Skip to content

armgit / fuobe

Public Imported from GitHub
0

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.

Handoff: Skills W7's build reports

Claude4509f87e1ca4
diff --git a/docs/handoff/reports/w2s-w7.json b/docs/handoff/reports/w2s-w7.json
new file mode 100644
index 00000000..455b6cbc
--- /dev/null
+++ b/docs/handoff/reports/w2s-w7.json
@@ -0,0 +1,97 @@
+{
+ "key": "w2s-w7",
+ "impl": {
+ "branch": "o/w2s-w7",
+ "summary": "Skills W7 built on o/w2s-w7 (worktree /home/user/wt/o-w2s-w7, 8 commits, not pushed). A skill can now span studios: recipe version 2 puts {{steps.<key>.output}} in a step's input, tool steps can go anywhere in the order, and each run is kept in a new skill_runs table that a 10 s sweep moves forward. For example a dub, then captions, then a 9:16 cut each start by themselves when the step before finishes. If a step fails, the steps after it fail too and the run says which step failed and why. Studio dry runs now exist: runAsDemo/inDemoScope on AsyncLocalStorage, chooseRoute returns the demo route inside that scope and createGenerations marks the rows request.demo. After a check, what it made goes to the Trash and the studio records it opened are deleted. Save as skill now writes cross-call studio references as step references instead of refusing them. The run's result names the run and the steps that wait, everywhere a skill runs: the Run toast ('See progress'), run_skill, schedules (they go through run_skill) and the CLI (--wait follows the run). The skill dialog has a Runs section showing 'Dub · done → Captions · running → 9:16 cut · waiting' with 'Open in <Studio>'. Already there from earlier packages: W1's runner, checks and Run dialog; W3's run_skill and draftFromThread; W4's schedules and CLI; the request.demo flag with forceDemo in chooseRoute and chainMode; stampRequests; createPipeline's existing option.",
+ "built": [
+ "src/lib/recipe.ts: fuobeRecipe 1|2 (RECIPE_VERSION 2); stepRef/refKey/stepRefs/fieldKind/TOOL_MAKES/isStaged/recipeParts/fillRefs; recipeProblems takes {makes} and checks references: must point at an earlier step, fill the whole field, fit the field's kind; a generate step can't use `after` on a studio step; a dub feeding a later step needs review:false; parts can't loop; v1 keeps the rule that a tool step stands alone. compile() returns kind 'staged' with parts; recipeMarkdown handles staged recipes; RecipeRun gains run/waiting; SkillRunStep/SkillRunView/runLine types",
+ "src/server/demo-scope.ts (new): runAsDemo, inDemoScope; hooked into chooseRoute and createGenerations (src/server/generations.ts)",
+ "src/server/skill-runs.ts (new): startSkillRun, advanceSkillRun (settle, fail what waits, start ready parts through createPipeline or executeTool, stamp studio rows), getSkillRun, listSkillRuns, discardSkillRun (trashes rows plus their batch mates; deletes dub, Layers, Shorts, Faceless episode and Katana records), stopSkillRun, sweepSkillRuns, ensureSkillRunSweep (started in src/instrumentation.ts)",
+ "src/server/recipes.ts: compileRun/planRun/planHash/asDemo/planCheck handle staged recipes. Each part is priced with stand-ins for references; a video-to-video studio step is priced on the clip it takes. Tool plans whose only error is 'connect a provider' are re-planned inside runAsDemo. runRecipe starts one skill run per row. The demo check now runs studio dry runs, for a single-tool recipe as well. The real check follows a staged run",
+ "src/server/recipe-builder.ts: draftFromThread no longer refuses (STUDIO_WAIT removed); linkStudios writes step references, and in a chat draft tool steps can sit beside other steps (v2). The Library builder is unchanged (still one studio step per skill)",
+ "src/server/db.ts: one appended migration (the last entry, 27 after 26 assist_schedules.skill_json): skill_runs(id, skill, status, values_json, state_json, created_at, updated_at) plus indexes. skill_runs values_json/state_json added to ASSET_REFS",
+ "GET /api/assist/skills/[name]/runs (src/app/api/assist/skills/[name]/runs/route.ts)",
+ "UI: src/components/assist/skill-runs.tsx (new Runs section, polls every 3 s while a run is going), mounted in skills-view.tsx SkillDetail for the owner with one line; the Run toast in run-skill-dialog.tsx says which steps wait, with 'See progress'",
+ "run_skill (src/server/assist/skill-tools.ts): each run's result includes run and waiting, and a note telling the agent not to start the waiting steps itself",
+ "CLI bin/lib/commands.mjs: skills run names the steps that wait and the progress URL; --wait/--out poll the runs route until the run ends, then wait for and save every step's results; docs/cli.md updated",
+ "Docs: ARCHITECTURE.md migration row 27 and a 'Skills that span studios' bullet; skills/README.md describes v2; docs/handoff/verify.sh DEMO_CHECKS gains skills-span",
+ "Browser check tests/e2e/skills-span.mjs"
+ ],
+ "tests": "New tests/skill-runs.test.ts (8 tests, pass): v2 problems and parts; compile and fillRefs; dub → captions → reframe in demo mode starts the dub, waits, then the rest, each step taking the one before's video, all stamped; run_skill result names the run and the waiting steps; a failed dub fails the rest ('Dub failed: No speech found in the clip', the others 'Didn't start: … failed'); state survives a restart (vi.resetModules, then the run finishes from skill_runs); runAsDemo runs add_captions on mock with Demo mode off; the studio dry run with Demo mode off passes, deletes the dub session, leaves no skill_runs row, and everything it made is in the Trash. Updated and passing: recipe.test (v2 loads), recipes.test (a tool recipe's check now does a studio dry run), assist-skill-tools.test (a generate result going into captions and a dub going into captions become step references), cli-run.test (new test for a run that spans studios: --wait/--json), public-signup.test (the runs GET is refused for guests (401) and accounts (403); POST run is refused for accounts), plus library, recipe-builder, mcp and assist-skills, all passing. Typecheck (NODE_OPTIONS=--max-old-space-size=8192 tsc --noEmit) and eslint on the touched files are clean. Browser: tests/e2e/skills-span.mjs passes every check at 1440 and 390 px, light and dark, on pnpm dev -p 3471 with FUOBE_DEMO_MODE=on: seed, free check, priced form, run from the form, the toast, See progress, the Runs section moving on its own to every step done, Open in Translate & dub and Open in Captions, no sideways scroll, no console or page errors. Screenshots were looked over; the server is stopped and .next and the data folder deleted. The one full vitest run (FUOBE_ACCOUNT_DISK_FREE_GB=1 pnpm vitest run --maxWorkers=2, log /tmp/claude-0/w7-vitest.log) was still running when this report was asked for, so its result isn't known yet.",
+ "left": "Read the full vitest result in /tmp/claude-0/w7-vitest.log; failures already known on main are listed in the rules. createPipeline's `existing` option was not used (later generate steps wait for the sweep), so that guess is still untested. The sweep runs every 10 s (the brief's model ran every 30 s), so a later step can start up to 10 s after the step before it finishes. Things that need real keys or a GPU: nothing has run with a paid key or on a GPU. Dry-run cleanup keeps the Ads brand kit a create_ads step makes from a brief and the shared Faceless 'Assist' channel; it deletes the episode. During a dry run the studio rows briefly appear in the Library before they go to the Trash (they aren't the hidden skill-check feature). A dub that feeds a later step must dub in one go (review:false): on the open engine the studio refuses that and the tool's own Library pipeline runs instead. The Library builder (W2) still makes one studio step per skill; only chats span studios. No new ComfyUI graph, node pack, studio or tool, so no pre-flight changes.",
+ "docsNotes": "STATUS.md: add a row or line for Skills W7: skills that span studios; recipe v2 {{steps.<key>.output}}; the skill_runs table (migration 27, the integrator may renumber); 10 s sweep; Runs in the skill dialog; studio dry runs now also run for single-tool recipes, replacing W1's 'plan only'; Save as skill turns cross-call studio references into step references; checked in demo mode only (tests/skill-runs.test.ts, e2e skills-span.mjs). DEVELOPMENT.md and STATUS.md e2e lists: add `node tests/e2e/skills-span.mjs [url]` (demo mode, ComfyUI unreachable). ARCHITECTURE.md line 464 ('Checked …') still says run_skill doesn't exist yet; that predates this package. Add /api/assist/skills/[name]/runs to the Assist row of the route table.",
+ "blocked": ""
+ },
+ "review": {
+ "findings": [
+ {
+ "severity": "medium",
+ "title": "CLI --wait/--out never finishes for a CSV of more than 8 staged rows: the runs route only returns a skill's 8 newest runs",
+ "where": "bin/lib/commands.mjs waitRuns (mine.length === runIds.length); src/app/api/assist/skills/[name]/runs/route.ts calls listSkillRuns(name) with its default limit 8 (src/server/skill-runs.ts listSkillRuns)",
+ "detail": "RECIPE_LIMITS.rows is 50 and runRecipe starts one skill_runs row per CSV row. `fuobe skills run <staged skill> --rows file.csv --wait` with 9+ rows polls GET /api/assist/skills/<name>/runs, which never lists more than 8 runs, so `mine.length === runIds.length` is never true. The CLI waits until --timeout (30 min by default) and exits with EXIT.timeout even though every run has ended, and it never saves the earlier rows' outputs with --out. The same happens with 8 rows or fewer when another run of the same skill (a schedule, the Run dialog) starts while it waits and pushes one out of the newest 8. Verified by tracing; no test covers more than one run (tests/cli-run.test.ts has one staged run).",
+ "fix": "Let the route take ?ids= (or a limit up to RECIPE_LIMITS.rows) and have waitRuns ask for its own run ids, or add GET /api/assist/skills/[name]/runs/[id]; add a CLI test with more than 8 rows."
+ },
+ {
+ "severity": "medium",
+ "title": "faceless_episode is declared to make a video, but its tool result names only the stills, so a step that takes its output always fails and the episode step reads 'done' too early",
+ "where": "src/lib/recipe.ts TOOL_MAKES.faceless_episode = 'video'; src/server/assist/studio-routes.ts facelessRoute.run returns ids: stills.slice(0, 8); src/server/skill-runs.ts startPart/settle/outputOf",
+ "detail": "recipeProblems accepts {faceless_episode} -> {add_captions video: {{steps.ep.output}}} (checked: recipeProblems returns []). At run time the part's ids are the episode's stills (images), so settle() marks the Faceless step done once those pictures finish, while the episode is still animating and mixing in stage two. outputOf(key, 'video') then finds no video and fillRefs throws '“ep” made no video for the next step', so every later step fails after stage one has been paid for. The Runs section also shows 'Faceless Studio · done' while the episode is still rendering. A dry run would catch it (the later step fails, so the check fails), but the format promises a combination it can't run, and a single-step faceless recipe's new studio dry run passes after the stills only and then deletes the episode mid-render. Related: Faceless's stage two is created by its own 2 s sweep outside the runAsDemo scope, so in a dry run with Demo mode off it could start for real if that sweep beats the discard.",
+ "fix": "Either drop faceless_episode from TOOL_MAKES (refuse a reference to it in refProblems) or track the episode, so the part settles on the episode's final generation, and carry the demo mark into stage two."
+ },
+ {
+ "severity": "low",
+ "title": "The demo scope isn't left by outsideRuns, so a long-lived timer first started inside a dry run would route every later run on the install to the demo provider",
+ "where": "src/server/demo-scope.ts; src/server/generations.ts outsideRuns/ensureRunner (outsideTenant/outsideOwnGpu/withoutCandidates only)",
+ "detail": "ensureRunner wraps startRunner in outsideRuns precisely so an AsyncLocalStorage scope isn't captured by the runner's setInterval, but outsideRuns doesn't leave the new demo scope. getGeneration/createGenerations call ensureRunner. If the runner (or its fastTimer after a dev hot reload) is first created inside runAsDemo, every later tick, including advanceDependents re-planning other runs' waiting steps through chooseRoute, would see inDemoScope() true and run as demos. In production src/instrumentation.ts starts the runner at boot, so this is latent (tests and the hot-reload path are where it could bite).",
+ "fix": "Have outsideRuns (or ensureRunner) also run outside the demo scope (for example scope.exit), and do the same for ensureSkillRunSweep."
+ },
+ {
+ "severity": "low",
+ "title": "A 'free' studio dry run with Demo mode off can still call the install's LLM and leave records behind",
+ "where": "src/server/assist/studio-routes.ts adsRoute.run -> createManualBrand -> llmText (src/server/brand.ts), ads copy (src/server/ads.ts); faceless askLlm and restore.ts check getSetting('demoMode') directly",
+ "detail": "runAsDemo only changes chooseRoute and createGenerations. LLM helpers (llmText goes to Claude when an Anthropic key is set) don't look at inDemoScope, so the new dry run of a create_ads step (now run for single-tool recipes too, replacing W1's plan-only check) makes paid Claude calls and keeps the brand kit it made. The implementer noted the kit; the LLM spend isn't noted, and the docs call the check free.",
+ "fix": "Make llmText/askLlm return null (offline wording) inside the demo scope, or skip studio dry runs whose tool writes with an LLM; say it in the notes."
+ },
+ {
+ "severity": "low",
+ "title": "Docs: ARCHITECTURE.md's Checks bullet still says 'Tool steps get the plan check only'",
+ "where": "docs/ARCHITECTURE.md (Checks bullet, line ~460)",
+ "detail": "W7 now runs a studio dry run for tool steps too. The new W7 bullet says so, but the older sentence contradicts it. Left for the docs pass along with the implementer's docsNotes.",
+ "fix": "Update that sentence in the docs pass."
+ }
+ ],
+ "checks": [
+ "Read the stage prompt, binding rules and implementer report; reviewed git diff claude/fuobe-parity-4...o/w2s-w7 (7 commits, 25 files) with the surrounding code (generations.ts chooseRoute/createGenerations/runner, studio-routes.ts, studio-tools.ts, faceless.ts, ads/brand LLM paths, guest-access.ts).",
+ "Public sign-up: GET /api/assist/skills/[name]/runs isn't matched by GUEST_SKILL and is refused for guests (401) and accounts (403) per tests/public-signup.test.ts. POST run is refused for accounts. Assist changes are owner-only (so no run_skill for accounts), and the sweep only advances owner runs. The estimate route still goes through priceAs, and planCheck/runAsDemo is only on the owner's verify path. No new file-reading path for account runs. No issues.",
+ "Migration appended as the last entry after 26; skill_runs values_json/state_json in ASSET_REFS. No ComfyUI graph, node pack, model, LoRA or Higgsfield usage added; no pre-flight changes needed.",
+ "Verified with node --experimental-strip-types that recipeProblems accepts faceless_episode -> add_captions via {{steps.ep.output}} (returns []).",
+ "Targeted vitest: tests/skill-runs.test.ts, tests/public-signup.test.ts, tests/recipe.test.ts: 3 files, 75 tests passed.",
+ "The implementer's full run log (/tmp/claude-0/w7-vitest.log) stopped after its header (no vitest process was left), so I ran the one full suite: FUOBE_ACCOUNT_DISK_FREE_GB=1 pnpm vitest run --maxWorkers=2. Result: 341/346 files, 5485 passed, 6 failed, 4 skipped. All 6 failures are known from main: comfy-reuse, dop-originals, preset-featured, soul-runs (2), split-soundtrack.",
+ "eslint on the touched source files (skill-runs, demo-scope, recipes, recipe, recipe-builder, skill-runs.tsx, run-skill-dialog.tsx, runs route, bin/lib/commands.mjs): clean.",
+ "UI read-through: skill-runs.tsx wraps at 390 px (flex-wrap, truncate, max-w-full), the links are real <Link> elements reachable by keyboard, and icons are aria-hidden with the status also in words. tests/e2e/skills-span.mjs fails on any console or page error and doesn't filter hydration errors. I didn't re-run the browser check (no server started)."
+ ],
+ "verdict": "approve-with-fixes: the core works and is tested (staged runs, the sweep, surviving a restart, the failure cascade, demo-scope dry runs, Save as skill linking, public-sign-up refusals), and the full suite shows only failures known from main. Fix before merge: the CLI --wait limit of 8 runs (medium) and faceless_episode's TOOL_MAKES 'video', whose result is only stills (medium). The rest are low."
+ },
+ "fix": {
+ "applied": [
+ "Medium, confirmed (traced: the route always returned listSkillRuns(name) with limit 8, so waitRuns' mine.length === runIds.length could never hold for 9+ rows). GET /api/assist/skills/[name]/runs now takes ?ids=a,b (up to RECIPE_LIMITS.rows = 50, else 400) and returns exactly those runs of that skill (listSkillRuns(skill, limit, ids)). Without ids it still lists the newest 8. The CLI's waitRuns asks for its own run ids, so other runs starting meanwhile can't push them out. Tests: a new tests/cli-run.test.ts case with a 9-row staged CSV, where the fake server returns only the newest 8 without ids (this would time out before the fix), and a new tests/skill-runs.test.ts route test covering 12 runs (newest 8, 10 asked by id, another skill's id left out, 51 ids → 400). Commit e02e0375.",
+ "Medium, confirmed (facelessRoute.run returns only the stills as ids). Added OUTPUT_NOT_HANDED_ON in src/lib/recipe.ts (faceless_episode) and removed faceless_episode from TOOL_MAKES. recipeProblems now refuses a step that takes a Faceless episode's output, saying why. linkStudios (Save as skill) keeps such a file as the literal file instead of a step reference. The studio dry run leaves out Faceless parts: their plan is the check again, as in W1, reported as skipped, so no dry-run date is stamped and no episode is started or deleted mid-render. That also removes the risk that stage two escapes the demo scope during a check. Other parts of the recipe still dry-run. Tests: the recipeProblems refusal, and verifyRecipe on a faceless recipe gives dryRun.skipped with no faceless_episodes row created. Commit c4782e28.",
+ "Low, confirmed. New outsideDemo(fn) (scope.exit) in src/server/demo-scope.ts. outsideRuns (and so ensureRunner) now also runs outside the demo scope, and ensureSkillRunSweep creates its setInterval through outsideDemo. Test: inside runAsDemo, outsideDemo, outsideRuns and a timer started through outsideDemo all see inDemoScope() false.",
+ "Low, confirmed. Inside runAsDemo, llmText (src/server/enhance.ts) returns null, so callers use their offline wording; Faceless askLlm and restore's writeRestorePrompt go offline too. A skill's free dry run (for example a create_ads step's brand kit and copy) no longer calls Claude or a local model. Test: llmText inside the scope returns null. This test is weak, because the test install has no LLM backend anyway.",
+ "Low (docs). docs/ARCHITECTURE.md: the Checks bullet no longer says 'Tool steps get the plan check only'; it describes studio dry runs and the Faceless exception. The W7 bullet adds the Faceless reference rule, the runs route's ?ids=, and outsideDemo. skills/README.md says no later step takes a Faceless episode's output."
+ ],
+ "rejected": [
+ "Part of the LLM-spend finding: 'leave records behind'. A create_ads step's dry run still keeps the brand kit it makes from a brief (createManualBrand), as does the shared Faceless 'Assist' channel. Deleting a brand kit the user might then reuse is riskier than keeping it, and the implementer had already noted it. It now costs nothing (no LLM call). Left as a note, not fixed."
+ ],
+ "checks": [
+ "Worktree /home/user/wt/o-w2s-w7 on o/w2s-w7: only this package's own commits, and the base is an ancestor (no merge needed). pnpm install --frozen-lockfile --prefer-offline and npx next typegen: OK.",
+ "Targeted vitest: tests/cli-run.test.ts 26/26 passed. tests/skill-runs, recipe, recipes, recipe-builder, assist-skill-tools and public-signup: 6 files, 142/142 passed.",
+ "pnpm typecheck: exit 0. pnpm lint: exit 0 (0 errors, 5 warnings that were already there, in files this package didn't touch).",
+ "Full suite, one run (FUOBE_ACCOUNT_DISK_FREE_GB=1 pnpm vitest run --maxWorkers=2, log /tmp/claude-0/w7fix-vitest.log): 341 of 346 files passed. Tests: 5490 passed, 6 failed, 4 skipped (5500). All 6 failures are known from main: comfy-reuse, dop-originals, preset-featured, soul-runs (2), split-soundtrack.",
+ "No server started and no browser check re-run (no UI change). .next is absent and git status is clean. Two fix commits (e02e0375, c4782e28), not pushed."
+ ],
+ "finalSummary": "Skills W7 (skills that span studios) is done, with the review's fixes. Recipe v2's {{steps.<key>.output}}, staged runs in skill_runs moved on by a 10 s sweep, the failure cascade, surviving a restart, studio dry runs inside runAsDemo, Save as skill linking, the Runs section, run_skill/toast/schedule/CLI results that name the waiting steps, and CLI --wait (now for any number of rows). Fixed here: the CLI no longer waits forever on 9+ rows; a Faceless episode's output can't be referenced (its result is only the stills), and Faceless is checked by its plan only; the demo scope can't leak into long-lived timers; a dry run asks no AI helper. Engines: everything was verified in demo mode on the mock provider only (unit/integration tests, plus the implementer's browser check at 1440/390 px, light and dark). Cloud: the staged chain uses the same studio tools and hosted models as before, but nothing has run with a paid key. Open engine: same, nothing has run on a GPU. A dub feeding a later step must use review:false, which the open engine's studio refuses, so the tool's own Library pipeline runs there. Public sign-up: the runs route (GET, including ?ids=) and running skills belong to the owner. Guests are refused (401) and accounts are refused (403) by the proxy, as tests/public-signup.test.ts shows. The sweep only moves owner runs, and no new file-reading path exists for account runs.",
+ "left": "Docs pass (STATUS.md / DEVELOPMENT.md): add the Skills W7 line, the e2e entry `node tests/e2e/skills-span.mjs [url]` and the runs route (with ?ids=) in the Assist route table. The ARCHITECTURE.md line about run_skill not existing yet predates this package. A single Faceless step in a staged run still shows 'done' in the Runs section once its stills finish, while the episode keeps rendering in Faceless Studio (it has an 'Open in Faceless Studio' link); tracking the episode's final generation is a possible follow-up. A create_ads dry run keeps the brand kit it made. createPipeline's `existing` option is still unused. Nothing has run with paid keys or on a GPU. Migration 27 (skill_runs) stays the last entry; the integrator may renumber it.",
+ "blocked": ""
+ }
+}