Skip to content

fix(reproduce-issue): define settings, require recordings, drive web apps through the Playwright CLI - #4

Merged
dotts-h merged 1 commit into
mainfrom
fix/qstack-adapter-gaps
Oct 19, 2026
Merged

dotts-h merged 1 commit into
mainfrom
fix/qstack-adapter-gaps

Conversation

@dotts-h

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

Copy link
Copy Markdown
Owner

Summary

This fixes the three gaps that blocked the first qstack test drive, where the strict outcome was Blocked before any driving started.

  • Settings file. qstack read control.skill_name, control.feature_map_path, and routing.map_path, but nothing said where they live. They now live in .cursor/qstack/settings.json in the project under test, under the key names pstack's configuration template uses. The new scripts/check-settings.mjs checks the file. reproduce-issue is Blocked when the check fails. triage-defect still writes the defect report, but routes nowhere and writes no ticket.
  • Recording rule. The reproduce-and-triage playbook accepted "a screenshot or recording", while reproduce-issue required both. A video now counts as a recording, and so does a trace that holds a screencast. Screenshots alone do not. check-verdict.mjs now rejects Reproduced, Confirmed, and Insufficient fix verdicts that cite no recording, and it rejects empty evidence files.
  • Browser rules. Web apps are driven through the Playwright CLI, playwright-cli. Cursor's built-in browser may explore a page, but it may not drive a repro run or a check, and a verdict may not cite its captures.
  • README. Load the plugin from a real folder or a git worktree, because Cursor's docs say it skips a symlink in ~/.cursor/plugins/local that points elsewhere. A new section covers installing the Playwright CLI.

Stacked on #3, which added the browser section this PR rewrites.

Why the browser rules changed

These results come from a click probe page with a disabled button, a disabled input button, and an enabled button. They were measured on 2026-10-19 on Windows 10.0.26200.

Driver Disabled button Disabled input Enabled button
Cursor 3.25.9 built-in browser, coordinate click handler ran handler ran ran, isTrusted false
playwright-cli 0.1.22 with Chrome 155 refused after 5 s, "element is not enabled" refused after 5 s ran, isTrusted true

On the TestSheepNZ calculator, the built-in browser's coordinate click ran Calculate while the button was disabled, so it can't judge enabled or disabled state. Its ref click also rejected each <input type="button"> it was given.

The Playwright CLI covers every capability in the control-adapter contract, recording included. Two traps found on the way are now rules:

  • Video needs Playwright's ffmpeg build. playwright-cli install-browser ffmpeg installs it.
  • After a failed video-start, video-stop still prints a video path, though no file was written.

Test plan

  • node --test from the plugin root: 29 of 29 pass. These are the 18 existing tests, as adjusted, 9 new settings tests, and 2 new evidence tests.
  • Mutation checks. With each rule disabled in turn, only its own test failed. The rules were captures outside the workspace, per-use key checks, recording required, empty evidence, and one problem for an unreadable file.
  • Both verdicts from the first test drive cite screenshots only. The new checker rejects both with "Reproduced needs a recording in Evidence".
  • In a scratch workspace, a missing settings file gives one problem, "settings file not found". A valid file passes for reproduce and triage, including one written with a byte-order mark. The first version of the checker printed two extra "is required" lines for a missing file. That bug is fixed, and a test now covers it.
  • The markdown link check over 60 files finds 2 problems. Both are the dangling principle-guard-the-context-window links that fix(qstack-mode): drop links to a principle qstack does not ship #2 fixes.

Decisions to review

  • The Playwright MCP and Chrome DevTools MCP lines are removed, including the CrUX privacy flags. The CLI covers the same capabilities without MCP.
  • Without control.artifact_directory, captures go to a qstack folder in the temporary directory. Without control.artifact_retention_hours, cleanup deletes no capture.
  • An empty string for an optional key is an error, not "unset". Delete the key instead.
  • The settings file is JSON, not YAML like pstack's template, so the checker needs only Node's standard library.

@dotts-h

dotts-h commented Oct 19, 2026

Copy link
Copy Markdown
Owner Author

PASS+NOTES

This is an independent verification of #4. I did not write this PR.

Nothing blocks landing. Every claim in the PR body that I could run holds at head, and base shows the old behavior. The notes are follow-ups.

Commands and results

  1. gh pr view 4 and gh pr diff 4 show 15 changed files in one commit on top of the base.
  2. node --test from the plugin root passes 18 of 18 at base and 29 of 29 at head. That is the 18 existing tests, 9 settings tests, and 2 evidence tests.
  3. node scripts/check-verdict.mjs <verdict.md> ran at base and head on the 36 real verdicts in qstack-drive\saucedemo\verdicts and qstack-drive\calc-eval\verdicts. Base accepts all 36. Head accepts 34 and rejects error_user-error-report-wait.md and performance_glitch_user-inventory-render-delay.md, each with one problem, "Reproduced needs a recording in Evidence, a video or a trace". Both cite timing JSON, SQLite, logs, and a PNG, and no video. Every verdict file had the same SHA-256 before and after.
  4. The same checker ran on the two first-drive verdicts, calc-build2\verdict.md and prototype-div0\verdict.md. Both cite PNGs, a log, and a URL. Base accepts both, and head rejects both with the same single problem, as the test plan says.
  5. node matrix.mjs builds fresh fixtures and runs both checkers at base and head, 83 runs in all. 80 runs have an expected result taken from the PR body and the head references, and 79 of them match. The other 3 record behavior the PR does not specify.
    • Verdict checker. Base accepts all 21 fixtures. Head rejects Reproduced, Confirmed, and Insufficient fix when Evidence cites only screenshots, only a page URL, a .zip with no trace in its name, or a zip inside a traces/ folder. Head accepts .webm, .mp4, .mov, .mkv, .trace, run-1-trace.zip, and https://ci.example/run/7/video.mp4?raw=1. Head still accepts screenshot-only Could not reproduce, Blocked, FAIL, and PASS. An empty .webm gets "evidence file is empty" and "needs a recording". An empty PNG on a Blocked verdict gets "evidence file is empty". Base accepts both empty files.
    • Settings checker. Base has no scripts/check-settings.mjs, so Node reports "Cannot find module". At head, a missing file, invalid JSON, and a JSON array each exit 1 with one problem. The example in settings.md passes reproduce and triage, also with a UTF-8 byte-order mark. Relative paths resolve from the folder that holds .cursor, whatever the working directory. An artifact_directory inside the workspace or equal to it fails, while the OS temp folder, ../captures, and another drive pass. Retention 24 passes, and 0, -1, "24", and null fail. An empty string for an optional key fails. Unknown keys pass. {} passes triage and gives reproduce 2 problems. A missing routing map fails only triage, and a bad retention fails only reproduce. Usage errors exit 2. The setup-qstack step 8 flow, with the example feature map copied and the settings written, passes reproduce.
    • The one mismatch is cosmetic. A settings file saved as UTF-16LE, which PowerShell 5.1's > and Out-File write by default, fails closed with "not valid JSON". The message spans 2 lines and does not name the encoding.
  6. node mutate.mjs breaks one rule at a time in a scratch copy of head and runs node --test. The tests catch all 5 rules from the test plan, plus 3 extra mutants: .trace not counted as a recording, zero retention allowed, and the byte-order mark not stripped. Disabling the recording rule fails 2 tests rather than only its own, because the empty-evidence test also asserts the recording message. That is a wording nit in the test plan, not a test problem.
  7. node qstack-validate-md.mjs from the plugin root reports 59 files and 2 problems at base, and 60 files and the same 2 problems at head. Both are the dangling principle-guard-the-context-window paths in diagnose-live.md:10 and diagnose-trace.md:11, and neither file is in this PR. My check-links.mjs resolves all 61 relative links and anchors in the 11 changed markdown files at head, with 0 broken.
  8. I checked the CLI claims against the installed @playwright/cli 0.1.22 help and skill files without running the CLI. -s=<name> sessions, the in-memory profile default, eval, run-code, video-start [filename], video-stop, install --skills with -g, and install-browser [browser] all exist, and ffmpeg is a listed install name. A transcript from the test drive shows the CLI printing each action's Playwright code with a locator, such as page.locator('[data-test="login-button"]').click().
  9. The 7 keys in settings.md match the key names in pstack's automations/benny/templates/configuration.example.yaml. A grep at head finds no remaining mention of Playwright MCP, Chrome DevTools MCP, or the CrUX flags, and the only mention of Cursor's built-in browser is the new rule. The skill text matches the PR body. A failed reproduce check means Blocked in reproduce-issue step 2 and in playbook step 3. A failed triage check means triage-defect still writes the report but routes nowhere and writes no ticket.

Notes

  1. Known limitation. Head rejects 2 of the 36 real verdicts. Both are timing findings that cite timing data and no video. The planned follow-up that lets timing verdicts cite timing data covers them.
  2. Captures land inside the repository by default. playwright-cli writes snapshots, console logs, and traces to .playwright-cli under its working directory unless a config sets outputDir. I read this in the CLI's bundled outputDir() function, and the two drive folders hold 1,069 and 1,802 such files. So an agent that runs the CLI from the workspace root writes captures inside the repository, against "Keep captures outside the repository", and bypasses control.artifact_directory. The test drive avoided this by running from the drive folders, but no skill says to. A line under Browser targets could say to run playwright-cli with control.artifact_directory as its working directory and to give screenshots and videos absolute paths inside it. Playwright MCP had the same default at base, so this is not a regression.
  3. The fix-verification path skips the settings gate. verify-fix-and-retest.md step 4 and verify-existing-fix.md drive "the configured control adapter" but never run check-settings.mjs. The reproduce path runs it in reproduce-and-triage.md step 3 and reproduce-issue step 2. Reading the text, nothing on the verify path turns a missing or bad settings file into Blocked.
  4. A bare .trace file holds no screencast. The checker accepts trace-<n>.trace. I measured the test drive's cli-probe trace, and its 2 screencast-frame events point to JPEG files in a sibling screencast/ folder. Keeping or citing only the .trace file keeps no frames. The references could say to keep the whole trace folder, or to cite a zip of it.
  5. Small checker nits, none blocking. A feature_map_path that names a folder passes, because the check uses existsSync. The use name constructor crashes with "TypeError: required is not iterable" and exit 1, not the usage line and exit 2, because READS[use] finds the prototype property. The UTF-16 error could name the encoding.
  6. Not checked independently. My rules forbid opening a window or running playwright-cli, so I did not re-run the click-probe table, the calculator observations, or the video-stop false-path trap. The README's statements about Cursor's docs are unverified because auto-review blocked the docs fetch. These are the symlink rule, the Allow Local Plugin Imports setting, and the Customize view. The worktree install the README describes matches the one at ~/.cursor/plugins/local/qstack on this machine.

The scripts and fixtures are in %TEMP%\qstack-verify\pr4. To rerun them, add base and head worktrees at the two SHAs there, then run node matrix.mjs and node mutate.mjs.

@dotts-h
dotts-h force-pushed the fix/qstack-research-corrections branch from 0371e6b to e3e98ea Compare October 19, 2026 09:39
…apps through the Playwright CLI

- Settings. qstack read control.skill_name, control.feature_map_path, and routing.map_path, but nothing said where they live. Define .cursor/qstack/settings.json with the key names pstack's configuration uses, and add scripts/check-settings.mjs. reproduce-issue is Blocked when the check fails. triage-defect routes nowhere and writes no ticket when it fails.
- Recording. The reproduce-and-triage playbook accepted a screenshot or a recording, while reproduce-issue required both. A video, or a trace that holds a screencast, now counts as a recording. Screenshots alone do not. check-verdict.mjs rejects Reproduced, Confirmed, and Insufficient fix verdicts that cite no recording, and rejects empty evidence files.
- Browser. Web apps are driven through the Playwright CLI. Cursor's built-in browser may explore a page, but it may not drive a repro run or a check, because its coordinate click fires on disabled controls and sends untrusted events. The Playwright MCP and Chrome DevTools MCP lines are removed.
- README. Load the plugin from a real folder or a git worktree, because Cursor skips a symlink in the local plugin folder that points elsewhere.

Co-authored-by: Cursor <[email protected]>
@dotts-h
dotts-h changed the base branch from fix/qstack-research-corrections to main October 19, 2026 09:39
@dotts-h
dotts-h force-pushed the fix/qstack-adapter-gaps branch from 6daa771 to 6687834 Compare October 19, 2026 09:40
@dotts-h
dotts-h merged commit 6cda90e into main Oct 19, 2026
dotts-h added a commit that referenced this pull request Oct 19, 2026
* test(check-markdown): run the markdown checker under node --test

Move the markdown link validator into scripts/check-markdown.mjs. It checks skill frontmatter, links, anchors, cited paths, long dashes, and curly quotes in every markdown file. node --test now fails when the plugin has any such problem, and a second test proves that the checker reports each kind.

The README's bare SKILL.md mention now reads skills/<name>/SKILL.md, so the checker no longer needs a qstack-mode lookup base that let any file cite qstack-mode paths without their prefix.

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

* fix(check-verdict): make the verdict reference, reproduce-issue, and the checker agree

reproduce-issue required Fix artifact and Missing lines under Verdict, but the reference's Reproduction example left them out and the checker never read them. The checker now requires both lines on the six reproduce-issue outcomes. Confirmed and Insufficient fix need the fix URL, and Blocked must name what was missing. Gate and parity outcomes need neither line.

The reference now says how to read the checker's summary line, where a triage report goes in a verdict file, and that a run counts when only its video shows the broken state.

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

* fix(triage-defect): file clearly broken states and add an Unclassified category

On the drives, agents raised clear defects as questions because a reference build, a baseline account, or the page text seemed to allow them. Triage now files a clearly broken state as a Bug whatever the expected-state source says, and gives examples of a stuck state and a self-contradicting one. The playbooks that pick the source of an expected state point to that rule.

The old "unclear" case told the agent not to pick a category, while the report template expects one. It is now the Unclassified category, which files nothing and maps to the other marker.

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

* fix(qstack-mode): define a black-box run and skip source steps in it

Both drives ran against public sites with no source, while the playbooks asked for how and why traces, profiles, and the files that own a result. qstack-mode now defines a black-box run once. Each step that reads the source points to that definition and is marked skipped. Triage writes the cause trace as unavailable, and a timing limiter comes from counters with what runs inside it named unknown.

The control adapter, the verdict Environment line, and the pull request rule in reproduce-issue no longer assume a repository, a seed, or a pull request. When a public page's expected behavior can be learned only by using it, the agent explores first and writes the feature map from what it saw.

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

* fix(reproduce-issue): let the parent run the reviewer a delegate cannot spawn

A qstack delegate does not own Task spawns, so it cannot run the separate read-only reviewer that confirms the evidence. On the calculator drive, the delegate reviewed its own screenshots instead. The delegate now says it could not spawn the reviewer and lists the evidence paths. The parent runs the reviewer before it accepts the verdict.

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

* fix(visual-parity): add a noise threshold, a repeat rule, and a behavior line

On the Sauce Demo drive, visual parity compared accounts, not revisions. An invisible 4-level delta seen in 1 of 2 renders still forced Unproven, and a placeholder image on every product went to a person as a visual question instead of being filed.

The playbook now defines the baseline for revisions, accounts, and environments, and takes full-page captures. A pixel differs only above 8 of 255 levels, which clears the measured 6-level noise between two baseline renders. A change must show in both of two fresh captures. Behavior changes such as image sources, text, and dialogs go to reproduce-and-triage and do not decide the visual outcome. Visual changes without a person go into one questions file. The control adapter says that a native dialog's evidence is the CLI's dialog record.

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

* fix(perf-gate): define the sides and the trace, and add delays only automation sees

The perf gate assumed one before-and-after number and never said what a trace is. On the Sauce Demo drive, the agent compared two accounts and exported the page's performance entries, because a Playwright trace would capture the site's scripts. The error_user wait came from a failing error-report request that held each click for about 3.4 s while the page kept responding.

The playbook now names a baseline and a compared side, defines a trace, and says when to export performance entries instead. It adds a step that separates a delay a person sees from one only automation sees, and a step for the timing report.

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

* feat(check-verdict): let a timing verdict cite timing data instead of a recording

PR #4's checker rejected the two Sauce Demo timing verdicts, because their evidence is performance-timeline data and not a video or a trace. A verdict now declares itself a timing verdict with a Timing line in its run record, naming the clock that timed each run. Only then does a non-empty .json, .jsonl, .csv, .sqlite, .db, or .cpuprofile file count in place of a recording. Without the line, a data file does not count, so a screenshot-only verdict cannot pass by citing a JSON file. A placeholder such as "Timing: none" is rejected.

scripts/fixtures/timing holds copies of the two real verdicts with the one Timing line added. The tests show that they pass with it and fail without it, and the markdown checker skips the fixtures folder because the fixtures cite paths from the drive.

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

* fix(control-adapter): open no window on the user's desktop

On Windows, each Playwright CLI video-start opened a visible console window for ffmpeg until video-stop (microsoft/playwright#43515). Agents that recorded every run opened windows every few seconds, and the user had to stop the drive.

qstack-mode now forbids opening any window on the user's desktop, which means headless browsers, no Start-Process, and no viewers. On Windows, the control adapter records a trace instead of a video unless the CLI hides the ffmpeg window. When the run must not capture the page's scripts, which a trace holds, recording is missing and the outcome is Blocked.

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

---------

Co-authored-by: Cursor <[email protected]>
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