seer-mcp 0.1.0
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/.vscode/settings.json +3 -0
- package/LICENSE +176 -0
- package/README.md +272 -0
- package/README_dev.md +199 -0
- package/dist/bundle/ci.d.ts +47 -0
- package/dist/bundle/ci.d.ts.map +1 -0
- package/dist/bundle/ci.js +113 -0
- package/dist/bundle/ci.js.map +1 -0
- package/dist/bundle/contract.d.ts +111 -0
- package/dist/bundle/contract.d.ts.map +1 -0
- package/dist/bundle/contract.js +352 -0
- package/dist/bundle/contract.js.map +1 -0
- package/dist/bundle/export.d.ts +36 -0
- package/dist/bundle/export.d.ts.map +1 -0
- package/dist/bundle/export.js +152 -0
- package/dist/bundle/export.js.map +1 -0
- package/dist/bundle/external.d.ts +66 -0
- package/dist/bundle/external.d.ts.map +1 -0
- package/dist/bundle/external.js +238 -0
- package/dist/bundle/external.js.map +1 -0
- package/dist/bundle/format.d.ts +94 -0
- package/dist/bundle/format.d.ts.map +1 -0
- package/dist/bundle/format.js +42 -0
- package/dist/bundle/format.js.map +1 -0
- package/dist/bundle/import.d.ts +49 -0
- package/dist/bundle/import.d.ts.map +1 -0
- package/dist/bundle/import.js +116 -0
- package/dist/bundle/import.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +1402 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +48 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +284 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/db/schema.d.ts +3 -0
- package/dist/db/schema.d.ts.map +1 -0
- package/dist/db/schema.js +616 -0
- package/dist/db/schema.js.map +1 -0
- package/dist/db/store.d.ts +1011 -0
- package/dist/db/store.d.ts.map +1 -0
- package/dist/db/store.js +3888 -0
- package/dist/db/store.js.map +1 -0
- package/dist/graph/pagerank.d.ts +9 -0
- package/dist/graph/pagerank.d.ts.map +1 -0
- package/dist/graph/pagerank.js +47 -0
- package/dist/graph/pagerank.js.map +1 -0
- package/dist/indexer/architecture.d.ts +72 -0
- package/dist/indexer/architecture.d.ts.map +1 -0
- package/dist/indexer/architecture.js +112 -0
- package/dist/indexer/architecture.js.map +1 -0
- package/dist/indexer/behavior.d.ts +75 -0
- package/dist/indexer/behavior.d.ts.map +1 -0
- package/dist/indexer/behavior.js +395 -0
- package/dist/indexer/behavior.js.map +1 -0
- package/dist/indexer/boundaries.d.ts +60 -0
- package/dist/indexer/boundaries.d.ts.map +1 -0
- package/dist/indexer/boundaries.js +366 -0
- package/dist/indexer/boundaries.js.map +1 -0
- package/dist/indexer/churn.d.ts +15 -0
- package/dist/indexer/churn.d.ts.map +1 -0
- package/dist/indexer/churn.js +49 -0
- package/dist/indexer/churn.js.map +1 -0
- package/dist/indexer/classify.d.ts +9 -0
- package/dist/indexer/classify.d.ts.map +1 -0
- package/dist/indexer/classify.js +90 -0
- package/dist/indexer/classify.js.map +1 -0
- package/dist/indexer/context.d.ts +176 -0
- package/dist/indexer/context.d.ts.map +1 -0
- package/dist/indexer/context.js +193 -0
- package/dist/indexer/context.js.map +1 -0
- package/dist/indexer/continuity.d.ts +67 -0
- package/dist/indexer/continuity.d.ts.map +1 -0
- package/dist/indexer/continuity.js +288 -0
- package/dist/indexer/continuity.js.map +1 -0
- package/dist/indexer/detectchanges.d.ts +32 -0
- package/dist/indexer/detectchanges.d.ts.map +1 -0
- package/dist/indexer/detectchanges.js +74 -0
- package/dist/indexer/detectchanges.js.map +1 -0
- package/dist/indexer/discovery.d.ts +37 -0
- package/dist/indexer/discovery.d.ts.map +1 -0
- package/dist/indexer/discovery.js +136 -0
- package/dist/indexer/discovery.js.map +1 -0
- package/dist/indexer/externaldeps.d.ts +18 -0
- package/dist/indexer/externaldeps.d.ts.map +1 -0
- package/dist/indexer/externaldeps.js +288 -0
- package/dist/indexer/externaldeps.js.map +1 -0
- package/dist/indexer/freshness.d.ts +48 -0
- package/dist/indexer/freshness.d.ts.map +1 -0
- package/dist/indexer/freshness.js +128 -0
- package/dist/indexer/freshness.js.map +1 -0
- package/dist/indexer/git.d.ts +144 -0
- package/dist/indexer/git.d.ts.map +1 -0
- package/dist/indexer/git.js +444 -0
- package/dist/indexer/git.js.map +1 -0
- package/dist/indexer/index.d.ts +145 -0
- package/dist/indexer/index.d.ts.map +1 -0
- package/dist/indexer/index.js +930 -0
- package/dist/indexer/index.js.map +1 -0
- package/dist/indexer/modules.d.ts +62 -0
- package/dist/indexer/modules.d.ts.map +1 -0
- package/dist/indexer/modules.js +293 -0
- package/dist/indexer/modules.js.map +1 -0
- package/dist/indexer/preflight.d.ts +154 -0
- package/dist/indexer/preflight.d.ts.map +1 -0
- package/dist/indexer/preflight.js +399 -0
- package/dist/indexer/preflight.js.map +1 -0
- package/dist/indexer/protoScanner.d.ts +34 -0
- package/dist/indexer/protoScanner.d.ts.map +1 -0
- package/dist/indexer/protoScanner.js +133 -0
- package/dist/indexer/protoScanner.js.map +1 -0
- package/dist/indexer/risk.d.ts +115 -0
- package/dist/indexer/risk.d.ts.map +1 -0
- package/dist/indexer/risk.js +194 -0
- package/dist/indexer/risk.js.map +1 -0
- package/dist/indexer/serviceHostScanner.d.ts +25 -0
- package/dist/indexer/serviceHostScanner.d.ts.map +1 -0
- package/dist/indexer/serviceHostScanner.js +95 -0
- package/dist/indexer/serviceHostScanner.js.map +1 -0
- package/dist/indexer/serviceLinks.d.ts +105 -0
- package/dist/indexer/serviceLinks.d.ts.map +1 -0
- package/dist/indexer/serviceLinks.js +509 -0
- package/dist/indexer/serviceLinks.js.map +1 -0
- package/dist/indexer/shapehash.d.ts +98 -0
- package/dist/indexer/shapehash.d.ts.map +1 -0
- package/dist/indexer/shapehash.js +354 -0
- package/dist/indexer/shapehash.js.map +1 -0
- package/dist/indexer/skeleton.d.ts +15 -0
- package/dist/indexer/skeleton.d.ts.map +1 -0
- package/dist/indexer/skeleton.js +136 -0
- package/dist/indexer/skeleton.js.map +1 -0
- package/dist/indexer/symbolhistory.d.ts +41 -0
- package/dist/indexer/symbolhistory.d.ts.map +1 -0
- package/dist/indexer/symbolhistory.js +124 -0
- package/dist/indexer/symbolhistory.js.map +1 -0
- package/dist/indexer/watcher.d.ts +68 -0
- package/dist/indexer/watcher.d.ts.map +1 -0
- package/dist/indexer/watcher.js +179 -0
- package/dist/indexer/watcher.js.map +1 -0
- package/dist/mcp/server.d.ts +80 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +1610 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/parser/index.d.ts +8 -0
- package/dist/parser/index.d.ts.map +1 -0
- package/dist/parser/index.js +33 -0
- package/dist/parser/index.js.map +1 -0
- package/dist/parser/languages/cpp.d.ts +3 -0
- package/dist/parser/languages/cpp.d.ts.map +1 -0
- package/dist/parser/languages/cpp.js +350 -0
- package/dist/parser/languages/cpp.js.map +1 -0
- package/dist/parser/languages/csharp.d.ts +3 -0
- package/dist/parser/languages/csharp.d.ts.map +1 -0
- package/dist/parser/languages/csharp.js +239 -0
- package/dist/parser/languages/csharp.js.map +1 -0
- package/dist/parser/languages/go.d.ts +3 -0
- package/dist/parser/languages/go.d.ts.map +1 -0
- package/dist/parser/languages/go.js +259 -0
- package/dist/parser/languages/go.js.map +1 -0
- package/dist/parser/languages/java.d.ts +3 -0
- package/dist/parser/languages/java.d.ts.map +1 -0
- package/dist/parser/languages/java.js +391 -0
- package/dist/parser/languages/java.js.map +1 -0
- package/dist/parser/languages/python.d.ts +3 -0
- package/dist/parser/languages/python.d.ts.map +1 -0
- package/dist/parser/languages/python.js +396 -0
- package/dist/parser/languages/python.js.map +1 -0
- package/dist/parser/languages/rust.d.ts +3 -0
- package/dist/parser/languages/rust.d.ts.map +1 -0
- package/dist/parser/languages/rust.js +159 -0
- package/dist/parser/languages/rust.js.map +1 -0
- package/dist/parser/languages/typescript.d.ts +3 -0
- package/dist/parser/languages/typescript.d.ts.map +1 -0
- package/dist/parser/languages/typescript.js +1442 -0
- package/dist/parser/languages/typescript.js.map +1 -0
- package/dist/parser/parserContext.d.ts +77 -0
- package/dist/parser/parserContext.d.ts.map +1 -0
- package/dist/parser/parserContext.js +354 -0
- package/dist/parser/parserContext.js.map +1 -0
- package/dist/parser/walker.d.ts +81 -0
- package/dist/parser/walker.d.ts.map +1 -0
- package/dist/parser/walker.js +217 -0
- package/dist/parser/walker.js.map +1 -0
- package/dist/parser/worker.d.ts +66 -0
- package/dist/parser/worker.d.ts.map +1 -0
- package/dist/parser/worker.js +129 -0
- package/dist/parser/worker.js.map +1 -0
- package/dist/parser/workerpool.d.ts +107 -0
- package/dist/parser/workerpool.d.ts.map +1 -0
- package/dist/parser/workerpool.js +383 -0
- package/dist/parser/workerpool.js.map +1 -0
- package/dist/scip/format.d.ts +87 -0
- package/dist/scip/format.d.ts.map +1 -0
- package/dist/scip/format.js +31 -0
- package/dist/scip/format.js.map +1 -0
- package/dist/scip/import.d.ts +37 -0
- package/dist/scip/import.d.ts.map +1 -0
- package/dist/scip/import.js +180 -0
- package/dist/scip/import.js.map +1 -0
- package/dist/types.d.ts +392 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +4 -0
- package/dist/types.js.map +1 -0
- package/docs/architecture.md +105 -0
- package/docs/benchmarks/methodology.md +134 -0
- package/docs/benchmarks/raw-results.md +71 -0
- package/docs/benchmarks.md +74 -0
- package/docs/cli.md +148 -0
- package/docs/examples/behavior-tests.md +70 -0
- package/docs/examples/change-history.md +85 -0
- package/docs/examples/pre-edit-context.md +81 -0
- package/docs/examples/service-links.md +88 -0
- package/docs/examples.md +80 -0
- package/docs/faq.md +70 -0
- package/docs/internals.md +104 -0
- package/docs/languages.md +70 -0
- package/docs/limits.md +52 -0
- package/docs/mcp.md +199 -0
- package/docs/quickstart.md +119 -0
- package/docs/testing.md +123 -0
- package/docs/tools.md +115 -0
- package/package.json +52 -0
- package/research-codebase.md +578 -0
- package/seer-cli-docs.md +326 -0
- package/seer-master-guide.md +246 -0
- package/src/bundle/ci.ts +141 -0
- package/src/bundle/contract.ts +387 -0
- package/src/bundle/export.ts +175 -0
- package/src/bundle/external.ts +285 -0
- package/src/bundle/format.ts +92 -0
- package/src/bundle/import.ts +157 -0
- package/src/cli/index.ts +1249 -0
- package/src/cli/init.ts +389 -0
- package/src/db/schema.ts +614 -0
- package/src/db/store.ts +4306 -0
- package/src/graph/pagerank.ts +53 -0
- package/src/indexer/architecture.ts +148 -0
- package/src/indexer/behavior.ts +466 -0
- package/src/indexer/boundaries.ts +374 -0
- package/src/indexer/churn.ts +58 -0
- package/src/indexer/classify.ts +96 -0
- package/src/indexer/context.ts +340 -0
- package/src/indexer/continuity.ts +322 -0
- package/src/indexer/detectchanges.ts +94 -0
- package/src/indexer/discovery.ts +176 -0
- package/src/indexer/externaldeps.ts +243 -0
- package/src/indexer/freshness.ts +166 -0
- package/src/indexer/git.ts +453 -0
- package/src/indexer/index.ts +1092 -0
- package/src/indexer/modules.ts +358 -0
- package/src/indexer/preflight.ts +548 -0
- package/src/indexer/protoScanner.ts +147 -0
- package/src/indexer/risk.ts +304 -0
- package/src/indexer/serviceHostScanner.ts +92 -0
- package/src/indexer/serviceLinks.ts +543 -0
- package/src/indexer/shapehash.ts +370 -0
- package/src/indexer/skeleton.ts +169 -0
- package/src/indexer/symbolhistory.ts +172 -0
- package/src/indexer/watcher.ts +206 -0
- package/src/mcp/server.ts +1659 -0
- package/src/parser/index.ts +37 -0
- package/src/parser/languages/cpp.ts +361 -0
- package/src/parser/languages/csharp.ts +235 -0
- package/src/parser/languages/go.ts +259 -0
- package/src/parser/languages/java.ts +382 -0
- package/src/parser/languages/python.ts +370 -0
- package/src/parser/languages/rust.ts +164 -0
- package/src/parser/languages/typescript.ts +1435 -0
- package/src/parser/parserContext.ts +392 -0
- package/src/parser/walker.ts +306 -0
- package/src/parser/worker.ts +181 -0
- package/src/parser/workerpool.ts +448 -0
- package/src/scip/format.ts +83 -0
- package/src/scip/import.ts +216 -0
- package/src/types.ts +457 -0
- package/tests/benchmark-service-links.ts +244 -0
- package/tests/bug-regressions.ts +626 -0
- package/tests/filters.ts +264 -0
- package/tests/fixtures/Counter.tsx +38 -0
- package/tests/fixtures/caller.ts +7 -0
- package/tests/fixtures/collisions.ts +23 -0
- package/tests/fixtures/local_helper.ts +5 -0
- package/tests/fixtures/overloads.java +17 -0
- package/tests/fixtures/remote_helper.ts +4 -0
- package/tests/fixtures/sample.c +15 -0
- package/tests/fixtures/sample.cpp +47 -0
- package/tests/fixtures/sample.cs +62 -0
- package/tests/fixtures/sample.go +68 -0
- package/tests/fixtures/sample.h +30 -0
- package/tests/fixtures/sample.java +85 -0
- package/tests/fixtures/sample.py +46 -0
- package/tests/fixtures/sample.rs +78 -0
- package/tests/fixtures/sample.ts +76 -0
- package/tests/fixtures-service/HttpClients.cs +30 -0
- package/tests/fixtures-service/HttpClients.java +24 -0
- package/tests/fixtures-service/billing.ts +15 -0
- package/tests/fixtures-service/docker-compose.yml +15 -0
- package/tests/fixtures-service/gateway.ts +10 -0
- package/tests/fixtures-service/get_user.ts +11 -0
- package/tests/fixtures-service/graphql_client.ts +63 -0
- package/tests/fixtures-service/graphql_server.ts +30 -0
- package/tests/fixtures-service/grpc_client.go +30 -0
- package/tests/fixtures-service/http_clients.go +23 -0
- package/tests/fixtures-service/http_clients.py +38 -0
- package/tests/fixtures-service/http_clients.ts +49 -0
- package/tests/fixtures-service/k8s/payment-service.yaml +22 -0
- package/tests/fixtures-service/k8s_calls.ts +20 -0
- package/tests/fixtures-service/messaging.ts +87 -0
- package/tests/fixtures-service/trpc_client.ts +39 -0
- package/tests/fixtures-service/trpc_server.ts +39 -0
- package/tests/fixtures-service/user_service.proto +33 -0
- package/tests/fixtures-trackcd/Cargo.toml +11 -0
- package/tests/fixtures-trackcd/SpringController.java +36 -0
- package/tests/fixtures-trackcd/auth_service.ts +19 -0
- package/tests/fixtures-trackcd/complex_module.py +50 -0
- package/tests/fixtures-trackcd/express_app.js +30 -0
- package/tests/fixtures-trackcd/fastapi_app.py +49 -0
- package/tests/fixtures-trackcd/fastify_object_routes.js +32 -0
- package/tests/fixtures-trackcd/go.mod +8 -0
- package/tests/fixtures-trackcd/package.json +15 -0
- package/tests/fixtures-trackcd/requirements.txt +4 -0
- package/tests/fixtures-trackcd/tests/auth_service.test.ts +13 -0
- package/tests/fixtures-tracke/auth/AuthService.ts +23 -0
- package/tests/fixtures-tracke/auth/crypto.ts +7 -0
- package/tests/fixtures-tracke/billing/Billing.ts +20 -0
- package/tests/fixtures-tracke/billing/Invoice.ts +10 -0
- package/tests/fixtures-tracke/billing/server.ts +17 -0
- package/tests/fixtures-tracke/package.json +7 -0
- package/tests/fixtures-tracke/tests/auth.test.ts +23 -0
- package/tests/fixtures-tracke/tests/billing.test.ts +14 -0
- package/tests/fixtures-trackf/package.json +5 -0
- package/tests/fixtures-trackf/src/auth.ts +26 -0
- package/tests/fixtures-trackf/src/handlers.ts +35 -0
- package/tests/fixtures-tracki/billing/routes.ts +12 -0
- package/tests/fixtures-tracki/gateway/client.ts +13 -0
- package/tests/git-features.ts +267 -0
- package/tests/init.ts +141 -0
- package/tests/mcp-jit.ts +130 -0
- package/tests/mcp-smoke.ts +191 -0
- package/tests/mcp-trackcd.ts +169 -0
- package/tests/mcp-tracke.ts +229 -0
- package/tests/mcp-trackf.ts +330 -0
- package/tests/mcp-trackg.ts +219 -0
- package/tests/mcp-tracki.ts +174 -0
- package/tests/mcp-watcher.ts +126 -0
- package/tests/optspec.ts +194 -0
- package/tests/parallel-index.ts +333 -0
- package/tests/parallel-read.ts +125 -0
- package/tests/parallel-recovery.ts +241 -0
- package/tests/perf-callers.ts +145 -0
- package/tests/query-parity.ts +184 -0
- package/tests/query-perf.ts +55 -0
- package/tests/scale-parallel-parity.ts +225 -0
- package/tests/scale-test.ts +523 -0
- package/tests/smoke.ts +396 -0
- package/tests/trackcd.ts +325 -0
- package/tests/tracke-collisions.ts +255 -0
- package/tests/tracke.ts +314 -0
- package/tests/trackf-bugs.ts +406 -0
- package/tests/trackf.ts +390 -0
- package/tests/trackg.ts +1372 -0
- package/tests/tracki-boundaries.ts +202 -0
- package/tests/tracki-continuity.ts +253 -0
- package/tests/tracki-contract-diff.ts +249 -0
- package/tests/tracki-external-bundles.ts +341 -0
- package/tests/tracki-preflight.ts +251 -0
- package/tests/verify-roles.ts +51 -0
- package/tests/worker-parity.ts +286 -0
- package/tests/worker-pool.ts +262 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
# Research Codebases for Seer
|
|
2
|
+
|
|
3
|
+
This note analyzes the three local codebases under `Resources/`: `aider`, `codebase-memory-mcp`, and `scip`. It uses the checked-in source as the primary evidence, with official public references used only to clarify purpose and project positioning.
|
|
4
|
+
|
|
5
|
+
Public references:
|
|
6
|
+
- Aider GitHub: https://github.com/Aider-AI/aider
|
|
7
|
+
- Aider repo map docs: https://aider.chat/docs/repomap.html
|
|
8
|
+
- Codebase Memory MCP GitHub: https://github.com/DeusData/codebase-memory-mcp
|
|
9
|
+
- Codebase-Memory paper: https://arxiv.org/abs/2603.27277
|
|
10
|
+
- SCIP GitHub: https://github.com/scip-code/scip
|
|
11
|
+
- SCIP site: https://scip-code.org/
|
|
12
|
+
- Sourcegraph SCIP announcement: https://sourcegraph.com/blog/announcing-scip
|
|
13
|
+
|
|
14
|
+
## Executive Synthesis
|
|
15
|
+
|
|
16
|
+
These three repos map cleanly onto Seer's intended architecture. Aider is the strongest reference for the interactive agent loop: how to budget code context, rank a repository map, talk to many models, apply edits, run tests, and keep a human in control. Codebase Memory MCP is the strongest reference for Seer's L0/L1 substrate: fast local indexing, tree-sitter extraction, SQLite graph storage, graph query tools, call tracing, semantic search, Louvain-style communities, and an MCP-facing tool API. SCIP is the strongest reference for interoperability and symbol identity: it gives Seer a precise external format for symbols, definitions, references, ranges, relationships, and index validation.
|
|
17
|
+
|
|
18
|
+
The practical architecture suggested by these repos is: use a Codebase-Memory-like pipeline for local graph construction, make Seer's internal symbol and occurrence model SCIP-compatible, then expose an Aider-like context and navigation layer that never loads raw source unless a user or agent has a specific reason to descend to L0. Aider proves that a small ranked map is better than a giant prompt. Codebase Memory proves that graph tools can replace wasteful grep/read loops. SCIP proves that symbol identity and source ranges need a real protocol, not ad hoc strings.
|
|
19
|
+
|
|
20
|
+
## Aider
|
|
21
|
+
|
|
22
|
+
### What It Is
|
|
23
|
+
|
|
24
|
+
Aider is a Python terminal AI pair programmer for real git repositories. It wraps model selection, terminal I/O, chat state, repo mapping, edit formats, patch application, git commits, lint/test loops, URL/image input, and interactive slash commands into one local workflow. Its central product idea is that an LLM should receive a compact, ranked map of the repository plus explicitly added files, then ask for more context only when needed. In the local checkout, the main application is under `Resources/aider/aider`, edit strategies live under `Resources/aider/aider/coders`, tree-sitter repo-map logic lives in `Resources/aider/aider/repomap.py`, git integration lives in `Resources/aider/aider/repo.py`, and command handling lives in `Resources/aider/aider/commands.py`.
|
|
25
|
+
|
|
26
|
+
### Technical Analysis for Seer
|
|
27
|
+
|
|
28
|
+
Aider is highly relevant to Seer because it has already solved a smaller version of Seer's "how does an AI navigate a codebase without wasting tokens?" problem. `RepoMap` extracts definitions and references with tree-sitter queries, falls back to Pygments when references are missing, builds a file graph, ranks it with PageRank, then renders only selected lines of interest through `grep_ast.TreeContext`. This is essentially Seer L1 plus a lightweight L2 rendering layer. It is not a full knowledge graph and does not preserve rich edge semantics, but the ranking and token-budget mechanics are exactly the kind of behavior Seer needs when deciding which modules, symbols, and snippets belong in an answer.
|
|
29
|
+
|
|
30
|
+
The `Coder` hierarchy is also a useful product reference. `Coder.create()` chooses an edit format based on model capabilities, `format_messages()` assembles the final prompt, `send_message()` manages retries and context-window failures, `apply_updates()` delegates edits to specific coder implementations, and the post-edit loop can auto-commit, lint, test, and reflect errors back into the model. Seer should not become an edit agent first, but onboarding eventually becomes active: "try this kata", "make this safe change", "explain why this test failed". Aider's loop shows how to connect explanation, code context, edits, and verification without making every response a raw source dump.
|
|
31
|
+
|
|
32
|
+
The most important design constraint Aider reinforces is that the map must be dynamic. Aider boosts files already in chat, mentioned identifiers, mentioned filenames, long meaningful identifiers, and files connected by reference edges. Seer should do the same across L2-L5: if the user asks about `BillingWebhookProcessor`, increase rank for the symbol, its file, its module, its callers, its tests, and its temporal ancestors. The repo map should be a context-packing algorithm, not a static document.
|
|
33
|
+
|
|
34
|
+
### Implementation Path for Seer
|
|
35
|
+
|
|
36
|
+
1. Build a first Seer repo-map prototype from Aider's pattern: tree-sitter definitions, references, file graph, PageRank, token-bounded rendering of lines of interest.
|
|
37
|
+
2. Replace file-level tags with Seer's richer L1 symbol graph: symbols, call edges, import edges, tests, routes, config, and temporal metadata.
|
|
38
|
+
3. Implement a context packer that uses Aider-style personalization: active files, mentioned identifiers, recently viewed nodes, current L4/L5 summaries, and query terms.
|
|
39
|
+
4. Add "ask for more context" affordances to Seer chat: source is loaded only through deliberate `read_source(file, range)` or equivalent.
|
|
40
|
+
5. Reuse the Aider edit-loop concept later for onboarding katas: run test, capture failure, ask the model to explain, compare against original PR or expected fix.
|
|
41
|
+
6. Keep Seer's output provenance stricter than Aider's. Every generated explanation should cite graph nodes, source ranges, commits, PRs, or summaries.
|
|
42
|
+
|
|
43
|
+
### Codebase Graph for AI Navigation
|
|
44
|
+
|
|
45
|
+
Use this map when an AI needs to inspect Aider without walking the whole repo.
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
Resources/aider/
|
|
49
|
+
README.md
|
|
50
|
+
Product summary, features, install, public docs links.
|
|
51
|
+
|
|
52
|
+
pyproject.toml
|
|
53
|
+
Package metadata and dependency hints.
|
|
54
|
+
|
|
55
|
+
aider/__main__.py
|
|
56
|
+
Minimal Python module entry point.
|
|
57
|
+
|
|
58
|
+
aider/main.py
|
|
59
|
+
CLI bootstrap.
|
|
60
|
+
Flow:
|
|
61
|
+
main(argv)
|
|
62
|
+
-> load config and env
|
|
63
|
+
-> parse args
|
|
64
|
+
-> select model
|
|
65
|
+
-> build GitRepo
|
|
66
|
+
-> build Commands
|
|
67
|
+
-> Coder.create(...)
|
|
68
|
+
-> optional lint/test/commit/show-map modes
|
|
69
|
+
-> interactive coder.run()
|
|
70
|
+
Read this for startup, config, model selection, and app lifecycle.
|
|
71
|
+
|
|
72
|
+
aider/coders/base_coder.py
|
|
73
|
+
Core agent loop.
|
|
74
|
+
Flow:
|
|
75
|
+
Coder.create()
|
|
76
|
+
-> choose subclass by edit_format
|
|
77
|
+
Coder.__init__()
|
|
78
|
+
-> setup repo, files, repo map, linter, summarizer
|
|
79
|
+
get_repo_map()
|
|
80
|
+
-> RepoMap.get_repo_map(...)
|
|
81
|
+
format_messages()
|
|
82
|
+
-> assemble system, repo map, file context, readonly files, history
|
|
83
|
+
send_message()
|
|
84
|
+
-> LLM call, retries, output capture, edit application, lint/test reflection
|
|
85
|
+
apply_updates()
|
|
86
|
+
-> subclass-specific edit parsing and file writes
|
|
87
|
+
Read this for prompt assembly, token checks, chat state, and post-edit verification.
|
|
88
|
+
|
|
89
|
+
aider/coders/
|
|
90
|
+
Edit strategy layer.
|
|
91
|
+
Key files:
|
|
92
|
+
architect_coder.py
|
|
93
|
+
Two-stage "architect then editor" workflow.
|
|
94
|
+
patch_coder.py
|
|
95
|
+
Custom patch format parser/applier.
|
|
96
|
+
editblock_coder.py
|
|
97
|
+
Search/replace blocks with fuzzy matching.
|
|
98
|
+
udiff_coder.py
|
|
99
|
+
Unified diff parsing/application.
|
|
100
|
+
wholefile_coder.py
|
|
101
|
+
Whole-file replacement mode.
|
|
102
|
+
*_prompts.py
|
|
103
|
+
Prompt templates for each edit mode.
|
|
104
|
+
Read here when studying model-specific edit formats or patch robustness.
|
|
105
|
+
|
|
106
|
+
aider/repomap.py
|
|
107
|
+
Token-efficient repository map.
|
|
108
|
+
Flow:
|
|
109
|
+
get_tags_raw()
|
|
110
|
+
-> tree-sitter query captures definitions/references
|
|
111
|
+
get_ranked_tags()
|
|
112
|
+
-> build file graph from def/ref edges
|
|
113
|
+
-> personalize with chat files and mentioned identifiers
|
|
114
|
+
-> networkx PageRank
|
|
115
|
+
get_ranked_tags_map_uncached()
|
|
116
|
+
-> binary search how many ranked tags fit token budget
|
|
117
|
+
to_tree()
|
|
118
|
+
-> render selected lines of interest per file
|
|
119
|
+
Read this first for Seer L1/L2 context-packing ideas.
|
|
120
|
+
|
|
121
|
+
aider/queries/tree-sitter-languages/
|
|
122
|
+
Language-specific tag queries used by RepoMap.
|
|
123
|
+
Read only when adding or debugging a language.
|
|
124
|
+
|
|
125
|
+
aider/repo.py
|
|
126
|
+
Git integration.
|
|
127
|
+
Handles tracked files, ignore logic, diffs, commits, dirty files, and commit-message generation.
|
|
128
|
+
Read this for local-first git behavior and safe repo boundaries.
|
|
129
|
+
|
|
130
|
+
aider/commands.py
|
|
131
|
+
Slash command dispatcher.
|
|
132
|
+
Key commands: /add, /drop, /map, /map-refresh, /tokens, /lint, /test, /run, /git, /commit, /undo, /ask, /code, /architect, /context.
|
|
133
|
+
Read this for user-facing command workflows.
|
|
134
|
+
|
|
135
|
+
aider/models.py
|
|
136
|
+
Model registry and provider abstraction through LiteLLM/OpenRouter/local providers.
|
|
137
|
+
Read this for token counting, model settings, edit-format selection, weak/editor models, thinking tokens, and environment validation.
|
|
138
|
+
|
|
139
|
+
aider/io.py
|
|
140
|
+
Terminal I/O, prompts, confirmations, autocomplete, output styling, chat history.
|
|
141
|
+
Read this for human-in-the-loop ergonomics.
|
|
142
|
+
|
|
143
|
+
aider/linter.py, aider/run_cmd.py
|
|
144
|
+
Lint/test/shell execution support.
|
|
145
|
+
Read this for verification loops.
|
|
146
|
+
|
|
147
|
+
aider/watch.py, aider/watch_prompts.py
|
|
148
|
+
IDE/watch-file integration.
|
|
149
|
+
Read this for comment-driven or file-change-driven workflows.
|
|
150
|
+
|
|
151
|
+
tests/basic/
|
|
152
|
+
Unit tests for core modules.
|
|
153
|
+
Start at test_repomap.py, test_coder.py, test_commands.py, test_repo.py, test_main.py, test_linter.py.
|
|
154
|
+
|
|
155
|
+
benchmark/
|
|
156
|
+
SWE-bench and editing benchmarks.
|
|
157
|
+
Read this when designing Seer evaluation suites.
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
High-value Aider paths for Seer:
|
|
161
|
+
- Repo-map ranking: `aider/repomap.py`
|
|
162
|
+
- Agent prompt assembly: `aider/coders/base_coder.py`
|
|
163
|
+
- Edit/verification loop: `aider/coders/base_coder.py`, `aider/linter.py`, `aider/repo.py`
|
|
164
|
+
- Commands and UX: `aider/commands.py`, `aider/io.py`
|
|
165
|
+
- Model abstraction: `aider/models.py`
|
|
166
|
+
|
|
167
|
+
## Codebase Memory MCP
|
|
168
|
+
|
|
169
|
+
### What It Is
|
|
170
|
+
|
|
171
|
+
Codebase Memory MCP is a C code intelligence engine exposed as an MCP server and CLI. It indexes repositories into a persistent SQLite-backed knowledge graph using tree-sitter grammars, language-specific extractors, LSP-style type resolution, semantic scoring, graph traversals, cross-service linking, git-diff impact analysis, and optional 3D graph visualization. The local checkout is mostly C under `Resources/codebase-memory-mcp/src` and `Resources/codebase-memory-mcp/internal/cbm`, with a React/Vite graph UI under `Resources/codebase-memory-mcp/graph-ui`. Its README positions it as a structural analysis backend for AI coding agents rather than an LLM agent itself.
|
|
172
|
+
|
|
173
|
+
### Technical Analysis for Seer
|
|
174
|
+
|
|
175
|
+
This is the closest existing implementation to Seer's deterministic L0/L1 layer. It already has the shape Seer wants: discovery, tree-sitter parsing, extraction passes, a graph buffer, SQLite storage, query tools, semantic edges, call tracing, route nodes, cross-repo links, background watching, and a compressed graph artifact for team sharing. The pipeline comments in `src/pipeline/pipeline.h` describe the core pass order: structure, definitions, imports, calls, usages, semantic edges, then post-passes for tests, communities, HTTP links, config, and git history. That maps almost one-to-one onto Seer's source/symbol/module substrate.
|
|
176
|
+
|
|
177
|
+
The strongest implementation idea to borrow is the separation between indexing and intelligence. Codebase Memory does not try to answer natural language questions itself. It gives the agent precise tools: `index_repository`, `search_graph`, `query_graph`, `trace_path`, `get_code_snippet`, `get_graph_schema`, `get_architecture`, `search_code`, `detect_changes`, `manage_adr`, and `ingest_traces`. Seer should follow that principle. The LLM should formulate questions and synthesize answers, while deterministic tools return bounded, cited graph facts.
|
|
178
|
+
|
|
179
|
+
The second major idea is pipeline caching. `pass_parallel.c` describes a three-phase pipeline where files are read and parsed once, results are cached, and later resolution passes reuse `CBMFileResult` rather than reparsing. Seer's full L0-L5 system should adopt this discipline: L0/L1 extraction should produce stable artifacts that are reused by L2 summaries, L3 clustering, L4 subsystem synthesis, and temporal indexing. Repeated parse and repeated LLM summarization are both architectural smells.
|
|
180
|
+
|
|
181
|
+
The third idea is graph enrichment beyond plain calls. The codebase has extractors for definitions, imports, calls, usages, semantic structures, type references, environment access, channels, Kubernetes, service patterns, cross-repo routes, similarity, semantic edges, and git history. Seer's onboarding goal needs the same breadth. New hires do not only ask "what calls this function?" They ask "what feature area owns this?", "what external service does it hit?", "what config controls it?", "which tests protect it?", and "what changed recently?" Codebase Memory shows that many of these can be deterministic graph edges before any LLM writes prose.
|
|
182
|
+
|
|
183
|
+
The main place Seer should diverge is the user-facing layer. Codebase Memory is a powerful backend, but Seer needs an onboarding-oriented hierarchy: L2 file summaries, L3 module summaries, L4 subsystem views, L5 system overview, temporal narratives, katas, citations, and confidence markings. Codebase Memory gives the fact substrate; Seer must add durable explanation products on top.
|
|
184
|
+
|
|
185
|
+
### Implementation Path for Seer
|
|
186
|
+
|
|
187
|
+
1. Define Seer's internal graph schema by borrowing Codebase Memory's node/edge families: Project, Folder, File, Module, Function, Method, Class, Route, Config, Test, ADR, Commit, PR, Issue, plus edges like CONTAINS, DEFINES, IMPORTS, CALLS, INHERITS, IMPLEMENTS, TESTS, HTTP_CALLS, DATA_FLOWS, SIMILAR_TO, CHANGED_IN, INTRODUCED_BY, FIXED_BY.
|
|
188
|
+
2. Build an MVP indexer with the same pass shape: discover files, create structure nodes, extract definitions, resolve imports, resolve calls, extract usages, then write to SQLite.
|
|
189
|
+
3. Add graph query tools before adding a chat UI. Minimum tool surface: `search_graph`, `read_symbol`, `trace_calls`, `impact`, `architecture`, `schema`, `list_modules`, `time_travel`.
|
|
190
|
+
4. Add Louvain or Leiden module clustering over weighted call/import/test edges. Store cluster membership as deterministic L3 candidates before asking an LLM to summarize.
|
|
191
|
+
5. Add artifact sharing similar to `.codebase-memory/graph.db.zst`, but extend it with content hashes and summary parent hashes so teams can share both graph and L2-L5 summaries.
|
|
192
|
+
6. Add temporal passes after stable L1 graph indexing: git history, per-symbol chains, commit classification, PR/issue linking, and causal edges.
|
|
193
|
+
7. Keep MCP compatibility in mind, even if Seer ships its own UI. MCP-style tools are an excellent boundary between deterministic graph retrieval and LLM synthesis.
|
|
194
|
+
|
|
195
|
+
### Codebase Graph for AI Navigation
|
|
196
|
+
|
|
197
|
+
Use this map when an AI needs to inspect Codebase Memory MCP without getting lost in generated grammars and vendored code.
|
|
198
|
+
|
|
199
|
+
```text
|
|
200
|
+
Resources/codebase-memory-mcp/
|
|
201
|
+
README.md
|
|
202
|
+
Product, feature list, tools, performance claims, install, graph artifact, MCP behavior.
|
|
203
|
+
|
|
204
|
+
Makefile.cbm
|
|
205
|
+
Build and test wiring for the C codebase.
|
|
206
|
+
|
|
207
|
+
src/main.c
|
|
208
|
+
Binary entry point.
|
|
209
|
+
Flow:
|
|
210
|
+
main()
|
|
211
|
+
-> parse subcommands and UI flags
|
|
212
|
+
-> run config/update/install/uninstall/cli modes
|
|
213
|
+
-> create MCP server
|
|
214
|
+
-> create watcher
|
|
215
|
+
-> optional HTTP graph UI
|
|
216
|
+
-> run MCP stdio loop
|
|
217
|
+
Read this for process lifecycle and CLI-vs-MCP behavior.
|
|
218
|
+
|
|
219
|
+
src/mcp/mcp.c, src/mcp/mcp.h
|
|
220
|
+
MCP JSON-RPC server and tool dispatch.
|
|
221
|
+
Key concepts:
|
|
222
|
+
TOOLS[] defines tool names, descriptions, JSON schemas.
|
|
223
|
+
cbm_mcp_handle_tool(...) routes calls.
|
|
224
|
+
Query tools open SQLite stores.
|
|
225
|
+
Indexing tools call the pipeline.
|
|
226
|
+
Read this for the external API Seer should emulate or integrate.
|
|
227
|
+
|
|
228
|
+
src/pipeline/
|
|
229
|
+
Indexing pipeline and graph construction.
|
|
230
|
+
Main files:
|
|
231
|
+
pipeline.h
|
|
232
|
+
Public pipeline API and high-level pass order.
|
|
233
|
+
pipeline.c
|
|
234
|
+
Orchestrates discovery, structure, definitions, LSP cross pass, calls, usages, semantics, tests, git history, artifact export.
|
|
235
|
+
pipeline_internal.h
|
|
236
|
+
Shared pipeline context and pass declarations.
|
|
237
|
+
pass_parallel.c
|
|
238
|
+
Optimized read/parse-once parallel extraction/resolution path.
|
|
239
|
+
pass_definitions.c
|
|
240
|
+
Converts extraction results into graph nodes and registry entries.
|
|
241
|
+
pass_lsp_cross.c
|
|
242
|
+
Builds project-wide LSP inputs and merges resolved calls back into results.
|
|
243
|
+
pass_calls.c
|
|
244
|
+
Resolves call edges from extracted calls and LSP results.
|
|
245
|
+
pass_usages.c
|
|
246
|
+
Usage and type-reference edges.
|
|
247
|
+
pass_semantic.c
|
|
248
|
+
INHERITS, DECORATES, IMPLEMENTS.
|
|
249
|
+
pass_semantic_edges.c
|
|
250
|
+
SEMANTICALLY_RELATED edges from combined signals.
|
|
251
|
+
pass_similarity.c
|
|
252
|
+
SIMILAR_TO near-clone detection.
|
|
253
|
+
pass_route_nodes.c
|
|
254
|
+
Route nodes and service edges.
|
|
255
|
+
pass_cross_repo.c
|
|
256
|
+
Cross-project route/channel matching.
|
|
257
|
+
pass_githistory.c
|
|
258
|
+
Git history and change coupling.
|
|
259
|
+
pass_gitdiff.c
|
|
260
|
+
Changed-file impact inputs.
|
|
261
|
+
pass_tests.c
|
|
262
|
+
Test detection and test graph enrichment.
|
|
263
|
+
pass_configlink.c, pass_configures.c, pass_envscan.c, pass_infrascan.c, pass_k8s.c
|
|
264
|
+
Config, environment, and infrastructure edges.
|
|
265
|
+
artifact.c
|
|
266
|
+
Compressed graph artifact import/export.
|
|
267
|
+
registry.c
|
|
268
|
+
Function registry used during resolution.
|
|
269
|
+
worker_pool.c
|
|
270
|
+
Parallel execution primitive.
|
|
271
|
+
Read this first for Seer's L0/L1 indexer design.
|
|
272
|
+
|
|
273
|
+
internal/cbm/
|
|
274
|
+
Tree-sitter extraction core and language registry.
|
|
275
|
+
Main files:
|
|
276
|
+
cbm.h
|
|
277
|
+
Central data model: definitions, calls, imports, usages, type refs, env accesses, channels, resolved calls, file result.
|
|
278
|
+
cbm.c
|
|
279
|
+
Parse/extract orchestration per file.
|
|
280
|
+
extract_defs.c
|
|
281
|
+
Definition extraction across languages.
|
|
282
|
+
extract_imports.c
|
|
283
|
+
Import extraction.
|
|
284
|
+
extract_calls.c
|
|
285
|
+
Call extraction.
|
|
286
|
+
extract_unified.c
|
|
287
|
+
Unified tree-sitter extraction pass.
|
|
288
|
+
extract_semantic.c, extract_type_refs.c, extract_type_assigns.c, extract_usages.c
|
|
289
|
+
Additional semantic extraction.
|
|
290
|
+
extract_channels.c
|
|
291
|
+
Pub-sub/channel edges.
|
|
292
|
+
extract_k8s.c
|
|
293
|
+
Kubernetes resource extraction.
|
|
294
|
+
lang_specs.c, lang_specs.h
|
|
295
|
+
Language specs and node type lists.
|
|
296
|
+
grammar_*.c
|
|
297
|
+
Thin language grammar bridge files.
|
|
298
|
+
vendored/grammars/
|
|
299
|
+
Huge generated tree-sitter parsers. Ignore unless debugging a parser.
|
|
300
|
+
Read this for extraction internals and the shape of L1 facts.
|
|
301
|
+
|
|
302
|
+
internal/cbm/lsp/
|
|
303
|
+
Language-specific LSP-style type resolution.
|
|
304
|
+
Key files:
|
|
305
|
+
type_rep.c/.h
|
|
306
|
+
Internal type representation.
|
|
307
|
+
type_registry.c/.h
|
|
308
|
+
Registered funcs/types and lookup.
|
|
309
|
+
scope.c/.h
|
|
310
|
+
Lexical scope binding.
|
|
311
|
+
go_lsp.c, c_lsp.c, ts_lsp.c, py_lsp.c, php_lsp.c, cs_lsp.c
|
|
312
|
+
Per-language type-aware call resolution.
|
|
313
|
+
Read this when Seer needs more precise call graphs than tree-sitter can provide.
|
|
314
|
+
|
|
315
|
+
src/store/store.c, src/store/store.h
|
|
316
|
+
SQLite graph store.
|
|
317
|
+
Responsibilities:
|
|
318
|
+
schema creation
|
|
319
|
+
node/edge upsert
|
|
320
|
+
search
|
|
321
|
+
traversal
|
|
322
|
+
architecture summaries
|
|
323
|
+
Louvain community detection
|
|
324
|
+
project/file metadata
|
|
325
|
+
Read this for persistence, query APIs, and graph algorithms.
|
|
326
|
+
|
|
327
|
+
src/graph_buffer/
|
|
328
|
+
In-memory graph buffer before SQLite dump.
|
|
329
|
+
Read this for bulk write strategy and ID management.
|
|
330
|
+
|
|
331
|
+
src/cypher/cypher.c
|
|
332
|
+
Cypher-like query engine.
|
|
333
|
+
Read this for custom graph query language tradeoffs.
|
|
334
|
+
|
|
335
|
+
src/semantic/
|
|
336
|
+
Semantic scoring and AST profiles.
|
|
337
|
+
Read this for embedding-like or code-shape similarity signals.
|
|
338
|
+
|
|
339
|
+
src/simhash/
|
|
340
|
+
MinHash/LSH and near-clone detection.
|
|
341
|
+
Read this for duplicate/similarity edges.
|
|
342
|
+
|
|
343
|
+
src/discover/
|
|
344
|
+
File discovery, gitignore handling, language detection, user config.
|
|
345
|
+
Read this for repo walking and ignore semantics.
|
|
346
|
+
|
|
347
|
+
src/watcher/
|
|
348
|
+
Background change detection and reindex callbacks.
|
|
349
|
+
Read this for local incremental updates.
|
|
350
|
+
|
|
351
|
+
src/traces/
|
|
352
|
+
Runtime trace ingestion.
|
|
353
|
+
Read this for future dynamic-behavior graph edges.
|
|
354
|
+
|
|
355
|
+
src/ui/
|
|
356
|
+
Embedded HTTP server, layout, and UI asset serving.
|
|
357
|
+
|
|
358
|
+
graph-ui/
|
|
359
|
+
React/Vite 3D graph visualization.
|
|
360
|
+
Key files:
|
|
361
|
+
src/App.tsx
|
|
362
|
+
src/hooks/useGraphData.ts
|
|
363
|
+
src/components/GraphScene.tsx
|
|
364
|
+
src/components/GraphTab.tsx
|
|
365
|
+
src/components/NodeDetailPanel.tsx
|
|
366
|
+
src/components/StatsTab.tsx
|
|
367
|
+
src/api/rpc.ts
|
|
368
|
+
Read this for graph visualization UX, not for indexing logic.
|
|
369
|
+
|
|
370
|
+
tests/
|
|
371
|
+
Large C test suite.
|
|
372
|
+
Start with:
|
|
373
|
+
test_pipeline.c
|
|
374
|
+
test_store_*.c
|
|
375
|
+
test_mcp.c
|
|
376
|
+
test_*_lsp.c
|
|
377
|
+
test_cypher.c
|
|
378
|
+
test_incremental.c
|
|
379
|
+
test_integration.c
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
High-value Codebase Memory paths for Seer:
|
|
383
|
+
- Indexer orchestration: `src/pipeline/pipeline.c`, `src/pipeline/pipeline.h`
|
|
384
|
+
- Extraction model: `internal/cbm/cbm.h`, `internal/cbm/cbm.c`, `internal/cbm/extract_*.c`
|
|
385
|
+
- Storage/query: `src/store/store.c`, `src/store/store.h`
|
|
386
|
+
- Tool API: `src/mcp/mcp.c`
|
|
387
|
+
- Cross-file precision: `src/pipeline/pass_lsp_cross.c`, `internal/cbm/lsp/*`
|
|
388
|
+
- Temporal/impact seeds: `src/pipeline/pass_githistory.c`, `src/pipeline/pass_gitdiff.c`
|
|
389
|
+
- Visualization reference: `graph-ui/src/components/GraphScene.tsx`, `graph-ui/src/components/StatsTab.tsx`
|
|
390
|
+
|
|
391
|
+
## SCIP
|
|
392
|
+
|
|
393
|
+
### What It Is
|
|
394
|
+
|
|
395
|
+
SCIP, the SCIP Code Intelligence Protocol, is a language-agnostic protocol for source-code indexes. It is not a full codebase explainer and not primarily a storage engine; its design docs explicitly describe it as a transmission format from producers such as language indexers to consumers such as Sourcegraph or other code intelligence tools. The repo contains the Protobuf schema `scip.proto`, Go and Rust bindings, generated TypeScript and Haskell bindings, a `scip` CLI for linting/printing/snapshotting/testing/converting indexes, and `reprolang`, a tiny test language for deterministic SCIP fixture generation.
|
|
396
|
+
|
|
397
|
+
### Technical Analysis for Seer
|
|
398
|
+
|
|
399
|
+
SCIP matters to Seer because it solves the hardest low-level naming problem: how to identify code symbols across languages, packages, files, local scopes, definitions, references, implementations, type definitions, and source ranges. Seer could invent its own symbol string format, but SCIP already has a rigorous grammar: scheme, package manager/name/version, descriptors, local symbols, roles, relationships, symbol kinds, signatures, documentation, diagnostics, and enclosing ranges. Seer should treat SCIP as either an import/export format or the inspiration for its internal L1 identity layer.
|
|
400
|
+
|
|
401
|
+
The most useful SCIP field for Seer beyond basic definitions is `Occurrence.enclosing_range`. SCIP's schema calls out call hierarchies, symbol outlines, breadcrumbs, expand selection, and hover ranges as applications. For Seer, enclosing ranges are also the bridge from L1 to L2: they let us attach a definition occurrence to the complete AST span that should be summarized, cited, diffed, and time-traveled. They are also crucial for test linkage and behavioral explanations because a reference inside a function body should belong to that enclosing function, not just to a file.
|
|
402
|
+
|
|
403
|
+
SCIP's relationship model is also directly relevant. `Relationship` supports reference, implementation, type definition, and definition relationships. Seer can extend this idea internally with temporal and architectural relationships while retaining a SCIP-compatible core. For example, `IMPLEMENTS`, `INHERITS`, and `TYPE_DEFINES` can be imported from SCIP; `INTRODUCED_BY`, `FIXED_BY`, `TESTED_BY`, `CONFIGURES`, and `EXPLAINS` can be Seer-native.
|
|
404
|
+
|
|
405
|
+
The CLI is a useful validation model. `scip lint`, `scip print`, `scip snapshot`, `scip test`, `scip stats`, and experimental SQLite conversion show the operational tools a serious index format needs. Seer should ship similar "trust the index" tools: validate graph invariants, print symbol neighborhoods, snapshot expected navigation, show stats, and convert/import external indexes.
|
|
406
|
+
|
|
407
|
+
### Implementation Path for Seer
|
|
408
|
+
|
|
409
|
+
1. Define Seer's canonical symbol ID with SCIP compatibility in mind: package identity plus descriptor path plus local symbol support. Avoid opaque integer IDs as the public identity.
|
|
410
|
+
2. Add a SCIP importer that maps `Index -> Project`, `Document -> File`, `SymbolInformation -> Symbol nodes`, `Occurrence -> Definition/Reference/Read/Write edges`, and `Relationship -> semantic edges`.
|
|
411
|
+
3. Add a SCIP exporter for Seer's deterministic L1 layer so other tools can consume Seer indexes.
|
|
412
|
+
4. Use SCIP as a fallback precision source when language-specific indexers are available. For example, import `scip-typescript`, `scip-python`, `scip-clang`, or `rust-analyzer` outputs instead of relying only on tree-sitter heuristics.
|
|
413
|
+
5. Build Seer graph validation commands inspired by `scip lint` and `scip snapshot`: validate ranges, missing definitions, duplicate symbols, unresolved references, and broken temporal parent links.
|
|
414
|
+
6. Store source ranges with explicit position encoding. SCIP's UTF-8/UTF-16/UTF-32 distinction is not optional if Seer wants editor-grade citations and Monaco integration.
|
|
415
|
+
7. Keep SCIP as transmission, not storage. Internally Seer still needs a query-optimized SQLite graph and summary store.
|
|
416
|
+
|
|
417
|
+
### Codebase Graph for AI Navigation
|
|
418
|
+
|
|
419
|
+
Use this map when an AI needs to inspect SCIP without confusing it with unrelated "SCIP" projects.
|
|
420
|
+
|
|
421
|
+
```text
|
|
422
|
+
Resources/scip/
|
|
423
|
+
README.md
|
|
424
|
+
Project summary, included artifacts, known indexers, install instructions.
|
|
425
|
+
|
|
426
|
+
scip.proto
|
|
427
|
+
The core protocol.
|
|
428
|
+
Main concepts:
|
|
429
|
+
Index
|
|
430
|
+
metadata + documents + external_symbols
|
|
431
|
+
Metadata
|
|
432
|
+
protocol version, tool info, project root, text encoding
|
|
433
|
+
Document
|
|
434
|
+
relative_path, language, occurrences, symbols, optional text, position_encoding
|
|
435
|
+
Symbol
|
|
436
|
+
scheme + package + descriptors
|
|
437
|
+
SymbolInformation
|
|
438
|
+
documentation, relationships, kind, display name, signature, enclosing symbol
|
|
439
|
+
Relationship
|
|
440
|
+
reference, implementation, type definition, definition links
|
|
441
|
+
Occurrence
|
|
442
|
+
range, symbol, roles, syntax kind, diagnostics, enclosing_range
|
|
443
|
+
SymbolRole
|
|
444
|
+
Definition, Import, WriteAccess, ReadAccess, Generated, Test, ForwardDefinition
|
|
445
|
+
Read this first for Seer symbol identity, ranges, and relationship semantics.
|
|
446
|
+
|
|
447
|
+
docs/DESIGN.md
|
|
448
|
+
Design rationale.
|
|
449
|
+
Key decisions:
|
|
450
|
+
SCIP is a transmission format, not a storage format.
|
|
451
|
+
Protobuf enables static types and streaming.
|
|
452
|
+
String IDs are preferred over integer IDs.
|
|
453
|
+
Direct graph encoding is avoided to improve indexer parallelism and debugging.
|
|
454
|
+
Read this before designing Seer's import/export boundary.
|
|
455
|
+
|
|
456
|
+
docs/CLI.md
|
|
457
|
+
CLI reference.
|
|
458
|
+
Commands:
|
|
459
|
+
lint
|
|
460
|
+
print
|
|
461
|
+
snapshot
|
|
462
|
+
stats
|
|
463
|
+
test
|
|
464
|
+
expt-convert
|
|
465
|
+
Read this when designing Seer diagnostics and golden tests.
|
|
466
|
+
|
|
467
|
+
cmd/scip/
|
|
468
|
+
Go CLI implementation.
|
|
469
|
+
Key files:
|
|
470
|
+
main.go
|
|
471
|
+
Command registration and app setup.
|
|
472
|
+
lint.go
|
|
473
|
+
Index validation.
|
|
474
|
+
print.go
|
|
475
|
+
Debug output.
|
|
476
|
+
snapshot.go
|
|
477
|
+
Human-readable golden snapshots.
|
|
478
|
+
test.go
|
|
479
|
+
Test-file validation.
|
|
480
|
+
stats.go
|
|
481
|
+
Index statistics.
|
|
482
|
+
convert.go
|
|
483
|
+
Experimental SCIP-to-SQLite conversion.
|
|
484
|
+
Read this for operational tooling around an index format.
|
|
485
|
+
|
|
486
|
+
bindings/go/scip/
|
|
487
|
+
Rich Go helper library.
|
|
488
|
+
Key files:
|
|
489
|
+
scip.pb.go
|
|
490
|
+
Generated schema bindings.
|
|
491
|
+
symbol.go
|
|
492
|
+
Parse/validate symbol API.
|
|
493
|
+
symbol_parser.go
|
|
494
|
+
Low-allocation symbol parser.
|
|
495
|
+
symbol_formatter.go
|
|
496
|
+
Symbol string formatting.
|
|
497
|
+
parse.go
|
|
498
|
+
Streaming parse helpers.
|
|
499
|
+
canonicalize.go
|
|
500
|
+
Canonicalization utilities.
|
|
501
|
+
flatten.go
|
|
502
|
+
Merge duplicate documents, symbols, occurrences, relationships.
|
|
503
|
+
sort.go
|
|
504
|
+
Stable ordering.
|
|
505
|
+
position.go
|
|
506
|
+
Range/position helpers.
|
|
507
|
+
source_file.go
|
|
508
|
+
Source-file utilities.
|
|
509
|
+
Read this if implementing Seer in Go or porting symbol parsing ideas.
|
|
510
|
+
|
|
511
|
+
bindings/rust/
|
|
512
|
+
Rust bindings and symbol helpers.
|
|
513
|
+
Read this if Seer's indexer is Rust.
|
|
514
|
+
|
|
515
|
+
bindings/typescript/
|
|
516
|
+
Generated TypeScript bindings.
|
|
517
|
+
Read this if Seer's prototype is TypeScript and needs SCIP import/export.
|
|
518
|
+
|
|
519
|
+
bindings/haskell/
|
|
520
|
+
Generated Haskell bindings.
|
|
521
|
+
Usually low priority for Seer.
|
|
522
|
+
|
|
523
|
+
reprolang/
|
|
524
|
+
Tiny deterministic language used to test SCIP features.
|
|
525
|
+
Key files:
|
|
526
|
+
README.md
|
|
527
|
+
grammar.js
|
|
528
|
+
repro/indexer.go
|
|
529
|
+
repro/scip.go
|
|
530
|
+
repro/parser.go
|
|
531
|
+
repro/namer.go
|
|
532
|
+
testdata/
|
|
533
|
+
Read this for an excellent pattern for Seer golden tests: small artificial programs that produce known graph facts.
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
High-value SCIP paths for Seer:
|
|
537
|
+
- Protocol schema: `scip.proto`
|
|
538
|
+
- Design rationale: `docs/DESIGN.md`
|
|
539
|
+
- Index validation/snapshots: `cmd/scip/lint.go`, `cmd/scip/snapshot.go`, `cmd/scip/test.go`
|
|
540
|
+
- Symbol parser/formatter: `bindings/go/scip/symbol_parser.go`, `bindings/go/scip/symbol_formatter.go`
|
|
541
|
+
- Dedup/canonicalization: `bindings/go/scip/flatten.go`, `bindings/go/scip/canonicalize.go`
|
|
542
|
+
- Deterministic fixture language: `reprolang/`
|
|
543
|
+
|
|
544
|
+
## Combined Implementation Direction for Seer
|
|
545
|
+
|
|
546
|
+
The most effective path is not to pick one of these repos as "the base." They solve different layers:
|
|
547
|
+
|
|
548
|
+
1. Use SCIP's data model for symbol identity, source ranges, occurrence roles, and import/export.
|
|
549
|
+
2. Use Codebase Memory's architecture for local indexing, graph storage, query tools, and deterministic enrichment passes.
|
|
550
|
+
3. Use Aider's repo-map and agent loop ideas for token-bounded context packing, conversation flow, and human-in-the-loop workflows.
|
|
551
|
+
4. Add Seer's unique layer on top: L2-L5 recursive summaries, temporal causal graph, per-symbol time travel, epoch narratives, onboarding paths, katas, and confidence-scored citations.
|
|
552
|
+
|
|
553
|
+
The first Seer MVP should avoid building a beautiful chat UI before the graph is trustworthy. A better sequence is:
|
|
554
|
+
|
|
555
|
+
1. Index one repo into SQLite with stable symbol IDs and source ranges.
|
|
556
|
+
2. Query definitions, references, callers, imports, and tests from the graph.
|
|
557
|
+
3. Render an Aider-style ranked map from the graph.
|
|
558
|
+
4. Cluster modules with Louvain/Leiden and create L3 candidates.
|
|
559
|
+
5. Generate L2 file summaries and L3 module summaries with citations.
|
|
560
|
+
6. Add a minimal chat agent that navigates through graph tools.
|
|
561
|
+
7. Add temporal indexing and per-symbol history.
|
|
562
|
+
8. Build the polished onboarding UI once the facts and citations are solid.
|
|
563
|
+
|
|
564
|
+
## Quick Lookup Table
|
|
565
|
+
|
|
566
|
+
| Seer Question | Best Reference | Where To Look |
|
|
567
|
+
|---|---|---|
|
|
568
|
+
| How should an AI see a huge repo without reading it all? | Aider | `aider/repomap.py`, `aider/coders/base_coder.py` |
|
|
569
|
+
| How should files/symbols be ranked for a prompt? | Aider | `RepoMap.get_ranked_tags()` |
|
|
570
|
+
| How should Seer expose graph tools to an agent? | Codebase Memory MCP | `src/mcp/mcp.c` |
|
|
571
|
+
| How should local graph indexing be structured? | Codebase Memory MCP | `src/pipeline/*`, `internal/cbm/*` |
|
|
572
|
+
| How should Seer store/query graph facts? | Codebase Memory MCP | `src/store/store.c`, `src/store/store.h` |
|
|
573
|
+
| How should Seer discover modules? | Codebase Memory MCP plus Louvain paper | `src/store/store.c` Louvain functions |
|
|
574
|
+
| How should symbol IDs and ranges work? | SCIP | `scip.proto`, `bindings/go/scip/symbol_parser.go` |
|
|
575
|
+
| How should index quality be tested? | SCIP | `cmd/scip/*`, `reprolang/` |
|
|
576
|
+
| How should onboarding connect to edits/tests later? | Aider | `base_coder.py`, `repo.py`, `commands.py`, `linter.py` |
|
|
577
|
+
| How should cross-language precision be imported? | SCIP | External SCIP indexers and `scip.proto` |
|
|
578
|
+
|