Repository navigation
Conversation
…here too
genclass_explain wrote a Playwright test that could not go green. On the Tiny
Shop (docs/evidence/e2e-walkthrough/app) typing "react" fast lets an older
/api/search answer land last, and explore reports it: under seed 2 the page
shows "Reading lamp" and "Real wood desk". Explore compares page lines as
counts: the shop always lists a product card "Reading lamp", so that line is
there once with responses in request order and twice in the failing order
(the finding's evidence says so: textCounts 1 and 2). The generator ignored
the counts and wrote `expect(snap.text).not.toContain("Reading lamp")`, which
the card alone fails, so the test stayed red after the fix.
testgen.ts now reads textCounts, as the replay verdict already does: a line
both orders show is asserted by how many times the page shows it (no more
often than with responses in request order; for a line the failing order
showed less often, no less often, where presence passed on the bug). A line
one side never shows, and a finding stored without counts, keep the presence
assertion, so those tests are generated byte for byte as before. Counts enter
the file only as whole numbers.
Tests: the shop's case through the store (the generated assertions run on the
fixed page's lines and on the failing order's), the reverse direction, and
counts from a state file.
No version bump: a release is the owner's call.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e it shows The finding from the Tiny Shop read `it shows "Reading lamp", which the baseline does not`, and the report listed "Reading lamp" under "page text only in this run", while the baseline shows that line once (the product card): page lines are compared as counts, 1 in request order and 2 in the failing order. - nameDifference() (the finding's title and the report's RACE line) names a line the other side never shows before a line both sides show, so the shop's finding says `it shows "Real wood desk", which the baseline does not`; when every line is on both pages it says the counts: `it shows "Reading lamp" 2 times, 1 in the baseline`. - The report's lists and genclass_explain's evidence add the counts to such a line: `"Reading lamp" (2 times in this run, 1 in the baseline)`. - compare.ts onBothSides() reads textCounts for the title, the report and the test generator (whole numbers only); the generated message says "1 time". A diff or finding kept without counts reads as before. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
genclass_explainturns a race found bygenclass_exploreinto a Playwright regression test. On the Tiny Shop(
docs/evidence/e2e-walkthrough/app) that test could not go green: it stayed red after the race was fixed.Typing "react" fast lets an older
/api/searchanswer land last. Explore reports it correctly: under seed 2 the pageshows "Reading lamp" and "Real wood desk". Explore compares page lines as counts, and the shop always lists a product
card named "Reading lamp" outside the results, so that line is on the page once with responses in request order and
twice in the failing order. The finding's evidence says so (
textCounts:"Reading lamp": { baseline: 1, run: 2 },"Real wood desk": { baseline: 0, run: 1 }), and the replay verdict has used those counts since 0.2.0.The test generator did not (
packages/mcp/src/testgen.ts, the loop overtextOnlyRun). It wrotewhich the product card alone fails, on the fixed shop too.
What changed
testgen.tsreadstextCounts:than with responses in request order for a line of the failing run, and no less often for a line of the baseline
(there,
toContainpassed on the bug);not.toContain/toContain, and so does a finding stored without counts, sothose tests are generated byte for byte as before;
For the shop's finding the test now ends with
The title and the report (second commit)
For the same reason the finding and the explore report said something untrue:
it shows "Reading lamp", which the baseline does not, and "Reading lamp" under "page text only in this run", while the baseline shows that line once.nameDifference()(the finding's title and the report's RACE line) names a line the other side never shows beforea line both sides show. The shop's finding now reads
under "seed 2" it shows "Real wood desk", which the baseline does not. When every differing line is on both pages it says the counts:it shows "Reading lamp" 2 times, 1 in the baseline.genclass_explain's evidence add the counts to such a line:page text only in this run: "Reading lamp" (2 times in this run, 1 in the baseline), "Real wood desk".Only
packages/mcp/and two paragraphs ofdocs/runtime/AGENT.md(5.1 the report, 5.3 the generator) changed. Nonew dependency, no model-visible text, nothing in the runtime.
Checks
npm run typecheck -w @genclass/mcp && npm run build -w @genclass/mcp && (cd packages/mcp && npx vitest run): green,343 tests.
New unit tests in
packages/mcp/test/testgen.test.ts("a race test counts a page line the page shows elsewheretoo"). They build the shop's finding through the store and run the generated assertions on page lines: on the fixed
page (the card still there) they pass, on the failing order's page they fail. Two of the three fail on main
(
expected 'fails' to be 'passes'for the fixed page;expected 'passes' to be 'fails'for the reverse direction).New tests for the wording in
test/compare.test.ts(the name) andtest/mcp.test.ts(the report andgenclass_explainthrough the tools); both fail on the first commit.The real flow, once, in headless Chrome, on a copy of the rehearsal's shop (the walkthrough's shop with
@genclass/runtime0.3.0-beta.11 from npm) and this branch's built server: explore (2 baselines, 3 seeded orders)→ RACE 2 of 3 →
genclass_explain→ the test, run withnpx playwright test. The same finding also went throughmain's generator for comparison.
Expected: <= 1, Received: 2on "Reading lamp")not.toContain("Reading lamp"))On the fixed shop
genclass_replaysays "not reproduced", and a new explore finds no race.The steps of
packages/mcp/test/e2e/race.e2e.mjs(both packages built): ok, withtestOnBuggy: failed,testOnFixed: passed,exploreFixed: no race. Its generated assertions are the same as before (its page shows noresult line anywhere else).
Not run, and why
race.e2e.mjsas committed: Playwright's own Chromium is not installed on this machine, so I ran a scratch copythat differs only in launching the installed Chrome (
channel: "chrome") and closing its browser while the specruns. The
mcp.ymlworkflow runs the committed script in Chromium on this pull request.packages/mcp/and one docparagraph changed.
Left for the owner
mcp-v*) is the owner's call. The changelog entries are under "Unreleased".🤖 Generated with Claude Code