Skip to content

Router tests use synthetic prompts instead of real benchmark tasks (GST-3402) - #4642

Merged
capy-ai[bot] merged 5 commits into
mainfrom
fix/synthetic-skill-route-fixtures
Nov 22, 2026
Merged

capy-ai[bot] merged 5 commits into
mainfrom
fix/synthetic-skill-route-fixtures

Conversation

@garrytan

@garrytan garrytan commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

gstack's current files no longer contain real benchmark tasks: the router tests' 63 SWE-rebench prompts are replaced with synthetic ones covering the same routes.
Why: every install is a clone of this repository, so those tasks sat in each user's home and in every eval run that installed gstack, contaminating any eval that uses them.
Nothing to do; a new check fails if a SWE-bench-style task id appears under test/ or browse/test/ again.

What changed

Eval runs install gstack, and an install is a clone, so the router tests' real SWE-rebench prompts were sitting next to the agents being measured. Those prompts are gone from the current tree, the router tests run on made-up projects and issues instead, and a free test now stops any SWE-bench-style task id from coming back.

  • Deleted test/fixtures/skill-route-b1-in-sample.json (60 B1 in-sample prompts built from SWE-rebench tasks) and test/fixtures/skill-route-bug-reports.json (3 SWE-rebench bug reports), and removed the three real task ids from test/skill-route.test.ts.
  • Added test/fixtures/skill-route-synthetic-prompts.json: made-up projects and issues only. The B1 wrapper around each task is kept, since that is the text the router sees in those runs.
  • test/free-fixtures.test.ts now scans every file under test/ and browse/test/ for an id shaped like a SWE-bench or SWE-rebench task, with a negative control that uses invented ids. A file too large to scan is reported instead of skipped.
  • docs/skill-routing-and-contracts.md points at the new fixture, and docs/TESTING_INTERNALS.md describes the new check.
  • Older commits still hold the original prompts, so an install with full git history, such as one pinned to a commit, can still reach them through git log. Removing them from history would need a rewrite, which this PR does not do.
Coverage, before and after
Router test Before After
B1-shaped prompts: every bug report names prove-it alone, never /verify first; plain prompts name nothing; a feature task is not a bug report 60 real prompts (46 bug, 14 feature) 60 synthetic prompts (46 bug, 14 feature), same assertions; the prompt hash check against the eval plan is dropped because there is no plan to match
GST-3123: words a long bug report shares with a /qa trigger don't route it to /qa; with a bug-fix skill it routes there 3 real reports, the longest 17,470 characters 4 synthetic reports, the longest 14,118 characters, with a new assertion that one is longer than the router's head and tail windows

The task-id check fails on main, naming both deleted fixtures and test/skill-route.test.ts.

Router gaps the first draft found

My first draft of the synthetic reports was written without looking at the detector. 14 of the 46 bug reports did not read as bug reports, and one routed to /verify first. Three of the 4 long reports routed to /qa, because a long report containing "find", a defect word and "site" anywhere matches the "find bugs on site" trigger, and one contained the phrase "test the site". I reworded those prompts to state their symptom plainly, so this PR keeps the router's behavior and its tests as they were. The gaps are recorded for a follow-up.

Why

Real benchmark tasks in the repository meant every gstack install carried them into the user's home and into every eval arm that installed gstack. An agent under test could find the very task it was being scored on. Now the current tree holds only synthetic prompts, and a free test keeps it that way.

Blast radius

Only tests, test fixtures, one changelog entry and two docs change; no product code, skill text, setup or install path is touched. The deleted fixtures had no other readers (a tree-wide search for both file names finds none), and CI's full free suite passed at this tree (run 44964526303).

Pre-Landing Review

Two review rounds, plus one quick recheck of the first fix. The first round's Red Team found the changelog overclaimed (full-history installs still hold the old prompts), and that wording was fixed. The second-model review (GPT-6.2 Astra) found two real problems in the new check, both fixed and rechecked by the second round: the negative control spelled two real task ids in pieces (it now uses invented ids), and files over 8 MB were skipped silently (they are now reported). Nothing above the blocking floor is open.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL sf-0f9be970b67d security finding, details recorded privately
  • INFORMATIONAL test/free-fixtures.test.ts:178 The task-id scan checks file contents but not file paths, so a task stored under a folder named after its id with no id in the text would pass.
  • INFORMATIONAL test/fixtures/skill-route-synthetic-prompts.json:1 The synthetic fixture's about text says no text comes from a real task, but every prompt keeps B1's prompt wrapper (task content is all synthetic).
  • INFORMATIONAL test/free-fixtures.test.ts:159 The scan's pattern misses an id glued to a word character, such as one prefixed with instance_.
  • INFORMATIONAL changelog.d/synthetic-skill-route-fixtures.md:4 Clones made before this change keep the old prompts in their git history after upgrading; only a fresh shallow install is clean.
  • INFORMATIONAL test/skill-route.test.ts:77 The bug-report-is-not-a-QA-request router test never produces a /qa candidate with these prompts (also true on main), so it passes without exercising the overlap.
  • INFORMATIONAL test/free-fixtures.test.ts:177 No test covers the new branch that reports a file over 8 MB as too large to scan.
Exploratory QA

No runtime surface changed: this PR touches tests, fixtures and docs only. The reviewers ran the two affected test files themselves (44 pass, 0 fail at the reviewed tree), and the new check's negative control proves it catches a planted id.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch; bug fixes need no plan).

TODOS

No TODO items completed in this PR.

Documentation

Status: updated. One factual doc edit; no blockers.

Scope: base c8641cc to HEAD 78a1c6c (4 commits, 8 files), with no staged, unstaged or untracked changes. The changes swap the real SWE-rebench router fixtures for synthetic prompts and add a free test that scans for task ids.

Documentation health:

  • docs/skill-routing-and-contracts.md: current (the branch already points it at the synthetic fixture; 60 prompts, 46 bug reports, checked against the file)
  • docs/TESTING_INTERNALS.md: updated (documents the task-id scan in test/free-fixtures.test.ts)
  • changelog.d/fix-synthetic-skill-route-fixtures.md: reviewed, owned by ship

Coverage debt: the task-id scan now has reference coverage only. There is no how-to for contributors on adding router fixtures safely (common gap). No architecture diagram drift.

Tests
  • CI Free Tests, run 44964526303 at tree 8e555f2 (head e000e18): green, 1,733 test files carried
  • macOS named regressions: green in the same run
  • bun test test/free-fixtures.test.ts after the review fixes: 13 pass, 0 fail
  • bun test test/changelog-fragments.test.ts after the changelog edit: 15 pass, 0 fail
  • Before /ship, at 48e9754: typecheck, typecheck:test, skill-route, free-fixtures, test-of-test-ratchet, spawnsync-timeout-tripwire, test-free-shards, bun-entry-isolation, changelog-fragments, skill-contract-stop-hook, skill-descriptions, docs-only, test-pr-profile, module-size-ratchet and gitattributes-eol all passed
Agent notes

GSTA-759 for GST-3402, replacing #4638 (closed) on GStack Minder's ruling. The deleted originals are kept in the org drive under handoffs/GEVA-562/skill-route-fixtures/; gstack-evals' B1 route table holds the task ids and prompt hashes but not the prompt text or labels.

Refs GST-3402

CI note: Free Tests run 44963661037 on e000e18 hit a tree mismatch because main moved; the first attempt was also cancelled when its free-plan runner setup took 4m44s against a 5-minute job timeout (infra). Free Tests was dispatched on the branch as run 44964526303, which is green and carries the test results.

REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=7 fixed=3 scope=frozen unbound=2 ledgers_read=4 fix_checks=1 dispatches=4
Gate edits: none detected (0 listed, 0 read)
Second-model review: openai/gpt-6.2-astra (host subagent), completed, outside the certified configuration (openai/gpt-6.1-sol at medium)

Approvals

No approvals recorded for branch fix/synthetic-skill-route-fixtures.
Plan: exempt: bug fix (test fixtures only), no plan review per R4
Plan check: exempt bug fix

{
  "schema_version": 1,
  "pr": 4642,
  "head": "e000e18dd0082f94e6b343810c8a3a9e873c6c6a",
  "version": "1.102.2.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 1733,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44964526303,
      "attempt": 1,
      "tree": "8e555f2dfd2412a2b92c7b1c6be0577ec46304da"
    }
  ],
  "calls": 19,
  "session_kind": "unattended",
  "run": "/home/user/.capy/work/ship-4642",
  "head_tree": "8e555f2dfd2412a2b92c7b1c6be0577ec46304da",
  "product_patch_id": "ac6ce10647dcee3833d0621cd2b104a60bc6946b",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 0,
    "rules": "85b3923b1a978e41",
    "base": "2887261a478144bc8a1b466c5e027a100c913a09",
    "registry": "2887261a478144bc8a1b466c5e027a100c913a09",
    "gate_scan": {
      "tagged": 0,
      "head": "e000e18dd0082f94e6b343810c8a3a9e873c6c6a"
    },
    "reasons": [
      "gate-class",
      "runtime=0"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @8e555f2dfd24 (8 checks, current for e000e18dd008)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44964526303/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=8e555f2dfd24 tests=38710 skipped=67 runs=44964526303/1 profiles=ci-reuse/free-tests heads=e000e18dd008 verified=2026-11-22T00:07:43.410Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/, README.md, CONTRIBUTING.md against base c8641cc (8 changed files)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 7,
    "fixed": 3,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 2,
    "ledgers_read": 4,
    "unbound": 2,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  },
  "gate_dispositions": []
}

Open in Capy

…ST-3402)

Every gstack install is a clone of this repository, so the 63 SWE-rebench task prompts in the router fixtures sat in each user's home and in every eval run that installed gstack. They are replaced with 60 synthetic B1-shaped prompts (46 bug, 14 feature) and 4 synthetic long bug reports that share words with /qa's triggers, the real task ids are gone from the tests, and the fixture inventory test now fails if a SWE-bench-style task id appears under test/ or browse/test/.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 4 commits November 21, 2026 23:33
Review-Finding: p1/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/outside-voice#1 reader=outside-voice
Review-Finding: p1/outside-voice#2 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit d8abe59 into main Nov 22, 2026
86 of 88 checks passed
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