Skip to content

The prompt-routing hook names your installed bug-fix skill on bug reports, and never puts /verify first (GST-3237) - #4539

Merged
capy-ai[bot] merged 7 commits into
mainfrom
routing-hook-names-bug-fix-skill
Nov 19, 2026
Merged

capy-ai[bot] merged 7 commits into
mainfrom
routing-hook-names-bug-fix-skill

Conversation

@garrytan

@garrytan garrytan commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

On a bug report, the routing hook now names the installed bug-fix skill (prove-it, or any skill whose triggers claim bug fixing) alone, so /verify is never ranked ahead of it.
Why: in B1d, Opus 5.5 loaded prove-it in 29 of 33 sessions when the hook named it alone and 0 of 20 when it didn't; the old matcher named it on only 40 of B1's 60 prompts.
Nothing to do: the hook line's wording is unchanged.

What changed

Bug reports were getting /verify first, or no bug-fix skill at all, so the model often skipped the skill built for fixing bugs. Now a prompt that reads as a bug report names the installed bug-fix skill alone.

  • Bug reports go to the bug-fix skill (lib/skill-route.ts). A prompt reads as a bug report on one strong sign (a symptom word such as crash, hang, leak or wrong; an exception name; the verb fix; "expected behavior", "steps to reproduce"; "fails", "doesn't work"; a "should X, not Y" correction) or two different weak ones (error or exception used as a noun, a negated verb such as "can't", "should", "instead of"). gstack's own routed skills (/review, /qa, /verify) only check work, so they never claim one. With no bug-fix skill installed, routing is as before.
  • Only a generic fixer claims bug reports. A trigger claims them when it names the defect and fixing it and nothing else ("fix this bug", "reproduce the bug in a test"). A fixer with its own target, such as "fix lint errors" or "fix postgres bugs", no longer takes every bug report.
  • Asking for a review or QA pass still gets one. A prompt that holds the whole phrase of a /review or /qa trigger ("review this PR for bugs", "find bugs on site") and asks for no fix keeps that skill. "The checkout page crashes… find the cause and fix it" still goes to the bug-fix skill.
  • Another installed skill's trigger needs two content words (GST-3142). "error", "the crash" or "fix it" are skipped and named in the routing log and --explain; the skill keeps its other triggers.
  • GSTACK_SKILL_ROUTE_HINT=step and =contract quote only gstack's own skills (GST-3142). Another skill gets the default line.
  • Router text (its own commit, ideas from The router and the Claude overlay stop contradicting themselves and drop planning nudges #4500 and /ship, /spec and /review state their gates in plain prose, and /ship's description stops promising a deploy #4501 by @lubosxyz, rebuilt on main). PROACTIVE=all no longer says "Do NOT answer directly when a skill exists", which contradicted "When to invoke, and when not to". /ship's router rule and description drop "deploy"; deploying is /land-and-deploy.
  • The trace line adds bug_report=true, and gstack-skill-route --explain says when a route came from a bug report.
Why

The routing hook exists to put the right skill in front of the model. On bug reports it was naming /verify first or nothing, and in B1d that decided whether the model used the bug-fix skill at all (29 of 33 sessions with it named alone, 0 of 20 without).

Blast radius

The change is inside the routing hook's matcher (routePrompt and its helpers), read by the Claude hook and gstack-skill-route only; both callers were updated and nothing else calls it (grep of routePrompt(). The hook only adds a hint line, so a misroute costs a wrong suggestion, never a failed command (test/skill-route.test.ts, 29 tests, and the full free suite in CI run 44617369574).

Measured on B1's 60 in-sample prompts

test/fixtures/skill-route-b1-in-sample.json holds them byte for byte (each prompt's sha256 matches the B1d preregistration), with a bug or feature label written before the bug-report check. 46 are bug reports, 14 ask for new behavior.

before (main ab6a38b) after
names prove-it 40 of 60 (33 alone, 7 second) 51 of 60, all alone
names prove-it on a bug report 36 of 46 (29 alone) 46 of 46, all alone
/verify first 9 (7 on bug reports) 2 (both feature requests)
feature requests naming prove-it 4 of 14 5 of 14
the 60 plain non-bug prompts naming anything 0 0

The sealed held-out tasks were never opened. The counts were rechecked after every review fix at f30cfd8.

Pre-Landing Review

Two full review passes and one extra check of the last fix found 12 issues; 7 were fixed and 5 ship as notes below the blocking bar.

  • Fixed: a request to review a PR or QA a site for bugs was sent to the bug-fix skill; a fixer for one target (lint errors, broken links, one database) claimed every bug report; the negation sign missed "can't" and "won't"; the first fix for review requests fired on scattered words and on fix requests, now a whole-phrase match with no fix asked.
  • Notes: the bug-fix route logs a score of 1 and ignores --threshold; skipped one-word triggers add to the routing failure counter; a review request that uses "fix" as a noun ("code review my fix") now goes to the bug-fix skill, and that case has no test.
  • Second-model review (GPT-6.1 Sol) completed; its two findings are among the fixed ones.
Exploratory QA

Four probes of gstack-skill-route --explain against an isolated skills folder: a crash report routes to the bug-fix skill alone, a one-word third-party trigger is skipped, a plain review request still routes to /review, and /qa's own trigger was checked as the riskiest case. All passed.

Documentation

Status: current. The branch's own doc changes already match the code, so this audit made no edits.

Scope: committed diff ab6a38b..f30cfd8 on routing-hook-names-bug-fix-skill (14 files; nothing staged, unstaged or new). Authored docs checked against lib/skill-route.ts, bin/gstack-skill-route and hosts/claude/hooks/skill-route-hook.ts.

Documentation health

  • docs/skill-routing-and-contracts.md: Current (bug-report route, two-content-word rule, bug_report field, hint-style limit)
  • SKILL.md.tmpl: Current (PROACTIVE wording, deploy now routes to /land-and-deploy)
  • ship/SKILL.md.tmpl: Current (description no longer claims deploy)
  • changelog.d/routing-hook-names-bug-fix-skill.md: Current (fragment matches the behavior and numbers in the docs)
  • docs/skills.md, docs/skill-gates.md: Current (no affected content)

Coverage debt: none found. Diagram drift: the hook's flow comment was updated in the same diff; no other diagrams are affected.

Issues

Refs #4500
Refs #4501

Tests
  • bun test test/skill-route.test.ts: 29 pass, 0 fail
  • bun test test/parity-suite.test.ts: 2 pass, 0 fail
  • bun run test (free suite): carried from CI run 44617369574 at f30cfd8, 1712 files
  • bun run typecheck and bun run typecheck:test: no new diagnostics
Agent notes

Approvals

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

REVIEW_LOOP: passes=2 blocking_found=2 deferred=0 noted=9 fixed=7 scope=frozen fix_checks=1 dispatches=10
Gate edits: partial (1 of 7 eligible read), 0 findings
Review-loop exception: accepted by Captain GStack Minder (GSTA-36) 2026-11-19 via grant relayed by the lane's parent agent; approval a-6e02413ab58b: Captain GStack Minder (GSTA-36), 2026-11-19: one fix-check on #4539 at 6486ffd, for the round-1 regression only: a bug report skips the bug-fix route only when a /review or /qa trigger appears as a whole phrase, and never when the prompt asks for a fix. Add a test with both crash examples, plus a 'review this PR for bugs' → /review control. Reason: it breaks the brief's item 1 on web-app bug reports, which the fresh-draw re-measure will contain. (fix-check at f30cfd8, 2 findings)

{
  "schema_version": 1,
  "pr": 4539,
  "head": "f30cfd86f80bc513f0177f2cb2cd21b334af8601",
  "version": "1.102.0.0",
  "base": "main",
  "gate": {
    "route": {
      "pass": 29,
      "fail": 0,
      "skip": 0
    },
    "parity": {
      "pass": 2,
      "fail": 0,
      "skip": 0
    },
    "free": {
      "pass": 1712,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 44617369574,
      "attempt": 1,
      "tree": "b562dba4c84df41afc098c1e36499737a0429748"
    }
  ],
  "calls": 48,
  "session_kind": "unattended",
  "run": "r1",
  "head_tree": "b562dba4c84df41afc098c1e36499737a0429748",
  "product_patch_id": "ae83258f2f5069918704cfbb6ff599615732c105",
  "gstack_version": "1.102.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 103,
    "rules": "1afa38a4be3b5eef",
    "base": "dab7549451e28ee4d89aa717cad06fdc00509106",
    "registry": "dab7549451e28ee4d89aa717cad06fdc00509106",
    "gate_scan": {
      "tagged": 1,
      "head": "f30cfd86f80bc513f0177f2cb2cd21b334af8601"
    },
    "reasons": [
      "gate-class",
      "runtime=103"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @b562dba4c84d (8 checks, current for f30cfd86f80b)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/44617369574/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44617369574/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44615131847/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=b562dba4c84d tests=38396 skipped=104 runs=44617369574/1 profiles=ci-reuse/free-tests heads=f30cfd86f80b verified=2026-11-19T21:28:55.293Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [
      4500,
      4501
    ],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CONTRIBUTING.md, SKILL.md.tmpl and ship/SKILL.md.tmpl against the routing change"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 9,
    "fixed": 7,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "dispatches": {
      "specialist": 8,
      "red-team": 2
    }
  },
  "review_loop_exception": {
    "accepted_by": "Captain GStack Minder (GSTA-36)",
    "date": "2026-11-19",
    "via": "grant relayed by the lane's parent agent; approval a-6e02413ab58b",
    "reason": "Captain GStack Minder (GSTA-36), 2026-11-19: one fix-check on #4539 at 6486ffd, for the round-1 regression only: a bug report skips the bug-fix route only when a /review or /qa trigger appears as a whole phrase, and never when the prompt asks for a fix. Add a test with both crash examples, plus a 'review this PR for bugs' → /review control. Reason: it breaks the brief's item 1 on web-app bug reports, which the fresh-draw re-measure will contain.",
    "fix_check": {
      "head": "f30cfd86f80bc513f0177f2cb2cd21b334af8601",
      "findings": 2
    }
  },
  "review_round_grants": [
    {
      "kind": "fix-check",
      "head": "50c0423c9fe5397cf580a01b80ff5b2dc586c5f9",
      "pr": 4539,
      "by": "Captain GStack Minder (GSTA-36)",
      "reason": "round-1 regression: bug-fix route skipped on scattered review/qa words and on fix requests",
      "at": "2026-11-19T21:03:33.237Z",
      "approval": "a-6e02413ab58b",
      "stop_run": "r1",
      "findings": [
        "p2/red-team#1",
        "p2/specialist-batched#1"
      ]
    }
  ],
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "23eb808423669ba0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "ae83258f2f5069918704cfbb6ff599615732c105",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

Open in Capy

garrytan and others added 2 commits November 19, 2026 20:12
…(GST-3237, GST-3142)

A prompt that reads as a bug report now goes to the installed skill whose
triggers claim bug fixing, named alone, so /verify is never ranked ahead of
it. On B1's 60 in-sample prompts the hook names prove-it on all 46 bug
reports (before: 40 of 60, /verify first on 7).

Another installed skill's trigger needs two content words, and the opt-in
step and contract hint styles quote only gstack's own skills.

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

The router's PROACTIVE=all rule told the model never to answer directly
when a skill exists, while its own "When to invoke, and when not to"
section says to answer quick factual questions directly. It now invokes
the matching skill subject to that section. /ship's router rule and its
description stop listing "deploy": /ship stops at a pull request, and
deploying is /land-and-deploy.

Rebuilt on current main from the ideas in #4500 and #4501.

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

trunk-io Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 5 commits November 19, 2026 20:22
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>
…fixers for other targets

A trigger now claims bug reports only when it names the defect and fixing it and
nothing else, so a lint or link fixer no longer takes every bug report. A prompt
that uses a full /review or /qa trigger keeps that skill. The negation sign now
reads can't and won't.

Review-Finding: p1/outside-voice#1 reader=outside-voice
Review-Finding: p1/outside-voice#2 reader=outside-voice
Review-Finding: p1/adversarial-native#1 reader=adversarial-native
Review-Finding: p1/adversarial-native#4 reader=adversarial-native
Review-Finding: p1/specialist-batched#1 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…uests

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…rs whole and no fix is asked

A request to review or QA keeps /review or /qa only when one of their triggers
appears as a whole phrase and the prompt never asks for a fix, so web-app bug
reports that mention a site or a review still go to the bug-fix skill.

Review-Finding: p2/red-team#1 reader=red-team
Review-Finding: p2/specialist-batched#1 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 5df6b5a into main Nov 19, 2026
83 checks passed
@garrytan garrytan mentioned this pull request Nov 20, 2026
capy-ai Bot added a commit that referenced this pull request Nov 20, 2026
- Two /ship approval records stop needing workarounds. (#4549)
- For contributors: the paid auto-decide check counts a start step that ran while the skill loaded. (#4543)
- The destructive-command check closes three ways past its disk-wipe and force-push blocks. (#4534)
- A green CI run still counts when the repository's artifact storage is full. (#4536)
- `/cso` now audits repositories that track symlinks. (#4567)
- A doc-sync eval stops failing when the audit child drops one field from its result line. (#4555)
- The browse daemon no longer picks port 10080, which Chromium refuses to open. (#4554)
- Opted-in telemetry now says why a skill run ended, which coding agent and model family ran it, and whether an upgrade worked. (#4542)
- A preregistration with only its write-up and plain data now gets the write-up review: one reviewer, one round. (#4544)
- When owner rulings don't clear a stopped review, `gstack-review-read` now says which findings are left. (#4553)
- The prompt-routing hook now names your installed bug-fix skill on bug reports, alone, and never puts /verify ahead of it. (#4539)
- Owner rulings now close a stopped review whose findings were logged in a findings file. (#4568)
- /ship can finish after the owner accepts a stopped review's findings as open notes. (#4552)
- /ship no longer starts the full test suite on your machine when CI's earlier run can't be reused (GST-3277). (#4565)
- The prompt-routing hook no longer acts on words inside backticks. (#4566)
- In Claude Code, a gstack skill's start step now runs when the skill loads, so the model can't skip it. (#4509)
- gstack's telemetry backend only accepts writes through its own validated endpoint, and the community dashboard now counts real use. (#4537)
- gstack now says what it's adding before it adds a background job or a browser extension. (#4538)
- For contributors: every flaky pass in Free Tests is now recorded. (#4572)
- For contributors: Free Tests on pull requests starts its test shards one round of small jobs sooner. (#4570)
- Secret values written as `name=value` at the end of a path are now hidden. (#4571)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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