feat(gatorwalk-factory): saved scenarios in scenarios/<factory>/, run by validate (swamp-club #2805) #389

Merged
seth merged 2 commits from cue/2805-gatorwalk-factory-saved into main 2026-09-30 19:11:37 +00:00
Owner

Closes swamp-club #2805.

A factory can now be tested before anyone runs work on it. Saved scenarios are YAML files at scenarios/<factory>/<scenario>.yaml, one engine call per step (record, approve, decline, move, override, wait, and a bare expect: { stage }; expect: { refused } pins a gate message). The factory's validate runs each in process on the real engine (committingStore(memoryStore()), simulated clock) and fails naming every unexpected step as <path> step <n> (<label>): <message>.

  • _lib/engine/scenario.ts: the file schema and the runner, free of Deno APIs so the studio can run it (a test walks its import graph). One frame per step: committed run, readiness, metrics, outcome.
  • definition_file.ts: readScenarioFiles, with the definition file's inside-the-repo and symlink checks; RepoFiles gains readDir.
  • The examples' walks move from factories_test.ts into 19 scenario files under references/examples/scenarios/<example>/, which examples_test.ts runs through validate; factories_test.ts keeps only the CEL and dispatch checks, run on the scenarios' results.
  • The factory key must equal the factory's name (the directory), not the definition's.
  • Docs: README and DESIGN.md "Saved scenarios", a decision-log entry, and the skill's references/scenarios.md.

Acceptance: breaking conformance-review's "needs a justification" message makes validate fail with bug-to-done.yaml step 28 (move conforms), in unit tests and through the real swamp CLI.

Main was merged in before verification (#2769 made isRegression required; the scenario files carry it).

Verified: verify-build 9d7f6d37-2406-4f13-a56d-7ca0f4b7fa5d and verify-reviews e42e6051-a102-44b8-abba-eac9c38fd6a2 on 87b16ab21, 12/14 passed, 2 guarded skips; attestation 37810a87-e66f-4499-8378-c49013dd1904.

🤖 Generated with Claude Code

Closes swamp-club #2805. A factory can now be tested before anyone runs work on it. Saved scenarios are YAML files at `scenarios/<factory>/<scenario>.yaml`, one engine call per step (`record`, `approve`, `decline`, `move`, `override`, `wait`, and a bare `expect: { stage }`; `expect: { refused }` pins a gate message). The factory's `validate` runs each in process on the real engine (`committingStore(memoryStore())`, simulated clock) and fails naming every unexpected step as `<path> step <n> (<label>): <message>`. - `_lib/engine/scenario.ts`: the file schema and the runner, free of Deno APIs so the studio can run it (a test walks its import graph). One frame per step: committed run, readiness, metrics, outcome. - `definition_file.ts`: `readScenarioFiles`, with the definition file's inside-the-repo and symlink checks; `RepoFiles` gains `readDir`. - The examples' walks move from `factories_test.ts` into 19 scenario files under `references/examples/scenarios/<example>/`, which `examples_test.ts` runs through `validate`; `factories_test.ts` keeps only the CEL and dispatch checks, run on the scenarios' results. - The `factory` key must equal the factory's name (the directory), not the definition's. - Docs: README and DESIGN.md "Saved scenarios", a decision-log entry, and the skill's `references/scenarios.md`. Acceptance: breaking conformance-review's "needs a justification" message makes `validate` fail with `bug-to-done.yaml step 28 (move conforms)`, in unit tests and through the real swamp CLI. Main was merged in before verification (#2769 made `isRegression` required; the scenario files carry it). Verified: verify-build `9d7f6d37-2406-4f13-a56d-7ca0f4b7fa5d` and verify-reviews `e42e6051-a102-44b8-abba-eac9c38fd6a2` on 87b16ab21, 12/14 passed, 2 guarded skips; attestation `37810a87-e66f-4499-8378-c49013dd1904`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A factory can now be tested before anyone runs work on it. Saved scenarios
are YAML files at scenarios/<factory>/<scenario>.yaml, one engine call per
step (record, approve, decline, move, override, wait, and a bare expect
stage; expect refused pins a gate message). The factory's validate runs
each in process on the real engine against committingStore(memoryStore())
with a simulated clock, and fails naming every unexpected step by file and
step.

- _lib/engine/scenario.ts: the file schema and the runner, free of Deno APIs
  so the studio can run it; one frame per step with the committed run,
  readiness and metrics.
- definition_file.ts: readScenarioFiles, with the definition file's
  inside-the-repo and symlink checks; RepoFiles gains readDir.
- The examples' walks move from factories_test.ts into scenario files under
  references/examples/scenarios/<example>/, which examples_test runs through
  validate; factories_test keeps only the CEL and dispatch checks, run on
  the scenarios' results.
- README, DESIGN.md ("Saved scenarios") and the skill
  (references/scenarios.md) document the format.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Merge origin/main into cue/2805-gatorwalk-factory-saved
All checks were successful
CI / Review Integrity (pull_request) Successful in 56s
CI / Validate Attestation (pull_request) Successful in 1m23s
87b16ab214
Main added #2769 (a classification always records isRegression; a
downgraded claim records false and is still reviewed on its verdict) and
#2798. The walks those changes touched in factories_test.ts are scenario
files on this branch, so the change is carried into them: every
classification records isRegression, regression-downgraded records false,
and the scenario for a classification with no isRegression is dropped, as
main dropped that case.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
seth merged commit 432c6d0811 into main 2026-09-30 19:11:37 +00:00
seth deleted branch cue/2805-gatorwalk-factory-saved 2026-09-30 19:11:42 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
swamp-club/swamp-extensions!389
No description provided.