carto-md 2.1.0 → 2.1.1
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.
- package/CHANGELOG.md +135 -0
- package/CONTRIBUTING.md +11 -8
- package/README.md +165 -213
- package/docs/anci/v0.1-DRAFT.md +132 -2
- package/docs/api/README.md +27 -2
- package/docs/api/did_we_discuss_this.md +2 -0
- package/docs/api/dismiss_gap.md +39 -0
- package/docs/api/find_consumers_of_api.md +2 -0
- package/docs/api/get_action_patterns.md +2 -0
- package/docs/api/get_arch_events.md +2 -0
- package/docs/api/get_architectural_drift.md +2 -0
- package/docs/api/get_blast_radius.md +2 -0
- package/docs/api/get_canonical_pattern.md +2 -0
- package/docs/api/get_change_velocity.md +2 -0
- package/docs/api/get_churn_vs_blast_radius.md +2 -0
- package/docs/api/get_complexity_trend.md +2 -0
- package/docs/api/get_conventions.md +2 -0
- package/docs/api/get_cross_repo_blast_radius.md +2 -0
- package/docs/api/get_data_flow.md +2 -0
- package/docs/api/get_decision_log.md +2 -0
- package/docs/api/get_domain_evolution.md +2 -0
- package/docs/api/get_domain_health.md +2 -0
- package/docs/api/get_file_receipts.md +34 -0
- package/docs/api/get_gaps.md +52 -0
- package/docs/api/get_hotspot_files.md +2 -0
- package/docs/api/get_intent.md +25 -0
- package/docs/api/get_intervention_history.md +2 -0
- package/docs/api/get_invariants.md +2 -0
- package/docs/api/get_microservices_migration_cut_points.md +2 -0
- package/docs/api/get_neighbors.md +2 -0
- package/docs/api/get_org_architecture.md +2 -0
- package/docs/api/get_org_domain_mapping.md +2 -0
- package/docs/api/get_pending_decisions.md +2 -0
- package/docs/api/get_recent_decisions.md +2 -0
- package/docs/api/get_service_boundary_violations.md +2 -0
- package/docs/api/get_service_dependency_graph.md +2 -0
- package/docs/api/get_session_context.md +2 -0
- package/docs/api/get_temporal_context.md +2 -0
- package/docs/api/history.md +78 -0
- package/docs/api/impact.md +56 -0
- package/docs/api/memory.md +70 -0
- package/docs/api/org.md +51 -0
- package/docs/api/patterns.md +63 -0
- package/docs/api/set_intent.md +45 -0
- package/docs/api/simulate_change_impact.md +2 -0
- package/docs/concepts/domains.md +75 -50
- package/docs/concepts/mcp-integration.md +4 -2
- package/docs/guides/pre-merge-review.md +2 -2
- package/docs/migration/v1-to-v2.md +2 -2
- package/docs/screenshots/carto-supabase-blast-radius.png +0 -0
- package/package.json +2 -1
- package/scripts/gen-api-docs.js +51 -19
- package/src/agents/domains.js +72 -24
- package/src/ai/tools.js +4 -2
- package/src/anci/consumer.js +83 -3
- package/src/anci/emit.js +18 -1
- package/src/anci/git-meta.js +171 -0
- package/src/anci/pack.js +288 -0
- package/src/anci/serialize.js +77 -6
- package/src/anci/staleness.js +161 -0
- package/src/brain/conventions/index.js +134 -20
- package/src/brain/invariants/index.js +76 -22
- package/src/cli/anci.js +27 -1
- package/src/cli/doctor.js +69 -0
- package/src/cli/export.js +128 -0
- package/src/cli/index.js +19 -1
- package/src/cli/init.js +84 -1
- package/src/cli/load.js +125 -0
- package/src/extractors/imports.js +35 -10
- package/src/extractors/languages/javascript.js +8 -4
- package/src/extractors/languages/prisma.js +1 -1
- package/src/extractors/languages/typescript.js +13 -49
- package/src/extractors/schemas.js +60 -0
- package/src/extractors/tree-sitter-parser.js +39 -0
- package/src/mcp/change-plan.js +131 -12
- package/src/mcp/impact.js +119 -0
- package/src/mcp/server.js +708 -82
- package/src/rules/concepts/auth-middleware.md +111 -0
- package/src/rules/concepts/money-as-float.md +80 -0
- package/src/rules/engine.js +178 -0
- package/src/rules/intent.js +178 -0
- package/src/rules/registry.js +24 -0
- package/src/rules/rules/auth-missing-on-mutating-route.js +255 -0
- package/src/rules/rules/money-as-float.js +166 -0
- package/src/store/config-loader.js +77 -3
- package/src/store/sqlite-store.js +248 -7
- package/src/store/sync.js +69 -39
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Carto land here. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow [SemVer](https://semver.org/).
|
|
4
|
+
|
|
5
|
+
## [2.1.1] - 2026-07-08
|
|
6
|
+
|
|
7
|
+
Correctness, trust, and real portability. The external-audit fixes land, the tool surface collapses to a default core-10, and the container becomes a single verifiable file you can move between machines.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **Single-file container** - `carto export` packs `.carto/anci.{yaml,bin}` into one portable `.anci` file; `carto load <file>` unpacks it on another machine with no re-index and verifies the content digest. Loaded contents are treated as untrusted data, never instructions.
|
|
11
|
+
- **Container identity** - the ANCI manifest now records source commit, tree hash, carto version, tree-sitter grammar versions, and a sha256 content digest. The same repo rebuilds to the same digest.
|
|
12
|
+
- **Staleness warnings** - MCP responses and `carto doctor` warn "graph is N commits stale" instead of silently serving old numbers.
|
|
13
|
+
- **Model extractors** - Zod (`z.object`) and Drizzle (`pgTable`/`sqliteTable`/`mysqlTable`) schemas are now extracted and surfaced by `get_models`.
|
|
14
|
+
- **Temporal auto-backfill** - `carto init` backfills git history automatically (bounded to ~200 commits); pass `--no-temporal` to skip. Temporal and predictive tools now return real data with no manual step.
|
|
15
|
+
- **Audit CI gate** - `test/audit-supabase.js` pins the external-audit findings so trust can't silently regress.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- **MCP surface collapsed** from ~76 flat tools into a handful of parameterized families (`impact`, `memory`, `history`, `patterns`, `org`) plus a default core-10, so the tool list stops burning context at session start. Former tool names still resolve as deprecated shims with byte-identical output.
|
|
19
|
+
- **Domain classification** now routes through a single source of truth, so `get_data_flow` and `get_cross_domain` always agree; repo-declared domain globs in `carto.config.json` are the primary source, with inference as the fallback.
|
|
20
|
+
- **`get_canonical_pattern`** requires a non-trivial, well-connected exemplar (ignores demo/example/fixture routes).
|
|
21
|
+
- **`get_change_plan`** matches intent on word boundaries instead of naive substring.
|
|
22
|
+
- **`get_conventions`** mines naming/export/directory patterns with confidence instead of a single trivial rule.
|
|
23
|
+
- README reworked around portability ("build once, load anywhere"), the active-guardrail framing, and container identity.
|
|
24
|
+
- Test suite expanded to 417 tests.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
- Domain misclassification from over-broad keyword seeds (byte-size utility, theme resolver, and similar).
|
|
28
|
+
- Deterministic file discovery (sorted POSIX paths) so content digests are reproducible across machines.
|
|
29
|
+
|
|
30
|
+
## [2.1.0] — 2026-06-26
|
|
31
|
+
|
|
32
|
+
The big one. Five new memory layers, six new languages, two-axis growth across the MCP surface.
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
- **76 MCP tools** across temporal, brain, predictive, adjacent, org, and AI retrieval groups (was 22).
|
|
36
|
+
- **Episodic memory** — every `validate_diff` call now writes to `.carto/carto.db`. New chats can ask `did_we_discuss_this` and read the prior verdict. Tools: `did_we_discuss_this`, `get_decision_log`, `get_session_context`, `get_pending_decisions`, `get_intervention_history`.
|
|
37
|
+
- **Temporal layer** — snapshots, churn, deltas, git-history backfill. Tools: `get_architectural_drift`, `get_domain_evolution`, `get_hotspot_files`, `get_arch_events`, `get_temporal_context`, `get_change_velocity`, `get_complexity_trend`.
|
|
38
|
+
- **Brain layer** — invariants and conventions mined from the import graph, action patterns mined from git history. Tools: `get_invariants`, `get_conventions`, `get_canonical_pattern`, `get_action_patterns`, `get_working_memory`, `get_active_suggestions`, `scaffold_for_intent`.
|
|
39
|
+
- **Predictive layer** — per-file P(causes next incident) score blending blast radius, churn, coupling, intervention history, test coverage. Tools: `get_predictive_risk`, `get_safety_checklist`, `get_drift_digest`, `get_test_coverage_map`, `validate_change`.
|
|
40
|
+
- **AI retrieval** — token-budgeted context picker with hybrid retrieval (structural + lexical + semantic) and RRF fusion. Tools: `get_minimal_context_for_intent`, `get_progressive_disclosure_tree`, `get_token_budget_report`.
|
|
41
|
+
- **Org / multi-repo** — cross-repo detection, service graph, npm/pypi/go-mod/maven edge resolution. Tools: `get_org_architecture`, `get_service_dependency_graph`, `get_cross_repo_blast_radius`, `find_consumers_of_api`, `get_service_boundary_violations`, `get_org_domain_mapping`.
|
|
42
|
+
- **Adjacent signals** — cross-language call graph, IaC resources, OTLP runtime ingestion, risk-weighted blast radius, dead code with confidence, semantic diff.
|
|
43
|
+
- **Language extractors** — PHP (Laravel, Symfony, Eloquent), Swift (Vapor, structs), Kotlin (Spring, Ktor, data classes), Dart (Flutter widgets, Shelf), R (Plumber, Shiny, R6, S7). All tier-1.
|
|
44
|
+
- **Plugin API** for third-party language extractors. Unified framework router collapses the per-language plugins under a single interface.
|
|
45
|
+
- **ACP agent mode** — `carto agent` runs as a full ACP agent for Zed, JetBrains, VS Code. BYOK for Anthropic, OpenAI, Gemini, Groq, Ollama, OpenRouter, Together, Azure.
|
|
46
|
+
- **MCP middleware** — `carto mcp-middleware --block-on HIGH -- <inner>` wraps any stdio MCP server and blocks risky writes before they reach the model.
|
|
47
|
+
- **CLI** — new subcommands: `explain`, `diff`, `validate`, `status`, `why`, `doctor`, `check`, `pr-impact`. `init` now auto-wires Claude Code, Codex, Windsurf, Zed in addition to Cursor and Kiro.
|
|
48
|
+
- **Benchmarks** — SWE-bench-Verified harness for measuring the Carto delta (`bench/swe-bench/`).
|
|
49
|
+
- **Docs** — auto-generated per-tool reference for all 76 tools (`docs/api/`), concept walkthroughs (blast radius, domains, import graph, MCP integration, ANCI), guides (CI integration, monorepo setup, onboarding, adding features safely, pre-merge review), V1→V2 migration, quickstart, troubleshooting.
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
- Test suite expanded to 346 tests covering the v2.1 surface.
|
|
53
|
+
- README rewritten around episodic memory and predictive risk.
|
|
54
|
+
|
|
55
|
+
### Removed
|
|
56
|
+
- V1 import path; the `-v2` suffix is gone from internal modules.
|
|
57
|
+
|
|
58
|
+
## [2.0.9] — 2026-06-07
|
|
59
|
+
|
|
60
|
+
### Added
|
|
61
|
+
- **Prebuilt native binaries** for macOS arm64, Linux x64 (glibc + musl), Windows x64. No C++ toolchain needed for the common case.
|
|
62
|
+
- **GitHub Action** — `carto/pr-impact` drops a sticky PR comment with blast radius, cross-domain violations, affected routes, risk badge. `fail-on: HIGH|MEDIUM|LOW` gates the workflow.
|
|
63
|
+
- **ANCI v0.1-DRAFT** — Architecturally Normalized Code Index. `.carto/anci.{yaml,bin}` written on every `carto sync`. Reference consumer in `src/anci/consumer.js`.
|
|
64
|
+
- **Scale-test harness** — `bench/scale-test/` plus an expanded test suite.
|
|
65
|
+
|
|
66
|
+
### Changed
|
|
67
|
+
- `carto sync` emits the ANCI export alongside the SQLite store; bitmap mtime invariant fixed so reads never see a stale graph.
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
- Stale spec-version references scrubbed from extractor and CLI comments.
|
|
71
|
+
|
|
72
|
+
## [2.0.8] — 2026-06-05
|
|
73
|
+
|
|
74
|
+
### Changed
|
|
75
|
+
- **Reshape release.** Diff validation lands as the primary surface. The bitmap engine replaces the SQLite path for graph queries (10× median, sub-millisecond at 7K files). Import graph is now accurate by construction. Fresh-by-default — `carto sync` runs on every git event.
|
|
76
|
+
- README leads with the AI tool integration story; Origin section restored. Codex CLI setup added.
|
|
77
|
+
|
|
78
|
+
## [2.0.7] — 2026-06-02
|
|
79
|
+
|
|
80
|
+
### Added
|
|
81
|
+
- Codex CLI setup instructions.
|
|
82
|
+
|
|
83
|
+
### Fixed
|
|
84
|
+
- Correctness fixes across the extractor stack.
|
|
85
|
+
- MCP resilience — server no longer crashes on malformed tool calls.
|
|
86
|
+
- Security hardening — `.cartoignore` blocks `.env` and credential files by default; secrets never enter `AGENTS.md`.
|
|
87
|
+
|
|
88
|
+
## [2.0.6] — 2026-06-01
|
|
89
|
+
|
|
90
|
+
### Added
|
|
91
|
+
- ACP agent mode (`carto agent`) with BYOK LLM support — initial cut.
|
|
92
|
+
- VS Code Copilot and Windsurf added to the MCP config section.
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
- README restructured to lead with AI tool integration.
|
|
96
|
+
- `carto init` migrated to the V2 SQLite indexer (Spec 4).
|
|
97
|
+
- Prominent update notice wired into `init`, `serve`, `impact`, `check` (Spec 4.5).
|
|
98
|
+
|
|
99
|
+
### Fixed
|
|
100
|
+
- `Project Structure` block in `AGENTS.md` now populates correctly under the V2 sync path.
|
|
101
|
+
|
|
102
|
+
## [2.0.3 – 2.0.5] — 2026-05-31
|
|
103
|
+
|
|
104
|
+
### Added
|
|
105
|
+
- GitHub Actions CI (Spec 3): test matrix across Node 20/22 on Ubuntu, macOS, Windows.
|
|
106
|
+
|
|
107
|
+
### Changed
|
|
108
|
+
- `get_change_plan` replaced keyword-grep with real graph traversal (Spec 2).
|
|
109
|
+
- Lockfile sync at 2.0.3; `.npmrc` with `legacy-peer-deps` for Windows CI.
|
|
110
|
+
|
|
111
|
+
### Fixed
|
|
112
|
+
- `carto check` SQLite query path; serve/sync CLI cleanup.
|
|
113
|
+
|
|
114
|
+
## [2.0.0] — 2026-05-29
|
|
115
|
+
|
|
116
|
+
### Added
|
|
117
|
+
- **V2 architecture.** SQLite store with WAL mode replaces JSON blobs. Recursive directory watcher with debounce, burst detection, dirty-flag recluster.
|
|
118
|
+
- **Tree-sitter parser** with grammars for 8 languages. JS/TS plugins use tree-sitter for imports and symbols; Babel runs only on API handler files.
|
|
119
|
+
- **Language plugins** — Rust, Java, C++, C#, Ruby (Rails routes including `resources :foo` CRUD expansion, Sinatra, ActiveRecord), expanded Python and Go.
|
|
120
|
+
- **Domain clustering** — Leiden + CPM, four new MCP tools, lazy context generation.
|
|
121
|
+
- **Worker pool** for parsing; mtime + size cache; the 300-file smartSelect cap is gone.
|
|
122
|
+
- Benchmark suite, correctness tests, V2 CONTRIBUTING.md.
|
|
123
|
+
|
|
124
|
+
### Changed
|
|
125
|
+
- `carto check` rewritten against the SQLite store. `serve` and `sync` CLI surfaces updated.
|
|
126
|
+
|
|
127
|
+
## [1.x] — 2026-05-01 – 2026-05-02
|
|
128
|
+
|
|
129
|
+
Early releases. Go import graph, Flask routes, custom domain config, initial MCP server. See git history for detail.
|
|
130
|
+
|
|
131
|
+
[2.1.0]: https://github.com/theanshsonkar/carto/releases/tag/v2.1.0
|
|
132
|
+
[2.0.9]: https://github.com/theanshsonkar/carto/releases/tag/v2.0.9
|
|
133
|
+
[2.0.8]: https://github.com/theanshsonkar/carto/releases/tag/v2.0.8
|
|
134
|
+
[2.0.7]: https://github.com/theanshsonkar/carto/releases/tag/v2.0.7
|
|
135
|
+
[2.0.6]: https://github.com/theanshsonkar/carto/releases/tag/v2.0.6
|
package/CONTRIBUTING.md
CHANGED
|
@@ -39,7 +39,8 @@ Framework-specific route and model extraction lives inside the language plugins.
|
|
|
39
39
|
### Tier 3 — Core (review carefully before merging)
|
|
40
40
|
|
|
41
41
|
- `src/agents/merger.js` — merger logic. One bad merge = developer loses manual notes.
|
|
42
|
-
- `src/agents/
|
|
42
|
+
- `src/agents/domains.js` — domain assignment (declared config + keyword/majority-vote inference). Wrong domains = wrong context everywhere.
|
|
43
|
+
- `src/agents/leiden.js` — Leiden+CPM graph clustering. Present but not on the default domain path; touch only if wiring it in.
|
|
43
44
|
- `src/store/sqlite-store.js` — SQLite persistence layer.
|
|
44
45
|
- `src/mcp/server.js` — MCP server tools. Breaking changes affect Kiro/Cursor/Claude.
|
|
45
46
|
- `src/store/sync.js` — full sync pipeline.
|
|
@@ -183,20 +184,22 @@ Test on at least 2 real open-source projects using the framework.
|
|
|
183
184
|
|
|
184
185
|
## How domain clustering works
|
|
185
186
|
|
|
186
|
-
|
|
187
|
+
Every file gets exactly one domain, resolved in strict priority order: **declared config wins, inference is the fallback.** All tools read the assignment through a single accessor (`store.getDomainOf`), so they never disagree. See [`docs/concepts/domains.md`](docs/concepts/domains.md) for the full spec.
|
|
187
188
|
|
|
188
|
-
|
|
189
|
+
**Declared (primary).** Define domains in `carto.config.json`. Globs are recommended for monorepos; keywords + anchors give finer control:
|
|
189
190
|
|
|
190
191
|
```json
|
|
191
192
|
{
|
|
192
193
|
"domains": {
|
|
193
|
-
"EDITOR":
|
|
194
|
-
"PLATFORM": ["platform", "service", "registry"]
|
|
194
|
+
"EDITOR": { "globs": ["src/editor/**", "packages/*/editor/**"] },
|
|
195
|
+
"PLATFORM": { "keywords": ["platform", "service"], "anchor": ["src/platform/registry.ts"] }
|
|
195
196
|
}
|
|
196
197
|
}
|
|
197
198
|
```
|
|
198
199
|
|
|
199
|
-
The keyword seeds in `src/store/sync.js`
|
|
200
|
+
**Inferred (fallback).** For anything undeclared, Carto infers a domain from path keywords plus an import-graph majority vote (`src/agents/domains.js`), and drops low-confidence files to `CORE`/`UNCLASSIFIED` rather than guessing a wrong specific domain. The keyword seeds in `src/store/sync.js` can be extended for new domain types.
|
|
201
|
+
|
|
202
|
+
> `src/agents/leiden.js` ships a Leiden+CPM clusterer, but it is not on the default inference path today - the active fallback is the keyword + majority-vote pass in `domains.js`.
|
|
200
203
|
|
|
201
204
|
---
|
|
202
205
|
|
|
@@ -219,7 +222,7 @@ cd carto
|
|
|
219
222
|
npm install
|
|
220
223
|
node src/cli/index.js init # test in any project
|
|
221
224
|
node src/cli/index.js serve # test MCP server
|
|
222
|
-
npm test # run test suite (
|
|
225
|
+
npm test # run test suite (417 tests across ~40 suites)
|
|
223
226
|
node test/correctness.js # run correctness tests (27 checks)
|
|
224
227
|
node test/benchmark.js # run benchmarks against real repos
|
|
225
228
|
```
|
|
@@ -262,7 +265,7 @@ npm run test:bench-ci # self-bench (matches what bench.yml runs)
|
|
|
262
265
|
- [ ] Extension added to `CODE_EXTS` and `detectLanguage()` in `sync.js`
|
|
263
266
|
- [ ] No changes to merger logic (unless explicitly fixing a merger bug)
|
|
264
267
|
- [ ] No network calls added
|
|
265
|
-
- [ ] `npm test` passes (
|
|
268
|
+
- [ ] `npm test` passes (417/417)
|
|
266
269
|
- [ ] `node test/correctness.js` passes (27/27)
|
|
267
270
|
|
|
268
271
|
---
|