Skip to content

fix(qstack): record verdict runs as K of N and apply four research corrections - #3

Merged
dotts-h merged 5 commits into
mainfrom
fix/qstack-research-corrections
Oct 19, 2026
Merged

dotts-h merged 5 commits into
mainfrom
fix/qstack-research-corrections

Conversation

@dotts-h

@dotts-h dotts-h commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Why

The research review of #1 found five rules the evidence does not support. A fixed two-run rule cannot verify a fix for an intermittent bug. A zero-pixel rule fails on rendering noise. The plugin also had no safe browser-control defaults and no rule for repairing a broken check.

What changed

  • scripts/check-verdict.mjs validates a run record with Surface, Environment, Order, Runs: K of N or Baseline runs and Patched runs, and Pass-to-fail. Each field appears once. A fix verdict needs enough clean patched runs for the baseline failure rate. Every cited evidence file must exist. The checker also requires a measured, inferred, or guess label and ignores the byte-order mark that PowerShell writes by default.
  • skills/qstack-mode/references/verdict-file.md documents the format. The tests run its examples and its patched run table against the checker.
  • reproduce-issue, verify-existing-fix, and two playbooks teach the run record instead of "twice". The reproduce tokens become Confirmed and Insufficient fix to match the checker.
  • visual-parity.md masks regions that differ between two baseline captures and routes each remaining delta to a person.
  • principle-never-block-on-the-human and the qstack-mode autonomy rules name the QA calls that wait for a person.
  • control-adapter.md drives browsers by snapshot ref and stores role or test-id locators. It forbids browser_run_code_unsafe and starts Chrome DevTools MCP with --no-performance-crux, --no-usage-statistics, and --redact-network-headers.
  • maintain-verification-skill limits repairs to locators, waits, and data, and regression-pin states the same assertion rule.

Scope

Five corrections, one commit each. This PR builds no eval harness and no new playbook. Two links to a principle qstack does not ship are fixed in #2.

Tradeoffs

  • The patched run formula treats the baseline's observed failure rate as the true rate. A small baseline can overstate that rate, so the 5% bound is approximate.
  • The checker skips evidence paths that contain spaces.
  • A verdict that says "twice" now fails the checker. No verdict files are committed, so nothing in the repo breaks.

Blast Radius

reproduce-and-triage and verify-fix-and-retest write verdict files and now need the run record. regression-and-parity reads the visual parity outcome instead of a pixel count. No script other than the checker changes.

Verification

  • node --test passes 18 of 18 tests at the first commit and at the head. With the old checker restored, 15 fail. The 3 that pass cover behavior this PR keeps.
  • An independent review on a second model filed 13 findings. Twelve were fixed, each checker bug with a failing test first. One was dismissed because visual parity writes no verdict file.
  • The Chrome DevTools MCP flags match its README and configuration guide.
  • A markdown check over all 59 files reports only the two links fixed in fix(qstack-mode): drop links to a principle qstack does not ship #2.

@dotts-h

dotts-h commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

PASS+NOTES

This is an independent verdict from an agent that did not write this PR. I ran the checker and its tests the way the skills tell a QA agent to, from each plugin root, base against head. The machine runs Windows 11, PowerShell 5.1.26100, and Node v22.11.0.

The core change works as claimed, measured below. Every claim in the body holds except the byte-order mark wording in note 1. The notes are follow-ups, and none is a regression from base.

Commands and results

  1. gh pr view 3 and gh pr diff 3 read the PR. git worktree add --detach made one clean worktree per SHA. I pushed nothing and did not edit the PR.
  2. node --test at base runs 0 tests, because base ships no test file.
  3. node --test at head passes 18 of 18. That holds on the CRLF checkout (core.autocrlf=true) and on an LF export from git -c core.autocrlf=false archive.
  4. node --test at the first commit d382ef6, from a git archive export, passes 18 of 18. No file under scripts/ changes after that commit, and neither does verdict-file.md.
  5. Head's tests against base's check-verdict.mjs give 15 failing and 3 passing. The 3 cover the reference examples, long dashes, and exit code 2, as the body says.
  6. node scripts/check-verdict.mjs <fixture> ran from each plugin root on 23 fixtures I wrote. The table below lists the ones that test a claim. Notes 2 and 3 cover four more. A plain Set-Content copy, which PowerShell 5.1 writes without a BOM, passes at both.
  7. node qstack-validate-md.mjs at head checks 59 files and reports 2 problems. Both are the principle-guard-the-context-window paths in diagnose-live.md and diagnose-trace.md. Base reports the same 2, this PR does not touch those files, and fix(qstack-mode): drop links to a principle qstack does not ship #2 removes both.
  8. A resolver over the 14 markdown files this PR changes found 49 relative links and 80 backticked .md or .mjs paths. All resolve at head, including the new #browser-targets anchor.
  9. A brute-force script compared the checker's patched run formula with the documented rule, the smallest N of at least 2 where (1 - K/M) ** N <= 0.05. It found 0 mismatches across all 124,750 baselines up to 500 runs. The table in verdict-file.md matches.
  10. I read the upstream docs this session. The Chrome DevTools MCP configuration guide lists --performanceCrux and --usageStatistics as default true and --redactNetworkHeaders as default false. Its README says CrUX lookups send trace URLs to Google. The Playwright MCP README calls browser_run_code_unsafe "RCE-equivalent". The Playwright Locator docs list locator.normalize() and say refs only work for the latest snapshot.

Fixtures

Exit codes come from base's checker, then head's.

Fixture Base Head Head says
"Reproduced twice" with no counts 0 1 lacks Environment:, Order:, Runs:
Reproduced, Runs: 2 of 3, the reference example 0 0
Reproduced, Runs: 1 of 3, with "2 runs" in Order: 0 1 needs the broken state on at least 2 runs
Confirmed, baseline 2 of 4, patched 0 of 2 0 1 a 2 of 4 baseline needs at least 5 patched runs
Confirmed, baseline 2 of 4, patched 0 of 5 0 0
Confirmed, patched 1 of 2 0 1 allows no failing patched run
Insufficient fix, patched 0 of 3, one pass-to-fail check 0 0
Evidence file missing on disk 0 1 evidence path not found
No measured, inferred, or guess label 0 1 lacks a label
Could not reproduce with 2 of 3 0 1 the verdict is Reproduced
Blocked with only Surface: and Environment: 0 0
PASS with Runs: 0 of 2 1 0
Two Runs: lines 0 1 appears more than once
Windows absolute path with a :12 suffix 0 0
UTF-8 BOM from Set-Content -Encoding UTF8 1 0
UTF-16LE from PowerShell 5.1 Out-File and > 1 1 no H1, every section missing
Verified existing fix, the verify token base's reproduce-issue taught 1 1 lacks an allowed token

The third row shows the old bug. Base matched "2 runs" anywhere in the section, so it passed a reproduction seen once. The last row shows the mismatch the token rename fixes. Head's skill text teaches Confirmed and Insufficient fix, and no old token remains at head.

Claims in the body

  • The run record holds per the fixtures. That covers one line per field, the patched run rule, existing evidence files, and the label.
  • verdict-file.md documents the format. Tests 1 and 12 run its examples and its table against the checker.
  • reproduce-issue, verify-existing-fix, reproduce-and-triage, and verify-fix-and-retest teach the run record. Each agrees with the checker's rules.
  • visual-parity.md masks only from two baseline captures and routes each remaining delta to a person. regression-and-parity.md reads its Pass token.
  • The never-block principle and the qstack-mode autonomy rule name the same calls. Visual parity, maintain-verification-skill, regression-pin, and automate-check route those calls to a person.
  • maintain-verification-skill and regression-pin carry the same assertion sentence word for word.
  • The control adapter's flags and tool names match upstream. Notes 4 and 5 cover two gaps.
  • Five commits make five corrections. The new files are the test and the reference, and no playbook is new. git ls-tree at head lists no verdict files. No script other than the checker changes.
  • I cannot rerun the second-model review. Its one dismissal holds, because visual-parity.md writes no verdict file.

Notes

  1. The byte-order mark claim overstates. Measured. PowerShell 5.1 writes UTF-16LE (FF FE) by default from Out-File and >. Both checkers reject that file with "no H1 title" and every section missing, and neither names the encoding. Head strips only the UTF-8 BOM that -Encoding UTF8 writes. Either decode a FF FE file as UTF-16LE, or reword the claim and tell agents to write UTF-8.
  2. A backticked single space passes as evidence. Measured. An ## Evidence section whose only token is one space exits 0 at head, because the empty token resolves to the verdict's own folder. A bare :12 resolves the same way, inferred from the code. Skipping empty tokens after the trim and the line-suffix strip closes it.
  3. Some messages name the wrong cause. Measured. Runs: twice also reports lacks "Runs:". A missing file also reports "cites no backticked path or URL". A path with a space reports only that message, even though the file exists. Bold labels such as - **Runs:** 2 of 2 go unrecognized, so all four fields read as missing. Agents often bold labels.
  4. control-adapter.md names locator.normalize() to turn a ref into a stored locator. Under Playwright MCP, only browser_run_code_unsafe runs library code, and the next bullet forbids it. Playwright MCP's browser_generate_locator makes the same conversion when the server starts with --caps=testing. The role and name on the snapshot line also work. Naming one of those makes the rule followable over MCP. Inferred from the upstream README.
  5. "A web app adapter drives the page through Playwright MCP or the Playwright CLI" reads as the only allowed path. create-verification-skill tells the agent to reuse an existing Cypress spec or a browser or CDP harness, and Cursor's own browser also acts on snapshot refs. Opening the sentence with "for example" removes the tension. Inferred.
  6. The automate-check.md reply asks for "each repair with the run that still failed on the broken revision". maintain-verification-skill step 5 asks for that run only when the repaired check guards a known bug. Inferred.
  7. "Setting a production blast radius" has no referent in the plugin. Elsewhere, "blast radius" names the read-only analysis that regression-and-parity.md step 2 runs unattended, so an agent could read the new rule as a reason to wait there. Inferred.
  8. No outcome covers clean patched runs that fall short of the rule. A 2 of 20 baseline needs 29 clean patched runs, measured with the checker's formula. An agent that stops at 10 has no named token. Inconclusive with a Missing: line fits, and verify-fix-and-retest.md could say so. Inferred.

dotts-h and others added 5 commits October 19, 2026 12:39
…d pass-to-fail

Replace the fixed two-run rule with a run record. Each verdict states how many runs showed the broken state out of how many ran. Fix verification needs enough clean patched runs for the baseline rate, and cited evidence paths must exist. Rename the reproduce-issue tokens to Confirmed and Insufficient fix so they match the checker.

Co-authored-by: Cursor <[email protected]>
…udge

Mask regions that differ between two captures of the same baseline, then route every remaining delta to a person with the baseline, the capture, and the diff image. Pass, Fail, and Unproven follow that review, and regression-and-parity reads the visual parity outcome instead of a zero pixel count.

Co-authored-by: Cursor <[email protected]>
Accepting a healed locator or repaired check, updating a baseline, judging an assistive-technology outcome, and setting a production blast radius each change what counts as correct. The agent finishes the work around them and presents each call with its evidence.

Co-authored-by: Cursor <[email protected]>
…P defaults

Act on accessibility snapshot refs, persist role or test-id locators instead of refs, and keep screenshots as evidence rather than action targets. Never call browser_run_code_unsafe, and turn off the Chrome DevTools MCP options that send trace URLs and usage data to Google.

Co-authored-by: Cursor <[email protected]>
…ssertions

A skipped check counts as failing. A repaired check that guards a known bug must still fail on a revision that has the bug. An assertion changes only when the expected behavior changed on purpose and a person accepts it, and regression-pin now states the same rule. automate-check routes every repair through that rule and a person's review.

Co-authored-by: Cursor <[email protected]>
@dotts-h
dotts-h changed the base branch from feat/qstack-p1-core to main October 19, 2026 09:39
@dotts-h
dotts-h force-pushed the fix/qstack-research-corrections branch from 0371e6b to e3e98ea Compare October 19, 2026 09:39
@dotts-h
dotts-h merged commit 3dd7ebb into main Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant