Skip to content

refactor(scenarios): move diagram-scenarios to tools/scenarios - #851

Merged
anandpant merged 1 commit into
mainfrom
refactor/phase3-scenarios-tools
Nov 18, 2026
Merged

anandpant merged 1 commit into
mainfrom
refactor/phase3-scenarios-tools

Conversation

@anandpant

@anandpant anandpant commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Move diagram-scenarios to tools/scenarios

packages/diagram/scenarios is now tools/scenarios. The scenario runner is a tool, as the plan says. Frontierclimb calls it for case discovery and deterministic grading, so a paired Frontierclimb PR moves that caller: shpitdev/frontierclimb#281 (head 83ec4eb3e3e3f497efe62fd9d787dcaa22087d99, left unmerged).

Changes

  • Move: git mv of the whole project; packages/diagram/ is gone. The Nx name diagram-scenarios, the package @sketchi/diagram-scenarios, the tags scope:package,type:eval (Studio and the editor import it) and the Vite-bundled CLI are unchanged. The CLI is now tools/scenarios/dist/cli.js, with no shim at the old path.
  • Depth-sensitive config: project.json, tsconfig extends/references/rootDir, Vite ssr/outDir, and the Vitest cache, aliases and coverage.
  • Consumers: root tsconfig.json; tools/{tsconfig.json,vitest.config.mts}; the native-conversion Storybook; editor tsconfig, Vitest and Storybook; Studio tsconfig, Vite and both Vitest configs. The lockfile change is importer paths only. nx sync:check is clean.
  • Docs: README, architecture, diagram-families and the scenarios README commands. The plan's row 7 now marks the scenarios move done, with a new "Scenarios: done" entry; the import-endings entry keeps the old path as history. The Studio production checklist gains: "Studio chat's 60-second idle bound is proven only against stubbed stalls. After deploying Studio, watch for stalled-turn errors on real long replies."

project.json shows as a rename at -M30%; only its paths changed.

Proof, base a70feeb9 vs e384a562

  • Built CLI identity: base build from a clean export of a70feeb9, same mise toolchain. Byte-identical:

    • --list (118 cases);
    • all 118 --fixture reports, all exit 0, 78 with editDrags>0 and none with editUnavailable;
    • --input replays of incident-escalation and checkout-payment-sequence;
    • a failed-check grade (exit 1, 10/22 failed) and a decode-error grade (exit 1).

    The bundled cli.js differs only in 25 bundler // <module path> comments.

  • Actual Frontierclimb adapters from the paired branch, run with SKETCHI_REPO pointing at this worktree at e384a562 (clean, mise node 26.13.0 / pnpm 12.16.1):

    • prepare passes for sketchi and sketchi-generate. The CLI resolves under tools/scenarios. The runtime closure is tools/scenarios plus packages/{cloudflare,diagrams,drawing,icons/catalog,observability} dist.
    • cases is byte-identical to the base --list; generate and no-cue cases return 118 each.
    • check, MCP, generate and no-cue, passing and failing: grades are correct, failed checks become ok:false, and each reports 12 bound routes and 12 editor drags with no editUnavailable.
    • The adapter's own MCP execute files grade byte-identically with the base and candidate CLIs.

    These runs are offline: no samples, models or services.

  • Focused checks: diagram-scenarios build, typecheck, test (126 passing) and check-scenario; playground/editor typecheck; editor tests; Studio api.server.test.ts; ops check-tools, lint, format and references; native-conversion and editor Storybook builds.

  • Independent review: Sol (t3tt) accepted e384a562 with no actionable findings. It confirmed identical blob IDs for all 53 relocated source files and correct relative depths everywhere. It ran its own plain-Node checks of the built CLI with editor drags, and found all 122 saved old/new JSON pairs byte-identical (.memory/effect-execution/phase3/scenarios-sketchi-review.md).

  • Full gate: pnpm ci:local --no-signoff against origin/main a70feeb9 passes on e384a562 in 2m39s, sampled routing included. The first attempt failed only ops:check-workflows, because actionlint (installed by my-nix at ~/go/bin) was not on the agent shell's PATH. The rerun on the unchanged head added it.

  • Pushed-head signoff: pnpm ci:local on the pushed e384a562 passed and posted local-ci success on this PR.

Not in this PR

Production and previews are not deployed. The paired Frontierclimb PR stays on a merge hold that only the user lifts, even after this PR merges.

Move packages/diagram/scenarios to tools/scenarios. The Nx name
diagram-scenarios, package name, tags and Vite-bundled CLI are unchanged;
the runnable CLI is now tools/scenarios/dist/cli.js, with no old-path shim.
Update every local consumer path (root and tools TypeScript config, Studio
and editor Vite/Vitest/Storybook aliases and references, the native
conversion Storybook) and the lockfile importer.

The built CLI's --list output and all 118 --fixture reports, plus passing
and failing --input replays, are byte-identical to the base build.

Record the move in the plan and add Fable's Studio checklist note: the 60s
chat idle bound is proven only by stubbed stalls.
@anandpant
anandpant marked this pull request as ready for review November 18, 2026 03:00
@anandpant
anandpant merged commit 22a50bb into main Nov 18, 2026
9 checks passed
@anandpant
anandpant deleted the refactor/phase3-scenarios-tools branch November 18, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant