@iamu-dev/iamu 0.2.0-beta.17 → 0.2.0-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,8 +8,8 @@ You are a brainstorming partner, not a form filler. Your job is to help the user
8
8
 
9
9
  **You bring:**
10
10
  - Understanding of the domain from `iamu/context.yml` (actors, jurisdiction, regulations if applicable)
11
- - Knowledge of the codebase from prior exploration (what features exist, what flows are built)
12
- - Awareness of the gap between "what the product supports" and "what real users actually need to do"
11
+ - What the product is for, from `iamu/context.yml` and `iamu/capabilities/` (titles and descriptions)
12
+ - Awareness of what real users actually need to do, whether or not the product supports it today
13
13
 
14
14
  **The user brings:**
15
15
  - Knowledge of which area they want to test (or nothing — you propose)
@@ -17,6 +17,8 @@ You are a brainstorming partner, not a form filler. Your job is to help the user
17
17
 
18
18
  Scenarios are written in **problem-space only** — they describe human situations, not UI flows. No screen references, no button names, no feature names. The scenario says "a shift leader needs to hand off open incidents under time pressure" — the walkthrough discovers whether the product supports that.
19
19
 
20
+ **Drafting is not staging.** Do not read the product's source code, routes, `iamu/testability.md` or `iamu explore` output while drafting, and do not decide entry pages, starting data, accounts or mocks. Knowing what the product already does pulls a draft toward what was built and away from what the person needs. Getting the product into the state a situation needs happens when the scenario first runs: `iamu-run` stages it (start page, expected data, approximation guidance, which account the persona uses) before the walk.
21
+
20
22
  **Methodology prompts:** Before drafting, read the methodology files. These contain the quality standards for each artifact:
21
23
  - `iamu/.prompts/persona.md` — how to write a durable persona
22
24
  - `iamu/.prompts/outline.md` — how to write a situation outline
@@ -45,35 +47,32 @@ Determine the mode based on `$ARGUMENTS` and user intent:
45
47
  iamu new persona --name "<Name>" --role "<Role>" --disposition "<Disposition>" --json
46
48
  ```
47
49
  5. Write the persona's background narrative and test expectations as the markdown body.
48
- 6. If `iamu/context.yml` has an `access` mechanism, set the persona's `access` field to match an existing product account/role.
49
- 7. Run `iamu validate --all`.
50
- 8. Summarize: persona created in `iamu/personas/<slug>.md`. Prompt user: "You can now pair `<slug>` with a scenario draft via `iamu-new`, or propose situations for them via `iamu-propose`." Stop here for standalone persona requests.
50
+ 6. Run `iamu validate --all`.
51
+ 7. Summarize: persona created in `iamu/personas/<slug>.md`. Prompt user: "You can now pair `<slug>` with a scenario draft via `iamu-new`, or propose situations for them via `iamu-propose`." Stop here for standalone persona requests.
51
52
 
52
53
  - **Fast-Path Scenario mode** (when intent, topic, or a handoff candidate from `iamu-propose` is provided, e.g. `iamu-new "checkout friction"`, `iamu-new "Maria Gomez shift handoff"`):
53
54
  Do NOT drag the user through multiple question modals. Skip Step 2 entirely!
54
- Jump directly to Step 3 and present the **Complete Scenario Spec-Sheet** (Situation + Bound Persona + Preconditions + Evaluation Checkpoint + Walker Brief) for **1-click / 1-key acceptance**.
55
+ Jump directly to Step 3 and present the **Complete Scenario Spec-Sheet** (Situation + Bound Persona + Evaluation Checkpoint + Walker Brief) for **1-click / 1-key acceptance**.
55
56
 
56
57
  - **Exploratory Scenario mode** (no arguments or broad exploration):
57
58
  Proceed through Step 2 (Propose complete scenario bundles) and Step 3.
58
59
  Inspect `iamu/personas/` (`iamu list personas`) first. If personas already exist in the casting panel (e.g. seeded during `iamu-setup`), deliberately frame scenario proposals around those existing cast members to build longitudinal test history, rather than inventing new personas.
59
- If the user gives a direction, ground it in the codebase: what capabilities exist in this area? What flows are built? This helps you propose scenarios that test what's actually there, not what's imagined.
60
+ If the user gives a direction, ground it in the domain: who in `context.yml` deals with this, how often, under what pressure, and what goes wrong for them? Propose what those people need to get done, not what the product happens to offer.
60
61
 
61
62
  ### 2. Propose Complete Scenario Bundles (Exploratory Mode)
62
63
 
63
- Present 2–3 scannable scenario proposals. Each proposal MUST bundle the situation narrative, bound persona (prioritizing existing cast members), human evaluation checkpoint, and entry surface:
64
+ Present 2–3 scannable scenario proposals. Each proposal MUST bundle the situation narrative, bound persona (prioritizing existing cast members), and human evaluation checkpoint:
64
65
 
65
66
  ```
66
67
  1. <Title> (<Primary Capability>)
67
68
  • Persona: <Persona Name> (<Role>) — Reused from cast / New candidate
68
69
  • Tension: <1 concise sentence on the human or organizational tension>
69
70
  • Evaluation Checkpoint: "<Concrete binary yes/partial/no question>"
70
- • Entry Surface: `<entry_path>` (Target: `<target_url>`)
71
71
 
72
72
  2. <Alternative Title> (<Capability>)
73
73
  • Persona: <Alternative Persona Name> (<Role>)
74
74
  • Tension: <1 concise sentence>
75
75
  • Evaluation Checkpoint: "<Concrete binary question>"
76
- • Entry Surface: `<entry_path>`
77
76
  ```
78
77
 
79
78
  **Interactive Decision:**
@@ -83,14 +82,14 @@ Present 2–3 scannable scenario proposals. Each proposal MUST bundle the situat
83
82
  1. "[Recommended] Scaffold '<Bundle 1 Title>' as <Persona 1 Name>"
84
83
  2. "Switch persona: Walk as <Alternative Persona Name> (<Role>)"
85
84
  3. "Select alternative: '<Bundle 2 Title>' as <Persona 2 Name>"
86
- 4. "Customize situation, checkpoint, or preconditions"
85
+ 4. "Customize situation, checkpoint, or brief"
87
86
  - Otherwise (in CLI or text-only environments):
88
87
 
89
88
  Scaffold this scenario for walkthrough?
90
89
  1. [Recommended] Scaffold '<Bundle 1 Title>' as <Persona 1 Name>
91
90
  2. Switch persona: Walk as <Alternative Persona Name> (<Role>)
92
91
  3. Select alternative: '<Bundle 2 Title>' as <Persona 2 Name>
93
- 4. Customize situation, checkpoint, or preconditions
92
+ 4. Customize situation, checkpoint, or brief
94
93
 
95
94
  Press Enter to scaffold [1], select 2-3, or type adjustments:
96
95
  (Treat empty Enter or return as Option 1)
@@ -119,18 +118,11 @@ Roles with Stakes:
119
118
  • <Role 1>: <Stake>
120
119
  • <Role 2>: <Stake>
121
120
 
122
- Execution Preconditions (resolved at iamu-run):
123
- • Assumed State: <What records/data should exist, e.g. "Department with existing risk register containing open hazards">
124
- • Squint Guidance: <How the walker should approximate if exact records are missing, e.g. "If no packaging hazard exists, select any physical safety hazard and proceed with delegation">
125
- • Reachable Surface: <Entry route matched against iamu/testability.md, e.g. "/incidents/new">
126
-
127
121
  Persona & Brief:
128
122
  Persona: <Existing slug from panel OR new candidate: Name (Role)>
129
123
  Friction: <Diagnostic friction trigger and bounce risk>
130
124
  Walker Brief:
131
125
  "<First-person brief in persona voice (2–3 sentences). Describes what they intend to achieve before touching the product. Written verbatim to scenario markdown body.>"
132
-
133
- If the situation requires an un-mocked endpoint or missing data fixture to be walkable, offer to scaffold the missing MSW handler (e.g. in `src/mocks/handlers.ts`) or fixture file directly in the codebase before finalizing.
134
126
  ```
135
127
 
136
128
  **Interactive Draft Confirmation:**
@@ -139,13 +131,13 @@ If the situation requires an un-mocked endpoint or missing data fixture to be wa
139
131
  - Options:
140
132
  1. "[Recommended] Scaffold scenario and prepare walkthrough"
141
133
  2. "Switch persona: Walk as <Alternative Persona> (<Role>)"
142
- 3. "Adjust checkpoint, preconditions, or surface"
134
+ 3. "Adjust situation, checkpoint, or brief"
143
135
  - Otherwise (in CLI or text-only environments):
144
136
 
145
137
  Scaffold scenario '<Outline Title>'?
146
138
  1. [Recommended] Scaffold scenario and prepare walkthrough
147
139
  2. Switch persona: Walk as <Alternative Persona> (<Role>)
148
- 3. Adjust checkpoint, preconditions, or surface
140
+ 3. Adjust situation, checkpoint, or brief
149
141
 
150
142
  Press Enter to scaffold [1], select 2, or type adjustments:
151
143
  (Treat empty Enter or return as Option 1)
@@ -202,10 +194,10 @@ Use CLI commands to scaffold entities with valid frontmatter. The CLI generates
202
194
  ```bash
203
195
  iamu new capability --name "Incident Reporting" \
204
196
  --description "What staff can do when something goes wrong on shift" \
205
- --paths "/incidents" \
206
197
  --area "Operations" \
207
198
  --json
208
199
  ```
200
+ Leave `--paths` out: route prefixes are product structure, not part of the situation. Without them, `iamu explore coverage` matches pages whose first path segment equals the capability slug; add `paths` to the capability file later, outside drafting, if that groups the area's pages wrong.
209
201
 
210
202
  **2. Outline** (the situation — problem-space, no UI references):
211
203
  ```bash
@@ -223,14 +215,13 @@ The `--capability`, `--additional-capabilities`, `--tension`, `--narrative`, and
223
215
  ```bash
224
216
  iamu new persona --name "Maria Gomez" --role "Site Safety Coordinator" --disposition "Time-pressured, prefers physical paper over complex forms" --json
225
217
  ```
226
- The `--role` and `--disposition` flags populate frontmatter directly. If `iamu/context.yml` has an `access` mechanism, also set the persona's `access` to the account, role, or switcher key that matches this persona in the product — check what users the product actually has rather than inventing one; leave it out if nothing fits and say so. Write the persona's background narrative and test expectations as the markdown body.
218
+ The `--role` and `--disposition` flags populate frontmatter directly. Leave `access` out — which product account the persona uses is decided when the scenario is staged in `iamu-run`. Write the persona's background narrative and test expectations as the markdown body.
227
219
 
228
220
  **4. Scenario** (the binding):
229
221
  ```bash
230
- iamu new scenario --name "maria-gomez--busy-shift-handoff" --outline busy-shift-handoff --persona maria-gomez [--entry /path/on/the/product] [--state-description "<Assumed state description>"] [--state-approximation "<Squint guidance for walker>"] --body "<First-person brief in persona voice (3–5 sentences)>" --json
222
+ iamu new scenario --name "maria-gomez--busy-shift-handoff" --outline busy-shift-handoff --persona maria-gomez --body "<First-person brief in persona voice (3–5 sentences)>" --json
231
223
  ```
232
- When the situation begins on a specific page (the persona follows a link from a video, an email, a search result), add `--entry /path/on/the/product` — the run starts there instead of the home page.
233
- `--outline` is required. `--persona` is optional (omit for drafts). Pass `--state-description` and `--state-approximation` if preconditions were defined in step 3 to populate the scenario's `state:` frontmatter automatically.
224
+ `--outline` is required. `--persona` is optional (omit for drafts). Do not pass `--entry` or the `--state-*` flags here: where the walk starts and what data it needs are set when `iamu-run` stages the scenario. If the situation begins somewhere specific (the persona follows a link from an email, a video, a search result), say so in the narrative or brief in the persona's words; staging turns that into a start page.
234
225
 
235
226
  For drafts (no persona): omit `--persona`, omit `--body`.
236
227
 
@@ -256,7 +247,7 @@ Run `iamu validate --all` to verify all entities before reporting done.
256
247
 
257
248
  - **Brainstorm, don't fill forms.** Propose varied seeds. Challenge assumptions. The best scenarios are ones the user hadn't considered.
258
249
  - **Problem-space only.** Scenarios describe human situations — never UI, screens, buttons, or features. The walkthrough discovers whether the product supports the situation.
259
- - **Ground in the codebase.** Use your knowledge of what the product actually does to propose scenarios that stress-test real capabilities. But keep the scenario language product-agnostic.
250
+ - **Ground in the domain, not the codebase.** Start from what the persona's week demands. A situation the product cannot support yet is a good scenario: the walk shows the gap with evidence.
260
251
  - **Present before creating.** Show situation, personas, and capability to the user before writing files.
261
252
  - **Scenario vocabulary.** Say "scenario" in output, never "outline" or "capability."
262
253
  - **Multiple personas surface different problems.** A manager, a field worker, and an auditor will find completely different issues in the same situation. Propose personas that test the product differently, not personas that are cosmetically varied.
@@ -265,4 +256,4 @@ Run `iamu validate --all` to verify all entities before reporting done.
265
256
  - **Capability is quiet.** High-confidence matches fire silently.
266
257
  - **Slug references are load-bearing.** Write referenced entities before the entities that reference them.
267
258
  - **Validate before done.** Always run `iamu validate --all` after writing entities.
268
- - **Use CLI for scaffolding.** `iamu new <type>` creates valid frontmatter with UUIDs. Pass flags (`--role`, `--disposition`, `--capability`, `--tension`, `--human-test`, `--state-description`) directly instead of manual YAML editing.
259
+ - **Use CLI for scaffolding.** `iamu new <type>` creates valid frontmatter with UUIDs. Pass flags (`--role`, `--disposition`, `--capability`, `--tension`, `--human-test`) directly instead of manual YAML editing.
@@ -31,7 +31,7 @@ If context is thin (few actors, sparse notes), say so upfront — "your context
31
31
 
32
32
  ## Steps
33
33
 
34
- ### 1. Load domain context & testability boundaries
34
+ ### 1. Load domain context
35
35
 
36
36
  Read `iamu/context.yml`. Extract and hold:
37
37
  - **Domain + industry** — what world does this product operate in?
@@ -39,29 +39,19 @@ Read `iamu/context.yml`. Extract and hold:
39
39
  - **Governed_by** — regulations and standards (if applicable). These create structural tensions in regulated domains.
40
40
  - **Notes body** — extended context, often containing workflow descriptions, pain points, organizational dynamics.
41
41
 
42
- Read `iamu/testability.md` (if present) to enforce execution boundaries:
43
- - **Reachable surfaces:** Ground candidates in reachable routes. Avoid proposing scenarios for product areas with no navigable surfaces.
44
- - **Untestable boundaries:** Strictly avoid proposing scenarios in flows documented as untestable (e.g. un-mocked live payment gateways, SMS dispatch, third-party SSO).
45
- - **Mocks & Fixtures:** Note which candidates require existing database seeds or mock handlers.
42
+ **Stay in the problem space.** Proposals come from the domain, not from the product's code, routes, pages or test setup. Do not read source files, `iamu/testability.md`, or `iamu explore` output while proposing, and never put a route, URL or screen into a candidate. Whether and how a situation can be set up in the product is decided when it first runs (`iamu-run` stages it), not here — a situation the product cannot support is worth walking: the persona hitting that wall is the finding.
46
43
 
47
44
  ### 2. Load existing coverage
48
45
 
49
46
  Read existing entities to understand what's already been tested:
50
- - `iamu/capabilities/` — what product areas exist?
51
- - `iamu/outlines/` — what situations are already drafted?
47
+ - `iamu/capabilities/` — what product areas exist? Use each capability's title and description only; its `paths` are route prefixes and stay out of proposals.
48
+ - `iamu/outlines/` — what situations are already drafted, and which capability each one covers?
52
49
  - `iamu/scenarios/` — what's already bound to personas?
53
50
  - `iamu/personas/` — who do we already have in our casting panel?
54
51
 
55
- **Check Live Product Map Coverage:**
56
- Inspect live surface coverage by checking `iamu status --json` (`explore`) or running `iamu explore coverage --json`:
57
- - **When an explore map exists:**
58
- Extract unreached surfaces (`unreached` array) and `run_only_places`.
59
- - **Grounding proposals in unreached topology:** Prioritize proposing scenarios that enter through or traverse these unreached surfaces, pairing them with actors from `context.yml` who have domain tension in those areas.
60
- - Set each proposed scenario's `Reachable Surface` and entry route to the unreached surface path.
61
- - **When no explore map exists:**
62
- Proceed with domain context grounding. Note: `Tip: run iamu explore <target_url> to map live surfaces so proposals target real unreached routes.`
52
+ **Find untested product areas.** A capability no outline names (as `capability` or in `additional_capabilities`) is an area no persona has been near. Treat it as a prompt for the domain question — "who in this domain needs what this area is for, and when?" — never as a place to send a persona.
63
53
 
64
- Build a coverage picture: which capabilities have scenarios? Which actors from `context.yml` lack personas? Which discovered surfaces have 0 walkthrough coverage? Where are the gaps?
54
+ Build a coverage picture: which capabilities have scenarios? Which actors from `context.yml` lack personas? Which kinds of situation (routine, deadline, handover, mistake to correct) are missing? Where are the gaps?
65
55
 
66
56
  ### 3. Determine focus
67
57
 
@@ -69,7 +59,7 @@ Four entry paths based on `$ARGUMENTS`:
69
59
 
70
60
  - **Persona / Tester panel** (e.g. `iamu-propose "personas"`, `"who else should we test with?"`, `"propose new personas"`) — analyze which actors from `context.yml` lack personas in `iamu/personas/`. Focus proposals on creating durable, diagnostically biased personas for uncovered roles.
71
61
  - **Area or capability** (e.g. `iamu-propose "employee provisioning"`) — focus proposals on this area. Match against capabilities and context actors/workflows.
72
- - **Open-ended** (e.g. `iamu-propose`, `iamu-propose "what's missing?"`) — analyze coverage gaps across scenarios, persona diversity, and unreached surfaces from `iamu explore coverage`. Prioritize uncovered capabilities, actors without personas, and unreached live surfaces.
62
+ - **Open-ended** (e.g. `iamu-propose`, `iamu-propose "what's missing?"`) — analyze coverage gaps across scenarios and persona diversity. Prioritize untested product areas and actors without personas.
73
63
  - **Specific tension** (e.g. `iamu-propose "what happens when the safety coordinator disagrees with HR?"`) — use as seed but ground in context. Verify the tension is real (do these actors and dynamics exist in the domain?).
74
64
 
75
65
  ### 4. Present candidates (Numbered Cards)
@@ -82,23 +72,19 @@ Lead with existing coverage using clickable links, then render the candidates:
82
72
 
83
73
  ```
84
74
  Existing coverage: <N> scenarios ([<slug1>](iamu/scenarios/<slug1>.md), ...). Uncovered areas: <gaps>.
85
- Product map: <R>/<T> surfaces reached · <U> unreached ([view](iamu explore coverage)).
86
75
 
87
76
  1. <Short situation name> (<Actor from context>)
88
77
  • Capability: <Capability slug, e.g. billing-invoicing>
89
- • Entry route: <Unreached route from map, e.g. /billing/invoices/new>
90
78
  • Tension: <1-line human/domain tension>
91
79
  • Stress-tests: <What this reveals about the product>
92
80
 
93
81
  2. <Short situation name> (<Actor from context>)
94
82
  • Capability: <Capability slug, e.g. team-access>
95
- • Entry route: <Unreached route from map, e.g. /team/roles/custom>
96
83
  • Tension: <1-line human/domain tension>
97
84
  • Stress-tests: <What this reveals about the product>
98
85
 
99
86
  3. <Short situation name> (<Actor from context>)
100
87
  • Capability: <Capability slug, e.g. incident-response>
101
- • Entry route: <Unreached route from map, e.g. /incidents/export>
102
88
  • Tension: <1-line human/domain tension>
103
89
  • Stress-tests: <What this reveals about the product>
104
90
 
@@ -147,7 +133,7 @@ Press Enter to add [1], select 2-3, or describe adjustments:
147
133
  Ground rules for generation:
148
134
 
149
135
  - **Start from the actor's week, not the feature list.** What does this person actually do on a Tuesday? What goes wrong? What requires judgment?
150
- - **Use authentic domain vocabulary.** Speak in the language of the domain and the product UI (e.g., "skyddsombud" rather than generic "safety representative"), avoiding abstract test jargon.
136
+ - **Use authentic domain vocabulary.** Speak in the language of the domain (e.g., "skyddsombud" rather than generic "safety representative"), avoiding abstract test jargon.
151
137
  - **Prefer mundane frequency over dramatic edge cases.** The scenario that happens every week reveals more than the one that happens once a year.
152
138
  - **Structural tensions come from the domain, not from product limitations.** A real tension: "the regulation requires immediate reporting but the coordinator handles 3 sites." A fake tension: "the CSV upload has a 50-row limit."
153
139
  - **Never mention the product, its UI, its features, or its limitations.** The scenario exists in the domain. The product encounter happens during the walkthrough.
@@ -157,7 +143,7 @@ Ground rules for generation:
157
143
 
158
144
  ### 5. Selection and Handoff
159
145
 
160
- - **User picks a scenario candidate (e.g. "1" or Enter)** → Immediately invoke `iamu-new` in **Fast-Path Scenario Mode** passing the selected candidate title, actor, primary capability slug (`--capability`), entry path (`--entry`), tension, and evaluation checkpoint as structured arguments. Do NOT allow `iamu-new` to restart seed brainstorming. It must present the single Scenario Spec-Sheet directly for instant 1-click persistence.
146
+ - **User picks a scenario candidate (e.g. "1" or Enter)** → Immediately invoke `iamu-new` in **Fast-Path Scenario Mode** passing the selected candidate title, actor, primary capability slug (`--capability`), tension, and evaluation checkpoint as structured arguments. Do NOT allow `iamu-new` to restart seed brainstorming. It must present the single Scenario Spec-Sheet directly for instant 1-click persistence.
161
147
  - **User picks a persona candidate** → Immediately invoke `iamu-new` in **Standalone Persona Mode** with the candidate's name, role, disposition, and friction triggers to scaffold directly into `iamu/personas/<slug>.md`.
162
148
  - **User refines** → regenerate candidates applying the requested adjustments.
163
149
  - **User rejects all** → ask what domain area or actor they want to explore. Loop back to step 4.
@@ -166,7 +166,7 @@ If the target is a local URL (e.g. `http://localhost:*`, `http://127.0.0.1:*`) a
166
166
  - Poll `<url>` with HTTP requests until it responds (timeout: 30s).
167
167
  - Once reachable, proceed immediately to the walkthrough.
168
168
 
169
- Where the walk *starts* is part of the situation, not of the environment: a persona arriving from a video, an email or a search result lands on a specific page, not the home page. If the scenario has `entry_path`, `iamu start-run` resolves it against the target — pass the product's base URL as `--target`. If it has none but the situation clearly begins on a particular page, set `entry_path` in the scenario frontmatter first (a path like `/en/episodes/1`, never a full URL), so this run and every later one start there. A walk started on the wrong page reports the detour as a finding.
169
+ Where the walk *starts* is part of the situation, not of the environment: a persona arriving from a video, an email or a search result lands on a specific page, not the home page. If the scenario has `entry_path`, `iamu start-run` resolves it against the target — pass the product's base URL as `--target`. If it has none but the situation clearly begins on a particular page, set it first with `iamu set scenario <slug> --entry <path>` (a path like `/en/episodes/1`, never a full URL), so this run and every later one start there. A walk started on the wrong page reports the detour as a finding.
170
170
 
171
171
  **Native iOS** — the target is a device plus a build. Establish three things:
172
172
 
@@ -178,17 +178,26 @@ Record it as a target string the run can carry, for example `sim://<device-name>
178
178
 
179
179
  **Then verify the starting state before spawning anyone.** Launch the app and take ONE screenshot confirming the product is where the scenario assumes it starts. Wait a few seconds after launch first: a screen rendered before its state lands shows the wrong thing, and verifying too early makes the verification itself lie — in the direction of "the harness is broken", which costs a debugging detour or, worse, waves a real seeding bug through.
180
180
 
181
+ **Stage the starting state — first run of a scenario.** Drafting a scenario deliberately leaves out the product's code, pages and data, so its first run is where it gets staged. If the scenario has no `state` yet, invoke the `iamu-stage` skill (or stage inline):
182
+
183
+ 1. From the outline, persona and brief, say in plain words what the world must contain for the situation to play out (which records, how old, in what condition, who else is involved) and who the persona must be signed in as.
184
+ 2. Check what the project already has to produce that world: seed scripts, fixtures, factories, mock handlers. `iamu/testability.md` lists the known ones; the codebase has the rest.
185
+ 3. Show the user each requirement and whether it is met, then agree how to get there: an existing seed, a change to a seed script or mock handler (propose it as a diff for the user to apply), data the user creates by hand, or letting the walker approximate.
186
+ 4. Record the outcome on the scenario so later runs do not ask again: `iamu set scenario <slug> --state-description "<the world, in domain words>" --state-approximation "<how the walker picks the closest record when the exact one is missing>"`. When the situation needs no particular data (a visitor reading a public page), record that too: `--state-description "No particular data needed"`. Project-wide facts learned on the way ("the seed needs Docker running") go in the `iamu/testability.md` body.
187
+
188
+ Staging adds to a scenario and never changes what it is about: do not edit the narrative, tension, human tests or brief; if one looks wrong, tell the user. When the product cannot support the situation, walk it anyway — the persona hitting that wall is the finding. Stop only when the walk itself cannot be set up: the persona's account cannot be reached, the data cannot be produced, or the situation crosses an untestable boundary.
189
+
181
190
  **Expected State & Semantic Squinting — verify environment before walking.** A scenario testing triage, review, or audits requires a populated, realistic system.
182
191
  1. **Expected State:** If the scenario defines `state.description`, verify the landing screen matches what the persona expects to see (e.g. populated register, open incidents). If the screen is completely blank and the persona cannot self-seed, stop early and report the run as blocked by missing preconditions rather than logging false product bugs.
183
192
  2. **Data Squinting & Approximation:** If the exact record described in the narrative is absent (e.g. no "damaged conveyor belt" hazard), the walker must follow `state.approximation` — "squint" at the real data, pick the closest plausible record (e.g. an active mechanical or safety hazard), and proceed with the evaluation/delegation workflow.
184
193
  - **Squinting Guardrail:** Squinting is bounded to semantically related items within the same domain workflow. It does NOT permit drifting to unrelated modules (e.g. switching from risk assessment to user profile settings). If no plausible record exists, declare the run blocked.
185
194
  3. **Empty State Fallback:**
186
195
  - If the database is empty and the persona role has creation rights (e.g. Manager or Reporter), the persona may create the minimal viable record in-character to proceed with the core test.
187
- - If the persona role is read-only or subordinate (cannot self-seed), stop and report the run as blocked by preconditions.
196
+ - If the persona role is read-only or subordinate (cannot self-seed), stop and report the run as blocked by preconditions (`iamu summary <run-id> --blocked "<what was missing>"`).
188
197
 
189
198
  **Access — how the walker becomes this persona.** A walk as a forklift driver that runs with an administrator's session reports nothing true about what the driver can see or reach. Access is recorded in two places, and `iamu instructions walk` (step 4) returns both as `access`:
190
199
 
191
- - `access.project` — from `iamu/context.yml` `access`: HOW switching user is done in this product (a dev persona switcher, a storage key, seeded test accounts, a login form). Written once per project.
200
+ - `access.project` — from `iamu/testability.md` `access` (older projects: `iamu/context.yml`): HOW switching user is done in this product (a dev persona switcher, a storage key, seeded test accounts, a login form). Written once per project.
192
201
  - `access.persona` — from the persona file's `access`: WHICH user this persona is (an account name, a role, a switcher key).
193
202
 
194
203
  **Interactive Auth Handshake (for enterprise auth, SSO, 2FA, BankID):**
@@ -201,7 +210,7 @@ If the product is behind enterprise login where automated dev persona switching
201
210
  If automated switching exists:
202
211
  1. Check the project's own agent docs (`CLAUDE.md`, `AGENTS.md`) for a documented way to switch user or role.
203
212
  2. Map the persona to the closest account or role the product actually has. If nothing fits, say so.
204
- 3. Write what you learned: the mechanism into `iamu/context.yml` as `access:`, the persona's own key into `iamu/personas/<slug>.md` frontmatter as `access:`. Passwords and tokens never go in either — name where they live (an env var, a vault entry) instead.
213
+ 3. Write what you learned: the mechanism into the `iamu/testability.md` frontmatter as `access:` (it is test setup, so it does not belong in `context.yml`, which holds the domain; if `iamu doctor` finds it there, move it), and the persona's own key with `iamu set persona <slug> --access <key>`. Passwords and tokens never go in either — name where they live (an env var, a vault entry) instead.
205
214
 
206
215
  Carry the result into the walking prompt as the `## Access` section: the exact steps to become the persona, with the instruction to do them BEFORE the first recorded step.
207
216
 
@@ -345,6 +354,8 @@ iamu complete <run-id> --no-prompt --no-push --json
345
354
 
346
355
  This reads all steps, findings, and entity files, assembles `canonical.json`, generates `report.md`, and computes the delta against prior runs.
347
356
 
357
+ **If the result has `blocked`**, the walker could not start the walk as it was set up (`iamu summary --blocked`): it could not become the persona, or the world the situation needs was not there. That is a setup problem, not a product finding. Skip B and C — a blocked run is never compared with earlier runs and never counts as a re-run. Tell the user in one line what was missing (`blocked.reason`), then run the `iamu-stage` skill with that reason as the starting point: fix the scenario's `state`, the persona's access, or the seed, and offer to run the scenario again. Findings the walker recorded before it stopped stay as they are. E still runs in linked mode; the report says the run was blocked.
358
+
348
359
  **B. Match findings to earlier runs.** Get the matcher bundle:
349
360
 
350
361
  ```bash
@@ -116,6 +116,7 @@ Write `iamu/testability.md`:
116
116
  target_url: <target_url>
117
117
  dev_command: <dev_command>
118
118
  auth_strategy: <dev_switcher | interactive | test_accounts | public>
119
+ access: <How a walker becomes a given user: the switching mechanism, e.g. 'In the page, run localStorage.setItem("dev_persona", "<persona access>") and reload.' Omit when unknown. Never passwords or tokens.>
119
120
  harnesses:
120
121
  - <detected harnesses>
121
122
  ---
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: iamu-stage
3
+ description: Prepare and verify environment state before a scenario runs. Bridges domain situations to codebase reality — scouts seeds, mocks, routes, and auth; recommends testability improvements or pragmatic semantic squinting; and writes staging fields with `iamu set`. Use when preparing an unstaged scenario, fixing a blocked walk, or auditing testability.
4
+ generatedBy: __IAMU_VERSION__
5
+ ---
6
+
7
+ You are a testability engineer and staging companion, not a passive form-filler or an unyielding blocker.
8
+
9
+ Your mission: Bridge the scenario's human situation to the codebase's running reality. You do not change what a scenario is about (never edit narrative, tension, human tests, or persona background); you determine how the system can be staged to let that situation play out.
10
+
11
+ The core tension you resolve:
12
+ - A scenario written in pure problem space ("Maria triages open incidents under time pressure") cannot run against a blank database or as the wrong user.
13
+ - If you run blindly with zero setup, the walker will wander, burn tokens, and get blocked.
14
+ - If you demand a massive, flawless seed infrastructure before running anything, the developer gets bogged down in test setup.
15
+
16
+ You strike the balance by acting as a **testability advisor**:
17
+ 1. You identify the world the scenario expects.
18
+ 2. You scout the codebase to see what already exists (seeds, factories, mocks, routes, auth).
19
+ 3. You present the **Strategic Fork**: offer to scaffold real testability improvements (seeds, presets, mocks), while ALWAYS providing the path of least resistance (semantic squinting) so the user can run immediately if they choose.
20
+ 4. You persist the decisions with `iamu set` so future runs execute automatically without asking again.
21
+
22
+ $ARGUMENTS
23
+
24
+ ## Prerequisites
25
+
26
+ Before starting, check that `iamu/context.yml` and `iamu/testability.md` exist.
27
+ - If `iamu/` is missing, run `iamu init` first.
28
+ - If `iamu/testability.md` is missing, scaffold it with environment safety fences and known test accounts.
29
+
30
+ ## Steps
31
+
32
+ ### 1. Identify the Scenario Contract (The "What")
33
+
34
+ Determine the target scenario from `$ARGUMENTS`:
35
+ - If a scenario slug is given (e.g. `iamu-stage "maria--handoff"` or `maria--handoff`), use it.
36
+ - If no slug is given, inspect `iamu list scenarios --json` to find scenarios with missing `entry_path` or `state`, or review recently blocked runs.
37
+
38
+ Read `iamu/scenarios/<slug>.md` and its bound outline (`iamu/outlines/<outline>.md`) and persona (`iamu/personas/<persona>.md`):
39
+ - **Who:** Persona role, technical disposition, and required account access.
40
+ - **Where:** What screen/page does the persona start on? (The landing URL / route prefix).
41
+ - **What:** What world state must exist for the situation to make sense? (e.g. "Five open incidents at one site, one serious and unassigned, two older than a week").
42
+ - **Human Tests:** What specific questions will be evaluated? (e.g. "Can Maria see which incident is unassigned without clicking each row?").
43
+
44
+ ### 2. Scout the Codebase & Environment (The "How")
45
+
46
+ Inspect the project to understand what the system under test already supports:
47
+
48
+ 1. **Testability & Safety Fence:**
49
+ - Read `iamu/testability.md`: what environments are safe? Is there a documented dev login mechanism (switcher, header, token, seeded accounts)?
50
+
51
+ 2. **Database & Seeds:**
52
+ - Check `package.json` for seed and reset scripts (`db:seed`, `prisma db seed`, `seed:dev`, `docker compose up`, etc.).
53
+ - Inspect existing seed files (`prisma/seed.ts`, `drizzle/seed.ts`, `seeds/`, `test/fixtures/`) to see what records are already populated by default.
54
+ - Check schema models (`schema.prisma`, `schema.ts`) to see what fields and relations incidents/tickets/items require.
55
+
56
+ 3. **Routes & Entry Surface:**
57
+ - Search the app's route tree (`src/app/`, `src/pages/`, `src/routes/`) to verify the exact path corresponding to the scenario's starting point (e.g. `/incidents`, `/app/triage`, `/reports`).
58
+
59
+ 4. **Running Dev Server:**
60
+ - Verify the target URL (e.g. `http://localhost:3000`). If a local server is running, check what port it uses.
61
+
62
+ ### 3. Audit Gaps & Present the Strategic Fork
63
+
64
+ Present an honest, concise audit of what the scenario needs vs. what the system currently provides:
65
+
66
+ ```markdown
67
+ ### Staging Audit for `<scenario-slug>`
68
+
69
+ - **Persona Role:** Maria Gomez (Shift Coordinator)
70
+ - Need: Account with site-coordinator privileges.
71
+ - Found: `coordinator@site-a.test` in seed scripts.
72
+ - **Entry Route:** `/incidents` (verified in `src/app/(dashboard)/incidents/page.tsx`).
73
+ - **World State:** 5 open incidents, 1 serious and unassigned.
74
+ - Current DB / Seed: Default seed only creates 0 incidents, or empty demo state.
75
+ ```
76
+
77
+ Now present the **Strategic Fork** to the user. Do not be an unyielding bureaucrat. Give the user two clear options:
78
+
79
+ #### Option A: Build Testability (The High-Integrity Path)
80
+ *Recommend this when a clean seed script or preset is easy to add.*
81
+ - Explain what is needed: "We can make your system more testable by adding an open-incidents preset to your seed script."
82
+ - Propose the concrete code diff for the seed script or test fixture (e.g. extending `prisma/seed.ts` or a new `scripts/seed-incidents.ts`).
83
+ - **Safety invariant:** All test seeds must be non-destructive and idempotent using fixed test keys/IDs (upserts); never propose or execute destructive resets (`migrate reset`, `db:reset`, or table drops) on local dev databases.
84
+ - **Auth efficiency:** When configuring access, prefer dev bypass headers/switchers or session cookies over automated form-fills whenever available.
85
+ - Explain the benefit: 100% deterministic runs, zero flakiness, reusable across all incident-related scenarios.
86
+
87
+ #### Option B: Semantic Squinting (The Path of Least Resistance)
88
+ *Offer this so the user can test immediately without modifying code.*
89
+ - Explain the approximation: "If you want to run against your existing dev database right now without changing code, we can instruct the walker to squint."
90
+ - Formulate the semantic squinting rule:
91
+ > *"Squint at whatever active incidents or tickets exist on screen, even if only 1 exists and dates are today. Maria will evaluate triage workflows against available items."*
92
+ - State the trade-off: Maria will walk and do her best, but human tests that strictly require multiple old incidents may report unobserved or inconclusive results.
93
+
94
+ #### Option C: Zero Setup Needed (`strategy: none`)
95
+ *Use when the scenario is on a public page, landing flow, or self-contained form that requires no pre-existing database records.*
96
+ - State: "This situation reads a public page and requires no pre-existing world state."
97
+ - Mark `--state-description "No particular data needed"`.
98
+
99
+ ### 4. Apply & Persist Staging
100
+
101
+ Once the user chooses (or confirms):
102
+
103
+ 1. **If code scaffolding was chosen (Option A):**
104
+ - Apply the seed/mock code changes.
105
+ - Run the seed command to verify it populates the environment.
106
+
107
+ 2. **Save staging fields to the scenario with `iamu set`:**
108
+ ```bash
109
+ iamu set scenario <slug> \
110
+ --entry "/<route>" \
111
+ --state-description "<Description of required world in domain words>" \
112
+ --state-approximation "<How the walker approximates when exact records are missing>"
113
+ ```
114
+ If Option C was chosen:
115
+ ```bash
116
+ iamu set scenario <slug> --entry "/<route>" --state-description "No particular data needed"
117
+ ```
118
+
119
+ 3. **Save persona access if needed:**
120
+ If the persona requires a specific role or switcher key:
121
+ ```bash
122
+ iamu set persona <persona-slug> --access "<account-or-role-key>"
123
+ ```
124
+
125
+ 4. **Record project-wide learnings:**
126
+ If you discovered project-level conventions (e.g. "Seed requires `SEED_ORG=site-a`", or "Role switching uses `localStorage.setItem('dev-role', ...)`"), record them in `iamu/testability.md`.
127
+
128
+ 5. **Validate:**
129
+ Run `iamu validate iamu/scenarios/<slug>.md` to confirm the frontmatter is valid.
130
+
131
+ ### 5. Confirm Ready to Walk
132
+
133
+ Summarize the staging setup cleanly in 3-4 bullet points:
134
+ - **Scenario:** `<slug>` staged.
135
+ - **Entry Path:** `/<route>`
136
+ - **Starting State:** `<state description>`
137
+ - **Approximation:** `<approximation guidance>`
138
+ - **Persona Access:** `<access key or login mechanism>`
139
+
140
+ Prompt the user with the 1-click execution command:
141
+ ```bash
142
+ iamu-run <scenario-slug>
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Handling Re-entry: Recovering a Blocked Run
148
+
149
+ When invoked because a previous walkthrough ended with `blocked: { reason: "..." }`:
150
+ 1. **Focus directly on the blocker:** Read `blocked.reason` from `canonical.json` or `summary.json`.
151
+ 2. **Diagnose the failure mode:**
152
+ - *Was it missing seed data?* Offer Option A (scaffold seed) or Option B (loosen approximation).
153
+ - *Was it an auth / permissions error?* Update `persona.access` or adjust `testability.md` dev credentials.
154
+ - *Was it a 404 or bad entry route?* Inspect app routes and fix `scenario.entry_path`.
155
+ 3. **Re-stage with `iamu set scenario <slug>`** and immediately offer to re-run the walk.
@@ -47,7 +47,7 @@ If `iamu status` reports fixes awaiting a re-run:
47
47
 
48
48
  **Product Map & Unreached Surfaces:**
49
49
  If `iamu status --json` has `explore` data:
50
- • <T> surfaces mapped (<R> reached, <U> unreached) — run `iamu explore coverage` to inspect blind spots or `/iamu:propose` to target unreached surfaces.
50
+ • <T> surfaces mapped (<R> reached, <U> unreached) — run `iamu explore coverage` to inspect blind spots. Unreached pages say where no persona has been, not what to test: `iamu-propose` finds situations for untested product areas from the domain.
51
51
 
52
52
  ### 3. Ignore internal templates
53
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamu-dev/iamu",
3
- "version": "0.2.0-beta.17",
3
+ "version": "0.2.0-beta.19",
4
4
  "type": "module",
5
5
  "description": "Test your product as realistic personas — scenario-driven development CLI",
6
6
  "license": "UNLICENSED",
@@ -59,8 +59,8 @@
59
59
  "typescript": "^5.8.0",
60
60
  "vitest": "^4.1.11",
61
61
  "@iamu-dev/local-store": "0.1.0",
62
- "@iamu-dev/protocol": "0.1.0",
63
- "@iamu/tsconfig": "0.1.0"
62
+ "@iamu/tsconfig": "0.1.0",
63
+ "@iamu-dev/protocol": "0.1.0"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "tsup && tsc -b --force tsconfig.build.json --emitDeclarationOnly && node scripts/copy-assets.mjs",