feat(gatorwalk-factory): saved scenarios in scenarios/<factory>/, run by validate (swamp-club #2805) #389
Loading…
Reference in a new issue
No description provided.
Delete branch "cue/2805-gatorwalk-factory-saved"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 bareexpect: { stage };expect: { refused }pins a gate message). The factory'svalidateruns 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;RepoFilesgainsreadDir.factories_test.tsinto 19 scenario files underreferences/examples/scenarios/<example>/, whichexamples_test.tsruns throughvalidate;factories_test.tskeeps only the CEL and dispatch checks, run on the scenarios' results.factorykey must equal the factory's name (the directory), not the definition's.references/scenarios.md.Acceptance: breaking conformance-review's "needs a justification" message makes
validatefail withbug-to-done.yaml step 28 (move conforms), in unit tests and through the real swamp CLI.Main was merged in before verification (#2769 made
isRegressionrequired; the scenario files carry it).Verified: verify-build
9d7f6d37-2406-4f13-a56d-7ca0f4b7fa5dand verify-reviewse42e6051-a102-44b8-abba-eac9c38fd6a2on87b16ab21, 12/14 passed, 2 guarded skips; attestation37810a87-e66f-4499-8378-c49013dd1904.🤖 Generated with 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>