@capagents/forgeqe 2.9.8 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/HOW_TO_USE.md +90 -33
  2. package/dist/docs-site/docs/index.html +53 -4
  3. package/dist/docs-site/docs/search.js +1 -1
  4. package/dist/forgeqe.js +2042 -1892
  5. package/dist/web/assets/Agent-B_mG1pww.js +8 -0
  6. package/dist/web/assets/ApiTests-C2QIp_tG.js +10 -0
  7. package/dist/web/assets/Browse-zQoOQXpA.js +2 -0
  8. package/dist/web/assets/{Chat-DSlBwNAI.js → Chat-BtLEKYY8.js} +3 -3
  9. package/dist/web/assets/CommandPalette-BgQORiKD.js +1 -0
  10. package/dist/web/assets/{Compare-BI8IMq49.js → Compare-DQNg3ldO.js} +1 -1
  11. package/dist/web/assets/Cost-T0NH8ymc.js +1 -0
  12. package/dist/web/assets/{Data-CjnqjcAx.js → Data-CqKsrslC.js} +4 -4
  13. package/dist/web/assets/Desktop-CgDXi3lX.js +1 -0
  14. package/dist/web/assets/DesktopReview-C-gW_gli.js +1 -0
  15. package/dist/web/assets/Evidence-1pipN6K6.js +1 -0
  16. package/dist/web/assets/{Explore-Cc-1cTwG.js → Explore-lG_kobPj.js} +2 -2
  17. package/dist/web/assets/Features-BIrW3AiQ.js +1 -0
  18. package/dist/web/assets/{Flags-CICcBCkH.js → Flags-sG1vr7NU.js} +2 -2
  19. package/dist/web/assets/Flaky-ChKBXlcW.js +1 -0
  20. package/dist/web/assets/Impact-D5a5fyc2.js +3 -0
  21. package/dist/web/assets/Jobs-B52pIZUx.js +5 -0
  22. package/dist/web/assets/KindPage-BFoKPj7l.js +6 -0
  23. package/dist/web/assets/Migration-DbuzD_s4.js +2 -0
  24. package/dist/web/assets/Product-DiH61j0X.js +7 -0
  25. package/dist/web/assets/Production-8h5LixDt.js +1 -0
  26. package/dist/web/assets/Quality-CI5n8b_k.js +1 -0
  27. package/dist/web/assets/Readiness-D4n4HSlW.js +1 -0
  28. package/dist/web/assets/Record-O8LOzHLo.js +2 -0
  29. package/dist/web/assets/Regression-DbShD6ji.js +5 -0
  30. package/dist/web/assets/RelationGraph-D_ZVeOBh.js +1 -0
  31. package/dist/web/assets/Reports-IdoUvtaW.js +2 -0
  32. package/dist/web/assets/{Response-CaWPiZyx.js → Response-BRVM9mW_.js} +2 -2
  33. package/dist/web/assets/{RunDiff-BQKwTCbM.js → RunDiff-uQoK3Q6q.js} +1 -1
  34. package/dist/web/assets/Runs-BhDgzDo4.js +2 -0
  35. package/dist/web/assets/Steps-BDSeIznj.js +2 -0
  36. package/dist/web/assets/TestCases-DQ2oWXt2.js +1 -0
  37. package/dist/web/assets/TestData-D-ZdmHVa.js +2 -0
  38. package/dist/web/assets/TestDebt-_jer4Dmy.js +1 -0
  39. package/dist/web/assets/Tosca-DOT6-53c.js +3 -0
  40. package/dist/web/assets/{WhatsNew-CznfTEFM.js → WhatsNew-DU5k6dz6.js} +1 -1
  41. package/dist/web/assets/dataParts-BzuL6pAo.js +3 -0
  42. package/dist/web/assets/{families-B0QIuAe3.js → families-zlLgApNV.js} +1 -1
  43. package/dist/web/assets/filters-CflRmNDz.js +1 -0
  44. package/dist/web/assets/flowLayout-cXVJhLpH.js +1 -0
  45. package/dist/web/assets/{fold-HnodvJWj.js → fold-DZYvcIP0.js} +1 -1
  46. package/dist/web/assets/frame-Bjxy1jvq.js +4 -0
  47. package/dist/web/assets/index-DH21lIE7.js +66 -0
  48. package/dist/web/assets/index-DwUumNPZ.css +2 -0
  49. package/dist/web/assets/{logos-CNarWSPL.js → logos-Co26FM0G.js} +1 -1
  50. package/dist/web/assets/markdown-nTIj9lyp.js +10 -0
  51. package/dist/web/assets/{palette-B2YywN1k.js → palette-CitkMCod.js} +1 -1
  52. package/dist/web/assets/{parts-z_AE9U-M.js → parts-C53RxMcR.js} +1 -1
  53. package/dist/web/assets/{productParts-C4vc_bLJ.js → productParts-DK3ULNpv.js} +1 -1
  54. package/dist/web/assets/qualityParts-DADI5Fqn.js +1 -0
  55. package/dist/web/assets/{recordTest-GvGQjhR4.js → recordTest-CqxnF953.js} +1 -1
  56. package/dist/web/assets/{rows-7zDrF-Yp.js → rows-BqT7fknl.js} +1 -1
  57. package/dist/web/assets/{segmented-DANusepM.js → segmented-CAf_qz5Z.js} +1 -1
  58. package/dist/web/assets/{thread-BUBgX0xW.js → thread-iRsceqhM.js} +2 -2
  59. package/dist/web/assets/{usePageChat-DnOXyd_B.js → usePageChat-BCrPoTyS.js} +1 -1
  60. package/dist/web/index.html +5 -4
  61. package/docs/BUSINESS_ASSURANCE.md +105 -0
  62. package/docs/user-guide.html +53 -4
  63. package/package.json +1 -1
  64. package/prompts/README.md +3 -0
  65. package/prompts/brain.md +11 -0
  66. package/prompts/business-interview.md +43 -0
  67. package/prompts/business-persona.md +3 -1
  68. package/prompts/business-strategist.md +44 -0
  69. package/prompts/persona-own.md +47 -0
  70. package/py/forgeqe_engine/browser.py +29 -0
  71. package/py/forgeqe_engine/capture.py +2 -2
  72. package/py/forgeqe_engine/cli.py +5 -0
  73. package/py/forgeqe_engine/dynamic.py +8 -0
  74. package/py/forgeqe_engine/memory.py +33 -2
  75. package/py/forgeqe_engine/recordsession.py +301 -28
  76. package/py/forgeqe_engine/webrecord.py +80 -0
  77. package/py/forgeqe_engine/webrecord_page.py +136 -17
  78. package/dist/web/assets/Agent-D0jovbz1.js +0 -6
  79. package/dist/web/assets/ApiTests-CMMMApBR.js +0 -10
  80. package/dist/web/assets/Browse-Bimy9-t0.js +0 -2
  81. package/dist/web/assets/CommandPalette-D7NWAtOU.js +0 -1
  82. package/dist/web/assets/Cost-BV0JavsG.js +0 -1
  83. package/dist/web/assets/Desktop-Bu72INy4.js +0 -1
  84. package/dist/web/assets/DesktopReview-jDnb5Gfn.js +0 -1
  85. package/dist/web/assets/Evidence-CIlcAy5n.js +0 -1
  86. package/dist/web/assets/Features-CewFSOSI.js +0 -1
  87. package/dist/web/assets/Flaky-BrWbRajc.js +0 -1
  88. package/dist/web/assets/ForceGraph-BLYMwmyj.js +0 -1
  89. package/dist/web/assets/Impact-D7seby-G.js +0 -3
  90. package/dist/web/assets/Jobs-D7yPretO.js +0 -5
  91. package/dist/web/assets/KindPage-Cjt1s7Vd.js +0 -6
  92. package/dist/web/assets/Migration-CbCqOsJI.js +0 -2
  93. package/dist/web/assets/Product-CxXVrpoD.js +0 -7
  94. package/dist/web/assets/Production-D5jIe328.js +0 -1
  95. package/dist/web/assets/Quality-D3G8IKLZ.js +0 -1
  96. package/dist/web/assets/Readiness-B4Fy4Vln.js +0 -1
  97. package/dist/web/assets/Record-DLfODYjy.js +0 -2
  98. package/dist/web/assets/Regression-Daoc9Qvx.js +0 -5
  99. package/dist/web/assets/Reports-DEzDDoGF.js +0 -2
  100. package/dist/web/assets/Runs-BIUnN08h.js +0 -2
  101. package/dist/web/assets/Steps-DjR_K32c.js +0 -2
  102. package/dist/web/assets/TestCases-BZWiTLjC.js +0 -1
  103. package/dist/web/assets/TestData-D6YiouU4.js +0 -2
  104. package/dist/web/assets/TestDebt-COFagfQU.js +0 -1
  105. package/dist/web/assets/Tosca-B3sZ9uqe.js +0 -3
  106. package/dist/web/assets/dataParts-DpVitZdm.js +0 -3
  107. package/dist/web/assets/filters-mFECJpMB.js +0 -1
  108. package/dist/web/assets/frame-DiKY0GWx.js +0 -4
  109. package/dist/web/assets/index-HjX2EOmp.js +0 -75
  110. package/dist/web/assets/index-VgSzQGK8.css +0 -2
  111. package/dist/web/assets/qualityParts-jsPhayON.js +0 -1
package/HOW_TO_USE.md CHANGED
@@ -66,6 +66,8 @@ agent:
66
66
  | building blocks, mauve | Agent builder | `forgeqe-agent-builder` | Works out a custom agent with the user: questions, plan, name | No |
67
67
  | an envelope, plum | Bug reporter | `forgeqe-bug-report` | Drafts a defect in ForgeQE itself from the person's words, and asks what it lacks | No |
68
68
  | a database drum, aqua | DB agent | `forgeqe-data` | DB agent: finds or designs the test data other agents ask for before they run | No |
69
+ | a target with its centre, wine | Scenario strategist | `forgeqe-business-strategist` | Scenario Strategist: proposes business hypotheses (misuse, unfair outcomes, money lost) over a model of the business; code plans and judges them | No |
70
+ | a microphone on its stand, berry | Persona interviewer | `forgeqe-business-interviewer` | Persona interviewer: answers, as one person of a simulated population, why they did what they did, citing their own calls; the model's account, never evidence | No |
69
71
  | a person, head and shoulders, heather | Persona agent | `forgeqe-persona` | Persona agent: drafts a business persona (an SME, an end user, a specialist, a business user) any agent acts as or tests for | No |
70
72
  | a lit lamp, slate | Knowledge agent | `forgeqe-knowledge-agent` | Knowledge agent: says what ForgeQE understood about the product and turns a person's corrections into changes to knowledge, skills, team prompts and the product graph | No |
71
73
  | an open book with its pages, denim | Document reader | `forgeqe-doc-reader` | Document reader: picks the sections of the project's documents that answer a question, from their outline | No |
@@ -82,50 +84,53 @@ agent:
82
84
  The icons as the shell draws them, each in its agent's colour:
83
85
 
84
86
  ```text
85
- ▗▟▙▖ Orchestrator ▗▟▛ Scribe
86
- ▜▛▜▛ ▟▀
87
+ ▗▟▙▖ Orchestrator ▗▟▛ Scribe
88
+ ▜▛▜▛ ▟▀
87
89
 
88
- █▖▗█ Scribe, reading ▄ ▗▛ Reviewer
89
- ▀▜▛▀ ▝█▛
90
+ █▖▗█ Scribe, reading ▄ ▗▛ Reviewer
91
+ ▀▜▛▀ ▝█▛
90
92
 
91
- ▚▖ Test planner ▗▟▙▖ Healer
92
- ▝▀▄ ▝▜▛▘
93
+ ▚▖ Test planner ▗▟▙▖ Healer
94
+ ▝▀▄ ▝▜▛▘
93
95
 
94
- ▄▄█▄ Migrator ▗▀▀▖ Tosca converter
95
- ▀█▀▀ ▌▘▝▐
96
+ ▄▄█▄ Migrator ▗▀▀▖ Tosca converter
97
+ ▀█▀▀ ▌▘▝▐
96
98
 
97
- ▗▀█ Tosca assistant ▟█▖ Test finder
98
- ▝▟▄▘ ▝▀▐▖
99
+ ▗▀█ Tosca assistant ▟█▖ Test finder
100
+ ▝▟▄▘ ▝▀▐▖
99
101
 
100
- ▛▛▛█ PR reviewer ▗▙▟▖ API test writer
101
- ▜▛▀▀ ▝▜▛▘
102
+ ▛▛▛█ PR reviewer ▗▙▟▖ API test writer
103
+ ▜▛▀▀ ▝▜▛▘
102
104
 
103
- ▘▀▀▀ API planner ███▘ Explorer
104
- ▘▀▀ █
105
+ ▘▀▀▀ API planner ███▘ Explorer
106
+ ▘▀▀ █
105
107
 
106
- ▚▟▙▞ Root cause ▜██▛ Refine
107
- ▜██▛ ▜▛
108
+ ▚▟▙▞ Root cause ▜██▛ Refine
109
+ ▜██▛ ▜▛
108
110
 
109
- █ █ Agent builder █▀▀█ Bug reporter
110
- █ █ ▙▟▙▟
111
+ █ █ Agent builder █▀▀█ Bug reporter
112
+ █ █ ▙▟▙▟
111
113
 
112
- ▟██▙ DB agent ▟▙ Persona agent
113
- ▚▄▄▞ ▟██▙
114
+ ▟██▙ DB agent ▟▀▀▙ Scenario strategist
115
+ ▚▄▄▞ ▜▟▙▛
114
116
 
115
- ▗██▖ Knowledge agent █▖▗█ Document reader
116
- ▜▛ ████
117
+ █ Persona interviewer ▟▙ Persona agent
118
+ ▝█▘ ▟██▙
117
119
 
118
- ▐█▙ Judge ▄▟▙▄ Model profiler
119
- ▄▖▝▙ ▙▖ ▙
120
+ ▗██▖ Knowledge agent █▖▗█ Document reader
121
+ ▜▛ ████
120
122
 
121
- █ █ Content judge ▛▀█▖ Scenario drafter
122
- ▞ ▞ ▙█▄▌
123
+ ▐█▙ Judge ▄▟▙▄ Model profiler
124
+ ▄▖▝▙ ▙▖ ▙
123
125
 
124
- ▀▖▗▀ Knowledge builder ▗▜▛▖ Investigator
125
- ▄▝▘▄ ▝▄▄▙
126
+ █ █ Content judge ▛▀█▖ Scenario drafter
127
+ ▞ ▞ ▙█▄▌
126
128
 
127
- ▞▀▀▚ Acceptance reader ▗▚▞▖ Change reader
128
- ▙██▟ ▝▞▚▘
129
+ ▀▖▗▀ Knowledge builder ▗▜▛▖ Investigator
130
+ ▄▝▘▄ ▝▄▄▙
131
+
132
+ ▞▀▀▚ Acceptance reader ▗▚▞▖ Change reader
133
+ ▙██▟ ▝▞▚▘
129
134
 
130
135
  ▛▀▀▜ Browser agent
131
136
  ▙▄▄▟
@@ -148,6 +153,7 @@ Everything ForgeQE can do, by area. ForgeQE's agent answers "can you…?" questi
148
153
  | 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) |
149
154
  | 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) |
150
155
  | Test cases | **Business personas for testing**: Personas that test the software the way the business would: a subject matter expert (a payments SME who checks refunds, settlement cut-offs and currency rounding), an end user, a specialist (compliance) or a business user (an operations manager with approval limits). The Persona agent drafts a new one from your words; any agent then acts as it in a browser run, designs test cases from what it validates, or reviews a feature through its eyes. Kept in the project for every agent. | `business_persona` | [docs](#business-personas) |
156
+ | Test cases | **Business assurance: testing as the business, its customers and its opportunists**: The Business Testing agent: builds a model of how the business works from the product's code (capabilities, processes, the rules the code enforces, record states, personal data), asks business questions rather than functional ones (can a refund exceed what was paid, can a one-time coupon be used twice at once, can a rule on one journey be bypassed on another, can one customer act on another's order), plays them out as multi-persona scenarios through the API and the browser on a test environment, and judges business outcomes rather than HTTP statuses. Findings are classed as confirmed failures, potential risks, policy ambiguities or missing evidence, ranked by business impact, with exposure estimated only from observed breaches and stated assumptions. | `business_assurance` | [docs](#business-assurance) |
151
157
  | 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) |
152
158
  | Desktop | **Automate Windows desktop apps**: Carries out a plain-language goal in a Windows thick-client app with UFO² and saves it as a workflow with checks of the outcome, or records the steps a tester does by hand, with no model; replays saved workflows with no model, healing a step whose control moved, and fixes a workflow from chat (a timeout, a wait, a dialog to dismiss) after showing the change. Apps and the secrets they may type come from env.yaml or forgeqe.yaml desktop:. | `desktop_explore`, `desktop_record`, `desktop_replay`, `desktop_edit_workflow`, `desktop_manage` | [docs](#desktop-apps-windows) |
153
159
  | Mobile | **Automate Android and iOS apps**: Carries out a plain-language goal in an Android or iOS app through Appium and saves it as a mobile workflow with checks of the outcome; replays workflows with no model on Appium (healing a moved control) or Maestro; runs the team's own Maestro flows after checking them against an allowlist; uploads an app build to TestMu AI and saves its lt:// id as the app's build. Apps come from env.yaml (kind: mobile) or forgeqe.yaml mobile:. | `mobile_explore`, `mobile_replay`, `mobile_maestro`, `mobile_upload` | [docs](#mobile-apps-android-ios) |
@@ -734,7 +740,7 @@ view, in the manner of ForgeQE's own architecture map: each kind of part a tinte
734
740
  data and messages), the outside services in a column on the right, and wires at right angles from card to card, as
735
741
  wide as the page and as tall as the window. A green wire is a call a run saw, a dotted amber one a run made differently,
736
742
  a dashed one goes to an outside system, and a grey one is read in the code or configuration. Hover over or tab to a part
737
- to trace what it sends and receives; the How they talk tab lists every link in words. Select a service to see it from the inside: its endpoints with the authentication
743
+ to trace what it sends and receives; the How they talk tab draws every link as a relationship graph (the Personas tab's: each part coloured by its band, each line named by what it does, a part or link picked showing how it is known) and then lists them in words. These graphs are laid out in order, not by forces, so the same product always comes out the same: the product and How they talk as an architecture diagram that fills its panel: a full-width tier per band from top to bottom (front ends, gateways, services, data and messages, platform), test suites in a column at the left and outside systems at the right, each tier's parts spread evenly across it (onto more lines when crowded) and ordered so lines cross as little as they can; folders and clusters as round areas in centred rows, sibling folders side by side, each area's files packed from its middle out, the most linked in the middle and named (zoom in, point at or select a file for the others). The Code map's Graph view, at All repositories, draws the product: each repository (coloured by its band on the services map, sized by its files), the data stores and outside systems they share, and a line for each kind of connection with how many (calls, events and shared data from the services map; imports and calls in code that crosses repositories). Select a repository for what it holds (files, tests, lines, languages, main folders) and what it talks to and is used by, then open it; inside it, click a folder's name in the graph (or pick it in Folder) to open that folder, and go back by the path above the graph (All repositories › repository › folder). The side panel lists the repositories at All repositories, and inside one says what it holds and what it connects to, each other repository a link. Inside a repository, Graph's Arrange by draws it as an architecture diagram by default (Layers: a tier for each layer, front end, API and routes, services and domain, data access and other code, from top to bottom, tests at the left and shared code and config at the right; each file's layer is worked out from its folders, name and kind, a guess from names only) or as its folders (Folders). The Graph and Cluster views draw files the same way, coloured and placed by folder, repository or cluster (in Graph, each folder or repository in its named outline), a selected file's links lit and the files a change to it reaches ringed in orange; a part's evidence panel draws what the part is linked to; and the Impact page's map draws the change the same way, arranged by steps from the change by default (an architecture diagram of the change: a tier for the changed files at the top, then each step away, the files it does not reach as small dots at the bottom, tests that reach it at the left and files in other repositories at the right) or by folders (Arrange by), each file in its colour by impact, steps from the change or how often it changes (the legend in the graph, with counts), each folder in its named outline (in the Internal view in the colour of its file nearest the change; another repository's in blue), a selected or pointed-at file lighting its chain back to the change. The keys are the Personas graph's. Select a service to see it from the inside: its endpoints with the authentication
738
744
  they need, who calls them and what a change to one reaches; what it calls, reads, writes, publishes and uses. Each part
739
745
  opens its evidence (the file and line, or the run's call), and each open question has Investigate, which asks
740
746
  ForgeQE's agent in a chat.
@@ -4050,7 +4056,9 @@ forgeqe persona show payments-sme # one persona and the brief agents act on
4050
4056
  forgeqe persona create "an SME in card payments who reconciles settlements" --domain payments --kind sme [--save]
4051
4057
  ```
4052
4058
 
4053
- Built in: `payments-sme` (`/priya`), `retail-customer` (`/sam`), `compliance-specialist` (`/dana`), `operations-manager` (`/lee`), `first-time-user` (`/alex`).
4059
+ Built in: `payments-sme` (`/priya`), `retail-customer` (`/sam`), `compliance-specialist` (`/dana`), `operations-manager` (`/lee`), `first-time-user` (`/alex`), and three risk-oriented personas the [Business Testing agent](#business-assurance) uses: `incentive-exploiter` (`/max`, an opportunistic deal hunter), `insider-agent` (`/rory`, a customer service agent who misuses refund and credit rights) and `partner-merchant` (`/morgan`, a marketplace merchant watching payout timing).
4060
+
4061
+ Besides what they know and check, a persona can say **why they act** (`intent`: `legitimate`, `opportunistic` or `adversarial`, with a `risk_appetite`), what drives them (`motivations`), what their role lets them do in the app (`permissions`), the limits they work within (`constraints`), the mistakes they plausibly make (`mistakes`) and who they deal with (`relationships`, by persona id). Each saved change raises its `version`.
4054
4062
 
4055
4063
  **Every persona is a command in every agent's chat.** Start a message with it and the task: `/priya Validate the payment change`. It works in the terminal shell (typing `/` suggests the personas with the shell's commands), `forgeqe run "/priya …"`, every chat box of the web app (typing `/` at the start offers the personas) and a custom agent's chat. ForgeQE turns the command into the persona's brief, quoted as data, and your task after it, so the agent acts as that person, puts the brief at the start of its browser runs, and judges the app by what they check. A persona's command is its `handle` (its id when it has none): a word of lower-case letters, digits and dashes that is never one of the shell's own commands or another persona's.
4056
4064
 
@@ -4061,7 +4069,9 @@ forgeqe persona import personas.json # another project's: new ones only,
4061
4069
 
4062
4070
  **Sharing personas:** the Persona agent's page (Personas tab) has Export and Import, and so does `forgeqe persona export|import`. The file is JSON of the personas' fields. An import is checked as strictly as a persona file. The whole file is refused when any persona in it is refused, and a persona whose id or command this project already has is skipped and listed, never replaced.
4063
4071
 
4064
- **In the web app**, the Persona agent's page (Agents, Persona agent) opens on its **Agent** tab: describe a person in your words ("a compliance officer who reviews every refund over 10,000 EUR") and the agent turns them into a persona in the conversation, shows it, and asks before saving it. **Personas** lists every persona by kind; open one to read what it checks and **Run as this persona**: say what they should try and a chat starts as them. **New persona** has the Persona agent draft one from your words (or write it yourself), lets you change every field, and saves it when you press Save.
4072
+ **In the web app**, the Persona agent has three pages, linked at the top right of each: **Agent**, **Personas** and **Tools and runs**. On **Agent**, describe a person in your words ("a compliance officer who reviews every refund over 10,000 EUR") and the agent turns them into a persona in the conversation, shows it, and asks before saving it. **Personas** lists every persona by kind; open one to read what it checks in a side panel, with **Edit** for your own and **Copy to edit** for a built-in one. **New persona** there opens the same kind of panel: the Persona agent drafts one from your words (or write it yourself), you change any field, and Save keeps it. To work as a persona, type its command and the task in any chat (`/priya Refund half of yesterday's order`).
4073
+
4074
+ **A persona's own skills and knowledge** are used only when an agent works as that persona (its command in a chat), never by other agents: `.forgeqe/business-personas/<id>/skills/<name>/SKILL.md` and `.forgeqe/business-personas/<id>/knowledge/<name>.md`, a folder the skills list and the document search do not read. The Persona agent drafts a skill and a knowledge note from the persona right after you save a new persona or a copy, and on **Generate skill and knowledge** in any persona's panel (a built-in one too); you review and change them, and nothing is saved until you press Save. Edit or remove them in the panel. A persona can also use the project's shared skills and documents, picked in **Edit**, with suggestions that match its domain.
4065
4075
 
4066
4076
  **The Persona agent** (`forgeqe-persona`) drafts a new persona from your words: ask "create a persona of an SME in payments", or `op: create` with `request`. It has no tools and answers in a fixed shape; ForgeQE keeps only the persona's fields, checked. A draft is shown first and saved only when you agree (`--save` asks in a terminal; `save: true` asks in the shell and the web app). It needs a live model; without one, write the persona yourself.
4067
4077
 
@@ -4092,6 +4102,53 @@ scenarios:
4092
4102
 
4093
4103
  A persona file can come from the repository, so ForgeQE reads it strictly: only these keys, each choice from its list, no YAML aliases, every text one line and clipped, at most 12 items in a list, a regular file only (no link), and a text that reads as an instruction to an agent ("ignore the rules", "run this command") is refused. A persona only describes a person: it never changes what an agent may do. These personas are separate from the accessibility personas (`.forgeqe/personas`), which set how the browser perceives the page.
4094
4104
 
4105
+ ### Business assurance
4106
+
4107
+ The **Business Testing agent** asks what a functional test does not: *how does this business really work, what could go wrong when different people use it, who could benefit from unexpected behaviour, what could the organisation lose, and what is the evidence of the actual business outcome?* An HTTP 200, a finished workflow or a confirmation message proves nothing to it.
4108
+
4109
+ It works in steps, each reading the same model of the business:
4110
+
4111
+ 1. **Discover** (`context`): from the product knowledge graph (`forgeqe knowledge build`), a model of the business: capabilities (payments, refunds, incentives, approvals, entitlements, payouts, personal data…), processes, the **rules the code enforces** (the conditions that refuse a request, with file and line), the states a record goes through, tables with personal data, and the **exposures** these suggest (a refund route with no cap on the amount, an incentive that may be granted twice, a route that acts on a record by its id with no sign-in seen). What was read is *observed*; what it means is *inferred*, and said to be.
4112
+ 2. **Hypothesise** (`hypotheses`): business questions, each with personas chosen for their motives: can two partial refunds add up to more than was paid; can a one-time coupon be used five times at the same moment; is a reward taken back when its order is returned; can a cancelled order still be shipped (a rule enforced on one journey, missing on another); can a limit be split; can someone approve their own request; can one customer act on another's order; do equivalent customers get the same price; is a refund after the payout run taken off the next payout. With a live model, the **Scenario Strategist** (`forgeqe-business-strategist`, no tools) proposes more; ForgeQE keeps only those that name things the model of the business has. When a scenario needs a persona the project lacks (an insider, a colluding merchant), it says so, and the Persona agent drafts it.
4113
+ 3. **Plan** (`plan`): an investigation: steps by one or several personas (in turn, or at the same moment for a race), each an **API call** ForgeQE sends (matched to your saved API contracts) or a **browser journey** the Orchestrator runs as the persona, and **business outcome oracles**: what the business intended, as checks over business values (`sum($refunded) <= $paid`, at most one accepted redemption, the forbidden action refused, the same outcome for equivalent customers).
4114
+ 4. **Run** (`run`): the API steps on a **test environment** of env.yaml (never one named like production), the calls that change data only after you agree. The Orchestrator does the browser steps as the personas and records what it saw (`observe`).
4115
+ 5. **Judge and report** (`report`): each investigation's outcome, worked out by code: **confirmed business failure** (an expectation that is policy, or a rule the code enforces elsewhere, was broken, with the evidence), **policy ambiguity** (the software did something unexpected, but nobody has said the expectation is policy: a question for the business), **potential risk**, **missing evidence**, or **expected behaviour**. Findings are ranked by impact, exploitability, likelihood and confidence, with an exposure range only where a breach was observed and you stated how often it could happen. Views for executives, product owners, risk and compliance, and engineering.
4116
+ 6. **Learn**: findings, a person's decisions and proposals (add a broken expectation to the personas who acted) are kept in `.forgeqe/business/memory.jsonl`; a pattern confirmed once weighs more in later hypotheses. Proposals are never applied by themselves.
4117
+
4118
+ Ask ForgeQE's agent ("test our refunds and coupons the way an opportunistic customer would", "what could the business lose in checkout?"), or at a terminal:
4119
+
4120
+ ```bash
4121
+ forgeqe business context # the model of the business (writes .forgeqe/business/context.md too)
4122
+ forgeqe business hypotheses [--focus refunds] [--model]
4123
+ forgeqe business plan <hypothesis-id> [--env qa] # writes .forgeqe/business/investigations/<id>.json; edit it, or plan again
4124
+ forgeqe business run <investigation-id> [--env qa] [--yes]
4125
+ forgeqe business observe <investigation-id> --step 2 --accepted|--refused [--value name=value] [--note TEXT]
4126
+ forgeqe business decide <investigation-id> <expectation> --policy|--permitted|--not-policy --reason TEXT
4127
+ forgeqe business report [--view executive|product|risk|engineering] [--out FILE]
4128
+ forgeqe business population [--size 200] [--seed 7] # many people drawn from the personas
4129
+ ```
4130
+
4131
+ **Populations.** A population is many people drawn from your personas, the way a business really has them: mostly legitimate customers, some opportunists, a few insiders, and the staff and partners they deal with (`--size`, and on the page the shares of opportunists and adversarial customers). Each person is one of a persona, with their own activity, the hours they act in, a monthly budget and how long they have been a customer; people are linked by what the personas say about who they deal with (`relationships`: "buys from partner-merchant", "requests approval from operations-manager", "may collude with incentive-exploiter"). It is made by code from a seed, so the same seed gives the same people, with no model. The **Personas** tab draws it as a relationship graph in the style of MiroFish's (rebuilt in ForgeQE's own code): each person a node coloured by their persona, curved edges labelled with the relation (`BUYS_FROM`, `APPROVAL_FROM`, `SHARES_DEALS_WITH`, `MAY_COLLUDE_WITH`), a picked person's or relationship's card floating at the top right, the persona types at the bottom left, Refresh and full screen; drag, pan and zoom. By keyboard, Tab to the graph, then the arrows move to the nearest person that way, R walks their relationships and F follows one to the person at its other end, Enter or Space opens the details and Escape closes them, + and − zoom, 0 fits and Shift with an arrow pans; where you are is ringed and read out to a screen reader. Populations are kept in `.forgeqe/business/populations` and read back as untrusted. They are the cast for simulations.
4132
+
4133
+ **Simulations.** A simulation plays a population on a test environment over simulated days: each hour, the people active in it act through your saved API calls. Customers place an order, pay, sometimes ask for a refund and redeem their one-time code; opportunists ask twice at once for 60% back and redeem their code five times at once. Who does what comes from the seed, so a run can be repeated exactly; values are worked out by formulas over what each person captured (`$paid * 0.6`), never by a model. Its checks judge the whole population ("the business never refunds more than it took") and each person ("nobody is refunded more than they paid", "a one-time code redeems once"), and name everyone who broke them, so a loss the totals hide still shows. It runs only on a test environment, its calls that change data only after you agree to the list shown, and never more than its call budget (`max_calls`). On the page, the **Simulation** tab plans one for the newest population, runs it, and shows the outcome, who broke each check, calls by persona and the run log; the plan can be changed and is checked again. Each simulation's latest run is also in the **Findings** report (and `forgeqe business report`): for leaders, ranked with the investigations by what needs attention, saying how many people broke each check and of which persona; for product, risk and engineering, a Simulations section with each check, who broke it by persona, the amount beyond the rule (not for product) and, for engineering, the calls by persona. Interviews are not part of the report: they are the model's account, not evidence. At a terminal:
4134
+
4135
+ ```bash
4136
+ forgeqe business simulate # plan one for the newest population
4137
+ forgeqe business simulate <simulation> [--env qa] [--yes]
4138
+ ```
4139
+
4140
+ **Interviews.** After a run you can ask any person of the population why they did what they did: on the Simulation tab, **Ask why** next to each person who broke a check, or at a terminal. The interviewer is a model with no tools; it is given that person's persona, their attributes and their own calls of that run, numbered, as data, and answers as that person, citing the calls its answer rests on. Code keeps only citations of that person's own calls, and says so when an answer cites none ("not tied to the run"). An answer is the model's account, never evidence: it never changes the outcome, and the checks stay the evidence. Interviews are kept in the simulation's `interviews.jsonl` and read back as untrusted. With no model set up, nobody is interviewed.
4141
+
4142
+ ```bash
4143
+ forgeqe business interview <simulation> <member> 'Why did you ask for a refund twice?'
4144
+ ```
4145
+
4146
+ **In the web app**, the Business assurance agent's page (Agents, or Quality Engineering, Test design, Business assurance) has its tabs at the top right: **Agent** (ask it in words; its tools and runs), **Investigations** (each one's scenario, what the business intended, Run, which first lists the calls that change data and runs them only once you agree, the evidence, what pending steps showed, and **Decide**, where you type the investigation's id), **Hypotheses** (filter by area, **Plan** one), **Model of the business** (read again from the product graph), and **Findings** for leaders, product, risk and compliance, or engineering. Switching tabs is instant and keeps what you typed; each tab has its own address. The gateway (`src/web/business.ts`) checks everything again, and audits every plan, run, observation and decision. The Persona agent's page shows and edits each persona's intent, risk appetite, motivations, permissions, constraints, mistakes and relationships.
4147
+
4148
+ Try it on `samples/business-shop`, a small shop API whose checks each return the right status for the case they were written for, and whose business still loses money: a second partial refund is checked against the order's total, not what is left to refund; a one-time coupon is checked before a slow lookup, so a burst redeems it several times; shipping does not check that the order was cancelled.
4149
+
4150
+ An investigation file can be written by hand, by the model or come from the repository, so it is read strictly: known keys only, personas and API calls only ones the project has (a contract set by its id, never a path), a call's path only a path on the API, `{{name}}` values put in a path encoded and in a body as data, values captured only from the fields named, no input named like a credential, oracles only in their small formula grammar (numbers, `$names`, `+ - *`, `sum min max count abs`; never code), at most 20 steps and 20 repeats. Deciding whether an expectation is the business's policy, or a behaviour is permitted, is a person's: `forgeqe business decide` asks you to type the investigation's id, and the agent asks you first.
4151
+
4095
4152
  ### Visual comparison
4096
4153
 
4097
4154
  Every browser run also captures each page it visits and compares it, pixel by pixel, with that page's **approved baseline**:
@@ -151,7 +151,7 @@ forgeqe docs --copy ./docs # copy the guide, the architecture page, the refere
151
151
  </div>
152
152
  <h3 class="band-title">Every feature</h3>
153
153
  <div class="area"><a href="#area-browser" class="area-name"><span class="mono">Browser</span></a><ul class="tiles"><li><a href="#cap-browser-goals" class="tile"><b>Run any goal in a real browser</b><span>Go to booking.com and search hotels in Mumbai for next weekend</span></a></li><li><a href="#cap-logins" class="tile"><b>Saved logins for the application under test</b><span>Sign in to the admin site and keep the session</span></a></li><li><a href="#cap-record-web" class="tile"><b>Record a web test by hand</b><span>I'll show you the checkout steps in the shop: record them</span></a></li></ul></div>
154
- <div class="area"><a href="#area-test-cases" class="area-name"><span class="mono">Test cases</span></a><ul class="tiles"><li><a href="#cap-run-test-cases" class="tile"><b>Run manual test cases in browsers</b><span>Run SHOP-12 and SHOP-14 from Jira, two browsers at once</span></a></li><li><a href="#cap-test-case-quality" class="tile"><b>Check and improve test cases</b><span>Are the cases in test plan 12 good enough to run?</span></a></li><li><a href="#cap-write-test-cases" class="tile"><b>Write test cases from a story</b><span>Write test cases for story 1234 and save them</span></a></li><li><a href="#cap-domain-compliance" class="tile"><b>Domain and regulatory test design</b><span>Write test cases for story 1234, covering our DORA and PSD2 obligations</span></a></li><li><a href="#cap-exploratory-testing" class="tile"><b>Exploratory testing of a story</b><span>Explore story 1234 and find bugs</span></a></li><li><a href="#cap-business-personas" class="tile"><b>Business personas for testing</b><span>Create a persona of an SME in payments</span></a></li></ul></div>
154
+ <div class="area"><a href="#area-test-cases" class="area-name"><span class="mono">Test cases</span></a><ul class="tiles"><li><a href="#cap-run-test-cases" class="tile"><b>Run manual test cases in browsers</b><span>Run SHOP-12 and SHOP-14 from Jira, two browsers at once</span></a></li><li><a href="#cap-test-case-quality" class="tile"><b>Check and improve test cases</b><span>Are the cases in test plan 12 good enough to run?</span></a></li><li><a href="#cap-write-test-cases" class="tile"><b>Write test cases from a story</b><span>Write test cases for story 1234 and save them</span></a></li><li><a href="#cap-domain-compliance" class="tile"><b>Domain and regulatory test design</b><span>Write test cases for story 1234, covering our DORA and PSD2 obligations</span></a></li><li><a href="#cap-exploratory-testing" class="tile"><b>Exploratory testing of a story</b><span>Explore story 1234 and find bugs</span></a></li><li><a href="#cap-business-personas" class="tile"><b>Business personas for testing</b><span>Create a persona of an SME in payments</span></a></li><li><a href="#cap-business-assurance" class="tile"><b>Business assurance: testing as the business, its customers and its opportunists</b><span>Test our refunds and coupons the way an opportunistic customer would</span></a></li></ul></div>
155
155
  <div class="area"><a href="#area-setup" class="area-name"><span class="mono">Setup</span></a><ul class="tiles"><li><a href="#cap-test-apps" class="tile"><b>Test environments and their apps</b><span>Place an order in the shop, then check its invoice in Billing, in UAT</span></a></li><li><a href="#cap-generated-code" class="tile"><b>What ForgeQE wrote</b><span>How much of the code ForgeQE wrote is still there?</span></a></li><li><a href="#cap-forgeqe-commands" class="tile"><b>Every forgeqe command from the shell</b><span>Show me the context budget</span></a></li><li><a href="#cap-product-knowledge" class="tile"><b>Product knowledge from the product's repositories</b><span>How does the product cancel an order? Show the endpoints and tables involved</span></a></li><li><a href="#cap-knowledge-agent" class="tile"><b>The Knowledge agent: what ForgeQE understood, and your corrections</b><span>What do you know about refunds?</span></a></li><li><a href="#cap-document-search" class="tile"><b>Search the project's documents, without vectors</b><span>What does the payments spec say about refund limits?</span></a></li><li><a href="#cap-setup-help" class="tile"><b>Setup, skills, and documentation</b><span>What can you do?</span></a></li></ul></div>
156
156
  <div class="area"><a href="#area-desktop" class="area-name"><span class="mono">Desktop</span></a><ul class="tiles"><li><a href="#cap-desktop-apps" class="tile"><b>Automate Windows desktop apps</b><span>Create an invoice for Contoso in the Billing app and save it as a test</span></a></li></ul></div>
157
157
  <div class="area"><a href="#area-mobile" class="area-name"><span class="mono">Mobile</span></a><ul class="tiles"><li><a href="#cap-mobile-apps" class="tile"><b>Automate Android and iOS apps</b><span>Sign in to the courier app and accept the first delivery, and save it as a test</span></a></li></ul></div>
@@ -1569,13 +1569,15 @@ Acceptance criteria:
1569
1569
  forgeqe persona show payments-sme # one persona and the brief agents act on
1570
1570
  forgeqe persona create &quot;an SME in card payments who reconciles settlements&quot; --domain payments --kind sme [--save]
1571
1571
  </code></pre></div>
1572
- <p>Built in: <code>payments-sme</code> (<code>/priya</code>), <code>retail-customer</code> (<code>/sam</code>), <code>compliance-specialist</code> (<code>/dana</code>), <code>operations-manager</code> (<code>/lee</code>), <code>first-time-user</code> (<code>/alex</code>).</p>
1572
+ <p>Built in: <code>payments-sme</code> (<code>/priya</code>), <code>retail-customer</code> (<code>/sam</code>), <code>compliance-specialist</code> (<code>/dana</code>), <code>operations-manager</code> (<code>/lee</code>), <code>first-time-user</code> (<code>/alex</code>), and three risk-oriented personas the <a href="#doc-how_to_use-business-assurance">Business Testing agent</a> uses: <code>incentive-exploiter</code> (<code>/max</code>, an opportunistic deal hunter), <code>insider-agent</code> (<code>/rory</code>, a customer service agent who misuses refund and credit rights) and <code>partner-merchant</code> (<code>/morgan</code>, a marketplace merchant watching payout timing).</p>
1573
+ <p>Besides what they know and check, a persona can say <strong>why they act</strong> (<code>intent</code>: <code>legitimate</code>, <code>opportunistic</code> or <code>adversarial</code>, with a <code>risk_appetite</code>), what drives them (<code>motivations</code>), what their role lets them do in the app (<code>permissions</code>), the limits they work within (<code>constraints</code>), the mistakes they plausibly make (<code>mistakes</code>) and who they deal with (<code>relationships</code>, by persona id). Each saved change raises its <code>version</code>.</p>
1573
1574
  <p><strong>Every persona is a command in every agent's chat.</strong> Start a message with it and the task: <code>/priya Validate the payment change</code>. It works in the terminal shell (typing <code>/</code> suggests the personas with the shell's commands), <code>forgeqe run &quot;/priya …&quot;</code>, every chat box of the web app (typing <code>/</code> at the start offers the personas) and a custom agent's chat. ForgeQE turns the command into the persona's brief, quoted as data, and your task after it, so the agent acts as that person, puts the brief at the start of its browser runs, and judges the app by what they check. A persona's command is its <code>handle</code> (its id when it has none): a word of lower-case letters, digits and dashes that is never one of the shell's own commands or another persona's.</p>
1574
1575
  <div class="code"><div class="code-bar"><i></i><i></i><i></i><span>bash</span><button class="copy-code" type="button">Copy</button></div><pre><code>forgeqe persona export --out personas.json # your own personas, as a file to share
1575
1576
  forgeqe persona import personas.json # another project's: new ones only, never replacing one here
1576
1577
  </code></pre></div>
1577
1578
  <p><strong>Sharing personas:</strong> the Persona agent's page (Personas tab) has Export and Import, and so does <code>forgeqe persona export|import</code>. The file is JSON of the personas' fields. An import is checked as strictly as a persona file. The whole file is refused when any persona in it is refused, and a persona whose id or command this project already has is skipped and listed, never replaced.</p>
1578
- <p><strong>In the web app</strong>, the Persona agent's page (Agents, Persona agent) opens on its <strong>Agent</strong> tab: describe a person in your words (&quot;a compliance officer who reviews every refund over 10,000 EUR&quot;) and the agent turns them into a persona in the conversation, shows it, and asks before saving it. <strong>Personas</strong> lists every persona by kind; open one to read what it checks and <strong>Run as this persona</strong>: say what they should try and a chat starts as them. <strong>New persona</strong> has the Persona agent draft one from your words (or write it yourself), lets you change every field, and saves it when you press Save.</p>
1579
+ <p><strong>In the web app</strong>, the Persona agent has three pages, linked at the top right of each: <strong>Agent</strong>, <strong>Personas</strong> and <strong>Tools and runs</strong>. On <strong>Agent</strong>, describe a person in your words (&quot;a compliance officer who reviews every refund over 10,000 EUR&quot;) and the agent turns them into a persona in the conversation, shows it, and asks before saving it. <strong>Personas</strong> lists every persona by kind; open one to read what it checks in a side panel, with <strong>Edit</strong> for your own and <strong>Copy to edit</strong> for a built-in one. <strong>New persona</strong> there opens the same kind of panel: the Persona agent drafts one from your words (or write it yourself), you change any field, and Save keeps it. To work as a persona, type its command and the task in any chat (<code>/priya Refund half of yesterday's order</code>).</p>
1580
+ <p><strong>A persona's own skills and knowledge</strong> are used only when an agent works as that persona (its command in a chat), never by other agents: <code>.forgeqe/business-personas/&lt;id&gt;/skills/&lt;name&gt;/SKILL.md</code> and <code>.forgeqe/business-personas/&lt;id&gt;/knowledge/&lt;name&gt;.md</code>, a folder the skills list and the document search do not read. The Persona agent drafts a skill and a knowledge note from the persona right after you save a new persona or a copy, and on <strong>Generate skill and knowledge</strong> in any persona's panel (a built-in one too); you review and change them, and nothing is saved until you press Save. Edit or remove them in the panel. A persona can also use the project's shared skills and documents, picked in <strong>Edit</strong>, with suggestions that match its domain.</p>
1579
1581
  <p><strong>The Persona agent</strong> (<code>forgeqe-persona</code>) drafts a new persona from your words: ask &quot;create a persona of an SME in payments&quot;, or <code>op: create</code> with <code>request</code>. It has no tools and answers in a fixed shape; ForgeQE keeps only the persona's fields, checked. A draft is shown first and saved only when you agree (<code>--save</code> asks in a terminal; <code>save: true</code> asks in the shell and the web app). It needs a live model; without one, write the persona yourself.</p>
1580
1582
  <p><strong>Your own personas</strong> are <code>.forgeqe/business-personas/&lt;id&gt;.yaml</code>, shared with everyone who uses the repository. Saving one also writes its profile as <code>&lt;id&gt;.md</code> beside it, made from its fields, for people and agents that read the project's documents. The YAML is the persona; the <code>.md</code> is written again whenever the persona is saved:</p>
1581
1583
  <div class="code"><div class="code-bar"><i></i><i></i><i></i><span>yaml</span><button class="copy-code" type="button">Copy</button></div><pre><code>id: merchant-onboarding-sme
@@ -1604,6 +1606,53 @@ scenarios:
1604
1606
  </section>
1605
1607
  </div>
1606
1608
  </article>
1609
+ <article class="spec feat" id="cap-business-assurance">
1610
+ <div class="hd"><span class="mono">Test cases</span><h3>Business assurance: testing as the business, its customers and its opportunists</h3></div>
1611
+ <p class="ds">The Business Testing agent: builds a model of how the business works from the product's code (capabilities, processes, the rules the code enforces, record states, personal data), asks business questions rather than functional ones (can a refund exceed what was paid, can a one-time coupon be used twice at once, can a rule on one journey be bypassed on another, can one customer act on another's order), plays them out as multi-persona scenarios through the API and the browser on a test environment, and judges business outcomes rather than HTTP statuses. Findings are classed as confirmed failures, potential risks, policy ambiguities or missing evidence, ranked by business impact, with exposure estimated only from observed breaches and stated assumptions.</p>
1612
+ <div class="facts">
1613
+ <div class="fact"><span class="mono">Ask it</span><ul class="asks"><li>Test our refunds and coupons the way an opportunistic customer would</li><li>Find business-logic flaws in the order process</li><li>Give me the business assurance report for executives</li></ul></div>
1614
+ <div class="fact"><span class="mono">What it needs</span><ul class="needs"><li><span class="need opt">Optional</span><span>A live model profile in llms.json (an API key or Microsoft Entra ID sign-in)</span></li></ul></div>
1615
+ <div class="fact"><span class="mono">Limits</span><ul class="plainlist"><li>Its model of the business comes from the product knowledge graph (forgeqe knowledge build): what the code does not show, it does not know</li><li>API steps run only on a test environment of env.yaml, never one named like production; calls that change data run only after you agree</li><li>A violated expectation is a confirmed failure only when it is policy or a rule the code enforces; otherwise it is a question for the business, which only a person answers</li></ul></div>
1616
+ <div class="fact"><span class="mono">Tools</span><p class="tools"><code>business_assurance</code></p></div>
1617
+ </div>
1618
+ <div class="detail"><span class="mono">In detail</span>
1619
+ <section class="doc" id="doc-how_to_use-business-assurance">
1620
+ <h4>Business assurance</h4>
1621
+ <div class="prose"><p>The <strong>Business Testing agent</strong> asks what a functional test does not: <em>how does this business really work, what could go wrong when different people use it, who could benefit from unexpected behaviour, what could the organisation lose, and what is the evidence of the actual business outcome?</em> An HTTP 200, a finished workflow or a confirmation message proves nothing to it.</p>
1622
+ <p>It works in steps, each reading the same model of the business:</p>
1623
+ <ol>
1624
+ <li><strong>Discover</strong> (<code>context</code>): from the product knowledge graph (<code>forgeqe knowledge build</code>), a model of the business: capabilities (payments, refunds, incentives, approvals, entitlements, payouts, personal data…), processes, the <strong>rules the code enforces</strong> (the conditions that refuse a request, with file and line), the states a record goes through, tables with personal data, and the <strong>exposures</strong> these suggest (a refund route with no cap on the amount, an incentive that may be granted twice, a route that acts on a record by its id with no sign-in seen). What was read is <em>observed</em>; what it means is <em>inferred</em>, and said to be.</li>
1625
+ <li><strong>Hypothesise</strong> (<code>hypotheses</code>): business questions, each with personas chosen for their motives: can two partial refunds add up to more than was paid; can a one-time coupon be used five times at the same moment; is a reward taken back when its order is returned; can a cancelled order still be shipped (a rule enforced on one journey, missing on another); can a limit be split; can someone approve their own request; can one customer act on another's order; do equivalent customers get the same price; is a refund after the payout run taken off the next payout. With a live model, the <strong>Scenario Strategist</strong> (<code>forgeqe-business-strategist</code>, no tools) proposes more; ForgeQE keeps only those that name things the model of the business has. When a scenario needs a persona the project lacks (an insider, a colluding merchant), it says so, and the Persona agent drafts it.</li>
1626
+ <li><strong>Plan</strong> (<code>plan</code>): an investigation: steps by one or several personas (in turn, or at the same moment for a race), each an <strong>API call</strong> ForgeQE sends (matched to your saved API contracts) or a <strong>browser journey</strong> the Orchestrator runs as the persona, and <strong>business outcome oracles</strong>: what the business intended, as checks over business values (<code>sum($refunded) &lt;= $paid</code>, at most one accepted redemption, the forbidden action refused, the same outcome for equivalent customers).</li>
1627
+ <li><strong>Run</strong> (<code>run</code>): the API steps on a <strong>test environment</strong> of env.yaml (never one named like production), the calls that change data only after you agree. The Orchestrator does the browser steps as the personas and records what it saw (<code>observe</code>).</li>
1628
+ <li><strong>Judge and report</strong> (<code>report</code>): each investigation's outcome, worked out by code: <strong>confirmed business failure</strong> (an expectation that is policy, or a rule the code enforces elsewhere, was broken, with the evidence), <strong>policy ambiguity</strong> (the software did something unexpected, but nobody has said the expectation is policy: a question for the business), <strong>potential risk</strong>, <strong>missing evidence</strong>, or <strong>expected behaviour</strong>. Findings are ranked by impact, exploitability, likelihood and confidence, with an exposure range only where a breach was observed and you stated how often it could happen. Views for executives, product owners, risk and compliance, and engineering.</li>
1629
+ <li><strong>Learn</strong>: findings, a person's decisions and proposals (add a broken expectation to the personas who acted) are kept in <code>.forgeqe/business/memory.jsonl</code>; a pattern confirmed once weighs more in later hypotheses. Proposals are never applied by themselves.</li>
1630
+ </ol>
1631
+ <p>Ask ForgeQE's agent (&quot;test our refunds and coupons the way an opportunistic customer would&quot;, &quot;what could the business lose in checkout?&quot;), or at a terminal:</p>
1632
+ <div class="code"><div class="code-bar"><i></i><i></i><i></i><span>bash</span><button class="copy-code" type="button">Copy</button></div><pre><code>forgeqe business context # the model of the business (writes .forgeqe/business/context.md too)
1633
+ forgeqe business hypotheses [--focus refunds] [--model]
1634
+ forgeqe business plan &lt;hypothesis-id&gt; [--env qa] # writes .forgeqe/business/investigations/&lt;id&gt;.json; edit it, or plan again
1635
+ forgeqe business run &lt;investigation-id&gt; [--env qa] [--yes]
1636
+ forgeqe business observe &lt;investigation-id&gt; --step 2 --accepted|--refused [--value name=value] [--note TEXT]
1637
+ forgeqe business decide &lt;investigation-id&gt; &lt;expectation&gt; --policy|--permitted|--not-policy --reason TEXT
1638
+ forgeqe business report [--view executive|product|risk|engineering] [--out FILE]
1639
+ forgeqe business population [--size 200] [--seed 7] # many people drawn from the personas
1640
+ </code></pre></div>
1641
+ <p><strong>Populations.</strong> A population is many people drawn from your personas, the way a business really has them: mostly legitimate customers, some opportunists, a few insiders, and the staff and partners they deal with (<code>--size</code>, and on the page the shares of opportunists and adversarial customers). Each person is one of a persona, with their own activity, the hours they act in, a monthly budget and how long they have been a customer; people are linked by what the personas say about who they deal with (<code>relationships</code>: &quot;buys from partner-merchant&quot;, &quot;requests approval from operations-manager&quot;, &quot;may collude with incentive-exploiter&quot;). It is made by code from a seed, so the same seed gives the same people, with no model. The <strong>Personas</strong> tab draws it as a relationship graph in the style of MiroFish's (rebuilt in ForgeQE's own code): each person a node coloured by their persona, curved edges labelled with the relation (<code>BUYS_FROM</code>, <code>APPROVAL_FROM</code>, <code>SHARES_DEALS_WITH</code>, <code>MAY_COLLUDE_WITH</code>), a picked person's or relationship's card floating at the top right, the persona types at the bottom left, Refresh and full screen; drag, pan and zoom. By keyboard, Tab to the graph, then the arrows move to the nearest person that way, R walks their relationships and F follows one to the person at its other end, Enter or Space opens the details and Escape closes them, + and − zoom, 0 fits and Shift with an arrow pans; where you are is ringed and read out to a screen reader. Populations are kept in <code>.forgeqe/business/populations</code> and read back as untrusted. They are the cast for simulations.</p>
1642
+ <p><strong>Simulations.</strong> A simulation plays a population on a test environment over simulated days: each hour, the people active in it act through your saved API calls. Customers place an order, pay, sometimes ask for a refund and redeem their one-time code; opportunists ask twice at once for 60% back and redeem their code five times at once. Who does what comes from the seed, so a run can be repeated exactly; values are worked out by formulas over what each person captured (<code>$paid * 0.6</code>), never by a model. Its checks judge the whole population (&quot;the business never refunds more than it took&quot;) and each person (&quot;nobody is refunded more than they paid&quot;, &quot;a one-time code redeems once&quot;), and name everyone who broke them, so a loss the totals hide still shows. It runs only on a test environment, its calls that change data only after you agree to the list shown, and never more than its call budget (<code>max_calls</code>). On the page, the <strong>Simulation</strong> tab plans one for the newest population, runs it, and shows the outcome, who broke each check, calls by persona and the run log; the plan can be changed and is checked again. Each simulation's latest run is also in the <strong>Findings</strong> report (and <code>forgeqe business report</code>): for leaders, ranked with the investigations by what needs attention, saying how many people broke each check and of which persona; for product, risk and engineering, a Simulations section with each check, who broke it by persona, the amount beyond the rule (not for product) and, for engineering, the calls by persona. Interviews are not part of the report: they are the model's account, not evidence. At a terminal:</p>
1643
+ <div class="code"><div class="code-bar"><i></i><i></i><i></i><span>bash</span><button class="copy-code" type="button">Copy</button></div><pre><code>forgeqe business simulate # plan one for the newest population
1644
+ forgeqe business simulate &lt;simulation&gt; [--env qa] [--yes]
1645
+ </code></pre></div>
1646
+ <p><strong>Interviews.</strong> After a run you can ask any person of the population why they did what they did: on the Simulation tab, <strong>Ask why</strong> next to each person who broke a check, or at a terminal. The interviewer is a model with no tools; it is given that person's persona, their attributes and their own calls of that run, numbered, as data, and answers as that person, citing the calls its answer rests on. Code keeps only citations of that person's own calls, and says so when an answer cites none (&quot;not tied to the run&quot;). An answer is the model's account, never evidence: it never changes the outcome, and the checks stay the evidence. Interviews are kept in the simulation's <code>interviews.jsonl</code> and read back as untrusted. With no model set up, nobody is interviewed.</p>
1647
+ <div class="code"><div class="code-bar"><i></i><i></i><i></i><span>bash</span><button class="copy-code" type="button">Copy</button></div><pre><code>forgeqe business interview &lt;simulation&gt; &lt;member&gt; 'Why did you ask for a refund twice?'
1648
+ </code></pre></div>
1649
+ <p><strong>In the web app</strong>, the Business assurance agent's page (Agents, or Quality Engineering, Test design, Business assurance) has its tabs at the top right: <strong>Agent</strong> (ask it in words; its tools and runs), <strong>Investigations</strong> (each one's scenario, what the business intended, Run, which first lists the calls that change data and runs them only once you agree, the evidence, what pending steps showed, and <strong>Decide</strong>, where you type the investigation's id), <strong>Hypotheses</strong> (filter by area, <strong>Plan</strong> one), <strong>Model of the business</strong> (read again from the product graph), and <strong>Findings</strong> for leaders, product, risk and compliance, or engineering. Switching tabs is instant and keeps what you typed; each tab has its own address. The gateway (<code>src/web/business.ts</code>) checks everything again, and audits every plan, run, observation and decision. The Persona agent's page shows and edits each persona's intent, risk appetite, motivations, permissions, constraints, mistakes and relationships.</p>
1650
+ <p>Try it on <code>samples/business-shop</code>, a small shop API whose checks each return the right status for the case they were written for, and whose business still loses money: a second partial refund is checked against the order's total, not what is left to refund; a one-time coupon is checked before a slow lookup, so a burst redeems it several times; shipping does not check that the order was cancelled.</p>
1651
+ <p>An investigation file can be written by hand, by the model or come from the repository, so it is read strictly: known keys only, personas and API calls only ones the project has (a contract set by its id, never a path), a call's path only a path on the API, <code>{{name}}</code> values put in a path encoded and in a body as data, values captured only from the fields named, no input named like a credential, oracles only in their small formula grammar (numbers, <code>$names</code>, <code>+ - *</code>, <code>sum min max count abs</code>; never code), at most 20 steps and 20 repeats. Deciding whether an expectation is the business's policy, or a behaviour is permitted, is a person's: <code>forgeqe business decide</code> asks you to type the investigation's id, and the agent asks you first.</p>
1652
+ </div>
1653
+ </section>
1654
+ </div>
1655
+ </article>
1607
1656
  </section>
1608
1657
  <section class="chapter" id="area-setup" aria-labelledby="area-setup-h">
1609
1658
  <header class="chead"><img class="pix pix--chapter" src="../img/icons/healer.svg" alt="" width="40" height="40"><span class="mono">06</span><h2 id="area-setup-h">Setup</h2><p>Configuration, skills, and help</p></header>
@@ -2120,7 +2169,7 @@ view, in the manner of ForgeQE's own architecture map: each kind of part a tinte
2120
2169
  data and messages), the outside services in a column on the right, and wires at right angles from card to card, as
2121
2170
  wide as the page and as tall as the window. A green wire is a call a run saw, a dotted amber one a run made differently,
2122
2171
  a dashed one goes to an outside system, and a grey one is read in the code or configuration. Hover over or tab to a part
2123
- to trace what it sends and receives; the How they talk tab lists every link in words. Select a service to see it from the inside: its endpoints with the authentication
2172
+ to trace what it sends and receives; the How they talk tab draws every link as a relationship graph (the Personas tab's: each part coloured by its band, each line named by what it does, a part or link picked showing how it is known) and then lists them in words. These graphs are laid out in order, not by forces, so the same product always comes out the same: the product and How they talk as an architecture diagram that fills its panel: a full-width tier per band from top to bottom (front ends, gateways, services, data and messages, platform), test suites in a column at the left and outside systems at the right, each tier's parts spread evenly across it (onto more lines when crowded) and ordered so lines cross as little as they can; folders and clusters as round areas in centred rows, sibling folders side by side, each area's files packed from its middle out, the most linked in the middle and named (zoom in, point at or select a file for the others). The Code map's Graph view, at All repositories, draws the product: each repository (coloured by its band on the services map, sized by its files), the data stores and outside systems they share, and a line for each kind of connection with how many (calls, events and shared data from the services map; imports and calls in code that crosses repositories). Select a repository for what it holds (files, tests, lines, languages, main folders) and what it talks to and is used by, then open it; inside it, click a folder's name in the graph (or pick it in Folder) to open that folder, and go back by the path above the graph (All repositories › repository › folder). The side panel lists the repositories at All repositories, and inside one says what it holds and what it connects to, each other repository a link. Inside a repository, Graph's Arrange by draws it as an architecture diagram by default (Layers: a tier for each layer, front end, API and routes, services and domain, data access and other code, from top to bottom, tests at the left and shared code and config at the right; each file's layer is worked out from its folders, name and kind, a guess from names only) or as its folders (Folders). The Graph and Cluster views draw files the same way, coloured and placed by folder, repository or cluster (in Graph, each folder or repository in its named outline), a selected file's links lit and the files a change to it reaches ringed in orange; a part's evidence panel draws what the part is linked to; and the Impact page's map draws the change the same way, arranged by steps from the change by default (an architecture diagram of the change: a tier for the changed files at the top, then each step away, the files it does not reach as small dots at the bottom, tests that reach it at the left and files in other repositories at the right) or by folders (Arrange by), each file in its colour by impact, steps from the change or how often it changes (the legend in the graph, with counts), each folder in its named outline (in the Internal view in the colour of its file nearest the change; another repository's in blue), a selected or pointed-at file lighting its chain back to the change. The keys are the Personas graph's. Select a service to see it from the inside: its endpoints with the authentication
2124
2173
  they need, who calls them and what a change to one reaches; what it calls, reads, writes, publishes and uses. Each part
2125
2174
  opens its evidence (the file and line, or the run's call), and each open question has Investigate, which asks
2126
2175
  ForgeQE's agent in a chat.</p>