fix(editor): skip keyframe cache persistence when no workspace root (host-mounted) - #12
Conversation
…host-mounted) The decoder-prewarm worker's keyframes_extracted handler called updateMedia() unconditionally. updateMedia() goes through requireWorkspaceRoot(), which throws when the editor surface is host-mounted without <WorkspaceGate> (e.g. CodePress) — surfacing as an uncaught error on every decoded play/pause cycle. Gate the persistence call on getWorkspaceRoot(): host-mounted surfaces skip cross-session keyframe persistence while in-session registration (registerKeyframeIndex, keyframesSentForSrc) stays unconditional. Bump @quantfive/freecut-editor-surface to 0.3.1 (fail-soft fix; publish intentionally not done here).
|
@codepress /judge-verification can you judge this verification? Local VerificationPR Head SHA: Scope: FreeCut PR #12 (draft, base Diff Trigger Inventory
No CodePress-side changes in this PR; the CodePress bump is a separate follow-up lane. Verification Contract ResultsRe-run fresh at the head above by the manager (not just worker-reported), from the worktree Worker-reported at the same head (spot-verified consistent with the runs above): Inherited base failures (reproduced at base Post-verification captures: Overall: PASSThe D1 defect is fixed fail-soft with red/green-capable regression coverage (the no-root case throws before the fix by construction of |
|
👋 Hey @lightninglu10! Spawning a verification judge session to help with your request. View session |
|
Dispatched by judge-verification. This judgment is READY TO MERGE at the current head. If the PR is still a draft, transition it to ready for review now with the guarded readiness transaction: Verification Judgment — PR #12 (local)Verdict: ✅ READY TO MERGE PR Head SHA: Summary: The current PR head is safe to merge. The three-file diff gates only the cross-session Revision binding
Diff trigger inventory
Per-item
Overall status check
What stood up
|
|
Starting initial review of |
There was a problem hiding this comment.
Approved. The change cleanly treats workspace persistence as optional for host-mounted editor surfaces while preserving the in-session keyframe index used by preview/export behavior.
The two regression cases cover the relevant branches: no workspace root does not call storage or throw, and a configured root still calls updateMedia with the extracted timestamps. This is a cohesive patch-level fix with no actionable concerns found.
|
Review head |
Defect
@quantfive/freecut-editor-surface@0.3.0: the decoder-prewarm worker'skeyframes_extractedmessage handler (src/features/preview/utils/decoder-prewarm.ts) calledupdateMedia(mediaId, { keyframeTimestamps })unconditionally.updateMedia()goes throughrequireWorkspaceRoot()(src/infrastructure/storage/workspace-fs/root.ts), which throwsWorkspace root is not set...when the editor surface is host-mounted without<WorkspaceGate>— as CodePress mounts it. The throw escaped the Workeronmessagehandler on every play/pause cycle of decoded media (in dev, opening the blocking Next.js error overlay).In-session keyframe registration (
registerKeyframeIndex) was unaffected — only the workspace persistence path needs a root.Fix
Gate the persistence call on
getWorkspaceRoot()(already exported from the same module; returnsnullinstead of throwing): when no workspace root is set,updateMediais skipped.registerKeyframeIndexandkeyframesSentForSrc.addremain unconditional, so the export/edit overlay path keeps working in host-mounted sessions; only cross-session keyframe persistence is skipped there.Regression tests
Two new cases in
src/features/preview/utils/decoder-prewarm.test.ts:keyframes_extracteddoes not throw, still registers the in-session keyframe index, and never callsupdateMedia.updateMedia(mediaId, { keyframeTimestamps }).Version bump
@quantfive/freecut-editor-surface0.3.0 → 0.3.1 (patch: fail-soft behavior fix). Publish of 0.3.1 is intentionally not done in this PR — publishing stays manager/human-owned.Gate results (at head 18d0581)
npm run check(typecheck+lint, 2439 files): passnpm run lint: 1 error —typescript(TS2307)inpackages/freecut-editor/consumer-smoke.test.tsx(cannot resolve@quantfive/freecut-editor-surface). Inherited: reproduces identically at basefedfb2d6with changes stashed.decoder-prewarm.test.ts22/22 pass;src/infrastructure/storage158/158 pass (19 files)npm run build:editor-surface(package build): pass;npm run build(app build): passnpm run check:boundaries,check:legacy-lib-imports,check:changed-health(0 introduced dead_code/complexity/duplication): passnpm run verify:provenance(reproducible-package verify-only): passvp fmt --checkon changed files: pass (repo-wideformat:checkflags 169 pre-existing files, unchanged by this PR)