Version and regression-test all model-facing text surfaces (card formats, plugin prompts, meta-tool descriptions)
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 9
- Forks
- 17
- Avg merge
- 21h 36m
- Merged PRs (30d)
- 22
Description
Summary
Introduce explicit versioning for every text surface a model consumes — the ChoiceCard render format, the LLM-plugin prompt templates, the gateway meta-tool names/descriptions, and the call-prompt/handoff render templates — with version stamps in result metadata and golden regression tests per surface.
Why this matters
These surfaces are prompts: changing a card line format or a summarizer instruction changes model behavior in every downstream deployment. Versioning makes such changes visible, reviewable, and traceable (which prompt produced this stored summary?), enables A/B comparison and audits, and protects integrators from silent behavior drift between releases. This is the prompt-engineering analogue of the project's existing schema-drift gate (make schemas-check).
Current evidence
src/contextweaver/extras/llm_summarizer.pylines 43–52:DEFAULT_SUMMARY_PROMPT/ extractor prompts are unversioned constants; noprompt_versionis recorded onResultEnvelope(src/contextweaver/envelope.py) orFirewallStats.src/contextweaver/routing/cards.py—render_cards_text()line format ([{idx}/{total}] {id} ({kind}) — {description}) has no format identifier and no golden test of its own (demo casts inmake record-demos-checkcover it only incidentally).src/contextweaver/adapters/mcp_gateway.py—tool_browse/tool_execute/tool_viewdescriptions are the instructions client LLMs actually follow, and are similarly unversioned.grep -rn "prompt_version" src/returns no matches.
Proposed implementation
- Add a small registry module (e.g.
prompt_surfaces.py) declaring(surface_name, version, text-or-format)for: card render format, summary prompt, fact-extraction prompt, meta-tool descriptions, call-prompt template (context/call_prompt.py), handoff render (context/handoff.py). - Stamp versions where output is persisted:
FirewallStats.prompt_versionfor LLM-path summaries,ResultEnvelope.metadata,GraphManifest/RouteTracefor the card format version. - Add golden tests per surface: fixed inputs → committed expected text, failing on any unreviewed change (pattern mirrors
make record-demos-check). - Add a changelog policy: bumping a surface version requires a CHANGELOG entry and, where the benchmark can detect it, a benchmark-delta note.
- Documentation page listing current surface versions and their change history.
Example prompt, schema, or interface
SURFACES = {
"choice_card_text": SurfaceVersion("v1", renderer=render_cards_text),
"firewall_summary_prompt": SurfaceVersion("v1", text=DEFAULT_SUMMARY_PROMPT),
"gateway_tool_browse_desc": SurfaceVersion("v1", text=TOOL_BROWSE_DESCRIPTION),
}
# FirewallStats(..., prompt_version="firewall_summary_prompt/v1")
Acceptance criteria
- Every listed surface has a declared version and a golden regression test.
- LLM-path summaries persist the prompt version that produced them.
- Changing any surface text without bumping its version fails CI.
- A docs page enumerates surfaces and versions.
Test and evaluation plan
- Golden tests per surface (committed expected outputs).
- Serde round-trip tests for the new metadata fields.
- CI drift check analogous to
schemas-check(could be folded intomake ci).
Migration notes
New optional metadata fields on FirewallStats/ResultEnvelope — additive, with to_dict/from_dict defaults so previously serialized data loads unchanged. Contributor workflow gains one rule: surface edits require version bumps.
Risks and tradeoffs
Slight contributor friction (golden tests must be regenerated deliberately). Version stamps add a few bytes to persisted envelopes. The registry must not become a kitchen sink — limit it to genuinely model-facing surfaces.
Suggested labels
prompt-engineering, reliability, evals, area/context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/contextweaver/extras/llm_summarizer.py, envelope.py, routing/cards.py, adapters/mcp_gateway.py, context/call_prompt.py, and context/handoff.py, then inspect make record-demos-check and schemas-check. Map each listed model-facing surface to its persisted metadata and golden test. Done means every surface is versioned, regression-tested, serialized compatibly, documented, and checked by CI.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- ai, documentation, testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100