From de078e5edc70bed26a4a61db0170102444889f9e Mon Sep 17 00:00:00 2001 From: Lee Overy Date: Sun, 26 Jul 2026 22:43:08 +0100 Subject: [PATCH] test(prose): discovery's epic arm, to the same durability boundary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The same empty project and the same walk as the feature case, committed as an epic instead. The two diverge at one point — confirm-trigger's routing — and everything downstream follows from it. A feature concludes there. An epic continues into Step 7, which runs the discovery gateway, and that call is what proves which arm was taken: it sits in calls_include and in the ordering chain behind manifest exists and workunit create, so a walk cannot reach it by another route. Three claims are the epic's alone and cannot pass by accident. The session log records the map as empty at a first session rather than the not-applicable a single-topic type carries. The engine sets active_session, which a feature never acquires. And the shaping conversation is carried forward rather than restarted, so no second log is authored. calls_exclude covers topic start, the discussion map and the entry skills: nothing may begin while the topics are still unnamed. Its first run is what surfaced the walker wander at Step 5, and through that the asserter's inability to say whose fault a step was. Both are fixed beneath this in the stack; the case is unchanged since, so it wants a run against them before it is trusted. Co-Authored-By: Claude Opus 5 --- .../cases/discovery-commits-new-epic/act.md | 5 ++ .../discovery-commits-new-epic/assert.md | 39 ++++++++++++++ .../discovery-commits-new-epic/case.json | 41 +++++++++++++++ .../fixture-state.cjs | 12 +++++ .../discovery-commits-new-epic/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, 167 insertions(+) create mode 100644 tests/prose/cases/discovery-commits-new-epic/act.md create mode 100644 tests/prose/cases/discovery-commits-new-epic/assert.md create mode 100644 tests/prose/cases/discovery-commits-new-epic/case.json create mode 100644 tests/prose/cases/discovery-commits-new-epic/fixture-state.cjs create mode 100644 tests/prose/cases/discovery-commits-new-epic/fixture.md create mode 100644 tests/prose/cases/discovery-commits-new-epic/fixture/.claude/settings.json create mode 100644 tests/prose/cases/discovery-commits-new-epic/fixture/.recipe-hash create mode 100644 tests/prose/cases/discovery-commits-new-epic/fixture/.workflows/.state/migrations create mode 100644 tests/prose/cases/discovery-commits-new-epic/fixture/.workflows/_gitignore.fixture diff --git a/tests/prose/cases/discovery-commits-new-epic/act.md b/tests/prose/cases/discovery-commits-new-epic/act.md new file mode 100644 index 000000000..01f1758b8 --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-epic/act.md @@ -0,0 +1,5 @@ +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 discovery has been run for the newly created work +unit and the prose turns to initialising it — do not initialise, and name +no topics. diff --git a/tests/prose/cases/discovery-commits-new-epic/assert.md b/tests/prose/cases/discovery-commits-new-epic/assert.md new file mode 100644 index 000000000..ea633753e --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-epic/assert.md @@ -0,0 +1,39 @@ +The prose should have taken this path: + +1. the empty project is shown as such, and starting an epic routes into + discovery with the work unit given as `none` +2. the work type is put to the user at the gate and committed on their + answer — the pre-seed is a hint, and the several interacting strands + they describe are what makes it an epic rather than the menu key they + pressed +3. a name is checked against existing work before anything is created, + and one engine transaction then creates the work unit, installs the + session log staged in the cache, and commits +4. resume detection is skipped: it answers whether an earlier session was + interrupted, and work created moments ago cannot have been +5. the commit does not conclude the work as it would for a single-phase + type — discovery is run for the new work unit, and the conversation + carries on into topic territory + +Further claims: + +- the shaping conversation continues rather than restarting: the session + the confirm-trigger opened is the one the work carries forward, and no + second session log is authored + +EXPECTED WORLD — the walk should have produced, from a project that held +no work at all: + +- an epic work unit named `search-relevance`, in progress, registered in + the project manifest alongside its own manifest +- a description drawn from what the user said about ranking signals, + synonyms and measurement — not invented, and not narrowed to one of them +- exactly one discovery session log, `session-001.md`, naming no seeds and + no imports +- that log recording the map as empty at the start of this first session, + which is the epic's shape — not the "not applicable" a single-topic work + type would carry +- the epic marked as having a discovery session open, which is the state a + feature never acquires +- no topics anywhere: no map items, no research or discussion directories. + The work unit exists and its topics have not been named yet diff --git a/tests/prose/cases/discovery-commits-new-epic/case.json b/tests/prose/cases/discovery-commits-new-epic/case.json new file mode 100644 index 000000000..c5ba46ed1 --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-epic/case.json @@ -0,0 +1,41 @@ +{ + "origin": "discovery — the epic arm of the same commit the feature case walks: the work unit is created, then the work continues into topic territory instead of concluding", + "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": [ + "e — start a new epic", + "Search relevance across the catalogue is poor and it is several problems at once. Ranking barely uses behavioural signals. Synonyms and misspellings are handled by a hand-maintained list nobody trusts. And we have no way to tell whether a change made results better or worse, so every tweak is an argument. I want to take the whole thing on rather than patch one piece.", + "y — that's the right shape, set it up", + "search-relevance" + ], + "invariants": { + "engine_before_write": true, + "calls_include": [ + "manifest exists search-relevance", + "workunit create search-relevance epic", + "workflow-discovery/scripts/gateway.cjs search-relevance" + ], + "calls_in_order": [ + "manifest exists search-relevance", + "workunit create search-relevance epic", + "workflow-discovery/scripts/gateway.cjs search-relevance" + ], + "calls_exclude": [ + "topic start", + "discussion-map", + "workflow-discussion-entry", + "workflow-research-entry" + ] + } +} diff --git a/tests/prose/cases/discovery-commits-new-epic/fixture-state.cjs b/tests/prose/cases/discovery-commits-new-epic/fixture-state.cjs new file mode 100644 index 000000000..857c13e35 --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-epic/fixture-state.cjs @@ -0,0 +1,12 @@ +'use strict'; + +// An empty project, exactly as the feature case starts. What the walk +// makes of it is the whole difference. + +const m = require('../../mainlines/feature.cjs'); + +module.exports = { + build(h) { + m.init(h); + }, +}; diff --git a/tests/prose/cases/discovery-commits-new-epic/fixture.md b/tests/prose/cases/discovery-commits-new-epic/fixture.md new file mode 100644 index 000000000..94cda6c43 --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-epic/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 something larger in mind than a single change, and has not +yet said what. diff --git a/tests/prose/cases/discovery-commits-new-epic/fixture/.claude/settings.json b/tests/prose/cases/discovery-commits-new-epic/fixture/.claude/settings.json new file mode 100644 index 000000000..ae019ede5 --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-epic/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-epic/fixture/.recipe-hash b/tests/prose/cases/discovery-commits-new-epic/fixture/.recipe-hash new file mode 100644 index 000000000..e7d6a571a --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-epic/fixture/.recipe-hash @@ -0,0 +1 @@ +3e44d2307ed2aa0fafc1f4ac0d8bd5eb585501c158714be81c690d229f6bd522 diff --git a/tests/prose/cases/discovery-commits-new-epic/fixture/.workflows/.state/migrations b/tests/prose/cases/discovery-commits-new-epic/fixture/.workflows/.state/migrations new file mode 100644 index 000000000..3c7162acc --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-epic/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-epic/fixture/.workflows/_gitignore.fixture b/tests/prose/cases/discovery-commits-new-epic/fixture/.workflows/_gitignore.fixture new file mode 100644 index 000000000..779cbf28a --- /dev/null +++ b/tests/prose/cases/discovery-commits-new-epic/fixture/.workflows/_gitignore.fixture @@ -0,0 +1,2 @@ +.cache/ +.manifest.json.*.tmp