Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ the skill.
## 2. MCP tools (Python): atomic knowledge providers

The tools are all thin. Skill tools (one per SKILL.md) and knowledge loaders (`sumo_qa_load_*`)
return markdown catalogues as text. Each served skill body is optionally reshaped by an output profile (`SUMO_QA_OUTPUT_PROFILE=concise|default|strict`, #215): a small serve-time overlay tunes verbosity/strictness without editing any SKILL.md, with `default` serving the body byte-for-byte and the mandatory gates (Iron Law, HARD-GATE, evidence, confirmation-before-write) never downgraded. A read-only progressive-loading pair (`sumo_qa_list_skill_manifests`, `sumo_qa_load_skill_context`) indexes each SKILL.md's sections/modules and serves a single slice (manifest / section / module / full) as a JSON string so a host can load just the routing summary or one section rather than the whole body; `mode="full"` returns the same bytes as the skill tool under the default output profile (under `concise`/`strict` the skill tool prepends the profile overlay while this loader always serves the canonical body, keeping every `content_hash` stable across profiles), except that a body over the host's per-response token cap is served through both paths as a compact `oversize` pointer to the manifest/section/module slices instead of the over-cap body the host would refuse (#393). `sumo_qa_list_skill_manifests` is a *compact* all-skill routing aid by default (`detail="compact"`: per-skill metadata only, no section/module arrays); the full all-skill index is an explicit `detail="full_index"` opt-in, while the per-skill manifest/section/module/full slices of `sumo_qa_load_skill_context` are the progressive-loading ladder a host climbs once it has chosen a skill. Each partial slice carries a `content_hash` (sha256 of the returned text) and `estimated_tokens`; a caller can pass `known_hash` to get a derived `changed` flag (body omitted when unchanged). This change-detection is stateless; there is no server-side session cache, because MCP session identity is not reliable across the supported hosts, so re-hashing the live slice per call is preferred over a cache keyed on an unstable identity. The same index is additionally exposed as additive MCP resources/resource-templates (`sumoqa://skills`, `sumoqa://skills/{name}/manifest|sections/{id}|modules/{id}|full`) whose bodies are byte-for-byte the loader output, for hosts that surface resources; the model-callable tools stay the canonical, unchanged path. A capabilities-discovery tool (`sumo_qa_capabilities`) returns a compact, typed map of the core QA workflows. Repo-map tools build and consume the QA-native `.sumo-qa/repo-map.json` artifact, each returning a compact typed summary rather than the full map. A risk-to-test ledger formatter (`sumo_qa_format_risk_ledger`) validates host-supplied risk rows and renders the structured verdict appendix: no inference, file/format plumbing only. A context-bundle formatter (`sumo_qa_format_context_bundle`) validates a host-neutral issue/PR context bundle and renders its brief plus its freshness/conflict signals (an optional review/planning *input*, never a network call or GitHub dependency). A QA-readiness-scorecard composer (`sumo_qa_format_qa_scorecard`) reuses those two artifacts plus optional coverage/mutation signals to *derive* a readiness recommendation (ready / ready_with_accepted_residuals / blocked / insufficient_evidence). It is an evidence summary, not a predictive quality score; it invents no numeric score and refuses a ready state while a risk is an uncovered blocker or evidence is stale. A QA-artifact exporter (`sumo_qa_export_test_cases`) deterministically renders host-supplied, already-structured test cases into versioned JSON, a markdown table, or (for flat outlines) CSV. Markdown stays the default human-facing output, exports are side-effect free, and there is no vendor lock-in or new mandatory dependency. A local QA-report composer (`sumo_qa_generate_qa_report`, CLI mirror `sumo-qa report`) projects the persisted `.sumo-qa` artifacts into one self-contained static HTML page with honest not-available states and a readiness verdict derived by the #151 `QaScorecard` engine (the single source of truth, so the report and the scorecard can never disagree): no inference, no network, the HTML body only lands on disk via `write_to`. Test-data tools read/write the local
return markdown catalogues as text. A read-only progressive-loading pair (`sumo_qa_list_skill_manifests`, `sumo_qa_load_skill_context`) indexes each SKILL.md's sections/modules and serves a single slice (manifest / section / module / full) as a JSON string so a host can load just the routing summary or one section rather than the whole body; `mode="full"` returns the same bytes as the skill tool, except that a body over the host's per-response token cap is served through both paths as a compact `oversize` pointer to the manifest/section/module slices instead of the over-cap body the host would refuse (#393). `sumo_qa_list_skill_manifests` is a *compact* all-skill routing aid by default (`detail="compact"`: per-skill metadata only, no section/module arrays); the full all-skill index is an explicit `detail="full_index"` opt-in, while the per-skill manifest/section/module/full slices of `sumo_qa_load_skill_context` are the progressive-loading ladder a host climbs once it has chosen a skill. Each partial slice carries a `content_hash` (sha256 of the returned text) and `estimated_tokens`; a caller can pass `known_hash` to get a derived `changed` flag (body omitted when unchanged). This change-detection is stateless; there is no server-side session cache, because MCP session identity is not reliable across the supported hosts, so re-hashing the live slice per call is preferred over a cache keyed on an unstable identity. The same index is additionally exposed as additive MCP resources/resource-templates (`sumoqa://skills`, `sumoqa://skills/{name}/manifest|sections/{id}|modules/{id}|full`) whose bodies are byte-for-byte the loader output, for hosts that surface resources; the model-callable tools stay the canonical, unchanged path. A capabilities-discovery tool (`sumo_qa_capabilities`) returns a compact, typed map of the core QA workflows. Repo-map tools build and consume the QA-native `.sumo-qa/repo-map.json` artifact, each returning a compact typed summary rather than the full map. A risk-to-test ledger formatter (`sumo_qa_format_risk_ledger`) validates host-supplied risk rows and renders the structured verdict appendix: no inference, file/format plumbing only. A context-bundle formatter (`sumo_qa_format_context_bundle`) validates a host-neutral issue/PR context bundle and renders its brief plus its freshness/conflict signals (an optional review/planning *input*, never a network call or GitHub dependency). A QA-readiness-scorecard composer (`sumo_qa_format_qa_scorecard`) reuses those two artifacts plus optional coverage/mutation signals to *derive* a readiness recommendation (ready / ready_with_accepted_residuals / blocked / insufficient_evidence). It is an evidence summary, not a predictive quality score; it invents no numeric score and refuses a ready state while a risk is an uncovered blocker or evidence is stale. A QA-artifact exporter (`sumo_qa_export_test_cases`) deterministically renders host-supplied, already-structured test cases into versioned JSON, a markdown table, or (for flat outlines) CSV. Markdown stays the default human-facing output, exports are side-effect free, and there is no vendor lock-in or new mandatory dependency. A local QA-report composer (`sumo_qa_generate_qa_report`, CLI mirror `sumo-qa report`) projects the persisted `.sumo-qa` artifacts into one self-contained static HTML page with honest not-available states and a readiness verdict derived by the #151 `QaScorecard` engine (the single source of truth, so the report and the scorecard can never disagree): no inference, no network, the HTML body only lands on disk via `write_to`. Test-data tools read/write the local
known-good catalogue under `knowledge/test_data/`. An ingestion tool materialises runtime knowledge packs into a user-writable location. External-skill lifecycle tools search, install, locate, and load external skills through the Skills CLI while preserving the skill-level confirmation gate. The search tool returns ANSI-stripped CLI output verbatim (no structured parsing) so Skills CLI format drift doesn't break the flow.

See [TOOLS.md](TOOLS.md) for the full list.
Expand Down
42 changes: 0 additions & 42 deletions docs/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,13 @@ All optional. Defaults work out of the box after `pip install sumo-qa && sumo-qa
| `QA_TEST_DATA_PATH` | `knowledge/test_data` (cwd) | Override the known-good test data catalogue. **No samples ship in the wheel**, the catalogue is empty on a fresh install; populate it per your team's domains. |
| `QA_KNOWLEDGE_PATH` | bundled `_data/knowledge` / repo `knowledge` | Override the canonical knowledge catalogues (classifications, approaches, principles, techniques) |
| `SUMO_QA_DEBUG_DIR` | unset | Directory to capture per-tool-call args + output as JSON for debugging / grading |
| `SUMO_QA_OUTPUT_PROFILE` | `default` | Output verbosity/strictness profile for served skill bodies: `concise`, `default`, or `strict` (see [Output verbosity and strictness profiles](#output-verbosity-and-strictness-profiles)). An unrecognised value falls back to `default`. |

These env vars are the lowest-level override and always win. For a no-clone way
to add custom content, see [Adding custom knowledge without cloning the
repo](#adding-custom-knowledge-without-cloning-the-repo) below, it inserts
ingested project/global packs as middle tiers between the env vars and the
bundled defaults.

## Output verbosity and strictness profiles

`SUMO_QA_OUTPUT_PROFILE` tunes how much ceremony wraps the skill guidance
sumo-qa serves, so a small docs-only or test-only edit does not feel like a
full QA audit while security, API, migration, and release-gate work still gets
strict handling. It is a serve-time overlay on the single skill-serving path,
so no skill file is edited and the canonical `SKILL.md` content stays readable
and host-neutral.

| Value | Effect |
|---|---|
| `concise` | Shortest useful answer: one focused risk/test summary, findings over framing, no formal section headers or evidence tables unless the skill marks them mandatory. |
| `default` | Current behaviour. The skill body is served byte-for-byte, unchanged. |
| `strict` | Full ceremony: each gate stated explicitly, evidence as a table, every named risk mapped to its test, and an explicit residual-risk section. |

An unrecognised value (a typo, an unknown name) falls back predictably to
`default` rather than failing, so a misconfigured host can never break serving
or silently drop a gate.

**Never optional, at any profile.** A profile tunes how much prose wraps the
work, never whether the mandatory gates hold. Whatever the profile, the served
overlay restates that the skill's Iron Law and any HARD-GATE, evidence for
every claim, explicit user confirmation before writing files or installing
anything, and every mandatory test or safety gate the skill names are always
kept. Concise mode shortens low-risk output; it does not drop a gate on
high-risk work. Strict mode adds structure to the skill body only; it does not
touch the `sumo_qa_load_*` catalogue payloads, so it cannot bloat them.

```json
{
"mcpServers": {
"sumo-qa": {
"command": "sumo-qa",
"env": {
"SUMO_QA_OUTPUT_PROFILE": "concise"
}
}
}
}
```

## Example: custom team standards

```json
Expand Down
48 changes: 24 additions & 24 deletions docs/RELIABILITY-HARDENING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,30 @@ INTENTIONALLY BOUNDED (residual named and accepted), never open or unaddressed.

### 2. Verbosity fatigue

- **Classification:** intentionally bounded (mechanism merged and pinned; host compliance
is behavioral).
- **Control (merged):** `SUMO_QA_OUTPUT_PROFILE=concise|default|strict` serve-time
overlays on the single skill-serving path. Every overlay restates the never-optional
floor (Iron Law, HARD-GATE, evidence for claims, confirmation before writes/installs).
Unrecognised values fall back to `default`; the overlay rides the oversize pointer only
when the combination itself fits the token cap.
- **Owner / delivery:** issue #215, PR #471 (merged 2026-07-13).
- **Evidence:** `src/sumo_qa/skill_prompts.py`; the profile suite in
`tests/test_skill_prompts.py` (14 tests: byte-for-byte default through the real
registration path, overlay prepending, env-var call-time selection, invalid fallback,
mandatory-gate preservation, token-cap degradation); documentation contract in
`docs/CONFIGURATION.md`, `docs/TOOLS.md`, `docs/SKILLS.md`, and `docs/ARCHITECTURE.md`.
Live merge-gate proof: sha256-verified byte identity of default serving and the router
against the pre-change code, overlay heads with the gate language intact; see the batch
proof comment on PR #471.
- **Default / compatibility:** `default` serves every body byte-for-byte. The overlay
applies to the skill-tool surface only; `sumo_qa_load_skill_context` and the
`sumoqa://` resources always serve the canonical body so `content_hash`
change-detection stays stable across profiles.
- **Residual limit:** whether a host LLM actually emits shorter output under `concise`
is host-behavioral and cannot be proven by unit tests or disk-reading evals; the issue
author left that acceptance box unchecked by design. The discharge path is a live
A/B comparison across MCP builds.
- **Classification:** intentionally bounded, no serve-time control. A serve-time
output-profile mechanism was tried and reverted (a documented negative result).
- **Control:** none shipped. `SUMO_QA_OUTPUT_PROFILE` (the `concise`/`strict` serve-time
overlays, #215/#471) was reverted after the #528 investigation measured that a
serve-time prompt overlay cannot reliably reduce the reply a host emits: a prepended
brevity instruction loses to the model's task-completion drive. A strong model, given
the tightened contract and grounded input, still produced a full structured QA plan;
a weak model ignored the instruction amid large (~10x) run-to-run variance. Rather than
ship a knob that does not do its job, the feature was removed.
- **Owner / delivery:** issue #215, PR #471 (merged 2026-07-13); reverted under the #528
investigation (this removal reverts commit `577527e`).
- **Evidence:** the removal reverts `577527e` and its documentation; the #528
investigation records the A/B measurements and the strong-model contrast that showed no
reliable reduction. The skill-serving path returns to serving each `SKILL.md` body
byte-for-byte (the pre-#215 behavior), with the #393 over-cap progressive-loading
pointer unchanged.
- **Default / compatibility:** the removal is behavior-preserving for the common case:
the zero-argument skill tools serve the canonical body (the same bytes `default`
served), and the `sumo_qa_load_skill_context` loader and `sumoqa://` resources are
unchanged.
- **Residual limit:** verbosity is left to the host. 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. The original acceptance box (does the host
actually emit shorter output) has now been answered: not via a serve-time overlay.

### 3. Enforcement uncertainty (unsupported workflow claims)

Expand Down
6 changes: 3 additions & 3 deletions docs/SKILLS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The sumo-qa MCP ships a library of skills under [`skills/`](../skills/). Each is
`SKILL.md` file the host LLM follows literally: YAML frontmatter, an Iron Law, a
checklist, a Process Flow section, a Red Flags table, examples.

Each skill is also exposed as an MCP tool with the same name (e.g. `sumo_qa_deciding_approach`). The tool returns the SKILL.md body verbatim under the default output profile (a non-default `SUMO_QA_OUTPUT_PROFILE` prepends a small overlay, see [Configuration](CONFIGURATION.md#output-verbosity-and-strictness-profiles)), so hosts that don't have a native skill loader (JetBrains AI Assistant, Junie, VS Code Copilot) get the same content.
Each skill is also exposed as an MCP tool with the same name (e.g. `sumo_qa_deciding_approach`). The tool returns the SKILL.md body verbatim, so hosts that don't have a native skill loader (JetBrains AI Assistant, Junie, VS Code Copilot) get the same content.

**SKILL.md prose defines host-neutral obligations**, capability contracts like *"maintain an ordered work tracker"* or *"dispatch a fresh delegated worker"*. The same body is exposed to every host through whichever surface that host provides (native slash command, MCP tool, agentic-mode tool selection). Skill bodies and contract docs deliberately avoid naming any one host's tools; see `using-sumo-qa` → *Shared vocabulary* for the canonical capability terms each host adapts, and `tests/test_skill_conformance.py` for the regression guard.

Expand All @@ -14,7 +14,7 @@ Slash-menu conventions differ per host:
- **JetBrains AI Assistant**: `/sumo_qa_deciding_approach` (underscores): comes from the MCP tool. Every MCP entry is slash-invocable.
- **JetBrains Junie / VS Code Copilot**: Natural language; the AI picks the tool by description in Agent mode.

All paths invoke the same SKILL.md body. Under a non-default `SUMO_QA_OUTPUT_PROFILE` the MCP skill tool prepends a small output-profile overlay to that body; native skill files and the progressive-loading loader (`sumo_qa_load_skill_context`) always carry the canonical text.
All paths invoke the same SKILL.md body.

## The skills

Expand Down Expand Up @@ -67,7 +67,7 @@ A skill body can be loaded whole, or in slices, through the partial loader (`sum

- **manifest**: compact routing metadata (description, token weights, section/module ids, which sections are `required`). A *navigation aid*, not the instruction. Use it to pick a skill and see its shape.
- **section** / **module**: one verbatim slice of the body (e.g. just the Iron Law, or one lazy module). **Canonical**: cite or follow it directly.
- **full**: the entire canonical body, byte-for-byte identical to the zero-argument skill tool under the default output profile (under `concise`/`strict` the skill tool prepends the profile overlay; this loader always serves the canonical bytes). **Canonical**: load it when you are about to *execute* the skill and need the exact procedure wording. If a body would exceed the host's per-response token cap (today only `sumo-qa-reviewing-before-merge`), `mode="full"` and the zero-argument tool both return a compact `oversize` pointer to the manifest/section/module slices instead of the over-cap body the host would refuse (#393), so load that skill progressively.
- **full**: the entire body, byte-for-byte identical to the zero-argument skill tool. **Canonical**: load it when you are about to *execute* the skill and need the exact procedure wording. If a body would exceed the host's per-response token cap (today only `sumo-qa-reviewing-before-merge`), `mode="full"` and the zero-argument tool both return a compact `oversize` pointer to the manifest/section/module slices instead of the over-cap body the host would refuse (#393), so load that skill progressively.

**Canonical vs compact.** `section`, `module`, and `full` are verbatim from the file and may be followed as authoritative. The manifest paths are compact summaries for routing only, never treat a manifest description or section list as the procedure. When a workflow is actually running and depends on exact wording (Iron Law, HARD-GATE, the step-by-step checklist), load the full body or the specific section, not the manifest.

Expand Down
Loading