mr-onion

Phase 42 Decision Record — Reusable Suites, a Test Library and Gap Tests

Date: 2026-10-12 Scope: Keep each site’s Standard tests and reuse them on later runs; keep Comprehensive tests in a library of tests written against component patterns, applied to any site that has the pattern; map which element and flow every test covers; and write new tests only for what the map shows is uncovered, so analysis time goes to the outliers instead of the standard things. Status: Complete 2026-10-15 (locked 2026-10-12; every decision confirmed by Emil the same day). Starts after Phase 41’s Gate B. Tickets TFP-190 to TFP-197, plus TFP-200 and TFP-201 from Gate A. Complete 2026-10-15 (TFP-205 verified; TFP-206 moves to the post-Phase 42 review). Corrections from the review’s claims audit (R3, 2026-10-16) are marked Correction (R3, 2026-10-16) where they apply. The history above them is left as written. Findings: post-phase-42-review-findings.md.

Context

Decisions

  1. Reuse each site’s Standard tests (Emil, 2026-10-12).
    • A site’s Standard suite is saved with the fingerprint (Phase 40 page type and structural signature) of every page type it was written for.
    • On a later run the site is crawled first and compared:
      • unchanged page types reuse their tests as they are;
      • new or changed page types get new tests;
      • page types that are gone retire their tests.
    • A reused test that fails on a page whose fingerprint changed is regenerated and re-run before its result is reported (Emil, 2026-10-12). Only the re-run’s result counts; the report says the test was regenerated and why.
    • The report says what was reused, regenerated and retired.
    • A test edited by hand is kept and marked as edited; it is never regenerated silently. If its page changed, the report says so.
  2. A library of Comprehensive tests, written against patterns (Emil, 2026-10-12).
    • Each library entry is written for a component pattern (a login form, a sort control, a quantity stepper, a product listing, a checkout), not a site.
    • Applying the library means matching the patterns inspection finds and binding that site’s selectors and pages.
    • Each entry records its pattern, its ISTQB technique, its gate, and the benchmark bugs it has caught.
  3. A coverage map at element and flow level, indexed (Emil, 2026-10-12).
    • For every run: each element and flow inspection found, and the tests that touch it. What no test touches is the gap list.
    • Indexed for selection, not only for gaps (Emil): the same index answers “which tests touch this element”, so a run can pick the tests for what changed, and a test can be allocated to a page quickly.
    • The report shows coverage per page type and names what is uncovered.
  4. Where things live (Emil, 2026-10-12).
    • The library is generic and lives in the repo, reviewed like code.
    • Site suites hold one site’s selectors, pages and fingerprints, so they live in TestForge’s local data folder, outside the repo (local-first).
  5. Nothing joins the library or a site suite unchecked (Emil, 2026-10-12).
    • A written test is promoted only after it passes the generation gates and runs behind the gates (read-only by default, with Phase 41’s request guard), and proves itself: it finds what it was written for on the local benchmark copies and adds no unlabelled failure on the clean copy.
    • Model-written tests never write to the library directly.
  6. Who writes gap tests: Claude Code (Emil, 2026-10-12).
    • Claude Code, once per gap, not on every run. It writes a test for an uncovered element or flow, runs it, reads the result and revises it, which is the deeper analysis the gaps need. Its tests are saved into the site suite (Decision 1) and reused on later runs, so the cost is paid once per gap, and a run whose site hasn’t changed costs nothing.
    • Opt-in per site: it sends page structure off the machine, which a local-first tool shouldn’t do by default.
    • The local model stays as the offline option, not the default: at Phase 36’s speed it can write a test, but it can’t afford to run and revise one on this machine.
    • Rejected as the default: OpenAI, which writes once without running the test, the same as the local model, with data off the machine as well.
  7. Measured like everything else.
    • The gap writer’s targets are the benchmark bugs still missed after Phase 41’s Gate B, on the local copies.
    • Kept if it finds some of them, adds no unlabelled failure on the clean copy, and a re-run of an unchanged site reuses everything (no new tests, no writer cost). Recorded either way.
  8. Candidates: gap tests on their way to the library (Emil, 2026-10-12).
    • Why: a gap Claude Code fills on one site is often a component other sites will have too. A new way of building a WordPress block, say, met on one site, should already have tests waiting when the next site using it is tested.
    • Two outputs per gap. Claude Code writes:
      • the site test, bound to that site’s selectors and pages, saved in the site suite (Decision 1) once it passes the gates;
      • a candidate: the same test generalised to the component’s pattern (its structural signature, the way Decision 2’s entries are written), with its binding left open.
    • The candidate pool sits in TestForge’s local data folder, beside the site suites, until promotion. Each candidate records the pattern it matches, the site and run it came from, its gate and technique, and every later run it took part in.
    • On a new site, a candidate whose pattern matches is bound and run like a library entry, but outside the verdict: reported in its own section (“candidate tests”), never failing the run, as Comprehensive scenarios are today. Each run adds to its evidence.
    • Before writing a new gap test, Claude Code checks the pool: a candidate that already matches is used instead of writing another, and two candidates for one pattern are merged, not kept side by side.
    • Promotion is a library commit through Claude Code, reviewed like any code. The promotion rule (Emil, 2026-10-12): a candidate is promoted when it has passed the gates on every run, and either caught a real defect (a benchmark bug or a failure labelled real) or run on 3 sites with the pattern with no unlabelled failure, and Emil has approved the promotion. Rejected candidates are kept with the reason, so the same test isn’t proposed again.
    • Candidates run by default in Comprehensive, not in Standard (Emil, 2026-10-12): Standard stays the critical working path (Phase 38 Decision 2).

Order (draft)

  1. Site suites and reuse (Decision 1).
  2. The coverage map and index (Decision 3).
  3. The library: Phase 41’s checks moved into pattern entries (Decision 2).
  4. The gap writer, the candidate pool and promotion (Decisions 5, 6 and 8).
  5. Measurement (Decision 7).

Dependencies

Backlog

Ticket prefix TFP-. Built in batches, ticket by ticket with targeted tests; the full unit suite, the regression suite and check:template-unchanged run once at the end of each batch, which stops for verification (Emil, 2026-10-07). Every new test names its ISTQB technique and its gate. Measured on the local Toolshop copies (Phase 41 Decision 7).

TFP-190 — Site suites: save, fingerprint and reuse Standard tests

RUN-29 evidence

Moved word for word from docs/test-plan/RUN.md by TFP-253; the case’s row there links here.

Test: A site’s suite is saved outside the repo and reused while its page types are unchanged (TFP-190, Phase 42 Decisions 1 and 4; unit: src/lib/site-suites/site-suites.test.ts (generates through POST /api/generate on the comparison fixture’s /types shop, pages inspected in a real browser), src/lib/run/generation-record.test.ts)

Expected result: Each template-written suite (Standard, and Comprehensive per area; owner decision, 2026-10-13) is saved per origin and suite identity in TestForge’s data folder (TESTFORGE_DATA_DIR, else the OS app-data folder), with each page type’s structural signatures and each test’s file and written hash. Proven (decision table: site unchanged / one page’s structure changed / a page removed x a test edited by hand): a second run of the unchanged site reuses all 143 tests and generates none, and the suite is the saved one; types-contact-phone (the contact form gains a tel field) regenerates only /types/account/:slug’s tests and reuses every other, its hand-edited test kept as edited and flagged as on a changed page; types-privacy-removed retires the privacy page’s tests and the other pages’ link tests of it. The repo’s git status is the same before and after; the data folder resolves per platform (equivalence partitioning). The report and the HTML export say, in one sentence, what was reused, generated, regenerated and retired, and the edits to check. Gate: Phase 42 Gate A.

TFP-191 — A stale reused test is regenerated and re-run before it counts

RUN-30 evidence

Moved word for word from docs/test-plan/RUN.md by TFP-253; the case’s row there links here.

Test: A reused test that fails on a page whose structure changed is regenerated and re-run before it counts (TFP-191, Phase 42 Decision 1’s stale-test rule; owner decision, 2026-10-13; unit: src/lib/site-suites/stale.test.ts (generates through POST /api/generate and runs through POST /api/run on the comparison fixture’s /types shop, in a real browser), src/lib/run/generation-record.test.ts)

Expected result: After the run, each failing test that was reused from the site suite (written before this generation), not edited by hand and of one page type has its page read again with the inspection that saved its signature. Proven (decision table: reused or written by this generation x page structure changed or not): reused, types-contact-subject-list (Subject becomes a list): /types/account/:slug is named as changed with the contact page’s signature before and after, its tests are regenerated from a fresh inspection and re-run, and the report has only the re-run’s results - the stale Subject check is gone and its regenerated check of the list passes; the sentence names the regeneration, the failing tests and the re-run’s counts. Reused, types-quantity-readonly (the field turns read-only, the signature doesn’t change): the failure stands and is said to be on an unchanged page. Written by this generation: not read again, the failure stands. The re-run’s other failures on the contact page (the WCAG scan’s target size, the tab order of its inline labels) are reported as the re-run found them. Gate: Phase 42 Gate A.

TFP-192 — The coverage map and its index

RPT-20 evidence

Moved word for word from docs/test-plan/RPT.md by TFP-253; the case’s row there links here.

Test: The coverage map: each element, link and flow the inspection found, the tests that touch it, and what no test touches, per page type (TFP-192, Phase 42 Decision 3; unit: src/lib/report/coverage-map.test.ts (generates through POST /api/generate on the comparison fixture’s /types shop, pages inspected in a real browser))

Expected result: Read from the suite’s code: an element is touched by a test that visits its page and uses its locator (a form without an id by its recorded action, method and occurrence, as the form check finds it); a link likewise, or by a site-wide link check that requests its URL; a flow by its journey test. A whole-page check touches no single element. Proven (equivalence partitioning over what touches an element): every element check maps to the element it checks (the Subject check to the Subject field alone; the contact form’s check to the form); with the Subject check taken out of the suite, the Subject field is named in /types/account/:slug’s “touched by none”; every unselected candidate journey is listed as touched by none; the index gives exactly the Subject check for the Subject field, a run of one, and for a link its on-page check and the site-wide link check. The report (app and HTML export) shows the headline and, per page type, covered of total and the untouched names. Gate: Phase 42 Gate A.

Gate A rulings (Emil, 2026-10-14)

  1. Coverage is reported in two tiers, and a repeated link counts once. The Toolshop map read 243 of 243 because a site-wide link check that requests a URL counted every link as touched; only 16 of 132 links had an on-page check. But the 132 are 37 distinct links: 17 repeat across pages (header and footer) and make up 112 of the entries.
    • Reachability: a link’s URL was requested and answered.
    • In context: the link was found and checked on its page.
    • A link with the same text and target in a shared region of several pages is one item, covered in context when checked on any one of them. The gap list (and TFP-194’s targets) is the in-context tier.
    • Built first in batch 2 as TFP-201, before TFP-193.
  2. The label-wrapped <select> naming bug is ticketed (TFP-200), with a fixture case of a bare label-wrapped list marked as a known failure until the fix, and the coverage map naming the pattern as a known blind spot. The fix changes template output, so it is its own commit, the change to check:template-unchanged accepted deliberately.
  3. Accepted: template runs no longer show “no local model result was recorded” (they carry a generation record; a test pins it).
  4. Accepted: site-wide tests are not re-read after a run, so their failures stand. The report says so: a real site change can show up as a site-wide failure that isn’t re-checked for staleness.

RPT-21 evidence

Moved word for word from docs/test-plan/RPT.md by TFP-253; the case’s row there links here.

Test: Coverage in two tiers, a repeated link counted once (TFP-201, Phase 42 Gate A ruling 1; unit: src/lib/report/coverage-map.test.ts)

Expected result: In context: a test finds and checks the item on its page; this tier is the gap list and the index. Reachability: a link whose URL a site-wide check requests without finding it on a page; it stays on the gap list, saying so. A link with the same text and target on several pages is one item, covered in context when checked on any of them. Proven on the fixture’s /types shop (equivalence partitioning): /types/legal/privacy’s link, requested by the site-wide link check and found on no page, is reachability-only and on /types/help/terms’s gap list; /types/product/101’s link, on every page, with its on-page check kept on the terms page alone, is one item covered in context by that one test; distinct links are fewer than links found on pages; the index for a link gives its on-page checks, not the site-wide request. The headline names both tiers and the distinct-link count. Gate: Phase 42 batch 2.

TFP-200 — A list wrapped in its label is named as the browser names it

GEN-95 evidence

Moved word for word from docs/test-plan/GEN.md by TFP-253; the case’s row there links here.

Test: A control inside its label is named as the browser names it (TFP-200, Phase 42 Gate A ruling 2; unit: src/lib/introspect/label-names.test.ts (inspects the comparison fixture’s /wrapped page, then runs the generated checks in a real browser))

Expected result: The inspection reads a label’s text without the labelled control’s own content, as Chromium’s accessible name does. Proven (equivalence partitioning over what the label holds besides its text): a list (Subject), a list followed by text (Size *) and a textarea holding text (Message) are named so, and their generated element checks pass. On the code before the fix the names were “Subject OrderOther”, “Size ChooseM *” and “Message Hello”, and the test fails. RUN-30’s list now has no aria-label and its regenerated check still passes. Template output: unchanged on recorded profiles (check:template-unchanged); the change is in what new inspections record.

TFP-193 — The library: pattern entries, seeded from Phase 41

GEN-96 evidence

Moved word for word from docs/test-plan/GEN.md by TFP-253; the case’s row there links here.

Test: The library: Phase 41’s checks as pattern entries, applied by the patterns inspection finds (TFP-193, Phase 42 Decision 2; unit: src/lib/library/library.test.ts; output: benchmarks/2026-10-14-tfp193-library/)

Expected result: 15 entries in src/lib/library/entries.ts, each with its pattern, binding, technique, gate, where it runs, its builder and the bugs it caught. Proven: every caught bug is in the answer key, and together they are exactly Phase 41’s Gate B finds (2, 4, 19, 26, 27, 29, 31, 33, 34, 40, 42, 45, 53, 58, 59, 60, 62, 63, 66, 67, 75, 80, 82, 94); the image check lists none of its own. Applying an entry (decision table): a page with the pattern gets the check, one without doesn’t (the fixture’s /store sort list against /wrapped’s lists; / with no list or field); a page known only by its path matches only an entry for any page; the generated Standard suite has each check on exactly the pages its entry binds to, and the cross-page layout check needs two. The generators’ whole output (Standard fast and deep, Comprehensive security and accessibility, on the fixture’s and the local Toolshop’s page data) is byte-identical before and after the move: 8 of 8.

TFP-194 — Claude Code writes gap tests, once per gap, opt-in per site

RUN-31 evidence

Moved word for word from docs/test-plan/RUN.md by TFP-253; the case’s row there links here.

Test: Gap tests, once per gap, opt-in per site (TFP-194, Phase 42 Decisions 5 and 6; unit: src/lib/gap-writer/gap-writer.test.ts (generates through POST /api/generate on the comparison fixture’s /types pages in a real browser, with a stand-in for Claude Code reached by the real call path))

Expected result: A site’s gapWriter setting (off by default; claude-code; local-model) decides whether its uncovered elements and links get tests. Each written body runs at the read-only gate inside the request guard. A failure is revised in the same session (up to 3 attempts); a breach is rejected at once. A saved test joins the site suite and is reused; a gap tried without one isn’t asked for again. Proven (decision table: opt-in x what the written test does): off, the writer is never called and nothing is written; on, one call per gap, every target on the in-context gap list and no covered link asked for, all saved in “Gap tests”, and the report names the count and the cost; the same site again, no call, the gap tests reused; a failing test fixed on the second attempt, resuming the first call’s session; a test that POSTs rejected as a breach, never saved or revised, and the next generation asks for another gap; the local model chosen with none configured, nothing written, and the report says why. The settings route refuses an unknown writer and a request that names no site.

TFP-195 — The candidate pool

RUN-32 evidence

Moved word for word from docs/test-plan/RUN.md by TFP-253; the case’s row there links here.

Test: The candidate pool: gap tests generalised, run on other sites outside the verdict (TFP-195, Phase 42 Decision 8; unit: src/lib/candidates/candidates.test.ts (two comparison fixture sites, through POST /api/generate and POST /api/run, with TFP-194’s stand-in for Claude Code))

Expected result: After a gap test is saved, its writer generalises it (__PAGE__, __LOCATOR__). TestForge binds it back to the same element and runs it; only a pass joins the pool, one file per pattern (kind, type, name). Proven (decision table: site x run type x the candidate’s state): first site, the gap test generalised, checked and pooled with its source; second site, Comprehensive, the candidate bound to it in “Candidate tests” and run beside a template check, the report listing it in its own section and the Comprehensive summary counting the template check alone, and its evidence gaining the run (site, status, run id); second site, Standard, never run; second site opted in, no new gap test for the candidate’s pattern; one pattern from two sites merged into one candidate with both sources; a rejected candidate kept with its reason, never bound, never proposed again.

TFP-196 — Promotion

RUN-33 evidence

Moved word for word from docs/test-plan/RUN.md by TFP-253; the case’s row there links here.

Test: Promotion: only a candidate meeting the rule is offered; approved ones become library entries, rejected ones stay rejected (TFP-196, Phase 42 Decision 8’s rule; unit: src/lib/candidates/promotion.test.ts (through /api/candidates))

Expected result: The rule: gates passed on every run (no breach), and a real defect caught (a run labelled real, or a benchmark bug) or 3 sites with no unlabelled failure, and the tester’s approval. Proven (decision table): no runs, 2 clean sites, 3 sites with an unlabelled failure, and 3 sites with a breach are not offered; 3 clean sites and 1 site with a run labelled real (bug 27) are; approving one below the rule is refused (409, naming why); labelling the failure “not a defect” makes the 3-site candidate offered, while a breach never is. Approved: library:promote writes it as an entry with its evidence, caught bug 27 and approver, marks it promoted, and doesn’t write it twice. Rejected: kept with its reason, refused approval afterwards, and its pattern is still in the pool, so TFP-195 never proposes it again.

Batch 2 rulings (Emil, 2026-10-14)

  1. A repeated link is matched by text and target, wherever it sits on the page (the inspection records no region). Accepted.
  2. On Standard, a matching candidate becomes the gap’s test (TFP-203). As built, a gap with a matching candidate got no test on Standard, which never runs candidates. Now the candidate is bound into the site suite as that gap’s site test once it passes the gates, as Decision 8 intends (“used instead of writing another”).
  3. Promoted entries are applied by generation (TFP-204). Otherwise promotion changes nothing. The app screens for the opt-in and promotion wait for the post-Phase 42 review; the API routes work.
  4. The default limit of 5 gap tests per generation (TESTFORGE_GAP_LIMIT) is accepted as Emil’s decision.
  5. Gap tests are hardened before any real use (TFP-202, P0). They turn text read from a site under test into code that runs on Emil’s machine, and candidates carry that code to other sites. A real sandbox (the tests run inside Docker) is the follow-up, for the post-Phase 42 review.

Batch 3 rulings (Emil, 2026-10-15)

  1. The TFP-094 leak test types the credentials as literals and asserts that a run’s tests can’t read them from the environment: the first end-to-end proof of TFP-202’s environment rule. The run’s stored copy of the submitted code holds the literals, so the scan checks it is exactly what was sent and skips it; everything TestForge captured is still scanned.
  2. Promoted entries run on Standard only, accepted. Every promoted entry so far is a read-only functional check, and the library’s functional entries run only in “Standard functional”; Comprehensive has no functional area (security and accessibility only). An entry for an area Comprehensive has would follow entries.ts’s runsIn rule.
  3. A bound candidate’s Standard runs count toward its promotion (defcc40). Binding already completes the site’s own suite: the candidate is that gap’s test there, the gap counts covered and no writer is asked again. Promotion only decides whether it is offered to every site, and the rule counts distinct sites, so a run on another site is the cross-site evidence it asks for. A failure there is an unlabelled failure and blocks promotion until labelled.
  4. Found by fix 2’s test (fd48f77, 7e0116b): on a Standard run with control checks, every test under “Gap tests” failed with tfReadOnlyGuarded is not defined, because the template declares the helper inside the functional describe. It hit written gap tests since TFP-194 and bound candidates; the gates before saving were unaffected. A top-level copy is now added only where a call can’t reach one.
  5. For the post-Phase 42 review: Claude Code still loads Emil’s user-level CLAUDE.md, memory and hooks (--safe-mode would turn them off); the run environment drops proxy settings (HTTPS_PROXY, NODE_EXTRA_CA_CERTS), fine locally, not behind a corporate proxy.

TFP-202 — Harden the gap writer and the tests it writes

RUN-34 evidence

Moved word for word from docs/test-plan/RUN.md by TFP-253; the case’s row there links here.

Test: The gap writer and the tests it writes, hardened (TFP-202, P0, Phase 42 batch 2 ruling 5; unit: src/lib/gap-writer/hardening.test.ts (TFP-194’s stand-in for Claude Code by the real call path; a gap-test spec and a POST /api/run run in a real browser))

Expected result: Claude Code runs with every tool off, without this machine’s CLAUDE.md, auto memory or hooks (TFP-209), and from an empty temporary folder; written tests may use only the page and expect; every Playwright run gets only the environment Playwright needs, plus the proxy settings when set (TFP-209); page text is untrusted data in the prompt. Proven (equivalence partitioning): each call carries --tools "" --disallowedTools "*" --strict-mcp-config --disable-slash-commands --safe-mode, from an empty folder under the OS temp folder, kept for the revision and removed afterwards; through a .cmd shim on Windows the empty --tools value still arrives; 27 forbidden constructs (Node, imports, fetch, XHR, WebSocket, sendBeacon, page.request.post, routes, context(), computed names, arguments, this, prototypes…) are each refused, a body using process is refused before Playwright starts, and 6 ordinary bodies pass; a gap-test spec and a main-run test both read no OPENAI_API_KEY, ANTHROPIC_API_KEY, GITHUB_TOKEN or TESTFORGE_* setting while the run’s own TESTFORGE_INTERACTIVE arrives; runEnv passes HTTP_PROXY, HTTPS_PROXY, NO_PROXY and NODE_EXTRA_CA_CERTS when set, in either case, and not ALL_PROXY; an injection string (with a forged end marker) is one JSON line inside the PAGE-DATA block, and a revision’s run output is sent the same way. Live (2026-11-02, TFP-209, one real call, benchmarks/2026-11-02-tfp209-safe-mode/): a gap test saved under --safe-mode, with -p and --resume, no hook registered and no project memory, CLAUDE.md or MEMORY.md in the log or transcript.

TFP-203 — On Standard, a matching candidate becomes the gap’s test

RUN-35 evidence

Moved word for word from docs/test-plan/RUN.md by TFP-253; the case’s row there links here.

Test: On Standard, a matching pool candidate becomes the gap’s test (TFP-203, Phase 42 batch 2 ruling 2; unit: src/lib/candidates/candidates.test.ts (two comparison fixture sites, through POST /api/generate, in a real browser), src/lib/run/generation-record.test.ts)

Expected result: A candidate whose pattern matches a gap on a Standard run is bound to the site and run through the gap test’s gates; if it passes it joins the site suite under “Gap tests”, inside the verdict. Proven (decision table): the second site’s Standard run binds the first site’s candidate (recorded with its id, writer: "candidate"), asks no writer, writes nothing under “Candidate tests”, and the coverage map counts the gap covered; the next run reuses it. A candidate that breaches the read-only gate there, or that the code check refuses (fetch), is not bound, the gap is recorded as tried with the candidate’s id, and the next run doesn’t try it again. The record is kept, cleaned when malformed, and said in the report (“Pool candidates: 1 bound as its gap’s test (…), 1 not bound, failing the gates here.”). Verification fix (2026-10-15): the bound test names its candidate, and a Standard run of it on the second site (1 executed, 1 passed, in the verdict) adds that run to its evidence, so its verdict goes from 1 site to 2.

TFP-204 — Generation applies promoted library entries

RUN-36 evidence

Moved word for word from docs/test-plan/RUN.md by TFP-253; the case’s row there links here.

Test: Generation applies the library’s promoted entries (TFP-204, Phase 42 batch 2 ruling 3; unit: src/lib/library/promoted.test.ts (TFP-193’s recorded fixture profile; and one case through POST /api/generate and POST /api/run on the comparison fixture’s /types pages, in a real browser))

Expected result: A promoted entry in src/lib/library/promoted/ is bound wherever inspection found its pattern and runs inside the verdict on Standard runs with the functional area. Proven (decision table): an element’s pattern gets a test on each page with it, bound to the page and the generator’s locator, in the functional describe at the read-only gate, the guard’s helper written once, and each element counted covered; a repeated link gets one test, on its first page; a pattern on no page, an entry the code check refuses (fetch), and nothing promoted each leave the code byte for byte as it came; the repo’s folder holds no entry yet, and an unreadable entry file is skipped. Through the routes: a promoted entry for one of the site’s uncovered links is generated on Standard functional (not on Standard accessibility), covers the gap, and runs: 1 executed, 1 passed.

TFP-197 — Measure the gap writer (Gate B)

Gate B ruling (Emil, 2026-10-15)

GEN-97 evidence

Moved word for word from docs/test-plan/GEN.md by TFP-253; the case’s row there links here.

Test: The template checks every link on the pages it selects (TFP-205, Phase 42 Gate B ruling; unit: src/lib/generate/mock/link-audits/inventory-tests.test.ts (fixture pages served locally and inspected in a real browser; the committed Toolshop data offline), src/lib/report/coverage-map.test.ts)

Expected result: One read-only test per distinct link (text and target, once, on the first selected page it is on), at the end of the functional suite: the link is on its page by the generator’s own locator (or its address), visible and named when inspection found it visible, with a valid href; a same-origin target is loaded once a run (link health and the linked-routes check already load them; any other is loaded through the page inside the request guard, up to 20, the rest named as not loaded); an external target gets the href check only. Proven (decision table): on the fixture, 5 tests for 5 distinct links, the one on two pages once; all pass, with no request to the external link’s origin; link health fails on the broken one, naming it; with no other check loading the targets, the broken link’s own test fails (“leads to /missing, which answers 404”), the external one sends nothing, and one over a cap of 2 is named as not loaded; offline, on the pages TFP-197’s crawls selected for both Toolshop copies (with Gate B’s committed inspection of them), every distinct link is covered in context and none is on the gap list.

TFP-206 — Code check: allow response.request().method()

  1. Batch 1: TFP-190, TFP-191, TFP-192. Gate A passed 2026-10-14.
  2. Batch 2: TFP-201 first, TFP-200, then TFP-193, TFP-194, TFP-195, TFP-196.
  3. Before TFP-197: TFP-202, TFP-203, TFP-204 (one batch; batch 2’s rulings). Done, verified 2026-10-15.
  4. TFP-197. Gate B. Measured 2026-10-15; ruling above.
  5. TFP-205 (template link checks). Verified 2026-10-15; Phase 42 complete. TFP-206 waits for the review.

Gates

Gate A — Reuse and coverage

Passed 2026-10-14 (Emil), with the four rulings above.

Gate B — Gap tests measured

Passed 2026-10-15 (Emil), with the gap writer not kept as a bug finder (Gate B ruling above). TFP-205 verified the same day; Phase 42 complete.