codebase-intel 0.2.0__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- codebase_intel-0.3.0/.codebase-intel/intent-journal/journal.jsonl +6 -0
- codebase_intel-0.3.0/.gitignore +52 -0
- codebase_intel-0.3.0/CHANGELOG.md +52 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/CLAUDE.md +25 -3
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/CONTRIBUTING.md +1 -1
- codebase_intel-0.3.0/HANDOFF.md +104 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/LICENSE +1 -1
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/PKG-INFO +163 -14
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/README.md +157 -9
- codebase_intel-0.3.0/docs/EVAL-RESULTS.md +71 -0
- codebase_intel-0.3.0/docs/TASK-LEDGER.md +223 -0
- codebase_intel-0.3.0/docs/V2-PLAN.md +185 -0
- codebase_intel-0.3.0/docs/intent-graph.html +1 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/launch/awesome_list_submissions.md +4 -4
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/launch/devto_article.md +3 -3
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/launch/hackernews.md +1 -1
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/launch/reddit_claudeai.md +1 -1
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/launch/reddit_python.md +1 -1
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/launch/x_thread.md +1 -1
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/pyproject.toml +12 -4
- codebase_intel-0.3.0/skills/codebase-intel/SKILL.md +89 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/__init__.py +1 -1
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/analytics/benchmark.py +60 -68
- codebase_intel-0.3.0/src/codebase_intel/analytics/eval.py +288 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/analytics/feedback.py +39 -22
- codebase_intel-0.3.0/src/codebase_intel/analytics/naive.py +49 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/analytics/tracker.py +68 -6
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/cli/main.py +494 -72
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/contracts/auto_generator.py +199 -129
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/contracts/evaluator.py +59 -62
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/contracts/models.py +28 -11
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/contracts/registry.py +9 -11
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/core/config.py +24 -6
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/core/exceptions.py +8 -14
- codebase_intel-0.3.0/src/codebase_intel/core/text.py +51 -0
- codebase_intel-0.3.0/src/codebase_intel/core/tokens.py +35 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/core/types.py +10 -12
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/crossrepo/models.py +6 -9
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/crossrepo/registry.py +51 -46
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/crossrepo/scanner.py +105 -86
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/decisions/miner.py +63 -38
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/decisions/models.py +9 -13
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/decisions/store.py +24 -25
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/drift/detector.py +121 -100
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/graph/builder.py +30 -16
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/graph/parser.py +193 -149
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/graph/query.py +8 -21
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/graph/storage.py +12 -14
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/intent/models.py +5 -5
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/intent/store.py +19 -11
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/intent/verifier.py +33 -21
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/__init__.py +64 -0
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/anchors.py +372 -0
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/bootstrap.py +179 -0
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/capture.py +240 -0
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/classifier.py +175 -0
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/gate.py +128 -0
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/journal.py +118 -0
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/migrate.py +183 -0
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/models.py +294 -0
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/render.py +163 -0
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/store.py +398 -0
- codebase_intel-0.3.0/src/codebase_intel/intentgraph/traversal.py +87 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/mcp/server.py +407 -88
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/orchestrator/assembler.py +80 -104
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/workspace/registry.py +2 -6
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/conftest.py +10 -7
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/integration/test_graph_pipeline.py +18 -54
- codebase_intel-0.3.0/tests/integration/test_intent_gate.py +138 -0
- codebase_intel-0.3.0/tests/unit/analytics/test_eval.py +183 -0
- codebase_intel-0.3.0/tests/unit/analytics/test_naive.py +42 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/contracts/test_evaluator.py +14 -42
- codebase_intel-0.3.0/tests/unit/core/test_text.py +22 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/core/test_types.py +22 -6
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/decisions/test_store.py +119 -47
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/drift/test_detector.py +86 -54
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/graph/test_parser.py +20 -64
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/graph/test_storage.py +17 -50
- codebase_intel-0.3.0/tests/unit/intentgraph/test_anchors.py +273 -0
- codebase_intel-0.3.0/tests/unit/intentgraph/test_bootstrap.py +196 -0
- codebase_intel-0.3.0/tests/unit/intentgraph/test_capture.py +146 -0
- codebase_intel-0.3.0/tests/unit/intentgraph/test_classifier.py +110 -0
- codebase_intel-0.3.0/tests/unit/intentgraph/test_journal.py +99 -0
- codebase_intel-0.3.0/tests/unit/intentgraph/test_migrate.py +157 -0
- codebase_intel-0.3.0/tests/unit/intentgraph/test_models.py +171 -0
- codebase_intel-0.3.0/tests/unit/intentgraph/test_render.py +134 -0
- codebase_intel-0.3.0/tests/unit/intentgraph/test_store.py +298 -0
- codebase_intel-0.3.0/tests/unit/intentgraph/test_traversal.py +118 -0
- codebase_intel-0.3.0/tests/unit/orchestrator/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/orchestrator/test_assembler.py +3 -9
- codebase_intel-0.3.0/tests/unit/test_version.py +20 -0
- codebase_intel-0.3.0/tests/unit/workspace/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/workspace/test_manager.py +2 -6
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/workspace/test_registry.py +7 -21
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/workspace/test_server_integration.py +6 -4
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/uv.lock +19 -1
- codebase_intel-0.2.0/.gitignore +0 -41
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/.codebase-intel/intents/INT-001.yaml +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/.codebase-intel/intents/INT-002.yaml +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/.codebase-intel/intents/INT-003.yaml +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/.github/workflows/ci.yml +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/.github/workflows/publish.yml +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/community-contracts/fastapi.yaml +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/community-contracts/nodejs-express.yaml +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/community-contracts/react-typescript.yaml +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/docs/COMPARISON.md +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/analytics/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/cli/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/contracts/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/core/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/crossrepo/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/decisions/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/drift/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/graph/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/intent/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/mcp/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/orchestrator/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/workspace/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/src/codebase_intel/workspace/manager.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/integration/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/__init__.py +0 -0
- {codebase_intel-0.2.0/tests/unit/contracts → codebase_intel-0.3.0/tests/unit/analytics}/__init__.py +0 -0
- {codebase_intel-0.2.0/tests/unit/core → codebase_intel-0.3.0/tests/unit/contracts}/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/contracts/test_models.py +0 -0
- {codebase_intel-0.2.0/tests/unit/decisions → codebase_intel-0.3.0/tests/unit/core}/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/core/test_exceptions.py +0 -0
- {codebase_intel-0.2.0/tests/unit/drift → codebase_intel-0.3.0/tests/unit/decisions}/__init__.py +0 -0
- {codebase_intel-0.2.0 → codebase_intel-0.3.0}/tests/unit/decisions/test_models.py +0 -0
- {codebase_intel-0.2.0/tests/unit/graph → codebase_intel-0.3.0/tests/unit/drift}/__init__.py +0 -0
- {codebase_intel-0.2.0/tests/unit/orchestrator → codebase_intel-0.3.0/tests/unit/graph}/__init__.py +0 -0
- {codebase_intel-0.2.0/tests/unit/workspace → codebase_intel-0.3.0/tests/unit/intentgraph}/__init__.py +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{"actor": "cli", "entry_id": "c75235b94d883dc3", "op": "add_node", "payload": {"anchors": [{"content_hash": null, "file_path": "/home/phoenix/Documents/playground/codebase-intel/src/codebase_intel/intentgraph/journal.py", "line_range": null, "symbol_name": null}, {"content_hash": null, "file_path": "/home/phoenix/Documents/playground/codebase-intel/src/codebase_intel/intentgraph/store.py", "line_range": null, "symbol_name": null}], "author": "human", "confidence": 1.0, "created_at": "2026-07-17T17:57:17.836420Z", "decision_id": null, "level": 3, "metadata": {}, "node_id": "4dad4394663a3ee1", "session": null, "source": "capture", "status": "active", "supersede_reason": null, "superseded_by": null, "tags": ["architecture"], "title": "Journal-first intent storage", "trust": "confirmed", "updated_at": "2026-07-17T17:57:17.836424Z", "why": "SQLite index is derived and rebuildable; the JSONL journal committed to git is the source of truth — crash-safety, portability, merge-friendliness"}, "ts": "2026-07-17T17:57:17.836528Z"}
|
|
2
|
+
{"actor": "cli", "entry_id": "c9bf75e21d4b0f5d", "op": "add_node", "payload": {"anchors": [{"content_hash": null, "file_path": "/home/phoenix/Documents/playground/codebase-intel/src/codebase_intel/intentgraph/gate.py", "line_range": null, "symbol_name": null}], "author": "human", "confidence": 1.0, "created_at": "2026-07-17T17:57:18.329111Z", "decision_id": null, "level": 3, "metadata": {}, "node_id": "6c89907cccd0d567", "session": null, "source": "capture", "status": "active", "supersede_reason": null, "superseded_by": null, "tags": ["capture"], "title": "Soft pre-commit gate by default", "trust": "confirmed", "updated_at": "2026-07-17T17:57:18.329116Z", "why": "A hard gate that blocks hotfixes gets uninstalled; soft mode warns and leaves a missing-why backlog node, hard mode is per-repo opt-in"}, "ts": "2026-07-17T17:57:18.329248Z"}
|
|
3
|
+
{"actor": "cli", "entry_id": "19e25c83c221c1c2", "op": "add_node", "payload": {"anchors": [{"content_hash": null, "file_path": "/home/phoenix/Documents/playground/codebase-intel/src/codebase_intel/intentgraph/models.py", "line_range": null, "symbol_name": null}], "author": "human", "confidence": 1.0, "created_at": "2026-07-17T17:57:18.799017Z", "decision_id": null, "level": 3, "metadata": {}, "node_id": "bf8c7774b6ad86ef", "session": null, "source": "capture", "status": "active", "supersede_reason": null, "superseded_by": null, "tags": ["trust"], "title": "Trust tiers surfaced everywhere", "trust": "confirmed", "updated_at": "2026-07-17T17:57:18.799022Z", "why": "A hallucinated why is worse than none — mined/derived/asserted/confirmed tiers appear in every rendered answer so agents can weigh belief"}, "ts": "2026-07-17T17:57:18.799121Z"}
|
|
4
|
+
{"actor": "honesty", "entry_id": "4345f164f5d49491", "op": "update_node", "payload": {"changes": {"anchors": [{"content_hash": "3c48a38271e70ea5", "file_path": "/home/phoenix/Documents/playground/codebase-intel/src/codebase_intel/intentgraph/journal.py", "line_range": null, "symbol_name": null}, {"content_hash": "4973465f9237c937", "file_path": "/home/phoenix/Documents/playground/codebase-intel/src/codebase_intel/intentgraph/store.py", "line_range": null, "symbol_name": null}]}, "node_id": "4dad4394663a3ee1"}, "ts": "2026-07-17T18:01:40.723012Z"}
|
|
5
|
+
{"actor": "honesty", "entry_id": "7ed94ef9d40e7393", "op": "update_node", "payload": {"changes": {"anchors": [{"content_hash": "8358c0e41997c035", "file_path": "/home/phoenix/Documents/playground/codebase-intel/src/codebase_intel/intentgraph/gate.py", "line_range": null, "symbol_name": null}]}, "node_id": "6c89907cccd0d567"}, "ts": "2026-07-17T18:01:40.728759Z"}
|
|
6
|
+
{"actor": "honesty", "entry_id": "92aad8529d3af2af", "op": "update_node", "payload": {"changes": {"anchors": [{"content_hash": "5b9e6e9b15bf8b83", "file_path": "/home/phoenix/Documents/playground/codebase-intel/src/codebase_intel/intentgraph/models.py", "line_range": null, "symbol_name": null}]}, "node_id": "bf8c7774b6ad86ef"}, "ts": "2026-07-17T18:01:40.732727Z"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
*.egg-info/
|
|
7
|
+
*.egg
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
.eggs/
|
|
11
|
+
|
|
12
|
+
# Virtual environments
|
|
13
|
+
.venv/
|
|
14
|
+
venv/
|
|
15
|
+
env/
|
|
16
|
+
|
|
17
|
+
# IDE
|
|
18
|
+
.idea/
|
|
19
|
+
.vscode/
|
|
20
|
+
*.swp
|
|
21
|
+
*.swo
|
|
22
|
+
*~
|
|
23
|
+
|
|
24
|
+
# Testing
|
|
25
|
+
.coverage
|
|
26
|
+
htmlcov/
|
|
27
|
+
.pytest_cache/
|
|
28
|
+
.mypy_cache/
|
|
29
|
+
|
|
30
|
+
# OS
|
|
31
|
+
.DS_Store
|
|
32
|
+
Thumbs.db
|
|
33
|
+
|
|
34
|
+
# Project runtime data (generated by codebase-intel itself)
|
|
35
|
+
.codebase-intel/graph.db
|
|
36
|
+
.codebase-intel/graph.db-wal
|
|
37
|
+
.codebase-intel/graph.db-shm
|
|
38
|
+
# Intent graph: the SQLite index is derived and rebuildable — the journal (JSONL) IS committed
|
|
39
|
+
.codebase-intel/intent-graph.db
|
|
40
|
+
.codebase-intel/intent-graph.db-wal
|
|
41
|
+
.codebase-intel/intent-graph.db-shm
|
|
42
|
+
# Analytics/benchmark/eval history — local telemetry, not project state
|
|
43
|
+
.codebase-intel/analytics.db
|
|
44
|
+
.codebase-intel/analytics.db-wal
|
|
45
|
+
.codebase-intel/analytics.db-shm
|
|
46
|
+
.codebase-intel/feedback.db
|
|
47
|
+
.codebase-intel/feedback.db-wal
|
|
48
|
+
.codebase-intel/feedback.db-shm
|
|
49
|
+
|
|
50
|
+
# Environment
|
|
51
|
+
.env
|
|
52
|
+
.env.*
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and the project uses
|
|
5
|
+
[Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [0.3.0] — 2026-10-23
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **Intent graph (v2).** A multi-level "why" layer. `.codebase-intel/intent-journal/*.jsonl` is the
|
|
12
|
+
committed source of truth, and `intent-graph.db` is a rebuildable, git-ignored index. Nodes
|
|
13
|
+
carry trust tiers (`mined` → `derived` → `asserted` → `confirmed`) and four abstraction levels.
|
|
14
|
+
- MCP tools: `bootstrap`, `check_precedent`, `record_why`, `get_intent`. The server now exposes 16 tools.
|
|
15
|
+
- CLI: `why`, `intent-gate`, `install-hooks`, `intent-check`, `intent-confirm`, `intent-render`,
|
|
16
|
+
`intent-migrate`, `intent-rebuild`, `intent-eval`.
|
|
17
|
+
- Pre-commit intent gate that warns (or blocks, with `intentgraph.gate_hard`) on structural
|
|
18
|
+
changes with no recorded why.
|
|
19
|
+
- Anchor repair and re-anchoring when code moves; divergence, conflict and coverage reporting.
|
|
20
|
+
- Human projection of the intent graph as HTML or Mermaid.
|
|
21
|
+
- Safe, re-runnable migration of v1 decision records into the intent graph.
|
|
22
|
+
- Eval harness (`intent-eval`) measuring token cost and retrieval correctness against the v1
|
|
23
|
+
baseline. Self-hosted results and caveats are in `docs/EVAL-RESULTS.md`.
|
|
24
|
+
- Agent skill at `skills/codebase-intel/SKILL.md` that tells agents when to call the intent tools.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
|
|
28
|
+
- The package version now comes from `codebase_intel.__version__`, and `get_status` reports
|
|
29
|
+
it. Before this, three version strings had drifted apart: `0.1.0`, `0.2.0` and `0.2.0`.
|
|
30
|
+
- Project URLs in the package metadata now point to the actual GitHub repository.
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- Removed all pre-existing ruff and mypy errors in the v1 modules.
|
|
35
|
+
|
|
36
|
+
## [0.2.0] — 2026-04-09
|
|
37
|
+
|
|
38
|
+
### Added
|
|
39
|
+
|
|
40
|
+
- Global workspace manager: one MCP server for every registered project (`serve --auto`).
|
|
41
|
+
- Intent tracking (`set_intent`, `check_intent`, `list_intents`) with machine-verifiable
|
|
42
|
+
acceptance criteria.
|
|
43
|
+
- Cross-repo awareness across 14 web frameworks in 10 languages.
|
|
44
|
+
- Feedback loop and efficiency reporting.
|
|
45
|
+
|
|
46
|
+
## [0.1.0]
|
|
47
|
+
|
|
48
|
+
- Initial release: code graph, decision journal, quality contracts, drift detection, MCP server, CLI.
|
|
49
|
+
|
|
50
|
+
[0.3.0]: https://github.com/a-mutharasu/codebase-intel/compare/v0.2.0...v0.3.0
|
|
51
|
+
[0.2.0]: https://github.com/a-mutharasu/codebase-intel/compare/v0.1.0...v0.2.0
|
|
52
|
+
[0.1.0]: https://github.com/a-mutharasu/codebase-intel/releases/tag/v0.1.0
|
|
@@ -56,6 +56,9 @@ src/codebase_intel/
|
|
|
56
56
|
├── contracts/ # models.py, parser.py, evaluator.py, registry.py
|
|
57
57
|
├── orchestrator/ # assembler.py, budget.py, scorer.py, conflict.py
|
|
58
58
|
├── drift/ # detector.py, reporter.py
|
|
59
|
+
├── intentgraph/ # v2 core: models, journal (JSONL truth), store (SQLite index),
|
|
60
|
+
│ # capture, classifier, gate, traversal, bootstrap, anchors,
|
|
61
|
+
│ # render, migrate — the multi-level intent graph
|
|
59
62
|
├── workspace/ # manager.py, registry.py — global multi-project workspace
|
|
60
63
|
├── crossrepo/ # models.py, scanner.py, registry.py — cross-service deps
|
|
61
64
|
├── analytics/ # tracker.py, benchmark.py, feedback.py
|
|
@@ -64,6 +67,9 @@ src/codebase_intel/
|
|
|
64
67
|
└── cli/ # main.py
|
|
65
68
|
```
|
|
66
69
|
|
|
70
|
+
Outside `src/`: `skills/codebase-intel/SKILL.md` is the agent skill (portable frontmatter only:
|
|
71
|
+
name, description, license, compatibility). `CHANGELOG.md` records releases.
|
|
72
|
+
|
|
67
73
|
## Key Commands
|
|
68
74
|
- `ruff check src/ tests/` — Lint
|
|
69
75
|
- `ruff format src/ tests/` — Format
|
|
@@ -81,7 +87,23 @@ src/codebase_intel/
|
|
|
81
87
|
- Content hashing via xxhash for change detection
|
|
82
88
|
- ISO 8601 for all timestamps, UTC timezone
|
|
83
89
|
|
|
90
|
+
## Intent Graph (v2)
|
|
91
|
+
- Journal-first: `.codebase-intel/intent-journal/*.jsonl` is committed source of truth;
|
|
92
|
+
`intent-graph.db` is a derived, rebuildable index (git-ignored)
|
|
93
|
+
- Trust tiers: mined → derived → asserted (agent) → confirmed (human) — surfaced in every render
|
|
94
|
+
- MCP tools: record_why, check_precedent, bootstrap, get_intent
|
|
95
|
+
- CLI: why, intent-gate, install-hooks, intent-check, intent-confirm, intent-render,
|
|
96
|
+
intent-migrate, intent-rebuild, intent-eval
|
|
97
|
+
- Degradation ladder everywhere: intent graph → code graph → raw files, never hard-fail
|
|
98
|
+
- Eval harness (T-006): `codebase-intel intent-eval <repo...>` — token AND correctness
|
|
99
|
+
A/B (accuracy@1/@3, naive-vs-citation token reduction) vs the v1 baseline. See
|
|
100
|
+
docs/EVAL-RESULTS.md for methodology and this repo's self-hosted numbers.
|
|
101
|
+
- See docs/V2-PLAN.md (requirements/design) and docs/TASK-LEDGER.md (state)
|
|
102
|
+
|
|
84
103
|
## Current Focus
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
|
|
104
|
+
- v0.3.0 release prep (intent graph + agent skill) on `chore/release-0.3.0`; version is
|
|
105
|
+
single-sourced from `codebase_intel.__version__` via `[tool.hatch.version]`
|
|
106
|
+
(release = GitHub Release → `publish.yml` → PyPI)
|
|
107
|
+
- v2 intent graph: Phases 0–5 + eval harness shipped (see TASK-LEDGER)
|
|
108
|
+
- Next: eval harness needs 2–3 external production repos for a broader A/B (T-006
|
|
109
|
+
remains open for that), team layer depth, pre-existing coverage debt (T-008)
|
|
@@ -5,7 +5,7 @@ Thanks for wanting to help. Here's how to get started.
|
|
|
5
5
|
## Setup
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
git clone https://github.com/
|
|
8
|
+
git clone https://github.com/a-mutharasu/codebase-intel.git
|
|
9
9
|
cd codebase-intel
|
|
10
10
|
uv sync --dev # or: pip install -e ".[dev]"
|
|
11
11
|
```
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Handoff — codebase-intel v2 (Intent Graph)
|
|
2
|
+
|
|
3
|
+
Last updated: 2026-07-18 · Branch: `main` · For the next session (human or agent)
|
|
4
|
+
## Read this first
|
|
5
|
+
|
|
6
|
+
1. This file (5 min) — orientation and where things stand
|
|
7
|
+
2. `docs/V2-PLAN.md` — the requirements analysis and phased plan this work follows
|
|
8
|
+
3. `docs/TASK-LEDGER.md` — the authoritative, up-to-date task state (source of truth,
|
|
9
|
+
supersedes anything below if they disagree)
|
|
10
|
+
|
|
11
|
+
## What this is
|
|
12
|
+
|
|
13
|
+
`codebase-intel` v1 gives AI agents structured code-graph context, a decision journal,
|
|
14
|
+
and quality contracts. v2 (this work) adds an **intent graph**: a multi-level "why" layer
|
|
15
|
+
captured at decision time, so agents traverse recorded reasoning instead of re-reading
|
|
16
|
+
files and re-deciding things that were already decided. See `docs/V2-PLAN.md` for the
|
|
17
|
+
full functional/non-functional requirements and the resilience design.
|
|
18
|
+
|
|
19
|
+
## State right now
|
|
20
|
+
|
|
21
|
+
All of v2 Phases 0–5 are built, tested, and merged to `main`. Plus a chore pass that
|
|
22
|
+
eliminated all pre-existing v1 ruff/mypy debt. Concretely:
|
|
23
|
+
|
|
24
|
+
| Phase | What | Status |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| 0 | Intent graph foundation — journal-first store (JSONL truth + rebuildable SQLite index), trust tiers, v1→v2 migration | done |
|
|
27
|
+
| 1 | Capture loop — `record_why`, `check_precedent`, pre-commit gate, significance classifier | done |
|
|
28
|
+
| 2 | Traversal + session bootstrap with a mandatory degradation ladder | done |
|
|
29
|
+
| 3 | Honesty machinery — anchor repair/re-anchoring, staleness, conflicts, coverage | done |
|
|
30
|
+
| 5 | Human projection (Mermaid/HTML render) + review promotion (asserted→confirmed) | done |
|
|
31
|
+
| 4 (T-006) | Eval harness — token AND correctness A/B | **blocked**, see below |
|
|
32
|
+
| — (T-008) | v1 lint/type/coverage debt | ruff+mypy done; coverage gate still open |
|
|
33
|
+
|
|
34
|
+
913 tests passing, `ruff check`/`ruff format --check`/`mypy src/` all clean on `main`.
|
|
35
|
+
|
|
36
|
+
### What's genuinely unfinished
|
|
37
|
+
|
|
38
|
+
- **T-006 (eval harness) is blocked, not done.** The harness itself
|
|
39
|
+
(`analytics/eval.py`, CLI `codebase-intel intent-eval`) is code-complete and verified
|
|
40
|
+
end-to-end — it ran against this repo and produced real numbers
|
|
41
|
+
(`docs/EVAL-RESULTS.md`: 100% accuracy@1/@3, 99% token reduction, n=3 cases, self-hosted
|
|
42
|
+
only). The task's actual bar ("real repos," plural, vs v1 baseline) needs 2+ external
|
|
43
|
+
production repos. The CLI already accepts multiple paths
|
|
44
|
+
(`codebase-intel intent-eval repo-a repo-b repo-c`) — no more code is needed, just repos
|
|
45
|
+
to point it at. **This is the most concrete unblock a human can hand over.**
|
|
46
|
+
- **T-008 (v1 coverage debt) is in-progress.** `ruff` (222→0) and `mypy` (33→0) errors are
|
|
47
|
+
fully fixed. The `pytest` 90% coverage gate still fails (~45% project-wide) because large
|
|
48
|
+
v1 modules have zero dedicated unit tests: `mcp/server.py` (~5%), `graph/query.py` (0%),
|
|
49
|
+
`intent/*.py` (0%), `crossrepo/*.py` (0%), `decisions/miner.py` (0%). This is a
|
|
50
|
+
substantially larger effort (writing tests for existing untested v1 code) than the
|
|
51
|
+
lint/type fixes were — treat it as its own project, not a quick follow-on. Until it's
|
|
52
|
+
addressed, run tests with `pytest --no-cov` or expect the coverage gate to fail even
|
|
53
|
+
though every test passes.
|
|
54
|
+
|
|
55
|
+
## How to verify the repo is healthy
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
uv sync --extra dev
|
|
59
|
+
uv run ruff check src/ tests/ # should be clean
|
|
60
|
+
uv run ruff format --check src/ tests/ # should be clean
|
|
61
|
+
uv run mypy src/ # should be clean
|
|
62
|
+
uv run pytest --no-cov -q # 913 passed
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## How to explore what v2 built
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
codebase-intel why "<title>" "<reason>" -f <file> # record a why
|
|
69
|
+
codebase-intel intent-gate # pre-commit gate (also installable: install-hooks)
|
|
70
|
+
codebase-intel intent-check # anchor validation/repair report
|
|
71
|
+
codebase-intel intent-render -f html -o out.html # human-readable graph
|
|
72
|
+
codebase-intel intent-eval <repo...> # token+correctness eval (T-006)
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Or via MCP tools: `record_why`, `check_precedent`, `bootstrap`, `get_intent`.
|
|
76
|
+
|
|
77
|
+
This repo dogfoods its own intent graph — `.codebase-intel/intent-journal/journal.jsonl`
|
|
78
|
+
is committed and has real entries from this session's own work (see git history on that
|
|
79
|
+
path). `docs/intent-graph.html` is a static render of it.
|
|
80
|
+
|
|
81
|
+
## Working conventions this session used (carry these forward)
|
|
82
|
+
|
|
83
|
+
- One feature branch per phase (`feature/v2-phaseN-...`), squash of work, merge
|
|
84
|
+
`--ff-only` to `main` after full verification (ruff + mypy + full test suite).
|
|
85
|
+
- `docs/TASK-LEDGER.md` is updated at claim-time (status → in-progress, owner, touched)
|
|
86
|
+
and at completion (status → done/blocked, a dated Decisions entry explaining what
|
|
87
|
+
passed/what didn't and why) — read it before trusting any status claim here, this file
|
|
88
|
+
is a snapshot and will go stale.
|
|
89
|
+
- Commits in this session were made **without** a Co-Authored-By trailer, per explicit
|
|
90
|
+
user instruction — continue that unless told otherwise.
|
|
91
|
+
- Don't mark a ledger task `done` if its literal Verify bar isn't met — T-006 is the
|
|
92
|
+
example: the harness works, but "done" would overclaim a multi-repo A/B that hasn't
|
|
93
|
+
happened yet. `blocked` was used instead, with what's built vs what's missing spelled
|
|
94
|
+
out.
|
|
95
|
+
|
|
96
|
+
## Suggested next steps (not mandated — use judgment)
|
|
97
|
+
|
|
98
|
+
1. If you have other repos handy: `codebase-intel init` in them, capture a few real
|
|
99
|
+
`why`s, then `codebase-intel intent-eval` across all of them for T-006's real bar.
|
|
100
|
+
2. Otherwise: pick up T-008's coverage debt, module by module (mcp/server.py and
|
|
101
|
+
graph/query.py are the biggest zero-coverage gaps).
|
|
102
|
+
3. Team-layer depth (multi-user review queues, ownership UI, access control) was
|
|
103
|
+
deliberately deferred in Phase 5 — `capture.promote()` + owner metadata is the seed if
|
|
104
|
+
that becomes a priority.
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: codebase-intel
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Your AI agent writes code — but does it know WHY your code exists? Decision provenance, quality contracts, and AI anti-pattern detection for coding agents.
|
|
5
|
-
Project-URL: Homepage, https://github.com/mutharasu/codebase-intel
|
|
6
|
-
Project-URL: Repository, https://github.com/mutharasu/codebase-intel
|
|
7
|
-
Project-URL: Issues, https://github.com/mutharasu/codebase-intel/issues
|
|
5
|
+
Project-URL: Homepage, https://github.com/a-mutharasu/codebase-intel
|
|
6
|
+
Project-URL: Repository, https://github.com/a-mutharasu/codebase-intel
|
|
7
|
+
Project-URL: Issues, https://github.com/a-mutharasu/codebase-intel/issues
|
|
8
8
|
Author: Mutharasu
|
|
9
9
|
License-Expression: MIT
|
|
10
10
|
License-File: LICENSE
|
|
@@ -40,6 +40,7 @@ Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
|
|
|
40
40
|
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
41
41
|
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
42
42
|
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
43
|
+
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
|
|
43
44
|
Provides-Extra: eval
|
|
44
45
|
Requires-Dist: matplotlib>=3.7; extra == 'eval'
|
|
45
46
|
Description-Content-Type: text/markdown
|
|
@@ -51,11 +52,12 @@ Description-Content-Type: text/markdown
|
|
|
51
52
|
</p>
|
|
52
53
|
|
|
53
54
|
<p align="center">
|
|
54
|
-
<a href="https://github.com/
|
|
55
|
+
<a href="https://github.com/a-mutharasu/codebase-intel/stargazers"><img src="https://img.shields.io/github/stars/a-mutharasu/codebase-intel?style=flat-square" alt="Stars"></a>
|
|
55
56
|
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-green.svg?style=flat-square" alt="MIT"></a>
|
|
56
57
|
<a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.11+-blue.svg?style=flat-square" alt="Python 3.11+"></a>
|
|
57
58
|
<a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-compatible-purple.svg?style=flat-square" alt="MCP"></a>
|
|
58
59
|
<a href="#19-languages"><img src="https://img.shields.io/badge/languages-19-orange.svg?style=flat-square" alt="19 Languages"></a>
|
|
60
|
+
<a href="https://pypi.org/project/codebase-intel/"><img src="https://img.shields.io/pypi/v/codebase-intel?style=flat-square" alt="PyPI"></a>
|
|
59
61
|
</p>
|
|
60
62
|
|
|
61
63
|
---
|
|
@@ -135,7 +137,12 @@ Code → Graph → Agent Code → Graph ───────────
|
|
|
135
137
|
## Quick Start
|
|
136
138
|
|
|
137
139
|
```bash
|
|
138
|
-
|
|
140
|
+
# Install globally (no venv needed)
|
|
141
|
+
uvx codebase-intel --help # ephemeral, like npx
|
|
142
|
+
# or
|
|
143
|
+
pipx install codebase-intel # persistent global install
|
|
144
|
+
# or
|
|
145
|
+
pip install codebase-intel # traditional
|
|
139
146
|
|
|
140
147
|
# Initialize on your project
|
|
141
148
|
cd your-project
|
|
@@ -147,6 +154,9 @@ codebase-intel status
|
|
|
147
154
|
# Mine decisions from git history
|
|
148
155
|
codebase-intel mine --save
|
|
149
156
|
|
|
157
|
+
# Auto-detect code patterns and generate quality contracts
|
|
158
|
+
codebase-intel detect-patterns --save
|
|
159
|
+
|
|
150
160
|
# Run benchmarks (see the before/after)
|
|
151
161
|
codebase-intel benchmark
|
|
152
162
|
|
|
@@ -154,8 +164,9 @@ codebase-intel benchmark
|
|
|
154
164
|
codebase-intel dashboard
|
|
155
165
|
```
|
|
156
166
|
|
|
157
|
-
### Connect to Claude Code
|
|
167
|
+
### Connect to Claude Code / any MCP client
|
|
158
168
|
|
|
169
|
+
**Single project:**
|
|
159
170
|
```json
|
|
160
171
|
{
|
|
161
172
|
"mcpServers": {
|
|
@@ -167,6 +178,27 @@ codebase-intel dashboard
|
|
|
167
178
|
}
|
|
168
179
|
```
|
|
169
180
|
|
|
181
|
+
**Multiple projects (global mode):**
|
|
182
|
+
```bash
|
|
183
|
+
# Register repos once from anywhere
|
|
184
|
+
codebase-intel register ~/projects/user-service
|
|
185
|
+
codebase-intel register /opt/services/payment-api
|
|
186
|
+
codebase-intel register /var/repos/notification-service
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
```json
|
|
190
|
+
{
|
|
191
|
+
"mcpServers": {
|
|
192
|
+
"codebase-intel": {
|
|
193
|
+
"command": "uvx",
|
|
194
|
+
"args": ["codebase-intel", "serve", "--auto"]
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
In `--auto` mode, the MCP server automatically routes each request to the correct project based on file paths in the request. No manual switching — works like `npx @playwright/mcp`.
|
|
201
|
+
|
|
170
202
|
Now your agent automatically gets relevant context, decisions, and contracts before writing code.
|
|
171
203
|
|
|
172
204
|
---
|
|
@@ -263,17 +295,41 @@ Full tree-sitter parsing via [tree-sitter-language-pack](https://github.com/nico
|
|
|
263
295
|
## CLI Commands
|
|
264
296
|
|
|
265
297
|
```bash
|
|
298
|
+
# Core
|
|
266
299
|
codebase-intel init [path] # Initialize — build graph, create configs
|
|
267
300
|
codebase-intel analyze [--incremental] # Rebuild or update the code graph
|
|
268
301
|
codebase-intel mine [--save] # Mine git history for decision candidates
|
|
302
|
+
codebase-intel detect-patterns [--save] # Auto-detect code patterns → quality contracts
|
|
269
303
|
codebase-intel drift # Run drift detection
|
|
270
304
|
codebase-intel benchmark # Measure token efficiency (before/after)
|
|
271
305
|
codebase-intel dashboard # Live efficiency tracking over time
|
|
272
|
-
codebase-intel serve
|
|
306
|
+
codebase-intel serve [path] # Start MCP server (single project)
|
|
273
307
|
codebase-intel status # Component health check
|
|
308
|
+
codebase-intel intent [--verify] # Track and verify delivery goals
|
|
309
|
+
|
|
310
|
+
# Global workspace (multi-project)
|
|
311
|
+
codebase-intel register <path> # Register a project globally
|
|
312
|
+
codebase-intel unregister <id> # Remove from global registry
|
|
313
|
+
codebase-intel projects # List all registered projects
|
|
314
|
+
codebase-intel serve --auto # Start MCP server for ALL registered projects
|
|
315
|
+
|
|
316
|
+
# Cross-repo (microservices)
|
|
317
|
+
codebase-intel crossrepo <paths...> # Scan repos for cross-service dependencies
|
|
318
|
+
codebase-intel crossrepo --all # Scan all registered projects
|
|
319
|
+
|
|
320
|
+
# Intent graph (v0.3)
|
|
321
|
+
codebase-intel why "<title>" "<reason>" -f <file> # Record a why (confirmed trust)
|
|
322
|
+
codebase-intel install-hooks # Install the pre-commit intent gate
|
|
323
|
+
codebase-intel intent-gate # Run the gate manually
|
|
324
|
+
codebase-intel intent-check # Repair moved anchors, flag drift, report coverage
|
|
325
|
+
codebase-intel intent-confirm <node-id> # Promote an agent-asserted why to confirmed
|
|
326
|
+
codebase-intel intent-render -f html -o intent.html # Human view (html | mermaid)
|
|
327
|
+
codebase-intel intent-migrate # Import v1 decisions into the intent graph
|
|
328
|
+
codebase-intel intent-rebuild # Rebuild the SQLite index from the journal
|
|
329
|
+
codebase-intel intent-eval [repos...] # Token + correctness A/B vs the v1 baseline
|
|
274
330
|
```
|
|
275
331
|
|
|
276
|
-
## MCP Tools (
|
|
332
|
+
## MCP Tools (16 tools)
|
|
277
333
|
|
|
278
334
|
| Tool | What it does |
|
|
279
335
|
|---|---|
|
|
@@ -284,6 +340,15 @@ codebase-intel status # Component health check
|
|
|
284
340
|
| `check_drift` | Verify context freshness before trusting old decisions. |
|
|
285
341
|
| `impact_analysis` | "What breaks if I change this file?" |
|
|
286
342
|
| `get_status` | Health check — graph stats, decision count, contract count. |
|
|
343
|
+
| `record_feedback` | Record if AI output was accepted/rejected — powers the learning loop. |
|
|
344
|
+
| `get_efficiency_report` | Live token savings, acceptance rate, before/after proof. |
|
|
345
|
+
| `set_intent` | Capture what the user wants with machine-verifiable acceptance criteria. |
|
|
346
|
+
| `check_intent` | Verify if acceptance criteria are actually met before marking done. |
|
|
347
|
+
| `list_intents` | Show all tracked intents with completion status. |
|
|
348
|
+
| `bootstrap` | **Call first in a session.** System orientation + task-relevant whys, packed into a token budget. |
|
|
349
|
+
| `check_precedent` | Was this already decided — or decided and reversed? Call before structural choices. |
|
|
350
|
+
| `record_why` | Record why a structural decision was made, at the moment it's made. |
|
|
351
|
+
| `get_intent` | Traverse the intent graph by node, file, or abstraction level; no args = coverage stats. |
|
|
287
352
|
|
|
288
353
|
---
|
|
289
354
|
|
|
@@ -303,10 +368,89 @@ cp community-contracts/fastapi.yaml .codebase-intel/contracts/
|
|
|
303
368
|
|
|
304
369
|
---
|
|
305
370
|
|
|
371
|
+
## New in v0.3.0 — the Intent Graph
|
|
372
|
+
|
|
373
|
+
v0.2 could tell an agent *what* decisions exist. v0.3 captures **why** at the moment a decision is made, and lets agents traverse that reasoning instead of re-reading files and re-deciding things that were already decided.
|
|
374
|
+
|
|
375
|
+
- **Journal-first.** `.codebase-intel/intent-journal/*.jsonl` is the committed source of truth; `intent-graph.db` is a derived, git-ignored index you can always rebuild (`intent-rebuild`).
|
|
376
|
+
- **Four abstraction levels** — system topology → service/module → component/flow → function/decision — linked with parent/child and `supersedes` edges.
|
|
377
|
+
- **Trust tiers, surfaced everywhere:** `mined` (from git) → `derived` → `asserted` (by an agent) → `confirmed` (by a human, via `intent-confirm`). Agents see which whys a human has actually vouched for.
|
|
378
|
+
- **Capture loop.** Agents call `record_why` when they make a structural choice and `check_precedent` before they make one. A pre-commit gate (`install-hooks`) warns — or blocks, with `gate_hard` — on structural changes that have no recorded why.
|
|
379
|
+
- **Session bootstrap.** `bootstrap(task)` returns top-level orientation plus the relevant whys within a token budget, with a degradation ladder: intent graph → code graph → raw files. It never hard-fails.
|
|
380
|
+
- **Anchor honesty.** `intent-check` re-anchors whys when code moves, flags whys whose code diverged, and reports conflicts and coverage.
|
|
381
|
+
- **Human projection.** `intent-render` produces an HTML or Mermaid view of the same graph for review.
|
|
382
|
+
- **v1 migration.** `intent-migrate` imports existing decision records. It's safe to re-run.
|
|
383
|
+
- **Eval harness.** `intent-eval` measures token cost *and* retrieval correctness against the v1 baseline. First self-hosted result: accuracy@1 100%, ~99% fewer tokens than a naive file read — on **n=3** cases from this repo only. See [docs/EVAL-RESULTS.md](docs/EVAL-RESULTS.md) for methodology and caveats; external-repo numbers are still to come.
|
|
384
|
+
|
|
385
|
+
```bash
|
|
386
|
+
pip install -U codebase-intel
|
|
387
|
+
codebase-intel intent-migrate # bring v1 decisions along
|
|
388
|
+
codebase-intel install-hooks # start capturing whys at commit time
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
An agent skill that tells Claude Code (and other agents) when to call these tools ships in [`skills/codebase-intel/SKILL.md`](skills/codebase-intel/SKILL.md).
|
|
392
|
+
Install it for Claude Code with:
|
|
393
|
+
|
|
394
|
+
```bash
|
|
395
|
+
mkdir -p ~/.claude/skills/codebase-intel
|
|
396
|
+
curl -fsSL https://raw.githubusercontent.com/a-mutharasu/codebase-intel/main/skills/codebase-intel/SKILL.md \
|
|
397
|
+
-o ~/.claude/skills/codebase-intel/SKILL.md
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
## New in v0.2.0
|
|
401
|
+
|
|
402
|
+
### Global Workspace — One server, all your projects
|
|
403
|
+
|
|
404
|
+
No more running a separate MCP server per project. Register your repos once, serve them all:
|
|
405
|
+
|
|
406
|
+
```bash
|
|
407
|
+
codebase-intel register ~/projects/user-service
|
|
408
|
+
codebase-intel register /opt/services/payment-api
|
|
409
|
+
codebase-intel serve --auto
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
The server auto-routes each request to the correct project based on file paths. LRU cache keeps the 5 most recently used projects loaded — older ones are evicted and reloaded on demand.
|
|
413
|
+
|
|
414
|
+
### Intent Tracking — "Did you actually build what was requested?"
|
|
415
|
+
|
|
416
|
+
AI agents say "done" when the code compiles. But did they actually deliver what was asked? Intent tracking captures goals with **machine-verifiable** acceptance criteria:
|
|
417
|
+
|
|
418
|
+
```bash
|
|
419
|
+
# Agent sets intent at task start (via MCP tool set_intent)
|
|
420
|
+
# Agent works on the task...
|
|
421
|
+
# Before marking done, agent calls check_intent
|
|
422
|
+
# System runs automated checks: file_exists, function_exists, grep_match, test_passes...
|
|
423
|
+
# Returns: 18/21 criteria met — 3 gaps identified
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
11 verification types: `file_exists`, `file_contains`, `function_exists`, `wired`, `cli_works`, `mcp_tool_exists`, `grep_match`, `grep_no_match`, `test_passes`, `custom`, `manual`.
|
|
427
|
+
|
|
428
|
+
### Cross-Repo Awareness — Microservice dependency mapping
|
|
429
|
+
|
|
430
|
+
Scans 14 web frameworks across 10 languages to find exposed endpoints and outbound HTTP calls. Maps which service depends on which endpoint:
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
codebase-intel crossrepo --all --impact user-service
|
|
434
|
+
|
|
435
|
+
# Output:
|
|
436
|
+
# CRITICAL: 3 services depend on /api/v1/users/{id}
|
|
437
|
+
# → payment-service calls this endpoint [CRITICAL] at src/clients/user.py:42
|
|
438
|
+
# → notification-service calls this endpoint at lib/api/users.ts:18
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
Supported: FastAPI, Express, Flask, Django, Spring Boot, Gin, Actix, Rails, Phoenix, Laravel, ASP.NET, Ktor, Vapor, Echo.
|
|
442
|
+
|
|
443
|
+
### Feedback Loop — Learn from acceptance/rejection
|
|
444
|
+
|
|
445
|
+
Records whether AI-generated code was accepted, modified, or rejected. Over time, identifies which context patterns lead to better output and which rejection reasons are most common.
|
|
446
|
+
|
|
306
447
|
## Architecture
|
|
307
448
|
|
|
308
449
|
```
|
|
309
|
-
AI Agent (any) ──→ MCP Server (
|
|
450
|
+
AI Agent (any) ──→ MCP Server (16 tools)
|
|
451
|
+
│
|
|
452
|
+
Workspace Manager ←── Global Registry (~/.codebase-intel/)
|
|
453
|
+
(multi-project routing, LRU cache)
|
|
310
454
|
│
|
|
311
455
|
Context Orchestrator
|
|
312
456
|
(token budgeting, priority, conflicts)
|
|
@@ -318,8 +462,13 @@ AI Agent (any) ──→ MCP Server (7 tools)
|
|
|
318
462
|
Drift Detector
|
|
319
463
|
(staleness, rot, orphans)
|
|
320
464
|
│
|
|
321
|
-
|
|
322
|
-
|
|
465
|
+
┌──────────┼──────────┐
|
|
466
|
+
Analytics Feedback Intent
|
|
467
|
+
Tracker Loop Tracker
|
|
468
|
+
└──────────┼──────────┘
|
|
469
|
+
│
|
|
470
|
+
Cross-Repo Scanner
|
|
471
|
+
(14 frameworks, 10 languages)
|
|
323
472
|
```
|
|
324
473
|
|
|
325
474
|
---
|
|
@@ -350,7 +499,7 @@ Areas with the most impact:
|
|
|
350
499
|
4. **Benchmarks** — Run against your repos, share results
|
|
351
500
|
|
|
352
501
|
```bash
|
|
353
|
-
git clone https://github.com/
|
|
502
|
+
git clone https://github.com/a-mutharasu/codebase-intel.git
|
|
354
503
|
cd codebase-intel
|
|
355
504
|
pip install -e ".[dev]"
|
|
356
505
|
pytest
|