Releases: dgenio/contextweaver
Release list
v0.17.0
What's Changed
- feat(transport): SSE transport for MCP gateway and proxy (#694) by @dgenio in #716
- feat(ci): supply-chain & security hardening (#443, #689, #690, #691, #692, #468, #552) by @dgenio in #718
- chore(ci): bump peter-evans/create-pull-request from 6 to 8 by @dependabot[bot] in #720
- chore(ci): bump actions/attest-build-provenance from 96b4a1ef7235a096b17240c259729fdd70c83d45 to e8998f949152b193b063cb0ec769d69d929409be by @dependabot[bot] in #721
- chore(ci): bump actions/cache from 4 to 5 by @dependabot[bot] in #722
- chore(ci): bump actions/deploy-pages from 4 to 5 by @dependabot[bot] in #723
- chore(ci): bump actions/upload-pages-artifact from 3 to 5 by @dependabot[bot] in #724
- chore(deps): update mkdocstrings requirement from <1,>=0.25 to >=0.25,<2 by @dependabot[bot] in #725
- feat(mcp): generate config packs for MCP clients by @dgenio in #726
- docs: refresh label catalog to match live taxonomy by @corazonthedev in #715
- feat(benchmarks): scaling, scenarios, CI quality gate, and release trend by @dgenio in #727
- docs: link the Weaver Stack overview article (Towards AI) by @dgenio in #728
- chore(ci): bump actions/attest-build-provenance from 2.4.0 to 4.1.1 by @dependabot[bot] in #733
- feat(cli): add deployment-intent onboarding wizard by @dgenio in #734
- chore(ci): bump actions/cache from 5 to 6 by @dependabot[bot] in #732
- chore(ci): bump actions/checkout from 4 to 7 by @dependabot[bot] in #731
- chore(ci): bump astral-sh/setup-uv from 5 to 7 by @dependabot[bot] in #729
- chore(ci): bump peter-evans/find-comment from 3 to 4 by @dependabot[bot] in #730
- [codex] Add MCP incident packs by @dgenio in #739
- feat(gateway): runtime authorization gate + secure-by-default serving by @dgenio in #760
- fix(security): secret-scrubbing parity across gateway, primitive, and sidecar surfaces (#742, #743, #745) by @dgenio in #771
- chore(ci): bump peter-evans/create-or-update-comment from 4 to 5 by @dependabot[bot] in #772
- chore(ci): bump actions/upload-artifact from 4 to 7 by @dependabot[bot] in #773
- chore(ci): bump actions/setup-python from 5 to 6 by @dependabot[bot] in #774
- chore(ci): bump github/codeql-action from 3 to 4 by @dependabot[bot] in #775
- feat(adapters): knowledge-bundle context sources (#736, #763, #767, #776) by @dgenio in #779
- feat(gateway): add named policy presets for gateway operations (#664) by @dgenio in #780
- feat(gateway): live multi-upstream MCP serving, VS Code import, artifact lifecycle policy by @dgenio in #785
- feat: MCP gateway platform-maturity cluster (governance, observability, model-assist, transport) by @dgenio in #789
- Release v0.17.0 by @dgenio in #790
Full Changelog: v0.16.0...v0.17.0
v0.16.0
contextweaver 0.16.0 — consolidation, primitives, and DX hardening.
Highlight: Memory Consolidation Engine
Distill episodic memory into durable facts with contextweaver.context.consolidate(...). Deterministic clustering, provenance tracking, max-sensitivity inheritance, and an optional LLM-assisted canonicalizer — all pure stdlib, zero new dependency. Includes contextweaver consolidate CLI and �valuate_consolidation offline quality harness.
Gateway: Resources & Prompts
PrimitiveGatewayRuntime extends bounded-choice routing and context-firewall treatment from tools to MCP resources and prompts. Unified cross-primitive identity via
outing.primitive_id, four gateway meta-tools, and complete upstream adapters.
Developer Experience
- HTTP sidecar — language-agnostic POST /v1/route and /v1/compact over stdlib HTTP, no new dependency
- contextweaver verify — fast, deterministic smoke test for library-first adoption
- Stable error codes — every ContextWeaverError carries a machine-readable code + hint`n- Deprecation machinery — @deprecated decorator, registry, and upgrade guide
- Persistent routing cache — RoutingIndexCache + CachedRetriever for warm-start routing
Action Required
Three pre-1.0 APIs now emit DeprecationWarning (behavior unchanged; removal in 1.0):
- RouteResult.debug_trace → use .trace`n- RouteTrace.to_legacy_dicts() → use structured fields
- Router(scorer=...) → use
etriever= or scorer_backend=`n
See CHANGELOG.md for the full list.
v0.15.0
contextweaver 0.15.0
Highlights
- Structured route->select contract — constrained-selection schemas, validated selection repair, shortlist composition controls (#515, #479, #516, #509)
- New adapters — OpenAPI, Agent Skills, Microsoft Agent Framework, LangChain, OpenAI Agents, Google ADK (#546, #545, #430, #454, #502, #501, #547)
- Context-engine tuning — caller-owned rendering, new
ItemKind.retrieved_doc, phase-aware scoring weights, budget-overflow policy (#410, #411, #487, #510) - Gateway dispatch hardening — retry/backoff, dry-run, rate-limiting, read-only response cache (#529, #483, #482, #512)
- Store layer — Redis & S3 backends, SQLite episodic/fact stores, async protocol variants, conformance kit (#426, #496, #495, #520)
- Firewall — single-call facade, structured mode, determinism guarantee, built-in token counter (#399, #406, #404, #405)
- Sensitivity enforcement — secret-redaction, ingestion-time classification, header memory enforcement (#428, #542, #450, #451)
- Diagnostics — trustworthy context/gateway reporting, public API manifest, CI drift checks (#370, #378, #518, #522)
See CHANGELOG.md for full details.
v0.14.1
[0.14.1] - 2026-06-11
Added
- MCP Registry listing + PyPI ownership marker (#348). Adds a
registry-publishableserver.jsondescribing the gateway as a
uvx contextweaver mcp serve --config <gateway.yaml>stdio server (linking
to the gateway quickstart, not the raw API docs), an
mcp-name: io.github.dgenio/contextweavermarker in the README for PyPI
ownership verification, and a release-triggered GitHub Actions job that
publishes to the official MCP Registry via GitHub OIDC (no interactive
login required). - Trustworthy diagnostics across context builds and the MCP gateway
(#370, #378, #398, #414, #459).BuildStats.dropped_itemsattributes
every excluded item tosensitivity,dedup,kind_limit, orbudget;
the production context pipeline now fires exclusion and budget lifecycle
hooks. New versionedDiagnosticEvent/DiagnosticSinkAPIs include
thread-safe in-memory and append-only JSONL sinks.ProxyRuntimeemits
sanitized catalog, browse, hydrate, execute, and artifact-view events with
counts, token/schema savings, failures, and latency. Operators can use
contextweaver mcp inspect,contextweaver mcp stats, and
contextweaver inspectfor JSON or Markdown reports without exposing raw
queries, argument values, result text, prompt text, or artifact bytes. - Single-call firewall facade ÔÇö
compact_tool_result()/
firewalled_tool_result()(#399). Shrink one large tool result before it
enters the prompt without standing up aContextManager. Returns a
CompactResult(firewalled,payload,summary,facts,artifact_ref,
stats). Exported from the top level. - Structured (lossless) firewall mode (#406). New
StructuredFirewall(keep=[...])
plussummarize.structured.project/parse_path: keep an allow-list of
JSON paths inline, offload the rest to the artifact store (retrievable via
drilldown), no LLM. Selectable throughcompact_tool_result(strategy=...)
andContextManager.ingest_tool_result(..., firewall=StructuredFirewall(...)).
An explicitstrategy="structured"now raisesConfigErroron non-JSON
input instead of silently downgrading to a text summary;ingest_tool_result
appliesfirewall=only abovefirewall_threshold. - First-class firewall diagnostics ÔÇö
FirewallStats(#402). Records
triggered,strategy, original/summary chars+tokens (chars_saved/
tokens_saved),artifact_ref, andsummarized_by_llm. Surfaced on
ResultEnvelope.firewall_stats, and aggregated onBuildStats.firewall_events
/BuildStats.firewall_summary(). - Determinism guarantee ÔÇö
deterministic=True(#404).ContextManager(deterministic=True)
andcompact_tool_result(deterministic=...)fail closed with the new
DeterminismErrorrather than passing data through an LLM-backed summariser;
FirewallStats.strategy/summarized_by_llmmake the path auditable. - Built-in token counter ÔÇö
contextweaver.tokens(#405). Public
count()/get_token_counter()/heuristic_counter()(andTokenCounter
alias) so callers never wiretiktokendirectly; firewall/FirewallStats
numbers use the same counter. New no-opcontextweaver[tokenizers]extra
documents the contract (tiktokenis already core, with offline fallback). - Daily Driver guide for MCP gateway operators (#394). New
docs/daily_driver.mdexplains when to use or bypass contextweaver,
copy-paste operating instructions for common MCP clients, and a practical
debug loop using route explanations,BuildStats, artifact views, and OTel. - MCP gateway security and data-flow model (#396). New
docs/security_model.mddistinguishes prompt exposure from raw artifact
storage, documents trust and egress boundaries, and records the current
tool_view/ artifact-lifecycle limits tracked by #375. - Verified Claude Code MCP recipe (#429). Adds project/local registration
commands, a committed.mcp.jsonexample, operating instructions, and
troubleshooting verified against Claude Code 2.1.165. - Zero-install CLI smoke coverage (#437). Linux and macOS CI now build the
wheel and run itscontextweaverentry point through isolateduvxand
pipxenvironments.
Changed
BuildStatsaccounting now has one pipeline owner (#459).
total_candidatesis measured after dependency closure and before
sensitivity filtering;dropped_countincludes every later exclusion, so
completed builds satisfyincluded_count + dropped_count == total_candidates. The report schema is version 2.- CI now exercises every committed generated-artifact drift check
(#389ÔÇô#393).llms.txt/llms-full.txt, recorded demo casts, and the
gateway scorecard are gating checks on the Python 3.12 matrix cell; the
deterministic smoke evaluation also runs there as a non-gating signal. - MCP client recipes now use the installed CLI (#371, #437). Claude
Desktop, Claude Code, GitHub Copilot, and Cursor configs launch
uvx contextweaver mcp serve; docs no longer describe the dedicated CLI as
future work.examples/recipes/serve_gateway.pyremains a labelled
legacy/custom-runtime example, while config tests reject references to that
launcher across relative, absolute, POSIX, and Windows path forms. Relative
catalog paths now resolve from the config file, and text results expose their
stored artifact handle so clients can calltool_view.
v0.14.0
[0.14.0] – 2026-06-07
Added
- Canonical Frame-shaped ingestion seam —
ContextManager.ingest_envelope()
(#352). The execution boundary (e.g. agent-kernel) firewalls and hands
contextweaver an already-firewalledResultEnvelope(the native preimage of
a weaver-specFrame); contextweaver appends a summary-onlyContextItem
carrying the artifact handle and does not re-derive firewalling from raw
output. The raw-output APIs (ingest_tool_result,ingest_mcp_result)
remain for standalone use but are now labelled non-canonical for spec
compliance. New firewall boundary doc
explains the contextweaver-firewall vs agent-kernel-firewall split and the
seam; weaver-spec I-05 status updated accordingly. - Zero-Python config-file launch for the MCP gateway (#346).
contextweaver mcp serve --config gateway.yamlreads the catalog and serve
options (mode,top_k,beam_width,cache_stable,name,version)
from a single JSON/YAML file; explicit CLI flags still win. The catalog
loader now also accepts the real-MCP-server snapshot shape
({"tools": [...]}) used by the recipes. New Cursor recipe
(docs/recipes/cursor.md) plusexamples/recipes/gateway_config.yamland
examples/recipes/cursor_mcp.json. (Bridging a live upstream MCP server
over stdio remains follow-up on #346.) rank_collectedis now part of the public routing API (#288). The
score-sort / active-filter helper is re-exported from
contextweaver.routingso customNavigatorimplementations can reuse it.- End-to-end quality + cost benchmark vs a competent baseline (#345). New
benchmarks/e2e_quality.pyruns realistic tool-using tasks three ways —
naive concat, a hand-built competent baseline, and contextweaver — scoring
tool-selection accuracy, hallucinated-tool rate, end-task answer accuracy,
prompt tokens, and estimated cost per strategy. Ships with a deterministic
stub model (default, exercised in CI) and an opt-in real-model path
(CW_E2E_LLM=1+ a user-suppliedcall_fn, no LLM SDK dependency). New
make e2e-qualitytarget (non-gating) andbenchmarks/e2e/tasks.json
fixtures. The published real-model headline is produced from a credentialed
maintainer run.
Changed
- Decomposed
ContextManagerto meet the ≤300-line module guideline (#101).
The pipeline logic already lived incontext/build.py
(run_build_pipeline),context/route_build.py,context/call_prompt.py,
andcontext/ingest.py; what remained was the manager's own method surface
(manager.pywas 878 lines of thin delegating stubs + docstrings). Those
stubs now live in flat, single-level partial-class mixins —
_IngestMixin(context/_manager_ingest.py),_BuildMixin
(context/_manager_build.py),_RoutingMixin(context/_manager_routing.py)
— sharing a_ManagerStatebase (context/_manager_base.py) that declares
the private-attribute contract.manager.pyis now 239 lines (only
__init__, properties,drilldown, and mixin composition); every module is
≤300. The delegate pipeline functions are now typed against_ManagerState
(interface segregation;ContextManagerinherits it via the mixins, so every
call site is unchanged). No public API change — all 21 methods stay on
ContextManagerand the full test suite passes unmodified. - Unified routing metrics into
contextweaver.eval.metrics(#354).
benchmarks/benchmark.pyandcontextweaver.eval.routingpreviously
definedrecall@k/reciprocal_rankunder the same names with different
semantics (fractional recall vs boolean hit-rate). They now share one
canonical source of truth —recall_at_k(classic fractional recall),
precision_at_k,reciprocal_rank— re-exported fromcontextweaver.eval.
The benchmark scorecard numbers are unchanged;evaluate_routingnow reports
fractional recall for multi-expected cases (identical for the common
single-expected case). - Split
extras/memory/zep.pyintozep.py+_zep_common.pyso each
module stays within the repo's ≤300-lines-per-module rule (PR #360 review).
The public import path (contextweaver.extras.memory.zep) and its exports
(ZepBackendError,ZepEpisodicStore,ZepFactStore) are unchanged.
Fixed
- Routing history tool-id resolution narrows its exception handling.
route_build.resolve_tool_id_from_resultpreviously wrapped the parent
event-log lookup in a bareexcept Exception, silently swallowing any error
before falling back toparent_id. It now catches onlyItemNotFoundError
(the documentedEventLog.getcontract), so unexpected store errors surface
instead of being hidden (PR #363 review). - Provider message encoders no longer emit empty-content messages.
to_anthropic_messagesandto_gemini_contentsnow raise a clear
CatalogError(with the offendingmsg_index) when a turn would
serialise to empty or blank-text content, instead of letting the
provider reject it later with an opaque
400 ... messages: ... must have non-empty content. Messages that
carry tool-use / tool-result / function-call blocks remain valid.
OpenAI is intentionally left untouched: its Chat Completions API
tolerates empty content and the empty-string assistant-content
round-trip is an existing invariant (PR #230). - Zep backend defensively coerces scanned
tags/metadatawhen rebuilding
Episode/Factfrom persisted episodes: a non-listtags(e.g. a bare
string, which previously iterated into characters) yields[], and a non-dict
metadata(which previously raised indict(...)) yields{}(PR #360 review). LlmSummarizer/LlmExtractorfallback warnings now include the underlying
exception text, so a degraded LLM path is diagnosable (timeout vs auth vs
parsing) instead of opaque (PR #360 review).
contextweaver 0.13.4
Restore proven dependency floors:
- mcp: >=1.19.0 (was >=1.0; in-memory transport wire format changed)
- typer: >=0.16.0 (was >=0.9; breaks against click 8.2)
- pytest-asyncio: >=0.23.8 (was >=0.23; Package.obj collection bug)
- fastmcp: >=2.12.0 (was >=2.0; decorator pattern changed)
All floors trace back to the proven floor-deps commit �27eb1b which was accidentally reverted during the v0.13.0 release merge.
v0.12.0
What's Changed
Added
- Catalog showcase reference architecture — a start-here, deterministic example (�xamples/architectures/catalog_showcase/) that narrows a 65-tool catalog to a 5-card shortlist, hydrates only the selected tool's schema, and firewalls a large result; wired into make architectures and documented at docs/architectures/catalog_showcase.md. (#330)
- contextweaver demo --scenario killer — the 60-second failure mode: 100 tools + a long history + a huge tool result, contrasting a naive loop against contextweaver in character terms (92–99% reductions). New README 'The 60-second failure mode' section and docs/killer_demo.md. (#322)
- LangGraph agent-loop reference architecture — contextweaver running inside a LangGraph \StateGraph\ (\�xamples/architectures/langgraph_agent_loop/): LangGraph owns control flow, contextweaver owns route/firewall/answer. Guarded import with a hand-rolled fallback so it runs without the framework; new [langgraph]\ extra. \docs/architectures/langgraph_agent_loop.md. (#326)
- Agent-safe evaluation-artifact context profile — a context-shaping profile (\�xamples/architectures/eval_artifact_profile/) with \ok\ / \caution\ / \high_risk\ fixtures that never surfaces \V_hat\ without support diagnostics and foregrounds caveats for high-risk artifacts, with runtime-asserted invariants. \docs/architectures/eval_artifact_profile.md. (#335)
Fixed
- Docs accuracy follow-up to #337 — aligned the VibeGuard --diff\ shape between the Python subprocess and YAML CI snippets in \docs/cookbook.md, and corrected the sensitivity row in \docs/interop_skill_cards.md\ so it matches the actual \�pply_sensitivity_filter\ semantics. (#338)
Full Changelog: v0.11.1...v0.12.0
v0.11.1
Added
- Community & interop docs — CODE_OF_CONDUCT.md, contributor landing page, safety-gate cookbook recipe, and skill-card interop doc (#249, #325, #332, #333)
- Adopter positioning docs — benchmark report, ecosystem comparison, stability checklist, and launch kit (#323, #324, #327, #328, #329)
Changed
- README / docs / PyPI positioning — sharpened first-screen category and aligned descriptions (#321)
v0.10.0
What's New in v0.10.0
Added
contextweaver.routing.hydration- public schema-hydration helpers (SchemaSource,hydrate_with_schema,lazy_schema_resolver). Resolve a tool's full input schema from a sidecar source without hand-rolling a_FULL_SCHEMASdict. Issue #261.contextweaver mcp serveCLI - new Typer sub-app bootsMcpGatewayServerorMcpProxyServerover stdio against any JSON/YAML catalog. Marked [experimental]. Issues #243/#246.- Live-transport MCP gateway architecture variant - runs through a real
mcp.server.Server+ClientSessionpaired viamcp.shared.memory. Issue #260. - Multi-turn MCP gateway architecture variant - 4-turn scenario with fact accumulation across turns and dependency closure. Issue #262.
contextweaver demo --scenario mcp-gateway-full- surfaces the 60-tool reference architecture from the CLI. Catalog ships inside the wheel. Issue #264.- Gateway-scenario benchmark suite - 5 deterministic scenarios, firewall-reduction range 0.0%-98.8%. Issue #270.
- Real-MCP catalog architecture variant - runs against snapshots of 3 real MCP servers. Issue #280.
- Asciinema recordings for showcase demos - 4 committed casts under
docs/assets/casts/. Issue #281. RouteResult.to_dict/from_dict- missing serialization pair. Issue #289.- Context-pack explanation traces -
ContextManager.build(..., explain=True)returns per-candidate scoring and drop reasons. Issue #291. - Sensitivity/firewall regression fixtures - 6 fixtures covering all floors in drop and redact modes. Issue #292.
- Weaver-spec payload fixtures -
--fixtures-dirflag for actionable diagnostics. Issue #295. - Golden route-prompt + MCP-ingestion fixtures -
tests/fixtures/golden/snapshots. Issue #296.
Fixed
- MCP server call-tool result shape - proper
CallToolResultobjects instead of 2-tuples. SchemaSource.from_json_filevalidation tightened.CallToolResult.contenttype annotation narrowed for mypy strict.ContextBuildExplanationoverload guard for explain=True.PYTHONPATHin pytest config fortests.fixturesimports. Issue #302.
Full Changelog: v0.9.1...v0.10.0
0.8.0
What's Changed
Added
- CrewAI adapter (#193) — �dapters/crewai.py. Thin stateless converter: CrewAI BaseTool instances or plain-dict shape → SelectableItem. Ships crewai_tool_to_selectable, crewai_tools_to_catalog, infer_crewai_namespace, load_crewai_catalog. Dict-conversion path works without [crewai] extra. New integration guide docs/integration_crewai.md and examples/crewai_adapter_demo.py.
- Mem0 external-memory backend (#195) — extras/memory/mem0.py. Mem0EpisodicStore + Mem0FactStore implement EpisodicStore / FactStore Protocols verbatim (no widening). Writes via mem0.Memory.add(infer=False) stamped with cw_episode_id / cw_fact_id metadata. New [mem0] optional-dependency group. New docs/integration_memory.md decision matrix.
Changed
- Provider-SDK leak invariant tests now run in a subprocess — the est_module_does_not_import_provider_sdk_at_load_time assertions in est_adapters_openai_messages.py, est_adapters_anthropic_messages.py, and est_adapters_gemini_contents.py now spawn a fresh interpreter so the check is independent of test ordering and other installed extras (e.g. crewai transitively importing openai).
Fixed
- crewai adapter: deep-copy �rgs_schema to prevent catalog mutation
- EpisodicStore.add(): upsert semantics (idempotent on re-add)
- Mem0EpisodicStore.add(): graceful fallback to append-only when scan_limit exceeded
- Mem0FactStore.put(): guarded write path to avoid silent data loss
- Docs: corrected API kwargs, added original_description metadata
Full changelog: https://github.com/dgenio/contextweaver/blob/main/CHANGELOG.md