@iamu-dev/iamu 0.2.0-beta.6 → 0.2.0-beta.9

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.
@@ -70,11 +70,9 @@ Continuity: steps form ONE ongoing monologue. From step 2 onward, don't restate
70
70
 
71
71
  ## Pacing
72
72
 
73
- **Aim for 10-20 steps.** Stop when the primary task verdict is clear — either the persona accomplished their goal or they hit friction that blocks them. A focused 12-step walkthrough with sharp findings is worth more than a 40-step exhaustive tour.
73
+ **Aim for 10-20 steps.** When evaluating a form or journey, inspect all relevant sections across the workflow (e.g., travel details, per diem, deductions, expenses). Do not abandon the walkthrough after logging a single defect — continue through the remaining sections to uncover all distinct compliance and usability gaps before completing. A complete walkthrough with sharp findings across all sections gives the team high-value signal.
74
74
 
75
- Do not try to complete every interaction. If a form has 15 fields, the observation is "this persona would give up at field 4" — note the finding and move on.
76
-
77
- Do try key interactions that reveal something: click the main CTA, open a dropdown, check what filters exist. These are cheap observations with high signal.
75
+ Do try key interactions that reveal something: click the main CTA, open a dropdown, check what options or deductions exist. These are cheap observations with high signal.
78
76
 
79
77
  Follow the persona's motivation. Spend time on what matters to them. When you have enough evidence to answer "would this person come back?" — you're done.
80
78
 
@@ -100,6 +98,20 @@ Your browser tooling has limitations that can look like product bugs. Before rec
100
98
 
101
99
  Do NOT silently suppress findings you suspect are tooling issues. Record them with the caveat — the human triaging can verify.
102
100
 
101
+ ## Expected state vs product bugs (Empty state & unseeded data)
102
+
103
+ When an environment is unseeded or test records are missing:
104
+ - An empty table or "No records found" screen is NOT automatically a product bug. If your scenario assumes existing data (e.g. reviewing past entries or auditing submitted claims), check whether the environment simply lacks seed data.
105
+ - If your persona role is a creator (e.g. employee or consultant creating an item), click the creation CTA (e.g. "+ Ny reseräkning", "+ New") and proceed with your task.
106
+ - If your persona role is read-only (e.g. an auditor or manager) and cannot create data, do NOT record false "missing data" bugs against the product. Conclude the walk noting that the environment lacks the required preconditions.
107
+
108
+ ## Semantic squinting (Adapting to environmental mismatch)
109
+
110
+ Your prompt may include an approximation strategy (e.g. "If Malmö is missing, choose Göteborg").
111
+ - **Squint at the closest match:** When the exact target name, category, or record described in your brief isn't available in this environment, pick the closest available alternative that allows testing the workflow.
112
+ - **Stay in the journey:** Approximation is bounded. Never drift to unrelated modules (e.g. settings, profile, admin panels) just because a specific test record was absent.
113
+ - **Log the approximation:** In your step note (`note`), state clearly that you chose the closest alternative according to your instructions.
114
+
103
115
  ## Portal-rendered UI
104
116
 
105
117
  Radix / Headless UI / Floating UI render dropdowns and listboxes into portals that do not appear in accessibility snapshots. If an expandable combobox looks empty after click, try: press ArrowDown then Enter, or evaluate a script in the page to probe the DOM. Take a fresh screenshot.
@@ -95,9 +95,16 @@ Human Checkpoint: <Concrete binary yes/partial/no question scored at evaluation>
95
95
  Roles with Stakes:
96
96
  • <Role 1>: <Stake>
97
97
  • <Role 2>: <Stake>
98
+
99
+ Execution Preconditions (resolved at iamu-run):
100
+ • Assumed State: <What records/data should exist, e.g. "Department with existing risk register containing open hazards">
101
+ • 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">
102
+ • Reachable Surface: <Entry route matched against iamu/testability.md, e.g. "/incidents/new">
103
+
104
+ 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.
98
105
  ```
99
106
 
100
- Ask the user: "Ready to test this draft, or would you like to refine the focus question or circumstances? (Enter to accept, or type adjustments)"
107
+ Ask the user: "Ready to test this draft, or would you like to refine the focus question, preconditions, or circumstances? (Enter to accept, or type adjustments)"
101
108
 
102
109
  ### 4. Pick or propose personas
103
110
 
@@ -164,12 +171,12 @@ The `--role` and `--disposition` flags populate frontmatter directly. If `iamu/c
164
171
 
165
172
  **4. Scenario** (the binding):
166
173
  ```bash
167
- iamu new scenario --name "maria-gomez--busy-shift-handoff" --outline busy-shift-handoff --persona maria-gomez --json
174
+ 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
168
175
  ```
169
176
  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.
170
- `--outline` is required. `--persona` is optional (omit for drafts). Write the first-person brief as the markdown body — 3–5 sentences in the persona's voice.
177
+ `--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.
171
178
 
172
- For drafts (no persona): omit `--persona`, omit the brief body.
179
+ For drafts (no persona): omit `--persona`, omit `--body`.
173
180
 
174
181
  ### 7. Summarize
175
182
 
@@ -33,15 +33,19 @@ If context is thin (few actors, sparse notes), say so upfront — "your context
33
33
 
34
34
  ## Steps
35
35
 
36
- ### 1. Load domain context
36
+ ### 1. Load domain context & testability boundaries
37
37
 
38
38
  Read `iamu/context.yml`. Extract and hold:
39
39
  - **Domain + industry** — what world does this product operate in?
40
40
  - **Actors** — real roles with real responsibilities. These are scenario and persona seed material.
41
41
  - **Governed_by** — regulations and standards (if applicable). These create structural tensions in regulated domains.
42
- - **Glossary** — domain vocabulary. Scenarios and personas must use these terms, not generic UI words.
43
42
  - **Notes body** — extended context, often containing workflow descriptions, pain points, organizational dynamics.
44
43
 
44
+ Read `iamu/testability.md` (if present) to enforce execution boundaries:
45
+ - **Reachable surfaces:** Ground candidates in reachable routes. Avoid proposing scenarios for product areas with no navigable surfaces.
46
+ - **Untestable boundaries:** Strictly avoid proposing scenarios in flows documented as untestable (e.g. un-mocked live payment gateways, SMS dispatch, third-party SSO).
47
+ - **Mocks & Fixtures:** Note which candidates require existing database seeds or mock handlers.
48
+
45
49
  ### 2. Load existing coverage
46
50
 
47
51
  Read existing entities to understand what's already been tested:
@@ -116,7 +120,7 @@ Next action:
116
120
  Ground rules for generation:
117
121
 
118
122
  - **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?
119
- - **Use domain vocabulary from the glossary.** If the glossary says "skyddsombud" not "safety representative," use "skyddsombud."
123
+ - **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.
120
124
  - **Prefer mundane frequency over dramatic edge cases.** The scenario that happens every week reveals more than the one that happens once a year.
121
125
  - **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."
122
126
  - **Never mention the product, its UI, its features, or its limitations.** The scenario exists in the domain. The product encounter happens during the walkthrough.
@@ -113,7 +113,11 @@ After bind + brief, the scenario is ready to execute. Continue to step 3.
113
113
 
114
114
  ### 3. Target
115
115
 
116
- **Web** — ask for the target URL (live product, staging, or localhost). If the scenario has a default `target_url` in its frontmatter, offer that with a confirm.
116
+ **Web** — determine the target URL:
117
+ 1. If the user passed an explicit target or the scenario has `target_url`, use that.
118
+ 2. Otherwise, check `iamu/testability.md` for `target_url`.
119
+ 3. If still unconfigured, prompt the user for the target URL (live product, staging, or localhost).
120
+ Verify target reachability and dev server health with `iamu doctor --target <url>` before launching.
117
121
 
118
122
  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.
119
123
 
@@ -127,19 +131,30 @@ Record it as a target string the run can carry, for example `sim://<device-name>
127
131
 
128
132
  **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.
129
133
 
130
- **Web: check the product is ready, not just up.** A server that answers is not a product that has its data. Before spawning the walker, confirm the thing the scenario depends on actually exists — the list the persona will open is populated, the seeded records are there, background setup (seeding, migrations, indexing) has finished. Use the project's documented readiness signal if it has one; otherwise look at one screen or one API response yourself. A walk started too early reports "the feature is missing" as a critical finding, and nothing in the walker's view distinguishes that from a real defect.
134
+ **Expected State & Semantic Squinting — verify environment before walking.** A scenario testing triage, review, or audits requires a populated, realistic system.
135
+ 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.
136
+ 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.
137
+ - **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.
138
+ 3. **Empty State Fallback:**
139
+ - 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.
140
+ - If the persona role is read-only or subordinate (cannot self-seed), stop and report the run as blocked by preconditions.
131
141
 
132
142
  **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`:
133
143
 
134
144
  - `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.
135
145
  - `access.persona` — from the persona file's `access`: WHICH user this persona is (an account name, a role, a switcher key).
136
146
 
137
- If both are present, use them as they are. If either is missing, fill the gap now and SAVE it so no later run has to ask:
138
-
139
- 1. Check the project's own agent docs (`CLAUDE.md`, `AGENTS.md`, anything they point to for the dev environment) for a documented way to switch user or role.
140
- 2. Map the persona to the closest account or role the product actually has. If nothing fits, say so — a persona the product cannot represent is itself worth telling the user.
141
- 3. If the docs are silent, ask the user once. "No login, everyone is the same user" is a valid answer.
142
- 4. 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.
147
+ **Interactive Auth Handshake (for enterprise auth, SSO, 2FA, BankID):**
148
+ If the product is behind enterprise login where automated dev persona switching is not configured:
149
+ 1. Open the browser to the target URL (`iamu browse start --run <run-id>` or browser tool).
150
+ 2. Prompt the human user:
151
+ > 👉 **Please log in as `<persona.role>` (`<persona.name>`) in the opened browser window.** Press Enter once you reach the dashboard to hand control to the walker...
152
+ 3. Wait for the user to confirm, then let the walker drive the authenticated session.
153
+
154
+ If automated switching exists:
155
+ 1. Check the project's own agent docs (`CLAUDE.md`, `AGENTS.md`) for a documented way to switch user or role.
156
+ 2. Map the persona to the closest account or role the product actually has. If nothing fits, say so.
157
+ 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.
143
158
 
144
159
  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.
145
160
 
@@ -34,7 +34,7 @@ Check whether `iamu/config.json` already exists:
34
34
 
35
35
  ### 2. Understand the project
36
36
 
37
- Explore the codebase automatically — do NOT ask the user what files to read. Build a **project-context summary** (3–6 sentences) the downstream skills will use as grounding. Read the following files when present:
37
+ Explore the codebase automatically — do NOT ask the user what files to read. Build a **substantive project description** that serves as the foundation for all downstream analysis (personas, scenarios, and walkthroughs). Read the following files when present:
38
38
 
39
39
  - `README.md`, `CLAUDE.md`, `agents.md`
40
40
  - Package manifests — `package.json`, `Cargo.toml`, `pyproject.toml`, `go.mod`
@@ -42,114 +42,164 @@ Explore the codebase automatically — do NOT ask the user what files to read. B
42
42
  - `docs/`, OpenAPI / JSON / GraphQL schemas, `src/`-style source directories
43
43
  - `.env.example`
44
44
 
45
- Extract these key dimensions:
45
+ **Quality Standard for Project Context (Knowledgeable Observer):**
46
+ Write as an objective domain expert describing the business and its users, NOT marketing jargon, cookie notices, or tech stack. Do NOT hedge with "appears to be" or "seems to".
46
47
 
47
- 1. **Domain & Purpose** — what this product does, core workflows, and problem space (mandatory).
48
- 2. **Jurisdiction & Regulations (`governed_by`)** — country/region and specific compliance frameworks (AFS 2023:2, GDPR, HIPAA, ISO 27001, etc.). **Strictly optional:** only extract if the repo explicitly references legal or compliance standards. Do NOT invent regulations for standard apps.
49
- 3. **Key Actors & Roles** — the main user archetypes and roles discovered in the codebase (auth models, routes, permissions).
50
- 4. **Dev Access & Auth** — how personas switch or log in during local dev/test (e.g. dev persona switcher, seeded accounts, storage key, mock headers). Essential for walkthrough automation.
51
- 5. **Key Terminology (`glossary`)** — 2–4 domain-specific terms or acronyms found in the codebase.
52
- 6. **Primary Personas** — determine the 1–2 most critical user archetypes that stress-test this product (e.g. End User / Frontline vs. Admin / Compliance, or First-Timer vs. Power User). Propose:
53
- - Name and Role
54
- - Disposition / perspective (patience level, tech literacy, primary friction triggers)
48
+ The description MUST capture four substantive dimensions:
49
+ 1. **What the product fundamentally IS** — core workflow, product type, and problem space.
50
+ 2. **Who actually uses it and what they come here to do** — enumerate the real user journeys (e.g. reporting incidents, triaging risks, delegating actions, auditing).
51
+ 3. **What makes THIS product specific** — geography, jurisdiction, regulatory mandates, or business model.
52
+ 4. **Operational characteristics** — how users physically and organizationally encounter the software (e.g. deskless frontline mobile workers in high-hazard environments, strict statutory completion deadlines, immutable audit trails).
55
53
 
56
- Do NOT collect code architecture (agent reads the codebase directly — tech stack doesn't affect walkthroughs).
54
+ *Example of target substance:*
55
+ > "IA-systemet is Sweden's national work environment and safety incident management platform, utilized by thousands of Swedish enterprises to comply with statutory systematic work environment requirements (AML / AFS). It enables frontline employees to quickly log near-misses (tillbud), workplace accidents (olycksfall), and risk observations from desktop or mobile devices in the field. Core user journeys include real-time hazard reporting, line manager root-cause investigations, safety committee review, and action plan delegation with statutory compliance tracking."
57
56
 
58
- **If there is no code (greenfield, design phase):** ask the user: what does this project do, who are the users, what domain, and are there any specific regulations?
57
+ Synthesize the project into a cohesive, substantive narrative (1–2 paragraphs):
58
+ - What the product fundamentally is, its primary domain, and who uses it.
59
+ - Key user journeys and operational characteristics (e.g. mobile floor use, audit deadlines).
60
+ - Market, geography, and specific compliance frameworks (only if evident).
59
61
 
60
- **Present the proposal with clean, structured Markdown for confirmation:**
62
+ Audit testability without cluttering the domain context:
63
+ Inspect `package.json` dev scripts, existing mock harnesses (MSW, seed scripts), auth route guards (`middleware.ts`, ProtectedRoute, session hooks), and page/route directories (`app/`, `src/routes/`). Use these findings to populate `iamu/testability.md`.
61
64
 
62
- ```markdown
63
- ### 📋 Discovered Project Context
65
+ **If there is no code (greenfield, design phase, or test sandbox):** do NOT interrogate the user with a multi-part survey or ask for dev auth plumbing. Ask for a single entry point:
66
+ > No local codebase detected. To seed context, provide one of:
67
+ > - A target URL (staging, production, or docs — e.g., `https://app.example.com`)
68
+ > - A one-sentence description of what this product does
69
+ > - Or type `"sandbox"` to seed a pre-configured B2B SaaS demo
64
70
 
65
- - **Domain & Purpose:** <Concise description of the product and problem space>
66
- - **Jurisdiction & Rules:** <Country/region and compliance frameworks, or "None identified">
67
- - **Key Roles Identified:** <List of detected roles and their responsibilities>
68
- - **Dev Access & Auth:** <Detected mechanism to switch/assume personas in dev, or "Standard login">
69
- - **Domain Terminology:** <2–4 key terms/acronyms found in the codebase, if any>
71
+ **Autonomous Enrichment:**
72
+ - **URL provided:** Fetch or search public marketing/docs for that site. Automatically extract the substantive narrative, core user journeys, and key actors. If industry regulations are obvious (e.g., healthcare/HIPAA, Swedish workplace safety/AML), include them in the narrative.
73
+ - **One-sentence summary provided:** Immediately expand into a full substantive narrative using domain knowledge.
74
+ - **"sandbox" provided:** Seed a standard B2B SaaS narrative with Admin and End-User roles.
70
75
 
71
- ---
76
+ **Present ONLY the narrative description for user confirmation (Do NOT include metadata bullets or personas):**
72
77
 
73
- ### 🎭 Proposed Primary Personas
74
-
75
- #### 1. <Name> — *<Role / Title>*
76
- - **Context & Usage:** <Where and how they use the app (e.g., mobile on the floor vs. desktop in office)>
77
- - **Disposition:** <Patience level, technical confidence, key motivations>
78
- - **Friction Triggers:** <Specific interactions that cause friction, drop-off, or failure>
78
+ ```markdown
79
+ ### 📋 Discovered Project Context
79
80
 
80
- #### 2. <Name> — *<Role / Title>*
81
- - **Context & Usage:** <Where and how they use the app>
82
- - **Disposition:** <Patience level, technical confidence, key motivations>
83
- - **Friction Triggers:** <Specific interactions that cause friction, drop-off, or failure>
81
+ <1–2 cohesive paragraphs written as a knowledgeable observer: what the product fundamentally is, who actually uses it, key user journeys, operational reality (e.g. mobile floor use, audit deadlines), and regulatory/market context. No marketing fluff, no hedging, no tech stack descriptions, and no bullet points.>
84
82
 
85
83
  ---
86
84
 
87
85
  **Next step:**
88
- Reply **"yes"** to save this context to `iamu/context.yml` and scaffold these personas, or tell me what to adjust (e.g., change roles, edit domain, or add/skip personas).
86
+ Reply **"yes"** to save this context to `iamu/context.yml`, or tell me what to adjust.
89
87
  ```
90
88
 
91
- Wait for the user to confirm or correct before writing. The user only needs to verify domain and choose whether to accept, edit, suggest alternative personas, or defer persona creation.
92
-
93
- ### 3. Capture domain context and scaffold personas
94
-
95
- Persist the step-2 summary as structured fields so every scenario draft and walkthrough loads the same grounding. Downstream skills auto-read this file.
96
-
97
- 1. Check existing state by reading `iamu/context.yml` directly.
89
+ Wait for the user to confirm or correct before writing. The user only needs to verify the narrative description and choose whether to accept or edit.
98
90
 
99
- 2. **Branch on what you find:**
91
+ ### 3. Capture domain context and seed personas (Two-Phase Confirmation)
100
92
 
101
- - **Empty / not present** → synthesize structured fields from step 2 and write `iamu/context.yml` with your file-editing tool (not a shell heredoc — it avoids permission prompts).
102
- - **Present but thin** (missing domain) → show what's missing and offer to fill it. User picks **refine** or **replace**.
103
- - **Present and complete** (domain set) → show summary and ask "Use as-is, refine, or replace?" Default is **skip**.
104
-
105
- 3. **Write `iamu/context.yml`**:
93
+ #### Phase A: Persist Context
94
+ Once the user confirms the narrative description:
95
+ 1. Derive the structured frontmatter fields (`domain`, `actors`, `jurisdiction`, `governed_by`) from the confirmed text, and write `iamu/context.yml` with your file-editing tool. Put structured fields in frontmatter and the substantive narrative in the markdown body below the `---`:
106
96
 
107
97
  ```yaml
108
98
  ---
109
99
  schema_version: 1
110
- domain: e-commerce storefront
111
- # jurisdiction: EU / US # optional
112
- # governed_by: # strictly optional - omit if not regulated
113
- # - name: GDPR
100
+ domain: workplace safety management
101
+ # jurisdiction: Sweden / EU # optional
102
+ # governed_by: # strictly optional - omit if not regulated
103
+ # - name: AFS 2023:2
114
104
  # authority_level: regulation
115
105
  actors:
116
106
  - name: Store Admin
117
107
  role: Manages catalog, inventory, and order fulfillment
118
108
  - name: First-Time Buyer
119
109
  role: Explores products, adds to cart, and checks out
120
- glossary:
121
- - term: SKU
122
- definition: Stock Keeping Unit
123
110
  access: >-
124
111
  No login in dev. In the page, set localStorage "dev_persona" to the
125
112
  persona's access value and reload.
126
113
  ---
114
+
115
+ <The substantive 1–2 paragraph project description and core user journeys>
127
116
  ```
128
117
 
129
118
  Rules:
130
119
  - `domain` — one line. Mandatory.
120
+ - Body markdown (below `---`) — substantive description and user journeys. Downstream skills read this as extended grounding.
131
121
  - `jurisdiction` — optional. Only if evident or relevant.
132
- - `governed_by[]` — strictly optional. Order by authority (legislation > regulation > standard > company_policy > guideline > informational). Specific names, not categories. Omit entirely if no regulations apply.
122
+ - `governed_by[]` — strictly optional. Order by authority. Omit entirely if no regulations apply.
133
123
  - `actors[]` — all identified roles and their responsibilities.
134
- - `glossary[]` — domain terms only. Thin is better than padded with generic terms.
135
- - `access` — optional. Only what the docs actually say; leave it out rather than guess. `iamu-run` fills it in on the first walk if it is missing.
124
+ - `access` — optional. Only what the docs actually say; leave it out rather than guess.
136
125
  - Do NOT add `industry` or `architecture` — these don't affect walkthroughs.
137
126
 
138
- 4. **Scaffold confirmed personas (unless `skip-personas` selected):**
127
+ 2. Persist the technical testability and execution contract to `iamu/testability.md`:
128
+ Scaffold the target environment, auth mechanisms, discovered surfaces, mock harnesses, and untestable boundaries discovered from the code:
139
129
 
140
- Use the CLI to scaffold valid persona entities with schema-compliant UUIDs, slugs, frontmatter, and narrative body in a single command:
141
- ```bash
142
- iamu new persona --name "<Name>" --role "<Role>" --disposition "<Disposition>" --body "<2-4 sentence narrative detailing technical habits, patience level, and specific friction triggers>" [--access "<account-or-role>"] --json
130
+ ```markdown
131
+ ---
132
+ target_url: http://localhost:3000
133
+ dev_command: <detected dev script, e.g. pnpm dev or pnpm dev:mock>
134
+ auth_strategy: <dev_switcher | interactive | test_accounts | public>
135
+ harnesses:
136
+ - <detected harnesses, e.g. msw, seed>
137
+ ---
138
+
139
+ # Project Testability & Environment
140
+
141
+ ## Target & Run Instructions
142
+ - Command: <dev command>
143
+ - Base URL: <target_url>
144
+
145
+ ## Auth & Access Boundary
146
+ - <How a walker becomes this persona in dev or test mode>
147
+
148
+ ## Reachable Surfaces
149
+ - <List discovered routes/entry points, e.g. /login, /dashboard, /incidents>
150
+
151
+ ## Mocks & Data Fixtures
152
+ - <List existing MSW mock files, DB seed scripts, or fixture directories>
153
+
154
+ ## Untestable Boundaries (Do Not Walk)
155
+ - <List un-mocked external dependencies, e.g. live Stripe charges, SMS 2FA, external SSO>
143
156
  ```
144
157
 
145
- If `iamu/context.yml` specifies an `access` mechanism, pass `--access "<role>"` matching an existing product account/role.
158
+ Keep `context.yml` strictly about domain reality (which the Walker subagent reads), and `testability.md` strictly about developer testability and execution boundaries (which orchestrator skills read).
159
+
160
+ #### Phase B: Persona Casting (Opt-In & Separate Confirmation)
161
+ Immediately after saving `iamu/context.yml`, ask the user if they want to seed baseline personas:
162
+
163
+ > Context saved to `iamu/context.yml`.
164
+ >
165
+ > Would you like to seed 1–2 baseline personas to your casting panel now?
166
+ > Reply **"yes"** to propose personas, or **"skip"** to create scenarios directly via `iamu-new`.
167
+
168
+ **If the user chooses "yes":**
169
+ Propose 1–2 primary personas grounded in the confirmed actors and operational characteristics:
170
+
171
+ ```markdown
172
+ ### 🎭 Proposed Primary Personas
173
+
174
+ #### 1. <Name> — *<Role / Title>*
175
+ - **Context & Usage:** <Where and how they use the app (e.g. mobile on the floor vs. desktop in office)>
176
+ - **Disposition:** <Patience level, technical confidence, key motivations>
177
+ - **Friction Triggers:** <Specific interactions that cause friction, drop-off, or failure>
178
+
179
+ #### 2. <Name> — *<Role / Title>*
180
+ - **Context & Usage:** <Where and how they use the app>
181
+ - **Disposition:** <Patience level, technical confidence, key motivations>
182
+ - **Friction Triggers:** <Specific interactions that cause friction, drop-off, or failure>
183
+
184
+ ---
146
185
 
147
- Once all confirmed personas are created, run validation once:
186
+ **Next step:**
187
+ Reply **"yes"** to scaffold these personas into `iamu/personas/`, or tell me what to adjust.
188
+ ```
189
+
190
+ Wait for the user to confirm or adjust. Once confirmed:
191
+ 1. Scaffold personas using the CLI:
192
+ ```bash
193
+ iamu new persona --name "<Name>" --role "<Role>" --disposition "<Disposition>" --body "<2-4 sentence narrative detailing technical habits, patience level, and specific friction triggers>" [--access "<account-or-role>"] --json
194
+ ```
195
+ 2. Validate once:
148
196
  ```bash
149
197
  iamu validate --all
150
198
  ```
199
+ 3. Confirm: "Context saved and personas seeded in iamu/personas/. Run `iamu-new` to draft your first scenario."
151
200
 
152
- 5. Confirm: "Context saved and personas seeded in iamu/personas/. Run `iamu-new` to draft your first scenario." (or "Context saved. Run `iamu-new` to draft your first scenario." if personas were skipped).
201
+ **If the user chooses "skip":**
202
+ Confirm: "Context saved. Run `iamu-new` to draft your first scenario."
153
203
 
154
204
  ### 4. Offer cloud link (optional)
155
205
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iamu-dev/iamu",
3
- "version": "0.2.0-beta.6",
3
+ "version": "0.2.0-beta.9",
4
4
  "type": "module",
5
5
  "description": "Test your product as realistic personas — scenario-driven development CLI",
6
6
  "license": "UNLICENSED",
@@ -54,11 +54,12 @@
54
54
  "devDependencies": {
55
55
  "@types/node": "^22.0.0",
56
56
  "@vitest/coverage-v8": "^4.1.11",
57
+ "google-auth-library": "^11.1.0",
57
58
  "tsup": "^8.5.1",
58
59
  "typescript": "^5.8.0",
59
60
  "vitest": "^4.1.11",
60
- "@iamu-dev/protocol": "0.1.0",
61
61
  "@iamu-dev/local-store": "0.1.0",
62
+ "@iamu-dev/protocol": "0.1.0",
62
63
  "@iamu/tsconfig": "0.1.0"
63
64
  },
64
65
  "scripts": {
@@ -67,6 +68,8 @@
67
68
  "typecheck": "tsc --noEmit",
68
69
  "test": "vitest run",
69
70
  "test:coverage": "vitest run --coverage",
71
+ "eval:walkthroughs": "vitest run --config vitest.benchmark.config.ts",
72
+ "eval:gemini": "node dist/eval/gemini-eval-cli.js",
70
73
  "pack:dry-run": "npm pack --dry-run"
71
74
  }
72
75
  }
@@ -1,52 +0,0 @@
1
- import { type BuildMetadata, type RunViewport, type ScenarioFrontmatter } from "@iamu-dev/protocol";
2
- /**
3
- * The URL a run starts at: `--target` (or the scenario's `target_url`)
4
- * as the base, with the scenario's `entry_path` resolved against it.
5
- * Returns an error message instead when there is nothing usable.
6
- */
7
- export declare function resolveStartUrl(target: string | undefined, scenario: Pick<ScenarioFrontmatter, "target_url" | "entry_path">): {
8
- url: string;
9
- } | {
10
- error: string;
11
- };
12
- /**
13
- * Fast preflight probe to check if the target URL answers HTTP requests.
14
- * Times out quickly (default: 1000ms) to avoid stalling walkthrough initialization.
15
- */
16
- export declare function checkTargetReachable(url: string, timeoutMs?: number): Promise<{
17
- reachable: boolean;
18
- error?: string;
19
- }>;
20
- /**
21
- * The build as one line: label, branch, commit and CI provider. A dirty
22
- * tree shows next to the commit, so a re-run after an uncommitted fix
23
- * visibly walks a different build.
24
- *
25
- * @example
26
- * ```ts
27
- * formatBuild({ git_sha: "90e2444…", git_dirty: true, worktree_hash: "3fa9c1d2e4b5" });
28
- * // "90e2444 + uncommitted changes (3fa9c1…)"
29
- * ```
30
- */
31
- export declare function formatBuild(build: BuildMetadata): string;
32
- /**
33
- * A run viewport as one line.
34
- *
35
- * @example
36
- * ```ts
37
- * formatViewport({ device: "desktop", width: 1280, height: 800, source: "persona-tags" });
38
- * // "desktop 1280×800 (from persona tags)"
39
- * ```
40
- */
41
- export declare function formatViewport(v: RunViewport): string;
42
- export interface StartRunOptions {
43
- target?: string;
44
- build?: string;
45
- env?: string;
46
- json?: boolean;
47
- check?: boolean;
48
- walker?: string;
49
- judge?: string;
50
- matcher?: string;
51
- }
52
- export declare function startRun(scenarioSlug: string, opts: StartRunOptions): Promise<void>;