diff --git a/.agents/skills/kane-cli/SKILL.md b/.agents/skills/kane-cli/SKILL.md index c0d72be..4009520 100644 --- a/.agents/skills/kane-cli/SKILL.md +++ b/.agents/skills/kane-cli/SKILL.md @@ -1,6 +1,6 @@ --- name: kane-cli -description: "End-to-end (E2E) tests, regression checks, and smoke tests with KaneCLI. Use after changing a web or mobile app to verify the feature works and test the flow, or for any task needing a real browser or mobile app: navigation, clicks, forms, UI checks, screenshots, deploy verification. Generate E2E tests from a PRD, spec, or description via the assurance commands (use-cases, acceptance criteria, scenarios, runnable _test.md tests); never hand-write Kane test cases. Run on desktop web (Chrome by default), Android and iOS: emulator/simulator locally on macOS Apple Silicon or via testrun run --remote, and real cloud devices (--target android|ios). Prove coverage with evidence packs and kane-cli cover; gate CI by judging a pack against a policy (kane-cli evidence verdict, --policy). Work in a shared Test Manager project (link a folder with --project). Parse NDJSON output and inspect logs. Share the assurance store (.context/) via GitHub, S3, or a folder with kane-cli context sync." +description: "End-to-end (E2E) tests, regression checks, and smoke tests with KaneCLI. Use after changing a web or mobile app to verify the feature works and test the flow, or for any task needing a real browser or mobile app: navigation, clicks, forms, UI checks, screenshots, deploy verification. Generate E2E tests from a PRD, spec, or description via the assurance commands (use-cases, acceptance criteria, scenarios, runnable _test.md tests); never hand-write Kane test cases. Run on desktop web (Chrome by default), Android and iOS: emulator/simulator locally on macOS Apple Silicon or via testrun run --remote, and real cloud devices (--target android|ios). Prove coverage with evidence packs and kane-cli cover; gate CI by judging a pack against a policy (kane-cli evidence verdict, --policy). Work in a shared Test Manager project (link a folder with --project). Parse NDJSON output, inspect logs, and mark known bugs (kane-cli bugs). Share the assurance store (.context/) via GitHub, S3, or a folder with kane-cli context sync." --- # Kane CLI β€” End-to-End Test Generation and Execution Skill @@ -148,7 +148,7 @@ For exit code 1 (or `status: "failed"` in `run_end`), present the failure card. | ➑️ **Next** | Β· | ``` -The failing step's screenshot lives inside the run's evidence pack (the stderr hint names the pack path): extract it with `unzip "tests/*/steps/*/screenshot.png" -d `, Read it, and show it **under** the card. For the pack layout and deeper diagnosis, see `references/debug.md`. +The failing step's screenshot lives inside the run's evidence pack (the stderr hint names the pack path): extract it with `unzip "tests/*/steps/*/screenshot.png" -d `, Read it, and show it **under** the card. For the pack layout and deeper diagnosis, see `references/debug.md`. A saved test that failed may have hit a bug kane-cli already knows: `kane-cli bugs list _test.md --agent` names it, and your marks and notes shape the next diagnosis (`references/bugs.md`). Exit code 2 with no progress events means nothing ran: that is a `🟑 Didn't start` card, not a failure (`references/cards.md` Β§4). If progress events came before it, steps ran and the run stopped without a result: say so, and use the stopped-early card (`references/cards.md` Β§5). @@ -190,6 +190,7 @@ When the user's request involves a browser β€” or writing test cases: - View, share, or validate run evidence (`.evidence` packs) β†’ Read `references/evidence.md` - Judge a run or pack against quality gates (a policy YAML, `--policy`, `--policy-id`, `kane-cli evidence verdict`, `kane-cli policy …`), or gate CI on more than pass/fail β†’ Read `references/policy.md` first (after 0.10.0-rc.3) - Debug a failed run β†’ Read `references/debug.md` +- A saved test failed and you want the bugs it hit before, the person asks about known bugs (`BUG-12`), a failure's diagnosis (RCA) is wrong and needs correcting, or the person wants to see or manage the organisation's RCA categories β†’ Read `references/bugs.md` (`kane-cli bugs`, the release that ships it) - Configure kane-cli or check directory layout β†’ Read `references/setup-and-config.md` - The person asks to make kane-cli the default for this project or their team ("always use kane for E2E here", "add kane to CLAUDE.md / AGENTS.md") β†’ Read `references/setup-and-config.md` Β§Make kane-cli the default in a project. Only when asked, and ask before writing - Browse / create / pick a Test Manager project or folder for `kane-cli run`, or interpret the auto-default event β†’ Read `references/test-manager.md`. Linking an assurance folder to a project is different: `references/shared-projects.md` Β§2–3 @@ -383,6 +384,7 @@ A draft in chat cannot be run, and a hand-written `_test.md` carries no requirem | Need the assurance NDJSON event schema (`--mode agent`) | `references/assurance-parsing.md` | | Share the context store with a team, join one, keep stores level, or resolve a sync conflict (kane-cli 0.8.14+) | `references/context-sync.md` | | Run failed, need to diagnose | `references/debug.md` | +| Known bugs a test hit, or correcting a failure's diagnosis (`kane-cli bugs list\|show\|mark\|note\|duplicate\|retire\|categories`) | `references/bugs.md` | | View, share, validate, or merge evidence packs | `references/evidence.md` | | Judge a pack against a policy, run with `--policy`, or store/list policies in Test Manager | `references/policy.md` | | Multiple independent browser tasks | `references/parallel.md` | diff --git a/.agents/skills/kane-cli/references/bugs.md b/.agents/skills/kane-cli/references/bugs.md new file mode 100644 index 0000000..f620d69 --- /dev/null +++ b/.agents/skills/kane-cli/references/bugs.md @@ -0,0 +1,118 @@ + + +# Bugs β€” Agent Surface + +**Version.** Needs the kane-cli release that ships `kane-cli bugs`. If `bugs` is an unknown command, the installed build predates it: say so and go on without it. + +When a saved test fails, kane-cli's failure diagnosis (the RCA) works out why, and the diagnosis is uploaded with the run's evidence. kane-cli remembers each distinct **application bug** it finds, folds repeat sightings of the same bug together, and gives each one a ref that is unique within the project: `BUG-12`. A bug has a card (title, root cause, page, error signature), a status, and the runs it was seen in. + +When a later run fails on the same page, its diagnosis is told about the known bugs there: their status, their votes, and the latest note. It links the run to one of them only when this run's own evidence shows the same defect. **Feedback is how that memory gets sharper**: say what is real, say when a recorded root cause is wrong, and leave a note with what you learned. The next diagnosis reads it. + +## 1. Commands + +| Command | What it does | +|---|---| +| `kane-cli bugs list _test.md --agent` | The bugs this test has hit (its Test Manager test case) | +| `kane-cli bugs list --testcase --agent` | The bugs a Test Manager test case has hit, without a local file | +| `kane-cli bugs list [--status ] [--all-families] [--limit ] --agent` | No test and no `--testcase`: the project's bugs | +| `kane-cli bugs show BUG-12 --agent` | The card, status, votes, the runs it was seen in, and every live piece of feedback with its id | +| `kane-cli bugs mark BUG-12 real` \| `not-real` `--agent` | Is this a real product bug? (a vote) | +| `kane-cli bugs mark BUG-12 rca-right` \| `rca-wrong` `--agent` | Is the recorded root cause right? (a vote) | +| `kane-cli bugs mark BUG-12 done` \| `not-a-bug` \| `reopen` `--agent` | A ruling: fixed, a false alarm, or back to open | +| `kane-cli bugs note BUG-12 "" --agent` | Free text; the next diagnosis reads the latest note | +| `kane-cli bugs duplicate BUG-12 --of BUG-9 --agent` | BUG-12 is the same bug as BUG-9: merges 12 into 9. No confirmation | +| `kane-cli bugs retire --agent` | Take back a vote or note you gave (the id is in the `mark`/`note` output and in `show`) | +| `kane-cli bugs list --category "" --agent` | Only bugs given this RCA category (built-in or the organisation's); spans every family | +| `kane-cli bugs categories list [--source builtin\|org] [--status active\|inactive] --agent` | Every RCA category: the organisation's first, then the built-in ones; `agent_uses` says which the diagnosis picks from | +| `kane-cli bugs categories show "" --agent` | One category | +| `kane-cli bugs categories add --name "" --description "" [--inactive] --agent` | Add one of the organisation's | +| `kane-cli bugs categories edit "" [--name] [--description] [--status active\|inactive] --agent` | Change one of the organisation's | +| `kane-cli bugs categories remove "" --agent` | Remove one of the organisation's (no question under `--agent`; on a terminal it asks unless `--yes`) | + +- **Refs.** `BUG-12`, `bug-12` and `12` all mean BUG-12. +- **`--status`** takes a comma-separated list of `open`, `confirmed`, `done`, `regressed`, `not_a_bug`, `contested`, `merged` (`not-a-bug` also works). **`--limit`** is 1-200, default 50. **`--all-families`** lists every kind of failure the diagnosis recorded, not only application bugs. +- **Every subcommand** takes `--project `, `--profile `, `--env `, `--username `, `--access-key ` and `--agent`. + +**Which project.** `--project`, else the test.md's own project, else the folder's linked project, else the profile's (`kane-cli config project `). With none: `NO_PROJECT`. + +**RCA categories.** Every failure gets one category. The diagnosis prefers one of the organisation's own (Org Preferences β†’ Automatic AI RCA) whose description fits, else the closest built-in one; the family (product, test or environment fault) is still decided separately. Name a category by its name (any case) or id. Built-in ones are read-only. An organisation category's id is `custom:`: a failure records it as `/custom:` with its name beside it, and a failed step's reason names it. Changing the organisation's list applies to everyone's next runs, and adding, editing or removing needs org admin or the Product Preferences permission: do it only when the person asks. A category never decides which bug a failure joins, and **a bug keeps the category of the run that first found it**: one recorded before a category existed never takes it on, so `--category` doesn't list it. That is expected, not a fault. + +**Which test.** `bugs list _test.md` needs the test to have a Test Manager test case, which it gets the first time it runs with an upload. A test that never uploaded refuses with `NO_TESTCASE`: run it once, or pass `--testcase `. + +## 2. Who the feedback counts as + +- Feedback is the signed-in user's, and it moves the bug's status for the whole project. +- **With `--agent`** it is recorded as the agent's, made under the signed-in user, and it counts the same as a person's. Always pass `--agent` for your own marks, so a person reading the bug can tell yours from theirs. Without `--agent` but with no terminal, the output is still one JSON line, yet the mark is recorded as the person's. +- **One vote per person.** A person and the agent working as them share one `real`/`not-real` vote and one `rca-right`/`rca-wrong` vote; the latest wins. Marking again changes the vote, it does not add one. +- Only the person who gave feedback (or the agent working as them) can retire it. Another person's feedback refuses with `NOT_FOUND`. + +**How the status moves.** + +| Status | When | +|---|---| +| `open` | New, or the real-bug votes are not net positive. Shown as `open (disputed)` when more people say it is not real | +| `confirmed` | More `real` than `not-real` votes | +| `done` | Ruled fixed with `mark done` | +| `regressed` | Ruled `done`, then seen again in a later run | +| `not_a_bug` | Ruled a false alarm with `mark not-a-bug` | +| `contested` | Ruled `not_a_bug`, then hit again by several different tests | +| `merged` | Merged into another bug with `duplicate` | + +The latest ruling wins; `mark reopen` drops back to the votes. + +## 3. Output (one JSON line with `--agent`) + +``` +bugs list {"ok":true,"project_id":"","testcase_id":"","bugs":[{"ref":"BUG-12","status":"open","votes":1,"rca_votes":-1,"title":"…","root_cause":"…","page_pattern":"/cart","occurrences":3,"testcases":2,"last_seen_at":"…"}],"has_more":false} +bugs show {"ok":true,"bug":{"ref":"BUG-12","status":"open","card":{"title":"…","root_cause":"…","page_pattern":"/cart","error_signature":"…"},"occurrence_count":3,"testcase_count":2,"votes":1,"rca_votes":-1,…},"occurrences":[{"evidence_id":"…","seen_at":"…",…}],"feedback":[{"id":"","type":"vote_rca","value":"-1","author_kind":"agent","created_at":"…"},{"id":"","type":"note","text":"…","author_kind":"user",…}]} +bugs mark {"ok":true,"ref":"BUG-12","feedback_id":"","status":"confirmed"} +bugs note {"ok":true,"ref":"BUG-12","feedback_id":"","status":"open"} +bugs duplicate {"ok":true,"ref":"BUG-12","feedback_id":"","status":"merged","of":"BUG-9","merged":true,"merged_into":"BUG-9"} +bugs retire {"ok":true,"feedback_id":"","retired":true,"status":"open"} +refusal {"ok":false,"error":"NOT_FOUND","message":"BUG-99 is not a bug in project . This project's bugs: BUG-12, BUG-14"} +``` + +- `testcase_id` appears only when the list is for one test. `votes` and `rca_votes` are net counts and appear only when known; `disputed: true` appears only when set. +- A bug's feedback `type` is `vote_real` / `vote_rca` (value `1` or `-1`), `note`, `done`, `not_a_bug`, `reopen` or `duplicate_of`; `author_kind` is `user` or `agent`. +- `duplicate` with `"merged":false` was recorded as a suggestion only; the bugs were not merged. +- On a terminal the same commands print a table (`REF STATUS VOTES TITLE OCCURRENCES`) or plain lines. + +**Exit codes.** `0` done Β· `1` any refusal. + +## 4. Errors and how to recover + +| `error` | Meaning β†’ what to do | +|---|---| +| `NOT_FOUND` | An unknown ref: pick one from the refs the message lists. On `retire`: the id is wrong, or the feedback is not yours | +| `NO_TESTCASE` | The test.md has no Test Manager test case yet: run it once with an upload, or pass `--testcase ` | +| `NO_PROJECT` | Pass `--project `, run in a linked folder, or bind one with `kane-cli config project ` | +| `NOT_ENABLED` | `the bug store is not enabled on this controller`: bug memory is not available in this environment yet. Tell the person in one line and go on without it | +| `UNAUTHORIZED` | Sign-in: the person runs `kane-cli login` (never ask for keys in chat) | +| `NETWORK` | No answer: check the connection or `--env`, then retry | +| `NOT_READY` | Retry in a minute | +| `CYCLE` | The merge would loop (BUG-9 is already merged into BUG-12) | +| `INVALID` | A bad argument (an unknown mark, an empty note, `--limit` out of range, a bug as a duplicate of itself, a test.md that does not exist): fix the call as the message says | +| `CONFLICT` | Someone changed the bug at the same moment: retry | +| `BUILTIN_READ_ONLY` | A built-in category can't be edited or removed: add the organisation's own instead | +| `FORBIDDEN` | The person can't change categories: an org admin, or a role with the Product Preferences permission, must | +| `DUPLICATE_NAME` | Another category has that name: pick another, or edit that one | +| `AMBIGUOUS` | The name matches more than one category: use one of the ids the message lists | +| `NOT_SUPPORTED` | This controller has no category routes yet: tell the person in one line and go on | + +## 5. In an RCA flow + +After a saved test fails (`testmd run`, or a member of `testrun run`): + +1. Read the failure as usual (`references/debug.md`), including the diagnosis in the evidence pack. +2. `kane-cli bugs list _test.md --agent`: what this test has hit before. A known bug that matches this failure is context, not a new finding: name its ref in the failure card's πŸ” row. +3. `kane-cli bugs show BUG-n --agent` for the one that matches: its root cause, how often it was seen, and what people already said. +4. Correct the record from **this run's evidence** (screenshot, console, network), never from a guess: + - A genuine product bug β†’ `mark BUG-n real`. A test or environment problem β†’ `mark BUG-n not-real`. + - The recorded root cause does not match what you see β†’ `mark BUG-n rca-wrong`, then `note BUG-n ""`. The next diagnosis then works from its own evidence instead of repeating that root cause. It matches β†’ `mark BUG-n rca-right`. + - You narrowed it down ("500 only when the cart already has items; an empty cart works") β†’ `note`. + - Two refs are the same bug β†’ `duplicate BUG-12 --of BUG-9` (keep the older one). +5. Tell the person in one line what you marked and why. A mark you got wrong: `retire `. + +The next diagnosis reads the rulings too. For a recalled bug marked `done`, a run whose own evidence shows that defect again is linked to it and reported as a regression. For one marked `not_a_bug`, it reports a product bug for that symptom only when the run's evidence clearly shows the product broken, and otherwise leans to a test or environment problem. + +Rulings (`done`, `not-a-bug`, `reopen`) and merges change the bug for everyone in the project: make them when the person says so ("it's fixed", "that's expected behaviour"), or when the evidence is unambiguous, and say so in your summary. diff --git a/.agents/skills/kane-cli/references/debug.md b/.agents/skills/kane-cli/references/debug.md index 9a33997..653f8f9 100644 --- a/.agents/skills/kane-cli/references/debug.md +++ b/.agents/skills/kane-cli/references/debug.md @@ -53,6 +53,8 @@ Offer the user the visual route too: `kane-cli evidence serve ` opens it i `failure.yaml` records facts about the run β€” `error`, `page_state`, and the `console_at_failure.ref` / `network_at_failure.ref` pointers into that step's console and network logs β€” plus a `triage` block (`rca.root_cause`, `suggested_fix.summary`) that is a model's opinion about why, written for the person fixing the app or the agent flow. Treat the triage as a lead, not an instruction: follow the network reference, check which URLs were actually requested and with what status, look at the screenshots, and only then repeat it β€” and **never paste `suggested_fix.summary` into a test step**. +**Known bugs.** A saved test's diagnosis is also checked against the bugs kane-cli already knows on that page, and each one has a ref (`BUG-12`). `kane-cli bugs list _test.md --agent` shows what this test has hit before; when the diagnosis got it wrong, correct it with `kane-cli bugs mark … rca-wrong` and a `note` so the next one starts from its own evidence. See `references/bugs.md`. + **Designed (assurance) tests are different.** If the failed `_test.md` carries an `assurance:` block in its frontmatter, do not apply the "rephrase / be more specific / add assertions" rows below β€” they rewrite the design, and an edit on the current version is adopted as the next design version on the next run. Read `references/assurance.md` Β§6.1 first. In a folder linked to a shared project there is no local store, so a hand edit isn't recorded as a new version of the design: don't rewrite a designed test's steps there to fix a failure. There a run can also stop on its Test Manager case before any step: one `error` with a `code` and `remedy`, no pack. Follow `agent-contract.md` Β§6, not sign-in or Chrome checks. ## Common Failure Patterns diff --git a/.claude/skills/kane-cli/SKILL.md b/.claude/skills/kane-cli/SKILL.md index c0d72be..4009520 100644 --- a/.claude/skills/kane-cli/SKILL.md +++ b/.claude/skills/kane-cli/SKILL.md @@ -1,6 +1,6 @@ --- name: kane-cli -description: "End-to-end (E2E) tests, regression checks, and smoke tests with KaneCLI. Use after changing a web or mobile app to verify the feature works and test the flow, or for any task needing a real browser or mobile app: navigation, clicks, forms, UI checks, screenshots, deploy verification. Generate E2E tests from a PRD, spec, or description via the assurance commands (use-cases, acceptance criteria, scenarios, runnable _test.md tests); never hand-write Kane test cases. Run on desktop web (Chrome by default), Android and iOS: emulator/simulator locally on macOS Apple Silicon or via testrun run --remote, and real cloud devices (--target android|ios). Prove coverage with evidence packs and kane-cli cover; gate CI by judging a pack against a policy (kane-cli evidence verdict, --policy). Work in a shared Test Manager project (link a folder with --project). Parse NDJSON output and inspect logs. Share the assurance store (.context/) via GitHub, S3, or a folder with kane-cli context sync." +description: "End-to-end (E2E) tests, regression checks, and smoke tests with KaneCLI. Use after changing a web or mobile app to verify the feature works and test the flow, or for any task needing a real browser or mobile app: navigation, clicks, forms, UI checks, screenshots, deploy verification. Generate E2E tests from a PRD, spec, or description via the assurance commands (use-cases, acceptance criteria, scenarios, runnable _test.md tests); never hand-write Kane test cases. Run on desktop web (Chrome by default), Android and iOS: emulator/simulator locally on macOS Apple Silicon or via testrun run --remote, and real cloud devices (--target android|ios). Prove coverage with evidence packs and kane-cli cover; gate CI by judging a pack against a policy (kane-cli evidence verdict, --policy). Work in a shared Test Manager project (link a folder with --project). Parse NDJSON output, inspect logs, and mark known bugs (kane-cli bugs). Share the assurance store (.context/) via GitHub, S3, or a folder with kane-cli context sync." --- # Kane CLI β€” End-to-End Test Generation and Execution Skill @@ -148,7 +148,7 @@ For exit code 1 (or `status: "failed"` in `run_end`), present the failure card. | ➑️ **Next** | Β· | ``` -The failing step's screenshot lives inside the run's evidence pack (the stderr hint names the pack path): extract it with `unzip "tests/*/steps/*/screenshot.png" -d `, Read it, and show it **under** the card. For the pack layout and deeper diagnosis, see `references/debug.md`. +The failing step's screenshot lives inside the run's evidence pack (the stderr hint names the pack path): extract it with `unzip "tests/*/steps/*/screenshot.png" -d `, Read it, and show it **under** the card. For the pack layout and deeper diagnosis, see `references/debug.md`. A saved test that failed may have hit a bug kane-cli already knows: `kane-cli bugs list _test.md --agent` names it, and your marks and notes shape the next diagnosis (`references/bugs.md`). Exit code 2 with no progress events means nothing ran: that is a `🟑 Didn't start` card, not a failure (`references/cards.md` Β§4). If progress events came before it, steps ran and the run stopped without a result: say so, and use the stopped-early card (`references/cards.md` Β§5). @@ -190,6 +190,7 @@ When the user's request involves a browser β€” or writing test cases: - View, share, or validate run evidence (`.evidence` packs) β†’ Read `references/evidence.md` - Judge a run or pack against quality gates (a policy YAML, `--policy`, `--policy-id`, `kane-cli evidence verdict`, `kane-cli policy …`), or gate CI on more than pass/fail β†’ Read `references/policy.md` first (after 0.10.0-rc.3) - Debug a failed run β†’ Read `references/debug.md` +- A saved test failed and you want the bugs it hit before, the person asks about known bugs (`BUG-12`), a failure's diagnosis (RCA) is wrong and needs correcting, or the person wants to see or manage the organisation's RCA categories β†’ Read `references/bugs.md` (`kane-cli bugs`, the release that ships it) - Configure kane-cli or check directory layout β†’ Read `references/setup-and-config.md` - The person asks to make kane-cli the default for this project or their team ("always use kane for E2E here", "add kane to CLAUDE.md / AGENTS.md") β†’ Read `references/setup-and-config.md` Β§Make kane-cli the default in a project. Only when asked, and ask before writing - Browse / create / pick a Test Manager project or folder for `kane-cli run`, or interpret the auto-default event β†’ Read `references/test-manager.md`. Linking an assurance folder to a project is different: `references/shared-projects.md` Β§2–3 @@ -383,6 +384,7 @@ A draft in chat cannot be run, and a hand-written `_test.md` carries no requirem | Need the assurance NDJSON event schema (`--mode agent`) | `references/assurance-parsing.md` | | Share the context store with a team, join one, keep stores level, or resolve a sync conflict (kane-cli 0.8.14+) | `references/context-sync.md` | | Run failed, need to diagnose | `references/debug.md` | +| Known bugs a test hit, or correcting a failure's diagnosis (`kane-cli bugs list\|show\|mark\|note\|duplicate\|retire\|categories`) | `references/bugs.md` | | View, share, validate, or merge evidence packs | `references/evidence.md` | | Judge a pack against a policy, run with `--policy`, or store/list policies in Test Manager | `references/policy.md` | | Multiple independent browser tasks | `references/parallel.md` | diff --git a/.claude/skills/kane-cli/references/bugs.md b/.claude/skills/kane-cli/references/bugs.md new file mode 100644 index 0000000..f620d69 --- /dev/null +++ b/.claude/skills/kane-cli/references/bugs.md @@ -0,0 +1,118 @@ + + +# Bugs β€” Agent Surface + +**Version.** Needs the kane-cli release that ships `kane-cli bugs`. If `bugs` is an unknown command, the installed build predates it: say so and go on without it. + +When a saved test fails, kane-cli's failure diagnosis (the RCA) works out why, and the diagnosis is uploaded with the run's evidence. kane-cli remembers each distinct **application bug** it finds, folds repeat sightings of the same bug together, and gives each one a ref that is unique within the project: `BUG-12`. A bug has a card (title, root cause, page, error signature), a status, and the runs it was seen in. + +When a later run fails on the same page, its diagnosis is told about the known bugs there: their status, their votes, and the latest note. It links the run to one of them only when this run's own evidence shows the same defect. **Feedback is how that memory gets sharper**: say what is real, say when a recorded root cause is wrong, and leave a note with what you learned. The next diagnosis reads it. + +## 1. Commands + +| Command | What it does | +|---|---| +| `kane-cli bugs list _test.md --agent` | The bugs this test has hit (its Test Manager test case) | +| `kane-cli bugs list --testcase --agent` | The bugs a Test Manager test case has hit, without a local file | +| `kane-cli bugs list [--status ] [--all-families] [--limit ] --agent` | No test and no `--testcase`: the project's bugs | +| `kane-cli bugs show BUG-12 --agent` | The card, status, votes, the runs it was seen in, and every live piece of feedback with its id | +| `kane-cli bugs mark BUG-12 real` \| `not-real` `--agent` | Is this a real product bug? (a vote) | +| `kane-cli bugs mark BUG-12 rca-right` \| `rca-wrong` `--agent` | Is the recorded root cause right? (a vote) | +| `kane-cli bugs mark BUG-12 done` \| `not-a-bug` \| `reopen` `--agent` | A ruling: fixed, a false alarm, or back to open | +| `kane-cli bugs note BUG-12 "" --agent` | Free text; the next diagnosis reads the latest note | +| `kane-cli bugs duplicate BUG-12 --of BUG-9 --agent` | BUG-12 is the same bug as BUG-9: merges 12 into 9. No confirmation | +| `kane-cli bugs retire --agent` | Take back a vote or note you gave (the id is in the `mark`/`note` output and in `show`) | +| `kane-cli bugs list --category "" --agent` | Only bugs given this RCA category (built-in or the organisation's); spans every family | +| `kane-cli bugs categories list [--source builtin\|org] [--status active\|inactive] --agent` | Every RCA category: the organisation's first, then the built-in ones; `agent_uses` says which the diagnosis picks from | +| `kane-cli bugs categories show "" --agent` | One category | +| `kane-cli bugs categories add --name "" --description "" [--inactive] --agent` | Add one of the organisation's | +| `kane-cli bugs categories edit "" [--name] [--description] [--status active\|inactive] --agent` | Change one of the organisation's | +| `kane-cli bugs categories remove "" --agent` | Remove one of the organisation's (no question under `--agent`; on a terminal it asks unless `--yes`) | + +- **Refs.** `BUG-12`, `bug-12` and `12` all mean BUG-12. +- **`--status`** takes a comma-separated list of `open`, `confirmed`, `done`, `regressed`, `not_a_bug`, `contested`, `merged` (`not-a-bug` also works). **`--limit`** is 1-200, default 50. **`--all-families`** lists every kind of failure the diagnosis recorded, not only application bugs. +- **Every subcommand** takes `--project `, `--profile `, `--env `, `--username `, `--access-key ` and `--agent`. + +**Which project.** `--project`, else the test.md's own project, else the folder's linked project, else the profile's (`kane-cli config project `). With none: `NO_PROJECT`. + +**RCA categories.** Every failure gets one category. The diagnosis prefers one of the organisation's own (Org Preferences β†’ Automatic AI RCA) whose description fits, else the closest built-in one; the family (product, test or environment fault) is still decided separately. Name a category by its name (any case) or id. Built-in ones are read-only. An organisation category's id is `custom:`: a failure records it as `/custom:` with its name beside it, and a failed step's reason names it. Changing the organisation's list applies to everyone's next runs, and adding, editing or removing needs org admin or the Product Preferences permission: do it only when the person asks. A category never decides which bug a failure joins, and **a bug keeps the category of the run that first found it**: one recorded before a category existed never takes it on, so `--category` doesn't list it. That is expected, not a fault. + +**Which test.** `bugs list _test.md` needs the test to have a Test Manager test case, which it gets the first time it runs with an upload. A test that never uploaded refuses with `NO_TESTCASE`: run it once, or pass `--testcase `. + +## 2. Who the feedback counts as + +- Feedback is the signed-in user's, and it moves the bug's status for the whole project. +- **With `--agent`** it is recorded as the agent's, made under the signed-in user, and it counts the same as a person's. Always pass `--agent` for your own marks, so a person reading the bug can tell yours from theirs. Without `--agent` but with no terminal, the output is still one JSON line, yet the mark is recorded as the person's. +- **One vote per person.** A person and the agent working as them share one `real`/`not-real` vote and one `rca-right`/`rca-wrong` vote; the latest wins. Marking again changes the vote, it does not add one. +- Only the person who gave feedback (or the agent working as them) can retire it. Another person's feedback refuses with `NOT_FOUND`. + +**How the status moves.** + +| Status | When | +|---|---| +| `open` | New, or the real-bug votes are not net positive. Shown as `open (disputed)` when more people say it is not real | +| `confirmed` | More `real` than `not-real` votes | +| `done` | Ruled fixed with `mark done` | +| `regressed` | Ruled `done`, then seen again in a later run | +| `not_a_bug` | Ruled a false alarm with `mark not-a-bug` | +| `contested` | Ruled `not_a_bug`, then hit again by several different tests | +| `merged` | Merged into another bug with `duplicate` | + +The latest ruling wins; `mark reopen` drops back to the votes. + +## 3. Output (one JSON line with `--agent`) + +``` +bugs list {"ok":true,"project_id":"","testcase_id":"","bugs":[{"ref":"BUG-12","status":"open","votes":1,"rca_votes":-1,"title":"…","root_cause":"…","page_pattern":"/cart","occurrences":3,"testcases":2,"last_seen_at":"…"}],"has_more":false} +bugs show {"ok":true,"bug":{"ref":"BUG-12","status":"open","card":{"title":"…","root_cause":"…","page_pattern":"/cart","error_signature":"…"},"occurrence_count":3,"testcase_count":2,"votes":1,"rca_votes":-1,…},"occurrences":[{"evidence_id":"…","seen_at":"…",…}],"feedback":[{"id":"","type":"vote_rca","value":"-1","author_kind":"agent","created_at":"…"},{"id":"","type":"note","text":"…","author_kind":"user",…}]} +bugs mark {"ok":true,"ref":"BUG-12","feedback_id":"","status":"confirmed"} +bugs note {"ok":true,"ref":"BUG-12","feedback_id":"","status":"open"} +bugs duplicate {"ok":true,"ref":"BUG-12","feedback_id":"","status":"merged","of":"BUG-9","merged":true,"merged_into":"BUG-9"} +bugs retire {"ok":true,"feedback_id":"","retired":true,"status":"open"} +refusal {"ok":false,"error":"NOT_FOUND","message":"BUG-99 is not a bug in project . This project's bugs: BUG-12, BUG-14"} +``` + +- `testcase_id` appears only when the list is for one test. `votes` and `rca_votes` are net counts and appear only when known; `disputed: true` appears only when set. +- A bug's feedback `type` is `vote_real` / `vote_rca` (value `1` or `-1`), `note`, `done`, `not_a_bug`, `reopen` or `duplicate_of`; `author_kind` is `user` or `agent`. +- `duplicate` with `"merged":false` was recorded as a suggestion only; the bugs were not merged. +- On a terminal the same commands print a table (`REF STATUS VOTES TITLE OCCURRENCES`) or plain lines. + +**Exit codes.** `0` done Β· `1` any refusal. + +## 4. Errors and how to recover + +| `error` | Meaning β†’ what to do | +|---|---| +| `NOT_FOUND` | An unknown ref: pick one from the refs the message lists. On `retire`: the id is wrong, or the feedback is not yours | +| `NO_TESTCASE` | The test.md has no Test Manager test case yet: run it once with an upload, or pass `--testcase ` | +| `NO_PROJECT` | Pass `--project `, run in a linked folder, or bind one with `kane-cli config project ` | +| `NOT_ENABLED` | `the bug store is not enabled on this controller`: bug memory is not available in this environment yet. Tell the person in one line and go on without it | +| `UNAUTHORIZED` | Sign-in: the person runs `kane-cli login` (never ask for keys in chat) | +| `NETWORK` | No answer: check the connection or `--env`, then retry | +| `NOT_READY` | Retry in a minute | +| `CYCLE` | The merge would loop (BUG-9 is already merged into BUG-12) | +| `INVALID` | A bad argument (an unknown mark, an empty note, `--limit` out of range, a bug as a duplicate of itself, a test.md that does not exist): fix the call as the message says | +| `CONFLICT` | Someone changed the bug at the same moment: retry | +| `BUILTIN_READ_ONLY` | A built-in category can't be edited or removed: add the organisation's own instead | +| `FORBIDDEN` | The person can't change categories: an org admin, or a role with the Product Preferences permission, must | +| `DUPLICATE_NAME` | Another category has that name: pick another, or edit that one | +| `AMBIGUOUS` | The name matches more than one category: use one of the ids the message lists | +| `NOT_SUPPORTED` | This controller has no category routes yet: tell the person in one line and go on | + +## 5. In an RCA flow + +After a saved test fails (`testmd run`, or a member of `testrun run`): + +1. Read the failure as usual (`references/debug.md`), including the diagnosis in the evidence pack. +2. `kane-cli bugs list _test.md --agent`: what this test has hit before. A known bug that matches this failure is context, not a new finding: name its ref in the failure card's πŸ” row. +3. `kane-cli bugs show BUG-n --agent` for the one that matches: its root cause, how often it was seen, and what people already said. +4. Correct the record from **this run's evidence** (screenshot, console, network), never from a guess: + - A genuine product bug β†’ `mark BUG-n real`. A test or environment problem β†’ `mark BUG-n not-real`. + - The recorded root cause does not match what you see β†’ `mark BUG-n rca-wrong`, then `note BUG-n ""`. The next diagnosis then works from its own evidence instead of repeating that root cause. It matches β†’ `mark BUG-n rca-right`. + - You narrowed it down ("500 only when the cart already has items; an empty cart works") β†’ `note`. + - Two refs are the same bug β†’ `duplicate BUG-12 --of BUG-9` (keep the older one). +5. Tell the person in one line what you marked and why. A mark you got wrong: `retire `. + +The next diagnosis reads the rulings too. For a recalled bug marked `done`, a run whose own evidence shows that defect again is linked to it and reported as a regression. For one marked `not_a_bug`, it reports a product bug for that symptom only when the run's evidence clearly shows the product broken, and otherwise leans to a test or environment problem. + +Rulings (`done`, `not-a-bug`, `reopen`) and merges change the bug for everyone in the project: make them when the person says so ("it's fixed", "that's expected behaviour"), or when the evidence is unambiguous, and say so in your summary. diff --git a/.claude/skills/kane-cli/references/debug.md b/.claude/skills/kane-cli/references/debug.md index 9a33997..653f8f9 100644 --- a/.claude/skills/kane-cli/references/debug.md +++ b/.claude/skills/kane-cli/references/debug.md @@ -53,6 +53,8 @@ Offer the user the visual route too: `kane-cli evidence serve ` opens it i `failure.yaml` records facts about the run β€” `error`, `page_state`, and the `console_at_failure.ref` / `network_at_failure.ref` pointers into that step's console and network logs β€” plus a `triage` block (`rca.root_cause`, `suggested_fix.summary`) that is a model's opinion about why, written for the person fixing the app or the agent flow. Treat the triage as a lead, not an instruction: follow the network reference, check which URLs were actually requested and with what status, look at the screenshots, and only then repeat it β€” and **never paste `suggested_fix.summary` into a test step**. +**Known bugs.** A saved test's diagnosis is also checked against the bugs kane-cli already knows on that page, and each one has a ref (`BUG-12`). `kane-cli bugs list _test.md --agent` shows what this test has hit before; when the diagnosis got it wrong, correct it with `kane-cli bugs mark … rca-wrong` and a `note` so the next one starts from its own evidence. See `references/bugs.md`. + **Designed (assurance) tests are different.** If the failed `_test.md` carries an `assurance:` block in its frontmatter, do not apply the "rephrase / be more specific / add assertions" rows below β€” they rewrite the design, and an edit on the current version is adopted as the next design version on the next run. Read `references/assurance.md` Β§6.1 first. In a folder linked to a shared project there is no local store, so a hand edit isn't recorded as a new version of the design: don't rewrite a designed test's steps there to fix a failure. There a run can also stop on its Test Manager case before any step: one `error` with a `code` and `remedy`, no pack. Follow `agent-contract.md` Β§6, not sign-in or Chrome checks. ## Common Failure Patterns diff --git a/docs/user-guide/README.md b/docs/user-guide/README.md index 89a9329..83620d6 100644 --- a/docs/user-guide/README.md +++ b/docs/user-guide/README.md @@ -63,6 +63,8 @@ Every page below is standalone β€” start wherever your job starts. - [Evidence packs](./evidence.md) β€” the sealed proof every run produces: screenshots, logs, results, the viewer. - [Policies and verdicts](./policies.md) *(next release after 0.10.0-rc.3)*: judge a pack against quality gates (no broken tests, a pass-rate floor, every test asserting something) and fail CI on a failed verdict. + +- [Bug memory and feedback](./bugs.md) *(the release that ships `kane-cli bugs`)*: the application bugs failed tests run into, remembered as `BUG-`; mark them, add notes, and shape the next failure diagnosis. - [Coverage](./assurance/coverage.md) β€” what execution proved vs what the design still owes. - [Maintaining the suite](./assurance/maintain.md) β€” reconcile the suite when a requirement document changes. diff --git a/docs/user-guide/bugs.md b/docs/user-guide/bugs.md new file mode 100644 index 0000000..8447db9 --- /dev/null +++ b/docs/user-guide/bugs.md @@ -0,0 +1,222 @@ +# Bug memory and feedback + + +> Needs the kane-cli release that ships `kane-cli bugs` (`kane-cli bugs --help` prints the command list). On an older build, `bugs` is an unknown command. + +When a saved test fails, kane-cli works out why: its **failure diagnosis** (the RCA, root-cause analysis) reads the run's evidence and writes down what went wrong. kane-cli also **remembers the application bugs** those diagnoses find, so the same bug is recognised the next time a test runs into it, and you and your coding agent can correct and enrich what it remembers with `kane-cli bugs`. + +- Each distinct bug gets a ref that is unique within your Test Manager project: `BUG-12`. +- Repeat sightings of the same bug are folded into it, so you see one bug seen in five runs, not five bugs. +- Your feedback (is it real, is the root cause right, a note) is read by the next diagnosis. + +## How bugs appear + +1. A saved test (`kane-cli testmd run`, or a test in a `kane-cli testrun run` suite) fails. +2. The failure is diagnosed, and the diagnosis is uploaded with the run's [evidence](./evidence.md). +3. If the diagnosis found an application bug, kane-cli either files it as a new bug with its own `BUG-` ref, or adds this run to the bug it already knows. + +Each bug has a **card**: a title, the root cause, its [RCA category](#rca-categories), the page it happens on, and the error it shows. It also has a **status**, the **votes** people and agents gave it, and the list of runs it was seen in. + +## How the next diagnosis uses it + +When a later run fails on the same page, its diagnosis is told about the known bugs there: their status, their votes, and the latest note. It links the run to one of them only when **this run's own evidence** shows the same defect. A known bug is context for the diagnosis, never a shortcut past the evidence. + +That is why feedback matters: + +- Marking a bug `real` or `not-real` tells the next diagnosis how much weight it deserves. +- Marking its root cause `rca-wrong`, with a note that says what is actually wrong, makes the next diagnosis re-diagnose from its own evidence instead of repeating the recorded root cause. +- A note ("500 only when the cart already has items; an empty cart works") is passed on as it is. The latest note is the one the diagnosis reads. +- Marking a bug `done` tells the next diagnosis it was fixed: a run whose evidence shows that same defect again is linked to it, says the fix has regressed, and flags the bug `regressed`. +- Marking a bug `not-a-bug` tells the next diagnosis people ruled it isn't a product bug: for that symptom it reports a product bug only when the run's own evidence clearly shows the product broken, and otherwise leans to a test or environment problem. + +## Which test and which project + +`kane-cli bugs` works on a Test Manager project: + +1. `--project `, if you pass it; +2. else the project of the test file you name; +3. else the project your folder is [linked to](./assurance/shared-projects.md); +4. else your profile's project (`kane-cli config project `, see [Test Manager integration](./test-manager-integration.md)). + +To list the bugs of one test, the test needs a **Test Manager test case**. A test.md gets one the first time it runs with an upload. A test that has never uploaded has none: run it once, or pass `--testcase ` with the test case id from Test Manager. + +## Commands + +### List bugs + +```bash +kane-cli bugs list checkout_test.md # the bugs this test has hit +kane-cli bugs list --testcase # the bugs a Test Manager test case has hit +kane-cli bugs list # the project's bugs +kane-cli bugs list --status open,confirmed # only these statuses +kane-cli bugs list --category "Payment failures" # only bugs given this RCA category +``` + +On a terminal you get a table: + +``` +REF STATUS VOTES TITLE OCCURRENCES +BUG-12 open 1, rca -1 Checkout returns 500 when the cart has items 3 +BUG-9 done 2 Promo code field accepts expired codes 5 + +2 bugs for test case … in project …. +Details: kane-cli bugs show +``` + +`VOTES` is the net real-bug vote, then the net root-cause vote when it isn't zero (`rca -1` means more people said the root cause is wrong than right). + +| Flag | What it does | Default | +|---|---|---| +| `[test]` | A `*_test.md` file: its bugs | the project's bugs | +| `--testcase ` | A Test Manager test case id, instead of a test.md | none | +| `--status ` | Only these statuses, comma-separated: `open`, `confirmed`, `done`, `regressed`, `not_a_bug`, `contested`, `merged` | every status except `merged` | +| `--all-families` | Every kind of failure the diagnosis recorded, not only application bugs | application bugs | +| `--category ` | Only bugs given this [RCA category](#rca-categories), built-in or your organisation's. Takes in every kind of failure, since an organisation's category can be given to any of them | none | +| `--limit ` | At most n bugs (1-200) | 50 | + +### Show one bug + +```bash +kane-cli bugs show BUG-12 +``` + +Prints the card (title, root cause, kind, severity, page, error signature), how often and when the bug was seen and in how many test cases, its votes, the runs it was seen in, and every piece of feedback still in force, each with its **id** (you need the id to take your own feedback back). `BUG-12`, `bug-12` and `12` all mean the same bug. + +### Mark a bug + +```bash +kane-cli bugs mark BUG-12 real # it is a real product bug +kane-cli bugs mark BUG-12 not-real # it is a test or environment problem +kane-cli bugs mark BUG-12 rca-right # the recorded root cause is right +kane-cli bugs mark BUG-12 rca-wrong # the recorded root cause is wrong +kane-cli bugs mark BUG-12 done # it is fixed +kane-cli bugs mark BUG-12 not-a-bug # it was a false alarm +kane-cli bugs mark BUG-12 reopen # take back done / not-a-bug +``` + +``` +BUG-12: marked root cause wrong. Status: open. +Feedback … (take it back: kane-cli bugs retire …) +``` + +`real`, `not-real`, `rca-right` and `rca-wrong` are **votes**. `done`, `not-a-bug` and `reopen` are **rulings**. + +### Add a note + +```bash +kane-cli bugs note BUG-12 "500 only when the cart already has items; an empty cart works" +``` + +Quote the text. The next diagnosis reads the latest note on the bug. + +### Merge a duplicate + +```bash +kane-cli bugs duplicate BUG-12 --of BUG-9 +``` + +Says BUG-12 is the same bug as BUG-9 and merges 12 into 9. There is no confirmation prompt. The output says whether the bugs were merged, or the duplicate was recorded only as a suggestion. A merge is undone with a split in Test Manager. + +### Take your feedback back + +```bash +kane-cli bugs retire +``` + +The id is printed by `mark` and `note`, and listed by `bugs show`. You can take back only your own feedback. + +### RCA categories + +The diagnosis gives every failure one **RCA category**. It picks one of your organisation's own categories (the list in Org Preferences β†’ Automatic AI RCA) whenever its description fits the failure, and otherwise the closest built-in category. Whether the failure is a product bug, a test problem or an environment problem is still decided separately. `kane-cli bugs categories` shows both lists and manages your organisation's: + +```bash +kane-cli bugs categories list # yours first, then the built-in ones, and whether the diagnosis uses each +kane-cli bugs categories list --source org # only yours (or --source builtin; --status active|inactive) +kane-cli bugs categories show "Payment failures" # by name (any case) or id +kane-cli bugs categories add --name "Payment failures" --description "Payment gateway returns a 5xx or times out during checkout" [--inactive] +kane-cli bugs categories edit "Payment failures" --status inactive # or --name, --description +kane-cli bugs categories remove "Payment failures" [--yes] # asks first on a terminal +``` + +- The diagnosis matches failures against a category's **description**, so write it as the failures it covers. It uses one of your categories only while it is active and has a description. +- A change applies to the next run, for everyone in your organisation. +- Built-in categories can be listed and shown, never changed. +- Adding, editing and removing need org admin, or the Product Preferences permission when your organisation uses roles. +- A failed step's reason, `kane-cli bugs show` and the run's evidence name your category. A failure, and a bug, keep a category's name after it is renamed or removed. +- A category never decides which bug a failure joins: the same defect stays one bug whatever category each run gave it. +- **A bug keeps the category of the run that first found it.** A bug recorded before you added a category doesn't take it on, even when later runs pick it, so `bugs list --category` doesn't list that bug. +- The Org Preferences screen saves the whole list it loaded: saving it from a page opened before a change made here undoes that change. + +### Flags every subcommand takes + +| Flag | What it does | +|---|---| +| `--project ` | The Test Manager project (see [Which test and which project](#which-test-and-which-project)) | +| `--profile ` | Profile name (default: the active one) | +| `--env ` | Environment | +| `--username ` / `--access-key ` | Basic auth, skipping the stored sign-in | +| `--agent` | One JSON line on stdout; feedback is recorded as the agent's (see below) | + +## Statuses + +| Status | Meaning | +|---|---| +| `open` | New, or the real-bug votes are not net positive. Shown as `open (disputed)` when more people say it is not real | +| `confirmed` | More people say it is real than not | +| `done` | Ruled fixed | +| `regressed` | Ruled fixed, then seen again in a later run | +| `not_a_bug` | Ruled a false alarm | +| `contested` | Ruled a false alarm, then hit again by several different tests | +| `merged` | Merged into another bug as a duplicate | + +The latest ruling wins. `reopen` drops a bug back to what its votes say. + +## Votes, people and agents + +- Feedback is recorded under the signed-in user, and it changes the bug for everyone in the project. +- **One vote per person.** You have one real/not-real vote and one root-cause vote on each bug. Voting again replaces your vote; it does not add a second one. +- **Agents.** When your coding agent runs `kane-cli bugs … --agent`, its feedback is recorded as the agent's, made under your sign-in, and it counts the same as yours. `bugs show` labels each piece of feedback `user` or `agent`, so you can tell them apart. Your vote and your agent's vote are the same vote: the latest one counts. + +## For agents + +With `--agent`, or when stdout or stdin is not a terminal, every subcommand prints one JSON line: + +```json +{"ok":true,"ref":"BUG-12","feedback_id":"…","status":"open"} +``` + +and a refusal prints: + +```json +{"ok":false,"error":"NOT_FOUND","message":"BUG-99 is not a bug in project …. This project's bugs: BUG-12, BUG-14"} +``` + +Exit codes: `0` done, `1` any refusal. A typical agent flow after a saved test fails: read the failure from its evidence pack, `kane-cli bugs list _test.md --agent` to see what the test has hit before, `kane-cli bugs show BUG-n --agent` for the bug that matches, then `mark` and `note` from what this run's evidence shows. The kane-cli agent skill carries this flow; see [Using kane-cli from an AI coding agent](./agents.md). + +## Troubleshooting + +| Message | What to do | +|---|---| +| `the bug store is not enabled on this controller` | Bug memory isn't available in this environment yet. Nothing to fix on your side; runs and diagnoses work as before | +| `this test.md has no Test Manager test case yet: run it once with an upload, or pass --testcase` | The test has never uploaded. Run it once, or pass `--testcase ` | +| `no project: pass --project , run in a folder linked to a project, or bind one with …` | Pass `--project `, run in a linked folder, or bind one with `kane-cli config project ` | +| `BUG-99 is not a bug in project …. This project's bugs: …` | A ref from another project, or a typo. Pick one from the list, or pass the right `--project` | +| `feedback … was not found, or is not yours` | The id is wrong, or the feedback is someone else's. `kane-cli bugs show ` lists the ids | +| `"…" is not a mark: use real, not-real, rca-right, rca-wrong, done, not-a-bug, reopen` | Use one of those words | +| `--status takes open, confirmed, done, regressed, not_a_bug, contested, merged (comma-separated)` | Fix the status list | +| `--limit must be an integer in [1, 200]` | Pass a number from 1 to 200 | +| `… cannot be a duplicate of itself` / the merge would loop | Pick another bug for `--of` | +| `… is a built-in category and can't be changed` | Built-in categories are read-only. Add your own with `kane-cli bugs categories add` | +| A category change is refused for permission | Ask an org admin to make the change, or to give your role the Product Preferences permission | +| A category with that name already exists | Pick another name, or edit the existing category | +| `"…" is a built-in category in several families: use …` | Name it by one of the ids the message lists | +| `this controller has no RCA category routes yet` | This environment doesn't have categories yet. Listing and marking bugs work as before | +| `the controller refused the sign-in: run …` | Sign in again with `kane-cli login` ([Authentication](./authentication.md)) | +| No answer (a network error) | Check your connection, or the environment you passed with `--env` | + +## Next steps + +- [Evidence packs](./evidence.md): where a failed run's diagnosis and logs live. +- [Running test.md files](./testmd/running.md): replay, healing, and what happens when a replay fails. +- [Batch runs (testrun)](./testrun.md): many tests, one execution. +- [Troubleshooting](./troubleshooting.md): the debugging flow. diff --git a/docs/user-guide/evidence.md b/docs/user-guide/evidence.md index 90eceb7..8c7eadb 100644 --- a/docs/user-guide/evidence.md +++ b/docs/user-guide/evidence.md @@ -189,6 +189,9 @@ The pack is the fastest way to understand a failure, because everything is in on If a pack won't open in the viewer, run `kane-cli evidence validate ` β€” an unsealed or truncated pack (for example from a run that was killed hard) reports as invalid, and the run's session directory still holds the raw logs. + +A failed saved test's diagnosis is also matched against the bugs kane-cli already knows in your project *(the release that ships `kane-cli bugs`)*. To see them, or to correct a diagnosis that got the root cause wrong, see [Bug memory and feedback](./bugs.md). + ## Judging a pack against a policy *(next release after 0.10.0-rc.3)* @@ -209,6 +212,8 @@ Runs that upload to Test Manager attach their sealed pack automatically. Replaye - [Batch runs with testrun](./testrun.md) β€” many tests, one execution, one pack. - [Policies and verdicts](./policies.md) β€” judge a pack against quality gates. + +- [Bug memory and feedback](./bugs.md) β€” the bugs failed tests hit, and feedback that shapes the next diagnosis. - [Running test.md files](./testmd/running.md) β€” the testmd command family. - [Troubleshooting](./troubleshooting.md) β€” debugging flows and escape hatches. diff --git a/docs/user-guide/testmd/running.md b/docs/user-guide/testmd/running.md index fd70c06..4610645 100644 --- a/docs/user-guide/testmd/running.md +++ b/docs/user-guide/testmd/running.md @@ -118,6 +118,9 @@ A replay can fail if the site changed under you β€” a button moved, the page is Every failed replay is also **investigated automatically**: a failure record β€” the error, the page state at failure, and pointers into the step's console/network logs β€” is written into the run's [evidence pack](../evidence.md#debugging-a-failed-run-from-its-pack), so you can see *why* the replay broke, not just that it did. + +kane-cli also remembers the application bugs those diagnoses find, as `BUG-` refs in your project, and tells the next diagnosis about them *(the release that ships `kane-cli bugs`)*. `kane-cli bugs list _test.md` shows what a test has hit, and your marks and notes shape the next diagnosis. See [Bug memory and feedback](../bugs.md). + ### Replays don't need a project or folder A pure replay of an already-authored test β€” every step replays from cache β€” no longer requires a Test Manager project/folder to be configured. There is no interactive picker, no auto-created project, and no setup dead end: the test already knows where it belongs, and the replay runs with that identity. Authoring runs (first runs, edited steps, `--author`) resolve a project and folder as before. diff --git a/docs/user-guide/testrun.md b/docs/user-guide/testrun.md index df3989c..0fca5ab 100644 --- a/docs/user-guide/testrun.md +++ b/docs/user-guide/testrun.md @@ -239,6 +239,8 @@ In agent / non-TTY mode, `testrun run` emits its own typed NDJSON events on stdo - [Remote runs on the cloud grid](./remote-execution.md) β€” `--remote`, mobile suites from any machine. - [Evidence packs](./evidence.md) β€” what's in the pack and how to view it. - [Policies and verdicts](./policies.md) β€” gate the suite's pack on quality rules. + +- [Bug memory and feedback](./bugs.md) β€” the bugs failed members hit, and feedback that shapes the next diagnosis. - [Writing test.md files](./testmd/overview.md) β€” the file format, including `tags:`. - [Running test.md files](./testmd/running.md) β€” single-test runs, replay, and flags. - [CI/CD recipes](./cicd.md) β€” pipeline patterns. diff --git a/docs/user-guide/troubleshooting.md b/docs/user-guide/troubleshooting.md index c086eb0..308fe7b 100644 --- a/docs/user-guide/troubleshooting.md +++ b/docs/user-guide/troubleshooting.md @@ -20,6 +20,8 @@ This page lists common problems you may hit while using kane-cli, what causes th - [Shared projects: a command stopped](#shared-projects) β€” linking a folder, sessions, designs, runs on a test case, and the pull - [Real devices: the hub refused the tunnel](./mobile/real-device.md#troubleshooting) β€” the LT tunnel, its name, and `--env` - [Exploration: a run refused or designed no tests](./exploration.md#troubleshooting) β€” the URL, a login, secrets, the tunnel, design jobs + +- [Bug memory: `kane-cli bugs` refused](./bugs.md#troubleshooting) β€” no test case, no project, an unknown ref, or bug memory not enabled - [Context sync: Git not found or too old](#context-sync-git-not-found-or-too-old) - [Context sync: a location cannot be reached or refuses you](#context-sync-a-location-cannot-be-reached-or-refuses-you) - [Context sync: "a rebase is open" β€” every change refused](#context-sync-a-rebase-is-open--every-change-refused) diff --git a/integrations/docs/kiro-powers.md b/integrations/docs/kiro-powers.md index c4592ae..8521005 100644 --- a/integrations/docs/kiro-powers.md +++ b/integrations/docs/kiro-powers.md @@ -15,7 +15,7 @@ The `integrations/kiro-powers/` folder is a [Kiro power](https://kiro.dev/docs/p | Artifact | Path | Purpose | |---|---|---| | **Canonical skill** | `skill-installer/skills/SKILL.md` | Source of every CLI fact: command shapes, flags, exit codes, NDJSON essentials, decision tree, results presentation. **Edit this first.** Every other integration mirrors from here. | -| **Canonical references** | `skill-installer/skills/references/*.md` | On-demand reference content: `ready-check.md` (preflight, the ready card, problems that stop a run, sign-in), `first-run.md` (run first, the verbatim tour, three choices asked once), `agent-config.md` (the saved preferences file: location, schema, shell read and write, hard-case rules), `cards.md` (every result card and the rules for all cards), `live-strip.md` (the Claude Code status bar strip, not offered in Kiro), `objectives-cookbook.md` (pattern catalog + checkpoint analyze methods), `testmd.md` (file format, replay, the saved-test stream), `generate.md` + `generate-parsing.md` (AI test-case authoring), `test-manager.md` (project/folder agent surface, auto-default event, the global "changing where results go" flow), `parsing.md` (full NDJSON schema and the 0.8.17+ stream contract), `debug.md` (log layout), `parallel.md`, `setup-and-config.md`. Equally authoritative: facts in any of these must mirror through. | +| **Canonical references** | `skill-installer/skills/references/*.md` | On-demand reference content: `ready-check.md` (preflight, the ready card, problems that stop a run, sign-in), `first-run.md` (run first, the verbatim tour, three choices asked once), `agent-config.md` (the saved preferences file: location, schema, shell read and write, hard-case rules), `cards.md` (every result card and the rules for all cards), `live-strip.md` (the Claude Code status bar strip, not offered in Kiro), `objectives-cookbook.md` (pattern catalog + checkpoint analyze methods), `testmd.md` (file format, replay, the saved-test stream), `generate.md` + `generate-parsing.md` (AI test-case authoring), `test-manager.md` (project/folder agent surface, auto-default event, the global "changing where results go" flow), `parsing.md` (full NDJSON schema and the 0.8.17+ stream contract), `debug.md` (log layout), `bugs.md` (bug memory and `kane-cli bugs`), `parallel.md`, `setup-and-config.md`. Equally authoritative: facts in any of these must mirror through. | | Kiro power root | `integrations/kiro-powers/POWER.md` | Frontmatter (name/displayName/keywords/author), onboarding (install, sign-in rules, project/folder), the **Every session** protocol (ready check commands, ready card, problems table, no-human rule, launch line, watch mode), condensed command reference, steering-file mapping. | | First session + saved preferences steering | `integrations/kiro-powers/steering/kane-cli-first-run.md` | Loaded on a user's first session, on "kane tour" and on "kane preferences": the run-first rule and its defaults, the first-run tour (verbatim from canonical `first-run.md`), the first result's extra rows, the three choices asked once after the first result, and the saved preferences file (location, schema, shell read and write, hard-case rules; host key `kiro`). | | `kane-cli run` steering | `integrations/kiro-powers/steering/kane-cli-run.md` | Full reference for one-shot `kane-cli run`: objective patterns + checkpoint analyze methods (Visual / Textual-DOM / URL / Title / DevToolsβ†’Network/Console/Performance/Cookies/localStorage), full flag table, NDJSON parsing (including `project_folder_auto_defaulted`), results presentation, failure diagnosis, parallel execution, project/folder management (`projects`/`folders list|create`, auto-default gate). | @@ -23,6 +23,7 @@ The `integrations/kiro-powers/` folder is a [Kiro power](https://kiro.dev/docs/p | `kane-cli testrun` + evidence steering | `integrations/kiro-powers/steering/kane-cli-testrun.md` | Full reference for `kane-cli testrun run` (selection, preflight, parallel, dry-run, typed `testrun_*` NDJSON events, exit codes) and the evidence-pack surface (`evidence serve/validate/merge`, pack locations, the stderr view hint). | | `kane-cli fair-evaluation` steering | `integrations/kiro-powers/steering/kane-cli-fair-evaluation.md` | How to compare Kane CLI to other approaches honestly: like-for-like lifecycle phases (authoring vs the alternative's script *creation*; replay vs execution; plus locator-break repair + ongoing maintenance), the comparison traps (replay is zero-LLM, the sunk-cost trap, phase mismatch), and what Kane CLI is purpose-built for. | | `kane-cli mobile` steering | `integrations/kiro-powers/steering/kane-cli-mobile.md` | Full reference for driving a native mobile app (locally on macOS Apple Silicon, or on the cloud grid from any machine): the `--target desktop\|emulator\|simulator` axis (desktop/browser is the default), `--device-name` / `--os-version` / `--app` selection, the required app under test (build or `APP…` id), one-time local setup + `kane-cli doctor` / `devices list`, the flat `_test.md` `target:` + `app:` (+ `device_name:`/`os_version:`) frontmatter keys, mobile members in `testrun` and `testrun run --remote` (grid rules and preflight codes), and the web-only checkpoint carve-out. | +| `kane-cli bugs` steering | `integrations/kiro-powers/steering/kane-cli-bugs.md` | Full reference for bug memory and `kane-cli bugs` (`list`/`show`/`mark`/`note`/`duplicate`/`retire`): how a failed test's diagnosis is remembered as `BUG-`, who feedback counts as (`--agent`), the statuses, the one-line output and error codes, and the after-a-failure flow. | | `kane-cli assurance` steering | `integrations/kiro-powers/steering/kane-cli-assurance.md` | Full reference for the assurance flow: requirement docs β†’ `context ingest`/`extract` β†’ review checkpoints β†’ `design tests` β†’ author β†’ `testrun` β†’ `cover`, the `--mode agent` pause loop (exit 3 = resumable), the review checkpoints, and `maintain reconcile`. | | Hook template | `integrations/kiro-powers/hooks/kane-verify.kiro.hook` | Sample agent hook the user copies to their workspace `.kiro/hooks/`. | @@ -50,7 +51,7 @@ The canonical skill is a thin `SKILL.md` (7 sections, ~300 lines) plus on-demand | `references/testmd.md`: testmd file format, replay & cascade, `@import`, commands, parse errors, gate-fires-before-launch note, the saved-test stream table (`test_md_step_start` through `test_md_done`) | All of `steering/kane-cli-testmd.md` (the stream table lives under Replay policy and completion β†’ The saved-test stream); authoring from a description points at the assurance steering | | `references/parsing.md`: the 0.8.17+ stream contract (`stream_start`, `v`, `ts`, ignore unknown fields and event types, typeless step lines, completion event last, `events.ndjson` and the active-run pointer file), full NDJSON event schemas (`project_folder_auto_defaulted`, `bifurcation`, `child_agent_*`, `ask_user`, complete `run_end` fields incl. `credits_consumed`) | `steering/kane-cli-run.md` β†’ Parsing the NDJSON output (The stream contract + full event-type list + Terminal `run_end` event) | | `references/test-manager.md`: project/folder agent surface (`projects list|create`, `folders list|create` with the **required** `--project `, NDJSON wire shape, pagination), run-startup auto-default gate, `project_folder_auto_defaulted` event, self-healing for stale IDs, the global "changing where results go" flow | `POWER.md` β†’ Step 3 (project/folder onboarding) **and** `steering/kane-cli-run.md` β†’ Browsing / creating projects and folders + The run-startup auto-default gate + Changing where results go **and** `steering/kane-cli-testmd.md` β†’ Quick start (gate note) | -| `references/debug.md` β€” log layout, debugging flow, common failure patterns (incl. "did you mean" subcommand and self-healing rows), bug-report heuristic | `steering/kane-cli-run.md` β†’ Failure handling & log inspection + Bug-report heuristic | +| `references/debug.md` β€” log layout, debugging flow, the known-bugs pointer, common failure patterns (incl. "did you mean" subcommand and self-healing rows), bug-report heuristic | `steering/kane-cli-run.md` β†’ Failure handling & log inspection (incl. the Known bugs paragraph) + Bug-report heuristic | | `references/parallel.md` β€” when to split, agent prompt template, batch summary | `steering/kane-cli-run.md` β†’ Parallel execution | | `references/testrun.md`: batch runs: selection (paths/`--match`/`--tags`), preflight reasons, `--remote` (HyperExecute jobs, `remote_*` events, remote preflight codes, the 0.8.17+ remote additions), mobile members, `testrun_*` event schema (incl. `session_id`, `log_path`, `failure`, the authored member pair, `testrun_progress`), each test's own log and the `--stream-members` rule, suite card presentation, exit codes | All of `steering/kane-cli-testrun.md` | | `references/evidence.md`: pack locations, the stderr view hint, `evidence serve/validate/merge`, debugging with a pack, the first-run rule (serve the pack and link the viewer instead of offering) | `steering/kane-cli-testrun.md` β†’ Evidence packs **and** `steering/kane-cli-run.md` β†’ Failure handling (evidence-first flow) **and** `steering/kane-cli-first-run.md` β†’ The first result | @@ -58,6 +59,7 @@ The canonical skill is a thin `SKILL.md` (7 sections, ~300 lines) plus on-demand | `references/fair-evaluation.md` β€” like-for-like lifecycle comparison method, mandatory corrections (replay is zero-LLM, the "scripts already exist" sunk-cost trap, phase mismatch), maintenance-dominates-at-scale, what Kane CLI is purpose-built for | All of `steering/kane-cli-fair-evaluation.md` | | `references/assurance.md` β€” the assurance journey (ingest/extract β†’ review checkpoints β†’ design β†’ author β†’ cover β†’ reconcile), pause loop, trust rules, failure table | All of `steering/kane-cli-assurance.md` | | `references/assurance-parsing.md` β€” the assurance NDJSON contract (`--mode agent` envelope, `done` guarantee, `session_paused` shapes, reconcile + coverage event families) | `steering/kane-cli-assurance.md` β†’ the pause-loop and stream notes (condensed; the full schema stays canonical in the skill reference) | +| `references/bugs.md`: bug memory (`BUG-` refs, what the next diagnosis reads), `kane-cli bugs list\|show\|mark\|note\|duplicate\|retire`, project and test resolution, who feedback counts as (`--agent`, one vote per person), statuses, the one-line output, error codes, the RCA flow | All of `steering/kane-cli-bugs.md` **and** `POWER.md` β†’ Steering files + Command reference (the four common `bugs` lines) **and** a one-line pointer in `steering/kane-cli-testmd.md` β†’ Recovering replay failures | | `references/mobile.md`: mobile availability (local = macOS Apple Silicon; cloud grid = any machine), the `--target` axis (desktop default / `emulator` = Android / `simulator` = iOS), `--device-name` / `--os-version` / `--app` selection, the required app-under-test formats, setup plus `doctor` / `devices list`, the flat `_test.md` `target:` + `app:` (+ `device_name:`/`os_version:`) keys, mobile members in `testrun` and `testrun run --remote`, and the web-only checkpoint carve-out | All of `steering/kane-cli-mobile.md` | ## Kiro-specific framing (don't lose these on edit) @@ -130,7 +132,7 @@ Before committing changes to the integration: - [ ] `keywords` still activates on common user phrasing (browser, smoke test, deploy, verify, e2e, ui). - [ ] Every fact in POWER.md / steering / hook can be traced back to a line in `SKILL.md`. - [ ] Onboarding steps still produce the target end state (`kane-cli --version`, `kane-cli whoami`, `kane-cli config show`). -- [ ] Steering files are named `kane-cli-run.md` / `kane-cli-testmd.md` (Kiro convention `{tool}-{workflow}.md`). +- [ ] Steering files are named `kane-cli-.md` (`kane-cli-run.md`, `kane-cli-testmd.md`, `kane-cli-bugs.md`, …; Kiro convention `{tool}-{workflow}.md`). - [ ] Steering files do **not** have `inclusion:` frontmatter (that's for workspace `.kiro/steering/` files, not in-power steering). - [ ] POWER.md explicitly tells Kiro when to load each steering file. - [ ] POWER.md has a `# License and support` section naming Apache-2.0 and at least one support link (see Kiro-specific framing #9 β€” required by power review, has no `SKILL.md` source). diff --git a/integrations/kiro-powers/POWER.md b/integrations/kiro-powers/POWER.md index 2a8cb95..13e47bc 100644 --- a/integrations/kiro-powers/POWER.md +++ b/integrations/kiro-powers/POWER.md @@ -315,6 +315,7 @@ When the user's task makes one of these patterns relevant, load the matching ste - **`steering/kane-cli-mobile.md`**: any time the user wants to drive a **native mobile app** (Android or iOS) instead of the browser β€” locally on **macOS Apple Silicon**, or on the **cloud grid from any machine**. Covers the `--target desktop|emulator|simulator` axis (desktop / browser stays the default), selecting a device (`--device-name` + `--os-version`, `kane-cli devices list [--remote]`) and the required app under test (`--app `, `kane-cli apps list`), one-time local setup (Xcode / Android Studio plus `kane-cli doctor --target … --install`), the flat `_test.md` `target:` + `app:` (+ `device_name:`/`os_version:`) frontmatter keys, mobile members in `kane-cli testrun`, and `testrun run --remote` β€” the grid rules (one platform per job; simulator `.zip` builds auto-upload on real runs, or use uploaded `APP…` ids) and its preflight codes. - **`steering/kane-cli-testmd.md`** β€” any time the user wants a committable test, or is reading / editing / running a `_test.md` file. Covers the `kane-cli testmd` commands, `_test.md` file format and frontmatter (including `tags:`), `@import` composition, the replay-vs-author cache model, `Result.md`, lock conflicts, and CI patterns. - **`steering/kane-cli-testrun.md`** β€” any time the user wants to run **several** saved `_test.md` tests as one batch ("run the suite", "run all the smoke tests", "nightly regression"), or asks about evidence packs (viewing, sharing, validating a run's `.evidence` file). Covers `kane-cli testrun run` (selection by paths / `--match` / `--tags`, preflight, `--parallel`, `--dry-run`), its typed NDJSON events, exit codes, and the `kane-cli evidence` commands. +- **`steering/kane-cli-bugs.md`**: a saved `_test.md` test failed and you are diagnosing it, the user asks about known bugs (a ref like `BUG-12`), or a failure's diagnosis is wrong and needs correcting. Covers bug memory (how a failed test's diagnosis is remembered as `BUG-` and read by the next one), `kane-cli bugs list|show|mark|note|duplicate|retire`, who feedback counts as (`--agent`), its one-line output and errors, and the after-a-failure flow. Needs the Kane CLI release that ships `kane-cli bugs`. - Test cases or scenarios **written** (no browser action) β†’ **`steering/kane-cli-assurance.md`**: a requirement document, or a chat description written to `requirements/.md`, is ingested and designed from; no other authoring path exists. - **`steering/kane-cli-fair-evaluation.md`** β€” any time the user asks you to compare, evaluate, benchmark, or justify Kane CLI against another tool or approach (cost, tokens, effort, ROI). Covers the like-for-like lifecycle comparison method (Kane authoring vs the alternative's script *creation*; replay vs execution; plus locator-break repair and ongoing maintenance), the common comparison traps, and what Kane CLI is purpose-built for. - **`steering/kane-cli-assurance.md`** β€” any time the user has **requirement documents** (a PRD, a spec, acceptance notes) and wants tests designed from them, coverage accounting ("what exactly is covered?"), or the suite reconciled after a requirements change. Covers the assurance journey (`context ingest`/`extract` β†’ review β†’ `design tests` β†’ author β†’ `testrun` β†’ `cover`), the pause loop (`--mode agent`, exit 3 = resumable), the review checkpoints, and `maintain reconcile`. @@ -364,6 +365,12 @@ kane-cli config set-bug-detection kane-cli config chrome-profile kane-cli feedback --test-id --feedback-type --details "..." +# Known bugs a failed test hit, and feedback on them (the release that ships `kane-cli bugs`) +kane-cli bugs list _test.md --agent # the bugs this test has hit +kane-cli bugs show BUG-12 --agent # card, status, votes, feedback with ids +kane-cli bugs mark BUG-12 rca-wrong --agent # real | not-real | rca-right | rca-wrong | done | not-a-bug | reopen +kane-cli bugs note BUG-12 "" --agent # the next diagnosis reads the latest note + # Batch runs β€” many _test.md files, one execution, one evidence pack kane-cli testrun run [paths...] [--match ] [--tags ] [--parallel ] [--dry-run] < /dev/null diff --git a/integrations/kiro-powers/steering/kane-cli-bugs.md b/integrations/kiro-powers/steering/kane-cli-bugs.md new file mode 100644 index 0000000..1bc1903 --- /dev/null +++ b/integrations/kiro-powers/steering/kane-cli-bugs.md @@ -0,0 +1,76 @@ +# Kane CLI β€” `kane-cli bugs` steering + +Load this file when a saved `_test.md` test failed and you are diagnosing it, when the user asks about known bugs (a ref like `BUG-12`), or when a failure's diagnosis is wrong and needs correcting. + +**Version.** Needs the Kane CLI release that ships `kane-cli bugs`. If `bugs` is an unknown command, the installed build predates it: say so and go on without it. + +# What bug memory is + +When a saved test fails, Kane CLI's failure diagnosis (the RCA) works out why, and the diagnosis is uploaded with the run's evidence. Kane CLI remembers each distinct **application bug** it finds, folds repeat sightings of the same bug together, and gives each one a ref that is unique within the project: `BUG-12`. A bug has a card (title, root cause, page, error signature), a status, and the runs it was seen in. + +When a later run fails on the same page, its diagnosis is told about the known bugs there: their status, their votes, and the latest note. It links the run to one of them only when this run's own evidence shows the same defect. Feedback from people and agents is how that memory gets sharper, and the next diagnosis reads it. + +# Commands + +| Command | What it does | +|---|---| +| `kane-cli bugs list _test.md --agent` | The bugs this test has hit (its Test Manager test case) | +| `kane-cli bugs list --testcase --agent` | The bugs a Test Manager test case has hit, without a local file | +| `kane-cli bugs list [--status ] [--all-families] [--limit ] --agent` | No test and no `--testcase`: the project's bugs | +| `kane-cli bugs show BUG-12 --agent` | The card, status, votes, the runs it was seen in, and every live piece of feedback with its id | +| `kane-cli bugs mark BUG-12 real` \| `not-real` `--agent` | Is this a real product bug? (a vote) | +| `kane-cli bugs mark BUG-12 rca-right` \| `rca-wrong` `--agent` | Is the recorded root cause right? (a vote) | +| `kane-cli bugs mark BUG-12 done` \| `not-a-bug` \| `reopen` `--agent` | A ruling: fixed, a false alarm, or back to open | +| `kane-cli bugs note BUG-12 "" --agent` | Free text; the next diagnosis reads the latest note | +| `kane-cli bugs duplicate BUG-12 --of BUG-9 --agent` | BUG-12 is the same bug as BUG-9: merges 12 into 9. No confirmation | +| `kane-cli bugs retire --agent` | Take back a vote or note you gave (the id is in the `mark`/`note` output and in `show`) | +| `kane-cli bugs list --category "" --agent` | Only bugs given this RCA category (built-in or the organisation's) | +| `kane-cli bugs categories list\|show\|add\|edit\|remove --agent` | The RCA categories: the organisation's first, then the built-in ones (read-only); add, edit and remove change the organisation's | + +- `BUG-12`, `bug-12` and `12` all mean BUG-12. +- `--status` takes a comma-separated list of `open`, `confirmed`, `done`, `regressed`, `not_a_bug`, `contested`, `merged`. `--limit` is 1-200, default 50. `--all-families` lists every kind of failure the diagnosis recorded, not only application bugs. +- Every subcommand takes `--project `, `--profile `, `--env `, `--username `, `--access-key ` and `--agent`. +- **Project:** `--project`, else the test.md's own, else the folder's linked project, else the profile's (`kane-cli config project `). +- **Test:** `bugs list _test.md` needs the test to have a Test Manager test case, which it gets the first time it runs with an upload. Otherwise pass `--testcase `. + +- **RCA categories:** the diagnosis prefers one of the organisation's own categories whose description fits, else a built-in one. Change the organisation's list only when the user asks (it needs org admin or the Product Preferences permission, and applies to everyone's next runs). A category never decides which bug a failure joins, and a bug keeps the category of the run that first found it, so one recorded before a category existed never takes it on. + +# Who the feedback counts as + +- Feedback is the signed-in user's, and it moves the bug's status for the whole project. +- With `--agent` it is recorded as the agent's, made under the signed-in user, and it counts the same as a person's. Always pass `--agent` for your own marks. +- One vote per person: the user and the agent working as them share one `real`/`not-real` vote and one `rca-right`/`rca-wrong` vote, and the latest wins. +- Only the person who gave feedback (or the agent working as them) can retire it. + +Statuses: `open` (new, or votes not net positive; `disputed` when more say it is not real), `confirmed` (more `real` than `not-real`), `done` (ruled fixed), `regressed` (ruled done, then seen again), `not_a_bug` (ruled a false alarm), `contested` (ruled not a bug, then hit again by several different tests), `merged`. The latest ruling wins; `reopen` drops back to the votes. + +# Output + +With `--agent` every command prints one JSON line: `{"ok":true,…}` on success, `{"ok":false,"error":"","message":"…"}` on a refusal. `list` carries `bugs[]` (`ref`, `status`, `votes`, `rca_votes`, `title`, `root_cause`, `page_pattern`, `occurrences`, `testcases`, `last_seen_at`) and `has_more`; `show` carries `bug`, `occurrences[]` and `feedback[]` (each with `id`, `type`, `value` or `text`, `author_kind` `user` or `agent`); `mark` and `note` carry `ref`, `feedback_id` and the new `status`; `duplicate` adds `merged` and `merged_into` (`"merged":false` means it was recorded as a suggestion only); `retire` carries `feedback_id` and `retired`. Exit `0` done, `1` any refusal. Never show these field names to the user. + +| `error` | What to do | +|---|---| +| `NOT_FOUND` | An unknown ref: pick one from the refs the message lists. On `retire`: the id is wrong, or the feedback is not the user's | +| `NO_TESTCASE` | The test has no Test Manager test case yet: run it once with an upload, or pass `--testcase ` | +| `NO_PROJECT` | Pass `--project ` | +| `NOT_ENABLED` | `the bug store is not enabled on this controller`: bug memory is not available in this environment yet. Tell the user in one line and go on without it | +| `UNAUTHORIZED` | The user signs in with `kane-cli login` (never ask for keys in chat) | +| `NETWORK` / `NOT_READY` / `CONFLICT` | Retry shortly (for `NETWORK`, check `--env`) | +| `CYCLE` | The merge would loop | +| `INVALID` | Fix the call as the message says | +| `BUILTIN_READ_ONLY` / `FORBIDDEN` / `DUPLICATE_NAME` / `AMBIGUOUS` | Categories: built-in ones are read-only; the user lacks the permission; the name is taken; the name matches several (use an id from the message) | + +# After a saved test fails + +1. Read the failure as usual (the `kane-cli-run` steering file, Failure handling), including the diagnosis in the evidence pack. +2. `kane-cli bugs list _test.md --agent`: what this test has hit before. A known bug that matches is context, not a new finding: name its ref in the failure card. +3. `kane-cli bugs show BUG-n --agent` for the one that matches. +4. Correct the record from **this run's evidence** (screenshot, console, network), never from a guess: + - A genuine product bug β†’ `mark BUG-n real`; a test or environment problem β†’ `mark BUG-n not-real`. + - The recorded root cause is wrong β†’ `mark BUG-n rca-wrong`, then `note BUG-n ""`. The next diagnosis then works from its own evidence. It is right β†’ `rca-right`. + - Narrowed it down β†’ `note`. Two refs are the same bug β†’ `duplicate BUG-12 --of BUG-9`. +5. Tell the user in one line what you marked and why. A wrong mark: `retire `. + +The next diagnosis reads rulings: a recalled `done` bug seen again is reported as a regression; for a `not_a_bug` one it reports a product bug only when the run's evidence clearly shows the product broken. + +Rulings (`done`, `not-a-bug`, `reopen`) and merges change the bug for everyone in the project: make them when the user says so, or when the evidence is unambiguous. diff --git a/integrations/kiro-powers/steering/kane-cli-run.md b/integrations/kiro-powers/steering/kane-cli-run.md index 3c597db..bc44a3a 100644 --- a/integrations/kiro-powers/steering/kane-cli-run.md +++ b/integrations/kiro-powers/steering/kane-cli-run.md @@ -615,6 +615,8 @@ tests// Offer the visual route: `kane-cli evidence serve ` starts a local-only server and prints a hosted-viewer link. After agent-mode runs, Kane CLI prints a stderr hint line (`` evidence: view locally with `kane-cli evidence serve ` ``) β€” it is plain text on stderr, never a stdout event. If a pack won't open, `kane-cli evidence validate ` reports whether it's truncated/unsealed. Full evidence + testrun surface: load **`kane-cli-testrun`** steering. +**Known bugs.** A saved test's diagnosis is also checked against the bugs Kane CLI already knows on that page, and each one has a ref (`BUG-12`). `kane-cli bugs list _test.md --agent` shows what the test has hit before; when the diagnosis got it wrong, correct it with `kane-cli bugs mark … rca-wrong` and a `note` so the next one starts from its own evidence. Load **`kane-cli-bugs`** steering. + ## Common failure patterns | Symptom | Likely cause | Fix | diff --git a/integrations/kiro-powers/steering/kane-cli-testmd.md b/integrations/kiro-powers/steering/kane-cli-testmd.md index c236cb5..61b6095 100644 --- a/integrations/kiro-powers/steering/kane-cli-testmd.md +++ b/integrations/kiro-powers/steering/kane-cli-testmd.md @@ -321,7 +321,7 @@ A replay can fail when the site shifts under you: - **Adaptive healing** β€” enabled by default: three shrinking replay windows, then re-author authorable steps. Use `--no-adaptive-heal` to disable it. -Every failed replay is also **investigated automatically** β€” a failure record (error, page state, console/network pointers) is written into the run's evidence pack, so you can explain *why* the replay broke. +Every failed replay is also **investigated automatically** β€” a failure record (error, page state, console/network pointers) is written into the run's evidence pack, so you can explain *why* the replay broke. The diagnosis also remembers the application bugs it finds as `BUG-` refs; to see the bugs a test has hit and correct a wrong diagnosis, load the `kane-cli-bugs` steering file. ## Replays are self-sufficient diff --git a/skill-installer/skills/SKILL.md b/skill-installer/skills/SKILL.md index c0d72be..4009520 100644 --- a/skill-installer/skills/SKILL.md +++ b/skill-installer/skills/SKILL.md @@ -1,6 +1,6 @@ --- name: kane-cli -description: "End-to-end (E2E) tests, regression checks, and smoke tests with KaneCLI. Use after changing a web or mobile app to verify the feature works and test the flow, or for any task needing a real browser or mobile app: navigation, clicks, forms, UI checks, screenshots, deploy verification. Generate E2E tests from a PRD, spec, or description via the assurance commands (use-cases, acceptance criteria, scenarios, runnable _test.md tests); never hand-write Kane test cases. Run on desktop web (Chrome by default), Android and iOS: emulator/simulator locally on macOS Apple Silicon or via testrun run --remote, and real cloud devices (--target android|ios). Prove coverage with evidence packs and kane-cli cover; gate CI by judging a pack against a policy (kane-cli evidence verdict, --policy). Work in a shared Test Manager project (link a folder with --project). Parse NDJSON output and inspect logs. Share the assurance store (.context/) via GitHub, S3, or a folder with kane-cli context sync." +description: "End-to-end (E2E) tests, regression checks, and smoke tests with KaneCLI. Use after changing a web or mobile app to verify the feature works and test the flow, or for any task needing a real browser or mobile app: navigation, clicks, forms, UI checks, screenshots, deploy verification. Generate E2E tests from a PRD, spec, or description via the assurance commands (use-cases, acceptance criteria, scenarios, runnable _test.md tests); never hand-write Kane test cases. Run on desktop web (Chrome by default), Android and iOS: emulator/simulator locally on macOS Apple Silicon or via testrun run --remote, and real cloud devices (--target android|ios). Prove coverage with evidence packs and kane-cli cover; gate CI by judging a pack against a policy (kane-cli evidence verdict, --policy). Work in a shared Test Manager project (link a folder with --project). Parse NDJSON output, inspect logs, and mark known bugs (kane-cli bugs). Share the assurance store (.context/) via GitHub, S3, or a folder with kane-cli context sync." --- # Kane CLI β€” End-to-End Test Generation and Execution Skill @@ -148,7 +148,7 @@ For exit code 1 (or `status: "failed"` in `run_end`), present the failure card. | ➑️ **Next** | Β· | ``` -The failing step's screenshot lives inside the run's evidence pack (the stderr hint names the pack path): extract it with `unzip "tests/*/steps/*/screenshot.png" -d `, Read it, and show it **under** the card. For the pack layout and deeper diagnosis, see `references/debug.md`. +The failing step's screenshot lives inside the run's evidence pack (the stderr hint names the pack path): extract it with `unzip "tests/*/steps/*/screenshot.png" -d `, Read it, and show it **under** the card. For the pack layout and deeper diagnosis, see `references/debug.md`. A saved test that failed may have hit a bug kane-cli already knows: `kane-cli bugs list _test.md --agent` names it, and your marks and notes shape the next diagnosis (`references/bugs.md`). Exit code 2 with no progress events means nothing ran: that is a `🟑 Didn't start` card, not a failure (`references/cards.md` Β§4). If progress events came before it, steps ran and the run stopped without a result: say so, and use the stopped-early card (`references/cards.md` Β§5). @@ -190,6 +190,7 @@ When the user's request involves a browser β€” or writing test cases: - View, share, or validate run evidence (`.evidence` packs) β†’ Read `references/evidence.md` - Judge a run or pack against quality gates (a policy YAML, `--policy`, `--policy-id`, `kane-cli evidence verdict`, `kane-cli policy …`), or gate CI on more than pass/fail β†’ Read `references/policy.md` first (after 0.10.0-rc.3) - Debug a failed run β†’ Read `references/debug.md` +- A saved test failed and you want the bugs it hit before, the person asks about known bugs (`BUG-12`), a failure's diagnosis (RCA) is wrong and needs correcting, or the person wants to see or manage the organisation's RCA categories β†’ Read `references/bugs.md` (`kane-cli bugs`, the release that ships it) - Configure kane-cli or check directory layout β†’ Read `references/setup-and-config.md` - The person asks to make kane-cli the default for this project or their team ("always use kane for E2E here", "add kane to CLAUDE.md / AGENTS.md") β†’ Read `references/setup-and-config.md` Β§Make kane-cli the default in a project. Only when asked, and ask before writing - Browse / create / pick a Test Manager project or folder for `kane-cli run`, or interpret the auto-default event β†’ Read `references/test-manager.md`. Linking an assurance folder to a project is different: `references/shared-projects.md` Β§2–3 @@ -383,6 +384,7 @@ A draft in chat cannot be run, and a hand-written `_test.md` carries no requirem | Need the assurance NDJSON event schema (`--mode agent`) | `references/assurance-parsing.md` | | Share the context store with a team, join one, keep stores level, or resolve a sync conflict (kane-cli 0.8.14+) | `references/context-sync.md` | | Run failed, need to diagnose | `references/debug.md` | +| Known bugs a test hit, or correcting a failure's diagnosis (`kane-cli bugs list\|show\|mark\|note\|duplicate\|retire\|categories`) | `references/bugs.md` | | View, share, validate, or merge evidence packs | `references/evidence.md` | | Judge a pack against a policy, run with `--policy`, or store/list policies in Test Manager | `references/policy.md` | | Multiple independent browser tasks | `references/parallel.md` | diff --git a/skill-installer/skills/references/bugs.md b/skill-installer/skills/references/bugs.md new file mode 100644 index 0000000..f620d69 --- /dev/null +++ b/skill-installer/skills/references/bugs.md @@ -0,0 +1,118 @@ + + +# Bugs β€” Agent Surface + +**Version.** Needs the kane-cli release that ships `kane-cli bugs`. If `bugs` is an unknown command, the installed build predates it: say so and go on without it. + +When a saved test fails, kane-cli's failure diagnosis (the RCA) works out why, and the diagnosis is uploaded with the run's evidence. kane-cli remembers each distinct **application bug** it finds, folds repeat sightings of the same bug together, and gives each one a ref that is unique within the project: `BUG-12`. A bug has a card (title, root cause, page, error signature), a status, and the runs it was seen in. + +When a later run fails on the same page, its diagnosis is told about the known bugs there: their status, their votes, and the latest note. It links the run to one of them only when this run's own evidence shows the same defect. **Feedback is how that memory gets sharper**: say what is real, say when a recorded root cause is wrong, and leave a note with what you learned. The next diagnosis reads it. + +## 1. Commands + +| Command | What it does | +|---|---| +| `kane-cli bugs list _test.md --agent` | The bugs this test has hit (its Test Manager test case) | +| `kane-cli bugs list --testcase --agent` | The bugs a Test Manager test case has hit, without a local file | +| `kane-cli bugs list [--status ] [--all-families] [--limit ] --agent` | No test and no `--testcase`: the project's bugs | +| `kane-cli bugs show BUG-12 --agent` | The card, status, votes, the runs it was seen in, and every live piece of feedback with its id | +| `kane-cli bugs mark BUG-12 real` \| `not-real` `--agent` | Is this a real product bug? (a vote) | +| `kane-cli bugs mark BUG-12 rca-right` \| `rca-wrong` `--agent` | Is the recorded root cause right? (a vote) | +| `kane-cli bugs mark BUG-12 done` \| `not-a-bug` \| `reopen` `--agent` | A ruling: fixed, a false alarm, or back to open | +| `kane-cli bugs note BUG-12 "" --agent` | Free text; the next diagnosis reads the latest note | +| `kane-cli bugs duplicate BUG-12 --of BUG-9 --agent` | BUG-12 is the same bug as BUG-9: merges 12 into 9. No confirmation | +| `kane-cli bugs retire --agent` | Take back a vote or note you gave (the id is in the `mark`/`note` output and in `show`) | +| `kane-cli bugs list --category "" --agent` | Only bugs given this RCA category (built-in or the organisation's); spans every family | +| `kane-cli bugs categories list [--source builtin\|org] [--status active\|inactive] --agent` | Every RCA category: the organisation's first, then the built-in ones; `agent_uses` says which the diagnosis picks from | +| `kane-cli bugs categories show "" --agent` | One category | +| `kane-cli bugs categories add --name "" --description "" [--inactive] --agent` | Add one of the organisation's | +| `kane-cli bugs categories edit "" [--name] [--description] [--status active\|inactive] --agent` | Change one of the organisation's | +| `kane-cli bugs categories remove "" --agent` | Remove one of the organisation's (no question under `--agent`; on a terminal it asks unless `--yes`) | + +- **Refs.** `BUG-12`, `bug-12` and `12` all mean BUG-12. +- **`--status`** takes a comma-separated list of `open`, `confirmed`, `done`, `regressed`, `not_a_bug`, `contested`, `merged` (`not-a-bug` also works). **`--limit`** is 1-200, default 50. **`--all-families`** lists every kind of failure the diagnosis recorded, not only application bugs. +- **Every subcommand** takes `--project `, `--profile `, `--env `, `--username `, `--access-key ` and `--agent`. + +**Which project.** `--project`, else the test.md's own project, else the folder's linked project, else the profile's (`kane-cli config project `). With none: `NO_PROJECT`. + +**RCA categories.** Every failure gets one category. The diagnosis prefers one of the organisation's own (Org Preferences β†’ Automatic AI RCA) whose description fits, else the closest built-in one; the family (product, test or environment fault) is still decided separately. Name a category by its name (any case) or id. Built-in ones are read-only. An organisation category's id is `custom:`: a failure records it as `/custom:` with its name beside it, and a failed step's reason names it. Changing the organisation's list applies to everyone's next runs, and adding, editing or removing needs org admin or the Product Preferences permission: do it only when the person asks. A category never decides which bug a failure joins, and **a bug keeps the category of the run that first found it**: one recorded before a category existed never takes it on, so `--category` doesn't list it. That is expected, not a fault. + +**Which test.** `bugs list _test.md` needs the test to have a Test Manager test case, which it gets the first time it runs with an upload. A test that never uploaded refuses with `NO_TESTCASE`: run it once, or pass `--testcase `. + +## 2. Who the feedback counts as + +- Feedback is the signed-in user's, and it moves the bug's status for the whole project. +- **With `--agent`** it is recorded as the agent's, made under the signed-in user, and it counts the same as a person's. Always pass `--agent` for your own marks, so a person reading the bug can tell yours from theirs. Without `--agent` but with no terminal, the output is still one JSON line, yet the mark is recorded as the person's. +- **One vote per person.** A person and the agent working as them share one `real`/`not-real` vote and one `rca-right`/`rca-wrong` vote; the latest wins. Marking again changes the vote, it does not add one. +- Only the person who gave feedback (or the agent working as them) can retire it. Another person's feedback refuses with `NOT_FOUND`. + +**How the status moves.** + +| Status | When | +|---|---| +| `open` | New, or the real-bug votes are not net positive. Shown as `open (disputed)` when more people say it is not real | +| `confirmed` | More `real` than `not-real` votes | +| `done` | Ruled fixed with `mark done` | +| `regressed` | Ruled `done`, then seen again in a later run | +| `not_a_bug` | Ruled a false alarm with `mark not-a-bug` | +| `contested` | Ruled `not_a_bug`, then hit again by several different tests | +| `merged` | Merged into another bug with `duplicate` | + +The latest ruling wins; `mark reopen` drops back to the votes. + +## 3. Output (one JSON line with `--agent`) + +``` +bugs list {"ok":true,"project_id":"","testcase_id":"","bugs":[{"ref":"BUG-12","status":"open","votes":1,"rca_votes":-1,"title":"…","root_cause":"…","page_pattern":"/cart","occurrences":3,"testcases":2,"last_seen_at":"…"}],"has_more":false} +bugs show {"ok":true,"bug":{"ref":"BUG-12","status":"open","card":{"title":"…","root_cause":"…","page_pattern":"/cart","error_signature":"…"},"occurrence_count":3,"testcase_count":2,"votes":1,"rca_votes":-1,…},"occurrences":[{"evidence_id":"…","seen_at":"…",…}],"feedback":[{"id":"","type":"vote_rca","value":"-1","author_kind":"agent","created_at":"…"},{"id":"","type":"note","text":"…","author_kind":"user",…}]} +bugs mark {"ok":true,"ref":"BUG-12","feedback_id":"","status":"confirmed"} +bugs note {"ok":true,"ref":"BUG-12","feedback_id":"","status":"open"} +bugs duplicate {"ok":true,"ref":"BUG-12","feedback_id":"","status":"merged","of":"BUG-9","merged":true,"merged_into":"BUG-9"} +bugs retire {"ok":true,"feedback_id":"","retired":true,"status":"open"} +refusal {"ok":false,"error":"NOT_FOUND","message":"BUG-99 is not a bug in project . This project's bugs: BUG-12, BUG-14"} +``` + +- `testcase_id` appears only when the list is for one test. `votes` and `rca_votes` are net counts and appear only when known; `disputed: true` appears only when set. +- A bug's feedback `type` is `vote_real` / `vote_rca` (value `1` or `-1`), `note`, `done`, `not_a_bug`, `reopen` or `duplicate_of`; `author_kind` is `user` or `agent`. +- `duplicate` with `"merged":false` was recorded as a suggestion only; the bugs were not merged. +- On a terminal the same commands print a table (`REF STATUS VOTES TITLE OCCURRENCES`) or plain lines. + +**Exit codes.** `0` done Β· `1` any refusal. + +## 4. Errors and how to recover + +| `error` | Meaning β†’ what to do | +|---|---| +| `NOT_FOUND` | An unknown ref: pick one from the refs the message lists. On `retire`: the id is wrong, or the feedback is not yours | +| `NO_TESTCASE` | The test.md has no Test Manager test case yet: run it once with an upload, or pass `--testcase ` | +| `NO_PROJECT` | Pass `--project `, run in a linked folder, or bind one with `kane-cli config project ` | +| `NOT_ENABLED` | `the bug store is not enabled on this controller`: bug memory is not available in this environment yet. Tell the person in one line and go on without it | +| `UNAUTHORIZED` | Sign-in: the person runs `kane-cli login` (never ask for keys in chat) | +| `NETWORK` | No answer: check the connection or `--env`, then retry | +| `NOT_READY` | Retry in a minute | +| `CYCLE` | The merge would loop (BUG-9 is already merged into BUG-12) | +| `INVALID` | A bad argument (an unknown mark, an empty note, `--limit` out of range, a bug as a duplicate of itself, a test.md that does not exist): fix the call as the message says | +| `CONFLICT` | Someone changed the bug at the same moment: retry | +| `BUILTIN_READ_ONLY` | A built-in category can't be edited or removed: add the organisation's own instead | +| `FORBIDDEN` | The person can't change categories: an org admin, or a role with the Product Preferences permission, must | +| `DUPLICATE_NAME` | Another category has that name: pick another, or edit that one | +| `AMBIGUOUS` | The name matches more than one category: use one of the ids the message lists | +| `NOT_SUPPORTED` | This controller has no category routes yet: tell the person in one line and go on | + +## 5. In an RCA flow + +After a saved test fails (`testmd run`, or a member of `testrun run`): + +1. Read the failure as usual (`references/debug.md`), including the diagnosis in the evidence pack. +2. `kane-cli bugs list _test.md --agent`: what this test has hit before. A known bug that matches this failure is context, not a new finding: name its ref in the failure card's πŸ” row. +3. `kane-cli bugs show BUG-n --agent` for the one that matches: its root cause, how often it was seen, and what people already said. +4. Correct the record from **this run's evidence** (screenshot, console, network), never from a guess: + - A genuine product bug β†’ `mark BUG-n real`. A test or environment problem β†’ `mark BUG-n not-real`. + - The recorded root cause does not match what you see β†’ `mark BUG-n rca-wrong`, then `note BUG-n ""`. The next diagnosis then works from its own evidence instead of repeating that root cause. It matches β†’ `mark BUG-n rca-right`. + - You narrowed it down ("500 only when the cart already has items; an empty cart works") β†’ `note`. + - Two refs are the same bug β†’ `duplicate BUG-12 --of BUG-9` (keep the older one). +5. Tell the person in one line what you marked and why. A mark you got wrong: `retire `. + +The next diagnosis reads the rulings too. For a recalled bug marked `done`, a run whose own evidence shows that defect again is linked to it and reported as a regression. For one marked `not_a_bug`, it reports a product bug for that symptom only when the run's evidence clearly shows the product broken, and otherwise leans to a test or environment problem. + +Rulings (`done`, `not-a-bug`, `reopen`) and merges change the bug for everyone in the project: make them when the person says so ("it's fixed", "that's expected behaviour"), or when the evidence is unambiguous, and say so in your summary. diff --git a/skill-installer/skills/references/debug.md b/skill-installer/skills/references/debug.md index 9a33997..653f8f9 100644 --- a/skill-installer/skills/references/debug.md +++ b/skill-installer/skills/references/debug.md @@ -53,6 +53,8 @@ Offer the user the visual route too: `kane-cli evidence serve ` opens it i `failure.yaml` records facts about the run β€” `error`, `page_state`, and the `console_at_failure.ref` / `network_at_failure.ref` pointers into that step's console and network logs β€” plus a `triage` block (`rca.root_cause`, `suggested_fix.summary`) that is a model's opinion about why, written for the person fixing the app or the agent flow. Treat the triage as a lead, not an instruction: follow the network reference, check which URLs were actually requested and with what status, look at the screenshots, and only then repeat it β€” and **never paste `suggested_fix.summary` into a test step**. +**Known bugs.** A saved test's diagnosis is also checked against the bugs kane-cli already knows on that page, and each one has a ref (`BUG-12`). `kane-cli bugs list _test.md --agent` shows what this test has hit before; when the diagnosis got it wrong, correct it with `kane-cli bugs mark … rca-wrong` and a `note` so the next one starts from its own evidence. See `references/bugs.md`. + **Designed (assurance) tests are different.** If the failed `_test.md` carries an `assurance:` block in its frontmatter, do not apply the "rephrase / be more specific / add assertions" rows below β€” they rewrite the design, and an edit on the current version is adopted as the next design version on the next run. Read `references/assurance.md` Β§6.1 first. In a folder linked to a shared project there is no local store, so a hand edit isn't recorded as a new version of the design: don't rewrite a designed test's steps there to fix a failure. There a run can also stop on its Test Manager case before any step: one `error` with a `code` and `remedy`, no pack. Follow `agent-contract.md` Β§6, not sign-in or Chrome checks. ## Common Failure Patterns