@capagents/forgeqe 2.9.4 → 2.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/HOW_TO_USE.md +6 -2
- package/dist/docs-site/docs/architecture/index.html +1 -1
- package/dist/docs-site/docs/index.html +7 -8
- package/dist/docs-site/docs/search.js +1 -1
- package/dist/forgeqe.js +1652 -1644
- package/dist/web/assets/{Agent-djRg2i0o.js → Agent-BU8FKiQt.js} +1 -1
- package/dist/web/assets/{ApiTests-Becz5PP-.js → ApiTests-Bsv3NhD5.js} +1 -1
- package/dist/web/assets/{Browse-_TcGuZ8l.js → Browse-D-ho9bS_.js} +2 -2
- package/dist/web/assets/{Chat-VERzcB2r.js → Chat-czaM5kUi.js} +1 -1
- package/dist/web/assets/{CommandPalette-5QEcqEYi.js → CommandPalette-CrLuxoE5.js} +1 -1
- package/dist/web/assets/{Compare-Dl4z18KO.js → Compare-DfHMTNGi.js} +1 -1
- package/dist/web/assets/{Cost-B_i8IzAR.js → Cost-BYb3T8-c.js} +1 -1
- package/dist/web/assets/{Data-DKSQEWFO.js → Data-EF_k6c_T.js} +1 -1
- package/dist/web/assets/{Desktop-DkNohPJ7.js → Desktop-DY5Q1Sd3.js} +1 -1
- package/dist/web/assets/{DesktopReview-BUgkvk9D.js → DesktopReview-DFKpYor2.js} +1 -1
- package/dist/web/assets/{Evidence-Bmr0i0nA.js → Evidence-Db9H4-Nu.js} +1 -1
- package/dist/web/assets/{Explore-oz_P_CL1.js → Explore-B0EkFCFe.js} +1 -1
- package/dist/web/assets/{Features-CxcjdJkb.js → Features-8jsv2A1d.js} +1 -1
- package/dist/web/assets/{Flags-DF0H61Vl.js → Flags-DtzmOA5o.js} +1 -1
- package/dist/web/assets/{Flaky-DkjqrHrF.js → Flaky-BCzOx7Mq.js} +1 -1
- package/dist/web/assets/{Impact-DiTAOm8k.js → Impact-Da9L1tDd.js} +1 -1
- package/dist/web/assets/{Jobs-DR_mV4Mu.js → Jobs-CHw00lcx.js} +1 -1
- package/dist/web/assets/{KindPage-CLRfAada.js → KindPage-DiOmtzVZ.js} +1 -1
- package/dist/web/assets/{Migration-DQgCEr0G.js → Migration-Cu4JgOj1.js} +1 -1
- package/dist/web/assets/{Product-165KSr60.js → Product-DmvUI7pH.js} +1 -1
- package/dist/web/assets/{Production-DoF4CcF-.js → Production-CLoOV4jl.js} +1 -1
- package/dist/web/assets/{Quality-CEVce0Rs.js → Quality-ylTg9e0c.js} +1 -1
- package/dist/web/assets/{Readiness-DcnpsaAD.js → Readiness-BMD5Uj8D.js} +1 -1
- package/dist/web/assets/{Record-B7hLtTK5.js → Record-CoCnmfqW.js} +1 -1
- package/dist/web/assets/{Regression-BMftRz5h.js → Regression-D_Hy9bMt.js} +1 -1
- package/dist/web/assets/{Reports-sL20ZyMf.js → Reports-DXphAHAy.js} +1 -1
- package/dist/web/assets/{Response-C2roHnWk.js → Response-PDQ8zEZU.js} +1 -1
- package/dist/web/assets/{RunDiff-C0AZaAAA.js → RunDiff-C3MIKipo.js} +1 -1
- package/dist/web/assets/{Runs-CIgHrNZ7.js → Runs-DSQZwCpE.js} +1 -1
- package/dist/web/assets/{Steps-GPPeoUP-.js → Steps-CY6WROAr.js} +1 -1
- package/dist/web/assets/{TestCases-xpJiurmK.js → TestCases-BjgWdtPi.js} +1 -1
- package/dist/web/assets/{TestData-D07oKCRW.js → TestData-CDziNp2d.js} +1 -1
- package/dist/web/assets/{TestDebt-BaXdxqnZ.js → TestDebt-D59zFYSu.js} +1 -1
- package/dist/web/assets/{Tosca-BfIh2vCw.js → Tosca-umw1O224.js} +1 -1
- package/dist/web/assets/{WhatsNew-rQKGxI3X.js → WhatsNew-DqNMAytd.js} +1 -1
- package/dist/web/assets/{dataParts-D9LZxYD6.js → dataParts-DGVc48Ed.js} +1 -1
- package/dist/web/assets/{fold-D1JElpyx.js → fold-BKAl2p_2.js} +1 -1
- package/dist/web/assets/{frame-CgFXIaLn.js → frame-B0nzdTfN.js} +2 -2
- package/dist/web/assets/{index-BoLw7yMm.js → index-BLUj4Sgh.js} +5 -5
- package/dist/web/assets/{logos-BGd4nsug.js → logos-J0WPxDqj.js} +1 -1
- package/dist/web/assets/{palette-BWPcuOsU.js → palette-DViz4KwG.js} +1 -1
- package/dist/web/assets/{qualityParts-9olnn4fj.js → qualityParts-DnbSeK-G.js} +1 -1
- package/dist/web/assets/{rows-BWeaaykT.js → rows-CbXelp5_.js} +1 -1
- package/dist/web/assets/{thread-B8W__QtF.js → thread-BIUxcjeu.js} +1 -1
- package/dist/web/assets/{usePageChat-DvfE62rZ.js → usePageChat-DMOtRwzT.js} +1 -1
- package/dist/web/index.html +2 -2
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/user-guide.html +7 -8
- package/forgeqe.example.yaml +2 -0
- package/package.json +1 -1
- package/prompts/README.md +1 -0
- package/prompts/heal.md +2 -0
- package/prompts/page-differs.md +16 -0
- package/prompts/test-agent.md +4 -3
- package/prompts/test-rules.md +1 -10
- package/py/forgeqe_engine/copilot_gateway.py +31 -0
- package/py/forgeqe_engine/persona.py +28 -11
- package/py/forgeqe_engine/service.py +2 -0
package/HOW_TO_USE.md
CHANGED
|
@@ -1125,7 +1125,7 @@ A card says which it did and why (*Extending PracticeTests.Flow · covers 12 of
|
|
|
1125
1125
|
|
|
1126
1126
|
**Why a test failed.** When ForgeQE's run of Scribe's test fails, the ✗ line and the next attempt say why in the test's own words: dotnet test's Error Message, pytest's `E` lines, or the error with its Expected and Received values (Playwright, Jest, JUnit), not the runner's summary line.
|
|
1127
1127
|
|
|
1128
|
-
**Keeping Scribe's cost down.** ForgeQE reads the repository's test setup itself before Scribe starts (stack, settings files and their browser values, the test id attribute, base classes, page objects and their methods, one test command) and hands it over, so Scribe does not discover it with dozens of file reads. Each attempt after the first starts a fresh session from a summary of the job (handoff, files changed, what each attempt did, the latest failure), so later attempts cost about what the first did. The summary has a "Tried already, and did not work" list: for each failed attempt, what Scribe said it did (it reports each change in `tried`), how it failed, the locator the test was waiting for and the element that covered it and took the click, both read from the test's output, and whether an earlier attempt already failed on that locator. Scribe must not try those again in the same form and must say what it does differently. `forgeqe heal` keeps the same list across its attempts. `code.max_attempts` (default 3) and `code.max_tokens` (default 1,500,000; `0` turns it off) cap a job, and the token budget is checked during an attempt too, so one long attempt is stopped when the total passes it. Cached input counts at its share of the profile's input price (a session re-reads its own context, and that is most of its input), and in full when no cached price is known, such as with another `code.model`. The reviewer sorts its issues into correctness (the test does not test what the goal says, or not reliably) and coding standards (test data or credentials in a page object, naming, hard waits, leftovers). Coding standards never fail a test that works: it is accepted, and the coding agent gets one more round (not counted in `max_attempts`) to fix them; if that round breaks the test, ForgeQE puts back the version that passed and lists the standards issues in the notes (`code.tidy: false` skips the round). A test the reviewer rejects twice for correctness stops the job with its issues, since that usually means the test case and the page disagree. When a test passed and the reviewer sent it back, and the changes for the review then break it (or the attempts or the token budget run out first), ForgeQE puts back the version that passed: the result is passed but not approved, with the reviewer's issues in the notes, so you get a working test to finish instead of none. Under each step, the handoff shows that step's part of the page (its section and neighbours, from the replay's page snapshot) instead of whole snapshots. When a test fails, ForgeQE shows the failing element on the test's page at the failure and on the replay's page, so most failures are fixed without opening a browser. Scribe's live browser is switched on only when the same failure repeats, and it does not send a page snapshot after every click or keystroke. `code.max_steps` (default 50) caps the tool calls in one of Scribe's turns. `code.review_profile` runs the reviewer on a cheaper llms.json profile.
|
|
1128
|
+
**Keeping Scribe's cost down.** ForgeQE reads the repository's test setup itself before Scribe starts (stack, settings files and their browser values, the test id attribute, base classes, page objects and their methods, one test command) and hands it over, so Scribe does not discover it with dozens of file reads. Each attempt after the first starts a fresh session from a summary of the job (handoff, files changed, what each attempt did, the latest failure), so later attempts cost about what the first did. The summary has a "Tried already, and did not work" list: for each failed attempt, what Scribe said it did (it reports each change in `tried`), how it failed, the locator the test was waiting for and the element that covered it and took the click, both read from the test's output, and whether an earlier attempt already failed on that locator. Scribe must not try those again in the same form and must say what it does differently. `forgeqe heal` keeps the same list across its attempts. `code.max_attempts` (default 3) and `code.max_tokens` (default 1,500,000; `0` turns it off) cap a job, and the token budget is checked during an attempt too, so one long attempt is stopped when the total passes it. Cached input counts at its share of the profile's input price (a session re-reads its own context, and that is most of its input), and in full when no cached price is known, such as with another `code.model`. The reviewer sorts its issues into correctness (the test does not test what the goal says, or not reliably) and coding standards (test data or credentials in a page object, naming, hard waits, leftovers). Coding standards never fail a test that works: it is accepted, and the coding agent gets one more round (not counted in `max_attempts`) to fix them; if that round breaks the test, ForgeQE puts back the version that passed and lists the standards issues in the notes (`code.tidy: false` skips the round). A test the reviewer rejects twice for correctness stops the job with its issues, since that usually means the test case and the page disagree. When a test passed and the reviewer sent it back, and the changes for the review then break it (or the attempts or the token budget run out first), ForgeQE puts back the version that passed: the result is passed but not approved, with the reviewer's issues in the notes, so you get a working test to finish instead of none. Under each step, the handoff shows that step's part of the page (its section and neighbours, from the replay's page snapshot) instead of whole snapshots. When a test fails, ForgeQE shows the failing element on the test's page at the failure and on the replay's page, so most failures are fixed without opening a browser. Scribe's live browser is switched on only when the same failure repeats, or from the start when ForgeQE's own replay got through the flow in no setup (Scribe would otherwise patch the failing steps blind until a test ran), and it does not send a page snapshot after every click or keystroke. `code.max_steps` (default 50) caps the tool calls in one of Scribe's turns. `code.review_profile` runs the reviewer on a cheaper llms.json profile.
|
|
1129
1129
|
|
|
1130
1130
|
**Scribe's rulebook: the same mistake once.** When a job passes after a failed test run or a reviewer's change, Scribe's report gives up to three one-line rules that would have avoided the mistake ("Wait for the cart badge with toHaveText before clicking Checkout; it updates after a request"). ForgeQE keeps them in `.forgeqe/scribe-rules.json` in the repository, and every attempt of later jobs, and every healing session, starts with them. A lesson from a job that did not pass, or that passed at once, is not kept: only a fix that worked becomes a rule. The book stays small, since it is sent with each model call: at most 15 rules of one line each; a lesson learned again is merged into its rule (shown as "learned 3 times") instead of added; when it is full, the rule confirmed least and longest ago goes, and a rule not learned again for 180 days expires. The rules are the coding agent's own words, so a rule with a link, something like a token, a destructive command, or wording that tells an agent to drop its instructions is refused, and the agents are told they are hints that never override their instructions or the team's guardrails. Commit the file to share the rules with the team and see each change in review; edit or delete a rule there (the agents cannot change `.forgeqe`). ForgeQE says each new rule as it learns it (`Learned for next time: …`). `code.rulebook: false` turns it off.
|
|
1131
1131
|
|
|
@@ -1630,6 +1630,8 @@ code:
|
|
|
1630
1630
|
max_attempts: 5 # test runs before giving up
|
|
1631
1631
|
test_timeout_seconds: 600 # per test run
|
|
1632
1632
|
stall_after: 5 # stop the agent's turn when one command it runs has failed this many times
|
|
1633
|
+
repeat_after: 6 # stop its turn after this many look-ups answered as before (a file re-read unchanged, the same diff)
|
|
1634
|
+
edit_after: 8 # stop its turn after this many edits to files it already changed, with no test run in between
|
|
1633
1635
|
replay: true # before the agent starts, run the steps as a Playwright script and hand over what worked
|
|
1634
1636
|
live_browser: true # once a step fails, the agent looks at that page in a Playwright browser
|
|
1635
1637
|
graph: true # the code graph: find page objects without reading files, and reuse what already locates an element
|
|
@@ -1649,7 +1651,9 @@ What happens after the run passes:
|
|
|
1649
1651
|
|
|
1650
1652
|
Before Scribe starts, ForgeQE reads the repo into a **code graph**, without a model: every class, page object, method, property, and test (TypeScript, JavaScript, C#, Java, Python), the calls between them, and the locators each one builds, in any framework's spelling (Playwright, Selenium, Cypress, WebdriverIO, Testing Library). It is kept in `~/.forgeqe/cache/code-graph`, nothing leaves the machine, and the next job reads again only the files that changed. The graph is tied to page memory, which knows each element by all its locators (its id, role and name, text, test id): so when the run clicked `getByRole('button', { name: 'Login' })` and the repo's `LoginPage.LoginButton` uses `#login-button`, the handoff says under that step "in this repository: LoginPage.LoginButton … used by LoginPage.SignInAsync", and Scribe calls the existing method instead of writing a second locator. Scribe also gets tools that answer from the graph instead of grep and whole-file reads: `code_find` (classes, methods, and tests by name, or by the text a locator uses), `code_outline` (a file's or class's signatures and locators, or the source of one member), `code_element` (which member already locates an element), `code_references` (what calls a member, before it is changed), and `code_impact` (the tests a change reaches, through flows and base classes, whatever the test files are called). `graph: false` turns it off. The handoff also outlines the page objects its steps use and includes the repo's test that uses the most of them, so Scribe takes the test conventions from that test instead of reading other tests, and reads a settings file only to change it.
|
|
1651
1653
|
4. It writes the test from the handoff and the replay script: steps that worked are ported with their locators, steps that failed are fixed first. Every locator, including those for assertions, comes from the replay script, the page snapshots, page memory, or a check on the page; steps where the browser agent ran JavaScript to look around are left out. It does not walk the flow again or build tests to explore. Once a step fails (in the replay, or in its test), ForgeQE switches on its live browser: a Chrome that Playwright drives, set up like ForgeQE's, where it looks at the failing step's page one tool call per action (open, snapshot, click, type, wait, screenshot, run JavaScript, console errors, failed requests). Until then the live browser tools are off, so no tokens go into looking at pages that work. The live browser needs Node.js (`npx`), and Microsoft's Playwright MCP server is downloaded on first use; with `live_browser: false`, or without `npx`, it looks with a small throwaway script instead. When its browser gets a different page than ForgeQE's did (an error, a challenge, a control that will not open), it compares the two browsers (user agent, `navigator.webdriver`, headless, failed requests and CORS errors, headers the framework adds, console errors) and fixes the difference in the repo's browser configuration. It never judges the site with `curl` or `webfetch`.
|
|
1652
|
-
5. Scribe does not run the test itself: it may build or compile, then reports the test file and the command that runs only that test, and ForgeQE runs it. If one command it runs fails `stall_after` times in a row within its work (the same build again and again, say), ForgeQE stops that turn and sends the command and its last output back, asking it to change approach. If the same command stalls again, the job stops as a failure with that output in the notes.
|
|
1654
|
+
5. Scribe does not run the test itself: it may build or compile, then reports the test file and the command that runs only that test, and ForgeQE runs it. If one command it runs fails `stall_after` times in a row within its work (the same build again and again, say), ForgeQE stops that turn and sends the command and its last output back, asking it to change approach. If the same command stalls again, the job stops as a failure with that output in the notes. The same goes for going round in circles: re-reading files, outlines or `git diff` it has already seen, unchanged, `repeat_after` times, or changing files it already changed `edit_after` times without handing the test over, or making 3 edits that fail because the file no longer has the lines it expected (it then reads the file once and edits from that). Its turn stops and it is asked for the test, which ForgeQE then runs; if it does it again, the job stops.
|
|
1655
|
+
|
|
1656
|
+
Every model call sends the whole conversation again, so ForgeQE keeps conversations short. Each attempt after the first, a rerun of a job that stopped while writing, and carrying on after you raise the token budget all start a new session from a brief: the handoff, the plan, the notes, and the files the job wrote as they are now. For a recording, what the planner already looked up in the code goes to Scribe too, and the planner's tokens count toward `max_tokens`. When a session's calls are mostly re-sent in full rather than read from the model's cache, ForgeQE says so once. At the token budget, the question says whether ForgeQE has run the test yet; an unattended write never asks and stops there. A job that stops says whether a test ever ran and which files it left changed in the repository.
|
|
1653
1657
|
6. ForgeQE runs that command (with `CI=1`) and checks the exit code, and it watches the processes the command starts for a browser launched by Playwright, Puppeteer, Selenium, or Cypress. On a failure it sends the command, exit code, and output back to Scribe. The output is kept short so the error is never cut off: the page dump Playwright puts into a failed assertion ("Aria snapshot:", often thousands of lines) is taken out and saved as `<run>/test-runs/attempt-N-page.aria.yml`, then the start (where the first error and its stack trace are) and the end (the summary) are sent; the full output is in `<run>/test-runs/attempt-N.log`, and the prompt names both files. A command that exits 0 without starting a browser also goes back: the test must drive the app in a browser. If the repo's browser runs on another machine (Selenium Grid, a cloud service, a container), the agent says where and the check is skipped.
|
|
1654
1658
|
7. A passing test then goes to a separate reviewer agent, which can read files and `git diff` but not change anything. It checks the change against the goal and the test rules: every part of the goal done through the page and asserted, generic page objects with data in the test, no values or URLs copied from the run, browser settings in the repo's configuration, no leftover files. The changed files come inline in its prompt, so it reads nothing again, and it does not ask to replace locators or texts that came from the replay or the checks, since those matched the live site. It judges only what this job changed: ForgeQE records the working tree before the job, so your uncommitted edits, your untracked files, and ForgeQE's own files (`.forgeqe/`, `forgeqe.yaml`, `llms.json`) are never part of the review. It checks the diff of every file that existed before the job: removing or rewriting an existing test, even a commented-out one, is a correctness problem. Credentials come from the environment, except a public demo login that the application itself shows to anyone (such as the logins on saucedemo.com's sign-in page), which may stay in the repo's test data. It gets the outlines of the classes the changed code uses, the repo's browser settings, and the same `code_*` tools, so it checks reuse and settings without reading those files. The code graph also tells it what the job added that it can check in the code: a new member that locates an element an existing member already locates (to reuse instead), and new XPath or position-based locators. If it finds problems, they go back to Scribe as the next attempt. The terminal shows the exchange as it happens, in order: the reviewer's verdict with its reason and each issue (✗ correctness, ~ coding standard) with the file and the fix it asks for; then why Scribe tries again and what it is fixing (the reviewer's issues, or the test's first error); then what Scribe says it did and which files it changed; then the next verdict:
|
|
1655
1659
|
|
|
@@ -318,7 +318,7 @@
|
|
|
318
318
|
<tr><td><code>loop.ts</code> (retries)</td><td>Each failed attempt (a failed run, a run that opened no browser, a rejected review) adds a <code>Tried</code> entry: Scribe's <code>tried</code> items from its result (else its notes), the failure, and <code>failureFacts</code> of the output (the last "waiting for" locator of Playwright's call log, and the element that "intercepts pointer events"), with <code>again</code> when an earlier entry failed on the same locator. <code>nextAttemptPrompt</code> renders them with <code>triedSection</code>; <code>runHeal</code> keeps the same list from each test's <code>reason</code> and passes it to <code>healNextPrompt</code>. The attempt log, and so <code>scribe-mistakes.jsonl</code>, uses the <code>tried</code> items too</td></tr>
|
|
319
319
|
<tr><td><code>notes.ts</code></td><td><code>scribe-notes.json</code> in <code>memory.dir</code>: per repository, the reading turn's notes (<code>saveNotes</code>), when they were written, and up to 15 tests jobs wrote there (<code>addWrittenTest</code> on approval). <code>readNotes</code> returns nothing past 30 days; <code>notesSection</code> renders them for the first prompt</td></tr>
|
|
320
320
|
<tr><td><code>worktree.ts</code></td><td>The working tree before the job (<code>git status --porcelain -uall</code> with a hash of each file, and a copy of each file up to 5 MB, plus ForgeQE's <code>forgeqe.yaml</code> and <code>llms.json</code>); the paths the job changed since then; putting back files the job deleted or uncommitted edits it reverted to the committed version; and the protected paths in the form the agent runtime matches them</td></tr>
|
|
321
|
-
<tr><td><code>loop.ts</code></td><td>The attempt loop, stop handling, the replay (<code>code.replay</code>, on by default in <code>forgeqe.yaml</code>: <code>replayRun</code> runs while Scribe reads the repo, then the handoff is rebuilt with the replay and the result goes to <code>code.json</code> <code>replay</code>; skipped when <code>canReplay</code> finds no step beyond navigation and no checks), the reading turn (<code>READ_AGENT</code>, no structured answer, with or without a replay; skipped when <code>readNotes</code> has notes for the repo, which go into the first prompt instead; its reply is saved as the notes), the live browser (<code>code.live_browser</code>, on by default in <code>forgeqe.yaml</code>; its tools are off until the replay or a test run fails, a stall, a no-browser run, or a blocked report, and the prompt that switches them on says so), the stall guard (<code>code.stall_after</code>, default 5; counts reset after each ForgeQE test run), <code>code.json</code> (the run folder is recreated if it is gone, and a failed write is reported without changing the result), and resuming: <code>scribe-session.json</code> in the run folder (session id, repo, stage <code>reading</code>/<code>writing</code>, whether the live browser is on) is written when the session opens and updated as the job goes, and removed when the job ends with a result; after a stop, a crash, or a <code>ProviderAuthError</code>/<code>APIError</code> it stays, and a rerun for the same run and repo passes it as <code>openSession</code>'s <code>resume</code>. A
|
|
321
|
+
<tr><td><code>loop.ts</code></td><td>The attempt loop, stop handling, the replay (<code>code.replay</code>, on by default in <code>forgeqe.yaml</code>: <code>replayRun</code> runs while Scribe reads the repo, then the handoff is rebuilt with the replay and the result goes to <code>code.json</code> <code>replay</code>; skipped when <code>canReplay</code> finds no step beyond navigation and no checks), the reading turn (<code>READ_AGENT</code>, no structured answer, with or without a replay; skipped when <code>readNotes</code> has notes for the repo, which go into the first prompt instead; its reply is saved as the notes), the live browser (<code>code.live_browser</code>, on by default in <code>forgeqe.yaml</code>; its tools are off until the replay or a test run fails, a stall, a no-browser run, or a blocked report, and the prompt that switches them on says so), the stall guard (<code>code.stall_after</code>, default 5; counts reset after each ForgeQE test run), the loop guards (<code>code.repeat_after</code>, default 6: <code>RepeatedLooks</code>, look-ups whose answer is unchanged; <code>code.edit_after</code>, default 8: <code>RepeatedEdits</code>, edits to files already changed, and <code>FAILED_EDITS_AFTER</code> (3) edits that failed on lines the file no longer has; all reset after each test run, and each kind of loop gets <code>loopPrompt</code> once, then the job stops; a stop's notes say whether a test ever ran and which files were left changed (<code>stopFacts</code>), and its <code>test</code> event has <code>ran: false</code>), <code>code.json</code> (the run folder is recreated if it is gone, and a failed write is reported without changing the result), and resuming: <code>scribe-session.json</code> in the run folder (session id, repo, stage <code>reading</code>/<code>writing</code>, whether the live browser is on) is written when the session opens and updated as the job goes, and removed when the job ends with a result; after a stop, a crash, or a <code>ProviderAuthError</code>/<code>APIError</code> it stays, and a rerun for the same run and repo passes it as <code>openSession</code>'s <code>resume</code>. The session file also keeps the files the job changed (<code>changed</code>, saved after every edit, read back by <code>carriedPaths</code>). A rerun of a job that stopped while writing opens a fresh session whose first message is <code>brief(carriedOnTask)</code>; one that stopped while reading reopens its session with <code>RESUMED_NOTE</code> plus the first prompt. Either skips the reading turn and takes <code>savedReplay</code> when the replay finished. <code>brief</code> (the job's target or existing test, environment, notes, plan, <code>planFindings</code>, handoff, attempts and files) also starts every later attempt and the session after a raised budget (<code>BUDGET_RAISED</code>)</td></tr>
|
|
322
322
|
</tbody>
|
|
323
323
|
</table></div>
|
|
324
324
|
<p><strong>Config.</strong> The whole agent runtime config is passed through the environment, so nothing is written into the repo. Keys are <code>{env:NAME}</code> references, never values. Profile mapping:</p>
|
|
@@ -4692,6 +4692,8 @@ tokens and the like) show as <code>•••</code> in results. A check compares
|
|
|
4692
4692
|
max_attempts: 5 # test runs before giving up
|
|
4693
4693
|
test_timeout_seconds: 600 # per test run
|
|
4694
4694
|
stall_after: 5 # stop the agent's turn when one command it runs has failed this many times
|
|
4695
|
+
repeat_after: 6 # stop its turn after this many look-ups answered as before (a file re-read unchanged, the same diff)
|
|
4696
|
+
edit_after: 8 # stop its turn after this many edits to files it already changed, with no test run in between
|
|
4695
4697
|
replay: true # before the agent starts, run the steps as a Playwright script and hand over what worked
|
|
4696
4698
|
live_browser: true # once a step fails, the agent looks at that page in a Playwright browser
|
|
4697
4699
|
graph: true # the code graph: find page objects without reading files, and reuse what already locates an element
|
|
@@ -4716,15 +4718,12 @@ tokens and the like) show as <code>•••</code> in results. A check compares
|
|
|
4716
4718
|
<p>It writes the test from the handoff and the replay script: steps that worked are ported with their locators, steps that failed are fixed first. Every locator, including those for assertions, comes from the replay script, the page snapshots, page memory, or a check on the page; steps where the browser agent ran JavaScript to look around are left out. It does not walk the flow again or build tests to explore. Once a step fails (in the replay, or in its test), ForgeQE switches on its live browser: a Chrome that Playwright drives, set up like ForgeQE's, where it looks at the failing step's page one tool call per action (open, snapshot, click, type, wait, screenshot, run JavaScript, console errors, failed requests). Until then the live browser tools are off, so no tokens go into looking at pages that work. The live browser needs Node.js (<code>npx</code>), and Microsoft's Playwright MCP server is downloaded on first use; with <code>live_browser: false</code>, or without <code>npx</code>, it looks with a small throwaway script instead. When its browser gets a different page than ForgeQE's did (an error, a challenge, a control that will not open), it compares the two browsers (user agent, <code>navigator.webdriver</code>, headless, failed requests and CORS errors, headers the framework adds, console errors) and fixes the difference in the repo's browser configuration. It never judges the site with <code>curl</code> or <code>webfetch</code>.</p>
|
|
4717
4719
|
</li>
|
|
4718
4720
|
<li>
|
|
4719
|
-
<p>Scribe does not run the test itself: it may build or compile, then reports the test file and the command that runs only that test, and ForgeQE runs it. If one command it runs fails <code>stall_after</code> times in a row within its work (the same build again and again, say), ForgeQE stops that turn and sends the command and its last output back, asking it to change approach. If the same command stalls again, the job stops as a failure with that output in the notes.</p>
|
|
4720
|
-
</li>
|
|
4721
|
-
<li>
|
|
4722
|
-
<p>ForgeQE runs that command (with <code>CI=1</code>) and checks the exit code, and it watches the processes the command starts for a browser launched by Playwright, Puppeteer, Selenium, or Cypress. On a failure it sends the command, exit code, and output back to Scribe. The output is kept short so the error is never cut off: the page dump Playwright puts into a failed assertion ("Aria snapshot:", often thousands of lines) is taken out and saved as <code><run>/test-runs/attempt-N-page.aria.yml</code>, then the start (where the first error and its stack trace are) and the end (the summary) are sent; the full output is in <code><run>/test-runs/attempt-N.log</code>, and the prompt names both files. A command that exits 0 without starting a browser also goes back: the test must drive the app in a browser. If the repo's browser runs on another machine (Selenium Grid, a cloud service, a container), the agent says where and the check is skipped.</p>
|
|
4723
|
-
</li>
|
|
4724
|
-
<li>
|
|
4725
|
-
<p>A passing test then goes to a separate reviewer agent, which can read files and <code>git diff</code> but not change anything. It checks the change against the goal and the test rules: every part of the goal done through the page and asserted, generic page objects with data in the test, no values or URLs copied from the run, browser settings in the repo's configuration, no leftover files. The changed files come inline in its prompt, so it reads nothing again, and it does not ask to replace locators or texts that came from the replay or the checks, since those matched the live site. It judges only what this job changed: ForgeQE records the working tree before the job, so your uncommitted edits, your untracked files, and ForgeQE's own files (<code>.forgeqe/</code>, <code>forgeqe.yaml</code>, <code>llms.json</code>) are never part of the review. It checks the diff of every file that existed before the job: removing or rewriting an existing test, even a commented-out one, is a correctness problem. Credentials come from the environment, except a public demo login that the application itself shows to anyone (such as the logins on saucedemo.com's sign-in page), which may stay in the repo's test data. It gets the outlines of the classes the changed code uses, the repo's browser settings, and the same <code>code_*</code> tools, so it checks reuse and settings without reading those files. The code graph also tells it what the job added that it can check in the code: a new member that locates an element an existing member already locates (to reuse instead), and new XPath or position-based locators. If it finds problems, they go back to Scribe as the next attempt. The terminal shows the exchange as it happens, in order: the reviewer's verdict with its reason and each issue (✗ correctness, ~ coding standard) with the file and the fix it asks for; then why Scribe tries again and what it is fixing (the reviewer's issues, or the test's first error); then what Scribe says it did and which files it changed; then the next verdict:</p>
|
|
4721
|
+
<p>Scribe does not run the test itself: it may build or compile, then reports the test file and the command that runs only that test, and ForgeQE runs it. If one command it runs fails <code>stall_after</code> times in a row within its work (the same build again and again, say), ForgeQE stops that turn and sends the command and its last output back, asking it to change approach. If the same command stalls again, the job stops as a failure with that output in the notes. The same goes for going round in circles: re-reading files, outlines or <code>git diff</code> it has already seen, unchanged, <code>repeat_after</code> times, or changing files it already changed <code>edit_after</code> times without handing the test over, or making 3 edits that fail because the file no longer has the lines it expected (it then reads the file once and edits from that). Its turn stops and it is asked for the test, which ForgeQE then runs; if it does it again, the job stops.</p>
|
|
4726
4722
|
</li>
|
|
4727
4723
|
</ol>
|
|
4724
|
+
<p>Every model call sends the whole conversation again, so ForgeQE keeps conversations short. Each attempt after the first, a rerun of a job that stopped while writing, and carrying on after you raise the token budget all start a new session from a brief: the handoff, the plan, the notes, and the files the job wrote as they are now. For a recording, what the planner already looked up in the code goes to Scribe too, and the planner's tokens count toward <code>max_tokens</code>. When a session's calls are mostly re-sent in full rather than read from the model's cache, ForgeQE says so once. At the token budget, the question says whether ForgeQE has run the test yet; an unattended write never asks and stops there. A job that stops says whether a test ever ran and which files it left changed in the repository.
|
|
4725
|
+
6. ForgeQE runs that command (with <code>CI=1</code>) and checks the exit code, and it watches the processes the command starts for a browser launched by Playwright, Puppeteer, Selenium, or Cypress. On a failure it sends the command, exit code, and output back to Scribe. The output is kept short so the error is never cut off: the page dump Playwright puts into a failed assertion ("Aria snapshot:", often thousands of lines) is taken out and saved as <code><run>/test-runs/attempt-N-page.aria.yml</code>, then the start (where the first error and its stack trace are) and the end (the summary) are sent; the full output is in <code><run>/test-runs/attempt-N.log</code>, and the prompt names both files. A command that exits 0 without starting a browser also goes back: the test must drive the app in a browser. If the repo's browser runs on another machine (Selenium Grid, a cloud service, a container), the agent says where and the check is skipped.
|
|
4726
|
+
7. A passing test then goes to a separate reviewer agent, which can read files and <code>git diff</code> but not change anything. It checks the change against the goal and the test rules: every part of the goal done through the page and asserted, generic page objects with data in the test, no values or URLs copied from the run, browser settings in the repo's configuration, no leftover files. The changed files come inline in its prompt, so it reads nothing again, and it does not ask to replace locators or texts that came from the replay or the checks, since those matched the live site. It judges only what this job changed: ForgeQE records the working tree before the job, so your uncommitted edits, your untracked files, and ForgeQE's own files (<code>.forgeqe/</code>, <code>forgeqe.yaml</code>, <code>llms.json</code>) are never part of the review. It checks the diff of every file that existed before the job: removing or rewriting an existing test, even a commented-out one, is a correctness problem. Credentials come from the environment, except a public demo login that the application itself shows to anyone (such as the logins on saucedemo.com's sign-in page), which may stay in the repo's test data. It gets the outlines of the classes the changed code uses, the repo's browser settings, and the same <code>code_*</code> tools, so it checks reuse and settings without reading those files. The code graph also tells it what the job added that it can check in the code: a new member that locates an element an existing member already locates (to reuse instead), and new XPath or position-based locators. If it finds problems, they go back to Scribe as the next attempt. The terminal shows the exchange as it happens, in order: the reviewer's verdict with its reason and each issue (✗ correctness, ~ coding standard) with the file and the fix it asks for; then why Scribe tries again and what it is fixing (the reviewer's issues, or the test's first error); then what Scribe says it did and which files it changed; then the next verdict:</p>
|
|
4728
4727
|
<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>⏺ Reviewer asked for changes attempt 1 of 5 · 1 to fix, 1 coding-standard
|
|
4729
4728
|
⎿ The test never checks that the pie chart is shown.
|
|
4730
4729
|
✗ Correctness · tests/PracticeTests.cs: No assertion on the SVG pie chart.
|
|
@@ -4817,7 +4816,7 @@ forgeqe run "..." --no-code # no tests
|
|
|
4817
4816
|
</ul>
|
|
4818
4817
|
<p><strong>When the flow cannot be reproduced.</strong> If ForgeQE's own replay of the run could not reach the run's final page and Scribe's test fails too, Scribe is told where the replay stopped and what was open on the page, since that is usually a pop-up, consent banner or ad the browser agent closed, or state its browser already had (signed in, items in a cart), and gets another attempt to handle it. The job stops, saying which replayed step failed and why, only when the test then fails the same way again, instead of spending its remaining attempts on a flow no script can repeat as recorded.</p>
|
|
4819
4818
|
<p><strong>Why a test failed.</strong> When ForgeQE's run of Scribe's test fails, the ✗ line and the next attempt say why in the test's own words: dotnet test's Error Message, pytest's <code>E</code> lines, or the error with its Expected and Received values (Playwright, Jest, JUnit), not the runner's summary line.</p>
|
|
4820
|
-
<p><strong>Keeping Scribe's cost down.</strong> ForgeQE reads the repository's test setup itself before Scribe starts (stack, settings files and their browser values, the test id attribute, base classes, page objects and their methods, one test command) and hands it over, so Scribe does not discover it with dozens of file reads. Each attempt after the first starts a fresh session from a summary of the job (handoff, files changed, what each attempt did, the latest failure), so later attempts cost about what the first did. The summary has a "Tried already, and did not work" list: for each failed attempt, what Scribe said it did (it reports each change in <code>tried</code>), how it failed, the locator the test was waiting for and the element that covered it and took the click, both read from the test's output, and whether an earlier attempt already failed on that locator. Scribe must not try those again in the same form and must say what it does differently. <code>forgeqe heal</code> keeps the same list across its attempts. <code>code.max_attempts</code> (default 3) and <code>code.max_tokens</code> (default 1,500,000; <code>0</code> turns it off) cap a job, and the token budget is checked during an attempt too, so one long attempt is stopped when the total passes it. Cached input counts at its share of the profile's input price (a session re-reads its own context, and that is most of its input), and in full when no cached price is known, such as with another <code>code.model</code>. The reviewer sorts its issues into correctness (the test does not test what the goal says, or not reliably) and coding standards (test data or credentials in a page object, naming, hard waits, leftovers). Coding standards never fail a test that works: it is accepted, and the coding agent gets one more round (not counted in <code>max_attempts</code>) to fix them; if that round breaks the test, ForgeQE puts back the version that passed and lists the standards issues in the notes (<code>code.tidy: false</code> skips the round). A test the reviewer rejects twice for correctness stops the job with its issues, since that usually means the test case and the page disagree. When a test passed and the reviewer sent it back, and the changes for the review then break it (or the attempts or the token budget run out first), ForgeQE puts back the version that passed: the result is passed but not approved, with the reviewer's issues in the notes, so you get a working test to finish instead of none. Under each step, the handoff shows that step's part of the page (its section and neighbours, from the replay's page snapshot) instead of whole snapshots. When a test fails, ForgeQE shows the failing element on the test's page at the failure and on the replay's page, so most failures are fixed without opening a browser. Scribe's live browser is switched on only when the same failure repeats, and it does not send a page snapshot after every click or keystroke. <code>code.max_steps</code> (default 50) caps the tool calls in one of Scribe's turns. <code>code.review_profile</code> runs the reviewer on a cheaper llms.json profile.</p>
|
|
4819
|
+
<p><strong>Keeping Scribe's cost down.</strong> ForgeQE reads the repository's test setup itself before Scribe starts (stack, settings files and their browser values, the test id attribute, base classes, page objects and their methods, one test command) and hands it over, so Scribe does not discover it with dozens of file reads. Each attempt after the first starts a fresh session from a summary of the job (handoff, files changed, what each attempt did, the latest failure), so later attempts cost about what the first did. The summary has a "Tried already, and did not work" list: for each failed attempt, what Scribe said it did (it reports each change in <code>tried</code>), how it failed, the locator the test was waiting for and the element that covered it and took the click, both read from the test's output, and whether an earlier attempt already failed on that locator. Scribe must not try those again in the same form and must say what it does differently. <code>forgeqe heal</code> keeps the same list across its attempts. <code>code.max_attempts</code> (default 3) and <code>code.max_tokens</code> (default 1,500,000; <code>0</code> turns it off) cap a job, and the token budget is checked during an attempt too, so one long attempt is stopped when the total passes it. Cached input counts at its share of the profile's input price (a session re-reads its own context, and that is most of its input), and in full when no cached price is known, such as with another <code>code.model</code>. The reviewer sorts its issues into correctness (the test does not test what the goal says, or not reliably) and coding standards (test data or credentials in a page object, naming, hard waits, leftovers). Coding standards never fail a test that works: it is accepted, and the coding agent gets one more round (not counted in <code>max_attempts</code>) to fix them; if that round breaks the test, ForgeQE puts back the version that passed and lists the standards issues in the notes (<code>code.tidy: false</code> skips the round). A test the reviewer rejects twice for correctness stops the job with its issues, since that usually means the test case and the page disagree. When a test passed and the reviewer sent it back, and the changes for the review then break it (or the attempts or the token budget run out first), ForgeQE puts back the version that passed: the result is passed but not approved, with the reviewer's issues in the notes, so you get a working test to finish instead of none. Under each step, the handoff shows that step's part of the page (its section and neighbours, from the replay's page snapshot) instead of whole snapshots. When a test fails, ForgeQE shows the failing element on the test's page at the failure and on the replay's page, so most failures are fixed without opening a browser. Scribe's live browser is switched on only when the same failure repeats, or from the start when ForgeQE's own replay got through the flow in no setup (Scribe would otherwise patch the failing steps blind until a test ran), and it does not send a page snapshot after every click or keystroke. <code>code.max_steps</code> (default 50) caps the tool calls in one of Scribe's turns. <code>code.review_profile</code> runs the reviewer on a cheaper llms.json profile.</p>
|
|
4821
4820
|
<p><strong>Scribe's rulebook: the same mistake once.</strong> When a job passes after a failed test run or a reviewer's change, Scribe's report gives up to three one-line rules that would have avoided the mistake ("Wait for the cart badge with toHaveText before clicking Checkout; it updates after a request"). ForgeQE keeps them in <code>.forgeqe/scribe-rules.json</code> in the repository, and every attempt of later jobs, and every healing session, starts with them. A lesson from a job that did not pass, or that passed at once, is not kept: only a fix that worked becomes a rule. The book stays small, since it is sent with each model call: at most 15 rules of one line each; a lesson learned again is merged into its rule (shown as "learned 3 times") instead of added; when it is full, the rule confirmed least and longest ago goes, and a rule not learned again for 180 days expires. The rules are the coding agent's own words, so a rule with a link, something like a token, a destructive command, or wording that tells an agent to drop its instructions is refused, and the agents are told they are hints that never override their instructions or the team's guardrails. Commit the file to share the rules with the team and see each change in review; edit or delete a rule there (the agents cannot change <code>.forgeqe</code>). ForgeQE says each new rule as it learns it (<code>Learned for next time: …</code>). <code>code.rulebook: false</code> turns it off.</p>
|
|
4822
4821
|
</div>
|
|
4823
4822
|
</section>
|