Repository navigation
Description
Child of #137 (epic: progressive skill/context loading). This is the First PR Slice — the minimum useful path that gives measurable value without changing the existing host activation path.
Depends on: none (foundation slice — ready).
Problem
Every sumo-qa skill tool returns its full SKILL.md body (~136k chars / ~34k approx tokens across 14 skills). Hosts cannot retrieve just the routing summary, one section, or one module — so session-cumulative token cost is high. There is no manifest/index describing each skill's sections, modules, or token weights.
Expected outcome
A read-only, deterministic, local-only pair of tools lets a host load only the slice of skill context it needs, while the existing zero-argument skill tools keep returning full bodies unchanged.
Scope
src/sumo_qa/skill_prompts.py(or a new sibling module) — manifest/index generation fromskills/*/SKILL.mdheadings andskills/*/modules/*.mdfilenames; no LLM extraction.- New tools:
sumo_qa_list_skill_manifests()— compact metadata for all bundled skills (name, tool_name, description, content_hash, estimated_tokens_full, sections[], modules[]).sumo_qa_load_skill_context(skill_name, mode, section=None, module=None)withmode = "manifest" | "section" | "module" | "full".
- Stable section ids = slugs from markdown headings; duplicate headings get deterministic suffixes (
red-flags,red-flags-2). Module ids = slugs frommodules/*.mdfilenames. Reject path traversal and unknown skill/section/module with actionable error envelopes. docs/TOOLS.mdnote that the new loader exists (full detail/teaching deferred to PR2).
Acceptance criteria
- Existing zero-argument skill tools remain unchanged and still return full
SKILL.mdbodies. - First PR adds only
sumo_qa_list_skill_manifestsandsumo_qa_load_skill_context(or an equivalent minimal pair); larger levers stay follow-ups. - A manifest/section/module index exists for every bundled skill (all headings exposed even when canonical heading names differ).
-
required=trueis set forfrontmatter,Iron Law,HARD-GATE,Checklist,Flow,Red Flagswhen present. -
mode="manifest"returns routing summary + section list + module list;mode="section"returns one section;mode="module"returns one module;mode="full"returns byte-for-byte the existing skill tool body. - Error envelopes for invalid/missing skill/section/module/mode include the valid choices.
- New tools are read-only, deterministic, local-only — no MCP resources, catalogue compacting, graph/embedding/cache behavior in this PR.
- Partial loading preserves Iron Law / HARD-GATE availability.
-
tests/fixtures/mcp_tools_list_snapshot.jsonregenerated with a reviewable rationale for the two new tools.
Test plan
- Unit tests: markdown section indexing + stable section ids; duplicate headings; missing/malformed frontmatter; empty sections; unknown skill_name/section/mode.
- Unit tests: module indexing/loading, missing module reference, path-traversal rejection.
- Unit tests: manifest/section/module/full loader behavior;
mode="full"byte-equivalence to existing tool. pytest tests/test_skill_conformance.py tests/test_tools_list_contract.py tests/test_token_weight_regression.py- Run with Node 24 + isolated npm cache if any promptfoo eval is touched (none expected in this PR).
Context
Epic #137 "First PR Slice" + Lever 1 + Lever 2 (loader portion) + "Lazy skill modules — folded from #279". Boundaries: keep host-neutral (#82); honor #89/#172 token budgets. Do NOT add Graphify/GraphRAG/Graphiti/vector store/embeddings. Module-split refactor of sumo-qa-reviewing-before-merge itself is tracked separately (its eval-preservation acceptance lives in the epic); this slice delivers the loader + index mechanism the module pattern depends on.
Roadmap fields: Status: Ready; Priority: P1; Size: M; Depends on: none.
Activity
sumithr commentedon Jun 1, 2026
Acceptance-criteria verification (PR #292, branch
feat/issue-285-progressive-skill-loading-pr1)All 9 ACs verified against the branch (not the PR self-description):
skill_prompts.pyuntouched;test_skill_manifest.py::test_full_mode_is_byte_for_byte_equal_to_skill_tool_bodysumo_qa_list_skill_manifests+sumo_qa_load_skill_contextonlylist_skill_manifests()over all skills;test_every_bundled_skill_exposes_a_required_iron_law_and_red_flagsrequired=truefor frontmatter/Iron Law/HARD-GATE/Checklist/Flow/Red Flagstest_required_flag_matches_named_structural_sectionstest_load_unknown_*+test_load_missing_skill_name_returns_required_envelope+test_load_missing_mode_returns_required_envelope(added after codex P2)_read_only_localannotation; module does pure markdown + sha256, no I/O beyond reading SKILL.mdtests/fixtures/mcp_tools_list_snapshot.jsonregenerated;test_tools_list_contractgreenVerification evidence: full CI matrix green (Linux/macOS/Windows × py3.10–3.14, ruff, mypy, CodeQL, plugin-install); local full suite 1487 passed, 1 xfailed, 100.00% coverage; sumo-qa review SAFE (5 named risks covered); codex P2 (missing-arg envelope) fixed in
6685c9b.sumithr commentedon Jun 1, 2026
Behavioral verification (finish-pr step 4.7 — feature executed, not just tested)
Ran the two new tools through the real built MCP server (
build_mcp_server()) against the bundled skills on the branch — observed output, not a suite inference:sumo_qa_list_skill_manifestsandsumo_qa_load_skill_contextare advertised via the server'slist_tools()— a host can actually reach them.list_skill_manifests()→ metadata for all 14 bundled skills (skill_name, tool_name, sha256 content_hash, estimated_tokens_full, section + module indexes).mode="full"forsumo-qa-reviewing-before-mergeis byte-for-byte equal to the existing zero-arg skill tool's body (backward-compat intent, observed live).sumo-qa-reviewing-before-merge(~7150 approx tok full):The Iron Law) ≈ 49 tok, content verbatim from SKILL.mdskill_name, missingmode, unknown skill, unknown section, path-traversal (../../etc/passwdrejected), andmode="module"with no modules. Each returns{"error": ..., "available_*": [...]}.The feature does what #285/#137 intended: a host can load just the routing summary or one section at a fraction of the full-body cost, while the full body stays byte-identical to today's tool.
feat(skills): add skill-manifest index + partial skill-context loader (…
chore(main): release 0.26.0 (#293)
test: add cumulative token-budget tests + host docs for progressive s…
test: add cumulative token-budget tests + host docs for progressive s…
feat(skills): expose skill index as additive MCP resources/templates (#…
feat(skills): add content-hash digest + change-detection to partial s…