@capagents/forgeqe 2.6.4 → 2.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/HOW_TO_USE.md +17 -5
  2. package/dist/docs-site/docs/architecture/index.html +2 -2
  3. package/dist/docs-site/docs/guardrails/index.html +20 -4
  4. package/dist/docs-site/docs/index.html +18 -6
  5. package/dist/docs-site/docs/search.js +1 -1
  6. package/dist/docs-site/docs/web-app/index.html +4 -1
  7. package/dist/forgeqe.js +1529 -1516
  8. package/dist/template.html +68 -68
  9. package/dist/web/assets/Agent-DEt3EWA_.js +4 -0
  10. package/dist/web/assets/ApiTests-DYdaFLNz.js +10 -0
  11. package/dist/web/assets/Chat-CKxzWgEC.js +3 -0
  12. package/dist/web/assets/Data-DityccKX.js +3 -0
  13. package/dist/web/assets/Evidence-B-LwSbo6.js +1 -0
  14. package/dist/web/assets/Features-DCT-cbJc.js +1 -0
  15. package/dist/web/assets/Jobs-DeTQrrks.js +5 -0
  16. package/dist/web/assets/KindPage-_X13FTTE.js +6 -0
  17. package/dist/web/assets/Migration-fmIj_G3z.js +2 -0
  18. package/dist/web/assets/Product-D-WBRE7V.js +1 -0
  19. package/dist/web/assets/Quality-CGVs0dP9.js +1 -0
  20. package/dist/web/assets/Record-BxvtM3w6.js +2 -0
  21. package/dist/web/assets/Regression-DMzaMaHl.js +5 -0
  22. package/dist/web/assets/Reports-DcOPRMjx.js +2 -0
  23. package/dist/web/assets/Response-C6MFROng.js +4 -0
  24. package/dist/web/assets/Runs-Bzt7oS2o.js +2 -0
  25. package/dist/web/assets/Shell-C-_iUijV.js +3 -0
  26. package/dist/web/assets/TestCases-COdZhCPY.js +1 -0
  27. package/dist/web/assets/TestData-BorHzvQT.js +2 -0
  28. package/dist/web/assets/WhatsNew-Bc9JhLJC.js +1 -0
  29. package/dist/web/assets/{arrow-down-RIu4BNco.js → arrow-down-OOnlMKAE.js} +1 -1
  30. package/dist/web/assets/{arrow-right-DrTAkvEV.js → arrow-right-B3tcUlkA.js} +1 -1
  31. package/dist/web/assets/circle-8GDOF-jD.js +1 -0
  32. package/dist/web/assets/{circle-dashed-D_uPuLx9.js → circle-dashed-kZh6s667.js} +1 -1
  33. package/dist/web/assets/{circle-dot-BOuBI-n0.js → circle-dot-B5NyEMK3.js} +1 -1
  34. package/dist/web/assets/dataParts-C9gI1SAK.js +3 -0
  35. package/dist/web/assets/index-BxNs3KZC.js +43 -0
  36. package/dist/web/assets/index-o-gUBlx9.css +2 -0
  37. package/dist/web/assets/{keyboard-DEIIhxqf.js → keyboard-Chpodklu.js} +1 -1
  38. package/dist/web/assets/pencil-BKPpdCqf.js +1 -0
  39. package/dist/web/assets/{productParts-DyOA9ubE.js → productParts-RYNeN2sM.js} +1 -1
  40. package/dist/web/assets/qualityParts-BtCR-0Bc.js +1 -0
  41. package/dist/web/assets/thread-BVeiwKSf.js +5 -0
  42. package/dist/web/assets/{upload-DmbJDCcg.js → upload-A3zIIPtY.js} +1 -1
  43. package/dist/web/assets/usePageChat-D-iqArIy.js +1 -0
  44. package/dist/web/index.html +3 -3
  45. package/docs/ARCHITECTURE.md +2 -2
  46. package/docs/WEB_APP.md +4 -1
  47. package/docs/user-guide.html +18 -6
  48. package/forgeqe.example.yaml +7 -1
  49. package/guardrails/README.md +14 -1
  50. package/package.json +1 -1
  51. package/prompts/brain.md +35 -4
  52. package/py/forgeqe_engine/browser.py +78 -0
  53. package/py/forgeqe_engine/service.py +7 -0
  54. package/dist/web/assets/Agent-DEPTD9pN.js +0 -4
  55. package/dist/web/assets/ApiTests-DeW608jq.js +0 -10
  56. package/dist/web/assets/Chat-B8TOp9np.js +0 -3
  57. package/dist/web/assets/Data-CIXhtuw3.js +0 -3
  58. package/dist/web/assets/Evidence-C9qQTyEk.js +0 -1
  59. package/dist/web/assets/Features-B-wMlbqn.js +0 -1
  60. package/dist/web/assets/Jobs-DeX2jmbu.js +0 -5
  61. package/dist/web/assets/KindPage-DBZJP3U-.js +0 -6
  62. package/dist/web/assets/Migration-XZmPunGD.js +0 -2
  63. package/dist/web/assets/Product-Dlk_1xCK.js +0 -1
  64. package/dist/web/assets/Quality-Bal66JLa.js +0 -1
  65. package/dist/web/assets/Record-DWtUcZWt.js +0 -2
  66. package/dist/web/assets/Regression-WZEVTvAn.js +0 -5
  67. package/dist/web/assets/Reports-DJGUcECV.js +0 -2
  68. package/dist/web/assets/Response-FZElpR4y.js +0 -4
  69. package/dist/web/assets/Runs-DV_VCFbw.js +0 -2
  70. package/dist/web/assets/Shell-DrZla-8i.js +0 -3
  71. package/dist/web/assets/TestData-DMyp7DQ6.js +0 -2
  72. package/dist/web/assets/WhatsNew-KBVDRnTD.js +0 -1
  73. package/dist/web/assets/chevron-up-LdVKD-pj.js +0 -1
  74. package/dist/web/assets/circle-Blgfhc1Z.js +0 -1
  75. package/dist/web/assets/dataParts-wYKqjAh3.js +0 -3
  76. package/dist/web/assets/index-BKwsvR1Y.css +0 -2
  77. package/dist/web/assets/index-DarljPXz.js +0 -38
  78. package/dist/web/assets/qualityParts-DhiyeZEy.js +0 -1
  79. package/dist/web/assets/thread-jMTjTeNN.js +0 -5
  80. package/dist/web/assets/usePageChat-BKJalCrm.js +0 -1
package/HOW_TO_USE.md CHANGED
@@ -125,7 +125,7 @@ Everything ForgeQE can do, by area. ForgeQE's agent answers "can you…?" questi
125
125
  | Browser | **Record a web test by hand**: Opens a browser with the Recorder panel docked in the page while the user does the steps of a web test themself, and saves their clicks, typing, choices and keys in order as a run, with the checks, kept values, test data and notes they add; the coding agent then turns it into a test in the repository's framework. | `web_record` | [docs](#recording-a-web-test-by-hand) |
126
126
  | Test cases | **Run manual test cases in browsers**: Reads test cases from Azure DevOps, Jira, Xray, TestRail, Zephyr Scale, qTest, a file, or pasted text, runs each in a real browser with a verdict per step, writes report.html and junit.xml, posts results back, and files or updates bugs for failures. | `find_test_cases`, `run_test_cases` | [docs](#7-test-cases-and-suites) |
127
127
  | Test cases | **Check and improve test cases**: Checks test cases before they run (vague or missing expected results, missing test data, placeholders, duplicates) against the story, feature, and epic they test, then rewrites Azure DevOps or Jira cases in place once the user agrees. | `check_test_cases`, `update_test_case`, `retire_test_case` | [docs](#checking-test-cases-before-they-run) |
128
- | Test cases | **Write test cases from a story**: Writes test cases from a story's acceptance criteria and saves them in Azure DevOps or Jira, linked to the story. Reads the cases already linked first, so asking again adds only what is missing and updates cases in place instead of duplicating them; plans end-to-end journeys from the existing cases. | `story_test_cases`, `save_test_cases`, `link_test_case`, `e2e_journey` | [docs](#where-cases-come-from) |
128
+ | Test cases | **Write test cases from a story**: Writes test cases from an understanding of the feature, not only a story's acceptance criteria: it reads the feature and epic above the story, their other stories, linked Confluence pages, the RAG service, product knowledge, the app's pages and flows in page memory, and the area's past defects (from earlier runs and the tracker's bugs), then analyses each criterion before it designs cases. Each case names what it covers, and nothing is saved while a criterion has no case or reason. Saves them in Azure DevOps or Jira, linked to the story. Reads the cases already linked first, so asking again adds only what is missing and updates cases in place instead of duplicating them; plans end-to-end journeys from the existing cases. | `story_test_cases`, `save_test_cases`, `link_test_case`, `apply_case_changes`, `trace_criteria`, `requirements_file`, `e2e_journey` | [docs](#where-cases-come-from) |
129
129
  | Test cases | **Domain and regulatory test design**: Every agent works as an expert in the product's industry would, automatically: the risks the industry is known for and the obligations of its regulations and standards (for example DORA, PSD2, GDPR, ISO 27001), declared in forgeqe.yaml or worked out from the story and the application. It applies to analysing requirements, writing and checking test cases, exploration, writing, reviewing, and healing test code, API tests, finding tests, and pull request reviews, labelled so coverage can be traced and citing only the control ids in the team's compliance file. forgeqe eval domain measures how well the agent does it. | | [docs](#16-domain-and-regulations) |
130
130
  | Test cases | **Exploratory testing of a story**: Explores a story in real browsers beyond its scripted cases (edge cases, invalid input, boundaries, roles, state), confirms each defect by reproducing it, proposes test cases, and files bugs once the user agrees. | `explore_story` | [docs](#exploratory-testing-from-a-story) |
131
131
  | Setup | **Test environments and their apps**: Knows the test environments in env.yaml (QA, UAT, …) and each one's apps: web apps and APIs by URL, Windows desktop apps, and mobile apps, with what each is for. Every agent works from the active one; switches environment on request, picks the apps a scenario needs, and carries values such as an order number from one app to the next. | `test_apps`, `use_environment` | [docs](#environments-and-apps) |
@@ -1140,7 +1140,7 @@ The slash commands control the session and show a few things directly (`/help` l
1140
1140
  | `/theme light\|dark\|auto` | Colours for a light or a dark terminal. ForgeQE asks the terminal which it is when it starts and follows it when it changes (auto); a terminal that does not say is drawn dark. `FORGEQE_THEME=light` (or `dark`) sets it at start; `/theme` alone says which is in use |
1141
1141
  | `/details [on\|off]` | Show everything the agents do while they work: the browser agent's reasoning, page memory, engine logs, every file the coding agent reads (off by default: step results, files written, test results, problems). `--verbose` or `FORGEQE_VERBOSE=1` starts with it on, for `start`, `run`, `suite`, `code`, and `heal` too |
1142
1142
  | `/model` | Pick the model from the profiles in `llms.json` (or click the model ▾ in the status line; Tab switches to the next one) |
1143
- | `/profile <name>` | Switch LLM profile (or press Tab); the agent restarts with it |
1143
+ | `/profile <name>` | Switch LLM profile (or press Tab); from your next message the agent goes on with it in the same session, or, for a profile it cannot switch to, starts again with the conversation so far |
1144
1144
  | `/env [name]` | The test environments in `env.yaml` and their apps, or switch to one |
1145
1145
  | `/logs [shots]` | Save this session's log and runs in one archive to share (`shots`: with screenshots) |
1146
1146
  | `/features` | What ForgeQE can do, and what each capability still needs here |
@@ -1395,7 +1395,7 @@ forgeqe chat --jsonl [--repo DIR | --no-code] [--profile NAME] [--url URL] [--he
1395
1395
  [--replay MODE] [--no-memory] [--carry-over FILE] [--config forgeqe.yaml] [--verbose] [--debug]
1396
1396
  ```
1397
1397
 
1398
- The flags mean what they mean for `forgeqe run` and `forgeqe start`. `--jsonl` is required (the only format so far). `--carry-over FILE` is a JSON list `[{"user": "...", "reply": "..."}, ...]`: the turns of an earlier conversation whose process has gone (a server closing idle chats). The first message then reaches the agent with those turns before it, as when you switch profiles in the shell. To change profiles, start a new process with `--profile` and `--carry-over`. `--verbose` also writes readable event lines to stderr.
1398
+ The flags mean what they mean for `forgeqe run` and `forgeqe start`. `--jsonl` is required (the only format so far). `--carry-over FILE` is a JSON list `[{"user": "...", "reply": "..."}, ...]`: the turns of an earlier conversation whose process has gone (a server closing idle chats). The first message then reaches the agent with those turns before it, as when you switch profiles in the shell. To change the model mid-chat, send a `model` line: the same agent session goes on with the new model (below). `--verbose` also writes readable event lines to stderr.
1399
1399
 
1400
1400
  The process opens ForgeQE's agent on the first message and keeps it for every later one; it ends it on `close`, the end of stdin, or a signal. It works like the shell: background monitors are allowed and stop when it exits, and passed runs become tests unless `--no-code`. A request that was run before and passed is run again as recorded, without the agent, as in the shell (Tier 0, `registry.mode`); its turn ends with the result as the reply. When the agent cannot run (no model, no agent runtime), the process writes `fatal` and exits 1 before it reads anything: it never falls back to a browser goal.
1401
1401
 
@@ -1410,6 +1410,7 @@ The process opens ForgeQE's agent on the first message and keeps it for every la
1410
1410
  | `continue` | `id` (from a `wait`), `ok` (`true` = Done, continue; `false` = Cancel) | Ends the pending wait |
1411
1411
  | `stop` | | Stops the running turn (Esc or `/stop` in the shell). Nothing when idle |
1412
1412
  | `settings` | `headed` and/or `writeTests` (each `true` or `false`, nothing else) | Changes the chat's choices from now on: whether browser runs are shown (as `--headed`), and whether passed runs become tests (as `--no-code`, off). The next browser run uses them; the agent is told of a change with your next message. Answered with `settings` |
1413
+ | `model` | `profile` (a profile name, nothing else) | The chat's model from the next message, as a model picker does: the same agent session goes on, with the conversation, its tools and files, and the agent is told of the change with your next message; ForgeQE's tools use that profile too. Before the agent opens, any profile of llms.json; after, one of the `models` line. Refused with `error` `busy` while a turn runs, `bad_input` for anything else. Answered with `model` |
1413
1414
  | `close` | | Stops any turn, closes the agent, stops monitors and the containers it started, writes `closed`, exits 0 |
1414
1415
 
1415
1416
  A line that is not JSON, has an unknown `type`, or misses a field gets `error` `bad_input` with the reason and the first 200 characters of the line; the process goes on. The end of stdin is the same as `close`.
@@ -1419,6 +1420,8 @@ A line that is not JSON, has an unknown `type`, or misses a field gets `error` `
1419
1420
  | `type` | Fields | When |
1420
1421
  |--------|--------|------|
1421
1422
  | `ready` | `protocol` (1), `version`, `cwd`, `writeTests`, `headed`, `profile` (`name` and `provider`, never a key) | Once, after the config is loaded and checked, before stdin is read |
1423
+ | `models` | `profile` (`name`, `provider`: the one answering), `models` (each `name` and `provider`, its own first; empty when it cannot switch) | When the agent opens: the profiles a `model` line may name. A custom agent's chat, and one with `code.model`, offer none |
1424
+ | `model` | `profile` (`name`, `provider`) | After a `model` line: the profile answering from the next message |
1422
1425
  | `turn_start` | `id` | A message was accepted |
1423
1426
  | `settings` | `headed`, `writeTests` | After a `settings` line: the choices now in force |
1424
1427
  | `agent` | `id`, `event`: a `CodeEvent` (`stream`, `say`, `start`, `tool`, `plan`, `usage`, `context`, `test`, `info`, …) | While the turn runs |
@@ -1426,7 +1429,7 @@ A line that is not JSON, has an unknown `type`, or misses a field gets `error` `
1426
1429
  | `ask` | `id` (`ask-N`), `turn`, `question` (`title`, `detail`, `lines`, `options[{id, label}]`) | A tool asks you to choose |
1427
1430
  | `wait` | `id` (`wait-N`), `turn`, `prompt` | A tool waits for you to do something by hand |
1428
1431
  | `turn_done` | `id`, `outcome` (`done`, `failed`, `needs_input`, `stopped`), `reply` (the visible reply), `next` (follow-ups), `error` (when there is one), `usage` (the agent's usage so far, `null` before it opened) | The turn ended, whatever the way |
1429
- | `error` | `code` (`bad_input`, `busy`, `unknown_id`, `internal`), `message`, `turn` (when one runs) | A problem that does not end the process |
1432
+ | `error` | `code` (`bad_input`, `busy`, `unknown_id`, `model`, `internal`), `message`, `turn` (when one runs) | A problem that does not end the process |
1430
1433
  | `fatal` | `message` | The process cannot go on; exit code 1 follows |
1431
1434
  | `closed` | | The last line before a clean exit |
1432
1435
 
@@ -2236,7 +2239,16 @@ More of managing test cases, each set in `forgeqe.yaml` (and Settings › Integr
2236
2239
  - **Cases with no story.** Cases written from a page, a spec or a file are saved in an Azure DevOps area path or a Jira or Zephyr Scale project you name, compared with that area's or project's scope.
2237
2240
  - **The feature's other stories.** `sibling_cases: true` also compares with the cases of the other stories under the story's feature or epic (the first 30 stories; in Jira, the parent field Jira Cloud uses for epics).
2238
2241
  - **Automation on Jira and Xray.** A test that passes for a Jira or Xray case labels it `automated` and records the test on the issue, as Azure DevOps cases get their Associated Automation; a comment is added only when the test is new.
2239
- - **Release readiness in Jira.** `release_readiness` with `system: jira` reads a sprint, a fix version, an epic or story keys: each story's tests, which are automated, their last results in ForgeQE's runs, open bugs by priority, and the same verdict. Results recorded only in Xray or Zephyr Scale executions are not read.
2242
+ - **Release readiness in Jira.** `release_readiness` with `system: jira` reads a sprint, a fix version, an epic or story keys: each story's tests, which are automated, their last results (ForgeQE's runs, Xray test runs and Zephyr Scale executions, the newest of them), open bugs by priority, and the same verdict.
2243
+ - **Matching by steps.** Saving keeps an index of the scope's cases in `.forgeqe/cases-index/` (git-ignored): every case's steps read once, then only those changed since, 40 per save. A case with the same steps is found whatever its title, and a slightly reworded step still counts for extends.
2244
+ - **Several changes at once.** `apply_case_changes` links, extends, updates and retires several cases with one question, every change checked and read first.
2245
+ - **What ForgeQE changed.** Every case it creates, links, updates or retires is logged in `.forgeqe/history/case-changes.jsonl`; `story_test_cases` and the readiness report list the changes for their stories.
2246
+ - **Acceptance criteria traced to cases.** Saved cases carry the criteria they cover (`covers`), and `trace_criteria` records which linked cases cover which; `story_test_cases` lists each criterion with its cases, and readiness names the criteria no traced case covers.
2247
+ - **Healing and test cases.** When healing fixes a test because the application changed, it names the test cases that test automates (heal.md, Test cases to review), and the agent offers to update their steps.
2248
+ - **From Requirements Agent.** Requirements Agent writes `requirements.json` next to its report; `requirements_file` reads it, and the agent writes a case per requirement, traced by its id (FR-001).
2249
+ - **qTest, TestRail and Zephyr Scale.** Cases are saved in qTest (`module_id`, linked to the story's requirement), retired in TestRail (moved to `retired_section_id`) and Zephyr Scale (status Deprecated), and marked automated (TestRail's `automation_field`, Zephyr Scale's `automated` label). Sibling stories on Jira Server are found through Epic Link.
2250
+ - **Settings checks.** A `test_cases`, `new_cases` or retire setting ForgeQE would refuse when saving cases is refused when Settings saves it, with the setting named. In a saved Azure DevOps or Jira connection, **Try** beside each `test_cases` line says how many cases it finds, with a few of their titles.
2251
+ - **The Test cases page** (`forgeqe web`, Test cases): open a story by its system and id to see its linked cases (those older than the story's last change marked), its acceptance criteria with the cases traced to each, what ForgeQE changed, and the changes `save_test_cases` proposed. Tick the ones to make, review them, and Apply: the server checks every change again and nothing is written before Apply.
2240
2252
 
2241
2253
  With `sources.write_back: true` (the default), results go back after the suite:
2242
2254
 
@@ -252,7 +252,7 @@
252
252
  <tr><td><code>brain/prompt.ts</code></td><td><code>BRAIN_PROMPT</code>: the tools (every CLI command is one, so the agent uses the tool instead of telling the user to run a command), how to choose a source, find vs run, signing in, writing tests (<code>write_test</code>; small hand edits verified with <code>run_test</code>), the CI pipeline procedure, fixing broken tests (<code>heal_tests</code>), running existing repo tests (<code>find_tests</code> then <code>run_tests</code>, never without the user's confirmation; sprint dates only from <code>sprint</code>), monitoring, ForgeQE's own docs and setup, and the rules (no secret values, push only with <code>push_branch</code>, stay in the working directory). The reply is plain text, so it streams to the shell as it is written (the runtime's <code>message.part.delta</code> events, relayed as <code>stream</code> events); it ends with a hidden line <code>&amp;lt;!--forgeqe {&quot;outcome&quot;: done | failed | needs_input, &quot;next&quot;: […]}--&gt;</code> that <code>splitReply</code> reads and <code>visibleReply</code> holds back while the reply streams</td></tr>
253
253
  <tr><td><code>brain/index.ts</code></td><td><code>openBrain</code> starts the MCP server on 127.0.0.1 with a random token (<code>localToolServer</code>), then an agent runtime session with the prompt, the session notes, the schema, and the server as a remote MCP entry (6 h tool timeout). <code>ask</code> returns the reply and outcome, <code>abort</code> stops the session and every running tool call. <code>brainUnavailable</code> is why it cannot run (no model set up and no <code>code.model</code>, or no agent runtime); callers then run the text as one browser goal. <code>sessionSetup</code> picks the working directory and whether passed runs become tests from <code>--repo</code>, <code>--no-code</code>, and <code>code.repo</code> (default: tests in the current folder)</td></tr>
254
254
  <tr><td><code>mcp/tools.ts</code></td><td><code>TOOLS</code> and <code>environmentNotes</code> (working directory, run and memory folders, configured test case systems, suite defaults, timeouts, the profile, and the names, never values, of keys set in the environment). Each tool reports <code>ToolEvent</code>s (run-start/event/done, suite-start/event/done, info, <code>agent</code> for a nested coding or healing session's events, <code>card</code> for a result panel) to whoever shows them. <code>ToolContext</code> carries <code>session</code> (<code>shell</code>, <code>once</code> for <code>forgeqe run</code>, <code>server</code> for <code>forgeqe mcp</code>), <code>waitForUser</code> and <code>ask</code> when a person can answer, and <code>openSession</code> so tests can script the nested agent runtime sessions</td></tr>
255
- <tr><td><code>cases/save.ts</code></td><td><code>save_test_cases</code>: <code>saveAdoCases</code> creates Test Case work items (<code>adoStepsXml</code> writes <code>Microsoft.VSTS.TCM.Steps</code> the way <code>adoCases</code> reads it) linked to the story with <code>TestedBy-Reverse</code> in its area and iteration; <code>saveJiraCases</code> creates issues (type Test by default) with the steps in the description and an issue link. Both reuse a case already linked to the story under the same title, then compare with the story's scope (<code>cases/scope.ts</code>: <code>test_cases</code> maps an area path or project to a plan, suite, area or JQL filter, values checked before they reach WIQL or JQL, at most <code>MAX_SCOPE</code> cases read, steps only for the <code>shortlist</code>): the same steps are <code>reuse</code>, a case adding steps is <code>extends</code> with its <code>insert</code>; nothing is written to an existing case there. <code>planLinks</code> checks ids, type and project before <code>link_test_case</code> or <code>update_test_case</code>'s <code>story</code> asks; <code>insertSteps</code> applies an <code>insert</code>. <code>saveTestrailCases</code>, <code>saveZephyrCases</code>, Xray mode in <code>saveJiraCases</code> (<code>createXrayTest</code>, <code>setXraySteps</code> in <code>cases/xray.ts</code>), <code>saveAdoCasesInArea</code> and <code>saveJiraCasesInProject</code> for cases with no story, and <code>existingCases</code> for <code>check_test_cases</code>' <code>against</code>. <code>cases/fields.ts</code> checks <code>new_cases</code>; <code>cases/adodata.ts</code> writes shared steps references and parameters; <code>cases/staleness.ts</code> reads a story's history; <code>cases/retire.ts</code> retires a case; <code>cases/jirareadiness.ts</code> is release readiness for Jira. On unless <code>sources.save_cases: false</code>; <code>environmentNotes</code> tells the agent which</td></tr>
255
+ <tr><td><code>cases/save.ts</code></td><td><code>save_test_cases</code>: <code>saveAdoCases</code> creates Test Case work items (<code>adoStepsXml</code> writes <code>Microsoft.VSTS.TCM.Steps</code> the way <code>adoCases</code> reads it) linked to the story with <code>TestedBy-Reverse</code> in its area and iteration; <code>saveJiraCases</code> creates issues (type Test by default) with the steps in the description and an issue link. Both reuse a case already linked to the story under the same title, then compare with the story's scope (<code>cases/scope.ts</code>: <code>test_cases</code> maps an area path or project to a plan, suite, area or JQL filter, values checked before they reach WIQL or JQL, at most <code>MAX_SCOPE</code> cases read, steps only for the <code>shortlist</code>): the same steps are <code>reuse</code>, a case adding steps is <code>extends</code> with its <code>insert</code>; nothing is written to an existing case there. <code>planLinks</code> checks ids, type and project before <code>link_test_case</code> or <code>update_test_case</code>'s <code>story</code> asks; <code>insertSteps</code> applies an <code>insert</code>. <code>saveTestrailCases</code>, <code>saveZephyrCases</code>, Xray mode in <code>saveJiraCases</code> (<code>createXrayTest</code>, <code>setXraySteps</code> in <code>cases/xray.ts</code>), <code>saveAdoCasesInArea</code> and <code>saveJiraCasesInProject</code> for cases with no story, and <code>existingCases</code> for <code>check_test_cases</code>' <code>against</code>. <code>cases/fields.ts</code> checks <code>new_cases</code>; <code>cases/adodata.ts</code> writes shared steps references and parameters; <code>cases/staleness.ts</code> reads a story's history; <code>cases/retire.ts</code> retires a case; <code>cases/jirareadiness.ts</code> is release readiness for Jira. <code>cases/caseindex.ts</code> keeps a project's index of scope cases' steps; <code>cases/bulk.ts</code> prepares several changes for one question (apply_case_changes and the web gateway <code>web/testcases.ts</code>); <code>cases/targets.ts</code> names a case's system by its id; <code>cases/changelog.ts</code>, <code>cases/trace.ts</code> and <code>cases/proposals.ts</code> keep the project's change log, criteria trace and pending proposals; <code>cases/requirementsfile.ts</code> reads Requirements Agent's requirements.json; <code>cases/scopecheck.ts</code> checks the settings Settings saves and tries a test_cases line. On unless <code>sources.save_cases: false</code>; <code>environmentNotes</code> tells the agent which</td></tr>
256
256
  <tr><td><code>mcp/commands.ts</code></td><td><code>COMMAND_TOOLS</code>, one tool per CLI command, appended to <code>TOOLS</code>. <code>write_test</code> runs the coding loop (<code>runCodeAgent</code>) and <code>heal_tests</code> runs <code>runHeal</code>, forwarding their events as <code>agent</code> events and ending with a card; each opens its own agent runtime server on port 0, so it nests inside the brain's session. <code>monitor</code>: <code>round</code> (one <code>runMonitor --once</code>, refused while a background monitor uses the folder), <code>start</code>/<code>stop</code>/<code>status</code> (background monitors, only in <code>shell</code> and <code>server</code> sessions), <code>test_alerts</code>. <code>browser_run</code> takes <code>purpose</code> (<code>test</code> or <code>task</code>); <code>taskReason</code> treats a <code>task</code>, or a run that starts on, ends on, or names a configured source system's host (Azure DevOps, Jira, Confluence, TestRail, Zephyr, qTest, Xray), as a task: it writes <code>task.json</code> (<code>TASK_FILE</code>) in the run folder, returns no <code>write_test</code> next step, and <code>write_test</code> refuses that folder. <code>browser_run</code> also takes <code>resume_from</code> (a failed run's folder or name, read by <code>loadResume</code> in <code>run.ts</code>) and, after a failure with resume steps, returns them with a <code>next_step</code> naming the folder; the brain's prompt says to retry with it and say what to do differently. <code>logins</code>: <code>remember</code> (session logins), list (configured and remembered), clear (a saved session, and a remembered login's credentials and session file), and <code>sign_in</code> through <code>signIn</code> and <code>ctx.waitForUser</code> (refused without it). <code>forgeqe_setup</code>: profiles, MCP servers, <code>docsAbout</code> (README and HOW_TO_USE split at headings and scored against the topic, since the agent's <code>external_directory</code> rule keeps it out of the package folder), <code>install_engine</code>, <code>init</code>, <code>skills</code> (<code>op</code> list, show, or new: <code>newSkill</code> into the project's or the user's skills folder)</td></tr>
257
257
  <tr><td><code>card.ts</code></td><td><code>Card</code> (<code>status</code>, <code>title</code>, <code>stats</code>, <code>body</code>) and <code>cardText</code>. <code>codeCard</code>, <code>healCard</code>, and <code>roundCard</code> build cards from the same lines as the terminal summaries</td></tr>
258
258
  <tr><td><code>mcp/server.ts</code></td><td>JSON-RPC for MCP by hand: <code>initialize</code> (protocol 2025-06-18, 2025-03-26, 2024-11-05, with <code>instructions</code>), <code>ping</code>, <code>tools/list</code>, <code>tools/call</code>, <code>notifications/cancelled</code>. <code>serveHttp</code>: Streamable HTTP on 127.0.0.1, checking the bearer token in constant time (<code>tokenMatches</code>) and refusing requests whose <code>Origin</code> is not this machine (<code>originAllowed</code>), so a web page cannot call the tools; tool calls answer as an event stream with a progress notification every 10 s and a keep-alive every 15 s, so the agent runtime's per-call timeout (which resets on progress) never fires during a long suite. <code>serveStdio</code>: newline-delimited JSON-RPC for <code>forgeqe mcp</code>; closing stdin aborts running calls. <code>localToolServer</code>: a server over HTTP with a fresh token and the agent runtime's MCP entry for it, shared by the brain and the healing session</td></tr>
@@ -269,7 +269,7 @@
269
269
  <p>After the session opens, <code>openBrain</code> reads <code>client.mcp.status()</code> and reports each external server as connected, failed (with the error), or needing a browser sign-in; skipped systems are reported with their reason. The agent's session notes list the servers and say that a server whose tools are missing did not connect, so the agent falls back to <code>query_api</code>.</p>
270
270
  <p>Tools take structured arguments. <code>run_test_cases</code> and <code>find_test_cases</code> get a list of <code>CaseSelector</code>s (<code>{source: azure_devops \| jira \| xray \| testrail \| zephyr \| qtest \| file \| text, ids, plan, suite, run, cycle, folder, jql, paths, text}</code>) that <code>casesFrom</code> reads directly, so the model's choice of source is never re-parsed.</p>
271
271
  <p><strong>Permissions.</strong> The agent's bash is allowed except <code>git push*</code>, <code>git * push*</code> (so <code>git -C . push</code> is caught too), and <code>gh repo delete*</code>, each also with a leading <code>*</code> so a push wrapped in another command (<code>env git push</code>, <code>sh -c 'git push'</code>) is caught; the agent runtime matches each command of a chain on its own and applies the last matching rule. These rules are guard rails, not a sandbox. <code>forgeqe_*</code> tools are allowed. <code>external_directory</code> allows only the run and memory folders. Tool calls to <code>forgeqe_*</code> are hidden from the <code>⚙</code> lines because their <code>ToolEvent</code>s already render richer output (browser steps, suite cards).</p>
272
- <p><strong>Callers.</strong> The TUI opens the brain on the first message and keeps it for the session, so follow-up answers and &quot;write a test for that run&quot; have context; <code>/profile</code> (or Tab) closes it and keeps the turns so far: the next agent session's first prompt is <code>carryOver(turns, text)</code>, the last 20 turns with remembered secrets redacted, so switching models does not lose the conversation. It renders <code>card</code> events as result panels and <code>agent</code> events as <code>⚙</code> and test lines with their own token counter, and its <code>waitForUser</code> pushes the prompt into the transcript and opens a <strong>Your turn</strong> dialog (Done, continue / Cancel); opening another dialog or Esc settles it as cancelled. <code>forgeqe run</code> opens the brain for one request, prints tool events (cards as <code>cardText</code>) and the reply as plain lines, waits for Enter in <code>waitForUser</code> when stdin is a terminal, and exits 0 done, 1 failed, 2 stopped, 3 needs input. <code>forgeqe run --direct</code> and a missing agent runtime run <code>browser_run</code> directly. <code>forgeqe mcp</code> serves the same <code>TOOLS</code> on stdio and logs <code>ToolEvent</code>s to stderr; it has no <code>waitForUser</code>. <code>forgeqe chat --jsonl</code> (<code>src/chat/jsonl.ts</code>) is the TUI's agent for a program: like the TUI, it opens the brain on the first message, keeps it for every message, runs with <code>session: &quot;shell&quot;</code>, runs Tier 0 requests as recorded before asking the agent, and continues an earlier conversation with <code>carryOver</code> (<code>--carry-over FILE</code>, with its own reason sentence); like <code>forgeqe run</code>, it takes its flags (<code>repoFlag</code>, <code>memoryFlags</code>, …) and writes one session log; like <code>forgeqe mcp</code>, it is a machine interface, with stdout claimed for the protocol and every other print sent to stderr. It writes each <code>CodeEvent</code> and <code>ToolEvent</code> unchanged as a JSON line (<code>agent</code>, <code>tool</code>), turns <code>ask</code> and <code>waitForUser</code> into <code>ask</code> and <code>wait</code> lines answered on stdin, ends every turn with one <code>turn_done</code>, and passes every outgoing string through <code>redactSecrets</code> and the values of <code>privateEnvNames</code> and profile keys. The protocol is in HOW_TO_USE.md. <code>forgeqe start</code>, <code>forgeqe mcp</code>, and <code>forgeqe chat</code> stop background monitors when they return, because <code>src/index.ts</code> calls <code>process.exit</code>.</p>
272
+ <p><strong>Callers.</strong> The TUI opens the brain on the first message and keeps it for the session, so follow-up answers and &quot;write a test for that run&quot; have context; <code>/profile</code> (or Tab) switches the model in the same session before the next message (<code>Brain.setModel</code>: one agent runtime holds every usable profile, and each prompt names its model), with a one-line note to the agent; a profile the session does not offer (a custom agent's, <code>code.model</code>, one that could not answer when it opened) closes it and keeps the turns so far: the next agent session's first prompt is <code>carryOver(turns, text)</code>, the last 20 turns with remembered secrets redacted, so switching models does not lose the conversation. It renders <code>card</code> events as result panels and <code>agent</code> events as <code>⚙</code> and test lines with their own token counter, and its <code>waitForUser</code> pushes the prompt into the transcript and opens a <strong>Your turn</strong> dialog (Done, continue / Cancel); opening another dialog or Esc settles it as cancelled. <code>forgeqe run</code> opens the brain for one request, prints tool events (cards as <code>cardText</code>) and the reply as plain lines, waits for Enter in <code>waitForUser</code> when stdin is a terminal, and exits 0 done, 1 failed, 2 stopped, 3 needs input. <code>forgeqe run --direct</code> and a missing agent runtime run <code>browser_run</code> directly. <code>forgeqe mcp</code> serves the same <code>TOOLS</code> on stdio and logs <code>ToolEvent</code>s to stderr; it has no <code>waitForUser</code>. <code>forgeqe chat --jsonl</code> (<code>src/chat/jsonl.ts</code>) is the TUI's agent for a program: like the TUI, it opens the brain on the first message, keeps it for every message, runs with <code>session: &quot;shell&quot;</code>, runs Tier 0 requests as recorded before asking the agent, and continues an earlier conversation with <code>carryOver</code> (<code>--carry-over FILE</code>, with its own reason sentence); like <code>forgeqe run</code>, it takes its flags (<code>repoFlag</code>, <code>memoryFlags</code>, …) and writes one session log; like <code>forgeqe mcp</code>, it is a machine interface, with stdout claimed for the protocol and every other print sent to stderr. It writes each <code>CodeEvent</code> and <code>ToolEvent</code> unchanged as a JSON line (<code>agent</code>, <code>tool</code>), turns <code>ask</code> and <code>waitForUser</code> into <code>ask</code> and <code>wait</code> lines answered on stdin, ends every turn with one <code>turn_done</code>, and passes every outgoing string through <code>redactSecrets</code> and the values of <code>privateEnvNames</code> and profile keys. The protocol is in HOW_TO_USE.md. <code>forgeqe start</code>, <code>forgeqe mcp</code>, and <code>forgeqe chat</code> stop background monitors when they return, because <code>src/index.ts</code> calls <code>process.exit</code>.</p>
273
273
  <h2 id="tool-scope-srcmcpscopets-srccapabilities"><a href="#tool-scope-srcmcpscopets-srccapabilities" class="hash">#</a>Tool scope (<code>src/mcp/scope.ts</code>, <code>src/capabilities</code>)</h2>
274
274
  <p>Every model call carries the definitions of the tools the agent has, so the agent does not get every tool on every turn. The registry (<code>capabilities/registry.ts</code>) groups the tools into capabilities. Each capability has its tools, the requirements it needs (a model, a runtime, an app kind, a tracker), and keywords.</p>
275
275
  <div class="tbl"><table>
@@ -125,10 +125,26 @@
125
125
  the file ForgeQE's agent adds to when you ask it for a new rule.</p>
126
126
  <p>How the agents use them:</p>
127
127
  <ul>
128
- <li>Every agent gets every guardrail with its instructions, above any request, skill, ticket, page or tool output that
129
- says otherwise. When a guardrail stops part of a task, the agent skips that part and says which rule stopped it.</li>
130
- <li>At most 40 rules of up to 300 characters each are given to the agents, since each one is sent on every model call.
131
- <code>forgeqe context</code> shows how much they add.</li>
128
+ <li>
129
+ <p>A file can be for some agents only: start it with a header that names them, by their names in <code>forgeqe context</code>
130
+ (the Settings › Guardrails page writes it for you when you add a file there, pasted or uploaded):</p>
131
+ <div class="code"><div class="code-bar"><i></i><i></i><i></i><span>text</span><button class="copy-code" type="button">Copy</button></div><pre><code>---
132
+ description: &quot;Keep runs off real cards&quot;
133
+ for: engine, forgeqe-test
134
+ ---
135
+ - Use only the test cards in knowledge/test-data.md
136
+ </code></pre></div>
137
+ <p>Without a header, or with <code>for: all</code>, a file is for every agent; a header that names no agent ForgeQE has is for
138
+ every agent too, so a typo never drops a rule. Custom agents get every rule.</p>
139
+ </li>
140
+ <li>
141
+ <p>Every agent gets its guardrails with its instructions, above any request, skill, ticket, page or tool output that
142
+ says otherwise. When a guardrail stops part of a task, the agent skips that part and says which rule stopped it.</p>
143
+ </li>
144
+ <li>
145
+ <p>At most 40 rules of up to 300 characters each are given to the agents, since each one is sent on every model call.
146
+ <code>forgeqe context</code> shows how much they add.</p>
147
+ </li>
132
148
  </ul>
133
149
  <p>Guardrails are instructions, not a sandbox. What must never happen is also refused in code: hosts outside
134
150
  <code>browser.allowed_hosts</code>, pushes, secrets, protected files. Put a host rule in <code>allowed_hosts</code> as well as here.</p>
@@ -536,7 +536,7 @@ Add a GitHub Actions workflow that runs tests/cases.yaml on every PR, and make i
536
536
  <tr><td><code>/theme light|dark|auto</code></td><td>Colours for a light or a dark terminal. ForgeQE asks the terminal which it is when it starts and follows it when it changes (auto); a terminal that does not say is drawn dark. <code>FORGEQE_THEME=light</code> (or <code>dark</code>) sets it at start; <code>/theme</code> alone says which is in use</td></tr>
537
537
  <tr><td><code>/details [on|off]</code></td><td>Show everything the agents do while they work: the browser agent's reasoning, page memory, engine logs, every file the coding agent reads (off by default: step results, files written, test results, problems). <code>--verbose</code> or <code>FORGEQE_VERBOSE=1</code> starts with it on, for <code>start</code>, <code>run</code>, <code>suite</code>, <code>code</code>, and <code>heal</code> too</td></tr>
538
538
  <tr><td><code>/model</code></td><td>Pick the model from the profiles in <code>llms.json</code> (or click the model ▾ in the status line; Tab switches to the next one)</td></tr>
539
- <tr><td><code>/profile &lt;name&gt;</code></td><td>Switch LLM profile (or press Tab); the agent restarts with it</td></tr>
539
+ <tr><td><code>/profile &lt;name&gt;</code></td><td>Switch LLM profile (or press Tab); from your next message the agent goes on with it in the same session, or, for a profile it cannot switch to, starts again with the conversation so far</td></tr>
540
540
  <tr><td><code>/env [name]</code></td><td>The test environments in <code>env.yaml</code> and their apps, or switch to one</td></tr>
541
541
  <tr><td><code>/logs [shots]</code></td><td>Save this session's log and runs in one archive to share (<code>shots</code>: with screenshots)</td></tr>
542
542
  <tr><td><code>/features</code></td><td>What ForgeQE can do, and what each capability still needs here</td></tr>
@@ -728,7 +728,7 @@ forgeqe run &quot;Run the cases in smoke.yaml and don't post results&quot; --pla
728
728
  [--browser-provider local|docker|browserstack|testmu] [--devices a,b] [--max-steps N]
729
729
  [--replay MODE] [--no-memory] [--carry-over FILE] [--config forgeqe.yaml] [--verbose] [--debug]
730
730
  </code></pre></div>
731
- <p>The flags mean what they mean for <code>forgeqe run</code> and <code>forgeqe start</code>. <code>--jsonl</code> is required (the only format so far). <code>--carry-over FILE</code> is a JSON list <code>[{&quot;user&quot;: &quot;...&quot;, &quot;reply&quot;: &quot;...&quot;}, ...]</code>: the turns of an earlier conversation whose process has gone (a server closing idle chats). The first message then reaches the agent with those turns before it, as when you switch profiles in the shell. To change profiles, start a new process with <code>--profile</code> and <code>--carry-over</code>. <code>--verbose</code> also writes readable event lines to stderr.</p>
731
+ <p>The flags mean what they mean for <code>forgeqe run</code> and <code>forgeqe start</code>. <code>--jsonl</code> is required (the only format so far). <code>--carry-over FILE</code> is a JSON list <code>[{&quot;user&quot;: &quot;...&quot;, &quot;reply&quot;: &quot;...&quot;}, ...]</code>: the turns of an earlier conversation whose process has gone (a server closing idle chats). The first message then reaches the agent with those turns before it, as when you switch profiles in the shell. To change the model mid-chat, send a <code>model</code> line: the same agent session goes on with the new model (below). <code>--verbose</code> also writes readable event lines to stderr.</p>
732
732
  <p>The process opens ForgeQE's agent on the first message and keeps it for every later one; it ends it on <code>close</code>, the end of stdin, or a signal. It works like the shell: background monitors are allowed and stop when it exits, and passed runs become tests unless <code>--no-code</code>. A request that was run before and passed is run again as recorded, without the agent, as in the shell (Tier 0, <code>registry.mode</code>); its turn ends with the result as the reply. When the agent cannot run (no model, no agent runtime), the process writes <code>fatal</code> and exits 1 before it reads anything: it never falls back to a browser goal.</p>
733
733
  <p><strong>stdout</strong> carries only JSON lines: one object per line, UTF-8, ending in <code>\n</code>. Logs, warnings, and anything a library prints go to stderr. Lines can be long (a card, a suite result); do not assume a maximum length. Every line has <code>&quot;v&quot;: 1</code>, <code>&quot;seq&quot;</code> (1, 2, 3, … in this process), and <code>&quot;t&quot;</code> (ISO time). Every string is passed through the session's secret redaction, so a password given in a message never comes back out, not even inside a tool result; profile keys and the values of ForgeQE's own secret variables never appear.</p>
734
734
  <p><strong>Input</strong> (stdin), one JSON object per line:</p>
@@ -742,6 +742,7 @@ forgeqe run &quot;Run the cases in smoke.yaml and don't post results&quot; --pla
742
742
  <tr><td><code>continue</code></td><td><code>id</code> (from a <code>wait</code>), <code>ok</code> (<code>true</code> = Done, continue; <code>false</code> = Cancel)</td><td>Ends the pending wait</td></tr>
743
743
  <tr><td><code>stop</code></td><td></td><td>Stops the running turn (Esc or <code>/stop</code> in the shell). Nothing when idle</td></tr>
744
744
  <tr><td><code>settings</code></td><td><code>headed</code> and/or <code>writeTests</code> (each <code>true</code> or <code>false</code>, nothing else)</td><td>Changes the chat's choices from now on: whether browser runs are shown (as <code>--headed</code>), and whether passed runs become tests (as <code>--no-code</code>, off). The next browser run uses them; the agent is told of a change with your next message. Answered with <code>settings</code></td></tr>
745
+ <tr><td><code>model</code></td><td><code>profile</code> (a profile name, nothing else)</td><td>The chat's model from the next message, as a model picker does: the same agent session goes on, with the conversation, its tools and files, and the agent is told of the change with your next message; ForgeQE's tools use that profile too. Before the agent opens, any profile of llms.json; after, one of the <code>models</code> line. Refused with <code>error</code> <code>busy</code> while a turn runs, <code>bad_input</code> for anything else. Answered with <code>model</code></td></tr>
745
746
  <tr><td><code>close</code></td><td></td><td>Stops any turn, closes the agent, stops monitors and the containers it started, writes <code>closed</code>, exits 0</td></tr>
746
747
  </tbody>
747
748
  </table></div>
@@ -753,6 +754,8 @@ forgeqe run &quot;Run the cases in smoke.yaml and don't post results&quot; --pla
753
754
  </thead>
754
755
  <tbody>
755
756
  <tr><td><code>ready</code></td><td><code>protocol</code> (1), <code>version</code>, <code>cwd</code>, <code>writeTests</code>, <code>headed</code>, <code>profile</code> (<code>name</code> and <code>provider</code>, never a key)</td><td>Once, after the config is loaded and checked, before stdin is read</td></tr>
757
+ <tr><td><code>models</code></td><td><code>profile</code> (<code>name</code>, <code>provider</code>: the one answering), <code>models</code> (each <code>name</code> and <code>provider</code>, its own first; empty when it cannot switch)</td><td>When the agent opens: the profiles a <code>model</code> line may name. A custom agent's chat, and one with <code>code.model</code>, offer none</td></tr>
758
+ <tr><td><code>model</code></td><td><code>profile</code> (<code>name</code>, <code>provider</code>)</td><td>After a <code>model</code> line: the profile answering from the next message</td></tr>
756
759
  <tr><td><code>turn_start</code></td><td><code>id</code></td><td>A message was accepted</td></tr>
757
760
  <tr><td><code>settings</code></td><td><code>headed</code>, <code>writeTests</code></td><td>After a <code>settings</code> line: the choices now in force</td></tr>
758
761
  <tr><td><code>agent</code></td><td><code>id</code>, <code>event</code>: a <code>CodeEvent</code> (<code>stream</code>, <code>say</code>, <code>start</code>, <code>tool</code>, <code>plan</code>, <code>usage</code>, <code>context</code>, <code>test</code>, <code>info</code>, …)</td><td>While the turn runs</td></tr>
@@ -760,7 +763,7 @@ forgeqe run &quot;Run the cases in smoke.yaml and don't post results&quot; --pla
760
763
  <tr><td><code>ask</code></td><td><code>id</code> (<code>ask-N</code>), <code>turn</code>, <code>question</code> (<code>title</code>, <code>detail</code>, <code>lines</code>, <code>options[{id, label}]</code>)</td><td>A tool asks you to choose</td></tr>
761
764
  <tr><td><code>wait</code></td><td><code>id</code> (<code>wait-N</code>), <code>turn</code>, <code>prompt</code></td><td>A tool waits for you to do something by hand</td></tr>
762
765
  <tr><td><code>turn_done</code></td><td><code>id</code>, <code>outcome</code> (<code>done</code>, <code>failed</code>, <code>needs_input</code>, <code>stopped</code>), <code>reply</code> (the visible reply), <code>next</code> (follow-ups), <code>error</code> (when there is one), <code>usage</code> (the agent's usage so far, <code>null</code> before it opened)</td><td>The turn ended, whatever the way</td></tr>
763
- <tr><td><code>error</code></td><td><code>code</code> (<code>bad_input</code>, <code>busy</code>, <code>unknown_id</code>, <code>internal</code>), <code>message</code>, <code>turn</code> (when one runs)</td><td>A problem that does not end the process</td></tr>
766
+ <tr><td><code>error</code></td><td><code>code</code> (<code>bad_input</code>, <code>busy</code>, <code>unknown_id</code>, <code>model</code>, <code>internal</code>), <code>message</code>, <code>turn</code> (when one runs)</td><td>A problem that does not end the process</td></tr>
764
767
  <tr><td><code>fatal</code></td><td><code>message</code></td><td>The process cannot go on; exit code 1 follows</td></tr>
765
768
  <tr><td><code>closed</code></td><td></td><td>The last line before a clean exit</td></tr>
766
769
  </tbody>
@@ -1229,7 +1232,16 @@ forgeqe suite cases.yaml --no-code --no-write-back --out .forgeqe/reports/smoke
1229
1232
  <li><strong>Cases with no story.</strong> Cases written from a page, a spec or a file are saved in an Azure DevOps area path or a Jira or Zephyr Scale project you name, compared with that area's or project's scope.</li>
1230
1233
  <li><strong>The feature's other stories.</strong> <code>sibling_cases: true</code> also compares with the cases of the other stories under the story's feature or epic (the first 30 stories; in Jira, the parent field Jira Cloud uses for epics).</li>
1231
1234
  <li><strong>Automation on Jira and Xray.</strong> A test that passes for a Jira or Xray case labels it <code>automated</code> and records the test on the issue, as Azure DevOps cases get their Associated Automation; a comment is added only when the test is new.</li>
1232
- <li><strong>Release readiness in Jira.</strong> <code>release_readiness</code> with <code>system: jira</code> reads a sprint, a fix version, an epic or story keys: each story's tests, which are automated, their last results in ForgeQE's runs, open bugs by priority, and the same verdict. Results recorded only in Xray or Zephyr Scale executions are not read.</li>
1235
+ <li><strong>Release readiness in Jira.</strong> <code>release_readiness</code> with <code>system: jira</code> reads a sprint, a fix version, an epic or story keys: each story's tests, which are automated, their last results (ForgeQE's runs, Xray test runs and Zephyr Scale executions, the newest of them), open bugs by priority, and the same verdict.</li>
1236
+ <li><strong>Matching by steps.</strong> Saving keeps an index of the scope's cases in <code>.forgeqe/cases-index/</code> (git-ignored): every case's steps read once, then only those changed since, 40 per save. A case with the same steps is found whatever its title, and a slightly reworded step still counts for extends.</li>
1237
+ <li><strong>Several changes at once.</strong> <code>apply_case_changes</code> links, extends, updates and retires several cases with one question, every change checked and read first.</li>
1238
+ <li><strong>What ForgeQE changed.</strong> Every case it creates, links, updates or retires is logged in <code>.forgeqe/history/case-changes.jsonl</code>; <code>story_test_cases</code> and the readiness report list the changes for their stories.</li>
1239
+ <li><strong>Acceptance criteria traced to cases.</strong> Saved cases carry the criteria they cover (<code>covers</code>), and <code>trace_criteria</code> records which linked cases cover which; <code>story_test_cases</code> lists each criterion with its cases, and readiness names the criteria no traced case covers.</li>
1240
+ <li><strong>Healing and test cases.</strong> When healing fixes a test because the application changed, it names the test cases that test automates (heal.md, Test cases to review), and the agent offers to update their steps.</li>
1241
+ <li><strong>From Requirements Agent.</strong> Requirements Agent writes <code>requirements.json</code> next to its report; <code>requirements_file</code> reads it, and the agent writes a case per requirement, traced by its id (FR-001).</li>
1242
+ <li><strong>qTest, TestRail and Zephyr Scale.</strong> Cases are saved in qTest (<code>module_id</code>, linked to the story's requirement), retired in TestRail (moved to <code>retired_section_id</code>) and Zephyr Scale (status Deprecated), and marked automated (TestRail's <code>automation_field</code>, Zephyr Scale's <code>automated</code> label). Sibling stories on Jira Server are found through Epic Link.</li>
1243
+ <li><strong>Settings checks.</strong> A <code>test_cases</code>, <code>new_cases</code> or retire setting ForgeQE would refuse when saving cases is refused when Settings saves it, with the setting named. In a saved Azure DevOps or Jira connection, <strong>Try</strong> beside each <code>test_cases</code> line says how many cases it finds, with a few of their titles.</li>
1244
+ <li><strong>The Test cases page</strong> (<code>forgeqe web</code>, Test cases): open a story by its system and id to see its linked cases (those older than the story's last change marked), its acceptance criteria with the cases traced to each, what ForgeQE changed, and the changes <code>save_test_cases</code> proposed. Tick the ones to make, review them, and Apply: the server checks every change again and nothing is written before Apply.</li>
1233
1245
  </ul>
1234
1246
  <p>With <code>sources.write_back: true</code> (the default), results go back after the suite:</p>
1235
1247
  <ul>
@@ -1316,11 +1328,11 @@ forgeqe suite cases.yaml --no-code --no-write-back --out .forgeqe/reports/smoke
1316
1328
  </article>
1317
1329
  <article class="spec feat" id="cap-write-test-cases">
1318
1330
  <div class="hd"><span class="mono">Test cases</span><h3>Write test cases from a story</h3></div>
1319
- <p class="ds">Writes test cases from a story's acceptance criteria and saves them in Azure DevOps or Jira, linked to the story. Reads the cases already linked first, so asking again adds only what is missing and updates cases in place instead of duplicating them; plans end-to-end journeys from the existing cases.</p>
1331
+ <p class="ds">Writes test cases from an understanding of the feature, not only a story's acceptance criteria: it reads the feature and epic above the story, their other stories, linked Confluence pages, the RAG service, product knowledge, the app's pages and flows in page memory, and the area's past defects (from earlier runs and the tracker's bugs), then analyses each criterion before it designs cases. Each case names what it covers, and nothing is saved while a criterion has no case or reason. Saves them in Azure DevOps or Jira, linked to the story. Reads the cases already linked first, so asking again adds only what is missing and updates cases in place instead of duplicating them; plans end-to-end journeys from the existing cases.</p>
1320
1332
  <div class="facts">
1321
1333
  <div class="fact"><span class="mono">Ask it</span><ul class="asks"><li>Write test cases for story 1234 and save them</li><li>Build an end-to-end journey from story 1234's cases</li></ul></div>
1322
1334
  <div class="fact"><span class="mono">What it needs</span><ul class="needs"><li><span class="need req">Required</span><span>Azure DevOps or Jira: set up under sources: in forgeqe.yaml, or sign in with /auth</span></li></ul></div>
1323
- <div class="fact"><span class="mono">Tools</span><p class="tools"><code>story_test_cases</code> <code>save_test_cases</code> <code>link_test_case</code> <code>e2e_journey</code></p></div>
1335
+ <div class="fact"><span class="mono">Tools</span><p class="tools"><code>story_test_cases</code> <code>save_test_cases</code> <code>link_test_case</code> <code>apply_case_changes</code> <code>trace_criteria</code> <code>requirements_file</code> <code>e2e_journey</code></p></div>
1324
1336
  </div>
1325
1337
  <div class="detail"><span class="mono">In detail</span>
1326
1338
  <p class="see">See <a href="#doc-how_to_use-where-cases-come-from">Where cases come from</a>.</p>