Skip to content

Releases: dgenio/contextweaver

v0.1.3 — Progressive disclosure for tool results

05 Mar 06:26
v0.1.3
08e9b7b

Choose a tag to compare

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

  • ViewRegistry class in context/views.py — maps content-type patterns to ViewSpec generators
  • Built-in view generators for application/json, text/csv, text/plain, and binary/image content
  • generate_views() function for auto-generating ViewSpec entries from artifact data
  • drilldown_tool_spec() helper — generates a SelectableItem exposing drilldown as an agent-callable tool
  • ContextManager.drilldown() / drilldown_sync() — agent-facing wrapper for ArtifactStore.drilldown() with optional context injection
  • ContextManager.view_registry property for accessing/extending the view registry
  • Auto-generated ViewSpec entries during ingest_tool_result() (both large and small outputs)
  • Auto-generated ViewSpec entries during apply_firewall() via view registry
  • Content-type detection heuristics for generic application/octet-stream artifacts
  • Small tool outputs now stored in artifact store with artifact_ref for 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

04 Mar 07:07
v0.1.2
e3f9da2

Choose a tag to compare

Added

  • Sensitivity enforcement in context pipeline: items at or above ContextPolicy.sensitivity_floor are dropped or redacted
  • ContextItem.sensitivity field (default: Sensitivity.public)
  • ContextPolicy.sensitivity_action field ("drop" or "redact")
  • MaskRedactionHook — built-in redaction hook replacing text with [REDACTED: {sensitivity}]
  • apply_sensitivity_filter() function in context/sensitivity.py
  • register_redaction_hook() for user-extensible redaction hooks
  • BuildStats.dropped_reasons["sensitivity"] tracks sensitivity-dropped item count
  • .pre-commit-config.yaml with ruff format, ruff check --fix, and standard file hygiene hooks

Fixed

  • Validate sensitivity_action to reject unknown values
  • Use accumulation pattern for dropped_reasons["sensitivity"]
  • Adjust total_candidates for sensitivity drops in BuildStats

v0.1.1

03 Mar 06:16
v0.1.1
36f053b

Choose a tag to compare

[0.1.1] - 2026-03-03

Added

  • Catalog.hydrate(tool_id) returns a HydrationResult with full schema, examples, and constraints
  • HydrationResult dataclass in envelope.py with to_dict() / from_dict()
  • ContextManager.build_call_prompt() / build_call_prompt_sync() for Phase.call prompts with schema injection
  • SelectableItem.examples and SelectableItem.constraints fields
  • ContextManager.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

02 Mar 15:07
v0.1.0
616fb55

Choose a tag to compare

[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

02 Mar 10:55
v0.0.4
c36200b

Choose a tag to compare

What's New

Adapters

  • MCP adapter (mcp.py): convert MCP tool manifests and JSONL session logs into SelectableItem lists
  • A2A adapter (a2a.py): convert A2A agent cards and JSONL session logs into SelectableItem lists
  • Shared JSONL loader (_common.py): unified _load_session_jsonl() helper used by both adapters

Context Manager

  • StoreBundle constructor for pre-wired stores
  • ingest() / ingest_sync() / ingest_async() for event log appends
  • ingest_tool_result() with firewall integration for large outputs
  • add_fact() / add_episode() for episodic and factual memory stores
  • build_route_prompt() integrating Router + ChoiceCards + context pipeline
  • Episodic memory and facts injection into prompt header
  • budget_tokens override 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_type from item metadata instead of hardcoding text/plain
  • Unbounded fact injection: capped at 64 lines / 2,000 chars (_MAX_FACT_LINES, _MAX_FACT_CHARS)
  • Tag deduplication: merged query_tags and hints now use sorted(set(…))
  • JSONL field validation: non-dict rows and field conversion errors wrapped in CatalogError
  • Version alignment: pyproject.toml and __init__.py both report 0.0.4

Housekeeping

  • Removed 57 accidentally committed tmpclaude-* temp files; added pattern to .gitignore
  • Moved inline from typing import Literal to module level in both adapter files
  • Restored full Args/Returns docstrings on build() and build_sync()
  • Clarified ArtifactRef entries 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

v0.0.3

02 Mar 07:25
v0.0.3
76e3bce

Choose a tag to compare

What's New

Routing Engine (complete implementation)

  • Catalog: generate_sample_catalog, load_catalog_json, load_catalog_dicts with 8 namespace families (83 items)
  • KeywordLabeler: namespace detection and group summarization
  • ChoiceGraph: DAG with cycle detection, validation, save/load JSON, stats
  • TreeBuilder: 3 strategies — namespace grouping, Jaccard clustering, alphabetical fallback
  • Router: beam search with TF-IDF scoring, confidence gap, backtracking, debug trace
  • Cards: make_choice_cards() with budget/truncation, render_cards_text()
  • ChoiceCard: extended with kind, namespace, has_schema, score

Refactoring

  • Split graph.py into graph_node.py (ChoiceNode) and graph_io.py (save/load)
  • Topological sort uses heapq for O(log n) performance
  • Deterministic tie-breaking throughout (beam sort, namespace labeler)

Bug Fixes

  • Router backtrack threshold: was using beam_width (2) instead of top_k (20)
  • from_dict edge leak: cycle-causing edges now discarded before raising
  • Replaced assert with explicit RouteError guard in _score_node
  • Added missing from __future__ import annotations to all __init__.py
  • Removed dead item_kinds field from stats()
  • TreeBuilder validation guards for max_children and target_group_size
  • Cards: index tie-break in sort, max_desc_chars clamped to ≥4

Tests

  • 105 new routing tests (338 total)
  • mypy clean (37 source files), ruff clean

v0.0.2

01 Mar 18:00
v0.0.2
512c90d

Choose a tag to compare

What's Changed

Added

  • RuleBasedSummarizer: concrete summarizer implementation
  • StructuredExtractor: structured fact extraction (JSON, tabular, plain text)
  • TiktokenEstimator: token counting via tiktoken (optional) with model name support
  • EventLog: query(), children(), parent(), count(), tail() methods
  • ArtifactStore: exists(), metadata(), drilldown() selectors (head, lines, json_keys, rows)
  • EpisodicStore: latest(), delete() methods
  • FactStore: list_keys() method
  • Protocol declarations for all new EventLog and ArtifactStore methods
  • Comprehensive test coverage (255 tests)

Fixed

  • Version alignment: pyproject.toml now matches init.py
  • License alignment: pyproject.toml now uses Apache-2.0 (matches LICENSE file)
  • EventLog.query() defensive copy (was leaking internal list reference)
  • _EMAIL_RE regex: removed stray pipe from [A-Z|a-z] character class
  • mypy override for optional tiktoken dependency

v0.0.1 Initial Release

01 Mar 08:36
v0.0.1
5afc4ee

Choose a tag to compare

What's Changed

  • Create complete scaffolding for contextweaver Python library by @Copilot in #1

New Contributors

  • @Copilot made their first contribution in #1

Full Changelog: https://github.com/dgenio/contextweaver/commits/v0.0.1