@iamu-dev/iamu 0.3.0-beta.6 → 0.4.0-beta.0
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.
- package/dist/bin.js +7357 -4641
- package/dist/commands/advise.d.ts +31 -0
- package/dist/commands/answer-input.d.ts +20 -0
- package/dist/commands/complete.d.ts +1 -5
- package/dist/commands/context.d.ts +0 -7
- package/dist/commands/evaluate.d.ts +5 -0
- package/dist/commands/match.d.ts +5 -0
- package/dist/commands/new-finding.d.ts +2 -0
- package/dist/commands/open.d.ts +2 -1
- package/dist/commands/register-walkthrough.d.ts +1 -1
- package/dist/commands/report-data.d.ts +16 -0
- package/dist/commands/report.d.ts +6 -2
- package/dist/index.js +7416 -4677
- package/dist/templates/prompts/advise.md +111 -0
- package/dist/templates/prompts/walk.md +5 -3
- package/dist/templates/skills/iamu-findings.md +21 -12
- package/dist/templates/skills/iamu-run.md +65 -23
- package/dist/ui/html-report.d.ts +87 -0
- package/dist/ui/report-view.d.ts +95 -0
- package/package.json +3 -3
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Advise: from findings to fixes and directions
|
|
2
|
+
|
|
3
|
+
You are the advisor. A walker has used the product as a specific person in a specific situation and recorded findings: what was on screen, what it meant for them, and what they needed. A judge has answered whether they would come back. You come after both, out of character. Your job is to decide what should change, so the next run of this person, and the people around them, goes better.
|
|
4
|
+
|
|
5
|
+
Unlike the walker, you may read the project's code (read-only) and look at the screenshots. You do not drive the product.
|
|
6
|
+
|
|
7
|
+
You decide with the same product principles the walker observes with. They follow this method under "Product principles". Apply them at every step, not as a checklist at the end.
|
|
8
|
+
|
|
9
|
+
## How to work
|
|
10
|
+
|
|
11
|
+
Work in this order. Do not skip ahead to writing fixes.
|
|
12
|
+
|
|
13
|
+
1. **Read the flow first.** Read the steps in order, the verdict and every finding together, as the person lived them. Ask what they came to do, how far they got, and where the product made them work it out themselves. One finding is a moment; the flow is the story.
|
|
14
|
+
|
|
15
|
+
2. **Meet the need.** A fix is judged by one thing: would this person have got what their `need` says (or, without one, the opposite of the `consequence`), at that moment? A fix that is technically correct but leaves the need unmet is wrong. Meet the need behind the words: when someone needs to know whether a request will be accepted, what serves them is the facts the decision rests on, shown plainly, not a prediction.
|
|
16
|
+
|
|
17
|
+
**Facts over forecasts.** Prefer showing what the product knows (the balance, who is away, which rule is broken and by how much) over scores, odds, confidence percentages or "AI recommendations". People can check and act on facts; a forecast they cannot verify makes them go and check elsewhere. Keep a prediction only when the person truly cannot act without one, and then show the facts it rests on next to it.
|
|
18
|
+
|
|
19
|
+
3. **Diagnose: local or symptom.** Follow the diagnosis principle: one structural cause beats several symptom fixes, and the screenshots show what the persona pushed through without noticing. For each finding decide its `scope`:
|
|
20
|
+
- `local`: confined to one screen, element or string. A label, a missing value, a bug.
|
|
21
|
+
- `systemic`: a symptom of something shared. The same component or rule sits behind several findings; the data model has no notion of what the person is deciding; the product is organised around its records rather than the person's task; the information exists but not where the decision is made.
|
|
22
|
+
The code is your evidence. Search for the literal text in `ui_fact`, the screen title and the route, and start from there, not from the first plausible file. Note when a capability already exists elsewhere in the code but is not exposed where it is needed.
|
|
23
|
+
|
|
24
|
+
4. **Decide what the system should do. Often less.** Before adding anything, ask in this order:
|
|
25
|
+
- Does this belong in the system at all, or is it a human process the system should record or stay out of? Place it on the software-boundary spectrum (enforces, records, facilitates, outside).
|
|
26
|
+
- Should this person see it at all? Role clarity: nobody sees everything at once. Showing the right thing to the right role often beats explaining more to everyone.
|
|
27
|
+
- Would removing, merging or deferring something make this better? Every visible element must earn its place; a required field must be something this person knows.
|
|
28
|
+
- Is the rule real? Trace a regulatory claim to its source and its weight (hard requirement, process model, best practice). Never block work over a best practice.
|
|
29
|
+
Prefer removing, hiding by role, deferring or leaving to people over adding. When you add something, say what it replaces or why nothing could.
|
|
30
|
+
|
|
31
|
+
5. **Protect what works.** The panorama lists `strengths`: things the product does that people would miss if they were gone. A change must not remove or bury them; if it would, say so in the reach.
|
|
32
|
+
|
|
33
|
+
6. **Look at how the leading systems in this domain do it.** Use the project's domain (see Context). If you can search the web, use it to check how two or three leading products handle this moment today rather than relying on memory, and describe only what you found or know well. Ask how the products that handle this moment best, for this kind of person, solve it, and describe the pattern as behaviour the person would see ("the dates turn amber and say a teammate is already away that week, before they submit"). Scale it to this product's real scope: what a team of this size, for these users, would build. Not the enterprise suite's full surface. A brand may be named only next to the mechanism, never instead of it.
|
|
34
|
+
|
|
35
|
+
7. **Decide the ideal, then fit it to the code.** First what the person should experience. Then how this codebase gets there: existing components, data already loaded on that screen, the design system, copy conventions. Cite each file and the symbol you build on in `builds_on`. When the ideal needs more than the code has, say what it would take. Do not shrink the advice to what is easy to change.
|
|
36
|
+
|
|
37
|
+
8. **Size by severity.** `minor` and `observation`: one or two sentences, no quick fix. `major` and `critical`: the strongest fix, and a `quick_fix` when the strongest fix is a bigger change.
|
|
38
|
+
|
|
39
|
+
9. **Group shared causes.** Findings with one root cause get one `group`, with the cause stated once. Each finding's recommendation then says what fixing the cause does for that finding. Group members must cite at least one file in common.
|
|
40
|
+
|
|
41
|
+
10. **Propose directions for the flow.** Now step back from single findings. Ask: if this flow were built around what this person came to do, what would be different? Propose 0 to 3 **directions**: structural changes, described as behaviour. Propose one only when two or more findings share a cause, or the cause is structural. Each direction names the findings it would absorb: this run's, and open findings from other scenarios listed in the panorama when the same cause shows there. Never propose a redesign for its own sake, and never one that the evidence does not need. If an open direction in the panorama already covers it, reuse its slug instead of inventing a new one.
|
|
42
|
+
|
|
43
|
+
11. **Reason about reach.** For each direction, go through the project's other personas and scenarios in the panorama and ask:
|
|
44
|
+
- who else likely benefits, and why (`effect: "helps"`);
|
|
45
|
+
- who could be hurt: someone who relies on what you would move, hide or change (`effect: "risk"`);
|
|
46
|
+
- which scenarios must be re-run to check it actually helped (`verify`, including this one).
|
|
47
|
+
These are predictions, not observations. Give a reason for each. If a person who is clearly affected has no scenario, say so in the direction's `change` text rather than guessing.
|
|
48
|
+
|
|
49
|
+
12. **Look at what nobody walked.** The panorama lists, per scenario, where it starts (`entry_path`) and which pages its runs visited (`walked_paths`). Compare that with the routes in the code. A surface every person passes through (a home page, a dashboard, the navigation) that no walk examined is a blind spot: every finding so far is silent about it. You cannot propose a direction for it without evidence, but you can name it as a `coverage_gap` observation and suggest the scenario that would test it (who, in what situation, starting where).
|
|
50
|
+
|
|
51
|
+
13. **Question a feature's premise when it carries real risk.** Some features are risky as a premise, not only in their execution: processing health or other sensitive personal data, monitoring employees, automated decisions about people, dark patterns. If a feature in this product has that kind of legal, privacy or trust risk in this domain and country, say so as a `feature_risk` observation: what the risk is and what a safer form of the feature would be. Do not drop the feature from your advice on your own.
|
|
52
|
+
|
|
53
|
+
14. **Decline rather than guess.** If a finding is not actionable from what you know, leave it out.
|
|
54
|
+
|
|
55
|
+
## Writing
|
|
56
|
+
|
|
57
|
+
- Recommendations, quick fixes and direction texts are prose for a product person and a developer reading together. Plain, specific, in the product's own words.
|
|
58
|
+
- **No file paths or code symbols in the prose.** They go in `builds_on` only. The prose is shown to a later walker who must stay outside the code.
|
|
59
|
+
- A recommendation says what the person would see and why it meets their need, then how it fits this product.
|
|
60
|
+
|
|
61
|
+
## Answer
|
|
62
|
+
|
|
63
|
+
Reply with one JSON object and nothing else.
|
|
64
|
+
|
|
65
|
+
For a run:
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"groups": [{ "id": "g1", "root_cause": "…" }],
|
|
70
|
+
"advice": [
|
|
71
|
+
{
|
|
72
|
+
"finding_id": "<ref from the bundle, e.g. F3>",
|
|
73
|
+
"scope": "local | systemic",
|
|
74
|
+
"recommendation": "…",
|
|
75
|
+
"quick_fix": "… or null",
|
|
76
|
+
"builds_on": [{ "path": "relative/path/from/project/root", "symbol": "text that occurs in that file" }],
|
|
77
|
+
"group": "g1 or null",
|
|
78
|
+
"direction": "<direction slug> or null",
|
|
79
|
+
"heuristic": "the UX principle at stake (e.g. recognition_over_recall) or null"
|
|
80
|
+
}
|
|
81
|
+
],
|
|
82
|
+
"directions": [
|
|
83
|
+
{
|
|
84
|
+
"slug": "kebab-case-name",
|
|
85
|
+
"title": "Short imperative title",
|
|
86
|
+
"problem": "The shared cause, in product terms",
|
|
87
|
+
"change": "What the person would experience instead",
|
|
88
|
+
"leading_practice": "How leading systems in this domain handle it, scaled to this product",
|
|
89
|
+
"size": "small | medium | large",
|
|
90
|
+
"absorbs": ["<ref, e.g. F3>", "<ref, e.g. F12>"],
|
|
91
|
+
"reach": [{ "scenario": "<scenario slug>", "effect": "helps | risk", "reason": "…" }],
|
|
92
|
+
"verify": ["<scenario slug>"],
|
|
93
|
+
"builds_on": [{ "path": "…", "symbol": "…" }]
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
"observations": [
|
|
97
|
+
{
|
|
98
|
+
"kind": "coverage_gap | feature_risk",
|
|
99
|
+
"title": "Short title",
|
|
100
|
+
"detail": "What is missing or risky, and why it matters here",
|
|
101
|
+
"suggested_scenario": "Who, in what situation, starting where (coverage gaps) or null"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
`observations` are at most five, never absorb findings and are never treated as evidence.
|
|
108
|
+
|
|
109
|
+
For a project synthesis (the bundle says `"mode": "project"`), answer with `directions` and `observations` only: `{ "directions": [ … ], "observations": [ … ] }`. Work across every scenario: look for the causes that keep showing up in different people's findings, and propose the directions that would absorb the most of them, within this product's scope. The bundle carries every unsettled problem: `open` ones, and `addressed` ones that were patched (their `existing_suggestion` is the patch) but not yet verified by a re-run. Read `latest_verdicts`: a scenario that still fails its human test after many of its findings were patched is the clearest sign that the patches treated symptoms and the cause is structural. Say so in the direction's `problem` when it applies.
|
|
110
|
+
|
|
111
|
+
Every `finding_id` and `absorbs` entry must be a finding `ref` from the bundle (`F1`, `F2`, …), copied exactly. Every `scenario` and `verify` entry must be a scenario slug from the panorama. Every `builds_on` path must exist and contain its symbol. Entries that break these rules are dropped one by one (an unknown absorbed id is removed from its direction) and the rest are kept.
|
|
@@ -174,15 +174,17 @@ The CLI automatically handles sequential numbering, timestamps, screenshot captu
|
|
|
174
174
|
**Findings:** Always scaffold with the CLI — never create finding files by hand or call host Edit/Write tools:
|
|
175
175
|
|
|
176
176
|
```bash
|
|
177
|
-
iamu new-finding --scenario <slug> --run <run-id> --title "Short title" --type hinders --severity major --ui-fact "What the UI showed" --consequence "Impact on persona" --task-impact impairs --confidence high --
|
|
177
|
+
iamu new-finding --scenario <slug> --run <run-id> --title "Short title" --type hinders --severity major --ui-fact "What the UI showed" --consequence "Impact on persona" --task-impact impairs --confidence high --need "What I needed at that moment" --description "What happened and why it mattered" --json
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
- `--type`: `helps | hinders | missing | irrelevant | incorrect`
|
|
181
181
|
- `--severity`: `critical | major | minor | observation`
|
|
182
182
|
- `--task-impact`: `blocks | impairs | slows | neutral | accelerates | enables`
|
|
183
183
|
- `--confidence`: `high | medium | low`
|
|
184
|
-
- `--
|
|
185
|
-
- `--
|
|
184
|
+
- `--need`: for every finding that is not `helps`, what you needed at that moment, in your own terms as the persona ("I needed to know the code was wrong before I submitted")
|
|
185
|
+
- `--description`: markdown body describing what happened and why it mattered
|
|
186
|
+
|
|
187
|
+
**Record the need, never the fix.** You are outside the product: you cannot see its code or know what it would take to change. Write what you needed, not how the screen should change, and keep solutions out of the description too ("add inline validation" is a fix; "I needed to know before I pressed Send" is a need). A separate advisor reads the code after the walk and writes the fix from your need.
|
|
186
188
|
|
|
187
189
|
Leave `triage_status` alone; triage is not the walker's job.
|
|
188
190
|
|
|
@@ -61,7 +61,7 @@ Ask whether to pick one up. When the user picks a request:
|
|
|
61
61
|
|
|
62
62
|
### 2. List mode: present open findings grouped by scenario
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Run `iamu findings --open --json`. Each finding carries `slug`, `scenario`, `type`, `severity`, `title`, `where` (page and step), `recommendation` (the advisor's, or null) and `fix_state`. For how each scenario is doing, run `iamu report --json` and keep the newest row per `scenario`: its `summary.verdict` (label, question, answer) is the scenario's current outcome.
|
|
65
65
|
|
|
66
66
|
Filter to `triage_status: open`.
|
|
67
67
|
|
|
@@ -73,18 +73,22 @@ Filter to `triage_status: open`.
|
|
|
73
73
|
|
|
74
74
|
A run that simply did not come across a finding proves nothing — never call a fix verified because it was not seen. After the list, if any fixes await a re-run, say how many and in which scenarios (`iamu status --json` → `rerun`, with `requests.open` for team requests), and offer `iamu-run <scenario>` for the first one.
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
**Directions before findings.** Run `iamu directions --json`. Directions are structural changes the advisor proposed after a walk, each absorbing several findings (sometimes across scenarios), with the people it could hurt and the scenarios to re-run. If any are `proposed` or `accepted`, show them above the tally, one line each: `◆ <title> (<size>, <status>) · absorbs <N> findings in <S> scenarios · could hurt: <scenarios or "none predicted">`. Offer them first: taking a direction fixes its findings together, which beats patching them one by one. For each the user can **take it** (`iamu directions set <slug> --status accepted`, then implement it, or hand it to planning when it is `large`), take **only the local fixes** (leave it `proposed`, triage its findings below), **defer**, or **reject** (`--status rejected`; it is never proposed again). When a taken direction is implemented, mark it `done` and offer `iamu-run` for every scenario in its `verify` list. Reach is a prediction: say "likely" and "could", never "will".
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
Findings Tally: <N> Open (<C> Critical · <M> Major · <m> Minor) across <S> Scenarios
|
|
80
|
-
Awaiting verification: <K> addressed findings pending re-run
|
|
78
|
+
When open findings span three or more scenarios and there are no open directions, or the user asks what to change first, offer a project synthesis: `iamu advise --project --json`, dispatch a thorough-tier subagent with `iamu/.analysis/advise_prompt.md` as its only context, and record its answer with `iamu advise-record --project --data '<json>'`. It proposes directions across every scenario.
|
|
81
79
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
Render it as Markdown, not inside a code fence, so the tables render. Start with a one-line tally, then one block per scenario, scenarios with the worst verdict first:
|
|
81
|
+
|
|
82
|
+
**<N> open problems** (<C> critical · <M> major · <m> minor) across <S> scenarios · <K> fixes awaiting a re-run
|
|
83
|
+
|
|
84
|
+
### <persona> · <situation> — **<NO / PARTIAL / YES>**
|
|
85
|
+
<the scenario's latest `summary.verdict.answer`, first sentence or two>
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
| # | Finding | Severity | Where | What to do |
|
|
88
|
+
|---|---|---|---|---|
|
|
89
|
+
| 1 | <title> | **Critical** | <where> | <first sentence of recommendation, or — > |
|
|
90
|
+
|
|
91
|
+
Number findings continuously across scenarios, so "fix 3" means one finding. Sort each table worst first (critical → major → minor → observation; incorrect, hinders and missing before irrelevant). Leave strengths (`helps`) out of the tables. Keep the "What to do" cell to one sentence: the full recommendation belongs in the finding card (step 3).
|
|
88
92
|
|
|
89
93
|
Ask the user how they would like to triage:
|
|
90
94
|
|
|
@@ -112,6 +116,10 @@ Read the finding file at `iamu/findings/<slug>.md`. Parse the YAML frontmatter (
|
|
|
112
116
|
|
|
113
117
|
Synthesize a scannable triage summary. Do NOT output an undifferentiated wall of bullets or academic schema labels like "UI Fact:". The reviewer must be able to parse **What is broken** and **What to fix** in under 3 seconds.
|
|
114
118
|
|
|
119
|
+
**Advised findings are shown as they are.** When the frontmatter has `advised_by`, the recommendation was written after the walk by the advisor, from the code and the persona's need; a `**Part of:**` line names the direction it belongs to. Show it as is, and before applying it read `iamu/.runs/<run>/advice.json` and check that each `builds_on` file still exists and contains its symbol; if not, say the advice is stale before editing.
|
|
120
|
+
|
|
121
|
+
**Raise the recommendation before you show it** (only when there is no `advised_by`: older runs, findings pulled from the cloud, or runs whose advisor stage did not run). The walker wrote it without seeing the code, and it often patches the symptom. Ask what the products that handle this moment best would do for this persona — the established pattern and why it works, not a brand name. Then take a quick look at what this codebase can build that on: existing components, data already on the screen, the design system. Show the strongest fix that fits this project. When it is a bigger change than the walker's proposal, keep a small step that helps now as the quick fix. When the walker's proposal is already the right one, show it as is. Never recommend what the project cannot support without saying what it would take. Your reasoning stays out of the card — it is what "Discuss" is for.
|
|
122
|
+
|
|
115
123
|
Format the visible finding in chat:
|
|
116
124
|
|
|
117
125
|
```markdown
|
|
@@ -123,7 +131,8 @@ Format the visible finding in chat:
|
|
|
123
131
|
<What went wrong on screen and why it hinders the persona (synthesizing ui_fact and consequence in 1–2 clear, direct sentences)>
|
|
124
132
|
|
|
125
133
|
**💡 Recommendation:**
|
|
126
|
-
<
|
|
134
|
+
<The strongest fix that fits this project, grounded in the finding and the code>
|
|
135
|
+
<Only when the recommendation is a bigger change: *Quick fix:* <small step that helps now>>
|
|
127
136
|
```
|
|
128
137
|
*(For `type: "helps"` findings, omit `**❌ Problem:**` and `**💡 Recommendation:**`; render `**✓ Strength:** <Observation>`)*.
|
|
129
138
|
|
|
@@ -236,7 +245,7 @@ If `<N> > 0` findings were queued for fix:
|
|
|
236
245
|
Proceeding with code edits — say "done" to keep fixes open in iamu/findings/.
|
|
237
246
|
|
|
238
247
|
- **Executing the queued fixes:**
|
|
239
|
-
When Option 1 is chosen, apply code edits for each queued finding sequentially in the workspace. Verify the changes once (run test/typecheck suite). Update each finding with `iamu triage <slug> --status addressed --note "<summary of fix>"`.
|
|
248
|
+
When Option 1 is chosen, apply code edits for each queued finding sequentially in the workspace — the fix shown on its card or agreed in Discuss, not the walker's original text. Verify the changes once (run test/typecheck suite). Update each finding with `iamu triage <slug> --status addressed --note "<summary of fix>"`.
|
|
240
249
|
Run `iamu validate --all` to verify all entities before reporting done.
|
|
241
250
|
|
|
242
251
|
- **Closed-Loop Regression Verification (1-Click):**
|
|
@@ -329,10 +329,10 @@ Step files live at `iamu/.runs/<run-id>/steps/<NNN>.json`. The CLI manages monot
|
|
|
329
329
|
|
|
330
330
|
**Recording findings:**
|
|
331
331
|
|
|
332
|
-
Use the CLI to create findings with valid frontmatter, UUID, slug,
|
|
332
|
+
Use the CLI to create findings with valid frontmatter, UUID, slug, need and description in one atomic call (the walker records what the persona needed, never the fix; the advisor writes the fix in step C2):
|
|
333
333
|
|
|
334
334
|
```bash
|
|
335
|
-
iamu new-finding --scenario <slug> --run <run-id> --title "Short title" --type hinders --severity major --ui-fact "What the UI showed" --consequence "Impact on persona" --task-impact impairs --confidence high --
|
|
335
|
+
iamu new-finding --scenario <slug> --run <run-id> --title "Short title" --type hinders --severity major --ui-fact "What the UI showed" --consequence "Impact on persona" --task-impact impairs --confidence high --need "What I needed at that moment" --description "What happened and why it mattered" --json
|
|
336
336
|
```
|
|
337
337
|
|
|
338
338
|
This generates a valid UUID, derives the slug from the title, and writes the complete finding file to `iamu/findings/<slug>.md`. Returns `{ "slug": "...", "path": "...", "id": "..." }`. Never invoke host Edit or Write tools.
|
|
@@ -397,7 +397,23 @@ iamu evaluate-record <run-id> --data '<raw_verdicts_json>' --no-prompt --no-push
|
|
|
397
397
|
|
|
398
398
|
This links findings to human tests (`human_test_id`) and updates the report with judge verdicts.
|
|
399
399
|
|
|
400
|
-
**
|
|
400
|
+
**C2. Advise: fixes and directions.** Get the advisor prompt:
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
iamu advise <run-id> --json
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
If `needed` is `false` (blocked run, nothing open to advise, or already advised), skip to D. Otherwise read the prompt from `iamu/.runs/<run-id>/advise_prompt.md` and dispatch an advisor subagent with it as its only context (use the **thorough** model tier). Unlike the walker, the advisor reads the project's code (read-only) and the screenshots: it classifies each finding local or systemic, writes the fix from the persona's need, looks at how leading systems in the domain handle the moment, and proposes directions for the flow with their predicted reach on other personas. Record its JSON answer via `--data`:
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
iamu advise-record <run-id> --data '<raw_advice_json>'
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
Each entry is checked on its own. Entries that come back rejected (an invented file or symbol, a path in the prose, a direction with too little evidence) stay unadvised and the rest is kept; a run is advised once, so do not record again. Mention rejected entries in step 5. Keep the result's `directions` and `rerun` for step 5.
|
|
413
|
+
|
|
414
|
+
The judge (C) and the advisor (C2) are independent, so their subagents may run in parallel, but run `evaluate-record` and `advise-record` one after the other: both rewrite finding files. On a host without subagents, run the advise prompt yourself inline and record it the same way.
|
|
415
|
+
|
|
416
|
+
**D. Read the completed canonical.** Read `iamu/.runs/<run-id>/canonical.json` for the final data including the verification delta (if a prior run exists) and `analysis.directions` (if the advisor ran). Use this for step 5 presentation.
|
|
401
417
|
|
|
402
418
|
**E. Publish (linked mode only).** Upload the completed run, screenshots, verdicts, and findings in one atomic sync:
|
|
403
419
|
|
|
@@ -415,7 +431,7 @@ It prints the URL only if the run is on the cloud; otherwise it exits 1 and says
|
|
|
415
431
|
|
|
416
432
|
In linked-no-credentials or local-only mode, skip E.
|
|
417
433
|
|
|
418
|
-
Only after A→E are complete, proceed to step 5.
|
|
434
|
+
Only after A→E (with C2) are complete, proceed to step 5.
|
|
419
435
|
|
|
420
436
|
### 4a. Walk methodology summary
|
|
421
437
|
|
|
@@ -427,42 +443,68 @@ The `walker_prompt` from `iamu instructions walk` is the source of truth and con
|
|
|
427
443
|
|
|
428
444
|
### 5. Present assessment — stay in the conversation
|
|
429
445
|
|
|
430
|
-
You MUST output the complete Executive Scorecard to the chat stream FIRST.
|
|
446
|
+
You MUST output the complete Executive Scorecard to the chat stream FIRST. Build it from `iamu report <scenario-slug> --json`: the first row is this run, and its `summary` holds everything below already assembled (verdict, per-test labels, the since-last-run outcome of each earlier finding, findings with titles, where and recommendations, directions, observations). Do not re-read `canonical.json` or `verdicts.json` yourself. Output rich Markdown, not inside a code fence, so tables render and links are clickable:
|
|
447
|
+
|
|
448
|
+
### <summary.persona> · <summary.situation>
|
|
449
|
+
<summary.steps> steps · [Open in Iamu Cloud](<summary.cloud>) *(local-only: `[report.md](iamu/.runs/<run-id>/report.md)`)*
|
|
431
450
|
|
|
432
|
-
|
|
433
|
-
|
|
451
|
+
> **<summary.verdict.question>** **<summary.verdict.label>**
|
|
452
|
+
> <summary.verdict.answer>
|
|
434
453
|
|
|
435
|
-
|
|
436
|
-
> **Question:** "<human_tests[0].question>"
|
|
437
|
-
> **Verdict:** **<NO / PARTIAL / YES>** — <1-2 sentences evaluator reasoning from verdicts.json / report.md>
|
|
454
|
+
If `summary.tests` has more than one test, add one line per test: `**<label>** · <question>`.
|
|
438
455
|
|
|
439
|
-
|
|
440
|
-
*(If local-only, render instead: `> **Artifact:** [iamu/.runs/<run-id>/report.md](iamu/.runs/<run-id>/report.md) (Local only)`)*
|
|
456
|
+
If `summary.since` is set, show what happened to every earlier finding this run re-checked (`summary.since.items`), then one line for the new ones:
|
|
441
457
|
|
|
442
|
-
|
|
443
|
-
1. **[CRITICAL]** · *<type>* · <Short title> (Step <N> at `<short_url_path>`)
|
|
444
|
-
2. **[MAJOR]** · *<type>* · <Short title> (Step <N> at `<short_url_path>`)
|
|
445
|
-
...
|
|
446
|
-
(Helps: • [helps] <short title> (Step <N>))
|
|
458
|
+
**Since the last run** (<date of summary.since.baselineAt>)
|
|
447
459
|
|
|
448
|
-
|
|
460
|
+
| Earlier finding | Now |
|
|
461
|
+
|---|---|
|
|
462
|
+
| <title> | ✓ Resolved / ✗ Persists / ○ Not seen / ? Unclear |
|
|
449
463
|
|
|
450
|
-
|
|
464
|
+
`+ <summary.since.added> new problems this run.` "Not seen" means the walk did not pass that way: never call it fixed.
|
|
465
|
+
|
|
466
|
+
**Findings** (<N> problems, <K> strengths), worst first:
|
|
467
|
+
|
|
468
|
+
| # | Finding | Severity | Where | What to do |
|
|
469
|
+
|---|---|---|---|---|
|
|
470
|
+
| 1 | <title> | **Major** | <where> | <first sentence or two of recommendation, or — > |
|
|
471
|
+
|
|
472
|
+
Mark a finding that persists from the last run with `(persists)` after its title. Strengths go on one line under the table: `✓ Strengths: <title>; <title>`.
|
|
473
|
+
|
|
474
|
+
If `summary.directions` is non-empty:
|
|
475
|
+
|
|
476
|
+
**Directions** (structural changes the advisor proposes)
|
|
477
|
+
|
|
478
|
+
| Direction | Size | Absorbs | Re-run to check |
|
|
479
|
+
|---|---|---|---|
|
|
480
|
+
| <title> | <size> | <absorbs> findings | <verify> scenarios |
|
|
481
|
+
|
|
482
|
+
Reach is a prediction until those scenarios run again.
|
|
483
|
+
|
|
484
|
+
If `summary.observations` is non-empty, end with **Also worth knowing**: one bullet each, `Not walked: <title>` (coverage_gap) or `Risk: <title>` (feature_risk).
|
|
485
|
+
|
|
486
|
+
Do NOT output `### What Worked` paragraphs or lengthy bullet essays. Keep the scorecard scannable: the tables are the summary.
|
|
451
487
|
|
|
452
488
|
**Zero-Friction Triage Transition (Eliminate Meta-Prompt Gate):**
|
|
453
489
|
Do NOT prompt the user with a generic "How would you like to proceed?" multiple-choice modal. That intermediate prompt adds cognitive friction, duplicates the triage options, and obscures the assessment scorecard.
|
|
454
490
|
|
|
455
|
-
- **If
|
|
456
|
-
Output: "
|
|
491
|
+
- **If `summary.findings` is empty (no problems):**
|
|
492
|
+
Output: "No problems found in this run." The verdict above still stands on its own: a run without findings can still answer NO.
|
|
457
493
|
Do not enter triage.
|
|
458
494
|
|
|
459
|
-
- **If
|
|
495
|
+
- **If `summary.findings` is not empty:**
|
|
460
496
|
Output the Executive Scorecard above to chat FIRST, and advance IMMEDIATELY to triage on **Finding #1 of <total>** (Step 6 below) in the same turn. The user can choose to queue to fix, queue all remaining fixes (batch accept), dismiss, or discuss directly from Finding #1.
|
|
461
497
|
|
|
462
498
|
### 6. Conversational Triage & Guided Review
|
|
463
499
|
|
|
464
500
|
The conversation is the triage surface. Do NOT eject the user to manual CLI commands or dump them at file paths.
|
|
465
501
|
|
|
502
|
+
**Directions come first.** When the advisor proposed directions, offer them before going finding by finding, one at a time: what changes for the person, which findings it absorbs (in this and other scenarios), who it could hurt, and the size. The user chooses:
|
|
503
|
+
- **Take it**: `iamu directions set <slug> --status accepted`, then implement it (or hand it to planning when it is large). The findings it absorbs are fixed by the direction, not patched one by one.
|
|
504
|
+
- **Only the local fixes**: leave the direction `proposed` and triage its findings normally below.
|
|
505
|
+
- **Defer** (leave `proposed`) or **reject** (`iamu directions set <slug> --status rejected`; it will not be proposed again).
|
|
506
|
+
After a taken direction lands, mark it `done` and re-run the scenarios in its `verify` list, not only this one.
|
|
507
|
+
|
|
466
508
|
#### A. Guided One-by-One Review ("walk through them" / "review one by one")
|
|
467
509
|
When the user asks to review findings one by one:
|
|
468
510
|
1. **Present Finding #N in a scannable format (High Visual Hierarchy):**
|
|
@@ -608,4 +650,4 @@ Run `iamu validate --all` to verify all entities before reporting done. If older
|
|
|
608
650
|
- **Validate before done.** Always run `iamu validate --all` after a walkthrough to catch any issues.
|
|
609
651
|
- **Use CLI for scaffolding.** `iamu start-run` for runs, `iamu new-finding` for findings, `iamu complete` for assembly. Never manually create run directories or generate UUIDs.
|
|
610
652
|
- **Step files:** Record steps via the CLI (`iamu browse step` or `iamu step`), which manages step numbering, screenshots, and atomic writes to `steps/001.json`.
|
|
611
|
-
- **Finding bodies:**
|
|
653
|
+
- **Finding bodies:** `iamu new-finding` writes the description; the recommendation is written by `iamu advise-record` (step C2), never by the walker.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export interface HtmlReportHighlight {
|
|
2
|
+
targetBox: {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
viewportWidth?: number;
|
|
8
|
+
viewportHeight?: number;
|
|
9
|
+
viewport_width?: number;
|
|
10
|
+
viewport_height?: number;
|
|
11
|
+
};
|
|
12
|
+
label?: string;
|
|
13
|
+
severity?: string | null;
|
|
14
|
+
type?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface HtmlReportStep {
|
|
17
|
+
stepNumber: number;
|
|
18
|
+
action: string;
|
|
19
|
+
screenTitle?: string | null;
|
|
20
|
+
personaReasoning?: string | null;
|
|
21
|
+
url?: string | null;
|
|
22
|
+
screenshotUrl?: string | null;
|
|
23
|
+
targetBox?: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
viewportWidth?: number;
|
|
29
|
+
viewportHeight?: number;
|
|
30
|
+
viewport_width?: number;
|
|
31
|
+
viewport_height?: number;
|
|
32
|
+
} | null;
|
|
33
|
+
highlights?: HtmlReportHighlight[];
|
|
34
|
+
}
|
|
35
|
+
export interface HtmlReportFinding {
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
type: string;
|
|
39
|
+
severity?: string | null;
|
|
40
|
+
uiFact?: string | null;
|
|
41
|
+
consequence?: string | null;
|
|
42
|
+
recommendation?: string | null;
|
|
43
|
+
}
|
|
44
|
+
export interface HtmlReportVerdict {
|
|
45
|
+
question: string;
|
|
46
|
+
rating: string;
|
|
47
|
+
reasoning?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface HtmlReportVerification {
|
|
50
|
+
resolved: unknown[];
|
|
51
|
+
persists: unknown[];
|
|
52
|
+
newFindings: unknown[];
|
|
53
|
+
}
|
|
54
|
+
export interface HtmlReportData {
|
|
55
|
+
scenarioName: string;
|
|
56
|
+
scenarioNarrative?: string | null;
|
|
57
|
+
persona?: {
|
|
58
|
+
name: string;
|
|
59
|
+
role?: string | null;
|
|
60
|
+
context?: string | null;
|
|
61
|
+
} | null;
|
|
62
|
+
walkthroughId: string;
|
|
63
|
+
runNumber?: number | string | null;
|
|
64
|
+
startedAt?: string | null | Date;
|
|
65
|
+
completedAt?: string | null | Date;
|
|
66
|
+
targetUrl?: string | null;
|
|
67
|
+
steps: HtmlReportStep[];
|
|
68
|
+
findings: HtmlReportFinding[];
|
|
69
|
+
verdicts?: HtmlReportVerdict[];
|
|
70
|
+
verification?: HtmlReportVerification | null;
|
|
71
|
+
whatWorked?: string[];
|
|
72
|
+
openQuestions?: string[];
|
|
73
|
+
}
|
|
74
|
+
export declare function generateHtmlReport(data: HtmlReportData): string;
|
|
75
|
+
/**
|
|
76
|
+
* Builds HtmlReportData by reading a completed run directory and resolving
|
|
77
|
+
* persona/scenario files and local screenshots into base64 data URIs.
|
|
78
|
+
*/
|
|
79
|
+
export declare function buildReportDataFromRun(projectRoot: string, runId: string): Promise<HtmlReportData>;
|
|
80
|
+
/**
|
|
81
|
+
* Creates and writes a self-contained local HTML report for a walkthrough run.
|
|
82
|
+
* Defaults to writing to `iamu/.runs/<runId>/report.html`.
|
|
83
|
+
*/
|
|
84
|
+
export declare function createLocalHtmlReport(projectRoot: string, runId: string, destination?: string): Promise<{
|
|
85
|
+
filePath: string;
|
|
86
|
+
html: string;
|
|
87
|
+
}>;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export type VerdictLabel = "YES" | "PARTIAL" | "NO" | "PENDING" | "BLOCKED";
|
|
2
|
+
export interface RunFindingRow {
|
|
3
|
+
id: string;
|
|
4
|
+
/** Finding file slug, for `iamu triage <slug>`; null when the file is gone. */
|
|
5
|
+
slug: string | null;
|
|
6
|
+
severity: string | null;
|
|
7
|
+
type: string;
|
|
8
|
+
title: string;
|
|
9
|
+
where: string | null;
|
|
10
|
+
/** The advisor's recommendation, when the run was advised. */
|
|
11
|
+
recommendation: string | null;
|
|
12
|
+
persists: boolean;
|
|
13
|
+
isNew: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type SinceOutcome = "resolved" | "persists" | "not_seen" | "uncertain";
|
|
16
|
+
export interface RunView {
|
|
17
|
+
persona: string;
|
|
18
|
+
situation: string;
|
|
19
|
+
completedAt: string | null;
|
|
20
|
+
steps: number;
|
|
21
|
+
targetUrl: string | null;
|
|
22
|
+
/** Cloud link, or a note that the run is not synced; null when not linked. */
|
|
23
|
+
cloud: string | null;
|
|
24
|
+
verdict: {
|
|
25
|
+
label: VerdictLabel;
|
|
26
|
+
question: string | null;
|
|
27
|
+
answer: string | null;
|
|
28
|
+
};
|
|
29
|
+
tests: Array<{
|
|
30
|
+
question: string;
|
|
31
|
+
label: VerdictLabel;
|
|
32
|
+
}>;
|
|
33
|
+
since: {
|
|
34
|
+
baselineAt: string | null;
|
|
35
|
+
resolved: number;
|
|
36
|
+
persists: number;
|
|
37
|
+
added: number;
|
|
38
|
+
notSeen: number;
|
|
39
|
+
/** Each earlier finding this run re-checked, by title. */
|
|
40
|
+
items: Array<{
|
|
41
|
+
title: string;
|
|
42
|
+
outcome: SinceOutcome;
|
|
43
|
+
}>;
|
|
44
|
+
} | null;
|
|
45
|
+
findings: RunFindingRow[];
|
|
46
|
+
strengths: string[];
|
|
47
|
+
directions: Array<{
|
|
48
|
+
title: string;
|
|
49
|
+
size: string;
|
|
50
|
+
absorbs: number;
|
|
51
|
+
verify: number;
|
|
52
|
+
}>;
|
|
53
|
+
observations: Array<{
|
|
54
|
+
kind: string;
|
|
55
|
+
title: string;
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
58
|
+
export interface OverviewRun {
|
|
59
|
+
completedAt: string | null;
|
|
60
|
+
label: VerdictLabel;
|
|
61
|
+
problems: number;
|
|
62
|
+
resolved: number;
|
|
63
|
+
persists: number;
|
|
64
|
+
added: number;
|
|
65
|
+
}
|
|
66
|
+
export interface OverviewScenario {
|
|
67
|
+
persona: string;
|
|
68
|
+
situation: string;
|
|
69
|
+
slug: string;
|
|
70
|
+
runs: OverviewRun[];
|
|
71
|
+
latestAnswer: string | null;
|
|
72
|
+
}
|
|
73
|
+
export interface OverviewView {
|
|
74
|
+
project: string;
|
|
75
|
+
scenarios: OverviewScenario[];
|
|
76
|
+
openProblems: number;
|
|
77
|
+
directions: Array<{
|
|
78
|
+
title: string;
|
|
79
|
+
status: string;
|
|
80
|
+
size: string;
|
|
81
|
+
absorbs: number;
|
|
82
|
+
}>;
|
|
83
|
+
}
|
|
84
|
+
export declare function verdictColor(label: VerdictLabel): (s: string) => string;
|
|
85
|
+
/** "9 Oct 07:54" in local time; the raw value when it does not parse. */
|
|
86
|
+
export declare function shortDate(iso: string | null): string;
|
|
87
|
+
/** Word-wrap plain text to `width`, each line prefixed with `indent`. */
|
|
88
|
+
export declare function wrap(text: string, width: number, indent: string): string[];
|
|
89
|
+
export declare function firstSentence(text: string): string;
|
|
90
|
+
/** Opening sentences of a text, enough to say something (≥ 60 chars). */
|
|
91
|
+
export declare function lead(text: string): string;
|
|
92
|
+
/** The latest run of one scenario, outcome first. */
|
|
93
|
+
export declare function renderRunView(v: RunView, width?: number): string[];
|
|
94
|
+
/** Every scenario and how its runs went, newest scenario first. */
|
|
95
|
+
export declare function renderOverview(v: OverviewView, width?: number): string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@iamu-dev/iamu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Test your product as realistic personas — scenario-driven development CLI",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"tsup": "^8.5.1",
|
|
59
59
|
"typescript": "^5.8.0",
|
|
60
60
|
"vitest": "^4.1.11",
|
|
61
|
+
"@iamu-dev/local-store": "0.1.0",
|
|
61
62
|
"@iamu-dev/protocol": "0.1.0",
|
|
62
|
-
"@iamu/tsconfig": "0.1.0"
|
|
63
|
-
"@iamu-dev/local-store": "0.1.0"
|
|
63
|
+
"@iamu/tsconfig": "0.1.0"
|
|
64
64
|
},
|
|
65
65
|
"scripts": {
|
|
66
66
|
"build": "tsup && tsc -b --force tsconfig.build.json --emitDeclarationOnly && node scripts/copy-assets.mjs",
|