mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-23 16:41:35 +01:00
Prompt router stops sending feature requests to your bug-fix skill (#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
This commit is contained in:
1 parent
b3323f47b8
commit
596ff8a7cc
6 files changed
+337
-10
No files matched your search
@@ -40,14 +40,14 @@ The off switch is for people. The text the Stop hook shows the model never menti
|
||||
The hook scores the prompt against the `triggers:` list in each installed `SKILL.md` (`~/.claude/skills/*/SKILL.md`, or `$CLAUDE_CONFIG_DIR/skills`). It makes no model call and no network request, and the same prompt always gets the same answer.
|
||||
|
||||
- A trigger scores 1 when its whole phrase appears in the prompt. Otherwise it scores the share of its content words (common words dropped, light stemming, so "failing" matches "fails") that the prompt contains. A trigger with one content word counts only on its whole phrase, unless that word has five or more letters and is not a question word.
|
||||
- A bug report is full of everyday words (find, test, run, site) and defect words, so they never add up to a request by themselves. A trigger only partly present needs one of its five-letter-or-longer words, other than the defect word, among the words it shares: "pip cannot find the package and the install fails" no longer matches "find bugs on site". A trigger made only of shorter everyday words, with no defect word, needs them within 8 words of each other: a report that mentions a "call site" and, much later, "regression tests" no longer matches "test the site" (GST-3123).
|
||||
- A bug report is full of everyday words (find, test, run, site) and defect words, so they never add up to a request by themselves. A trigger only partly present needs one of its five-letter-or-longer words, other than the defect word, among the words it shares: "pip cannot find the package and the install fails" no longer matches "find bugs on site". A trigger made only of shorter everyday words, with no defect word, needs them within 8 words of each other, and the defect word counts as everyday unless the prompt reads as a bug report: a report that mentions a "call site" and, much later, "regression tests" no longer matches "test the site" (GST-3123).
|
||||
- Of gstack's own skills, only /review, /qa and /verify route (/investigate did too until it was cut, GST-1717). In the d7 check (PR #3912), scoring every gstack skill's triggers sent 17 of 32 non-fit Terminal-Bench prompts to some skill at 0.66; routing only the four routed skills of that time sent 4. The other gstack skills wait for their own trigger review.
|
||||
- Any other installed skill that lists `triggers:` in its own SKILL.md routes too (GST-3123). No host but gstack reads that field, so writing it is how a skill asks gstack to route it. A skill is gstack's own when its directory holds `.gstack-owned`, its SKILL.md links into gstack's checkout, or its name is one gstack generates or installs as an alias. A skill built from a gstack-style template, with the same generated-file banner, is not gstack's own.
|
||||
- An installed skill's triggers are used only when its name is letters, digits, `_`, `:` and `-`, it lists at most 12 triggers of at most 200 characters, and every trigger is letters, digits, spaces and `. , ' ? ! / -`. Otherwise the whole skill is skipped and named in `gstack-skill-route --explain` and the routing log, so trigger text cannot leave its quotes or add markup or shell characters to the hook's line. The quoted trigger is still the skill author's own words, so install only skills you trust.
|
||||
- Another installed skill's trigger needs at least two content words; a defect word counts as one word however it is spelled, so "error", "the crash" and "error exception" are each one. Shorter triggers are skipped and named the same way, and the skill keeps its others (GST-3142): a lone defect word would otherwise claim most bug reports.
|
||||
- The skills that reach the threshold, 0.66 (both words of a two-word trigger, or two of three), are ranked by score; at the same score gstack's own skill comes first, then the trigger with more matched words, then the name. The line names the top skill, or the top two different skills: "this request fits /verify or /notes. Run the one that fits better ...".
|
||||
- A bug report goes to the installed skill that claims bug reports, named alone, whatever the other triggers score (GST-3237). A skill claims bug reports when one of its triggers names the defect and fixing it, and nothing else ("fix this bug", "reproduce the bug in a test"); a trigger that names its own target ("fix lint errors", "fix postgres bugs") claims only that kind of fix. gstack's own routed skills only check work, so they never claim one, and /verify is never named ahead of the bug-fix skill. A prompt that holds one of /review's or /qa's own triggers as a phrase, its words in order with only common words such as "my" or "the" added between them ("review this pr for bugs", "find bugs on my site"), and never asks for a fix keeps that skill, since finding bugs is not fixing one; a report that only shares a trigger's words ("the site crashes during the smoke test", "a PR review page throws TypeError") does not. With none installed, a report of a defect still routes on triggers, but never to /review or /qa unless it holds such a phrase or one of their triggers' words in the same order with other small words in place of the trigger's ("review my PR, the login page is broken" keeps /review): three long first-draft reports that said "we test the site" or "find" and "broken" went to /qa (GSTA-759). "Test the site and fix what you find" reports no defect and keeps /qa. When the bug-fix skill reaches the threshold beside a gstack skill on a prompt that is not read as a bug report, it is named first, because an agent follows the first name: in GEVA-562's Codex run, Sol loaded /verify on all 7 tasks where /verify was named before prove-it, and prove-it on none. In B1d's in-sample run (gstack-evals #385), Opus 5.5 loaded prove-it in 29 of 33 sessions when the line named it alone and in none of the 20 where it was not named, and took /verify in 4 of the 7 where /verify came first. On B1's 60 in-sample prompts the line now names prove-it alone on all 46 bug reports; before, it named prove-it on 40 of the 60 and put /verify first on 7 of those (the labelled prompts are eval material and no longer live in this repository; gstack's router tests use 60 synthetic prompts of the same shape, `test/fixtures/skill-route-synthetic-prompts.json`).
|
||||
- A prompt reads as a bug report on one strong sign: a word for what went wrong (bug, crash, hang, stuck, leak, wrong, incorrect, unexpected, regression and the like), an exception name such as `ValueError`, the verb fix, an issue template's expected or actual heading ("expected behavior", "steps to reproduce", "correct output"), a failure verb ("fails", "failed to", "doesn't work"), a "should X, not Y" or "should X, but Y" correction, a regression ("started with 0.19", "used to work", "no longer"), a security hole or lost data. Feature requests use error, exception and failure as nouns ("add error handling", "a custom exception class"), so those words, a negated verb or "never", "should" or "must", "instead of" and a word for an unwanted outcome (lost, ignored, dropped, twice) are weak signs, and it takes two different ones. None of the 60 plain prompts in `test/fixtures/skill-route-plain-prompts.txt` reads as a bug report. On the 60 first-draft synthetic prompts (`test/fixtures/skill-route-synthetic-first-draft.json`, held in: the rules above were written after reading them), 42 of the 46 bug reports name prove-it alone, up from 32, and 1 of the 14 feature requests does.
|
||||
- A prompt reads as a bug report on one strong sign: a word for what went wrong (bug, crash, hang, stuck, leak, wrong, incorrect, unexpected, regression and the like), an exception name such as `ValueError`, the verb fix, an issue template's expected or actual heading ("expected behavior", "steps to reproduce", "correct output"), a failure verb ("fails", "failed to", "doesn't work"), a "should X, not Y" or "should X, but Y" correction, a regression ("started with 0.19", "used to work", "no longer"), a security hole or lost data. Feature requests use error, exception and failure as nouns ("add error handling", "a custom exception class"), so those words, a negated verb or "never", "should" or "must", "instead of" and a word for an unwanted outcome (lost, ignored, dropped, twice) are weak signs, and it takes two different ones. A request whose title (its first line, or the first line inside its first tag such as `<task>` when nothing outside that tag names a defect, standing alone) starts with a word that asks for something new ("[Feature]", "feat:", "Enhancement", "Add", "Support", "Allow", "Implement", "Introduce", "Provide", "Expose", "New") is not a bug report, whatever errors its body mentions, unless the title itself names a defect (any strong or weak sign, the verb fix, or an error status such as "returns 404"), the body asks for a fix, or the body follows an issue template (steps to reproduce, expected or actual behavior). A title whose feature word leads a noun phrase and a verb that says what happens ("Support page shows a blank screen", "New users see a blank dashboard", "New tab is empty") states a symptom, so it is no feature title. That is how gstack-evals draws its non-fit tasks, and 13 of its 27 such tasks routed to the bug-fix skill before (GEVA-558). On the 34 probes in `test/fixtures/skill-route-feature-title-probes.json`, fixed before the rule was written, 15 of the 16 feature requests no longer name the bug-fix skill and all 18 bug reports still name it first; before this rule, 3 of the 16 and 18 of the 18 did (on main, 4 of the 16 and 16 of the 18). The miss, a feature title that says "no longer", is listed in the test. None of the 60 plain prompts in `test/fixtures/skill-route-plain-prompts.txt` reads as a bug report. On the 60 first-draft synthetic prompts (`test/fixtures/skill-route-synthetic-first-draft.json`, held in: the rules above were written after reading them), 42 of the 46 bug reports name prove-it alone, up from 32, and 1 of the 14 feature requests does.
|
||||
- Words a bug report uses for the defect (error, exception, traceback, crash, fails, failure, broken, regression, incorrect, wrong, defect, and exception names such as `ValueError`) score as "bug", so "parse_one raises ValueError, please fix" matches a "fix this bug" trigger. Paths and identifiers stay whole (`site-packages`, `src/review.ts`, `max_retries`), so a traceback's paths never match a trigger's words.
|
||||
- Triggers and the bug-report signs read only the prompt's prose. Markdown code, meaning inline code in backticks and fenced code blocks as CommonMark reads them, is left out, so a command quoted in backticks never routes a prompt (#4564): "Run `mycli check` now" no longer matches "run the checks", "Run `gh pr review 123`" no longer matches "review this pr", and a `--fix` flag or the word broken in a pasted log is not a bug report. The prose around the code still routes ("run the checks, then `git push`"). One sign still reads the code: an exception name as code writes it (`KeyError`, `NullPointerException`), since a quoted error or a pasted traceback reports a bug.
|
||||
- When a trigger ties with another of the same skill on score and words, a whole-phrase match wins.
|
||||
|
||||
Reference in new issue
Block a user