Skip to content

Prompt router names your bug-fix skill first and stops sending feature requests to it (GST-3462) - #4674

Merged
capy-ai[bot] merged 9 commits into
mainfrom
fix/skill-route-recall-order
Nov 22, 2026
Merged

capy-ai[bot] merged 9 commits into
mainfrom
fix/skill-route-recall-order

Conversation

@garrytan

@garrytan garrytan commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

gstack's prompt hook now recognizes more bug reports and names your installed bug-fix skill first.
Why: in our Codex run the model loaded whichever skill the hook named first, and on 7 bug tasks that was /verify, never prove-it.
Nothing to do: the change is in the hook's scoring, with no setting or install change.

What changed
  • Order. When the installed bug-fix skill (a non-gstack skill with a trigger like "fix this bug") reaches the threshold beside a gstack skill, it is named first.

  • More bug reports recognized. New strong signs: "should X, but Y", "Expected:"/"Actual:", regressions ("started with 0.19", "used to work", "no longer"), security holes, lost data. New weak signs: "never", "must", and words for an unwanted outcome (lost, ignored, dropped, twice, truncated).

  • Messages no person typed are skipped (Skill routing routes messages from other agents and sessions as if a person asked #4423). Claude Code runs the hook on a message from another session (<cross-session-message …>) and on a background agent's hand-back (<task-notification>) too, and its payload has no field that marks them, so the hook skips text that starts with either wrapper and logs reason=agent-message. Closes Skill routing routes messages from other agents and sessions as if a person asked #4423.

  • /qa or /review for a reported defect only on their own phrase. A prompt that reports a defect goes to /review or /qa only when it holds one of their trigger phrases in order, with only small words such as "my" added ("find bugs on my site", "review this PR for bugs"), and never asks for a fix; a report that just shares their words ("the site crashes during the smoke test") goes to your bug-fix skill, or with none installed is not named to /review or /qa. "Test the site and fix what you find" reports no defect and keeps /qa.

  • Feature-titled requests are unchanged. A rule that stopped treating feature requests (titles starting with Add, Support, [Feature] and the like) as bug reports moves to a follow-up pull request; here they route as they do on main.

Evidence

All on the synthetic prompts in test/fixtures/; the first-draft set is held in (the rules were written after reading it).

Set main this PR
First-draft bug reports naming prove-it alone 32 of 46 42 of 46
First-draft bug reports naming /verify first 1 0
First-draft feature requests routed 1 of 14 1 of 14 (same prompt)
Long bug reports sent to /qa with no bug-fix skill 3 of 4 0 of 4
Current fixture: bug reports naming prove-it alone 46 of 46 46 of 46

Known misses kept in the test so they can only shrink: synthetic-bug-21, -27, -36, -43. Four new tests fail on main and pass here, including #4423's dry-run prompt.

Agent notes

Issues

Fixes #4423

Approvals

Approved: yes (record r-d162425a3a9a). The full approval record stays private.
Plan: exempt: bug fix
Plan check: exempt bug fix

Ruled note: lib/skill-route.ts:521:review-qa-order at 0a13de8 ruled by GSTA-36 (relayed from GSTA-36:2026-11-22T07:14:31Z) at 2026-11-22T07:14:31.938Z: routes the same as main or is the already-ruled over-catch class; no test fails, no production break (approval a-bd6d2c648ed4)
Ruled note: lib/skill-route.ts:524:bugfix-first-sort at 0a13de8 ruled by GSTA-36 (relayed from GSTA-36:2026-11-22T07:14:31Z) at 2026-11-22T07:14:32.046Z: routes the same as main or is the already-ruled over-catch class; no test fails, no production break (approval a-6419b0d23d03)
Ruled note: lib/skill-route.ts:422:vulnerab-overcatch at 0a13de8 ruled by GSTA-36 (relayed from GSTA-36:2026-11-22T07:14:31Z) at 2026-11-22T07:14:32.126Z: routes the same as main or is the already-ruled over-catch class; no test fails, no production break (approval a-ea44030d3f0c)
Ruled note: lib/skill-route.ts:423:version-digits at 0a13de8 ruled by GSTA-36 (relayed from GSTA-36:2026-11-22T07:14:31Z) at 2026-11-22T07:14:32.207Z: routes the same as main or is the already-ruled over-catch class; no test fails, no production break (approval a-f7ce8d6e81cc)
Ruled note: lib/skill-route.ts:422:signs-overcatch at 0a13de8 ruled by GSTA-36 (relayed from GSTA-36:2026-11-22T07:14:31Z) at 2026-11-22T07:14:32.312Z: routes the same as main or is the already-ruled over-catch class; no test fails, no production break (approval a-e0fcb1086808)
Ruled note: lib/skill-route.ts:335:phrase-stopword-swap at 0a13de8 ruled by GSTA-36 (relayed from GSTA-36:2026-11-22T07:47:16Z) at 2026-11-22T07:47:22.219Z: fixed in 08343f8 and confirmed clean by the granted fix-check; its row was logged blocking (approval a-4021502dae64)

Review-loop exception: accepted by GSTA-36 2026-11-22 via GSTA-36:2026-11-22T07:32:20Z: fixed in 08343f8, confirmed clean by the granted fix-check; open only because its row was logged blocking. (fix-check at 08343f8, 1 finding)

Fixes GST-3462 items 1, 2 and outside issue #4423 (reproduced on main with the reporter's own dry-run prompt). Bug fix, no plan review; failing-first tests in test/skill-route.test.ts. /ship receipt follows.

{
  "schema_version": 1,
  "pr": 4674,
  "head": "c1f16c5f16a2acad4716eaacbae6290d151e343f",
  "version": "1.102.2.0",
  "base": "main",
  "gate": {
    "route": {
      "pass": 54,
      "fail": 0,
      "skip": 0
    }
  },
  "calls": 33,
  "session_kind": "unattended",
  "run": "ship-4674c",
  "head_tree": "07fabafb8589fd27a66f21ab03987d9b8b72a105",
  "product_patch_id": "545c0645ac5160d40ff9499cfa3889e1e90578d7",
  "gstack_version": "1.102.2.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 121,
    "rules": "630fd3101899e28e",
    "base": "ef72e4142fb0972089c41286fc160374d3f191c4",
    "registry": "ef72e4142fb0972089c41286fc160374d3f191c4",
    "gate_scan": {
      "tagged": 0,
      "head": "c1f16c5f16a2acad4716eaacbae6290d151e343f"
    },
    "reasons": [
      "runtime=121"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @07fabafb8589 (8 checks, current for c1f16c5f16a2)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/44999851919/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44999851919/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=07fabafb8589 tests=38819 skipped=67 runs=44999851919/1 profiles=ci-reuse/free-tests heads=c1f16c5f16a2 verified=2026-11-22T08:27:54.772Z"
  ],
  "issues": {
    "fixes": [
      4423
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/ (151 files) and changelog.d/skill-route-recall-and-order.md against c2b4f0d2..HEAD"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 6,
    "deferred": 0,
    "noted": 3,
    "fixed": 1,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 1,
    "dispatches": {
      "specialist": 4,
      "red-team": 1
    }
  },
  "review_loop_exception": {
    "accepted_by": "GSTA-36",
    "date": "2026-11-22",
    "via": "GSTA-36:2026-11-22T07:32:20Z",
    "reason": "fixed in 08343f8, confirmed clean by the granted fix-check; open only because its row was logged blocking.",
    "fix_check": {
      "head": "08343f86c72f7828412247f311ab3eb874d639e7",
      "findings": 1,
      "files": [
        "lib/skill-route.ts"
      ]
    }
  },
  "review_round_grants": [
    {
      "kind": "fix-check",
      "head": "0a13de8a2943be39cd0d38ee18b9f7b3fde7bcfc",
      "pr": 4674,
      "by": "GSTA-36",
      "reason": "one scoped fix-check for the holdsPhrase regression (review my PR routes nowhere without a bug-fix skill)",
      "at": "2026-11-22T07:14:31.777Z",
      "approval": "a-655c875adab8",
      "stop_run": "ship-4674c",
      "findings": [
        "p1v/adversarial-native#2"
      ]
    }
  ],
  "ruled_notes": [
    {
      "finding": "lib/skill-route.ts:521:review-qa-order",
      "head": "0a13de8a2943be39cd0d38ee18b9f7b3fde7bcfc",
      "by": "GSTA-36",
      "reason": "routes the same as main or is the already-ruled over-catch class; no test fails, no production break",
      "at": "2026-11-22T07:14:31.938Z",
      "approval": "a-bd6d2c648ed4",
      "relayed": "GSTA-36:2026-11-22T07:14:31Z"
    },
    {
      "finding": "lib/skill-route.ts:524:bugfix-first-sort",
      "head": "0a13de8a2943be39cd0d38ee18b9f7b3fde7bcfc",
      "by": "GSTA-36",
      "reason": "routes the same as main or is the already-ruled over-catch class; no test fails, no production break",
      "at": "2026-11-22T07:14:32.046Z",
      "approval": "a-6419b0d23d03",
      "relayed": "GSTA-36:2026-11-22T07:14:31Z"
    },
    {
      "finding": "lib/skill-route.ts:422:vulnerab-overcatch",
      "head": "0a13de8a2943be39cd0d38ee18b9f7b3fde7bcfc",
      "by": "GSTA-36",
      "reason": "routes the same as main or is the already-ruled over-catch class; no test fails, no production break",
      "at": "2026-11-22T07:14:32.126Z",
      "approval": "a-ea44030d3f0c",
      "relayed": "GSTA-36:2026-11-22T07:14:31Z"
    },
    {
      "finding": "lib/skill-route.ts:423:version-digits",
      "head": "0a13de8a2943be39cd0d38ee18b9f7b3fde7bcfc",
      "by": "GSTA-36",
      "reason": "routes the same as main or is the already-ruled over-catch class; no test fails, no production break",
      "at": "2026-11-22T07:14:32.207Z",
      "approval": "a-f7ce8d6e81cc",
      "relayed": "GSTA-36:2026-11-22T07:14:31Z"
    },
    {
      "finding": "lib/skill-route.ts:422:signs-overcatch",
      "head": "0a13de8a2943be39cd0d38ee18b9f7b3fde7bcfc",
      "by": "GSTA-36",
      "reason": "routes the same as main or is the already-ruled over-catch class; no test fails, no production break",
      "at": "2026-11-22T07:14:32.312Z",
      "approval": "a-e0fcb1086808",
      "relayed": "GSTA-36:2026-11-22T07:14:31Z"
    },
    {
      "finding": "lib/skill-route.ts:335:phrase-stopword-swap",
      "head": "0a13de8a2943be39cd0d38ee18b9f7b3fde7bcfc",
      "by": "GSTA-36",
      "reason": "fixed in 08343f8 and confirmed clean by the granted fix-check; its row was logged blocking",
      "at": "2026-11-22T07:47:22.219Z",
      "approval": "a-4021502dae64",
      "relayed": "GSTA-36:2026-11-22T07:47:16Z"
    }
  ],
  "gate_dispositions": []
}
{"head":"b2654b2998df80e1c54675ac35fcd1c797b17a27","run":"ship-4674","status":"started","review_loop":{"passes":1,"blocking_found":6,"deferred":0,"noted":5,"fixed":1,"scope":"frozen","fix_checks":1,"rounds":1,"dispatches":{"specialist":4,"red-team":1}}}
{"head":"5a8e4775820636d8563dcf6bad193ae9f3e86f04","run":"ship-4674b","status":"started","review_loop":{"passes":1,"blocking_found":6,"deferred":0,"noted":1,"fixed":0,"scope":"frozen","rounds":1,"dispatches":{"specialist":4,"red-team":1}}}
{"head":"0a13de8a2943be39cd0d38ee18b9f7b3fde7bcfc","run":"ship-4674c","mark":"stop","tree":"58b3437ee32e1a0c1779f14ba1f33ff295c3e2d1"}
{"head":"0a13de8a2943be39cd0d38ee18b9f7b3fde7bcfc","run":"ship-4674c","mark":"grant","grant":"a-655c875adab8"}

Open in Capy

garrytan and others added 2 commits November 22, 2026 05:01
…l first

Feature-titled requests are no longer read as bug reports, a reported defect
is never routed to /review or /qa, and the installed bug-fix skill leads when
it is one of two skills named. Adds the GSTA-759 first-draft prompts as
held-in tests.

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

Claude Code runs UserPromptSubmit hooks on cross-session messages and
task-notification hand-backs too, and its payload cannot tell them from a
typed prompt, so the hook skips text that starts with either wrapper and
logs reason=agent-message.

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

trunk-io Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 7 commits November 22, 2026 05:34
…heck passes

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Only the prompt's first line, or the first inside a tag such as <task>, can be a feature title, so a bug report whose body has a stand-alone line starting with Add or New is still read as one.

Review-Finding: p1/specialist-batched#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
free-suite (6) failed at fdba829: test/free-fixtures.test.ts requires every tracked fixture to be registered.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…our bug-fix skill again

A reported defect reaches /review or /qa only when it holds one of their
trigger phrases in order (stopwords allowed between words), as on main,
with "find bugs on my site" still working. A line inside a later tag is
no longer read as a feature title, and an exception name in backticks
counts in the title check. Tests: the three regression probes.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The feature-title rule (a prompt whose title starts with Add, Support,
[Feature] and the like is never a bug report) and the defect-word
proximity change made for the same tasks move to a separate follow-up
pull request. Everything else in this change stays: bug-fix skill named
first, the new bug-report signs, phrase matching for /review and /qa,
and skipping messages from other sessions.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ix skill is installed

Matching for /review and /qa trigger phrases now also accepts a trigger's
words in order with other small words in their place ("review my PR"
for "review this pr"), so with only gstack installed such a report
routes to /review as it does on main. With a bug-fix skill installed it
still goes to that skill, as on main.

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 19247f6 into main Nov 22, 2026
77 checks passed
capy-ai Bot added a commit that referenced this pull request Nov 22, 2026
…4694)

The prompt hook no longer treats a feature request as a bug report just
because its body mentions an error, so your bug-fix skill isn't named
for "Add …", "Support …" or "[Feature]: …" requests.

Why: in our eval runs, 13 of 27 feature-titled tasks were routed to the
bug-fix skill, so the model started a bug-fix workflow on a feature.

Nothing to do: the change is in the hook's scoring. This builds on #4674
and should land after it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/specialist-batched#1 reader=red-team
Review-Finding: v1/outside-voice#1 reader=outside-voice
Review-Finding: v1/outside-voice#2 reader=outside-voice
Review-Finding: v1/outside-voice#6 reader=outside-voice
Review-Finding: v1/adversarial-native#1 reader=adversarial-native
Review-Finding: v1/adversarial-native#2 reader=adversarial-native
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.

Skill routing routes messages from other agents and sessions as if a person asked

1 participant