Repository navigation
feat(cli): cloud render --json lists the files an upload leaves out - #7631
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
`cloud render --dry-run --json` now reports `left_out`: each file outside the
project that the upload leaves out, with the file that points at it, the
reference as written, its path from the project, the reason (blocklisted or
received) and how many folders above the project it is. A wrapper can ask
before uploading. A full `--json` run carries the same list in its result and
prints a `{"event":"left_out"}` line on stderr for each, beside the warning a
person reads.
Publish, cloud render and feedback's repro send `cli_upload_left_out` when an
upload leaves something out: counts and folder depths only, never a name or
a path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
98dd221 to
c5932b3
Compare
There was a problem hiding this comment.
Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head c5932b3d
The left_out contract matches what hyperframes-internal#10620 parses: same file/reference on the stderr event and the human warning, so Desktop's dedup key holds, and a null levels_up maps to null. CI is green on this head.
Scope
Read in full: leftOutReference.ts, uploadLeftOut.ts, the publishProject.ts wiring (all three leaveOut sites plus the symlink loop in stagePublishFiles), cloud/render.ts (dry run, --no-wait and waited JSON), and publish.ts/feedback.ts. Checked: no telemetry property carries a name or path; --json keeps stdout clean (warning and event both go to stderr, and NO_COLOR comes from Desktop); levels_up on another drive. cli_upload_left_out also fires for each Desktop weigh dry run, with dry_run: true, so upload counts need dry_run = false.
— Genesis reviewer
hyperframes cloud render --dry-run --jsonnow lists every outside file the upload would leave out, so a wrapper (HyperFrames Desktop first) can tell the person before anything uploads. A full--jsonrun reports the same list, and publish, cloud render and feedback count what they left out in telemetry.Builds on #7598 (merged); rebased onto
main. Refs #7598Claude Opus 5.5
Why
When an upload leaves out a file the composition points at (a private location, or an outside file reached from a file that came in with an imported project, #7598), the CLI prints a warning naming it. A wrapper that runs the CLI and shows only progress and failures, such as Desktop's cloud render, never shows that warning to the person: the render arrives without the file and nothing says so. The product rule is that a skipped reference is always named to the person, never dropped silently. The CLI had no way to tell a program which files it will leave out.
What changed
cloud render --dry-run --json. This is the CLI's existing "build and inspect the zip without uploading" pattern, and Desktop already runs it to weigh a project for the cloud. Itsarchivenow carriesleft_out:{ "file": "index.html", "reference": "../notes.txt", "path": "../notes.txt", "reason": "received", "levels_up": 1 }fileis the project file holding the reference (or the link itself, for a symlink),referenceis as written,pathis from the project folder (absolute only on another drive),reasonisblocklistedorreceived, andlevels_upis how many folders above the project it leads (nullon another drive).--json). The final JSON (--no-waitand waited) carries the sameleft_outlist. Each file also prints a{"event":"left_out",…}line on stderr as it is left out, beside the existing human warning. That line uses the same shape as the existingupload_progresslines, so stderr readers that only parseupload_progressare unaffected.onLeftOutinpublishProject.tsnow takes a second, structured argument (LeftOutReference, newutils/leftOutReference.ts). Existing one-argument callers still type-check. The warning text is unchanged.cli_upload_left_out, sent once per staging that left something out (newtelemetry/uploadLeftOut.ts, through the existingtrackEvent). Properties:command(publish/cloud_render/feedback),dry_run,left_out_count,received_count,blocklisted_count,max_levels_up,levels_up_1,levels_up_2,levels_up_3_plusandother_drive. Only counts and depths, never a file name, reference or path; a test checks this.docs/packages/cli.mdxdocumentsleft_outundercloud render.Scope notes
publishandfeedback --file-issuehave no--jsonor dry-run mode, so they keep the human warning and gain the telemetry. All three paths stage through the samestagePublishFilesrules, socloud render <dir> --dry-run --jsonanswers "what would be left out" for publish too. Desktop drives only cloud render: its feedback guard refuses--file-issue, and it never runspublish.publishProject.ts(1060 → 1069 lines) andcloud/render.ts(1140 → 1159) were already over 600 lines before this change. The new logic lives in new small files, and those two files only gained the wiring.Testing
render.leftOut.test.tsruns the real CLI withcloud render --dry-run --jsonon an imported project that has one received and one blocklisted outside reference. It checksarchive.left_out, one stderrleft_outevent per entry, and that the human warning is still printed.leftOutReference.test.tscovers the structured entry for a../../reference into a hidden folder (levels_up: 2), an absolute reference in a received file (path made relative to the project), and a symlink to a private file.uploadLeftOut.test.tscovers the event's counts and depth histogram, checks that no name or path appears in the properties, and checks that nothing is sent when nothing was left out.vitest runonsrc/commands/cloud,src/utils/publishProject*,publishProxyBake,publish,feedback, and the new tests: 222 passed. oxlint, oxfmt, typecheck, fallow audit andcomment-ratchet --base origin/mainall pass.🤖 Generated with Claude Code
— Rames Jusso