From e40f8a23366b040767b196f43990edd529e0c02a Mon Sep 17 00:00:00 2001 From: Lee Overy Date: Sun, 26 Jul 2026 21:17:27 +0100 Subject: [PATCH] test(prose): discovery, walked to the point where work first exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Discovery is the phase every work type begins at, and it had no coverage at all. This walks it from workflow-start on an empty project — no work units, no inbox, not even a project manifest, since none exists until the first work unit is created — through the opener, the shape-and-confirm gate and name resolution, stopping the moment the work unit is on disk. That stop is the durability boundary rather than an arbitrary point. Everything before the work-type commit is ephemeral however long the shaping ran; everything after it persists. The case asserts exactly that: nothing is on disk until one engine transaction creates the work unit, installs the session log staged in the cache, and commits. Three firsts. It is the first case that creates a work unit instead of reading one someone else built. It is the first live user of world `claims` — the manifest description and the session log's prose are the model's to write, so the world is judged against stated claims rather than byte-compared. And it is only the second case where engine_before_write is not vacuous, since the walk stages the session log under .workflows itself. The deterministic spine is the ordering: `manifest exists` must run before `workunit create`, because a collision check after the thing it checks for is no check at all. Alongside it, calls_exclude on the epic machinery — no map, no topics, no session close — since single-phase work must not touch any of it. The name is supplied by the scripted user rather than accepting the suggestion, which keeps every path in the expected world fixed instead of depending on what the model would have derived from the description. Passed first run: 5/5 path, all four checks, world PASS, no markers. Co-Authored-By: Claude Opus 5 --- .../discovery-commits-new-feature/act.md | 4 ++ .../discovery-commits-new-feature/assert.md | 35 +++++++++++++ .../discovery-commits-new-feature/case.json | 38 ++++++++++++++ .../fixture-state.cjs | 13 +++++ .../discovery-commits-new-feature/fixture.md | 6 +++ .../fixture/.claude/settings.json | 9 ++++ .../fixture/.recipe-hash | 1 + .../fixture/.workflows/.state/migrations | 52 +++++++++++++++++++ .../fixture/.workflows/_gitignore.fixture | 2 + 9 files changed, 160 insertions(+) create mode 100644 tests/prose/cases/discovery-commits-new-feature/act.md create mode 100644 tests/prose/cases/discovery-commits-new-feature/assert.md create mode 100644 tests/prose/cases/discovery-commits-new-feature/case.json create mode 100644 tests/prose/cases/discovery-commits-new-feature/fixture-state.cjs create mode 100644 tests/prose/cases/discovery-commits-new-feature/fixture.md create mode 100644 tests/prose/cases/discovery-commits-new-feature/fixture/.claude/settings.json create mode 100644 tests/prose/cases/discovery-commits-new-feature/fixture/.recipe-hash create mode 100644 tests/prose/cases/discovery-commits-new-feature/fixture/.workflows/.state/migrations create mode 100644 tests/prose/cases/discovery-commits-new-feature/fixture/.workflows/_gitignore.fixture diff --git a/tests/prose/cases/discovery-commits-new-feature/act.md b/tests/prose/cases/discovery-commits-new-feature/act.md new file mode 100644 index 000000000..8d50d7719 --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-feature/act.md @@ -0,0 +1,4 @@ +Execute skills/workflow-start/SKILL.md from the top, as a user opening +the workflow with nothing on disk yet, and continue into whatever it +routes to. Stop once the work unit exists on disk and the prose turns to +routing the work into its first phase — do not enter that phase. diff --git a/tests/prose/cases/discovery-commits-new-feature/assert.md b/tests/prose/cases/discovery-commits-new-feature/assert.md new file mode 100644 index 000000000..de1f2cff9 --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-feature/assert.md @@ -0,0 +1,35 @@ +The prose should have taken this path: + +1. the empty project is shown as such, and starting a feature routes into + discovery with the work unit given as `none` — new work has no name to + pass until it is created +2. discovery reads the mode from that `none` and takes the new-work path, + with no seed material to read +3. the pre-seeded work type is treated as a hint, not a given: the read is + put to the user at a gate and only committed on their answer +4. a name is suggested, the user's own name is taken in its place, and it + is checked against existing work before anything is created +5. the session log is authored into the cache, and one engine transaction + creates the work unit, installs that log and commits — the log is never + written into the work unit directory by the walk + +Further claims: + +- nothing is on disk before the transaction: every earlier step of the + shaping is ephemeral, however much was said +- this is single-phase work, so no epic machinery runs — no discovery map, + no topics, no session close + +EXPECTED WORLD — the walk should have produced, from a project that held +no work at all: + +- a feature work unit named `search-filters`, in progress, registered in + the project manifest alongside its own manifest +- a description on it drawn from what the user actually said about saved + filters, not invented +- exactly one discovery session log for it, `session-001.md`, in the work + unit's `discovery/sessions/` directory +- that log naming no seeds and no imports, since the work came from + neither +- no research, discussion, or any other phase directory: the work unit + exists and nothing has begun diff --git a/tests/prose/cases/discovery-commits-new-feature/case.json b/tests/prose/cases/discovery-commits-new-feature/case.json new file mode 100644 index 000000000..36231b11b --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-feature/case.json @@ -0,0 +1,38 @@ +{ + "origin": "discovery — the universal first phase, walked to its durability boundary: the work-type commit, where a work unit first exists on disk", + "entry": "workflow-start", + "world": "claims", + "files": [ + "skills/workflow-start/SKILL.md", + "skills/workflow-start/references/empty-state.md", + "skills/workflow-start/references/route-to-discovery.md", + "skills/workflow-discovery/SKILL.md", + "skills/workflow-discovery/references/opener-pattern.md", + "skills/workflow-discovery/references/shape-and-confirm.md", + "skills/workflow-discovery/references/confirm-trigger.md", + "skills/workflow-discovery/references/name-resolution.md", + "skills/workflow-discovery/references/template.md" + ], + "answers": [ + "f — start a new feature", + "Saved search filters on the orders list. A user picks the filters they use often — status, date range, customer — names the combination, and it appears in a dropdown above the list so they can apply it in one click. Filters are per-user, not shared. Nothing else about the orders list changes.", + "y — that's the right shape, set it up", + "search-filters" + ], + "invariants": { + "engine_before_write": true, + "calls_include": [ + "manifest exists search-filters", + "workunit create search-filters feature" + ], + "calls_in_order": [ + "manifest exists search-filters", + "workunit create search-filters feature" + ], + "calls_exclude": [ + "discovery-map", + "discovery-session close", + "topic start" + ] + } +} diff --git a/tests/prose/cases/discovery-commits-new-feature/fixture-state.cjs b/tests/prose/cases/discovery-commits-new-feature/fixture-state.cjs new file mode 100644 index 000000000..d5ee1bcc5 --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-feature/fixture-state.cjs @@ -0,0 +1,13 @@ +'use strict'; + +// An empty project: the store is up and migrations have run, and nothing +// has ever been started. The walk itself creates the first work unit, +// which is the point of the case. + +const m = require('../../mainlines/feature.cjs'); + +module.exports = { + build(h) { + m.init(h); + }, +}; diff --git a/tests/prose/cases/discovery-commits-new-feature/fixture.md b/tests/prose/cases/discovery-commits-new-feature/fixture.md new file mode 100644 index 000000000..1c1d83d8d --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-feature/fixture.md @@ -0,0 +1,6 @@ +A project with the workflow system installed and nothing else. The +knowledge store is initialised, migrations have run, and no work has ever +been started — no work units, no inbox items, no history. + +The user has just decided they want to build something, and has not yet +said what. diff --git a/tests/prose/cases/discovery-commits-new-feature/fixture/.claude/settings.json b/tests/prose/cases/discovery-commits-new-feature/fixture/.claude/settings.json new file mode 100644 index 000000000..ae019ede5 --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-feature/fixture/.claude/settings.json @@ -0,0 +1,9 @@ +{ + "showClearContextOnPlanAccept": true, + "permissions": { + "allow": [ + "Edit(.workflows/**)", + "Bash(mv .workflows/:*)" + ] + } +} diff --git a/tests/prose/cases/discovery-commits-new-feature/fixture/.recipe-hash b/tests/prose/cases/discovery-commits-new-feature/fixture/.recipe-hash new file mode 100644 index 000000000..712443ffb --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-feature/fixture/.recipe-hash @@ -0,0 +1 @@ +88e88d312b8f83941c265b875f300ec5a34a4179d60d24c379806bc9af115f23 diff --git a/tests/prose/cases/discovery-commits-new-feature/fixture/.workflows/.state/migrations b/tests/prose/cases/discovery-commits-new-feature/fixture/.workflows/.state/migrations new file mode 100644 index 000000000..3c7162acc --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-feature/fixture/.workflows/.state/migrations @@ -0,0 +1,52 @@ +001 +002 +003 +004 +005 +006 +007 +008 +009 +010 +011 +012 +013 +014 +015 +016 +017 +018 +019 +020 +021 +022 +023 +024 +025 +026 +027 +028 +029 +030 +031 +032 +033 +034 +035 +036 +037 +038 +039 +040 +041 +042 +043 +044 +045 +046 +047 +048 +049 +050 +051 +052 diff --git a/tests/prose/cases/discovery-commits-new-feature/fixture/.workflows/_gitignore.fixture b/tests/prose/cases/discovery-commits-new-feature/fixture/.workflows/_gitignore.fixture new file mode 100644 index 000000000..779cbf28a --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-feature/fixture/.workflows/_gitignore.fixture @@ -0,0 +1,2 @@ +.cache/ +.manifest.json.*.tmp