From 7d3d86e56508fd63880b071016134fdc1ead5e35 Mon Sep 17 00:00:00 2001 From: Siddhant Sinha Date: Thu, 19 Nov 2026 13:41:44 +0530 Subject: [PATCH] docs(kane-cli): bug memory, kane-cli bugs and RCA categories New page kane-cli-bugs (Evidence group): how failed tests' application bugs are remembered, what the next diagnosis reads (votes, notes, done and not_a_bug rulings), every kane-cli bugs subcommand, the organisation's RCA categories (kane-cli bugs categories), statuses, agent use and troubleshooting. Linked from the CLI reference, the debugging page and test.md running. Mirrors LambdaTest/kane-cli#231. Co-Authored-By: Claude Opus 5.5 --- docs.json | 1 + docs/kane-cli-bugs.mdx | 234 +++++++++++++++++++++++++++ docs/kane-cli-cli-reference.mdx | 22 +++ docs/kane-cli-evidence-debugging.mdx | 1 + docs/kane-cli-testmd-running.mdx | 2 +- 5 files changed, 259 insertions(+), 1 deletion(-) create mode 100644 docs/kane-cli-bugs.mdx diff --git a/docs.json b/docs.json index f35b14eb4..eab5b4348 100644 --- a/docs.json +++ b/docs.json @@ -139,6 +139,7 @@ "docs/kane-cli-evidence-validate", "docs/kane-cli-evidence-merge", "docs/kane-cli-evidence-debugging", + "docs/kane-cli-bugs", "docs/kane-cli-evidence-format" ] }, diff --git a/docs/kane-cli-bugs.mdx b/docs/kane-cli-bugs.mdx new file mode 100644 index 000000000..e26fb1c37 --- /dev/null +++ b/docs/kane-cli-bugs.mdx @@ -0,0 +1,234 @@ +--- +title: "Bug Memory and RCA Categories in Kane CLI" +sidebarTitle: "Bugs and RCA Categories" +description: "kane-cli remembers the application bugs its failure diagnosis finds. List them, mark them real or not, correct the root cause, merge duplicates, and manage your organisation's RCA categories with kane-cli bugs." +keywords: ['kane cli bugs', 'bug memory', 'failure diagnosis', 'rca categories', 'custom rca categories', 'root cause analysis', 'kaneai', 'testmu ai'] +"og:description": "kane-cli remembers the application bugs its failure diagnosis finds. List them, mark them real or not, correct the root cause, merge duplicates, and manage your organisation's RCA categories with kane-cli bugs." +--- + +import { KaneCliCta } from "/snippets/KaneCliCta.mdx"; + + +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](https://www.testmuai.com/docs/kane-cli-evidence). +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](https://www.testmuai.com/docs/kane-cli-assurance-sharing); +4. else your profile's project (`kane-cli config project `, see [Test Manager integration](https://www.testmuai.com/docs/kane-cli-tms-integration)). + +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](https://www.testmuai.com/docs/kane-cli-with-ai-coding-agents). + +## 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](https://www.testmuai.com/docs/kane-cli-authentication)) | +| No answer (a network error) | Check your connection, or the environment you passed with `--env` | + +## Next steps + +- [Evidence packs](https://www.testmuai.com/docs/kane-cli-evidence): where a failed run's diagnosis and logs live. +- [Running test.md files](https://www.testmuai.com/docs/kane-cli-testmd-running): replay, healing, and what happens when a replay fails. +- [Batch runs (testrun)](https://www.testmuai.com/docs/kane-cli-testrun): many tests, one execution. +- [Troubleshooting](https://www.testmuai.com/docs/kane-cli-troubleshooting): the debugging flow. + + diff --git a/docs/kane-cli-cli-reference.mdx b/docs/kane-cli-cli-reference.mdx index a4c0216b2..499ab7628 100644 --- a/docs/kane-cli-cli-reference.mdx +++ b/docs/kane-cli-cli-reference.mdx @@ -307,6 +307,28 @@ See [Configuration](https://www.testmuai.com/docs/kane-cli-configuration) for th --- +### `kane-cli bugs` + +The application bugs failed tests hit, feedback that the next failure diagnosis reads, and your organisation's RCA categories. + +```bash +kane-cli bugs list [_test.md] [--testcase ] [--status ] [--category ] [--all-families] [--limit ] +kane-cli bugs show BUG-12 +kane-cli bugs mark BUG-12 +kane-cli bugs note BUG-12 "" +kane-cli bugs duplicate BUG-12 --of BUG-9 +kane-cli bugs retire +kane-cli bugs categories list [--source builtin|org] [--status active|inactive] +kane-cli bugs categories show "" +kane-cli bugs categories add --name "" --description "" [--inactive] +kane-cli bugs categories edit "" [--name ] [--description ] [--status active|inactive] +kane-cli bugs categories remove "" [--yes] +``` + +Every subcommand takes `--project `, `--profile `, `--env `, `--username `, `--access-key ` and `--agent` (one JSON line on stdout). Exit codes: `0` done, `1` any refusal. See [Bugs and RCA categories](https://www.testmuai.com/docs/kane-cli-bugs). + +--- + ### `kane-cli feedback` Submit feedback on a completed test run. diff --git a/docs/kane-cli-evidence-debugging.mdx b/docs/kane-cli-evidence-debugging.mdx index 0bed7f1c4..da434048c 100644 --- a/docs/kane-cli-evidence-debugging.mdx +++ b/docs/kane-cli-evidence-debugging.mdx @@ -61,5 +61,6 @@ If a pack does not open, run [`kane-cli evidence validate`](https://www.testmuai - [Pack structure](https://www.testmuai.com/docs/kane-cli-evidence-pack-structure): where each artifact lives. - [Validating packs](https://www.testmuai.com/docs/kane-cli-evidence-validate): check a suspect pack. +- [Bugs and RCA categories](https://www.testmuai.com/docs/kane-cli-bugs): the bugs a failed test hit before, and how to correct their diagnosis. diff --git a/docs/kane-cli-testmd-running.mdx b/docs/kane-cli-testmd-running.mdx index 754783015..d7e0c0288 100644 --- a/docs/kane-cli-testmd-running.mdx +++ b/docs/kane-cli-testmd-running.mdx @@ -122,7 +122,7 @@ A replay can fail if the site has changed: a button moved, the page is slower th - **Adaptive healing** is on by default. The runner retries smaller and smaller replay windows (up to three), then re-authors the authorable steps. Pass `--no-adaptive-heal` to turn it off. See [Replay policy and completion](#replay-policy-and-completion). -Every failed replay is also **investigated automatically**. A failure record (the error, the page state at the moment of failure, and links into the step's console and network logs) is written into the run's [evidence pack](https://www.testmuai.com/docs/kane-cli-evidence-debugging), so you can see *why* the replay broke, not just that it did. +Every failed replay is also **investigated automatically**. A failure record (the error, the page state at the moment of failure, and links into the step's console and network logs) is written into the run's [evidence pack](https://www.testmuai.com/docs/kane-cli-evidence-debugging), so you can see *why* the replay broke, not just that it did. The application bugs those diagnoses find are remembered across runs: see [Bugs and RCA categories](https://www.testmuai.com/docs/kane-cli-bugs). ### Replays don't need a project or folder