feat: complete v0.1.0 implementation — CLI, examples, docs, data files#6
Merged
Conversation
- Full CLI: all 7 subcommands (demo, build, route, print-tree, init, ingest, replay) with real handlers - JSONL data files: mcp_session.jsonl (12 events, firewall trigger), a2a_session.jsonl (10 events, multi-agent) - Examples: mcp_adapter_demo.py, a2a_adapter_demo.py rewritten with real adapters; before_after.py showpiece (70% token reduction) - Tests: test_cli.py with subprocess tests for all 7 commands; conftest.py with 7 new fixtures (store_bundle, sample_context_items, sample_selectable_items, large_catalog, sample_graph, context_manager, populated_manager) - Docs: architecture.md, concepts.md, integration_mcp.md, integration_a2a.md filled out - README.md: full content with installation, quick start, routing, CLI, examples, development - Root files: version 0.1.0, CHANGELOG.md, Makefile ci target, CI workflow with examples+demo - All 397 tests pass, mypy clean, ruff clean, all examples run
There was a problem hiding this comment.
Pull request overview
This PR completes the v0.1.0 release work for contextweaver, expanding the CLI into a fully functional entrypoint, adding end-to-end examples + sample session data, and filling out the documentation to describe the library’s architecture and integrations.
Changes:
- Implemented real handlers for all 7 CLI subcommands and added subprocess-based CLI tests.
- Added MCP/A2A integration examples and sample JSONL session data.
- Expanded documentation (architecture/concepts/integrations) and bumped version to
0.1.0, updating CI to run examples + demo.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_cli.py | Adds subprocess tests covering all CLI subcommands, including ingest/firewall + replay. |
| tests/conftest.py | Adds many reusable fixtures for stores, catalogs/graphs, and a pre-populated ContextManager. |
| src/contextweaver/main.py | Replaces placeholder CLI with full implementations for demo/build/route/print-tree/init/ingest/replay. |
| src/contextweaver/init.py | Bumps package version to 0.1.0. |
| pyproject.toml | Bumps project version to 0.1.0. |
| examples/mcp_adapter_demo.py | Updates MCP example to use real adapter functions and session ingestion. |
| examples/a2a_adapter_demo.py | Updates A2A example to use real adapter functions and session ingestion. |
| examples/before_after.py | Adds a “WITHOUT vs WITH contextweaver” comparison script using ContextManager + budgets. |
| examples/data/mcp_session.jsonl | Adds a sample MCP session with a large tool result to trigger the firewall. |
| examples/data/a2a_session.jsonl | Adds a sample multi-agent A2A session with handoffs. |
| docs/integration_mcp.md | Adds MCP integration documentation and examples. |
| docs/integration_a2a.md | Adds A2A integration documentation and examples. |
| docs/concepts.md | Adds conceptual overview (ContextItem, phases, firewall, ChoiceGraph, etc.). |
| docs/architecture.md | Adds architecture/pipeline documentation and package layout. |
| README.md | Replaces minimal README with installation, quickstart, CLI, examples, and docs links. |
| Makefile | Extends ci target to run examples + demo. |
| CHANGELOG.md | Adds 0.1.0 changelog entry and notes release contents. |
| .github/workflows/ci.yml | Updates CI workflow to run make example and make demo. |
…ntegration docs - Add missing agent_name parameter to section header and code snippet - Fix envelope.status comment: 'success' -> 'ok' (matches actual mapping)
…manager fixture - add_fact requires (key, value): use proper key/value pairs - add_episode requires (episode_id, summary): add episode ID - Consistent with patterns in __main__.py demo command
…oring - Add --catalog required arg to 'route' subcommand - Load items via load_catalog_json instead of reconstructing from graph IDs - Replace dynamic __import__ with top-level SelectableItem import - Also clean up local import in _cmd_demo (use top-level import) - Update CLI tests: _make_graph returns (graph_path, catalog_path)
…ntegration docs - Add missing tool_name parameter to section header and code snippet - Fix envelope.status comment: 'success' -> 'ok' (matches actual mapping)
dgenio
added a commit
that referenced
this pull request
Apr 15, 2026
- Move routing_config to keyword-only position in Router.__init__ to preserve positional argument backward compatibility (#1) - Add two focused tests for routing_config override behavior in test_router.py (#2) - Document policy omission in ProfileConfig.to_dict()/from_dict() docstrings with Note: blocks (#3) - Use ContextBudget()/ScoringConfig() defaults in ProfileConfig.from_dict() instead of hardcoded literals to prevent drift (#4) - Add ConfigError to contextweaver.exceptions; replace bare ValueError in ProfileConfig.from_preset(); export ConfigError from __init__; update test_config.py to assert ConfigError (#5) - Fold answer_budget into _ROUTING_PRESETS tuple (6th element) to keep all preset data in a single structure (#6) - Merge duplicate ### Added sections in CHANGELOG.md into one (#7)
dgenio
pushed a commit
that referenced
this pull request
May 16, 2026
- benchmark_delta.py: render status-bearing matrix rows as "skipped" with the reason text instead of treating zeroed metrics as a real regression (Copilot #4). +2 tests. - benchmark.py: validate --backends against the supported set (tfidf, bm25, fuzzy) and exit with argparse-style code 2 on typos rather than a ConfigError traceback from Router init (Copilot #5). +2 tests. - sweep_scoring.py: drop the unreachable `if default_row is not None and not default_row.is_default: pass` branch in render_report() (Copilot #7). - benchmark.py: emit naive_delta.naive_tokens / cw_tokens as ints (counts), matching the NaiveDelta dataclass and avoiding the int(float(...)) coercion in renderers (Copilot #8). - README.md / CHANGELOG.md: matrix and per_namespace live at the top of latest.json, not nested under routing (Copilot #2, #3). Comments #1 (_DELIM_CHARS missing _) and #6 (sweep_scoring.py size) are non-actionable — #1 is a false positive (underscore is already present; verified by behavioural test on _foo_) and #6 follows the existing scripts/ precedent (render_scorecard.py = 526 lines) acknowledged in the PR description. make ci: all 6 targets clean. make scorecard-check + make llms-check also clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Completes all remaining gaps identified in the v0.1 audit, bringing contextweaver to a fully functional v0.1.0 release.
What changed
CLI (
__main__.py)demo,build,route,print-tree,init,ingest,replaydemoruns a full end-to-end demonstration of both enginesingestapplies the context firewall to large tool results (>2000 chars)replayre-builds context from a saved session with configurable phase/budgetData files
examples/data/mcp_session.jsonl— 12-event MCP session with a tool_result >2000 chars (triggers firewall)examples/data/a2a_session.jsonl— 10-event A2A session with multi-agent handoffs (Orchestrator → Data → Report agents)Examples
mcp_adapter_demo.py— rewritten to use real MCP adapters, session loading, firewall integrationa2a_adapter_demo.py— rewritten to use real A2A adapters, multi-agent session, projected contextbefore_after.py— showpiece: side-by-side comparison showing 70% token reduction (WITHOUT vs WITH contextweaver)Tests
test_cli.py— subprocess tests for all 7 CLI commands with temp files, firewall trigger test, replay testsconftest.py— 7 new fixtures:store_bundle,sample_context_items(9 items, all ItemKinds, parent_id pair, dedup pair),sample_selectable_items(30 items, 6 namespaces),large_catalog(80 items),sample_graph,context_manager,populated_managerDocumentation
architecture.md— package layout, pipeline stages, design principlesconcepts.md— ContextItem, phases, firewall, ChoiceGraph, episodic memoryintegration_mcp.md— adapter functions, JSONL format, end-to-end exampleintegration_a2a.md— adapter functions, multi-agent sessionsREADME.md— full content with installation, quick start, routing, CLI, examplesRoot files
0.1.0inpyproject.tomland__init__.pyCHANGELOG.mdupdated with 0.1.0 entryMakefileci target now includesexampleanddemoValidation
pytest -q)mypy src/)ruff check+ruff format)before_after.pyshows 70% token reduction