The open creative studio on ComfyUI: images, video, 3D and audio on open weights, on your own GPU or the cloud. Camera motions, effects, apps, Cinema, Layers, Image to 3D and an AI agent.
TypeScript ai-videocomfyuicreative-toolsgenerative-aiideogramimage-generationimage-to-3dimage-to-videoltx-videominimax-h3nextjsopen-sourceopen-weightsqwen-imagetext-to-imagevideo-generationwan
Handoff: reports of the five packages merged on 11-01, and the queue without their finished stages
Claudef31680b6cb99
diff --git a/docs/handoff/queue.json b/docs/handoff/queue.jsonindex dacdb00e..a3b8d2f7 100644--- a/docs/handoff/queue.json+++ b/docs/handoff/queue.json@@ -62,222 +62,12 @@]},"wip": {- "n7-2-layout-mode": {- "branch": "o/n7-2-layout-mode",- "head": "492643b",- "base": "f7c6d8e, the old claude/fuobe-parity-4 head, which still carries the dropped acc-1 and acc-2",- "state": "5 signed commits (23 files, +1770/-24): every plan item in the brief is built, and the implement report in done.impl is accurate at the head. The review in done.review ran on this head and nothing was committed after it, so all 10 findings still apply. A read-only check found tsc clean (apart from Next's generated types) and the 13 related vitest files passing (210 tests). The fix stage is next.",- "next": [- "Before any stage runs, the main session moves the branch onto the rebuilt base, so it doesn't bring the dropped acc-1 and acc-2 back (docs/HANDOFF.md, 'Setting up a new session'): git rebase --onto claude/fuobe-parity-4 f7c6d8e o/n7-2-layout-mode moves only the package's own commits; resolve conflicts with main's 10-30 work, then git push --force-with-lease origin o/n7-2-layout-mode. If the base was fast-forwarded instead (main kept the acc commits and reverted them), merge the base into the branch. Expect conflicts (a test merge into PR #15's integration head on 10-30): src/components/studio/composer.tsx, src/components/studio/model-picker.tsx and src/lib/catalog/plan.ts; and from main's later account work (5e6a421, b5ca728) in src/server/generations.ts (accountRun, the Image to 3D finish) and src/server/providers/comfyui.ts (onOwnGpu). Keep both sides.",- "FIX (major) src/lib/catalog/payload.ts ~L1000 extractOutputs: fal's seed is recorded only inside `if (actualPrompt) {...}`, so cloud layout runs (MOSS with expansion off, FLUX.3, Ideogram) never store meta.seed, and Edit layout reopens without the seed. Fix: hoist `const seed = num(r.seed);` above the block and add `seed` to every image output's meta when it is a number (keep actualPrompt and width/height only when actualPrompt is set). Then change tests/layout-mode.test.ts L239 `expect(extractOutputs({ images: [...], seed: 3 }, \"t2i\")[0]).not.toHaveProperty(\"meta\")` to expect `meta: { seed: 3 }`, and re-run outputs/cloud-catalog tests in case other fal output fixtures change.",- "FIX (major) src/components/studio/studio-page.tsx LayoutHandoff (~L466-L495): `opened.current = value` is never reset, so a second Edit layout on the same picture does nothing, and the early return skips the ?layout= cleanup. Fix: in the `.finally(() => {...})` add `opened.current = null;` after `window.history.replaceState(...)`. Do not add `layout` to HANDOFF_PARAMS (composer.ts L720), because that would reset the draft epoch the comment says it must keep.",- "FIX (minor) tests/e2e/composer-flows.mjs ~L276-285: the 'Edit layout reopens the boxes' check cannot fail, because Reuse already left '1 box' in the strip. Before the menu click, press 'Layout off' and assert [data-layout-strip] is gone. Then Edit layout and assert '1 box'; then turn Layout off and use Edit layout again on the same tile (this covers the second-click bug). Also add a unit test for comfyProvider.poll copying meta.seed onto image outputs (comfyui.ts L1281/L1495), which no test covers.",- "FIX (minor) src/components/studio/composer.tsx ~L690: `boxModel = ... catalog.getModel(BOX_MODELS[model.engine])` ignores Settings → Models & licences. Fix: also require `catalog.offered(BOX_MODELS[model.engine], model.engine)` (catalog.tsx L55 exposes offered(id, engine?)); otherwise offer no 'Use MOSS-Image' link.",- "FIX (minor) src/components/studio/layout-editor.tsx onKeyDown (L293-L310): no keyboard resize, and focus is lost after Delete. Add Alt+Arrow (Shift for x10) to resize through resizedBox(box, ArrowLeft/Right→'e', ArrowUp/Down→'s', ±step), and after remove() focus the canvas element (tabIndex 0 at ~L429). Mention the keys in the editor hint.",- "FIX (minor) layout-editor.tsx L452 (box tab) and L594 (row chip): white text on #ff9f0a (about 2.1:1) and #34c759 (about 2.2:1) fails WCAG AA. Pick the ink by luminance (dark #1d1d1f on light colours, white otherwise) for KIND_COLOR and user-picked colours.",- "FIX (nit) src/lib/output-actions.ts editableLayout: `if (own) return ...` also returns a zero-box layout. Change it to `if (own?.items.length) return ...`.",- "FIX (nit) src/lib/catalog/plan.ts tier() / layoutCanvas: FLUX.3 '512sq'/'768sq' fall back to 'about 1360 × 768'. Map /^(\\d+)sq$/ to a square of that side. In composer.tsx push the layoutSizeWarning only when readsBoxes(model) (words models never place boxes).",- "FIX (nit) src/lib/layout-edit.ts MIN_BOX_PX = 16 is in render pixels, which is about 3 screen px on a phone. Give drawnBox a min parameter, and have layout-editor pass max(MIN_BOX_PX, 8 screen px converted to canvas px).",- "FIX (nit) layout-editor.tsx ~L377-L388: the aspect <select> filters out 'auto' but keeps value='auto', so it shows 21:9 over a square canvas. Either keep an 'Auto (square canvas)' option or use value '' with a disabled placeholder.",- "After the fixes: typecheck, lint, the layout/composer/outputs/plan vitest files, then node tests/e2e/composer-flows.mjs in demo mode, and a browser check at 1440/390 in light and dark for the editor changes. Merging after o/archive-restore conflicts in one place, the lucide import list in src/components/studio/result-actions.tsx; keep both LayoutDashboard and Palette."- ],- "risks": [- "Real MOSS-Image / FLUX.3 / Ideogram 4.5 renders are unverified: there was no GPU and no fal key, and everything ran on the mock provider in demo mode.",- "The implement report cites screenshots and a Playwright script under the old session's scratch folder (layout-check.mjs, shots/). They are gone in a fresh container, so don't look for them; re-run the browser check if you need evidence.",- "Fix 1 (seed on every fal image output) changes the stored meta for all fal image models, not only layouts. Expect fixture or snapshot assertions elsewhere to need updating, and decide whether meta.seed should go only on t2i/edit image ops.",- "The 16 px grid and 2048 limit for the open engine are constants in src/lib/layout-prompt.ts that mirror the moss-image-t2i manifest; a test pins them to the manifest. If the manifest limits change, update both.",- "Touch has no Shift key, so on phones you can't start a box on top of another box (Add box is the way round). This is a known gap, not a bug to fix in this package."- ]- },- "archive-restore": {- "branch": "o/archive-restore",- "head": "b84bc01",- "base": "f7c6d8e, the old claude/fuobe-parity-4 head, which still carries the dropped acc-1 and acc-2",- "state": "6 commits (64 files, +5032/-74) from an implement stage that stopped before it reported, so there is no done entry; the next implement run resumes from the branch. Built: both IC-LoRAs on record, the Hugging Face token setting (huggingfaceToken, in Settings -> LoRAs rather than Connections), the cloud route on fal's LTX-2.3 reference-video-to-video/lora, the tiled-fusion open graph (validated:false: the CPU ComfyUI has no ComfyUI-LTXVideo), /api/restore with its estimate and prompt writer, Video tools -> Restore & colourise, the result and Library menus, the Canvas node, Shorts and the Explainer, Assist/MCP restore_video, tests and an e2e script that was written but not run. Not built: Faceless, and Upscale's 'Restore archive footage first' (only a related link). Deinterlace is a one-field drop, not fieldmatch,yadif,decimate.",- "next": [- "Before any stage runs, the main session moves the branch onto the rebuilt base, so it doesn't bring the dropped acc-1 and acc-2 back (docs/HANDOFF.md, 'Setting up a new session'): git rebase --onto claude/fuobe-parity-4 f7c6d8e o/archive-restore moves only the package's own commits; resolve conflicts with main's 10-30 work (a test merge into PR #15's integration head on 10-30 conflicts in src/server/generations.ts and scripts/comfy/README.md; main's later account work, 5e6a421 and b5ca728, also changes src/server/generations.ts, src/server/providers/comfyui.ts, src/server/loras.ts and src/server/settings.ts, which this branch changes too: keep both sides), then git push --force-with-lease origin o/archive-restore. If the base was fast-forwarded instead (main kept the acc commits and reverted them), merge the base into the branch. Then the implement run's first job: its three routes (/api/restore, /api/restore/estimate, /api/restore/prompt) import handler from @/server/access/route, which went with acc-2: write them as plain route exports the way main's routes are, follow the PUBLIC SIGN-UP rule in the brief, and move the prompt writer's Ollama path onto src/server/llm. /api/restore reads an uploaded clip: for an account it goes through src/server/tenant.ts and account-inputs.ts like main's runs, or answers own-gpu-tool.",- "Fix the flaky test tests/restore-api.test.ts 'GPU: the windows chained by their prefix…'. It failed 2 of 4 runs here: batchOf (L46-49) sorts with `ORDER BY created_at, id`, pipeline steps share created_at, and ties fall to random nanoid order. Exact fix: change `ORDER BY created_at, id` to `ORDER BY rowid` in batchOf (generations is a rowid table).",- "Decide on and fix the gated-LoRA behaviour change in src/lib/catalog/loras.ts (`sendable` now accepts gated(l); fitLoras no longer leaves gated LoRAs out) and src/server/loras.ts prepareCloudLoras (it throws when there is no HF token). Before this branch, a cloud run carrying the gated LTX-2.3 Relight IC-LoRA or the LTX-2.5 Slow-Motion LoRA (Fuobe DoP preset 'motion-slow-motion', relight routes) ran without it, with a note. Now, for anyone without an HF token, the whole run fails at submit, and lorasFit for Replicate flips from true to false, which changes route choice. The test 'leaves a gated Hugging Face LoRA out of a cloud run with a note, never failing the run' was rewritten to match. Suggested fix: when there is no token, drop optional gated LoRAs with the old note; keep the hard refusal only for fuobe-restore's own adapter LoRA, and refuse that up front in src/server/restore.ts estimate/create on the cloud engine (it already pushes GATED_NOTE).",- "src/server/loras.ts mirrorCivitai hard-codes the licence snapshot `hosting: \"a gated Hugging Face file, downloaded once with your token; its licence allows hosted use (the research's snapshot)\"` for every gated file. That is true for the 4 gated entries today (all hostedOk:true), but build it from entry.hostedOk so a future gated LoRA isn't mislabelled. Also, the docblock `/** Test the civitai key (Settings → Save & test)… */` now sits orphaned above testHfToken's docblock; move it back above testCivitaiKey.",- "Placements still missing: Faceless (it takes no video uploads today, so either add an old-footage upload with the restore step or say in the report why it doesn't apply), and Upscale's 'Restore archive footage first' as an option that chains restore then upscale, rather than only the `related` link in src/lib/studios.ts VIDEO_UPSCALE_STUDIO. Or state in the report that the link was chosen.",- "Deinterlace is a one-field drop (restore-graph.ts: fieldHeight = height/2), not the card's fieldmatch,yadif,decimate. Either add an ffmpeg pre-pass (the open engine has ffmpeg-based steps) or record the deviation in the report.",- "Run the e2e: node tests/e2e/restore-flows.mjs against a demo-mode dev server, plus the browser check at 1440/390 in light and dark. The commit says it was written, but no run is reported. Then the full vitest suite, and write the implement report (which plan items were already on the base, what isn't verified). Then the review and fix stages.",- "GPU verification that can't happen here: the graph is validated:false (ComfyUI-LTXVideo missing on the CPU server; never install it from a package agent). GPU_NOTE says '24 GB GPU class, minutes per window', which the code itself marks as unmeasured. The cloud LoRA-mirror path to fal also needs a real fal key and HF token."- ],- "risks": [- "Without a token, the gated-LoRA change makes existing cloud runs fail (Fuobe DoP Slow motion / Relight on LTX-2.3): this is a regression outside the package's feature. Don't merge it unaddressed.",- "The flaky order assertion in tests/restore-api.test.ts will fail verify.sh about half the time until batchOf orders by rowid.",- "No implement report exists, so there is no claim that the e2e, browser checks or full suite passed. Treat commit 5's 'browser check' as a script that was written, not one that was run.",- "The open graph has never run, not even on CPU, because its pack nodes were replaced by stand-ins for validation. Tiled fusion, the prefix hand-off and the reference guide at frame_idx -1 are unproven.",- "Merging with o/n7-2-layout-mode has one trivial textual conflict (the lucide imports in src/components/studio/result-actions.tsx). generations.ts and output-actions.ts also change in both branches but merge cleanly."- ]- },"acc-3": "o/acc-3 on origin (head 3106848, one WIP commit for the old accounts lane) is dropped work: the owner's 10-30 decision drops the acc-* lane, so nothing builds on it. The owner may delete the branch (git push origin --delete o/acc-3). The next accounts work starts from a new plan around main's public sign-up.","idol-1": "Research 10 (2026-11-01): Idol is now hosted on fal (speridlabs/idol, since 2026-10-30), so this brief's \"no cloud half\" is out of date: check fal's endpoint and schema, and build the cloud route with what it supports (docs/research/new-models-10.md, section 5).","n7-3-regenerate-2k": "Research 10 (2026-11-01): ComfyUI core merged an H3 latent upscaler and a Sol-H3-VAE loader on 2026-10-28; check whether the installed ComfyUI has them before adding a latent-upscaler pack (docs/research/new-models-10.md, section 5).","blockout-film": "Research 10 (2026-11-01): fal hosts minimax/h3-max/3d-to-video, and SolarRenderer H3 LoRAs do the same task on the open engine; weigh them for both engines (docs/research/new-models-10.md, section 5)."},- "done": {- "n7-2-layout-mode": {- "impl": {- "branch": "o/n7-2-layout-mode",- "summary": "The Layout mode package is built, verified in demo mode and committed on o/n7-2-layout-mode, in /home/user/wt/o-n7-2-layout-mode. The tree is clean, all 5 commits are signed, and nothing was pushed then (the branch was later pushed to origin/o/n7-2-layout-mode at 492643b). I didn't verify real MOSS / FLUX.3 / Ideogram renders because there is no GPU and no fal key here.\n\nResuming the earlier attempt: its 3 commits were sound. But the working tree and index had the package's own changes to 15 files under src/ reverted and staged, dated 12:27, after the last commit. This looks like a check that was cut off mid-way. I restored those files from HEAD and kept the attempt's uncommitted test additions (a Reuse round trip in the unit tests and in the e2e script).\n\nThe base claude/fuobe-parity-4 had moved on since the branch was cut (cd9e5ff to f7c6d8e, which brings in acc-2 accounts and n7-6). I rebased the 3 commits onto it. The rebase had no conflicts and the commits were signed again. No pnpm-lock changes came with the new base.\n\nNew work in this session:\n- **Closing keeps your boxes:** the editor now keeps what was drawn when it is closed with Escape or by clicking outside it. Before, those boxes were lost, because the editor has no Cancel button.\n- **Shift (or Alt) drag draws over a box:** you can now draw a new box on top of another, such as a headline on a product. Before, any press on a box moved it, so you couldn't start a drag there.\n- **Nudges can be undone:** arrow-key nudges go into Undo; holding a key down counts as one step.\n- **Steady phone sheet:** the rows sheet at 390 px has a fixed height, so the canvas no longer shrinks under your finger when the first box is added.\n\nAlready on the base (from N7-1, reused, not rebuilt): src/lib/layout-prompt.ts (the neutral draft, the MOSS / FLUX.3 / Ideogram / VGL / plain-words compilers, decodeMoss, the Import parser, validateLayout, readsBoxes, carriesLayout). Also from N7-1: `options.layout` on the models and the `promptExpansion` setting. That setting switches the API's own prompt expansion off for moss-image, flux-3 and ideogram-4-5 whenever a request carries a layout.\n\nBuilt by the earlier attempt and checked now: everything the plan lists for N7-2.\n- **Composer:** `layout: true` in the Image studio and the StudioConfig flag; enterLayout / layoutRequest / leaveLayout plus withoutLayout for Reuse; the Layout chip, the strip and the Reuse path in the composer.\n- **Plan:** it compiles the draft at the size the model renders. On your GPU that is computeDimensions on a 16 px grid fitted to 2048, sent as width and height. On fal it is sizeValue clamped to 512-2048, sent as image_size. The browser's catalog keeps each route's size field so the composer prices the same canvas as the server.\n- **Server:** generations.ts never runs the prompt enhancer on a layout request.\n- **Edit layout:** fal outputs keep actual_prompt, seed and size, and ComfyUI pictures keep the seed they were drawn with. The Edit layout action and `/image?layout=<generation>` open the boxes with the same seed.\n- **Editor and picker:** the new layout-editor.tsx and its box maths in layout-edit.ts (built on layers.ts). The model list puts box-reading models first with a \"Reads boxes\" badge. Feed tiles say \"Layout · N boxes\".\n\nAccounts: the accounts core is on the base, but this package adds no routes, tables, jobs or paid calls. Edit layout reads results through the existing GET /api/generations/[id], which already goes through the accounts route handler. No migration was needed.",- "built": [- {- "feature": "Layout chip in the Image studio composer (StudioConfig.layout, IMAGE_STUDIO layout: true), strip above the prompt with box preview, Experimental badge, compiled-size line, Edit / Layout off with Undo; prompt becomes the summary caption; Enhance hidden",- "status": "done (earlier attempt), re-verified",- "verifiedHow": "tests/layout-mode.test.ts composer helper tests; tests/e2e/composer-flows.mjs section 7; my browser check at 1440/390, light and dark (screenshots)"- },- {- "feature": "Composer helpers enterLayout / layoutRequest / leaveLayout / withoutLayout, layoutShape, layoutModelNote, layoutSizeWarning, the 'Reads your boxes' group in groupModels",- "status": "done (earlier attempt)",- "verifiedHow": "vitest tests/layout-mode.test.ts"- },- {- "feature": "Plan compiles params.extra.layout at the exact render size: oss-moss-image on the 16 px grid with extra.width/height (fitted to 2048 as the ComfyUI provider fits it); fal moss-image image_size clamped to 512-2048 with the minimum respected; FLUX.3 / Ideogram 4.5 with their own compilers; other models get compileWords; a Text box without words is refused; enhancePrompt off",- "status": "done (earlier attempt)",- "verifiedHow": "vitest tests/layout-mode.test.ts (open 1360x768 and 2048x880; fal clamp 3000x300 -> 2048x512 and 300x300 -> 512x512; payload has enable_prompt_expansion false; the browser's catalog compiles the same)"- },- {- "feature": "Server never runs the prompt enhancer on a layout request (generations.ts submit)",- "status": "done (earlier attempt)",- "verifiedHow": "vitest tests/layout-mode-server.test.ts (demo mode, mock provider; enhancer mocked and never called for a layout, still called for a plain prompt)"- },- {- "feature": "Edit layout: an output action shown only when it can work (the request's own layout, or a fal MOSS actual_prompt decoded at the picture's own width and height); /image?layout=<id>[.<index>] opens Layout mode with the draft, caption, model and same seed; ComfyUI pictures keep the seed they were drawn with",- "status": "done (earlier attempt)",- "verifiedHow": "vitest tests/layout-mode.test.ts using the stored actual_prompt fixture tests/fixtures/moss-actual-prompt.json; e2e: Edit layout from a feed tile reopens the boxes (demo mode)"- },- {- "feature": "Reuse round trip (layout run comes back in Layout mode with boxes and caption, plans to the same prompt, size and seed)",- "status": "done; test changes committed this session",- "verifiedHow": "vitest Reuse test; e2e check 'Reuse brings the boxes and the caption back'"- },- {- "feature": "Layout editor (layout-editor.tsx): canvas in the chosen aspect ratio, drag to draw, numbered tabs, select / move / 8-handle resize, Delete, arrow-key nudge (Shift x10), the same spot cycles stacked boxes, Add box, Undo; rows with Object/Character/Text, what it looks like, exact words (inline error), optional colour; caption, canvas type Single/Panels/Collage, style tags; desktop rows beside the canvas, phone rows in a bottom sheet",- "status": "done (earlier attempt) plus fixes this session: closing keeps the boxes, Shift/Alt-drag draws over a box, nudges go into Undo, fixed-height phone sheet",- "verifiedHow": "My Playwright check (<the old session's scratch folder, gone>/layout-check.mjs): all checks pass at 1440 and 390 px, light and dark. Covered: drawing, moving and resizing by mouse and by touch; Shift-draw plus Undo; overlap cycling; nudge, Delete, Ctrl+Z; keyboard focus reaches every new control; the sheet folds; nothing scrolls sideways; labels fit; Escape keeps the boxes"- },- {- "feature": "Import / Export (browser only): import a Fuobe or LinXce draft, a compiled MOSS prompt read on the current canvas, a legacy scene prompt or CreateBoundingBoxes elements (paste or file); copy the compiled prompt, copy the draft JSON, download .json",- "status": "done (earlier attempt)",- "verifiedHow": "Browser check: CreateBoundingBoxes import (3 boxes), round trip through the copied compiled MOSS prompt (2 boxes, words kept), clipboard contents checked"- },- {- "feature": "Model list: box readers first with a 'Reads boxes' badge (cloud: FLUX.3, Ideogram 4.5, MOSS-Image; open: MOSS-Image); other models show 'This model reads the layout as words, not exact positions.' with a 'Use MOSS-Image' fix",- "status": "done (earlier attempt)",- "verifiedHow": "Browser: picker group contents on cloud and open; the words-model line on Nano Banana Pro"- },- {- "feature": "Warning past 2048 px a side or 4 MP, with the size the model renders instead; Experimental noted in the mode's hint, badge and strip; 'Free' price on the open engine",- "status": "done (earlier attempt)",- "verifiedHow": "Browser: oss-moss-image at 21:9 and 1.5K shows '2352 × 1008 is past 2048 px a side, so MOSS-Image renders 2048 × 880'; Generate shows Free"- },- {- "feature": "Feed tiles say 'Layout · N boxes'",- "status": "done (earlier attempt)",- "verifiedHow": "e2e 'the feed says it's a layout'"- }- ],- "tests": "- **Unit tests:** 64 test files that touch the changed modules (composer, plan, outputs, cloud catalog, comfy provider, moss-image, image studios, layout-mode and its server test, and others). 63 files and 1166 tests passed. The other file, tests/comfy-dbs.test.ts, failed to load: it imports scripts/comfy/build-library.mjs, which needs playwright-core, and scripts/comfy/node_modules is not installed in this worktree. That is a setup gap; this package doesn't touch that file.\n- **Typecheck:** `tsc --noEmit` is clean.\n- **Lint:** eslint is clean on every file the package changed.\n- **E2E:** `node tests/e2e/composer-flows.mjs` against `pnpm dev -p 3427` (FUOBE_DATA_DIR=/tmp/fuobe-o-n7-2-layout-mode-data, demo mode) passed fully, twice: all composer checks, including the 11 layout checks (draw, Text error, compiled-size strip, Generate sends the draft, feed label, compiled MOSS prompt, Reuse, Edit layout from a tile, touch draw at 390 px, sheet under the canvas, no sideways scroll).\n- **Browser check:** an extra Playwright check at 1440 and 390 px, light and dark, passed every check (about 70 checks and screenshots in <the old session's scratch folder, gone>/shots/: editor-*, strip-*, picker-*).\n- **Cleanup:** the dev server is stopped and .next is deleted.\n\nNo full suite and no pnpm build, as the stage rules say.",- "left": [- "Real MOSS-Image, FLUX.3 and Ideogram 4.5 renders, and how well they follow the boxes, are not verified: that needs a GPU (oss-moss-image on ComfyUI) or a fal key. Everything here was checked in demo mode with the mock provider.",- "Touch has no Shift key, so on phones a box can't be drawn starting on top of another one; the way round is 'Add box', then move and resize it. A long-press-to-draw gesture could be added later.",- "The size warning shows in the composer strip; the editor shows the canvas size but not the warning sentence itself.",- "On your GPU the canvas grid (16 px) and the 2048 limit come from constants in layout-prompt.ts that mirror the moss-image-t2i manifest limits; a test pins them to the manifest. A later change to the manifest limits would need those constants updated too.",- "Layouts in Canvas, Marketing, Ads and Assist (Plan layout) are package N7-8, not this one.",- "tests/comfy-dbs.test.ts can't load in this worktree until scripts/comfy dependencies (playwright-core 1.56.1) are installed. This is not about N7-2."- ],- "docsNotes": "For STATUS / ARCHITECTURE:\n- **The mode:** the Image studio has a Layout mode (chip next to Frames' place). Its draft rides as params.extra.layout. planGeneration compiles it once the render size is known: layoutCanvas, then the model's compiler (planLayout in src/lib/catalog/plan.ts).\n- **Sizes by engine:** on your GPU, exact width and height in extra on a 16 px grid, up to 2048 a side. On fal MOSS-Image, image_size equal to the canvas (512-2048) and enable_prompt_expansion false. FLUX.3 and Ideogram 4.5 use their own forms with expansion off; every other model gets plain sentences.\n- **No enhancer:** the server never runs Fuobe's prompt enhancer on a layout.\n- **Browser catalog:** slimModel now keeps a route's size field as route.preview.size, so the browser prices and compiles the same canvas as the server.\n- **Edit layout:** an output action, plus the /image?layout=<generation>[.<index>] hand-off. Its source is the request's own draft, or fal's actual_prompt decoded at the picture's size. fal MOSS outputs keep meta.actualPrompt, seed, width and height; ComfyUI image outputs keep meta.seed.\n- **Editor:** src/components/studio/layout-editor.tsx, with box maths in src/lib/layout-edit.ts (on layers.ts' rectFrom / resizeBox). Shift or Alt and drag draws over a box. Closing the editor keeps the boxes.\n- **No storage or route changes:** no migration, no new route, no new ComfyUI graph, no LoRA.\n- **Research:** no research corrections were needed."- },- "review": {- "findings": [- {- "file": "src/lib/catalog/payload.ts",- "line": 1003,- "severity": "major",- "summary": "Edit layout reopens cloud layout runs without the seed they were drawn with. extractOutputs records fal's `seed` only inside the `if (actualPrompt)` block. A layout run sends enable_prompt_expansion:false, and the research says fal returns actual_prompt only \"when expansion ran\". FLUX.3 and Ideogram 4.5 never return it. So no meta.seed is stored, and editableLayout falls back to the request's seed, which is normally unset. The plan says Edit layout opens \"with the draft and the same seed\". Separately, the fal provider sends seed+index per job, but the fallback hands every output the base seed.",- "failureScenario": "Image studio on the cloud (the default engine), MOSS-Image or FLUX.3, Layout mode, random seed, Generate, then Edit layout on the result. The toast says \"Layout opened\" with no seed, and the re-render uses a new random seed, so the whole picture changes instead of only the moved box. Verified with a scratch vitest probe: extractOutputs({images:[{url,width:1360,height:768}],seed:918273}) gives meta undefined, and editableLayout(...).seed is undefined. The repo's own test at tests/layout-mode.test.ts:239 asserts the same no-meta result.",- "verified": true- },- {- "file": "src/components/studio/studio-page.tsx",- "line": 473,- "severity": "major",- "summary": "Using Edit layout a second time on the same picture does nothing. LayoutHandoff keeps `opened.current = value` and never resets it, and it returns early when `opened.current === value`. `layout` is not in HANDOFF_PARAMS, so navigating to /image?layout=X does not bump the StudioProvider epoch, and the same LayoutHandoff instance (with its ref) survives. The early return also skips the `finally` cleanup, so ?layout=X stays in the address bar.",- "failureScenario": "In the Image studio: Edit layout on picture X, move boxes, Generate (result Y), then Edit layout on X again to try another variation from the original (or after turning Layout off). No fetch, no toast, nothing reopens until the page is reloaded. Opening a different picture in between makes X work again. Traced: handoffKey only keeps image/ref/video/audio/prompt/preset/model/format (composer.ts L720), and StudioProvider is keyed by start.epoch (studio-page.tsx L556).",- "verified": true- },- {- "file": "tests/e2e/composer-flows.mjs",- "line": 285,- "severity": "minor",- "summary": "The e2e check \"Edit layout reopens the boxes\" cannot fail. It runs right after the Reuse step, which already put the same 1-box layout in the strip. The `waitForFunction(() => !location.search.includes(\"layout=\"))` is already true before the menu click navigates, so it resolves at once. The check passes even if Edit layout does nothing, so it misses the second-click bug and does not check the seed. The ComfyUI change that copies meta.seed onto image outputs (comfyui.ts L1281 / L1495) has no test either.",- "failureScenario": "Break LayoutHandoff (for example, make it return early always). Section 7 still prints a pass for \"layout: Edit layout reopens the boxes\", because the strip shows \"1 box\" from Reuse. Verified by reading the sequence (Reuse check at L272-275, Edit layout check at L276-285). A grep of tests/ finds no test of comfyProvider.poll seed meta.",- "verified": true- },- {- "file": "src/components/studio/composer.tsx",- "line": 690,- "severity": "minor",- "summary": "The strip's \"Use MOSS-Image\" fix ignores Settings → Models & licences. boxModel comes from catalog.getModel(BOX_MODELS[engine]). getModel deliberately also finds models the admin switched off (catalog.tsx L85-L94), and the composer never checks catalog.offered() for it.",- "failureScenario": "An admin switches moss-image off. A user in Layout mode on Nano Banana Pro sees \"This model reads the layout as words… Use MOSS-Image\". Tapping it picks a model that is off, and the composer's offModel fallback (L331-332) moves straight back to the studio default. The suggested fix is a dead end. Traced in code.",- "verified": true- },- {- "file": "src/components/studio/layout-editor.tsx",- "line": 296,- "severity": "minor",- "summary": "Keyboard users cannot resize boxes. The 8 handles are aria-hidden spans driven only by pointer events, and onKeyDown handles only Ctrl+Z, Delete/Backspace and arrow-key nudges (nudgedBox). Add box always makes a box a third of each side, so a keyboard-only user is stuck at that size. Also, Delete on a focused box tab unmounts that tab and focus falls out of the canvas, so further arrow or Delete keys do nothing until the user tabs back in.",- "failureScenario": "Keyboard only: Tab to Add box and press Enter (a 1/3 × 1/3 box), Tab to its number tab, then try to make it a wide headline strip. There is no key that changes width or height. Verified by reading onKeyDown and the HANDLES markup (aria-hidden, no tabIndex).",- "verified": true- },- {- "file": "src/components/studio/layout-editor.tsx",- "line": 452,- "severity": "minor",- "summary": "Box number tabs (11 px) and row number chips (12 px) put white text on the kind colours: Text #ff9f0a about 2.1:1 and Character #34c759 about 2.2:1. Both fail WCAG AA in light and dark themes. Any colour the user picks (for example white or yellow) can make the number unreadable.",- "failureScenario": "Draw a box and set it to Text: its \"1\" tab is white on orange at 2.06:1 contrast. Computed from the sRGB relative luminance of the hex values in KIND_COLOR.",- "verified": true- },- {- "file": "src/lib/output-actions.ts",- "line": 250,- "severity": "nit",- "summary": "editableLayout returns the request's own layout even when it has zero boxes. A run made with Layout on but nothing drawn gets an Edit layout action that opens an empty canvas, while its feed tile has no \"Layout\" label.",- "failureScenario": "Turn Layout on, close the editor without drawing, type a prompt and Generate. The result menu offers Edit layout, which opens a blank layout. readLayout accepts items: [] and editableLayout has no items.length check on the `own` path.",- "verified": true- },- {- "file": "src/lib/catalog/plan.ts",- "line": 472,- "severity": "nit",- "summary": "The size line and warning for cloud models without a size field come from computeDimensions' tier table. FLUX.3's \"512sq\" and \"768sq\" are unknown tiers there and show as \"about 1360 × 768\". Words models also get the 2048/4 MP warning (\"Nano Banana Pro may place the boxes less exactly\") although they never place boxes by position.",- "failureScenario": "Probe: layoutCanvas(flux-3, 16:9, \"512sq\") returns 1360×768. With Nano Banana Pro at 2K the strip shows both the \"reads the layout as words\" line and the warning that it \"may place the boxes less exactly\".",- "verified": true- },- {- "file": "src/lib/layout-edit.ts",- "line": 14,- "severity": "nit",- "summary": "MIN_BOX_PX is measured in render pixels, not screen pixels. On a phone the canvas is drawn about 358 px wide, so for a 2048-wide render 16 px is about 2.8 screen px. A tap meant to deselect that drifts about 3 px in both directions draws a tiny box.",- "failureScenario": "390 px, oss-moss-image at 16:9 1.5K (2048×1152): tap empty canvas with slight finger drift, and a roughly 17×17 px box appears and is selected. rectFrom only rejects a side under `min` in render pixels.",- "verified": true- },- {- "file": "src/components/studio/layout-editor.tsx",- "line": 366,- "severity": "nit",- "summary": "The editor's aspect select drops \"auto\" from its options but keeps value=\"auto\". With Nano Banana Pro set to Auto, the select shows its first option (21:9) while the canvas is square (ratioOf(\"auto\") = 1).",- "failureScenario": "Nano Banana Pro, aspect Auto, Layout on: the header select reads 21:9 over a 1:1 canvas, and picking 21:9 fires no change because it already looks selected.",- "verified": true- }- ],- "checks": "Ran: vitest on tests/layout-mode.test.ts, tests/layout-mode-server.test.ts, tests/layout-prompt.test.ts and tests/moss-image.test.ts (4 files, 68 tests, all passed). `tsc --noEmit` reported no errors in package files. The only errors were Next's generated RouteContext/LayoutProps/PageProps globals, which are missing because .next was deleted, an environment gap. ESLint on every changed file: clean. Scratch vitest probes are in <the old session's scratch folder, gone>/n72review; nothing was written to the worktree. The probes covered: layout canvases for flux-3, ideogram-4-5, moss-image, oss-moss-image, nano-banana-pro and bria-fibo-2 at each tier; the Bria payload, which carries `vgl` as the research says; cloud MOSS with LoRAs keeping image_size; num_images=4 with expansion off; FLUX.3 and Ideogram edit routes with a layout; an empty caption with boxes; the Soul words path; and seed capture for fal responses without actual_prompt. Traced by reading: StudioProvider epoch and HANDOFF_PARAMS against LayoutHandoff; the engine-switch effect against the Edit layout engine change; the catalog access filter; ComfyUI seed meta; the server enhancer skip; stored request vs prompt column; and readLayout HEX colour sanitising (no CSS injection). No Higgsfield references, binaries, LoRA files or new models in the diff, so no licence data was needed. No new routes, tables or jobs, so nothing for the accounts core. All 5 commits carry gpgsig and the tree is clean.",- "verdict": "Most of the package is sound and does what the plan asks: the composer helpers, the plan compiling at the exact render size on both engines (16 px grid up to 2048 on the GPU, fal image_size kept within 512-2048), prompt expansion off and the server enhancer skipped for layouts, the browser catalog keeping the size field, Import / Export, the model list with box readers first, the feed label and the 390 px sheet. Fix two major Edit layout problems before merging. First, cloud layout runs (MOSS with expansion off, FLUX.3, Ideogram) never store fal's seed, so \"Edit layout with the same seed\" fails on the default engine whenever the seed was random. Second, reopening the same picture with Edit layout a second time in one Image studio session silently does nothing. The e2e check for Edit layout cannot fail as written, so it should be rewritten to start from a state with no layout. The rest are minor accessibility and polish items: no keyboard resize, low-contrast box numbers, and \"Use MOSS-Image\" offered when an admin has switched it off."- }- }- },+ "done": {},"packages": {"n7-2-layout-mode": {"title": "N7 2: Layout mode in the Image studio, Edit layout on results, Import and Export",diff --git a/docs/handoff/reports/archive-restore.json b/docs/handoff/reports/archive-restore.jsonnew file mode 100644index 00000000..6d02c1e0--- /dev/null+++ b/docs/handoff/reports/archive-restore.json@@ -0,0 +1,199 @@+{+ "key": "archive-restore",+ "impl": {+ "branch": "o/archive-restore",+ "summary": "Picked up the pushed branch (6 commits on f7c6d8e, only this package's own work) and merged claude/fuobe-parity-4 in twice, because the base moved during the session (4e51ffb, then bcfeb63). Conflicts were resolved keeping both sides in 14 files, including generations.ts (main's account checks plus the restore graph's LoRAs), gen-cloud-models.py (main's new Evolution plus the Restore model), the comfy README, library spec, install script, manifest and settings-form. The generated cloud-model and LoRA-library files match their generators. Then I finished the package. Its three routes are plain route exports again, following the public sign-up rules. Gated LoRAs behave as they did before the branch, except Restore's own adapter. The Hugging Face download token is now its own setting. The flaky test is fixed. Upscale's 'Restore archive footage first' now restores then upscales in one run. The GPU pre-flight board has a row for the tool, and the requirement index lists its graph. The e2e and the browser checks were run.",+ "built": [+ "Routes: /api/restore and /api/restore/prompt are plain POST exports. Guests and accounts get 403 own-gpu-tool from the proxy (with or without a GPU) because the tool plans with the studio's own AI helpers and chains its steps on the server. So no account run reads a file here, and tenant/account-inputs don't come into it. An account's single fuobe-restore run through POST /api/generations already goes through main's checks (accountRun, checkAccountLoras sees the graph's gated LoRA). /api/restore/estimate is in ESTIMATES and runs through priceAs: a visitor is priced on its own GPU, never as a demo.",+ "The page shows SelfHostNote, 'Self-hosted only' pricing and disabled inputs to visitors, the way Evolution does.",+ "The prompt writer uses src/server/llm (probeLocal, localWhat, localLabel). It answers with by 'local' instead of 'ollama', and the UI says 'a local model' and 'Settings → AI helper'. Frames are capped at 900 KB each (4 at most), so the body stays under the proxy's 4 MB.",+ "Hugging Face download token: main already had huggingfaceToken (Assist's Hugging Face Inference Providers key) on the same stored key, which made a duplicate settings entry. The download token is now its own setting: huggingfaceDownloadToken, stored as huggingface.downloadToken, env FUOBE_HF_DOWNLOAD_TOKEN. It is not HF_TOKEN, because main's llm-registry test forbids that variable. It sits in Settings → LoRAs as 'Hugging Face token for downloads', masked, with Save & test; the e2e confirmed the field is a password field.",+ "Gated LoRAs: LoraRef.adapter is new. Optional gated LoRAs (Relight, DoP's Slow motion) are left out of cloud runs with the old note again, whether or not a token is set, and lorasFit counts them as before. Only fuobe-restore's own IC-LoRA (adapter: true) is sent to the cloud, as Fuobe's copy made with the token. createRestore refuses a paid cloud run with a 422 before anything starts when there is no token; placeholder runs don't need one.",+ "mirrorCivitai builds its hosting note from the LoRA's hostedOk (gatedHosting), and the orphaned testCivitaiKey docblock is back in place.",+ "Upscale → Video: the static `related` link became UPSCALE_FIRST_STEPS in src/lib/catalog/upscale-first.ts (StudioConfig.firstSteps, drawn by studio-page.tsx with a visible hint), so n7-3 can add its row there. 'Restore archive footage first' opens Restore & colourise with ?then=upscale. That turns on a new 'Then upscale' switch: planRestore's thenUpscale adds an upscale-video step after the sound is put back (SeedVR2 on the GPU, Topaz Video in the cloud, both to 2160p). The upscaled clip is the run's one result, and its price is included in the estimate. Restore to 4K and Then upscale can't both be on.",+ "GPU pre-flight: a STUDIO_ROWS row for /video-tools/restore covering the restore graph, oss-join-clips, oss-mux and the gated Restore LoRA. ComfyUI-LTXVideo is pinned in workflows/comfyui/packs.json at 220e1d45 (registry id ComfyUI-LTXVideo, taken from its pyproject name; the registry API gave no answer). build-requirements.mjs now includes video-restore-ltx25-tiled in requirements.json.",+ "Flaky test: batchOf in tests/restore-api.test.ts now orders by rowid.",+ "Tests: new tests/restore-signup.test.ts (proxy answers for guests, accounts and the owner; visitor pricing; the 4 MB body; the board row). Also extended restore, restore-api, public-signup and lora-fetch, and adjusted gpu-requirements (gated set; budget raised from 25 to 26 KB gzipped, from 24.8 KB before this graph) and settings-links (now reads lora-settings.tsx anchors). The e2e script gained the Upscale-to-Restore chain checks."+ ],+ "tests": "tsc clean, and eslint clean on every changed file. Targeted vitest (--maxWorkers=2) after the second base merge: 35 files, 603 tests passed (restore*, public-signup*, lora-fetch, fal-lora, gpu-*, comfy-library-4, settings-*, llm-*, canvas*, eval-harness, request-body-limits and others). The full suite was not run. tests/e2e/restore-flows.mjs ran against a placeholder-mode dev server (FUOBE_DEMO_MODE=on; demo mode now defaults to off on main) and all checks passed, twice, the second time after the second merge. That covers the GPU and cloud flows, the placeholder run with its Before/After wipe, Upscale → Restore with Then upscale on, the masked token, Shorts and the Explainer offering the restore step, and 6 pages at 1440 and 390 px in light and dark on both engines with no sideways scroll. I also looked at the 390 px dark screenshot. ComfyUI: validate-workflows on the live CPU server still fails with missing_node_type for the ComfyUI-LTXVideo nodes (expected; I reverted its object_info and validation-state rewrites, which were only noise).",+ "left": [+ "Faceless gets no old-footage upload. Faceless takes only scripts (text) and reference images, and generates every shot itself, so offering a restore step would mean a new clip-upload path in its episode plan. I left that out; Shorts and the Explainer have the step.",+ "Deinterlace still drops one field (fieldHeight = height/2, nearest rows) instead of the card's fieldmatch,yadif,decimate. ComfyUI has no such nodes, and the Fuobe server runs no ffmpeg pre-pass for the open engine. The UI note says so.",+ "Never run on a GPU: the graph is validated:false because the CPU ComfyUI lacks ComfyUI-LTXVideo. Tiled fusion, the 17-frame prefix hand-off, the reference at frame_idx -1 and Restore to 4K are unproven. GPU_NOTE ('24 GB class, minutes per window') is unmeasured.",+ "Needs real keys: the cloud route (fal LTX-2.3 reference-video-to-video/lora with the mirrored gated LoRA), the token download (HF token plus accepted licence), and Then upscale on Topaz Video.",+ "model-pins.json has no pins for the two gated LoRA files: their sha256 can't be read without a token. The library entries carry their sizes and pinned revisions.",+ "Optional gated LoRAs no longer go to the cloud even when a token is set. That is a deliberate return to the pre-branch behaviour; extending it is a later choice.",+ "Assist/MCP restore_video has no 'then upscale' argument.",+ "Needs a GPU ComfyUI with ComfyUI-LTXVideo, a real fal key and a Hugging Face token with the gated licences accepted (not blocking)."+ ],+ "docsNotes": [+ "docs/public-signup.md: add Restore & colourise to the own-gpu-tool list (POST /api/restore, /api/restore/prompt) and /api/restore/estimate to the price checks.",+ "Settings docs: Settings → LoRAs has 'Hugging Face token for downloads' (FUOBE_HF_DOWNLOAD_TOKEN), separate from Assist's Hugging Face key (FUOBE_HF_TOKEN). It is only for gated LoRAs (Lightricks' Restore and Detail Refine IC-LoRAs), and a cloud run gets Fuobe's copy, never the token.",+ "FEATURES / STATUS: Video tools → Restore & colourise (both engines; GPU tiled LTX-2.5 with Restore to 4K, deinterlace and reference; cloud LTX-2.3 untiled at 720p or 1080p). Upscale → Video's 'Restore archive footage first' runs restore then upscale in one job. Restore entries are in the Library and feed menus, a Canvas Restore node, the Shorts and Explainer old-footage offer, and Assist/MCP restore_video.",+ "ARCHITECTURE: LoraRef.adapter (a model's own gated adapter, the only gated LoRA that goes to the cloud) and src/lib/catalog/upscale-first.ts (Upscale's list of first steps; n7-3 adds its Regenerate in 2K row there).",+ "Where the brief was out of date: it says the token goes in 'Settings → Connections', but there is no such section; it lives in Settings → LoRAs. The brief's HF token env would have clashed with main's HF_TOKEN rule. The brief's assumption that this branch's acc-2 handler() exists in the base was already noted in the WIP. Demo mode now defaults to off, so the e2e needs FUOBE_DEMO_MODE=on.",+ "scripts/comfy/README.md has the Restore section next to main's Round 5 section (both kept)."+ ],+ "blocked": ""+ },+ "review": {+ "findings": [+ {+ "severity": "high",+ "title": "The full Vitest suite fails: 3 tests in 2 files, all caused by this branch",+ "detail": "Full run (FUOBE_ACCOUNT_DISK_FREE_GB=1, --maxWorkers=2): 285 files, 4541 tests, 3 failed, 4535 passed, 3 skipped. Both test files are the same as on base claude/fuobe-parity-4. (1) tests/comfy-library-notes.test.ts, 'video-restore-ltx25-tiled reads as a public note' and 'the spec's notes are as clean as the manifest's': the graph's notes end 'Not validated here: the pack is not installed on this server.' (scripts/comfy/library.spec.mjs:2823, copied into workflows/comfyui/manifest.json), and 'on this server' is one of the INTERNAL patterns the test bans. (2) tests/model-access-listings.test.ts:100 expects list.loras.length 174 and gets 176, because the branch adds two LoRAs (Restore and Detail Refine). The targeted list in the implementer's report left out both files. Running only these two files fails the same way every time.",+ "verified": "Full suite run and a rerun of the two files; git diff of both test files against base is empty",+ "files": [+ "/home/user/wt/o-archive-restore/scripts/comfy/library.spec.mjs",+ "/home/user/wt/o-archive-restore/workflows/comfyui/manifest.json",+ "/home/user/wt/o-archive-restore/tests/model-access-listings.test.ts"+ ]+ },+ {+ "severity": "medium",+ "title": "Cloud engine: the reference picture is silently dropped from the Restore pipeline",+ "detail": "planRestore's cloud branch (src/lib/catalog/restore.ts, about lines 467-520) never reads input.reference. No piece gets inputs.images: piece 0 has no image at all, and later pieces get only the hand-off frame. The UI still offers it: the 'First frame in colour (optional)' slot and the hint 'The cloud uses a picture as the clip's first frame'. src/server/restore.ts planInput adds the estimate note 'In the cloud your picture is the first frame', and the Assist/MCP restore_video description says the same, so the user is told their picture is used when it isn't. The open branch does pass it (inputs.images on every window). Probe: planRestore({engine:'cloud', ..., reference:'/api/files/ref.png'}) gives steps cut0 / restore0 (and hand1 / restore1 / join) with no images on restore0. No test covers a cloud reference.",+ "verified": "Probe test run against the branch's code (vitest with a scratch config; no edits to the worktree)",+ "files": [+ "/home/user/wt/o-archive-restore/src/lib/catalog/restore.ts",+ "/home/user/wt/o-archive-restore/src/server/restore.ts",+ "/home/user/wt/o-archive-restore/src/components/restore/restore-tool.tsx"+ ]+ },+ {+ "severity": "low",+ "title": "routeLoras gives the wrong reason for optional gated LoRAs (regression from removing the gated line in plan.ts)",+ "detail": "The branch removed `if (gated(l) && !l.hostedUrl) return \"it is in a gated Hugging Face repo, so it runs only on your GPU\"` from routeLoras' why() in src/lib/catalog/plan.ts. An optional gated LoRA left off a cloud route (Relight, DoP's Slow motion) now falls through to 'no URL to send to the LoRA endpoint'. previewGeneration returns that in loras.dropped, which the evaluation harness records. Probe: routeLoras(fuobe-restore's fal route, [ltx-2-5-22b-lora-slow-motion-control]) gives dropped reason 'no URL to send to the LoRA endpoint'. This contradicts the report's 'gated LoRAs behave as before'. fitLoras' user-facing note is unchanged and correct. A fix is to keep the line with `&& !l.adapter`.",+ "verified": "Probe test",+ "files": [+ "/home/user/wt/o-archive-restore/src/lib/catalog/plan.ts"+ ]+ },+ {+ "severity": "low",+ "title": "Requirement index: the gzip budget raise is justified, but the raw 200 KB budget is now 99.8% full",+ "detail": "requirements.json on base: 202,120 B raw, 25,466 B gzipped (24.87 KB). On the branch: 204,422 B raw, 25,880 B gzipped (25.27 KB). This graph and its pack push gzip past the 25 KB limit, so raising it to 26 KB is a small, documented and warranted change. The raw limit (200*1024 = 204,800 B) was left alone and has only 378 B left, so the next graph (n7-3-regenerate-2k is queued against the same index) will fail it. Raise or rethink both limits together, deliberately. The gated-set regex change in the same test is correct: both IC-LoRA repos really are gated.",+ "verified": "Measured with zlib on git show of both refs",+ "files": [+ "/home/user/wt/o-archive-restore/tests/gpu-requirements.test.ts",+ "/home/user/wt/o-archive-restore/workflows/comfyui/requirements.json"+ ]+ },+ {+ "severity": "low",+ "title": "GPU pre-flight row checks a different join graph from the one the pipeline runs",+ "detail": "The STUDIO_ROWS row for /video-tools/restore lists REMOVE_TOOLS.open.join = oss-join-clips (video-concat-{n}: BatchImagesNode/CreateVideo/ImageScale). planRestore joins windows with oss-join-encoded (video-concat-encoded: ConcatenateVideo). On a ComfyUI without ConcatenateVideo the board could say Ready while a multi-window run fails at the join. tests/restore-signup.test.ts only checks that the listed workflows exist.",+ "verified": "Read src/server/gpu/tools.ts, src/lib/catalog/restore.ts joinEncoded and requirements.json",+ "files": [+ "/home/user/wt/o-archive-restore/src/server/gpu/tools.ts"+ ]+ },+ {+ "severity": "low",+ "title": "Visitor estimates reveal the owner's token state and show an owner-only instruction",+ "detail": "POST /api/restore/estimate is open to guests and accounts (ESTIMATES, priceAs). It returns hfToken: hasHfToken(), which says whether the install owner has set a Hugging Face download token. When none is set it adds GATED_NOTE ('add your Hugging Face token in Settings → LoRAs'), which a visitor can't do; Fuobe never downloads onto an account's GPU anyway. The token itself never leaves the server. This is a boolean leak plus a misleading note: give a visitor's estimate hfToken true (or leave it out) and drop the note under tenant().",+ "verified": "Read src/server/restore.ts estimateRestore/planInput and src/lib/guest-access.ts",+ "files": [+ "/home/user/wt/o-archive-restore/src/server/restore.ts"+ ]+ },+ {+ "severity": "low",+ "title": "Cloud run refused without a token even when Fuobe already holds a copy; the setup panel nags on the GPU when the file is already there",+ "detail": "createRestore throws 422 on any paid cloud run when !hasHfToken(). It doesn't check that prepareCloudLoras would use a cached fal copy (getCopy within the TTL) or a pinned local file (mirrorCivitai's sha-checked local lookup). An owner who mirrored once and then removed the token is blocked for no reason. On the open engine, the 'One-time setup: the Restore IC-LoRA is gated' panel shows whenever no token is set, even if the LoRA file is already in ComfyUI's loras folder.",+ "verified": "Read src/server/restore.ts createRestore, src/server/loras.ts prepareCloudLoras/mirrorCivitai and restore-tool.tsx",+ "files": [+ "/home/user/wt/o-archive-restore/src/server/restore.ts",+ "/home/user/wt/o-archive-restore/src/components/restore/restore-tool.tsx"+ ]+ },+ {+ "severity": "low",+ "title": "Mirroring the 1.7 GB LoRA holds the whole file in memory twice",+ "detail": "mirrorCivitai reads the file with fs.readFileSync (1.71 GB), and fal's prepareFile wraps it in new Uint8Array(data), which copies it into the File. Peak memory is about 3.4 GB or more on the Next server. The pattern already existed for civitai LoRAs, but this is the first adapter this large. Not verified live: it needs real fal keys.",+ "verified": "Read only",+ "files": [+ "/home/user/wt/o-archive-restore/src/server/loras.ts",+ "/home/user/wt/o-archive-restore/src/server/providers/fal.ts"+ ]+ },+ {+ "severity": "low",+ "title": "Weak tests around the new paths",+ "detail": "In lora-fetch's 'with the token' case, only the refusal on a hash mismatch is tested. The success path (copied once, recorded with the gatedHosting licence note, hostedUrl in the payload, the cache reused on the next run) and createRestore's 422 without a token on a real (non-placeholder) cloud plan aren't covered. No test checks the cloud reference (finding 2). The 3 suite failures show that the targeted test list missed affected files.",+ "verified": "Read tests/lora-fetch.test.ts, tests/restore*.test.ts",+ "files": [+ "/home/user/wt/o-archive-restore/tests/lora-fetch.test.ts",+ "/home/user/wt/o-archive-restore/tests/restore.test.ts"+ ]+ },+ {+ "severity": "nit",+ "title": "Pins and sizes of the gated LoRAs",+ "detail": "The report says model-pins.json has no pins because the sha256 can't be read without a token. But lora-library.generated.ts has both files' sha256 and exact sizes (1,711,643,914 and 1,308,787,534 B), while requirements.json carries rounded sizes (1.71e9 and 1.31e9).",+ "verified": "Read the generated files",+ "files": [+ "/home/user/wt/o-archive-restore/src/lib/catalog/lora-library.generated.ts",+ "/home/user/wt/o-archive-restore/workflows/comfyui/requirements.json"+ ]+ }+ ],+ "checks": [+ "Full Vitest (FUOBE_ACCOUNT_DISK_FREE_GB=1, --maxWorkers=2): 285 files, 4541 tests; 3 failed (comfy-library-notes x2, model-access-listings x1), 4535 passed, 3 skipped. The failures are deterministic and caused by this branch.",+ "tsc --noEmit: clean apart from the global LayoutProps/PageProps/RouteContext types that `next typegen` generates (no .next in the worktree); none in branch code. eslint on changed files: 0 errors, 1 warning that is already on base (WAN_NEG_EN).",+ "huggingfaceDownloadToken: secret: true (masked by publicSettings). /api/settings, /api/providers/test and /api/loras writes are OWNER_WRITES; /api/loras GET is closed to guests. The token goes only as an Authorization header to the library entry's huggingface.co URL (taken from the library, not the request, so no SSRF). A local two-origin test on Node 22.23 confirmed that fetch drops Authorization on a cross-origin redirect. hfFacts uses redirect: manual; redact() masks the token; the copy record's sourceUrl has no token; fal receives only the mirrored hostedUrl. It is separate from huggingfaceToken and HF_TOKEN.",+ "Gated LoRAs in the cloud: fitLoras still leaves out optional gated LoRAs (Relight, Slow motion) with the old note, with or without a token (lora-fetch test). Only the adapter: true Restore LoRA is sent, through the mirror. In tenant() it is refused rather than sent. Accounts' own-ComfyUI runs skip the download and go through checkAccountLoras with restoreGraphLoras.",+ "settings-links test change is justified: restore-tool links /settings#huggingface; ConnectField id='huggingface' renders as the wrapper div's id in lora-settings.tsx, which the anchor set didn't read before; its labels sit under Settings → LoRAs.",+ "gpu-requirements: the gated regex is correct (both IC-LoRA repos are gated). The gzip budget raise 25→26 KB is justified (24.87→25.27 KB), but the raw budget has 378 B left (finding 4).",+ "Fetched fal's live OpenAPI for fal-ai/ltx-2.3-22b/reference-video-to-video/lora: video_url, image_url, negative_prompt, num_frames, fps, seed, video_size {width,height}, loras[{path,scale,weight_name}] (required), ic_lora_type none, preprocessor none, enable_prompt_expansion, generate_audio, match_video_length and match_input_fps all exist, so the generated FieldMap matches.",+ "Checked the restore graph against the live CPU ComfyUI's /object_info: every core node's inputs match (the only misses are combo file lists and SaveVideo's dynamic format.codec). The three ComfyUI-LTXVideo nodes are missing there, as expected. Fetched the pinned pack (220e1d45) as data: the input names of LTXAddVideoICLoRAGuide, LTXICLoRALoaderModelOnly and LTXVTiledFusionSampler match the graph, and the guide's tile_frames is 97, same as the sampler's when streaming. The pack's LICENSE is the LTX-2 Community License, matching licences.ts. Its network code (gemma_api_conditioning) is a node this graph doesn't use. Nothing installed and no restart.",+ "Public sign-up: /api/restore and /api/restore/prompt aren't in accountMayChange, so guests and accounts get own-gpu-tool. /api/restore/estimate is in ESTIMATES and goes through priceAs. tests/public-signup and restore-signup pass.",+ "No LoRA files, Higgsfield media or binaries committed; no Higgsfield API use. Licences are recorded for both IC-LoRAs (library), the cloud model, the manifest entry and the node pack.",+ "Hand-built and workflows/ copies of the graph match apart from formatting, and validation-state's sha256 matches the workflow file. SeedVR2's chunked graph keeps audio, so Then upscale on the GPU keeps the restored sound.",+ "Did not rerun the browser e2e at 1440 and 390 px (the implementer reports two passes). Did not touch /home/user/Fuobe."+ ],+ "verdict": "changes requested: fix the 3 failing tests (reword the graph note without 'on this server' and update the LoRA count to 176), pass the cloud reference picture to piece 0 (or remove the cloud reference UI, note and Assist text), and restore the gated reason in routeLoras. The low findings can follow. The token handling and the gated-LoRA cloud behaviour are sound."+ },+ "fix": {+ "applied": [+ "Merged claude/fuobe-parity-4 at 2c72d369, which includes o/dbs-d2 (Remove dialogue), into o/archive-restore as merge commit e2641d36. One conflict, a docblock in src/components/studio/mode-switch-studio.tsx: kept both Remove dialogue and Restore & colourise. origin/claude/fuobe-parity-4 has since moved to that same 2c72d369, so the branch is up to date with it.",+ "Finding 1 (3 failing tests): the video-restore-ltx25-tiled note no longer ends with 'Not validated here: the pack is not installed on this server' (changed in scripts/comfy/library.spec.mjs and workflows/comfyui/manifest.json together; the rebuilt requirements.json is byte-identical). tests/model-access-listings.test.ts now expects 176 LoRAs, with a comment naming the two IC-LoRAs.",+ "Finding 2 (cloud reference): planRestore's cloud branch now sends input.reference as images[0] on piece 0, which fal sends as image_url. A single whole piece gets the video and the image. A cut piece gets the image, and the cut arrives through the chain. Later pieces still start from the hand-off frame. New test in tests/restore.test.ts covers the multi-piece case (including withChainInputs merging the chained cut beside the picture), the whole-clip case, and no reference. The existing fal payload test already checks that images[0] maps to image_url.",+ "Finding 3 (routeLoras reason): the gated line is back in src/lib/catalog/plan.ts as `gated(l) && !l.hostedUrl && !l.adapter`. New test in tests/eval-api.test.ts: on the reference-video-to-video/lora route, DoP's Slow-motion LoRA is dropped with the gated reason and Restore's adapter is applied.",+ "Finding 4 (requirement-index budget): raised, not shrunk. tests/gpu-requirements.test.ts now allows 216 KB raw and 27 KB gzipped, with a comment explaining why: this graph took the index from 202.1 to 204.4 KB (24.9 to 25.3 KB gzipped), and each graph adds about 1-2.5 KB raw and 0.2-0.5 KB gzipped, so the next few graphs, n7-3's among them, now fit. I raised both limits together, as the review advised, because 26 KB gzipped had only 0.7 KB left. The index is already compact JSON, so shrinking it would mean a format change for its readers.",+ "Finding 5 (pre-flight join): the STUDIO_ROWS row for /video-tools/restore now lists RESTORE_OPEN_JOIN (oss-join-encoded, newly exported from src/lib/catalog/restore.ts and used by joinEncoded) instead of oss-join-clips. tests/restore-signup.test.ts builds a multi-window GPU plan with sound and checks that the row's workflows are exactly the ones that plan uses, including video-concat-encoded.",+ "Finding 6 (visitor estimate): under tenant() (a guest or an account priced through priceAs), the estimate leaves out the token-state field and does not add GATED_NOTE. The field is renamed from hfToken to an optional loraReady (src/server/restore.ts, src/components/restore/hooks.ts). The setup panel shows only when loraReady === false. New test: neither a guest nor an account sees loraReady or the gated or Settings → LoRAs note; the owner with no token sees loraReady false and the note.",+ "Finding 7 (cloud refusal and GPU nag): new gatedFileReady(file, target) in src/server/loras.ts. It counts as ready when there is a token, or a live copy on the provider within its TTL (cloud only), or the file in ComfyUI's LoRA folder (and, for the cloud, Fuobe's cache) at its pinned size. Size stands in for the hash so an estimate doesn't hash 1.7 GB; mirrorCivitai still checks the hash before sending. createRestore now refuses a paid cloud run with 422 only when no usable copy exists. On the GPU, the estimate's loraReady and the setup panel check the folder, and with Restore to 4K on they check the Detail Refine file too.",+ "Finding 9 (missing tests): tests/lora-fetch.test.ts has a new success path, using the Detail Refine IC-LoRA pinned to a small stand-in as an adapter. With the token it is downloaded once (the token is never in a URL), copied to fal, and recorded with its sha256, size, sourceUrl and the gatedHosting note 'its licence allows hosted use'. A second run without the token reuses the copy with no network call. gatedFileReady is checked for fal and replicate, with and without the cache. tests/restore-api.test.ts has a new readiness test: with no token, a live fal copy lets the run through the 422 guard (it is stopped at a mocked createPipeline, so nothing is submitted), an expired copy is not ready, and a file in the LoRA folder at its pinned size is ready on both engines (a sparse file, so nothing is written). Restore to 4K without the refine file is not ready, and a file of the wrong size is not. The existing 422 test without a token on a real (fal key, non-placeholder) cloud plan now also checks that the estimate says loraReady false."+ ],+ "rejected": [],+ "checks": [+ "npx next typegen: done.",+ "pnpm typecheck: exit 0.",+ "pnpm lint: exit 0. 0 errors, 1 warning that is already on base (WAN_NEG_EN in scripts/comfy/library.spec.mjs).",+ "FUOBE_ACCOUNT_DISK_FREE_GB=1 pnpm vitest run --maxWorkers=2: exit 0. 286 files, 4564 passed, 3 skipped, 0 failed. This ran on the branch merged with base 2c72d369, which is also origin/claude/fuobe-parity-4's head at push time.",+ "node scripts/comfy/build-requirements.mjs: requirements.json unchanged (182 workflows, 204422 bytes).",+ ".next is removed and git status is clean. Pushed: origin/o/archive-restore is at 3f54b012.",+ "Not rerun: the browser e2e (tests/e2e/restore-flows.mjs) at 1440 and 390 px. The UI changes are one condition on the setup panel and a renamed field."+ ],+ "finalSummary": "o/archive-restore at 3f54b012, merged with claude/fuobe-parity-4 2c72d369 (Remove dialogue included). Open engine (ComfyUI): Restore & colourise runs the tiled-fusion LTX-2.5 graph with the Restore IC-LoRA, 97-frame windows chained by a 17-frame prefix, the optional reference at frame_idx -1, a one-field deinterlace, the sound put back, an optional Restore to 4K detail pass and an optional Then upscale (SeedVR2). The setup panel and the gated note now show only while neither a Hugging Face token nor the LoRA file in ComfyUI's folder is there. The pre-flight row checks the packet-copy join the pipeline really runs. All of this is built and unit-tested, but it has never run on a GPU: the graph is validated:false because the CPU ComfyUI lacks ComfyUI-LTXVideo. Cloud engine (fal LTX-2.3 reference-video-to-video/lora): untiled pieces of up to 97 frames at 720p or 1080p, each later piece starting from the last restored frame. The reference picture now really becomes the first piece's first frame (image_url), as the UI, the note and Assist say. The Restore LoRA goes as Fuobe's copy. A run without a token is refused only when Fuobe has no copy to send. Optional gated LoRAs stay off cloud routes with the gated reason. The plan and payload are tested, but nothing has run live: that needs a real fal key and a Hugging Face token with the licence accepted. Public sign-up: guests and accounts get own-gpu-tool on /api/restore and /api/restore/prompt. /api/restore/estimate prices them for their own GPU, never as a demo, and now tells them nothing about the owner's token or copies. The owner's flows are unchanged. Full suite, typecheck and lint pass.",+ "left": [+ "Finding 8 (memory): mirroring the 1.7 GB LoRA reads the whole file and copies it into the upload (about 3.4 GB peak). The civitai path already works the same way. Streaming the upload needs fal's upload API for streams and live keys to verify, so it is left for a later package.",+ "Nit (pins and sizes): model-pins.json has no entries for the two gated files, though lora-library.generated.ts has their sha256 and exact sizes, and requirements.json shows rounded sizes. Adding pins from the library's values is a small follow-up.",+ "The readiness check on the GPU reads the local LoRA folder (comfyLorasDir). A remote ComfyUI with no folder set still shows the setup panel until a token is added, which is harmless.",+ "From the earlier stages, still open: Faceless has no old-footage upload. Deinterlace drops one field rather than running fieldmatch, yadif and decimate. The graph has never run on a GPU and GPU_NOTE's timing is unmeasured. The cloud route, the token download and Topaz Then upscale have never run with real keys. Assist/MCP restore_video has no 'then upscale' argument.",+ "Docs notes from the implement report still apply: Restore in the public-signup own-gpu-tool and price lists, and the separate download-token setting."+ ],+ "blocked": ""+ },+ "merge": {+ "merged": [+ "o/archive-restore"+ ],+ "notMerged": [],+ "conflicts": "none",+ "checks": "typecheck 0, lint 0; merged tree identical to origin/o/archive-restore 3f54b012, whose full vitest on this base passed (286 files / 4564 passed, 3 skipped)",+ "pushed": true,+ "head": "6bcb1e63"+ }+}diff --git a/docs/handoff/reports/dbs-d2.json b/docs/handoff/reports/dbs-d2.jsonnew file mode 100644index 00000000..47ce11f0--- /dev/null+++ b/docs/handoff/reports/dbs-d2.json@@ -0,0 +1,121 @@+{+ "key": "dbs-d2",+ "impl": {+ "branch": "o/dbs-d2",+ "summary": "Video tools → Remove dialogue (/video-tools/remove-dialogue) is built on the open engine, with three outcomes: No dialogue (the default), Dialogue only, and Lower the music (−30 to 0 dB, default −12). It runs as two steps in one createPipeline batch. First, graph A (separate-soundtrack-dbs on oss-dbs-separate) reads the video's soundtrack with LoadAudio. Then the stream-copy mux on oss-mux runs: the background or voice stem goes through video-mux-audio-replace, and Lower the music runs video-mux-audio with audio = voice, audio2 = background and backgroundVolumeDb. No new ComfyUI graph was needed. owner-decisions.json has samAudioCloud: false, so there is no cloud route: the cloud engine says the tool runs on your GPU (open source), Engine mode 'Paid APIs only' refuses it with that reason, and the cloud dub is untouched. Commits f9f3261c and cadabebb are signed (SSH).",+ "built": [+ "src/lib/av/remove-dialogue.ts: the planner (outcomes, kept and removed stems, muxChain, the dB clamp, blockers 'This clip has no sound' and over 30 minutes, the cloud and cloud-only messages, removeDialogueTime = split time + mux)",+ "src/server/audio-tools.ts + /api/audio-tools: tool 'remove-dialogue' (zod body, header facts through storedMedia so a visitor's price check reads only its own files, hasAudio refusal, ?preview=1 time estimate with the host's DBS model, one createPipeline batch); the route maps field errors to plain messages",+ "src/server/chains.ts createPipeline: a step may now be listed twice in `after` when each slot it fills names a different stem (Lower the music needs voice and background from the one split; the runner already handled repeated dependencies). Anything else listed twice is still refused",+ "src/components/audio-tools/remove-dialogue-tool.tsx: drop or pick a video, ?video= hand-off, outcome control, the Lower slider, Fast/Best model with the host's pick, engine notice with 'Use open source', summary, honest notes, 'Free · runs on your ComfyUI' with the time, progress, before/after players, the result and the removed stem as downloads (both stems for Lower), and earlier runs with Compare to reopen them",+ "HUB_MODES['video-tools'] and TOOLS['video-tools'] entries; 'Remove dialogue' link in every video result menu (so the Genjutsu and Video tools feeds hand off by ?video=); for clips that have their sound, NEXT_STEPS now offers Extend, Remove dialogue, Split soundtrack (Upscale left the chips for those clips); MicOff icon",+ "GPU pre-flight board row /video-tools/remove-dialogue (steps oss-dbs-separate separate-audio + oss-mux mux; both graphs are already in requirements.json, and no new pack or model)",+ "docs/research/dbs-separation-7.md §4.4: as-built note (research correction)"+ ],+ "tests": "New tests/remove-dialogue.test.ts (17 tests): plans per outcome, chain stems, which mux graph runs (replace vs mix, via resolveWorkflowId), dB clamp, surround → mono, blockers, time, provider bindings (video → LoadAudio for oss-dbs-separate; the mux graphs' audio/audio2/volume), createPipeline accepting two stems from one step and refusing other repeats, hub/hand-off/next-step/board row, and the API in demo mode (preview free + estimate, a real two-step run finishing with four stems, refusals). tests/public-signup-tools.test.ts: the page opens for guests and accounts; a visitor's price check is on its own GPU, never a demo, and of its own video only; a run gets own-gpu-tool at the proxy; the board row. Updated tests/ux-flows and tests/library-pure for the new menu item and chips. Typecheck clean, lint clean (one existing warning in library.spec.mjs), full vitest 279 files / 4463 passed / 3 skipped. Live run on the CPU ComfyUI at 127.0.0.1:8188 (DBSLoader present, all four DBS weights) through Fuobe (pnpm dev, COMFYUI_URL set, demo off), 15 s H.264 + AAC stereo clip, all three outcomes succeeded: the result's video packets are byte-identical to the source's (framemd5 with -c copy matches); voice + background add back to the decoded source within 3.1e-5, and speech + music + effects to the channel mean within 4.6e-5 (16-bit FLAC); the result soundtrack correlates 0.997–0.998 with the stem (or voice + bed at −12 dB) it was made from, within 0.04 dB; split 54.5 s (0.28x real time), each mux about 1–2 s, inside the shown 49–97 s estimate. Browser (Playwright): /video-tools/remove-dialogue at 1440 and 390 px, light and dark, against the CPU ComfyUI (empty, cloud notice, options with the slider, result players and downloads) and in demo mode (a run from the page to before/after at 390 dark and 1440 light): no horizontal scroll, players fit, controls labelled. The one hydration error seen is in the sidebar on every page (also /audio/split and /video-tools/trim), not this package. Dev server stopped, .next and the data dir deleted.",+ "left": [+ "There is no cloud route, because samAudioCloud is false. If the owner turns it on, the brief's SAM Audio routes (extract-soundtrack → sam-audio-separate 'speech' → merge-audio-video, and loudnorm + compose for Lower) are still to build, with sam-audio-separate added to the catalog",+ "Not verifiable here: GPU timing (the estimate uses D1's figures), quality on real films, and any paid calls",+ "The test clip came from a ComfyUI template's sung song, not real dialogue: these checks prove the mechanics (picture copy, exact sum, mix level), not separation quality"+ ],+ "docsNotes": "For the docs pass: FEATURES/STATUS can list Video tools → Remove dialogue (open engine only: DBS + stream-copy mux; three outcomes; removed stem as a download; the cloud says it runs on your GPU). ARCHITECTURE: /api/audio-tools now also serves tool 'remove-dialogue'; createPipeline allows a step listed twice in `after` when each slot names its own stem. Where the brief was out of date: hubs.ts, mode-switch TOOLS, output-actions and NEXT_STEPS line numbers moved (found by name). The brief's 'more than 2 channels: each channel' is overridden by D1's as-built rule (a file with more than 2 channels is split in mono and its bed made from music + effects, because ComfyUI saves mono or stereo only); D2 follows D1. Already there from D1: graph A, oss-dbs-separate, the stem aliases (target/residual), the mock's four stems, the video → LoadAudio binding and its test, the hasAudio header probe, both mux graphs and the provider's choice between them. The brief's 'video URL bound to LoadAudio' test now also exists in remove-dialogue.test.ts, built from the plan's own request.",+ "blocked": null+ },+ "review": {+ "package": "dbs-d2",+ "branch": "o/dbs-d2",+ "base": "claude/fuobe-parity-4",+ "findings": [+ {+ "severity": "medium",+ "title": "Guests and accounts see a free run on their own ComfyUI, but every run they start is refused with own-gpu-tool",+ "where": "src/components/audio-tools/remove-dialogue-tool.tsx (AddVideo / useAskBeforeUpload, money() at ~L232, ToolHero subtitle, the run button and go()); ToolShell is rendered without selfHostedOnly",+ "detail": "POST /api/audio-tools (not ?preview=1) answers 403 own-gpu-tool to every account at the proxy. The branch's own test asserts this (tests/public-signup-tools.test.ts, 'Remove dialogue (DBS D2)'), and docs/public-signup.md L193-195 says so for this route. The page still treats a visitor like the owner. An account with its own GPU can upload a video (useAskBeforeUpload lets it through). The price check (priceAs, demo:false, costUsd 0) then shows 'Free · runs on your ComfyUI · about N s on your GPU', the hero says 'Runs on your ComfyUI … free', and the Remove dialogue button only fails after the click, with a 403. The base fixed exactly this for the other tools that never run on an account's GPU, in commits 25eac1ff ('visitors learn up front that self-hosted-only tools don't run here') and 0b2c24bc ('visitors read \"Self-hosted only\", not \"Free · your GPU\"'). Remove object follows that pattern at remove-object-tool.tsx L77/217/242/248: useLikelyVisitor, a SelfHostNote, a blocker, no upload or run, and ToolShell selfHostedOnly. This new page follows none of it. (D1's Split soundtrack page has the same gap; it was already on the base.)",+ "verified": "Traced it: the proxy's account() falls through to ownGpuTool() for POST /api/audio-tools, and the branch's test expects 403 own-gpu-tool. The account preview test expects {costUsd:0, demo:false}, so money() prints 'Free · runs on your ComfyUI'. grep finds no useLikelyVisitor, SelfHostNote or selfHostedOnly in remove-dialogue-tool.tsx.",+ "fix": "Follow remove-object-tool.tsx: const visitor = useLikelyVisitor(). Show <SelfHostNote>Remove dialogue runs on a self-hosted Fuobe for now.</SelfHostNote>, make the blocker say the same, turn off upload, 'From library' and the run, show 'Self-hosted only' in place of 'Free · runs on your ComfyUI', drop 'on your ComfyUI … free' from the hero for visitors, and pass ToolShell selfHostedOnly. The other way is to let accounts run it on their own ComfyUI: it is two plain open-engine steps with no AI helper, so the rule doesn't require own-gpu-tool. That needs accountRun plus the account-inputs checks and a tests/account-*.test.ts, so it is a bigger change."+ },+ {+ "severity": "low",+ "title": "Next-step chips: Upscale is gone for every clip that has its sound, and Remove dialogue's own result offers Remove dialogue again",+ "where": "src/lib/output-actions.ts nextSteps (SOUNDED_VIDEO_OPS → ['extend','remove-dialogue','split-soundtrack'])",+ "detail": "The brief asked for a Remove dialogue chip, but this change also takes the Upscale chip away from v2a, mux, lipsync, trim and captions results (tests/ux-flows.test.ts was edited to match). v2a is Sound for video, generated effects that rarely have speech, yet its first chips now include Remove dialogue in place of Upscale. A Remove dialogue result is op 'mux', so a 'No dialogue' result offers 'Remove dialogue' again. Upscale is still in the result menu.",+ "verified": "Read the code; the updated ux-flows test expects ['Extend','Remove dialogue','Split soundtrack'] for op v2a.",+ "fix": "Keep Upscale and add Remove dialogue only for ops that are likely to have speech (lipsync, dub/mux results other than feature remove-dialogue, trim, captions). Or leave the chips alone and rely on the menu link, then confirm with the owner."+ },+ {+ "severity": "low",+ "title": "Compare on an earlier run doesn't bring back its outcome or level in the controls",+ "where": "src/components/audio-tools/remove-dialogue-tool.tsx Results onOpen (~L700)",+ "detail": "onOpen sets source and ran.outcome = outcomeOf(r), but never calls setOutcome or setMusicDb. When you reopen a 'Lower the music (−20 dB)' run while the controls say 'No dialogue', the Before/After panel shows the Lower run while the 'What to keep' control, the summary and the run button still say No dialogue. Pressing the button then runs the outcome on screen, not the one that was reopened.",+ "verified": "Read the code: onOpen calls setSource and setRan only.",+ "fix": "In onOpen, call setOutcome(outcomeOf(r)) and, for lower-music, setMusicDb(r.request.params?.extra?.backgroundVolumeDb ?? LOWER_DEFAULT_DB)."+ },+ {+ "severity": "low",+ "title": "docs/public-signup.md still names only Split soundtrack as the /api/audio-tools tool that answers own-gpu-tool",+ "where": "docs/public-signup.md L193-195; the implementer's docsNotes",+ "detail": "Remove dialogue now runs on the same route and gets the same own-gpu-tool answer for accounts, with a working price check. The source-of-truth doc and the docsNotes for the docs pass don't say so.",+ "verified": "grep of docs/public-signup.md",+ "fix": "Have the docs pass add 'and Video tools → Remove dialogue' beside Split soundtrack (POST /api/audio-tools) in that paragraph."+ }+ ],+ "checks": [+ "owner-decisions.json on claude/fuobe-parity-4 has samAudioCloud: false, so it is right that there is no cloud route and no sam-audio-separate in the catalog. The cloud engine shows 'runs on your GPU (open source)', mode 'cloud' refuses the tool with CLOUD_ONLY_REMOVE_PROBLEM, and the diff doesn't touch the dub (src/lib/av/dub.ts and the dub studio are unchanged)",+ "No new model, LoRA, node pack or graph. separate-soundtrack-dbs (with its licence recorded), video-mux-audio and video-mux-audio-replace are already in manifest.json and requirements.json. Nothing from Higgsfield in the diff",+ "createPipeline: a step listed twice is allowed only when every repeated slot names a stem and those stems differ (case-insensitive); anything else listed twice is still refused. topoOrder dedupes with a Set. The runner (advanceDependents) maps each depends_on entry to its own slot. READY_DEPENDENTS (json_each), dropUnused and the recipe-builder walk all handle the repeated id",+ "The provider's bindings match the manifests. The split step's video goes to LoadAudio (node 1) with channels mono. The mux with one chain stem runs video-mux-audio-replace. With audio2 it runs video-mux-audio, with audio=node 3, audio2=node 4 and backgroundVolumeDb=node 5 volume. The EmptyAudio duration falls back to the FLAC stems' length when the video's header can't be read",+ "The GPU pre-flight row /video-tools/remove-dialogue resolves oss-mux to video-mux-audio only. The replace graph that the default outcomes run needs only ConcatenateVideo, LoadAudio, LoadVideo and SaveVideo, all core nodes and a subset of the mix graph's, so the board's readiness holds",+ "Public sign-up: /api/audio-tools?preview=1 is in PREVIEWS and the route is wrapped in priceAs. factsOf reads through storedMedia, so a visitor's price check sees only its own files (the owner's video answers 'That video is gone'). The account price is demo:false on its own GPU and calls no GPU (lastGpuDevice). Runs from accounts and guests are refused at the proxy. The JSON body is small (the video goes by /api/files reference)",+ "Live check on the CPU ComfyUI at 127.0.0.1:8188 (no installs, no restart). I ran video-mux-audio-replace on a VP9+Opus WebM and an H.264+AAC MOV, the containers the page accepts besides MP4 that the implementer didn't test. Both succeeded. The MOV's video packet framemd5 is identical to the source's. The WebM's VP9 packets are copied into MP4 with identical sizes and payload hashes (only the timestamps are rebased, by 7 ms), so the picture really isn't re-encoded for these containers either. Test files are in ComfyUI input/output subfolder rvw-d2",+ "npx tsc --noEmit: clean. eslint on the changed files: clean",+ "vitest --maxWorkers=2: tests/remove-dialogue, public-signup-tools, ux-flows, library-pure and split-soundtrack (117 passed); chains, chain-fanout, chain-optional, chain-soundtrack, pipeline, public-signup, public-signup-visitors, no-higgsfield, av-dub and split-soundtrack (187 passed)",+ "Brief items present: hub mode and TOOLS entry, the menu hand-off by ?video=, the three outcomes with a −30…0 dB slider (default −12, clamped on the server and in zod), the engine switch, the time line, before/after players, the removed stem (both stems for Lower) as downloads, the copy and honest notes, the 'This clip has no sound' and over-30-minutes blockers, one createPipeline batch, and the board row",+ "Not verified here: GPU timing, separation quality on real dialogue, and the 390 px / dark layout in a browser (I trusted the implementer's Playwright run and checked only that Segmented wraps and the Slider forwards aria-label and aria-valuetext to its thumb)"+ ],+ "verdict": "pass_with_fixes: the open-engine mechanics are correct (picture copied for MP4, MOV and WebM; stems wired right; createPipeline change is safe). Before merging, fix the visitor notice (medium): accounts are shown a free run on their own ComfyUI that the proxy always refuses. The three low items can be done in the same pass or the docs pass."+ },+ "fix": {+ "applied": [+ "Medium (confirmed: the proxy answers POST /api/audio-tools with own-gpu-tool for guests and accounts, but the page offered them 'Free · runs on your ComfyUI'): Remove dialogue now follows Remove object's pattern. It uses useLikelyVisitor, shows a SelfHostNote ('Remove dialogue runs on a self-hosted Fuobe for now', with the link to run Fuobe yourself), makes that sentence the blocker, and turns off the upload, From library, drop and file input (AddVideo disabled). The run button is off and go() returns early. Visitors see 'Self-hosted only' in place of the price, the hero drops 'on your ComfyUI … free' for them, and ToolShell gets selfHostedOnly. Account runs are NOT opened (main-session call).",+ "The same pattern applied to D1's Split soundtrack page (src/components/audio-tools/split-tool.tsx), which shares the route and had the same gap: 'Split soundtrack runs on a self-hosted Fuobe for now', AddMedia disabled, run off, 'Self-hosted only', hero wording, ToolShell selfHostedOnly.",+ "Shared price line: openToolPrice(p, visitor) in src/lib/av/split.ts replaces both pages' local money(). A visitor reads 'Self-hosted only'; the owner keeps 'Free · runs on your ComfyUI' / 'Placeholder · free'.",+ "Low (chips, confirmed): nextSteps keeps Upscale for every clip that has its sound. Remove dialogue is added only for clips likely to carry speech: mux (except a Remove dialogue result, by feature), lipsync, trim and captions, giving Extend, Upscale, Remove dialogue. v2a and a Remove dialogue result go back to the base's Extend, Upscale, Split soundtrack.",+ "Low (Compare, confirmed): requestedOutcome(request) in src/lib/av/remove-dialogue.ts reads the outcome and level back from the mux step's chain and params.extra.backgroundVolumeDb (clamped). onOpen now calls setOutcome, and setMusicDb for Lower the music, so the controls and the run button match the reopened run.",+ "Low (docs, confirmed): docs/public-signup.md names Video tools → Remove dialogue beside Split soundtrack (both POST /api/audio-tools) as own-gpu-tool for accounts with working price checks, and says both pages tell visitors up front.",+ "Tests: tests/remove-dialogue.test.ts covers requestedOutcome round-trips for every outcome, a missing or out-of-range level and an empty request; the demo API run's stored request reads back as lower-music at -15 dB; and the chips by op and feature (lipsync, dub mux, trim, captions offer Remove dialogue; v2a and a Remove dialogue result don't; max 4 shows Split soundtrack after it). tests/public-signup-tools.test.ts covers openToolPrice for owner and visitor, and checks both pages' source for the visitor pattern (useLikelyVisitor, SELF_HOSTED text, blocker, SelfHostNote, selfHostedOnly, disabled upload, library and input, run off, 'Self-hosted only', hero wording). tests/ux-flows.test.ts goes back to the base's v2a expectation and adds a lipsync case.",+ "Merged the latest claude/fuobe-parity-4 (4e51ffbf) into o/dbs-d2 first (59f8366b) with no conflicts. The fix commit is 6fa4b77f."+ ],+ "rejected": [+ "The reviewer's alternative for the medium finding (let accounts run Remove dialogue on their own ComfyUI through accountRun and the account-inputs checks): not taken, per the main session's call. The page follows the Remove object pattern instead, and the route stays own-gpu-tool for accounts."+ ],+ "checks": [+ "Worktree case (1): /home/user/wt/o-dbs-d2 on o/dbs-d2. The branch held only this package's commits (f9f3261c, cadabebb), so it was not cut from a rebuilt base. claude/fuobe-parity-4 was not an ancestor, so it was merged in.",+ "pnpm install --frozen-lockfile --prefer-offline: exit 0. npx next typegen: exit 0.",+ "pnpm typecheck (tsc --noEmit): exit 0.",+ "pnpm lint: exit 0. The one warning (WAN_NEG_EN unused in scripts/comfy/library.spec.mjs) was already there.",+ "FUOBE_ACCOUNT_DISK_FREE_GB=1 pnpm vitest run --maxWorkers=2: exit 0, 279 files, 4471 passed, 3 skipped, 1535 s. A first attempt was stopped by the background time limit while another session's vitest ran alongside, and was re-run to completion.",+ "Targeted runs before the full run: remove-dialogue, public-signup-tools, ux-flows, library-pure, split-soundtrack, 120 passed.",+ "No browser check of the visitor view in this pass. The change reuses components that are already checked (SelfHostNote, disabled Buttons, ToolShell selfHostedOnly).",+ ".next deleted, git status clean, pushed: origin/o/dbs-d2 = 6fa4b77f."+ ],+ "finalSummary": "Open engine (ComfyUI + ComfyUI-DBS, CPU or GPU): Video tools → Remove dialogue offers No dialogue, Dialogue only and Lower the music (−30…0 dB). It runs as two steps in one batch, graph A then the stream-copy mux, and keeps the removed stem as a download. The implementer and reviewer verified it on the CPU ComfyUI: picture packets are byte-identical for MP4, MOV and WebM, the stems add back exactly, and the mix level is right. Compare now restores the outcome and level. Cloud engine: no route, because samAudioCloud is false and DBS isn't hosted. The page says it runs on your GPU (open source), and 'Paid APIs only' refuses it. The cloud dub is unchanged. Needs a GPU: only for speed (it runs on CPU). No keys are needed. Public sign-up: guests and accounts can open /video-tools/remove-dialogue and /audio/split. Both pages now say up front that the tool runs on a self-hosted Fuobe for now, show 'Self-hosted only', and turn off upload, library pick and run. The price check (?preview=1) still works and is priced for the visitor's own GPU, on its own files only. A POST run is refused at the proxy with own-gpu-tool. The owner's pages are unchanged. Next-step chips keep Upscale and add Remove dialogue only for clips likely to have speech.",+ "left": [+ "There is no cloud route while samAudioCloud is false. If the owner turns it on, the SAM Audio routes (extract-soundtrack → sam-audio-separate 'speech' → merge-audio-video, and loudnorm + compose for Lower) and the sam-audio-separate catalog entry are still to build.",+ "Accounts can't run Remove dialogue or Split soundtrack on their own ComfyUI. Opening that (accountRun + account-inputs checks + a tests/account-*.test.ts) is an owner/plan decision.",+ "Not verifiable here: GPU timing, separation quality on real dialogue, and paid calls.",+ "Split soundtrack's mixer 'put the mix on the video' (remux) has no visitor gating, but a visitor can never get stems to reach it, because the split run itself is refused.",+ "Speech-likely clips now show Extend, Upscale, Remove dialogue as their three chips, so Split soundtrack moves to the menu for them. The owner may want a different order."+ ],+ "blocked": ""+ },+ "merge": {+ "merged": [+ "o/dbs-d2"+ ],+ "notMerged": [],+ "conflicts": "none",+ "checks": "typecheck 0, lint 0, vitest 282 files / 4503 passed, 3 skipped (exit 0)",+ "pushed": true,+ "head": "2c72d369"+ }+}diff --git a/docs/handoff/reports/n7-2-layout-mode.json b/docs/handoff/reports/n7-2-layout-mode.jsonnew file mode 100644index 00000000..04225ed8--- /dev/null+++ b/docs/handoff/reports/n7-2-layout-mode.json@@ -0,0 +1,196 @@+{+ "key": "n7-2-layout-mode",+ "impl": {+ "branch": "o/n7-2-layout-mode",+ "summary": "The Layout mode package is built, verified in demo mode and committed on o/n7-2-layout-mode, in /home/user/wt/o-n7-2-layout-mode. The tree is clean, all 5 commits are signed, and nothing was pushed then (the branch was later pushed to origin/o/n7-2-layout-mode at 492643b). I didn't verify real MOSS / FLUX.3 / Ideogram renders because there is no GPU and no fal key here.\n\nResuming the earlier attempt: its 3 commits were sound. But the working tree and index had the package's own changes to 15 files under src/ reverted and staged, dated 12:27, after the last commit. This looks like a check that was cut off mid-way. I restored those files from HEAD and kept the attempt's uncommitted test additions (a Reuse round trip in the unit tests and in the e2e script).\n\nThe base claude/fuobe-parity-4 had moved on since the branch was cut (cd9e5ff to f7c6d8e, which brings in acc-2 accounts and n7-6). I rebased the 3 commits onto it. The rebase had no conflicts and the commits were signed again. No pnpm-lock changes came with the new base.\n\nNew work in this session:\n- **Closing keeps your boxes:** the editor now keeps what was drawn when it is closed with Escape or by clicking outside it. Before, those boxes were lost, because the editor has no Cancel button.\n- **Shift (or Alt) drag draws over a box:** you can now draw a new box on top of another, such as a headline on a product. Before, any press on a box moved it, so you couldn't start a drag there.\n- **Nudges can be undone:** arrow-key nudges go into Undo; holding a key down counts as one step.\n- **Steady phone sheet:** the rows sheet at 390 px has a fixed height, so the canvas no longer shrinks under your finger when the first box is added.\n\nAlready on the base (from N7-1, reused, not rebuilt): src/lib/layout-prompt.ts (the neutral draft, the MOSS / FLUX.3 / Ideogram / VGL / plain-words compilers, decodeMoss, the Import parser, validateLayout, readsBoxes, carriesLayout). Also from N7-1: `options.layout` on the models and the `promptExpansion` setting. That setting switches the API's own prompt expansion off for moss-image, flux-3 and ideogram-4-5 whenever a request carries a layout.\n\nBuilt by the earlier attempt and checked now: everything the plan lists for N7-2.\n- **Composer:** `layout: true` in the Image studio and the StudioConfig flag; enterLayout / layoutRequest / leaveLayout plus withoutLayout for Reuse; the Layout chip, the strip and the Reuse path in the composer.\n- **Plan:** it compiles the draft at the size the model renders. On your GPU that is computeDimensions on a 16 px grid fitted to 2048, sent as width and height. On fal it is sizeValue clamped to 512-2048, sent as image_size. The browser's catalog keeps each route's size field so the composer prices the same canvas as the server.\n- **Server:** generations.ts never runs the prompt enhancer on a layout request.\n- **Edit layout:** fal outputs keep actual_prompt, seed and size, and ComfyUI pictures keep the seed they were drawn with. The Edit layout action and `/image?layout=<generation>` open the boxes with the same seed.\n- **Editor and picker:** the new layout-editor.tsx and its box maths in layout-edit.ts (built on layers.ts). The model list puts box-reading models first with a \"Reads boxes\" badge. Feed tiles say \"Layout · N boxes\".\n\nAccounts: the accounts core is on the base, but this package adds no routes, tables, jobs or paid calls. Edit layout reads results through the existing GET /api/generations/[id], which already goes through the accounts route handler. No migration was needed.",+ "built": [+ {+ "feature": "Layout chip in the Image studio composer (StudioConfig.layout, IMAGE_STUDIO layout: true), strip above the prompt with box preview, Experimental badge, compiled-size line, Edit / Layout off with Undo; prompt becomes the summary caption; Enhance hidden",+ "status": "done (earlier attempt), re-verified",+ "verifiedHow": "tests/layout-mode.test.ts composer helper tests; tests/e2e/composer-flows.mjs section 7; my browser check at 1440/390, light and dark (screenshots)"+ },+ {+ "feature": "Composer helpers enterLayout / layoutRequest / leaveLayout / withoutLayout, layoutShape, layoutModelNote, layoutSizeWarning, the 'Reads your boxes' group in groupModels",+ "status": "done (earlier attempt)",+ "verifiedHow": "vitest tests/layout-mode.test.ts"+ },+ {+ "feature": "Plan compiles params.extra.layout at the exact render size: oss-moss-image on the 16 px grid with extra.width/height (fitted to 2048 as the ComfyUI provider fits it); fal moss-image image_size clamped to 512-2048 with the minimum respected; FLUX.3 / Ideogram 4.5 with their own compilers; other models get compileWords; a Text box without words is refused; enhancePrompt off",+ "status": "done (earlier attempt)",+ "verifiedHow": "vitest tests/layout-mode.test.ts (open 1360x768 and 2048x880; fal clamp 3000x300 -> 2048x512 and 300x300 -> 512x512; payload has enable_prompt_expansion false; the browser's catalog compiles the same)"+ },+ {+ "feature": "Server never runs the prompt enhancer on a layout request (generations.ts submit)",+ "status": "done (earlier attempt)",+ "verifiedHow": "vitest tests/layout-mode-server.test.ts (demo mode, mock provider; enhancer mocked and never called for a layout, still called for a plain prompt)"+ },+ {+ "feature": "Edit layout: an output action shown only when it can work (the request's own layout, or a fal MOSS actual_prompt decoded at the picture's own width and height); /image?layout=<id>[.<index>] opens Layout mode with the draft, caption, model and same seed; ComfyUI pictures keep the seed they were drawn with",+ "status": "done (earlier attempt)",+ "verifiedHow": "vitest tests/layout-mode.test.ts using the stored actual_prompt fixture tests/fixtures/moss-actual-prompt.json; e2e: Edit layout from a feed tile reopens the boxes (demo mode)"+ },+ {+ "feature": "Reuse round trip (layout run comes back in Layout mode with boxes and caption, plans to the same prompt, size and seed)",+ "status": "done; test changes committed this session",+ "verifiedHow": "vitest Reuse test; e2e check 'Reuse brings the boxes and the caption back'"+ },+ {+ "feature": "Layout editor (layout-editor.tsx): canvas in the chosen aspect ratio, drag to draw, numbered tabs, select / move / 8-handle resize, Delete, arrow-key nudge (Shift x10), the same spot cycles stacked boxes, Add box, Undo; rows with Object/Character/Text, what it looks like, exact words (inline error), optional colour; caption, canvas type Single/Panels/Collage, style tags; desktop rows beside the canvas, phone rows in a bottom sheet",+ "status": "done (earlier attempt) plus fixes this session: closing keeps the boxes, Shift/Alt-drag draws over a box, nudges go into Undo, fixed-height phone sheet",+ "verifiedHow": "My Playwright check (<the old session's scratch folder, gone>/layout-check.mjs): all checks pass at 1440 and 390 px, light and dark. Covered: drawing, moving and resizing by mouse and by touch; Shift-draw plus Undo; overlap cycling; nudge, Delete, Ctrl+Z; keyboard focus reaches every new control; the sheet folds; nothing scrolls sideways; labels fit; Escape keeps the boxes"+ },+ {+ "feature": "Import / Export (browser only): import a Fuobe or LinXce draft, a compiled MOSS prompt read on the current canvas, a legacy scene prompt or CreateBoundingBoxes elements (paste or file); copy the compiled prompt, copy the draft JSON, download .json",+ "status": "done (earlier attempt)",+ "verifiedHow": "Browser check: CreateBoundingBoxes import (3 boxes), round trip through the copied compiled MOSS prompt (2 boxes, words kept), clipboard contents checked"+ },+ {+ "feature": "Model list: box readers first with a 'Reads boxes' badge (cloud: FLUX.3, Ideogram 4.5, MOSS-Image; open: MOSS-Image); other models show 'This model reads the layout as words, not exact positions.' with a 'Use MOSS-Image' fix",+ "status": "done (earlier attempt)",+ "verifiedHow": "Browser: picker group contents on cloud and open; the words-model line on Nano Banana Pro"+ },+ {+ "feature": "Warning past 2048 px a side or 4 MP, with the size the model renders instead; Experimental noted in the mode's hint, badge and strip; 'Free' price on the open engine",+ "status": "done (earlier attempt)",+ "verifiedHow": "Browser: oss-moss-image at 21:9 and 1.5K shows '2352 × 1008 is past 2048 px a side, so MOSS-Image renders 2048 × 880'; Generate shows Free"+ },+ {+ "feature": "Feed tiles say 'Layout · N boxes'",+ "status": "done (earlier attempt)",+ "verifiedHow": "e2e 'the feed says it's a layout'"+ }+ ],+ "tests": "- **Unit tests:** 64 test files that touch the changed modules (composer, plan, outputs, cloud catalog, comfy provider, moss-image, image studios, layout-mode and its server test, and others). 63 files and 1166 tests passed. The other file, tests/comfy-dbs.test.ts, failed to load: it imports scripts/comfy/build-library.mjs, which needs playwright-core, and scripts/comfy/node_modules is not installed in this worktree. That is a setup gap; this package doesn't touch that file.\n- **Typecheck:** `tsc --noEmit` is clean.\n- **Lint:** eslint is clean on every file the package changed.\n- **E2E:** `node tests/e2e/composer-flows.mjs` against `pnpm dev -p 3427` (FUOBE_DATA_DIR=/tmp/fuobe-o-n7-2-layout-mode-data, demo mode) passed fully, twice: all composer checks, including the 11 layout checks (draw, Text error, compiled-size strip, Generate sends the draft, feed label, compiled MOSS prompt, Reuse, Edit layout from a tile, touch draw at 390 px, sheet under the canvas, no sideways scroll).\n- **Browser check:** an extra Playwright check at 1440 and 390 px, light and dark, passed every check (about 70 checks and screenshots in <the old session's scratch folder, gone>/shots/: editor-*, strip-*, picker-*).\n- **Cleanup:** the dev server is stopped and .next is deleted.\n\nNo full suite and no pnpm build, as the stage rules say.",+ "left": [+ "Real MOSS-Image, FLUX.3 and Ideogram 4.5 renders, and how well they follow the boxes, are not verified: that needs a GPU (oss-moss-image on ComfyUI) or a fal key. Everything here was checked in demo mode with the mock provider.",+ "Touch has no Shift key, so on phones a box can't be drawn starting on top of another one; the way round is 'Add box', then move and resize it. A long-press-to-draw gesture could be added later.",+ "The size warning shows in the composer strip; the editor shows the canvas size but not the warning sentence itself.",+ "On your GPU the canvas grid (16 px) and the 2048 limit come from constants in layout-prompt.ts that mirror the moss-image-t2i manifest limits; a test pins them to the manifest. A later change to the manifest limits would need those constants updated too.",+ "Layouts in Canvas, Marketing, Ads and Assist (Plan layout) are package N7-8, not this one.",+ "tests/comfy-dbs.test.ts can't load in this worktree until scripts/comfy dependencies (playwright-core 1.56.1) are installed. This is not about N7-2."+ ],+ "docsNotes": "For STATUS / ARCHITECTURE:\n- **The mode:** the Image studio has a Layout mode (chip next to Frames' place). Its draft rides as params.extra.layout. planGeneration compiles it once the render size is known: layoutCanvas, then the model's compiler (planLayout in src/lib/catalog/plan.ts).\n- **Sizes by engine:** on your GPU, exact width and height in extra on a 16 px grid, up to 2048 a side. On fal MOSS-Image, image_size equal to the canvas (512-2048) and enable_prompt_expansion false. FLUX.3 and Ideogram 4.5 use their own forms with expansion off; every other model gets plain sentences.\n- **No enhancer:** the server never runs Fuobe's prompt enhancer on a layout.\n- **Browser catalog:** slimModel now keeps a route's size field as route.preview.size, so the browser prices and compiles the same canvas as the server.\n- **Edit layout:** an output action, plus the /image?layout=<generation>[.<index>] hand-off. Its source is the request's own draft, or fal's actual_prompt decoded at the picture's size. fal MOSS outputs keep meta.actualPrompt, seed, width and height; ComfyUI image outputs keep meta.seed.\n- **Editor:** src/components/studio/layout-editor.tsx, with box maths in src/lib/layout-edit.ts (on layers.ts' rectFrom / resizeBox). Shift or Alt and drag draws over a box. Closing the editor keeps the boxes.\n- **No storage or route changes:** no migration, no new route, no new ComfyUI graph, no LoRA.\n- **Research:** no research corrections were needed."+ },+ "review": {+ "findings": [+ {+ "file": "src/lib/catalog/payload.ts",+ "line": 1003,+ "severity": "major",+ "summary": "Edit layout reopens cloud layout runs without the seed they were drawn with. extractOutputs records fal's `seed` only inside the `if (actualPrompt)` block. A layout run sends enable_prompt_expansion:false, and the research says fal returns actual_prompt only \"when expansion ran\". FLUX.3 and Ideogram 4.5 never return it. So no meta.seed is stored, and editableLayout falls back to the request's seed, which is normally unset. The plan says Edit layout opens \"with the draft and the same seed\". Separately, the fal provider sends seed+index per job, but the fallback hands every output the base seed.",+ "failureScenario": "Image studio on the cloud (the default engine), MOSS-Image or FLUX.3, Layout mode, random seed, Generate, then Edit layout on the result. The toast says \"Layout opened\" with no seed, and the re-render uses a new random seed, so the whole picture changes instead of only the moved box. Verified with a scratch vitest probe: extractOutputs({images:[{url,width:1360,height:768}],seed:918273}) gives meta undefined, and editableLayout(...).seed is undefined. The repo's own test at tests/layout-mode.test.ts:239 asserts the same no-meta result.",+ "verified": true+ },+ {+ "file": "src/components/studio/studio-page.tsx",+ "line": 473,+ "severity": "major",+ "summary": "Using Edit layout a second time on the same picture does nothing. LayoutHandoff keeps `opened.current = value` and never resets it, and it returns early when `opened.current === value`. `layout` is not in HANDOFF_PARAMS, so navigating to /image?layout=X does not bump the StudioProvider epoch, and the same LayoutHandoff instance (with its ref) survives. The early return also skips the `finally` cleanup, so ?layout=X stays in the address bar.",+ "failureScenario": "In the Image studio: Edit layout on picture X, move boxes, Generate (result Y), then Edit layout on X again to try another variation from the original (or after turning Layout off). No fetch, no toast, nothing reopens until the page is reloaded. Opening a different picture in between makes X work again. Traced: handoffKey only keeps image/ref/video/audio/prompt/preset/model/format (composer.ts L720), and StudioProvider is keyed by start.epoch (studio-page.tsx L556).",+ "verified": true+ },+ {+ "file": "tests/e2e/composer-flows.mjs",+ "line": 285,+ "severity": "minor",+ "summary": "The e2e check \"Edit layout reopens the boxes\" cannot fail. It runs right after the Reuse step, which already put the same 1-box layout in the strip. The `waitForFunction(() => !location.search.includes(\"layout=\"))` is already true before the menu click navigates, so it resolves at once. The check passes even if Edit layout does nothing, so it misses the second-click bug and does not check the seed. The ComfyUI change that copies meta.seed onto image outputs (comfyui.ts L1281 / L1495) has no test either.",+ "failureScenario": "Break LayoutHandoff (for example, make it return early always). Section 7 still prints a pass for \"layout: Edit layout reopens the boxes\", because the strip shows \"1 box\" from Reuse. Verified by reading the sequence (Reuse check at L272-275, Edit layout check at L276-285). A grep of tests/ finds no test of comfyProvider.poll seed meta.",+ "verified": true+ },+ {+ "file": "src/components/studio/composer.tsx",+ "line": 690,+ "severity": "minor",+ "summary": "The strip's \"Use MOSS-Image\" fix ignores Settings → Models & licences. boxModel comes from catalog.getModel(BOX_MODELS[engine]). getModel deliberately also finds models the admin switched off (catalog.tsx L85-L94), and the composer never checks catalog.offered() for it.",+ "failureScenario": "An admin switches moss-image off. A user in Layout mode on Nano Banana Pro sees \"This model reads the layout as words… Use MOSS-Image\". Tapping it picks a model that is off, and the composer's offModel fallback (L331-332) moves straight back to the studio default. The suggested fix is a dead end. Traced in code.",+ "verified": true+ },+ {+ "file": "src/components/studio/layout-editor.tsx",+ "line": 296,+ "severity": "minor",+ "summary": "Keyboard users cannot resize boxes. The 8 handles are aria-hidden spans driven only by pointer events, and onKeyDown handles only Ctrl+Z, Delete/Backspace and arrow-key nudges (nudgedBox). Add box always makes a box a third of each side, so a keyboard-only user is stuck at that size. Also, Delete on a focused box tab unmounts that tab and focus falls out of the canvas, so further arrow or Delete keys do nothing until the user tabs back in.",+ "failureScenario": "Keyboard only: Tab to Add box and press Enter (a 1/3 × 1/3 box), Tab to its number tab, then try to make it a wide headline strip. There is no key that changes width or height. Verified by reading onKeyDown and the HANDLES markup (aria-hidden, no tabIndex).",+ "verified": true+ },+ {+ "file": "src/components/studio/layout-editor.tsx",+ "line": 452,+ "severity": "minor",+ "summary": "Box number tabs (11 px) and row number chips (12 px) put white text on the kind colours: Text #ff9f0a about 2.1:1 and Character #34c759 about 2.2:1. Both fail WCAG AA in light and dark themes. Any colour the user picks (for example white or yellow) can make the number unreadable.",+ "failureScenario": "Draw a box and set it to Text: its \"1\" tab is white on orange at 2.06:1 contrast. Computed from the sRGB relative luminance of the hex values in KIND_COLOR.",+ "verified": true+ },+ {+ "file": "src/lib/output-actions.ts",+ "line": 250,+ "severity": "nit",+ "summary": "editableLayout returns the request's own layout even when it has zero boxes. A run made with Layout on but nothing drawn gets an Edit layout action that opens an empty canvas, while its feed tile has no \"Layout\" label.",+ "failureScenario": "Turn Layout on, close the editor without drawing, type a prompt and Generate. The result menu offers Edit layout, which opens a blank layout. readLayout accepts items: [] and editableLayout has no items.length check on the `own` path.",+ "verified": true+ },+ {+ "file": "src/lib/catalog/plan.ts",+ "line": 472,+ "severity": "nit",+ "summary": "The size line and warning for cloud models without a size field come from computeDimensions' tier table. FLUX.3's \"512sq\" and \"768sq\" are unknown tiers there and show as \"about 1360 × 768\". Words models also get the 2048/4 MP warning (\"Nano Banana Pro may place the boxes less exactly\") although they never place boxes by position.",+ "failureScenario": "Probe: layoutCanvas(flux-3, 16:9, \"512sq\") returns 1360×768. With Nano Banana Pro at 2K the strip shows both the \"reads the layout as words\" line and the warning that it \"may place the boxes less exactly\".",+ "verified": true+ },+ {+ "file": "src/lib/layout-edit.ts",+ "line": 14,+ "severity": "nit",+ "summary": "MIN_BOX_PX is measured in render pixels, not screen pixels. On a phone the canvas is drawn about 358 px wide, so for a 2048-wide render 16 px is about 2.8 screen px. A tap meant to deselect that drifts about 3 px in both directions draws a tiny box.",+ "failureScenario": "390 px, oss-moss-image at 16:9 1.5K (2048×1152): tap empty canvas with slight finger drift, and a roughly 17×17 px box appears and is selected. rectFrom only rejects a side under `min` in render pixels.",+ "verified": true+ },+ {+ "file": "src/components/studio/layout-editor.tsx",+ "line": 366,+ "severity": "nit",+ "summary": "The editor's aspect select drops \"auto\" from its options but keeps value=\"auto\". With Nano Banana Pro set to Auto, the select shows its first option (21:9) while the canvas is square (ratioOf(\"auto\") = 1).",+ "failureScenario": "Nano Banana Pro, aspect Auto, Layout on: the header select reads 21:9 over a 1:1 canvas, and picking 21:9 fires no change because it already looks selected.",+ "verified": true+ }+ ],+ "checks": "Ran: vitest on tests/layout-mode.test.ts, tests/layout-mode-server.test.ts, tests/layout-prompt.test.ts and tests/moss-image.test.ts (4 files, 68 tests, all passed). `tsc --noEmit` reported no errors in package files. The only errors were Next's generated RouteContext/LayoutProps/PageProps globals, which are missing because .next was deleted, an environment gap. ESLint on every changed file: clean. Scratch vitest probes are in <the old session's scratch folder, gone>/n72review; nothing was written to the worktree. The probes covered: layout canvases for flux-3, ideogram-4-5, moss-image, oss-moss-image, nano-banana-pro and bria-fibo-2 at each tier; the Bria payload, which carries `vgl` as the research says; cloud MOSS with LoRAs keeping image_size; num_images=4 with expansion off; FLUX.3 and Ideogram edit routes with a layout; an empty caption with boxes; the Soul words path; and seed capture for fal responses without actual_prompt. Traced by reading: StudioProvider epoch and HANDOFF_PARAMS against LayoutHandoff; the engine-switch effect against the Edit layout engine change; the catalog access filter; ComfyUI seed meta; the server enhancer skip; stored request vs prompt column; and readLayout HEX colour sanitising (no CSS injection). No Higgsfield references, binaries, LoRA files or new models in the diff, so no licence data was needed. No new routes, tables or jobs, so nothing for the accounts core. All 5 commits carry gpgsig and the tree is clean.",+ "verdict": "Most of the package is sound and does what the plan asks: the composer helpers, the plan compiling at the exact render size on both engines (16 px grid up to 2048 on the GPU, fal image_size kept within 512-2048), prompt expansion off and the server enhancer skipped for layouts, the browser catalog keeping the size field, Import / Export, the model list with box readers first, the feed label and the 390 px sheet. Fix two major Edit layout problems before merging. First, cloud layout runs (MOSS with expansion off, FLUX.3, Ideogram) never store fal's seed, so \"Edit layout with the same seed\" fails on the default engine whenever the seed was random. Second, reopening the same picture with Edit layout a second time in one Image studio session silently does nothing. The e2e check for Edit layout cannot fail as written, so it should be rewritten to start from a state with no layout. The rest are minor accessibility and polish items: no keyboard resize, low-contrast box numbers, and \"Use MOSS-Image\" offered when an admin has switched it off."+ },+ "fix": {+ "applied": [+ "MAJOR payload.ts extractOutputs: fal's seed now stored on t2i/edit image outputs without actual_prompt; tests in tests/layout-mode.test.ts",+ "MAJOR studio-page.tsx LayoutHandoff: ref cleared once ?layout= leaves the address, so a second Edit layout opens again",+ "MINOR e2e composer-flows.mjs: Layout off checks and two Edit layout runs on the same tile (fails with the fix reverted); comfy-provider test that meta.seed reaches image outputs",+ "MINOR composer.tsx: 'Use MOSS-Image' only when catalog.offered (layoutBoxModel helper, tested)",+ "MINOR layout-editor.tsx: Alt+arrows resize (keyResizedBox), focus back to canvas after Delete, hint and aria-label name the keys",+ "MINOR contrast: inkOn() by WCAG contrast; KIND_COLOR shared in layout-edit.ts; Object blue #0071e3",+ "NIT output-actions.ts editableLayout: no Edit layout without boxes",+ "NIT plan.ts layoutCanvas '<side>sq' tiers; size warning only to box readers (layoutNotes)",+ "NIT layout-edit.ts drawnBox min parameter (8 screen px)",+ "NIT aspect select keeps 'Auto (square canvas)' only while current"+ ],+ "rejected": [],+ "checks": "pnpm typecheck 0; pnpm lint 0; full Vitest 277 files / 4444 passed, 1 failed (tests/no-higgsfield.test.ts on src/lib/status-page.ts:21, identical on the base; fixed on the base in dc99183). composer-flows.mjs e2e passes in demo mode; browser check 40/40 at 1440 and 390, light and dark.",+ "finalSummary": "Layout mode in the Image studio complete with all 10 review findings fixed and the base merged in (conflicts kept both sides: composer, model-picker, composer.ts, studio-page, plan.ts, generations.ts; open Ideogram 4 gets the fixed JSON caption for a layout's words). Open engine: oss-moss-image gets the compiled MOSS prompt and exact size on the 16 px grid up to 2048; seeds kept for Edit layout. Cloud: moss-image image_size = canvas with expansion off; flux-3 and ideogram-4-5 own compilers; others plain sentences plus a line, and 'Use MOSS-Image' when offered. fal seeds kept on t2i/edit outputs. No new route; public sign-up unchanged.",+ "left": [+ "Real MOSS-Image, FLUX.3, Ideogram 4.5 renders need a GPU or fal key",+ "fal's single seed reused for num_images > 1",+ "oss-ideogram-4 could become a box reader once compileIdeogram is checked against its schema",+ "Touch has no Shift to start a box over another (use Add box)",+ "Layouts elsewhere are N7-8",+ "Docs: fal seed kept as meta.seed; KIND_COLOR, inkOn, keyResizedBox in layout-edit.ts; layoutNotes, layoutBoxModel in composer.ts"+ ],+ "blocked": ""+ },+ "merge": {+ "merged": [+ "o/n7-2-layout-mode"+ ],+ "notMerged": [],+ "conflicts": "none",+ "checks": "typecheck 0, lint 0, vitest 278 files / 4445 passed, 3 skipped (exit 0)",+ "pushed": true,+ "head": "bc458e7f"+ }+}diff --git a/docs/handoff/reports/nm10-kling-4.json b/docs/handoff/reports/nm10-kling-4.jsonnew file mode 100644index 00000000..01dd2b61--- /dev/null+++ b/docs/handoff/reports/nm10-kling-4.json@@ -0,0 +1,156 @@+{+ "key": "nm10-kling-4",+ "impl": {+ "branch": "o/nm10-kling-4",+ "summary": "Re-read all four fal kling/v4 OpenAPI schemas on 2026-11-01. I extended scripts/fetch-hosted-schemas.py with --part4 (refreshes research part 4's records in place) and fixed its parser to keep min/maxLength and fal's file limits. All four endpoints are status active in fal's catalog, and their llms.txt pages show fal.run endpoints with no 'coming soon'; I flipped the records to active with checked=2026-11-01. I also read Replicate's official kwaivgi/kling-v4.0 (version f4dc4504, 2026-10-26) and added it as a second provider for t2v, i2v and flf2v only. Those map cleanly. Its references (numbered @image_1 across start, middle, end and reference images) and edits stay on fal, because Replicate has no shots or elements. The kling-4 model is generated with t2v, i2v+flf2v, ref2v, v2v, video-swap and video-insert; the Kling family's existing last-frame extend applies automatically. Badges are top, 30s and new. Defaults are 1080p, 5 s, 16:9; it takes any whole second from 3 to 30, and aspect ratios 16:9, 9:16, 1:1, 21:9 and auto. In the Video studio's Best list it sits right after Seedance 2.5. Shots map to multi_prompt (whole seconds, each prompt cut to 512 characters, the take as long as its shots), so a 30 s Cinema take is one call. @mentioned characters and props become Kling elements (@Element1..: a photo plus up to 3 angles, or a clip as a video element); locations and styles stay reference images. The mention menu says 'voices: not yet'. Edits, reference clips and clip elements are priced with a new Pricing.clipInput rule: max(input + output, 2x output) seconds at $0.094/$0.141 per second. The plan prices runs with clips at that minimum until the server reads the clip headers, then re-prices. Edit video's picker shows '$0.141/sec in+out', and a line under the composer says what is billed before the total (e.g. '4 s in + 4 s out: billed on 8 s at $0.141/s'). The clip limits (3-30 s, 700-4553 px a side, 30 s of clips in all) are checked in the composer and on the server before any paid call. Kling 4.0's edit is listed in Genjutsu's Object swap and Insert (prompt uses @Video1 and @Image1..). Cinema offers kling-4 after Seedance 2.5. I fixed the keyframes.ts comment so it no longer promises Kling keyframes. The licence row comes out automatically as 'Paid API · fal, Replicate' (Kuaishou), switched on.",+ "built": [+ "docs/research/paid-model-apis-4.json: the 4 kling/v4 records refreshed and set active (2026-11-01); a new replicate kwaivgi/kling-v4.0 record; the Kling 4 recommendations and gap entry updated",+ "scripts/fetch-hosted-schemas.py: --part4 mode, parser keeps maxLength and limit_description, reads the Replicate latest version and billing tiers",+ "scripts/gen-cloud-models.py: kling-4 model (TODO removed); FieldMap.elements for models in ELEMENT_MODELS (kling-4 only); multiShot.maxPrompt/integer; an edit's reference clips (video_urls) map beside its source clip",+ "src/lib/catalog/types.ts: Badge '30s', FieldMap.elements and multiShot.maxPrompt/integer, ModelOptions.elements, GenParams.elements and clipSeconds, Pricing.clipInput",+ "src/lib/catalog/payload.ts: elements built from params.elements (the files they take leave image_urls and video_urls); whole-second shots; duration = sum of shots",+ "src/lib/catalog/elements.ts: applyMentions turns characters and props into Kling elements; elementsNote()",+ "src/lib/catalog/plan.ts: clipBilling() and estimateCost's in+out rule; clipSeconds=0 marker for runs with clips",+ "src/lib/catalog/clip-windows.ts: kling-4 window 3-30 s, clipSizeProblem (700-4553 px), clipTotalProblem (30 s in all); clip-lengths.ts LENGTH_RANGES kling-4 [3,30]",+ "src/lib/catalog/cinema.ts: kling-4 in CINEMA_MODELS; a single take on a model with a length range gets the exact length asked (MiniMax H3 keeps its 5/10/15)",+ "src/lib/catalog/genjutsu.ts: kling-4 maker for swap and insert, using the O3 @Video1/@Image prompt",+ "src/server/generations.ts: reads reference clip headers through readRef (prepClip), refuses more than 30 s in all, re-prices; checks the edit's clip size; src/server/request-schema.ts accepts params.elements",+ "UI: model-picker (30 s badge, edit price in+out), prompt-input (elements note), composer (clipOutcome billing line, clipBlocker size check), model-rows pickerPrice(edits)",+ "src/lib/catalog/keyframes.ts: comment fix",+ "tests: tests/kling-4.test.ts, tests/account-kling-clips.test.ts, tests/e2e/kling-4.mjs; updated cloud-catalog-4, cinema-models and genjutsu tests",+ "docs/research/new-models-10.md: correction note in §7"+ ],+ "tests": "Vitest: kling-4 (23) and account-kling-clips (2) pass. A ~100-file related subset passes (1159 + 561 tests). tsc clean, eslint clean on the changed files. The kling-4 tests cover: payloads for each route against the stored schemas (21:9, 1080p default, multi_prompt sum = duration and 512-character shots, start/end frames on fal and Replicate, 4 reference clips on the edit with no duration sent, 7 elements with views and a video element, the 8th group dropped); prices (5 s at 720p = $0.785; 10 s edit at 1080p = 20 s x $0.141 = $2.82; reference clips at max(in+out, 2x out)); the Cinema 30 s three-shot take as one call; the mock provider on every route; the licence row; the Best list; Frames support = ends; the clip limits; and Genjutsu prompts and limits. Browser: tests/e2e/kling-4.mjs passed at 1440 and 390 px, light and dark, in demo mode (Video studio Best list and @ menu, a Cinema Kling 4.0 demo take, Edit video price, billing line and the 700 px refusal, no sideways scroll). It flaked once on reading the model chip before hydration; I added a wait and the rerun passed in full. The dev server was stopped and .next removed (then `npx next typegen` regenerated types for tsc). No paid call to fal or Replicate could be made here.",+ "left": [+ "No real fal or Replicate call was made: the live payloads, the edit's output audio (Genjutsu puts the clip's sound back, keepsSound false) and the final billed amounts still need a key to confirm.",+ "Voices: Fuobe has no flow for fal's kling-video/create-voice, so voice_ids and element voice_id are never sent ('voices: not yet' in the @ menu). A follow-up could add it.",+ "fal's middle_image_urls (8 ordered keyframes with no times) and Replicate's middle_images are not mapped. Frames mode stays on FLUX 3 Max, and Kling 4.0 takes only the first and last frame there. A follow-up could map untimed keyframes.",+ "Kling O1/O3 also record elements; they still send @mentions as reference images (ELEMENT_MODELS = {kling-4}).",+ "maxShots stays at the generator's default of 6 (fal's schema gives no maximum).",+ "Remove Object is not given a kling-4 route (the brief only asked for Edit video and Genjutsu Swap/Insert).",+ "Video studio reference-clip lengths aren't measured in the browser: runs with clips are priced at their minimum (2x output) until the server reads the clip headers.",+ "300 MB check: the media slot already refuses files over 200 MB in every studio (stricter than Kling's 300 MB), so no extra check was added."+ ],+ "docsNotes": "STATUS/ARCHITECTURE not edited (the brief didn't ask). For the docs pass: (1) Kling 4.0 (kling-4) is in the cloud catalog: fal t2v/i2v/flf2v/ref2v/v2v/video-swap/video-insert, Replicate t2v/i2v/flf2v; Video studio Best list, Cinema, Edit video, Genjutsu swap and insert. (2) A new pricing rule, Pricing.clipInput: edits, reference clips and clip elements bill max(input+output, 2x output) seconds; the server measures reference clips and refuses more than 30 s in all. (3) Elements: ModelOptions.elements / FieldMap.elements / params.elements turn @mentions into the API's own elements (Kling 4.0 only). (4) New browser check tests/e2e/kling-4.mjs (demo mode, ComfyUI unreachable, needs ffmpeg) for the DEVELOPMENT.md list and verify.sh. (5) scripts/fetch-hosted-schemas.py --part4 refreshes research part 4 records. Brief out of date: FLUX 3 Max is not in the Video studio's Best list (Best is MiniMax H3, Seedance 2.5, Kling 4.0, Kling 3.0); the edit schema now has video_urls (4) and voice_ids, and i2v/ref2v have middle_image_urls (8, untimed), so 'the hosted API does not take keyframes' is only true of timed keyframes; an element's clip is 3-8 s, not 3-30 s. Research correction made in new-models-10.md §7 and paid-model-apis-4.json. Already in place before this package: the Kling family's last-frame extend chain, native multi-shot plumbing, the paid-API licence rows, and search_models/Assist listing straight from the catalog. Nothing else from the plan was already built (the generator only had the TODO).",+ "blocked": ""+ },+ "review": {+ "findings": [+ {+ "severity": "high",+ "title": "Multi-shot: each shot's own words are cut off when the overall prompt is long (512-character cut keeps the wrong end)",+ "where": "src/lib/catalog/payload.ts clipWords() + buildPayload multiShot branch; src/lib/catalog/plan.ts:384",+ "detail": "planGeneration puts the overall prompt in front of every native shot (`${overall}. ${shot}`). The new maxPrompt rule then cuts that joined text to 512 characters from the start. With an overall prompt of about 500 characters or more (a detailed prompt, Cinema's compiled prompt, or the @mention legend added to it), every shot's own instruction is lost and all shots go to fal with the same text. The top-level prompt is deleted when multi_prompt is sent, so the shot words appear nowhere.",+ "verified": "Probe (planCinema kling-4, three manual shots, a 524-character prompt) -> planGeneration -> buildPayload on the fal route. Every multi_prompt entry was 509 characters, identical, and contained none of the shot text (SHOT-ONE/TWO/THREE). With a 17-character prompt the shots kept their words. The package's test only uses a short overall prompt.",+ "fix": "Keep the shot's words first: cut the overall part to fit (512 minus the shot's length minus 2), or skip the prefix when it doesn't fit. Add a test with a 600-character overall prompt."+ },+ {+ "severity": "medium",+ "title": "'Auto' aspect ratio is offered for text-to-video and sent to endpoints that reject it",+ "where": "scripts/gen-cloud-models.py (kling-4 has no fit_values) -> options.aspectRatios includes 'auto'; payload.ts putEnum",+ "detail": "Only kling/v4/reference-to-video takes aspect_ratio 'auto'. fal's text-to-video enum and Replicate's kwaivgi/kling-v4.0 enum are only 16:9, 9:16, 1:1 and 21:9. The fal enum was re-checked live today. The model's options merge all routes, so the Video studio's aspect picker shows 'Auto' for a text-only run. buildPayload then sends aspect_ratio:'auto' unchanged to fal text-to-video and to Replicate, and both answer 422.",+ "verified": "settingsShape(kling-4,'t2v').aspect = [16:9,9:16,1:1,21:9,auto]. planGeneration with params.aspectRatio='auto' gives a fal t2v payload with aspect_ratio 'auto' and a Replicate payload with 'auto'. Live fal OpenAPI V4TextToVideoInput.aspect_ratio enum = ['16:9','9:16','1:1','21:9'].",+ "fix": "Pass fit_values=True for kling-4, or give the t2v and Replicate routes an `accepts` list, so 'auto' is dropped or fitted. Add a payload test for 'auto' on t2v."+ },+ {+ "severity": "medium",+ "title": "Broken test: the Video studio's Best list changed but tests/open-minimax-h3.test.ts wasn't updated",+ "where": "tests/open-minimax-h3.test.ts:292",+ "detail": "Kling 4.0 now sits after Seedance 2.5 in Best, so Veo 3.1 drops out of the four entries. The existing assertion still expects ['minimax-h3','seedance-2-5','kling-3','veo-3-1'] and fails. The implementer ran only a related subset of tests, so this was missed. The test is unchanged on the current base, so it fails after a rebase too.",+ "verified": "Full vitest run: 276 of 278 files passed. This test fails with Received [minimax-h3, seedance-2-5, kling-4, kling-3].",+ "fix": "Update the expectation, and decide whether losing Veo 3.1 from Best is intended."+ },+ {+ "severity": "low",+ "title": "Branch is behind its base and has a merge conflict in composer.tsx",+ "where": "src/components/studio/composer.tsx (clipOutcome line next to the base's new layoutShape)",+ "detail": "claude/fuobe-parity-4 has moved 12 commits past the merge base. A `git merge-tree` dry run conflicts at the `shape`/`outcome` lines: the base added layoutShape, the branch added `today` to clipOutcome. The fix is trivial (keep both). The other failing test in the full run, tests/no-higgsfield.test.ts (a src/lib/status-page.ts comment), is not caused by this package. The base already fixed it in dc991833, so it passes after a rebase.",+ "verified": "git merge-tree --write-tree claude/fuobe-parity-4 o/nm10-kling-4 reports CONFLICT (content) in composer.tsx. git log shows dc991833 on the base fixed status-page.ts.",+ "fix": "Rebase onto the current base, resolving composer.tsx as `layoutOn ? layoutShape(baseShape) : baseShape` plus `clipOutcome(..., model, today)`."+ },+ {+ "severity": "low",+ "title": "Shot lengths: totals under 3 s pass the planner; rounding can change the total; Replicate gets a fractional duration",+ "where": "src/lib/catalog/payload.ts (ms.integer rounding, duration = sum of rounded shots); plan.ts multi-shot check",+ "detail": "The planner only checks the maximum. The Video studio's shot editor lets shots go down to 1 s, so two 1 s shots send duration 2, below fal's minimum of 3, and get a 422. Each shot is rounded on its own, so the sent total can differ from the priced total (2.4+2.4 is priced at 4.8 s and sent as 4 s), and could go above 30 s in an edge case. When a run with fractional shots goes to Replicate (written-out shots), duration 4.8 is sent to an integer field. The UI uses whole seconds, so this is reached mainly through the API or agent.",+ "verified": "Probe: shots [1,1] -> fal payload duration 2. Shots [2.4,2.4] -> plan duration 4.8 (priced $1.128), fal shots [2,2] with duration 4, Replicate duration 4.8.",+ "fix": "Refuse shots that total under 3 s for kling-4, and round so the total is kept (largest remainder), or round when planning so the price and the payload match."+ },+ {+ "severity": "low",+ "title": "Some of the hosted API's input limits aren't checked before the paid call",+ "where": "src/lib/catalog/clip-windows.ts, src/server/generations.ts, elements.ts",+ "detail": "Not checked before the paid call: a video element's clip must be 3-8 s; the edit's aspect ratio must be 0.40-2.50 and its frame rate 23.9-60.05 fps; the edit takes up to 4 video_urls, but options.maxVideos is 5, from ref2v. On the server, clipWindowProblem and clipSizeProblem run only for op v2v and only when params.duration is unset. Genjutsu swap/insert checks the sides and length on the client. None of these get past fal's own validation, but they fail with a raw provider error rather than Fuobe's words.",+ "verified": "Read the code paths. The research records state the limits.",+ "fix": "Optional follow-up: add the element-clip and aspect/fps checks next to clipSizeProblem."+ },+ {+ "severity": "info",+ "title": "Edit video shows Aspect, Duration and Multi-shot controls that Kling 4.0's edit ignores",+ "where": "src/lib/composer.ts settingsShape (model-wide options)",+ "detail": "For op v2v, settingsShape reads the model-wide options, so Kling 4.0's edit shows aspect (including auto), durations 3-30 and multi-shot. The edit route sends none of these: it keeps the source clip's length and shape. Kling O3 behaves the same way before this package, so this is not a new regression. It is at odds with the owner's 'say plainly what each engine does'."+ }+ ],+ "checks": [+ "Read the full diff (27 files) and the code around it: generator, payload, plan/clipBilling, elements/applyMentions, cinema fitParams, clip-windows, composer clipOutcome/clipBlocker, model-picker, generations.ts prepClip and re-pricing, request-schema.",+ "Regenerated the catalog from the branch's scripts/gen-cloud-models.py and docs in a scratch copy: the output is byte-identical to the committed cloud-models.generated.ts.",+ "Checked the four kling/v4 records and the Replicate kwaivgi/kling-v4.0 record against the routes' field maps. Re-fetched the live fal OpenAPI for text-to-video and reference-to-video: aspect enums confirmed ('auto' only on reference-to-video).",+ "Payload probes through planGeneration and buildPayload on every route: t2v/i2v/flf2v (fal and Replicate), ref2v with a clip (clipSeconds 0, priced at 2x output = $1.41), v2v at 720p and 1080p (10 s source = $2.82 / $1.88), v2v with reference clips, video-swap with @Image refs, and elements (character -> frontal + views, prop clip -> video element, location stays image_urls, shots rewritten to @Element1). All match the schemas apart from the findings above.",+ "Multi-shot probes: 36 s refused, 7 shots refused, fractional and under-3 s totals (finding), and a long overall prompt (finding).",+ "Pricing: clipBilling's max(in+out, 2x out) equals Replicate's rule ('2x output if input shorter, else input+output'). 5 s at 720p = $0.785. The server re-prices after reading the clip headers, and demo mode/mock is skipped.",+ "Public sign-up: no new routes. prepClip reads through the same gate()/readRef as prep, so an account's tenant guard applies. tests/account-kling-clips.test.ts covers input-not-yours/not-allowed and mentionElements() being empty for a tenant. Kling 4.0 is cloud-only, so accounts can't run it on the install's keys.",+ "Licence row (paid-api, fal + Replicate, Kuaishou, switched on), cloud-only engine (not in the open list), Cinema list order, Genjutsu maker (swap/insert, 700-4553 px, 3-30 s, @Video1/@Image prompts), keyframes.ts comment fix: all confirmed. No Higgsfield API use, no LoRA or media files, no ComfyUI graphs or packs added, so the GPU pre-flight board needs no change.",+ "faceless.ts and marketing.ts also call lengthRange; adding kling-4 to LENGTH_RANGES gives whole-second splits there, not a regression.",+ "tsc --noEmit: clean.",+ "Vitest: the package's own files (kling-4, account-kling-clips, cloud-catalog-4, cinema-models, genjutsu) pass, 97 tests. A 56-file related subset passes (696 tests). Full suite: 2 failures out of 4439 tests. open-minimax-h3 is caused by this package. no-higgsfield was already failing at the merge base and is fixed on the current base.",+ "git merge-tree against the current claude/fuobe-parity-4: one trivial conflict in composer.tsx.",+ "Not run: the browser check tests/e2e/kling-4.mjs (needs a dev server; the implementer reports it passed). No paid fal or Replicate call was possible."+ ],+ "verdict": "changes-requested: the catalog, pricing, elements, edits and sign-up handling are sound and match the schemas, but three things need fixing before merge. (1) Multi-shot runs lose each shot's own prompt when the overall prompt is long. (2) 'Auto' aspect is offered for and sent to text-to-video endpoints that reject it. (3) tests/open-minimax-h3.test.ts fails with the new Best list. Rebase onto the current base as well (trivial composer.tsx conflict)."+ },+ "fix": {+ "applied": [+ "HIGH multi-shot prompt cut: planGeneration now puts the shot's own words first wherever a route caps shot prompts (FieldMap.multiShot.maxPrompt, Kling 4.0: 512). The overall prompt in front is cut at a word to the room left, and left out when fewer than 40 characters fit. payload.ts clipWords is exported for this. Test: a 600+ character overall prompt keeps SHOT-ONE/TWO/THREE whole, each under 512 characters and all different; a shot that fills 512 characters by itself goes alone; a short overall prompt still leads each shot.",+ "MEDIUM 'auto' aspect: kling-4 gets fit_values=True in scripts/gen-cloud-models.py, and the catalog was regenerated (only the kling-4 block changed). Each route now lists the aspect ratios and resolutions it accepts, so 'auto' reaches only reference-to-video. fal text-to-video and Replicate leave it out and use the API's own 16:9. Test: a payload with 'auto' on t2v (fal and Replicate) passes the schema check, 9:16 is still sent to Replicate, and ref2v still gets 'auto'.",+ "MEDIUM Best list: tests/open-minimax-h3.test.ts now expects ['minimax-h3','seedance-2-5','kling-4','kling-3']. Veo 3.1 leaving Best is intended (owner).",+ "LOW shot lengths: new wholeShots() in plan.ts uses largest-remainder rounding to whole seconds and keeps the rounded total, so 2.4+2.4 becomes 3+2. It runs in the plan for models with integer multi-shot routes, so the priced total, the multi_prompt durations and Replicate's duration are the same whole seconds. Totals under the model's minimum (3 s) are refused ('The shots add up to 2s — Kling 4.0 makes 3s or more'), and rounding that goes past 30 s is refused too. Tests cover all of this, including the price ($0.785 for 5 s at 720p) and the schema checks on fal and Replicate.",+ "LOW pre-call limits (clip-windows.ts): SOURCE_FRAME adds aspect 0.40–2.50 to clipSizeProblem and a new clipFpsProblem for 23.9–60.05 fps; elementClipProblem checks 3–8 s clip elements; editClipsProblem allows at most 4 reference clips in an edit, with clip elements counted separately. The plan refuses more than 4 reference clips on v2v/swap/insert. The composer's clipBlocker adds the fps check. On the server, prepClip records clip lengths by input index, so each clip element is checked against 3–8 s. A new block holds an edit whose route sends no duration (Kling 4.0's edit, swap and insert) to the window, sides, shape and fps even when the request named a length. Frame-billed VACE routes are excluded and keep the base's rule. Tests: unit tests in tests/kling-4.test.ts, and a new tests/kling-4-server.test.ts with stubbed fetch: a 3000x700 edit with duration 5 and a 10 s clip element are both refused before any kling/v4 call. That test fails without the server change.",+ "Merged origin/claude/fuobe-parity-4 three times as it moved (dc991833, then bc458e7f with o/n7-2-layout-mode, then 4e51ffbf with o/owner-calls-1). Conflicts resolved by keeping both sides: composer.tsx uses layoutShape plus clipOutcome(..., today); clip-windows, plan, composer and generations keep the base's frame-billed VACE windows (sourceFrames/billedClipSeconds, clipWindowProblem(..., fps)) beside Kling 4.0's checks. The edit-clips check was moved so it no longer collides with the base's layout block in plan.ts."+ ],+ "rejected": [+ "INFO: Edit video shows Aspect/Duration/Multi-shot that Kling 4.0's edit ignores. Not changed. The review marks it informational and older than this package (Kling O3 behaves the same). Fixing it means making settingsShape route-aware for all edit models, which is outside this fix stage. The server now holds such edits to the clip's own limits whatever duration is sent."+ ],+ "checks": [+ "npx next typegen: exit 0",+ "pnpm typecheck: exit 0, after the final merge",+ "pnpm lint: exit 0 (0 errors, 1 warning in scripts/comfy/library.spec.mjs that was already there)",+ "FUOBE_ACCOUNT_DISK_FREE_GB=1 pnpm vitest run --maxWorkers=2 before the last base move: exit 0, 279/279 files, 4443 passed, 3 skipped",+ "After merging bc458e7f (layout mode): exit 0, 281/281 files, 4477 passed",+ "After merging 4e51ffbf (owner-calls-1, final): exit 1, 280/281 files, 4481 passed, 1 failed. The failure is tests/secret-box.test.ts 'opens nothing sealed under another server key', which is flaky and not caused by this package: secret-box.ts caches the key by file mtime and the test rewrites the file within the same mtime tick. It failed 1 of 3 isolated reruns, and neither file differs from the base.",+ "Targeted reruns after the final merge: kling-4, kling-4-server, open-minimax-h3, cinema-models, genjutsu, cloud-catalog-4, edit-video-pricing: 121/121 passed (run before the last merge; covered again by the full run)",+ "Regenerated catalog: the diff is only in the kling-4 block (aspect/resolution accepts)",+ "git merge-base --is-ancestor origin/claude/fuobe-parity-4 HEAD: true at push; .next removed; git status clean; pushed o/nm10-kling-4 (6266bdf5)"+ ],+ "finalSummary": "Kling 4.0 is cloud-only, a closed partner model through fal (t2v, i2v, flf2v, ref2v, v2v edit, video-swap, video-insert) and Replicate (t2v, i2v, flf2v). The open engine is unchanged and 'Open source only' hides it. What this fix changes: multi-shot runs keep each shot's own words within fal's 512-character limit. Shots are whole seconds that add up to the priced total, and totals under 3 s or over 30 s are refused. 'Auto' shape goes only to reference-to-video. The hosted API's clip limits are checked before any paid call, in Fuobe's own words: an edit's clip at 3–30 s, 700–4553 px, shape 0.40–2.50 and 23.9–60.05 fps; clip elements at 3–8 s; at most 4 reference clips in an edit; 30 s of clips in all. Verified: payloads against the stored fal/Replicate schemas, pricing, the server refusing before fal with fetch stubbed, and the full test suite. Built but not verified live: no fal or Replicate key was available, so real payloads, billing and edit audio still need a paid call. Nothing needs a GPU. Public sign-up: guests browse only. Accounts run only on their own ComfyUI, so they cannot run Kling 4.0 on the install's keys; their clip reads go through readRef/account-inputs as before (tests/account-kling-clips.test.ts). No new routes.",+ "left": [+ "No real fal or Replicate call made: live payloads, billed amounts and the edit's output audio still need a key.",+ "Voices (fal create-voice / voice_ids) still not built ('voices: not yet').",+ "middle_image_urls (untimed keyframes) not mapped; Frames stays on FLUX 3 Max.",+ "Edit video still shows Aspect, Duration and Multi-shot controls for Kling 4.0's edit (settingsShape is model-wide); a route-aware settings shape would fix this for all edit models.",+ "Genjutsu's client check doesn't do the shape/fps check for Kling 4.0 (the server refuses before fal).",+ "tests/secret-box.test.ts is flaky on the base (mtime-cached key): worth a fix in its own package.",+ "Browser check tests/e2e/kling-4.mjs was not re-run in this stage."+ ],+ "blocked": ""+ },+ "merge": {+ "merged": [+ "o/nm10-kling-4"+ ],+ "notMerged": [],+ "conflicts": "none",+ "checks": "typecheck 0, lint 0, vitest 281 files / 4482 passed, 3 skipped (exit 0); separate commit bcfeb63 fixes the flaky secret-box test",+ "pushed": true,+ "head": "bcfeb63d"+ }+}diff --git a/docs/handoff/reports/owner-calls-1.json b/docs/handoff/reports/owner-calls-1.jsonnew file mode 100644index 00000000..7ffe83b3--- /dev/null+++ b/docs/handoff/reports/owner-calls-1.json@@ -0,0 +1,121 @@+{+ "key": "owner-calls-1",+ "impl": {+ "branch": "o/owner-calls-1",+ "summary": "Evolution's cloud route now runs fal's hosted Wan 2.2 Fun VACE depth, the GPU recipe's model (LTX-2.3 removed): per piece of up to 10 s, a direction frame from hosted Qwen-Image-Edit 2511 (the GPU's instruction, first 3 references), then VACE with preprocess on and the frame as first_frame_url, the clip's sound put back, priced before running. The endpoint has no strength field, so the change level shapes only the direction frame in the cloud and the page says so in one line; cloud sizes are 480/580/720p. Fuobe Speak keeps its name; its menu line and Settings → Models & licences (new ModelDef.engineNote) say the GPU adds FusioniX and the cloud runs fal's InfiniteTalk without it. No hosted InfiniteTalk takes a LoRA (fal checked; Replicate only at likely names, no token for search). Marketing's Standalone shot stays GPU-only and its cloud menu line says so. New generated eval suite dop-mixed-media (8 of the 32 effects, Fuobe DoP vs Kling 2.5 Turbo, blind), marked runFirst paid-keys, with the revert rule in the README and STATUS. Audit: camera paths hold 24 keyframes on the GPU again (the cloud still simplifies to H3 Max's 12).",+ "built": [+ "src/lib/catalog/evolution.ts: cloud plan on hosted Wan 2.2 Fun VACE (cloudPieces, cloudReferences 3, cloudFrameModel, EVOLUTION_CLOUD_NOTE, cloud fps/frame checks); nearestShape, CLOUD_SHAPES, videoStrengthFor removed",+ "scripts/gen-cloud-models.py + cloud-models.generated.ts: fuobe-evolution on fal-ai/wan-22-vace-fun-a14b/depth (preprocess fixed, match_input_* defaults, images and aspectRatio dropped, per-video-second pricing, Apache-2.0)",+ "docs/research/fuobe-originals-recipes-5.json/.md: Evolution cloud record rewritten, depth schema re-fetched 2026-11-01, GPU direction-frame model corrected, Speak loraCheck",+ "models.ts: Evolution cloud options (no Change control, optional direction frame), Speak tagline, engineNote on Speak / Evolution / Marketing Image",+ "ModelDef.engineNote shown in Settings → Models & licences (ModelEntry, accessList, model-access-view, search)",+ "marketing.ts: cloud Standalone menu line says the cut-out and relight run on your GPU only",+ "server/evolution.ts and evolution-tool.tsx: cloud notes and copy",+ "eval: dop-mixed-media suite (gen-cases.mjs), schema fields runFirst and decides, validate marks it, README rule",+ "camera-path.ts: MAX_KEYS 24 (GPU), cloud still simplified to 12",+ "STATUS and ARCHITECTURE lines for these changes"+ ],+ "tests": "Typecheck and eslint clean on changed files. Vitest passed: evolution (16), evolution-api (7), evolution-comfy, open-tools, originals-marketing, eval-harness (42), cloud-catalog-4, cinema-original, cinema-path, camera-path, model-access*, licences, dop*, marketing*, public-signup*, shorts*, cinema* (33 files / 519 in one run, plus the others). Browser: popcorn-evolution.mjs at 1440 and 390, light and dark, with placeholder results on: all Evolution checks pass (121 ok, including the new cloud ones); 4 failures are the Storyboard 'next-scene LoRA' check, a page this package doesn't touch, suspected from 244bed92 but not checked on the base. A one-off check of Settings → Models & licences found the Speak and Evolution lines, no sideways scroll at both widths and themes. No GPU, live ComfyUI run or paid key.",+ "left": "Nothing rendered: fal's preprocess on an RGB clip, how far the direction frame carries each change level in the cloud, and the joins are unverified. The dop-mixed-media run needs paid keys. Follow-ups: Shorts' GPU first-frame edit is capped at 2 references though its model takes 3 (not cloud-caused); Marketing Image runs Qwen-Image 2.1 on the GPU vs 2511 in the cloud; the audio loop's cloud length is held to the GPU's 600 s limit (the reverse case); a hosted Standalone shot could use fal's Qwen-Image-Edit 2509 LoRA route plus a fal background remover. The Storyboard e2e failure needs a look.",+ "docsNotes": "STATUS and ARCHITECTURE lines edited for Evolution (row, gaps), Speak, the owner-calls bullet (now built), Marketing Standalone, dop-mixed-media (measured list, first-run rule) and the fly path (24 keys). The STATUS test counts aren't updated. The docs pass may want a FEATURES line for engineNote and for Evolution's cloud now being the GPU's model. Out of date in the brief: the Evolution docs said the GPU frame model was Qwen-Image-Edit 2511 with 2 refs; the code has used Qwen-Image 2.1 Turbo with 3 since 244bed92. Public sign-up is unchanged: no new route; Models & licences only gains a text line.",+ "blocked": ""+ },+ "review": {+ "findings": [+ {+ "severity": "medium",+ "title": "Edit video (and API) cloud runs of fuobe-evolution are priced as 5 s whatever the clip, and no clip window is checked",+ "where": "src/lib/catalog/models.ts (fuobe-evolution: defaults { duration: 5, ... }); src/lib/catalog/plan.ts estimateCost / clipEditSeconds; src/server/generations.ts ~1570; src/lib/catalog/clip-windows.ts",+ "detail": "Under LTX-2.3, duration set num_frames, so the default 5 s was what was made and billed. fal's VACE depth route has match_input_num_frames on and no duration or num_frames mapping, so the clip's own length is rendered. But planGeneration merges model.defaults, so params.duration = 5 always, and estimateCost uses params.duration before clipEditSeconds/sourceDuration. The server's re-price for a clip edit (generations.ts) also passes plan.params with duration 5. The composer's cloud half has no length control, and Edit video lists fuobe-evolution on the cloud (modelsFor v2v). This is a regression: a direct cloud Evolution run shows a fixed $0.50 at 720p. fal bills frames ÷ 16: a 20 s clip at 30 fps is about $3.75. fuobe-shorts on the same route has no default duration, so it is priced by the clip's length. Neither model has a SOURCE_SECONDS window, so a clip over 241 frames is sent whole to fal's VACE, which allows at most 241 frames. Before, LTX made 5 s from any clip.",+ "evidence": "A scratch vitest probe (outside the repo) ran planGeneration on {modelId fuobe-evolution, engine cloud, op v2v, video only} and got params.duration 5. estimateCost with sourceDuration 20 gave 0.5, and with 4, 10 or 30 s it was also 0.5. The same probe on fuobe-shorts gave 0.4 / 1 / 3 (2 at 20 s).",+ "fix": "Move duration: 5 into engineDefaults.open, since only the GPU half has durations [3,4,5]. Give the cloud half a window, and price direct runs by frames ÷ 16 (Shorts' originalBilledSeconds / billFps), or keep fuobe-evolution's cloud route out of Edit video. Add a test that a direct cloud run's price follows the clip."+ },+ {+ "severity": "low",+ "title": "Marketing Standalone is not GPU-only in the cloud as the brief says: it still runs on a different hosted model, only labelled",+ "where": "src/lib/catalog/marketing.ts formatModels (product-standalone); src/lib/catalog/models.ts fuobe-marketing-image engineNote",+ "detail": "The brief says 'Marketing Image's Standalone shot stays GPU-only while its graph has no hosted copy'. The cloud still makes a Standalone shot as a hosted Qwen-Image-Edit 2511 edit. The GPU recipe is BiRefNet plus Qwen-Image-Edit 2509 and the White_to_Scene LoRA. The cloud's menu line now says the cut-out and relight run on your GPU only, and Settings shows an engineNote. Engine mode 'Paid APIs only' does not hide or refuse it. Under the 'no substitute model' rule this is a different model doing the same job. The implementer read the brief as 'the recipe stays on the GPU' and lists a hosted 2509 + LoRA route as a follow-up: fal hosts 2509 with LoRAs (the Storyboard's next-scene LoRA runs there). The owner should confirm which reading they meant.",+ "evidence": "git diff of marketing.ts and models.ts. tests/originals-marketing.test.ts expects the cloud Standalone choice to stay, with the new note.",+ "fix": "Either make the cloud Standalone choice say it runs on your GPU and refuse or hide it in the cloud, or build the hosted 2509 + White_to_Scene route plus a hosted cut-out. If the current reading stands, record it as the owner's call."+ },+ {+ "severity": "low",+ "title": "The cloud sends the direction frame as first_frame_url, while the GPU graph uses it as VACE reference_image; the endpoint has ref_image_urls",+ "where": "scripts/gen-cloud-models.py (fuobe-evolution route drop ['aspectRatio','images']); src/lib/catalog/evolution.ts planEvolution cloud branch; tests/evolution.test.ts (asserts no ref_image_urls)",+ "detail": "In video-evolution-wan22-fun-vace, node 15 WanVaceToVideo takes the direction frame as reference_image and starts from the noised clip latent. The cloud sends the same frame as first_frame_url, which pins frame 0, and drops VACE references. fal's live depth schema (31 inputs, fetched in this review) does have ref_image_urls. This copies Fuobe Shorts' cloud recipe, not the GPU Evolution graph, which the brief asked to mirror 'as far as the hosted endpoint allows'. The docs say the cloud runs 'the way Fuobe Shorts runs it' but never note that the frame's role differs. The test pins the current choice in place.",+ "evidence": "workflows/comfyui/video-evolution-wan22-fun-vace.json node 15 inputs. curl of fal's openapi for fal-ai/wan-22-vace-fun-a14b/depth lists ref_image_urls and first_frame_url.",+ "fix": "Decide and say which it is: send the frame as ref_image_urls (closer to the GPU), as both, or keep first_frame_url and record the difference in the research JSON and ARCHITECTURE. The dop/evolution eval could compare the two."+ },+ {+ "severity": "low",+ "title": "The estimate doesn't carry the cloud line or fal's high-fps billing note; small copy and docs leftovers",+ "where": "src/server/evolution.ts planInput / createEvolution; src/lib/catalog/evolution.ts:80 comment; docs/FEATURES.md:66",+ "detail": "(a) The comment on EVOLUTION_CLOUD_NOTE says 'the page, the estimate and Settings say it', but the estimate's notes never include it. Only the page and Settings (engineNote) do. (b) Shorts' estimate adds 'fal bills this clip's N fps as X× its length' for clips above 16.5 fps, and Evolution's cloud estimate on the same billing has no such note, so a 30 fps clip costs about 1.9× its length without a word. (c) createEvolution's resolution refusal still joins with ' or ' ('Pick 480p or 580p or 720p'); evolutionProblem was fixed to read '480p, 580p or 720p'. (d) docs/FEATURES.md still says the fly path holds 'up to 12 keyframes in all', but MAX_KEYS is now 24 on the GPU. (e) STATUS test counts are not updated, as the implementer notes.",+ "evidence": "grep: EVOLUTION_CLOUD_NOTE is used only in evolution-tool.tsx; server/evolution.ts has no fps note. FEATURES.md:66.",+ "fix": "Add the note and the fps billing line to the cloud estimate notes. Use the same list join in createEvolution. Update FEATURES.md's fly path line and the STATUS counts in the docs pass."+ }+ ],+ "checks": [+ "Read the full diff claude/fuobe-parity-4...o/owner-calls-1 (32 files) and the code around it: evolution.ts, server/evolution.ts, shorts.ts cloud Original, plan.ts estimateCost, generations.ts, eval plan/recipes, scene-path.tsx.",+ "Regenerated cloud-models.generated.ts from a git-archive copy with scripts/gen-cloud-models.py: identical to the committed file.",+ "node scripts/eval/gen-cases.mjs --check: in sync (dop-mixed-media: 8 effects).",+ "The fuobe-evolution cloud route is field-for-field the same as fuobe-shorts' VACE depth route (preprocess fixed, match_input_* defaults, first_frame_url, resolution accepts), so payloads match the research endpoint.",+ "Fetched fal's live OpenAPI for fal-ai/wan-22-vace-fun-a14b/depth: 31 inputs, no strength or denoise field (the research is right), ref_image_urls present.",+ "Fetched fal's OpenAPI for fal-ai/infinitalk, /video-to-video and /single-text: no LoRA field, as the research says. Replicate's search page is client-rendered, so a model under another name couldn't be ruled out here either (acknowledged in the research).",+ "The GPU graph video-evolution-wan22-fun-vace uses the direction frame as WanVaceToVideo reference_image (finding 3).",+ "The GPU's Evolution capabilities are not weakened: the open half keeps the denoise Change control, durations [3,4,5], requires the direction frame, maxImages 1, aspectRatios auto + VID_AR, and 480p/720p (checked in a probe).",+ "Qwen-Image-Edit 2511 cloud takes up to 10 images, so frame + 3 references fits.",+ "Camera path: MAX_KEYS 24 is accepted by cinema-schemas, and toH3MaxTrajectory simplifies to 12 in the cloud with a note. The key chips scroll (overlay) or wrap (panel).",+ "DoP Mixed Media suite: the partner variant (kling-2-5-turbo) keeps presetId, but relightStep only runs the prestep when the preset's route model matches, so Kling runs on the preset's words. The test asserts all 8 presets' cloud model is fuobe-dop.",+ "Public sign-up: no new route, estimate or file path. The Models & licences entry gains only a text field.",+ "Vitest: evolution, evolution-api, evolution-comfy, open-tools, originals-marketing, camera-path, cinema-path, eval-harness, cloud-catalog-4, licences (10 files, 204 passed). Also model-access*, public-signup, shorts, marketing* (11 files, 203 passed).",+ "tsc --noEmit: no errors other than the Next typegen globals (LayoutProps/PageProps/RouteContext), which come from the environment. eslint on the changed src files and gen-cases.mjs: clean.",+ "Browser checks not re-run (no app started in this review). The Storyboard 'next-scene LoRA' e2e failure the implementer reports is on text from storyboard-view.tsx, which this package doesn't touch."+ ],+ "verdict": "changes-requested: the core work is sound (Evolution's cloud is on hosted Wan 2.2 Fun VACE with matching payloads, Speak labels, the DoP blind suite, the GPU path keys restored) and tests pass, but fix the medium pricing regression for direct cloud Evolution runs (stale 5 s default, no clip window) before merge. The other three findings are low (the owner's call on Standalone, the frame-role choice, docs and notes) and can go with the docs pass or as follow-ups."+ },+ "fix": {+ "applied": [+ "Medium (pricing): confirmed. planGeneration merged defaults.duration 5 into every cloud Evolution run, so a direct run cost $0.50 whatever the clip. Changed: duration 5 now sits in engineDefaults.open only (the GPU half's durations stay 3/4/5). New SOURCE_FRAMES in clip-windows.ts covers fuobe-evolution, fuobe-shorts and fuobe-genjutsu-restyle (fal's Wan 2.2 Fun VACE depth route, match_input_num_frames on). On the cloud only, a clip sent whole is billed as frames ÷ 16 through billedClipSeconds, using GenParams.sourceFps (new, sent by the composer from the clip header and accepted by request-schema) or the server's header read, or 30 fps when unknown. Clips outside 17–241 frames are refused by clipBlocker in the composer and in generations.ts submit before fal is called. The server re-prices when the header's rate differs from the caller's. Tests in evolution.test.ts (params.duration is undefined in the cloud and 5 on the GPU; price follows the clip: 4 s at 30 fps $0.75, 8 s at 16 fps $0.80) and edit-video-pricing.test.ts (prices, the 241-frame message, no window on the GPU, server re-price $0.50 → $1.125 for 6 s at an assumed 30 fps, a 20 s clip refused with nothing sent to fal).",+ "Low (Marketing Standalone): confirmed. The guidance's condition to build a cloud route was not met. fal hosts BiRefNet (fal-ai/birefnet/v2) and 2509 with LoRAs by URL (fal-ai/qwen-image-edit-plus-lora), but nothing hosted puts the cut-out on white: the live schemas of birefnet/v2 and bria/background/remove, read 2026-11-01, have no background colour. So the Standalone shot is now unavailable in the cloud. ModelChoice gains `unavailable` (the reason) and `pickable`. The cloud Standalone menu lists Fuobe Marketing Image last and greyed (aria-disabled) with STANDALONE_CLOUD_NOTE ('Fuobe Original · runs on your GPU only: the cut-out on white and the White_to_Scene relight have no hosted copy') and starts on Bria Product Shot. planMarketing refuses the Original in the cloud: 'Fuobe Marketing Image makes Standalone shots on your GPU only (…): switch to your GPU, or pick another model'. The page doesn't send such a pick to the cloud. engineNote, the research JSON (studios[marketing].original.cloud.productShot), ARCHITECTURE and STATUS are updated. Tests: originals-marketing (menu, pickable, refusal, GPU unchanged), marketing-api (cloud default is now bria-product-shot) and the marketing-originals.mjs browser check.",+ "Low (direction frame): mirrors the GPU graph. In video-evolution-wan22-fun-vace, WanVaceToVideo takes the frame as reference_image and no start frame, so the cloud now sends it as ref_image_urls and drops first_frame_url (gen-cloud-models.py drops `image`, not `images`; regenerated). No good reason was found to keep first_frame_url: it pins frame 0, which the GPU doesn't. The choice is recorded in research studios[evolution].original.cloud.video and the new .frameRole, the recipes .md, the generator comment, ARCHITECTURE and STATUS. Tests assert the payload has ref_image_urls and no first_frame_url, and read the GPU graph's reference_image wiring.",+ "Low (copy/docs): the cloud estimate now includes EVOLUTION_CLOUD_NOTE, 'fal bills this clip's N fps as X× its length (video seconds at 16 fps)' above 16.5 fps, and Shorts' downsample note above 30 fps. createEvolution's resolution refusal reads 'Pick 480p, 580p or 720p' (shared resolutionChoices). FEATURES.md's fly path says 24 keyframes on the GPU, simplified to H3 Max's 12 in the cloud. The STATUS Evolution GPU column is corrected to Qwen-Image 2.1 Turbo with 3 references. STATUS gains this run's test count. Tests are in evolution-api.test.ts.",+ "Base moved during the session (claude/fuobe-parity-4 bc458e7, the n7-2 merge). The branch was not behind it at the start, so it was merged in once, cleanly, and all checks were re-run after the merge."+ ],+ "rejected": [+ "None of the findings. Out of scope here: the Storyboard 'next-scene LoRA' check in popcorn-evolution.mjs, and the three open-engine Photodump/Fashion checks in marketing-originals.mjs. Both expect old model names (Qwen-Image-Edit 2511 on the GPU, from before 244bed92) on pages this package doesn't touch."+ ],+ "checks": [+ "pnpm typecheck (after npx next typegen, re-run after the merge): exit 0.",+ "pnpm lint: exit 0. Its one warning (WAN_NEG_EN unused in scripts/comfy/library.spec.mjs) was already there.",+ "FUOBE_ACCOUNT_DISK_FREE_GB=1 pnpm vitest run --maxWorkers=2 after the merge: 278 files, 4,453 tests: 4,449 passed, 3 skipped, 1 failed. The failure is tests/secret-box.test.ts 'opens nothing sealed under another server key', not touched by this branch. It passed 3 of 3 runs on its own, so it looks load-flaky. The run's exit code was 1 because of it. An earlier run before the merge also hit no-higgsfield on src/lib/status-page.ts; the base fixed that in dc991833 and it passes after the merge.",+ "Targeted runs: evolution (18), evolution-api (7), edit-video-pricing (5), originals-marketing (22), marketing-api (24): all pass.",+ "Re-running scripts/gen-cloud-models.py leaves no diff; node scripts/eval/gen-cases.mjs --check is in sync.",+ "Browser (next dev, demo mode, isolated data dir): popcorn-evolution.mjs at 1440 and 390, light and dark: 121 ok, including the new cloud note check. The only failures are the 4 Storyboard next-scene LoRA checks, outside this package and reported by the implementer before this fix.",+ "marketing-originals.mjs: 20 ok, including the new 'cloud: Standalone's first model is a partner' and 'lists the Original as running on your GPU only'. 3 open-engine Photodump/Fashion checks fail on stale model names, then the script stops at line 155, before its layout pass.",+ "Because the script stopped early, a one-off script checked the Standalone menu separately at 1440 and 390, light and dark: the Original is greyed with its line, with 0 px sideways scroll.",+ ".next deleted, dev server stopped, git status clean; pushed o/owner-calls-1 (f6e088ff..b6a1a628)."+ ],+ "finalSummary": "Cloud engine: Fuobe Evolution runs fal's hosted Wan 2.2 Fun VACE depth, the GPU's model. Per piece of up to 10 s, a direction frame from hosted Qwen-Image-Edit 2511 (first 3 references) is now sent as VACE's reference (ref_image_urls), as the GPU graph does; the clip's sound goes back on; the run is priced first. Because the endpoint has no strength field, the change level shapes only the direction frame, and the page, the estimate and Settings say so. Direct cloud runs from Edit video or the API are now priced on the clip's frames ÷ 16 and held to 17–241 frames; this also applies to Fuobe Shorts and Genjutsu Restyle on the same endpoint. Fuobe Marketing Image's Standalone shot is GPU-only, and the cloud says so in its menu. Fuobe Speak's labels, the dop-mixed-media eval rule and the GPU's 24-key paths are unchanged from the implement stage.\nOpen engine (ComfyUI): unchanged. Evolution keeps the denoise Change control, 3/4/5 s, a required direction frame, 480p/720p, and its 5 s default. The Standalone shot keeps BiRefNet + 2509 + White_to_Scene.\nVerified vs built: all of this is checked by unit and API tests plus demo-mode browser checks. Nothing was rendered: no GPU, no ComfyUI and no paid key were used. Unverified: fal's preprocess on an RGB clip, how well the VACE reference plus depth carries each change level, fal's behaviour for clips above 30 fps sent whole, and the first dop-mixed-media run, which needs paid keys.\nPublic sign-up: no new route or file path. request-schema accepts params.sourceFps, a price hint the server's own header read overrides. Guests and accounts get what they had: accounts run on their own ComfyUI (open engine, free), where none of the cloud pricing applies; Marketing Studio stays self-hosted only for visitors.",+ "left": [+ "A hosted Standalone shot needs a step that puts the cut-out on white. Nothing hosted does it; it could be built as an in-server composite before 2509 + the White_to_Scene LoRA by URL (and Lightning) on fal-ai/qwen-image-edit-plus-lora.",+ "Not yet measured: whether the direction frame works better as the VACE reference or as first_frame_url. The evolution eval suite can compare the two once paid keys exist.",+ "Clips above 30 fps sent whole to fal's VACE (no temporal_downsample_factor on a direct run): fal's behaviour is unknown. Today they are counted at full rate for the 241-frame window and the price.",+ "The browser checks still expect old model names: popcorn-evolution's Storyboard 'next-scene LoRA' check and marketing-originals' open-engine Photodump and Fashion checks (Qwen-Image-Edit 2511 on the GPU, from before 244bed92).",+ "secret-box's replaced-key test can fail under the full run's load.",+ "Follow-ups carried from the implement stage: Shorts' GPU first-frame edit is capped at 2 references; Marketing Image runs Qwen-Image 2.1 on the GPU vs 2511 in the cloud; the audio loop's cloud length is held to the GPU's 600 s limit.",+ "The docs pass may want a FEATURES line for engineNote and for the cloud Standalone note."+ ],+ "blocked": ""+ },+ "merge": {+ "merged": [+ "o/owner-calls-1"+ ],+ "notMerged": [],+ "conflicts": "none",+ "checks": "typecheck 0, lint 0, vitest 278 files / 4450 passed, 3 skipped (exit 0)",+ "pushed": true,+ "head": "4e51ffbf"+ }+}