Skip to content

feat(skill-serving): add configurable output verbosity/strictness profiles (#215) - #471

Merged
sumithr merged 4 commits into
mainfrom
feat/issue-215-qa-verbosity-profiles
Jul 13, 2026
Merged

sumithr merged 4 commits into
mainfrom
feat/issue-215-qa-verbosity-profiles

Conversation

@sumithr

@sumithr sumithr commented Jul 3, 2026 •

Copy link
Copy Markdown
Owner

Closes #215.

What

SUMO_QA_OUTPUT_PROFILE=concise|default|strict tunes how much ceremony wraps a served skill body, as a serve-time overlay on the single skill-serving path (src/sumo_qa/skill_prompts.py). No SKILL.md is edited; default serves every body byte-for-byte (backwards compatible); concise/strict prepend a small bounded overlay that reshapes host output while restating the never-optional floor (Iron Law, HARD-GATE, evidence for claims, confirmation before writes/installs, mandatory gates). The profile resolves fresh on each call (env var, explicit override for tests), an unrecognised value falls back predictably to default, and the overlay rides the #393 oversize pointer only when overlay + pointer itself fits the cap (otherwise the bare pointer is served, never recreating the over-cap response it exists to prevent).

The overlay applies to the skill-tool surface only: sumo_qa_load_skill_context and the sumoqa:// resources always serve the canonical body, keeping content_hash change-detection stable across profiles. The markdown docs (CONFIGURATION.md, ARCHITECTURE.md, TOOLS.md, SKILLS.md) and the live MCP loader/resource descriptions (server.py, skill_manifest.py, skill_resources.py) all state that single contract.

Evidence

  • TDD red-green: 12 profile tests failed on missing symbols before implementation, green after; 14 profile-related tests total after review fixes.
  • Full suite in the isolated clone: 2513 passed, 4 skipped, 1 xfailed; repo 100% coverage gate held (skill_prompts.py 100%).
  • CI: 33/33 required checks green on the tip commit.
  • Eval gate: not applicable (no skills/*/SKILL.md or promptfoo YAML changed).
  • Review gate: per-file sumo-qa review + codex adversarial passes during development. Round 1 raised 4 findings, fixed in cb5aa2d. Round 2 clean except one doc parity line, fixed in de5bfde. The final codex P2 (live MCP loader/resource descriptions claiming byte-for-byte parity, true only under default) was fixed in fa383b1 (docstrings/descriptions only). That review thread is resolved.
  • Batch finish pass (2026-07-13): the merge-boundary codex adversarial pass was skipped (Codex CLI/model configuration unavailable in-session); the gate completed on the finish-phase per-file review (SAFE across all 9 files) plus live behavioral verification through the REAL MCP dispatch: default profile byte-identical to main's serving code (sha256 match, len 14084), concise/strict overlays prepended with gate language intact and the canonical body following byte-for-byte, invalid value falling back to the exact default hash, and the using_sumo_qa router output byte-identical to main. See the proof comment.

Residual limit (documented)

  • The AC "small-change scenarios produce shorter output in concise mode" is host-LLM-behavioral. The mechanism is delivered and pinned (the concise overlay is served through the real registration path, unit tests assert it is prepended, and the never-optional gates are asserted present), but whether a given host LLM actually emits shorter output cannot be exercised by a unit test or a promptfoo fixture (the eval harness reads SKILL.md from disk, not the MCP serve path). A live A/B (compare-mcp-versions) is the only thing that could demonstrate it. This is epic [Epic]: Harden QA reliability beyond prompt-only controls #211 documented-limits territory; the issue author left that AC box unchecked.
  • The issue closure-bar item naming docs/qa/reliability-hardening.md is not PR-deliverable: docs/qa/ is gitignored on main. Where the epic control matrix lives is an epic-level decision at [Epic]: Harden QA reliability beyond prompt-only controls #211 close-out.

sumithrjl added 3 commits July 2, 2026 16:47
…files (#215)

Add SUMO_QA_OUTPUT_PROFILE=concise|default|strict, a serve-time overlay on the
single skill-serving path (src/sumo_qa/skill_prompts.py). `default` serves each
SKILL.md body byte-for-byte (backwards compatible); `concise` and `strict`
prepend a small, bounded overlay that reshapes host output. No SKILL.md is
edited and the sumo_qa_load_* catalogue payloads are untouched, so the canonical
skill content stays readable and host-neutral, and strict mode cannot bloat
payloads.

The overlay always restates the never-optional floor (Iron Law/HARD-GATE,
evidence for claims, confirmation before writes or installs, mandatory test and
safety gates), so no profile can downgrade a gate on high-risk work. An
unrecognised value falls back predictably to `default`.

Covered by unit tests in tests/test_skill_prompts.py: default byte-for-byte,
concise/strict overlays, env-var selection, invalid fallback, over-cap pointer
preservation, and a bounded overlay token budget. Docs updated:
CONFIGURATION.md (new env var + profiles section), ARCHITECTURE.md, TOOLS.md.
The over-cap pointer now drops the overlay when overlay + pointer would
itself exceed the token cap, so the degraded response can never recreate
the over-cap failure the pointer exists to prevent. The server-level
default-profile parity test asserts byte-for-byte equality through the
real registration path. Docs state the single accurate serving contract:
the overlay applies to the skill-tool surface only; the progressive
loader and resources serve the canonical body with stable hashes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de5bfde37f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/sumo_qa/skill_prompts.py Resolved
…tput profiles (#215)

The zero-argument skill tools now prepend the #215 output-profile overlay
under concise/strict, so the live MCP tool/resource descriptions that state
mode="full" (and the sumoqa://.../full resource) are byte-for-byte identical
to the zero-argument skill tool were true only under the default profile.
Qualify them with the same parity caveat already added to the markdown docs:
the loader and resources always serve the canonical body, the skill tool
overlays only under a non-default profile, so content_hash stays stable.

Addresses codex P2 (loader-description parity) on PR #471.
@sumithr

sumithr commented Jul 13, 2026

Copy link
Copy Markdown
Owner Author

Batch finish-pass proof (2026-07-13)

Per-file review (finish-phase step 6): SAFE across all 9 changed files (per-file, full post-change content vs base); functional logic confined to skill_prompts.py, three files docstring-only, four docs files accurate to code.

Codex adversarial pass: SKIPPED at the merge boundary; the Codex CLI/model configuration is unavailable in this session. Per batch policy the gate completed on the per-file review plus behavioral verification below. Historical codex coverage: round 1 (4 findings, fixed cb5aa2d), round 2 (doc parity, fixed de5bfde), final P2 (loader/resource parity claims, fixed fa383b1); thread resolved.

Behavioral verification (step 4.7, literal, all through the REAL dispatch build_mcp_server() + await server.call_tool(...)):

  • Default byte-identity vs main: sumo_qa_preparing_for_work on the branch = LEN 14084, sha256 753c1965...25df9; with origin/main's serving code swapped in, fresh process = same LEN, SAME sha256. Byte-for-byte parity proven.
  • Concise: LEN 14786 = 14084 + 702-byte overlay, head > Output profile: concise. ...; overlay contains Iron Law / HARD-GATE / evidence language; text after the separator equals the canonical SKILL.md byte-for-byte (prepended, body untouched).
  • Strict: overlay head present with evidence-table/risk-map/residual-risk instructions; canonical body follows byte-for-byte.
  • Invalid value verbose-plz: output sha256 equals the default hash exactly.
  • Router survival: using_sumo_qa sha256 8241cbdf...79cb identical between branch and main serving code.

AC ledger: all mechanical ACs on #215 verified (three profiles defined/documented, default byte-compatible, invalid fallback, low-ceremony contract, mandatory gates preserved, strict structure, real registration path, oversize-pointer behavior, parity limits documented). The one open AC ("small-change scenarios produce shorter output in concise mode") is host-LLM-behavioral: the mechanism is delivered and pinned, but the outcome is not unit-demonstrable; the issue author left that box unchecked and the PR body documents it as the epic-#211 residual. Left unticked; the merge decision owner accepts or discharges it (a compare-mcp-versions A/B is the discharge path).

Integration check (step 5.5): all 13 batch branches stacked on main v0.51.3: full suite green at the integrated tip (100% coverage over 7823 statements). The known #471 x #476 skill_prompts.py conflict was resolved by combining profile threading with the capture wrap and proven live at the tip (concise overlay served through the combined path). Router byte-identical to main; 48-tool surface intact.

CI: 33/33 green at head (stale-green vs pre-#492 main; the integrated-tip suite above proves the branch against current main). No open threads.

@sumithr
sumithr merged commit 577527e into main Jul 13, 2026
33 checks passed
@sumithr
sumithr deleted the feat/issue-215-qa-verbosity-profiles branch July 13, 2026 14:00
sumithr added a commit that referenced this pull request Jul 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.52.0](v0.51.3...v0.52.0)
(2026-07-13)


### Features

* **analysis:** add semantic code analysis adapters for QA
recommendations ([#212](#212))
([#490](#490))
([24b3abc](24b3abc))
* **conformance:** add cross-model conformance checks for QA routing and
outputs ([#214](#214))
([#476](#476))
([895cde1](895cde1))
* **gate-evidence:** add evidence-backed gate reporting for QA workflow
claims ([#213](#213))
([#486](#486))
([05a676d](05a676d))
* **repo-map:** add Java import-edge resolver
([#357](#357))
([#469](#469))
([9583754](9583754))
* **repo-map:** add TypeScript/JavaScript import resolver
([#355](#355))
([#481](#481))
([568eb38](568eb38))
* **repo-map:** rank affected nodes by connecting-edge confidence in
diff-impact ([#363](#363))
([#475](#475))
([9e6e426](9e6e426))
* **skill-serving:** add configurable output verbosity/strictness
profiles ([#215](#215))
([#471](#471))
([577527e](577527e))

---
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 Jul 20, 2026
…esult (#556)

## What

Reverts commit `577527e` (PR #471, issue #215): the
`SUMO_QA_OUTPUT_PROFILE` output-profile feature. This is a documented
**negative result**, not a bug fix.

The feature is removed entirely: the `concise`/`strict` serve-time
overlays, the `SUMO_QA_OUTPUT_PROFILE` env var, `_CONCISE_OVERLAY` /
`_STRICT_OVERLAY` / `_NEVER_OPTIONAL` / `_resolve_output_profile` /
`_profile_overlay`, the profile test suite, and the profile
documentation across `CONFIGURATION.md`, `TOOLS.md`, `SKILLS.md`,
`ARCHITECTURE.md`. Skill serving returns to the pre-#215 behavior: each
`SKILL.md` body served byte-for-byte.

## Why

The output profiles were meant to let a user tune how much output they
get, so a small change would not bury them in a full QA audit.
Measurement under the #528 investigation showed a serve-time prompt
overlay **cannot reliably do that**:

- On a **strong model**, given a tightened reply contract and grounded
input, the model still produced a full structured QA plan. The
task-completion drive overrides a prepended "be brief".
- On a **weak model**, the instruction was ignored amid ~10x run-to-run
variance; the aggregate showed no reliable reduction (and a conceptual
Q&A came out longer).

A serve-time overlay is a prepended instruction; it loses the tug-of-war
with the skill body and the model's drive to complete the task. Rather
than keep a knob that does not do its job, the feature is removed. If
reply length must be controlled, the effective levers are host-side (the
host's own output settings) or fewer, more structured turns, not a
served overlay.

## What is kept (deliberately, verified independent of profiles)

- **#393 over-cap progressive-loading pointer.** Load-bearing without
profiles: `sumo-qa-reviewing-before-merge` is ~18,141 tokens, over the
12,000 per-response cap, so its tool call would fail opaquely without
the pointer that redirects the host to load it in slices.
- **#476 conformance capture-wrapping.** `maybe_capture` records every
skill-tool call for a `SUMO_QA_DEBUG_DIR` conformance capture (#214); no
profile logic touches it.
- The progressive-loading loader (`sumo_qa_load_skill_context`,
`sumoqa://` resources) stays as the fallback the #393 pointer redirects
to.

## Docs

The single-commit revert cannot reach references added by later PRs, so
one was fixed by hand: the epic #211 "verbosity fatigue" control row in
`RELIABILITY-HARDENING.md` (added by #502) is rewritten from "mitigated
by profiles" to an honest negative result (control tried, measured,
reverted; residual: verbosity left to the host).

## Regression

- `ruff check` + `mypy` clean (74 source files).
- Full suite green, **100% coverage** (`skill_prompts.py` 106 -> 75
statements). CI matrix green on the final head `f3c6386`; scoped
mutation gate green.

## Review

Codex (bot) raised a P2 on the byte-for-byte serving contract: the
reverted body-match test used a weak `in` (contains) assertion that
would accept a reintroduced overlay wrapper. Fixed in `f3c6386` -
restored exact equality (`bodies[tool_name] == expected_text`) and added
`test_output_profile_env_is_inert_after_revert`, which asserts
`SUMO_QA_OUTPUT_PROFILE` (concise/strict/lean/nonsense) leaves the
served body byte-identical, guarding against a silent reintroduction.
Thread resolved.

## Supersedes / closes

Closes #528 (the re-scope investigation, concluded as this negative
result) and #536 (cost follow-up on the wrong framing). Supersedes PR
#535 (the concise re-scope), now closed.
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]: Add configurable QA verbosity and strictness profiles

2 participants