Repository navigation
fix(cli): cloud render no longer refuses a file only an unused page names - #7812
Conversation
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at 64ebc96
The ordinary unused-storyboard case is fixed, and the existing entry/loaded-composition missing-file cases still refuse. The outside-file localization and private-path decisions are unchanged in the diff and their focused tests pass.
Important — partial telemetry reachability is not proof that a page is unused (packages/cli/src/utils/publishProject.ts:699–704, packages/cli/src/utils/catalogUsage.ts:96–117). The reused walk intentionally skips reads and truncates discovery for telemetry. The new caller treats every omitted page as unused and disables its missing-media refusal. Three producer-backed probes reproduce this: a played page beyond the walk's file budget, a descendant reached through an archive-normalized Unicode filename, and a descendant mounted by a supported BOM-encoded page. In all three cases, the staged contents compile with the played page present, but staging allows that page's missing image instead of refusing. The per-file scan limit and unreadable ancestors need the same conservative treatment.
Fix: derive the played-page graph from the normalized staged contents that will actually render, with an explicit completeness result. Retain the previous strict missing-file enforcement when discovery is incomplete instead of converting unknown into unused. Cover the file/size limits, read failures, normalized-name descendants and the renderer's supported text encodings; keep the unused-page happy-path test.
Important — the new synchronous walk can block staging (packages/cli/src/utils/catalogUsage.ts:108, packages/cli/src/utils/publishProject.ts:699–704). Staging excludes non-regular inputs, but the new independent walk opens a referenced non-regular path with blocking readFileSync. A child-process probe reaches staging and then must be terminated at its deadline; the preceding implementation completes. Walk the already-staged regular buffers, or reuse the producer's nonblocking, regular-file-checked reader rather than adding a blocking filesystem pass.
Validation through the shared gate: frozen install/full bun run build passed. Missing-file, general publish staging, absolute/private/file-type guards, catalog usage, outside-reference and cloud-offload suites: 193 committed tests passed. 3 temporary staging/render parity probes fail (expected function to throw) after producer controls confirm the pages are consumed. A fourth probe times out inside staging after reaching the call. Restoring the previous staging function makes all four probes pass, while its unused-page happy-path test fails as expected. Temporary changes restored. No actual cloud upload/render or dev walkthrough performed.
Command: bun run --cwd packages/cli test src/utils/publishProject.missing.test.ts src/utils/publishProject.test.ts src/utils/publishProject.absolutePath.test.ts src/utils/publishProject.privateFiles.test.ts src/utils/publishProject.fileType.test.ts src/utils/catalogUsage.test.ts src/utils/leftOutReference.test.ts src/cloud/offload.test.ts --maxWorkers=1.
Need: yes · Size: focused refusal relaxation · Reuse: shared composition resolver and normalized staged file map · Simpler: one complete staged graph, conservative fallback when incomplete · Structure: fine (checked telemetry walker, staging normalization and the existing localization guards; the telemetry result needs a stronger contract for this caller)
Risk: medium — incomplete classification can upload a composition whose played media is missing, and a referenced non-regular input can hang staging.
Verdict: REQUEST CHANGES
Reasoning: The relaxation works for ordinary drafts, but suppresses required refusals for played pages and introduces an unbounded staging read.
— Rames
64ebc96 to
0e672e7
Compare
|
Both findings are fixed in 0e672e7 at the root: the walk no longer uses the telemetry walker or the disk. 1. Partial reachability treated as unused.
If any page the video loads is not staged as text, the walk returns
Each of those fails against 64ebc96 and passes now. The unused-page happy path is kept. 2. Blocking read. The walk reads only staged buffers. Staging already takes regular files only, so nothing new is opened. Test: "is refused on any page, without waiting, when the video loads a named pipe" hung at 64ebc96 until killed at 120 s. It now finishes in milliseconds and stays strict. A mutation (count an unstaged page as unused) turns exactly that test and the not-in-upload test red. The catalogUsage export is reverted. Runs are listed in the PR body. |
0e672e7 to
d03e471
Compare
|
Rebased on main 04202e8 as one commit, d03e471. The only conflict was an import line: main renamed Re-run on the rebased tree (Linux):
Not run: the full CLI tsc. Its only errors there come from |
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at d03e471c220b05572c9f5bcbfe08d6d130079513.
The earlier traversal and blocking-read findings are fixed. Discovery now walks normalized staged buffers, honors BOMs, has no telemetry file/size cutoff, and falls back to strict checks when a mounted page is absent. The three original producer-parity probes and the bounded named-pipe probe pass. Restoring the former traversal makes all four fail again, including the pipe timeout; treating an unstaged page as unused fails the two fallback tests.
Important — the selected cloud-render entry is ignored (missed in round 1). filmPagesOf (packages/cli/src/utils/publishProject.ts:710) starts at index.html, but cloud render --composition can select a different page. stageProjectFiles (packages/cli/src/commands/cloud/render.ts:754) calls staging before computing that selected entry. A valid index that does not mount alternate.html, plus an alternate page containing <img src="missing.png">, now passes cloud render --composition alternate.html --dry-run --json with exit 0 and a two-file archive. The actual selected page's missing media is classified as unused. Restoring strict missing-file enforcement rejects the same invocation with The composition references "missing.png", which is not in the project folder.
Pass the selected entry into staging/localization and seed discovery from it, retaining index.html as the default for publish callers. Add CLI-level tests for missing media on the alternate entry and for missing media on an index that the alternate entry does not play. Keep the incomplete-graph fallback and the repaired original cases.
Validation: frozen install and full bun run build passed. Seven focused staging/cloud test files: 194 tests passed, including seven temporary review controls (187 committed tests). Original traversal mutation: four review controls fail; strict-fallback mutation: two committed tests fail. The new alternate-entry CLI regression fails at head and passes with strict enforcement restored. Temporary source edits restored. No cloud upload/render, dev walkthrough or native Windows run.
Need: yes · Size: focused refusal relaxation · Reuse: staged graph and existing selected-entry contract · Simpler: thread the entry through the shared staging owner · Structure: fine (checked normalization, renderer resolver and cloud caller; no split)
Risk: medium — a selected render page can upload with missing required media.
Verdict: REQUEST_CHANGES
Reasoning: The repaired graph must start from the composition the cloud command will actually render.
— Rames
|
Fixed in f8ce7bf: the walk now starts from the page the cloud render will render.
Run on Linux:
Not run: the full CLI tsc, whose only errors there are from the unbuilt |
…ames The video's pages are walked from the staged upload, starting at index.html, with the renderer's resolver; when a page it loads is not staged text, every page stays strict.
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at f8ce7bf3c5869ceaef65eb5b4f172539fd82a2a2.
The selected-entry blocker is fixed on this branch: cloud staging computes the archive entry first and passes it through localization into graph discovery. Ordinary publish still defaults to index.html. The original alternate-entry CLI repro now refuses missing.png, while the new unused-index case succeeds.
Important — resolve the two integration conflicts before approval. Actual merge-tree against main e426ce4e conflicts in packages/cli/src/commands/cloud/render.ts and packages/cli/src/utils/publishProject.ts. Main uses the newly occupied argument positions for onOutsideFile; this branch uses them for entry. Preserve main's callback positions and append the entry argument:
stagePublishFiles(dir, limit, onLeftOut, onOutsideFile, entryPath);
localizeExternalAssets(dir, files, limit, onLeftOut, onOutsideFile, entry);Keep the default entry = "index.html" last in both signatures, preserve main's outside-file collection/reporting and publish forwarding, and retain one staging call after entryPath is calculated. Rerun both selected-entry CLI tests plus outside-file reporting tests on the resolved head. No additional behavior blocker found on the reviewed branch.
Validation: frozen install/full build passed. 34 tests pass across four files, including the original temporary CLI repro, both new CLI cases, missing-reference tests and publish tests. Removing the selected-entry argument makes both new CLI tests fail. Source restored. No upload/render, dev walkthrough or native Windows run.
Need: yes · Size: focused entry propagation · Reuse: shared staging graph and main's outside-file reporting · Simpler: preserve callback and append entry · Structure: fine (checked both call chains and conflicting signatures; no split)
Risk: medium — conflicting shared staging contracts must be integrated without dropping either behavior.
Verdict: REQUEST_CHANGES
Reasoning: The code fix passes; the unresolved shared-argument conflicts need a reviewed merge result.
— Rames
f8ce7bf to
c9fac43
Compare
|
Rebased on main e426ce4 at c9fac43. The conflict came from #7831, which adds an Re-run on the rebased tree (Linux):
Not run: the full CLI tsc, since the unbuilt inspector package is its only error source there. |
|
The integration conflict from the f8ce7bf review is resolved at c9fac43, in the shape you gave:
Re-run at c9fac43: both selected-entry CLI tests, |
jrusso1020
left a comment
There was a problem hiding this comment.
Reviewed at c9fac43b3e4f56d798b0701533a29e3f49981fa8.
The previous integration conflicts are resolved. Range-diff shows the two reviewed changes rebased onto main with its outside-file callback retained: stage argument 4 and localization argument 5 remain onOutsideFile, with entry appended as arguments 5/6. stageProjectFiles stages once, after computing entryPath. stageAndReport still collects and prints outside files; publish and feedback retain their index.html default and callback forwarding.
The selected-entry behavior remains correct: the original alternate.html CLI repro refuses missing.png, and an unused index.html with missing media does not block the alternate render. The earlier staged-buffer traversal and strict fallback remain intact. The automatic merge with main e426ce4 is clean.
Validation: frozen install and full build passed. Focused selected-entry, outside-file reporting, missing-reference and publish tests, including the original temporary CLI repro, passed on this head (40 tests across six files, one being the temporary reviewer repro). Commands: bun install --frozen-lockfile, bun run build, then bun run --cwd packages/cli test src/utils/review7812-entry.test.ts src/commands/cloud/render.missingEntry.test.ts src/commands/cloud/render.outsideFiles.test.ts src/utils/publishProject.outsideList.test.ts src/utils/publishProject.missing.test.ts src/commands/publish.test.ts --maxWorkers=1 through the shared gate; output: 6 passed, 40 passed. No upload/render, dev walkthrough or native Windows run.
Need: yes · Size: focused conflict resolution · Reuse: existing staging graph and outside-file callback · Simpler: preserve callback, append entry · Structure: fine (checked cloud stageAndReport and publish forwarding; no split)
Risk: medium — shared staging contract now carries both reporting and entry selection.
Verdict: APPROVE
Reasoning: The reviewed missing-file behavior and main's outside-file reporting survive together in the resolved tree.
— Rames
What
hyperframes cloud render(and--dry-run) no longer refuses a project because a page the video never plays names a missing file. The "The composition references "…", which is not in the project folder" refusal now fires forindex.htmland every composition it loads throughdata-composition-src. Other pages go up as they are. If the CLI can't be sure which pages the video plays, every page is checked, as before.Why
The upload staging checked every
.htmlin the folder. A storyboard page, an old draft or a notes page with an image or clip that was later deleted blocked the cloud render of a video that has every file it plays. Repro on 0.9.46: a project whoseindex.htmlplays a clip that exists, plusboards/storyboard.htmlcontaining<img src="stills/at-1.2s.png">with no such still.cloud render --dry-run --jsonexits 1 with the refusal.Related work
None.
How
filmPagesOfwalks the pages from the staged files the upload will contain, not from disk, starting atindex.html. Those staged files are regular files with archive-normalized (NFC) names, already in memory.decodeTextHonoringBom.collectSubCompositionSrcsand resolved withresolveCompositionSrc. That is the renderer's own resolver (htmlCompiler.tsresolveCompositionFile), which keeps<template>wraps and root-relative paths.null. Then every page's hard references (video[src],audio[src],img[src],video[poster]) stay required, which is the old behaviour. Unknown is never treated as unused.publishshares this path, so it gets the same rule.Test plan
packages/cli/src/utils/publishProject.missing.test.ts, 8 tests.packages/cli/src/utils/publishProject.missing.test.tsfails onorigin/main.catalogUsage12,publishProject75,.absolutePath46,.fileType8,.privateFiles7,.srcset6,cloud/offload41,offload.undecodableTrack2,commands/publish23,leftOutReference3,publishProxyBake10,submitFeedback11.publishProject.e2e.test.ts(its 2 tests skip on that box).tscthere only reports errors from the unbuilt@hyperframes/inspectorpackage, in files this PR does not touch.