Spec: self-testing loops from the Self-Testing AI Agents course
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 25/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- github-actions, playwright, typescript
- 领域
- devtools, testing-qa
调研方向
Start by reading the implementation decisions and identify the gstack skills, playbooks, principles, scripts, and references named there; inspect their indexes and go-help and README entry points. Check the reused course examples and vendor-specific claims against the cited commands and current documentation. Done means the specified materials and tests are added, each flagged example is reproduced before and after any fix, and the verification records are included in the PR description.
由索引模型根据 Issue 内容生成。
描述
Problem
Agents using gstack still make the human their feedback loop. gstack says to prove work against the real artifact, but it gives the agent few concrete procedures for doing so. It has no procedure for a flaky test, so agents raise retries or skip the test. A red build gives the agent a wall of runner output instead of a short readable account of the failure. Nothing helps a repo owner see which feedback loops their project has and which it lacks. Nothing tells an agent which test layer fits a change either. Asked to test a React login flow, an agent following gstack today writes a component test with mocked fetch calls. That test never sees the cookies, redirects, and sessions where login actually breaks.
The Self-Testing AI Agents course has the missing procedures, rules, and scripts. Its examples also contain bugs. A model review flagged them without running anything, so some of the flags may be wrong.
Solution
gstack gains three skills, one playbook, and one principle, and four existing skills get sharper. Together they let an agent check its own work at the right layer, read a failure without help, handle a flake without hiding it, and set up the missing loops in a project.
Every course example that gstack reuses is checked before it ships. Each flagged bug is reproduced against the example as written. A confirmed bug is fixed in the gstack copy, and the reproduction runs again to show the fix. A claim that does not reproduce is dropped.
User stories
Choosing a test layer
- As an agent testing a change, I want a rule that picks the lowest layer where the bug can actually occur, so that I test pure logic with unit tests, component behavior with component tests, and anything across the browser-server line with one real end-to-end test.
- As an agent testing a login flow, I want the rule to name auth, sessions, routing, and redirects as browser-server concerns, so that I write one end-to-end test of the main path instead of only mocked form tests.
- As an agent, I want to know when each layer runs, so that I run sub-second checks continuously, targeted checks on every meaningful edit, slow suites before declaring done, and leave CI-only suites to CI.
Handling a flaky test
- As an agent facing a flaky test, I want to run it ten times and read the failure count, so that I know whether it fails only in CI (0 of 10), is a real flake (1 to 3), or is broken (4 or more). The reruns use the project's Playwright test runner, not an ad hoc browser script.
- As an agent, I want to classify a flake as a timing race, leaked state, an ambiguous locator, or a config or auth mismatch, with evidence from the trace, before I change code.
- As a repo owner, I want agents never to raise retries to make a flake pass, so that retries stay a ceiling and not a fix.
- As a repo owner, I want a quarantined test marked as an expected failure with a linked issue, so that it fails the run once it starts passing and someone removes the quarantine.
Reading a failure
- As an agent with a red test run, I want a short markdown dossier per failure with the error, location, screenshot, trace path, and a reproduce command, so that I can fix it without a human explaining the failure.
- As an agent, I want to read the trace before changing code, and to start from the action that took far longer than the others, so that the fix follows evidence.
- As a repo owner, I want the option to generate the dossier automatically when a test command fails, so that the agent reads it without being told to.
- As a gstack user, I want the reproduce command to run exactly the failing test even when its title contains
$, backticks, or quotes, so that pasting it never runs the wrong test or expands shell syntax. - As a gstack user, I want each failure's message shown whether the Playwright JSON report puts it in
erroror inerrors, so that no failure appears with an empty message.
Auditing a project's loops
- As a repo owner, I want an audit that lists each feedback loop with its real command or "missing, proposed: …", so that I see the loops my project has and the loops it lacks. The loops are agent rules, static checks, git hooks, end-to-end proof, failure output, CI, nightly checks, and post-deploy smoke checks.
- As a repo owner, I want the audit to name the weakest loop and build the first fix, so that the audit ends in a change and not a report.
- As a repo owner, I want each check placed by its speed, so that staged-file checks under ten seconds run on pre-commit, checks under two minutes run on pre-push, CI is the clean-environment superset, and nightly runs only slow checks that catch drift.
- As a repo owner, I want each nightly failure to become an issue, a PR, or a file an agent can read, so that nightly failures do not sit unread.
- As a repo owner, I want a post-deploy smoke check with stop-ship triggers written before the deploy, so that a bad deploy is caught and rolled back by rule.
- As a repo owner copying the post-deploy workflow, I want the smoke job to receive the deploy URL, so that the smoke test runs against the deployment and not against an empty base URL.
- As a repo owner using the structured triage pipeline, I want the "needs human review" count to equal the number of low-confidence failures, so that the routing decision is correct.
- As a repo owner turning triage output into CI annotations, I want each annotation to land on the right file and line whatever its message contains.
Keeping agents inside the guardrails
- As a repo owner, I want
git commit -n,git -C <path> commit --no-verify, and the env prefixesHUSKY=0,LEFTHOOK=0,LEFTHOOK=false, andLEFTHOOK_EXCLUDE=denied, so that an agent cannot skip git hooks with a short flag or another spelling. - As a repo owner, I want ordinary commands that contain
-n, such asgit log -n 5andgrep -n, allowed, so that the guard does not block normal work. - As a repo owner, I want the files that hold the guardrails themselves protected, so that an agent cannot pass a check by editing hook configs, CI workflows, or lint config. The audit also flags quieter bypasses: a narrowed glob, a removed or renamed check, and a step moved to a later stage.
- As a repo owner, I want behavior that must happen every time enforced by a hook, so that
correctreaches for a hook when a rule alone keeps being skipped.
Learning from review
- As a repo owner, I want a review-bot finding that shows up in a third PR promoted to an agent rule, and to a lint or a test if it keeps happening, so that review comments stop repeating.
- As a repo owner writing a reviewer config, I want a structure to follow, so that the reviewer knows what to flag and where, what to ignore, and to name the line and a specific fix in plain words.
- As a repo owner, I want to test a reviewer config by planting a bug that passes every local check, so that I know whether the config catches it and whether an agent can fix it from the comment alone.
Proving behavior in a running app
- As an agent proving a change in a project's verification skill, I want any new console error to block done, so that a change that throws is never reported as working.
- As an agent, I want accessibility violations on changed routes to block done, with results that axe marks incomplete going to a human to review.
- As an agent, I want visual baselines changed only in the same commit as an intentional UI change, so that a baseline is never regenerated to make a test pass.
- As an agent working on a web app, I want the course's Playwright rules available for reference, so that my tests use stable locators and real waits. The rules cover the locator order, banned waits, storage-state auth, HAR recording, and
test.step. The reference opens by saying that Playwright drives the browser to prove a change, and that Chrome DevTools MCP is for debugging, not for proof.
Implementation decisions
New skills, playbook, and principle
- Test-layer principle. A new principle states the rule in stories 1 to 3. It joins the Verification group in the go-mode principle index. The tdd skill and the Feature playbook point to it. To generate a new end-to-end suite, the principle points to Playwright Test Agents (
npx playwright init-agents) instead of having the agent write the suite by hand. - Flaky-test playbook. A new go-mode playbook covers stories 4 to 7. It sits beside Bug fix and Trace forensics in the go-mode playbook index, with one routing line.
dossierskill. It ships a script that reads the runner's JSON report and writes one markdown file per failure (stories 8 to 12). The skill body holds the trace-reading procedure and the optional hook that runs the script when a test command fails. The script targets Playwright's JSON report first.loop-auditskill. It generalizes the course's lesson on porting the loop to another stack (stories 13 to 23). Its references hold the stage placement table, the post-deploy smoke example, the nightly example, the structured triage pipeline, and the anti-bypass checklist. It sends static-layer setup to the user'sproject-guardrailsskill when that skill is installed, and it does not duplicate that skill.- Bypass guard. A hook script ships with
loop-audit(stories 21 and 22). It splits the command into separate git invocations and checks flags only ongit commit, as the course's Cursor variant does. A plain regex over the whole command cannot tellcommit -nfromlog -n.
Changes to existing skills
correct. Add hooks as the level for behavior that must happen every time, between types and tests (story 24). Add the review-bot third-PR threshold as a source of mistake classes (story 25). Add protecting the guardrail files themselves (story 23).- Review-bot triage reference in
go-mode. Link the third-PR threshold tocorrect. Add the reviewer config structure and the planted-bug check (stories 26 and 27). create-verification-skill. Add stories 28 to 30 to the proof standards in the skill it generates. Add a Playwright reference with the course's rules (story 31), linked only for web surfaces. The reference names the driving tools: the project's Playwright test runner for proof, and@playwright/clifor an interactive loop when the agent works in a shell. Playwright MCP is the fallback when the host has no shell loop. The debugging side, Chrome DevTools and thecontrol-uirouting, is a separate spec.- go-help and README. Each new skill, the playbook, and the principle get a go-help row and a README line, per the gstack convention.
Checking reused course examples
- Each flagged bug follows the same order. Run the course example as written and record the failure. Apply the fix. Run it again and record the pass. Both records go in the PR description.
- A claim that does not reproduce is dropped. The PR lists it with the command that disproved it.
- Fixes land in the gstack copies only. No patches go to the course repo.
- The dossier builds the reproduce command with POSIX single-quote escaping, not
JSON.stringify. - The workflow fix declares the deploy URL as a job-level output.
actionlintreports references to undeclared job outputs, so it confirms both the bug and the fix. - The
jqfix collects low-confidence failures into one array before counting them. - The annotation fix follows GitHub's workflow-command escaping:
%,\r, and\nin the message, plus,and:in property values. The review claimed that commas and colons in the message also break annotations. GitHub's rules say they do not, so that claim is checked like the others. - Vendor-specific facts from the course, such as CLI flags, hook payload shapes, and action versions, are checked against current docs before they go in a skill. The course dates from April 2026. The same check covers the facts from Steve Kinney's article "Playwright vs. Chrome DevTools MCP":
@playwright/cli,npx playwright test --debug=cli, andnpx playwright init-agents.
Left to the build
- The test-layer principle's name.
- Which Playwright version the dossier fixture report comes from.
- Whether the dossier script supports a second runner's JSON format now or later.
Testing
- Dossier script. A
node --testregression test runs the script on a fixture JSON report with hostile test titles and both error shapes. It catches quoting and missing-message regressions. It misses report-format changes in later Playwright versions. Prior art: thedoctortests spawn the real script on fixture files. - Bypass guard. A
node --testregression test pipes samplePreToolUsepayloads into the hook script. It asserts a deny for every bypass form in story 21 and an allow for every look-alike in story 22. It misses changes to the harness payload shape. Prior art: the samedoctortests.
Everything else is verified by running it. Each new or changed skill passes the authoring-a-skill validation and the build. loop-audit runs once on a real project. The post-deploy workflow passes actionlint, the jq fix runs on a sample triage stream, and one annotation renders in a GitHub Actions run.
Out of scope
- Performance budgets. The course's checker sums module gzip sizes, not emitted files, and never reads its runtime budget. It needs its own design.
- Vendor walkthroughs for Bugbot, Copilot, and Codex.
- The capstone grading checklist.
- The Codex edit guard and the custom MCP probe. gstack does not reuse them.
- Contradictions in the course prose, such as the default retry count and whether the starter ships a Lefthook config.
- Upstreaming fixes to the course repo.
- 主要语言
- TypeScript
- 星标
- 0
- 派生
- 0
- 平均合并
- 3 小时 33 分钟
- 30 天内合并 PR
- 13
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
gregogun/gstack 的其他 Issue
-
ready-for-agent
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
ready-for-agent
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
ready-for-human
难度 4/5 3-5 天 新手友好度 43/100
维护者通常 1 天内回复
-
ready-for-agent
难度 3/5 1-2 天 新手友好度 56/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
Nimblesite/SharpLsp#468 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Bundled uv is never updated and trusts the compromised eMudhra certificates可能已有人在做 @FabienDanieau 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 76/100
-
bg_wait's blocking mode (stopOnAttention: false) is under-documented and effectively undiscoverable未关闭
难度 2/5 1-3 小时 新手友好度 66/100
nicobailon/pi-subagents#3019 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
db-ux-design-system/core-web#8613 ·
维护者通常 1 天内回复