Releases: dgenio/contextweaver
Releases · dgenio/contextweaver
v0.2.0
What's Changed
Breaking Changes
- ContextPolicy.ttl_behavior removed (#65) - the field was never read by any pipeline stage. Remove it from any ContextPolicy(ttl_behavior=...) calls. No behaviour changes; the field had no effect in prior releases.
- InMemoryEventLog.append() now raises DuplicateItemError instead of bare ValueError - callers catching ValueError must migrate to DuplicateItemError or ContextWeaverError (#64)
- InMemoryArtifactStore.drilldown() now raises ContextWeaverError instead of bare ValueError (#64)
Added
- StoreBundle.from_dict() and InMemoryArtifactStore.from_dict() - full round-trip serialization (#66)
- DuplicateItemError(ContextWeaverError) - exported from top-level package (#64)
- Named configuration presets ("fast", "balanced", "accurate") via ProfileConfig and RoutingConfig (#133)
- FastMCP Catalog bridge adapter in �dapters/fastmcp.py - astmcp_tool_to_selectable(), astmcp_tools_to_catalog(), load_fastmcp_catalog(), infer_fastmcp_namespace() (#114). Install: pip install contextweaver[fastmcp]
- End-to-end four-phase runtime loop example (examples/full_agent_loop.py) and guide (docs/guide_agent_loop.md) (#24)
- LangChain memory replacement example (examples/langchain_memory_demo.py) (#170)
- Benchmark harness for routing and context pipeline - make benchmark (#119)
- docs/troubleshooting.md - 10 common issues, debugging techniques, 12-entry FAQ (#82)
- SECURITY.md - vulnerability disclosure policy
- llms.txt / llms-full.txt - structured docs index and full-text bundle for AI tools
- Auto-generated API reference site via MkDocs + mkdocstrings - make docs (#110)
- make test now includes branch coverage report (#165)
- CI pip dependency caching (#94)
- Reusable agent prompt workflows in .github/prompts/ (#96)
Fixed
- _strip_namespace_prefix() now handles dot- and slash-delimited FastMCP names (#177)
- astmcp_tool_to_selectable() normalizes set/rozenset/ uple metadata values to lists (#177)
- All runnable snippets in docs/troubleshooting.md corrected to match actual APIs
- Example output markers normalized to ASCII for Windows cp1252 compatibility
Full changelog: https://github.com/dgenio/contextweaver/blob/main/CHANGELOG.md
v0.1.7
v0.1.6 — Logging Integration
What's New
Logging Integration (#111)
- Python
loggingintegration with structured events across all subsystems- Loggers:
contextweaver.context,contextweaver.routing,contextweaver.store,contextweaver.adapters - DEBUG-level messages at each context pipeline stage (candidate generation, scoring, dedup, selection, firewall, sensitivity)
- INFO-level summary messages for context builds and route completions
- Sensitivity guard: item text content is never logged at any level
- Loggers:
Developer Tooling (#95)
- Path-scoped Copilot instructions for
context/androuting/
Full Changelog: v0.1.5...v0.1.6
v0.1.5 — MCP Structured Content & Output Schema
[0.1.5] - 2026-03-07
Added
- MCP structured content (
structuredContent) support — JSON output stored as artifact with facts extracted from top-level keys - MCP
outputSchemasupport for tool definitions;SelectableItemnow includesoutput_schemafield (#102) - MCP content types:
audio(base64-decoded binary artifact) andresource_link(URI reference asArtifactRef) - Per-part content
annotations(audience,priority) tracked inprovenance["content_annotations"] - PR template and YAML issue forms (
.github/)
Fixed
- Use
text/uri-listMIME forresource_linkbinaries payload - Use
validate=Truefor base64 decoding in image and audio parts - Add
isinstanceguard forstructuredContentfact extraction and per-part annotations - Use
is not Noneforoutput_schemachecks to preserve empty dict schemas - Set
resource_linksize_bytesto actual URI length - Widen
structured_contentannotation toAnyfor MCP spec compliance
Changed
- Extracted
_decode_binary_parthelper for image/audio binary decoding
v0.1.4 — Pluggable Summarizer & Extractor protocols
What's New
Added
Summarizerprotocol inprotocols.py— converts raw tool output into human/LLM-readable summariesExtractorprotocol inprotocols.py— extracts structured facts from raw tool output- Pluggable
summarizerandextractorparameters onapply_firewall()andapply_firewall_sync() ContextManagernow accepts optionalsummarizerandextractorat construction, wired throughbuild()/build_sync()
Fixed
infer_namespace()now guards against empty prefixes caused by leading separators (e.g..fooor/bar)
Full Changelog: v0.1.3...v0.1.4
v0.1.3 — Progressive disclosure for tool results
What's new
This release connects the existing progressive disclosure building blocks (ViewSpec, ArtifactStore.drilldown(), ResultEnvelope.views) into a complete agent-facing workflow. Agents can now receive structured view options for tool results and drill down into specific slices incrementally.
Added
ViewRegistryclass incontext/views.py— maps content-type patterns toViewSpecgenerators- Built-in view generators for
application/json,text/csv,text/plain, and binary/image content generate_views()function for auto-generatingViewSpecentries from artifact datadrilldown_tool_spec()helper — generates aSelectableItemexposing drilldown as an agent-callable toolContextManager.drilldown()/drilldown_sync()— agent-facing wrapper forArtifactStore.drilldown()with optional context injectionContextManager.view_registryproperty for accessing/extending the view registry- Auto-generated
ViewSpecentries duringingest_tool_result()(both large and small outputs) - Auto-generated
ViewSpecentries duringapply_firewall()via view registry - Content-type detection heuristics for generic
application/octet-streamartifacts - Small tool outputs now stored in artifact store with
artifact_reffor drilldown support
How it works
ingest_tool_result(data)
→ apply_firewall(data) → artifact_store.put() → ArtifactRef
→ view_registry.generate_views(ref, data) → list[ViewSpec]
→ attach views to ResultEnvelope
→ agent sees: summary + available views
agent calls: drilldown(handle, selector)
→ artifact_store.drilldown() → slice text
→ optionally inject into context as ContextItem
Test coverage
- 32 new view tests + 13 new manager drilldown/auto-view tests
- 480 tests total, all passing
- Full CI green: ruff format, ruff check, mypy, pytest
Closes #17
Full changelog: v0.1.2...v0.1.3
v0.1.2 - Development Workflow Improvements
Added
- Sensitivity enforcement in context pipeline: items at or above
ContextPolicy.sensitivity_floorare dropped or redacted ContextItem.sensitivityfield (default:Sensitivity.public)ContextPolicy.sensitivity_actionfield ("drop"or"redact")MaskRedactionHook— built-in redaction hook replacing text with[REDACTED: {sensitivity}]apply_sensitivity_filter()function incontext/sensitivity.pyregister_redaction_hook()for user-extensible redaction hooksBuildStats.dropped_reasons["sensitivity"]tracks sensitivity-dropped item count.pre-commit-config.yamlwith ruff format, ruff check --fix, and standard file hygiene hooks
Fixed
- Validate
sensitivity_actionto reject unknown values - Use accumulation pattern for
dropped_reasons["sensitivity"] - Adjust
total_candidatesfor sensitivity drops inBuildStats
v0.1.1
[0.1.1] - 2026-03-03
Added
Catalog.hydrate(tool_id)returns aHydrationResultwith full schema, examples, and constraintsHydrationResultdataclass inenvelope.pywithto_dict()/from_dict()ContextManager.build_call_prompt()/build_call_prompt_sync()forPhase.callprompts with schema injectionSelectableItem.examplesandSelectableItem.constraintsfieldsContextManager.ingest_mcp_result()/ingest_mcp_result_sync()for one-call MCP result ingestion with artifact persistence
Changed
- Breaking:
mcp_result_to_envelope()now returns(ResultEnvelope, dict, str)tuple — envelope, extracted binary data, and full untruncated text
v0.1.0
[0.1.0] - 2026-03-03
Added
- Full CLI implementation: all 7 subcommands (demo, build, route, print-tree, init, ingest, replay) with real handlers
- MCP adapter: mcp_tool_to_selectable, mcp_result_to_envelope, load_mcp_session_jsonl
- A2A adapter: a2a_agent_to_selectable, a2a_result_to_envelope, load_a2a_session_jsonl
- Sample JSONL session files: mcp_session.jsonl, a2a_session.jsonl
- before_after.py showpiece: side-by-side token comparison WITHOUT vs WITH contextweaver
- Comprehensive test_cli.py: subprocess tests for all 7 CLI commands
- Expanded conftest.py: store_bundle, sample_context_items, sample_selectable_items, large_catalog, sample_graph, context_manager, populated_manager fixtures
- Documentation: architecture.md, concepts.md, integration_mcp.md, integration_a2a.md
- Full README.md with installation, quick start, routing, CLI, examples, and development sections
Changed
- Version bumped to 0.1.0
- Makefile ci target now includes example and demo
- Example scripts updated: mcp_adapter_demo.py and a2a_adapter_demo.py now use real adapters
v0.0.4 — Adapters, Context Manager expansion & PR fixes
What's New
Adapters
- MCP adapter (
mcp.py): convert MCP tool manifests and JSONL session logs intoSelectableItemlists - A2A adapter (
a2a.py): convert A2A agent cards and JSONL session logs intoSelectableItemlists - Shared JSONL loader (
_common.py): unified_load_session_jsonl()helper used by both adapters
Context Manager
StoreBundleconstructor for pre-wired storesingest()/ingest_sync()/ingest_async()for event log appendsingest_tool_result()with firewall integration for large outputsadd_fact()/add_episode()for episodic and factual memory storesbuild_route_prompt()integrating Router + ChoiceCards + context pipeline- Episodic memory and facts injection into prompt header
budget_tokensoverride for per-call budget control
Bug Fixes
- Budget bypass (blocker): fact/episodic injection is now pre-built and subtracted from the effective budget; overhead recorded in
BuildStats.header_footer_tokens - Firewall media_type: reads
media_typefrom item metadata instead of hardcodingtext/plain - Unbounded fact injection: capped at 64 lines / 2,000 chars (
_MAX_FACT_LINES,_MAX_FACT_CHARS) - Tag deduplication: merged
query_tagsandhintsnow usesorted(set(…)) - JSONL field validation: non-dict rows and field conversion errors wrapped in
CatalogError - Version alignment:
pyproject.tomland__init__.pyboth report0.0.4
Housekeeping
- Removed 57 accidentally committed
tmpclaude-*temp files; added pattern to.gitignore - Moved inline
from typing import Literalto module level in both adapter files - Restored full
Args/Returnsdocstrings onbuild()andbuild_sync() - Clarified
ArtifactRefentries are metadata-only in adapter docstrings
Tests
- 391 tests passing, mypy clean (38 source files), ruff clean
- New tests for adapters, firewall, manager (fact capping, budget accounting, route prompt), envelope