Skip to content

fix(skills): stop downstream skills leaking announce lines and approach labels - #816

Merged
sumithr merged 6 commits into
mainfrom
fix/issue-735-downstream-announce-leaks
Oct 2, 2026
Merged

sumithr merged 6 commits into
mainfrom
fix/issue-735-downstream-announce-leaks

Conversation

@sumithr

@sumithr sumithr commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Downstream sumo-qa skills no longer instruct a self-narrating announce preamble, and catalogue approach labels like Approach restated: Regression-first ... now fail conformance validation while ordinary prose ("a regression-first approach") does not. Extends the #248 router-hop fix to every downstream skill.

Related issue

Closes #735

Changes

  • Skills: the **Announce at start:** line (and example replies that repeated it) removed from all 16 skills that had one; sumo-qa-implementing-with-tdd step 1 names the target risk in plain words and keeps the approach internal. The skill scaffolder no longer emits an announce line (test_scaffolded_skill_has_no_announce_preamble), and test_skill_does_not_instruct_an_announce_preamble guards every SKILL.md.
  • Leak detector (src/sumo_qa/conformance.py and its JS mirror tests/evals/promptfoo/asserts/no-routing-leak.js, kept in lockstep): a qualified label at line start (Approach restated:, Chosen approach:, Selected classification: and similar) whose value starts with a whole catalogue name is a taxonomy_label leak, including bold, backticked and underscore-emphasised values; near-misses like regression-first_ish stay clean. A differential fuzz over 40,000 strings found no Python/JS mismatch.
  • Evals: the closing-qa-gaps, triaging, security-testing and implementing-with-tdd configs used to assert the announce line; they now wire the leak assert (skipping only route_announcement, since a hand-off may name the next skill) plus per-seed deterministic discipline markers taken from each skill. The preparing-for-work and finding-test-data prompt templates no longer ask for an announce line. The leak assert gains a config.skip option; an unknown family name fails the assert.
  • tests/scenarios/CONFORMANCE.md: the taxonomy_label row and the downstream wiring.

How it was verified

  • Real Claude Code install (clean wheels of 6728ae9 and origin/main, claude -p --strict-mcp-config, host skills disabled, claude-haiku-4-5):
  • Evals (Claude pair, haiku candidate, one pass on 6728ae9):
  • Targeted at 6728ae9 (conformance validator, leak assert, skill conformance, hooks/scaffold): 528 passed, 2 skipped. Pre-push hook: full suite, 100% coverage. Mutation gate run 37058225868: success. CI: all 33 checks green.

Review: per-file sumo-qa review plus /code-review (high), 5 rounds, and a final per-file pre-merge pass with every file SAFE; no high or medium findings remain.

Notes and decisions

  • Scope: a rule against naming the next skill in a hand-off was tried mid-review and reverted; it is outside [Task]: downstream sumo-qa skills still leak announce lines and catalogue approach labels into user output #735 (announce lines and approach labels) and conflicted with the router's own eval and other skills' pinned lines. Skill hand-off wording is unchanged from main.
  • Announce preambles are guarded at the skill-text level (the conformance test), not as a detector family in model output; the judge rubrics grade output.
  • The *-PRE-*.SKILL.md eval fixtures keep their announce lines on purpose: they are frozen historical baselines for A/B controls.
  • Left as is: skipping the whole route_announcement family downstream also skips router-only phrases such as "Picking the QA approach"; config.skip is not type-checked as a list (a non-list value errors the assert rather than skipping silently); planning-qa-rollout's plan template line is not covered by a wired eval; the .ab lift configs were not rerun.
  • The issue's "case-insensitive catalogue values" was already in place; the real gap was the qualifier word plus the prose after the value (drift comment on [Task]: downstream sumo-qa skills still leak announce lines and catalogue approach labels into user output #735).

Checklist

  • PR title follows Conventional Commits
  • Tests pass locally and lint/type checks are green
  • Added or updated tests covering the change
  • Updated the relevant docs in this same PR
  • No breaking changes

…ch labels

Downstream sumo-qa skills told the host to open every reply with a scripted
announce line, and the TDD skill's first step re-stated the catalogue approach
as a label ("Approach restated: Regression-first ..."). Both reached the user
verbatim on a real install.

- Remove the announce instruction from the 16 skills that carried it, with the
  example replies that echoed it; the TDD skill's first step now names the risk
  and keeps the approach internal.
- Widen the routing-state leak check (Python and the promptfoo JS mirror) to a
  qualified label ("Approach restated:", "Chosen approach:", "Classification
  identified:") whose value opens with a whole catalogue name, whatever prose
  follows. Ordinary prose ("a regression-first approach") still passes.
- A skill-conformance test fails any SKILL.md that instructs an announce
  preamble.
- Evals that anchored on an announce line now assert its absence
  (closing-qa-gaps, triaging-test-failures, security-testing); the
  preparing-for-work and finding-test-data prompts no longer script it.

Closes #735
…catch italic approach labels

- closing-qa-gaps, triaging-test-failures and security-testing evals now run
  the routing-leak assert plus a per-seed deterministic discipline marker
  grounded in each skill's checklist, replacing the absent-phrase check that
  passed every reply
- the qualified-label matcher (Python and JS) catches an underscore-italic
  catalogue value while a glued suffix such as regression-first_ish stays clean
- the skill scaffolder no longer seeds an announce preamble into new skills
- implementing-with-tdd step 1 says what it shows the user without quoting the
  forbidden label
…tream eval markers

Downstream skills (triaging, security-testing, closing-qa-gaps,
implementing-with-tdd) now hand off by invoking the next skill, so the
user sees that step's work and never a skill name or a routing line; the
closing-qa-gaps merge decline no longer names the review skill.

The implementing-with-tdd eval is wired to the routing-leak assert. The
security-testing no-anchor marker checks only what the skill mandates
deterministically: a question and none of the brief's field labels. The
closing-qa-gaps seeds tolerate separators around the evidence lines, need
a runner term in the refusal, and accept "line 42" for the survivor.
The qualified-label lookahead treats any underscore run glued to a word
character or hyphen as continuation in both engines, and CONFORMANCE.md
describes the current assert wiring.
…ipline

- using-sumo-qa's global discipline now says skill-to-skill hand-offs are
  invocations: the user sees the next skill's work, never a skill name or a
  routing line. The four per-skill copies are removed.
- The triage step-4 output line names the next step, a regression-first
  fix, never a skill: the isolation eval sees only that skill's text.
- Rubrics describe the next step without skill names (triaging stale-test,
  security dependency, closing ledger seeds).
- closing-qa-gaps: the ledger seed takes the verbatim evidence lines again;
  the refusal seed's runner check follows prerequisite (c)'s wording.
- security-testing: the no-anchor marker no longer treats "source anchor"
  as a brief label.
- CONFORMANCE.md separates the detector's boundary from the never-name rule
  and lists the wired configs as wired configs.
- Validator not-leak list pins the underscore-run lookahead.
Revert the never-name-a-skill hand-off rule: the using-sumo-qa global line,
triage step 4's clause, the invoke-not-name hand-off wording in triaging,
security-testing, closing-qa-gaps and implementing-with-tdd, the rubric
clauses that banned skill names, and the CONFORMANCE.md paragraph. The
announce-line and approach-label removals stay.

no-routing-leak.js takes an optional config.families filter (default: every
family). The four downstream evals check only taxonomy_label, since a
legitimate hand-off may name the next skill.

The closing-qa-gaps refusal seed leaves prerequisite (c), a way to run the
tests, to the judge rubric instead of a runner regex.
@sumithr

sumithr commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner Author

Finish proof, head 6728ae9

CI: 33 of 33 checks pass. Mutation gate: run 37058225868 on this head, success. Open review threads: 0.

Per-file review (sumo-qa-reviewing-before-merge, each changed file's full post-change content vs main): SAFE for every file. The 13 announce-line-only SKILL.md edits are the same shape (one line plus its blank line removed); closing-qa-gaps, triaging, security-testing and implementing-with-tdd were reviewed individually; conformance.py, no-routing-leak.js, the 11 eval YAMLs, CONFORMANCE.md, the fixtures and 4 test modules are accurate to the code. Two low notes, both already disclosed: a non-list config.skip throws rather than failing cleanly; ragged line wraps in two CONFORMANCE.md paragraphs.

/code-review (high): 5 rounds; final round clean.

Behaviour ledger (finish-pr 4.7):

# expected behaviour real-surface call + input observed output (quoted, short) Met
1 Routed Terraform prompt returns no announce line or taxonomy label branch build; "I changed our Terraform module to move the payments service behind a new internal load balancer. How should I test this?"; tools: using_sumo_qa, deciding_approach, load_classifications, load_approaches, reviewing_before_merge; find_routing_leaks = () line 1: "For a Terraform infrastructure change moving the payments service behind a load balancer, validate the change with these three layers:" ; no announce/label Met for the route taken. Caveat: haiku routed to reviewing-before-merge, not implementing-with-tdd as in #735, so the exact tdd skill path was not exercised here
2 Dev-framed prompt routed to a skill that lost its announce line is likewise clean branch build; "I'm fixing a bug where VIP customers get a double discount at checkout. Write the failing test first."; tools: using_sumo_qa, deciding_approach, implementing_with_tdd; leaks () "Before I write the test, I need to understand your codebase context. Can you tell me:" (clarifying question, no "Walking the red->green cycle", no "Approach restated") Met
3 existing_flow: "load the QA classifications" works, results unchanged both builds; tools both: ToolSearch, sumo_qa_load_classifications tool result text byte-identical (2297 chars both); PR does not change classification content Met
4 Approach-label leaks fail conformance; ordinary prose does not (AC2) tests/test_conformance_transcript_validator.py, tests/test_eval_no_routing_leak_assert.py, leak_transcripts.yaml fixtures; 14 extra edge inputs run through the Python and JS detectors 528 passed, 2 skipped; Python and JS agree on all 14 edge inputs Met
5 No skill instructs an announce preamble (AC1) test_skill_does_not_instruct_an_announce_preamble over every SKILL.md; scaffolder test passes; grep finds the old phrases only in frozen *-PRE-*.SKILL.md A/B baselines Met
  • real_repo: this repo's real history; wheels built from 6728ae9 and origin/main 042c013.
  • real_surface: real claude -p host, haiku, only the built sumo-qa attached, host skills disabled.
  • existing_flow: row 3.
  • evals (Claude pair, haiku candidate, judge opus, one pass, on 6728ae9; eval-reuse-check said RERUN for every config this diff feeds except finding-test-data and preparing-for-work, which are REUSABLE 1/1):

Acceptance criteria (#735): AC1 and AC2 met (rows 4 and 5), AC3 met (row 1: the routed Terraform prompt on a real install returns no announce line or taxonomy label). Test plan: unit tests met; targeted evals rerun for every config the changed skills feed, one case UNVERIFIED by judge bug #796 as recorded above.

Integration (finish-pr-batch 5.5) with #811, #813, #814, #816 and #818 merged in drain order on a throwaway branch off main: full suite 5323 passed, 100% coverage; live MCP routing reaches the routed skill through dispatch; tools/list unset/full equal main (48), core 40; no conflicts except #811 vs #813 (one import block in tests/test_tools_list_contract.py, resolved by keeping both imports; #811 is rebased after #813 merges).

@sumithr
sumithr merged commit f21f376 into main Oct 2, 2026
34 checks passed
@sumithr
sumithr deleted the fix/issue-735-downstream-announce-leaks branch October 2, 2026 21:44
sumithr added a commit that referenced this pull request Oct 2, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.70.1](v0.70.0...v0.70.1)
(2026-10-02)


### Bug Fixes

* **skills:** stop downstream skills leaking announce lines and approach
labels ([#816](#816))
([f21f376](f21f376))


### Tests

* **conformance:** add a live-host first-hop harness that scores real
host tool selection
([#814](#814))
([6e1cac7](6e1cac7))


### Continuous Integration

* **tests:** cut the pytest matrix to 9 jobs and run the suite under
pytest-xdist ([#813](#813))
([7a84f9b](7a84f9b))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: release-please[bot] <release-please[bot]@users.noreply.github.com>
sumithr added a commit that referenced this pull request Oct 2, 2026
## Summary

Slice 1 of #515. Every MCP tool now has one `ToolMeta` entry (group,
core, open_world, integration) in `src/sumo_qa/tool_registry.py`, and
the `core` and `full` profiles are derived from it.
`SUMO_QA_MCP_PROFILE=core|full` selects the profile before tools are
listed; unset or empty means `full`, so the default `tools/list` is
byte-identical to `main`. Any other value stops the server, installer
and doctor with one clean line.

A configured profile also survives the documented update flow:
re-running the installer keeps each host entry's `env` (and `envFile`
where the host reads it), and `sumo-qa-doctor --host <host>` probes the
entry the way that host launches it, with that entry's profile.

## Related issue

Closes #806

## Changes

- `tool_registry.py`: the registry, `resolve_profile`,
`resolve_profile_or_exit`, `profile_tool_names`. Core is 40 of 48 tools:
every workflow skill tool, the knowledge and test-data loaders, analysis
and evidence/reporting tools. Out of core: 4 specialist tools and the 4
external-skill search/check/install/execute tools.
- `server.py`: resolves the profile before registration and removes
non-profile tools in registration order; a registered tool without
metadata warns and is served under `full` only, and
`test_tool_registry.py` fails on it.
- `installer.py`: a bad profile exits cleanly before any host config is
written. A refresh keeps the existing entry's `env` in
`claude_desktop_config.json`, `.vscode/mcp.json` and Claude Code's user
registry, and `envFile` in the first two; the registry is re-registered
with `claude mcp add-json` (string env values only; `claude mcp add -e`
fallback for a CLI without `add-json`, warning on keys it cannot pass;
the removed entry is restored if the add fails). `REQUIRED_TOOL_NAMES`
is derived lazily per profile, so importing the installer never exits.
- `doctor.py`: `--host claude-code|claude-desktop|vscode` probes that
host's `sumo-qa` entry with its `env`, expands `${...}` the way that
host does, requires every tool of the entry's profile, and reports an
invalid profile, an unlaunchable command or an unexpandable VS Code
placeholder as a check result instead of crashing. Claude Desktop does
not inherit the doctor shell's profile; the Claude Code CLI and VS Code
keep it.
- Snapshot fixture gains `core_tools`; the regen script writes it and
refuses to pin a tool without metadata.
- `tests/conftest.py`: clears `SUMO_QA_MCP_PROFILE` in
`pytest_configure`, and runs doctor and installer test modules in a temp
HOME so nothing reads the real `~/.claude.json`.
- Docs: `CONFIGURATION.md` (Tool profiles, refresh and doctor behaviour
per host), `INSTALL.md`, `TOOLS.md`, `DEVELOPMENT.md`.

## How it was verified

- CI green on ec7a49d across the full matrix (pytest on macOS, Ubuntu
and Windows, py3.10 to 3.14; mypy; ruff; install and handshake jobs).
Mutation gate run 37062233685 on ec7a49d: success.
- Real install from the built wheel (b1d571f; later commits change one
test assertion and one doc paragraph), 13 of 13 acceptance rows met,
driven by a real `claude -p` (haiku) host with only the built sumo-qa
attached plus JSON-RPC cross-checks: profiles are `core` and `full`
only; the metadata test goes red when a `ToolMeta` is removed; `core` is
40 tools with the external and open-world ones absent; `full` and the
default equal `origin/main`'s names and input schemas; `bogus` exits 1
with `sumo-qa: SUMO_QA_MCP_PROFILE='bogus' is not a valid MCP tool
profile; expected one of: core, full`; order is stable; the installer
keeps `env`/`envFile` for VS Code and Claude Desktop; `claude mcp get`
shows the env kept for Claude Code; the doctor judges 40 required tools
for `core` entries on all three hosts; VS Code `${workspaceFolder}`
resolves. The router plus `load_classifications` return byte-identical
results to `main`.
- Snapshot regenerated into a temp path at the head: identical to the
committed fixture, and its `required_tools` and `schemas` equal
`origin/main`'s.
- Targeted modules (registry, tools-list contract, doctor, installer,
server, skill resources) with `SUMO_QA_MCP_PROFILE=core` exported and a
temp HOME: 298 passed, 0 skipped, including the round trip through the
real `claude` CLI.
- Integration check with #813, #814 and #816: full suite 5291 passed at
100% on the merged tip, live MCP routing and tool surface correct; one
import-block conflict in `tests/test_tools_list_contract.py` with #813.

Review: per-file sumo-qa review plus `/code-review` (high) over several
rounds, and a final per-file pass at the head with every file SAFE. The
two Codex threads (installer refresh dropping the profile env; doctor
probing with the ambient env) are fixed and resolved.

## Decisions recorded here (not changed)

- Under `core`, the external-skill workflow is listed but its
search/check/install/execute tools are absent; the actionable activation
path is #807.
- `ToolMeta.integration` and `open_world` stay: #515's spec lists both
as registry metadata.
- The doctor does not read a VS Code `envFile`; a profile set only there
is probed as the shell's profile (documented in `CONFIGURATION.md`).
- Low review notes left as is: the skill-reference regex can over-match
a hyphen-suffixed token; the doctor test compares stderr exactly; the
regen script keeps a local `PROFILE_ENV` literal so it runs without an
installed package; the conftest pop is not restored after the session;
`_required_tool_names_for` ignores its argument (only caller passes the
env's profile).

## Checklist

- [x] PR title follows Conventional Commits
- [x] Tests pass locally and lint/type checks are green
- [x] Added or updated tests covering the change
- [x] Updated the relevant docs in this same PR
- [x] No breaking changes (default profile is unchanged)
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.

[Task]: downstream sumo-qa skills still leak announce lines and catalogue approach labels into user output

1 participant