Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
ctx-optimize
command
ctx-optimize — gather a codebase (and its world) into one local store an agent answers from.
|
ctx-optimize — gather a codebase (and its world) into one local store an agent answers from. |
|
ctx-optimize-adapters
command
ctx-optimize-adapters — the capture companion: every database/queue/API driver links HERE (via the connectors blank import), keeping the main ctx-optimize binary driver-free and its hot paths byte-identical.
|
ctx-optimize-adapters — the capture companion: every database/queue/API driver links HERE (via the connectors blank import), keeping the main ctx-optimize binary driver-free and its hot paths byte-identical. |
|
internal
|
|
|
adapterscli
Package adapterscli is the entry for ctx-optimize-adapters — the capture companion (ADR 2026-07-17, "FINAL architecture: companion binary after all").
|
Package adapterscli is the entry for ctx-optimize-adapters — the capture companion (ADR 2026-07-17, "FINAL architecture: companion binary after all"). |
|
analyze
Package analyze is the deterministic graph-walking layer: shortest path, reverse impact (affected), node explanation, hubs (god nodes).
|
Package analyze is the deterministic graph-walking layer: shortest path, reverse impact (affected), node explanation, hubs (god nodes). |
|
app
Package app is the CLI: a deliberately dumb front over the internal packages.
|
Package app is the CLI: a deliberately dumb front over the internal packages. |
|
audit
Package audit is the append-only change log for every mutation door — dashboard endpoints and CLI verbs route through the same writer, so a human can always answer "who changed what, when" from one plain file:
|
Package audit is the append-only change log for every mutation door — dashboard endpoints and CLI verbs route through the same writer, so a human can always answer "who changed what, when" from one plain file: |
|
boundaries
ast.go — the boundary lane's matcher, as DATA over the AST (ADR 2026-08-14-boundaries-on-the-ast).
|
ast.go — the boundary lane's matcher, as DATA over the AST (ADR 2026-08-14-boundaries-on-the-ast). |
|
dashboard
Package dashboard serves the local store visually — an embedded React app (go:embed, built offline, no CDN, ZERO external requests) plus a JSON API over the same files queries use.
|
Package dashboard serves the local store visually — an embedded React app (go:embed, built offline, no CDN, ZERO external requests) plus a JSON API over the same files queries use. |
|
export
Package export renders the graph for other tools: GraphML (yEd, Gephi, networkx), an Obsidian vault (wikilinked notes), and CSV pairs (spreadsheets, pandas, Neo4j LOAD CSV).
|
Package export renders the graph for other tools: GraphML (yEd, Gephi, networkx), an Obsidian vault (wikilinked notes), and CSV pairs (spreadsheets, pandas, Neo4j LOAD CSV). |
|
extract/code
boundarysites.go — the boundary lane's matcher over the AST (ADR 2026-08-14-boundaries-on-the-ast).
|
boundarysites.go — the boundary lane's matcher over the AST (ADR 2026-08-14-boundaries-on-the-ast). |
|
extract/deplink
Package deplink is the cross-lane linker (ADR 2026-07-23-code-dependency- edges): it bridges the code lane's module:// import targets to the manifest lane's dep: nodes with resolves_to edges, so the graph answers "which files use package X" and `affected dep:npm/react` crosses the dependency boundary.
|
Package deplink is the cross-lane linker (ADR 2026-07-23-code-dependency- edges): it bridges the code lane's module:// import targets to the manifest lane's dep: nodes with resolves_to edges, so the graph answers "which files use package X" and `affected dep:npm/react` crosses the dependency boundary. |
|
extract/githistory
Package githistory is the tier-1 co-change producer: it derives "these files change together" edges purely from `git log` — no AST, no content read.
|
Package githistory is the tier-1 co-change producer: it derives "these files change together" edges purely from `git log` — no AST, no content read. |
|
extract/ignore
Package ignore answers "is this path gitignored?" with git's OWN semantics — nested .gitignore files, negations, global excludes — by asking git once per gather instead of reimplementing the spec.
|
Package ignore answers "is this path gitignored?" with git's OWN semantics — nested .gitignore files, negations, global excludes — by asking git once per gather instead of reimplementing the spec. |
|
extract/manifests
cargo.go — Cargo.toml recognizer (ADR 2026-07-25-structured-formats S7), table-anchored on the same walker as pyproject.go.
|
cargo.go — Cargo.toml recognizer (ADR 2026-07-25-structured-formats S7), table-anchored on the same walker as pyproject.go. |
|
extract/markdown
Package markdown is the first tier-1 producer: deterministic extraction of markdown/plain-text documents into the one emit schema.
|
Package markdown is the first tier-1 producer: deterministic extraction of markdown/plain-text documents into the one emit schema. |
|
extract/tomlwalk
Package tomlwalk is the shared TOML table walker used by the manifests producer's pyproject/Cargo lanes.
|
Package tomlwalk is the shared TOML table walker used by the manifests producer's pyproject/Cargo lanes. |
|
extract/yamlwalk
Package yamlwalk is the shared indentation-based YAML line walker used by the markdown producer's route lane (openapi/drupal/ingress) and the manifests producer's k8s lane.
|
Package yamlwalk is the shared indentation-based YAML line walker used by the markdown producer's route lane (openapi/drupal/ingress) and the manifests producer's k8s lane. |
|
feedback
Package feedback is the deterministic learning loop: the host agent saves how a store answer worked out (Result → memory/results.ndjson), and Reflect aggregates those results — exponential half-life decay, no LLM — into Lessons plus a byte-stable reflections/LESSONS.md.
|
Package feedback is the deterministic learning loop: the host agent saves how a store answer worked out (Result → memory/results.ndjson), and Reflect aggregates those results — exponential half-life decay, no LLM — into Lessons plus a byte-stable reflections/LESSONS.md. |
|
freshness
Package freshness compares a store's recorded source provenance (the git HEAD captured at add time) against the source repo's current HEAD, so an agent can tell whether the store still reflects the code or has fallen behind.
|
Package freshness compares a store's recorded source provenance (the git HEAD captured at add time) against the source repo's current HEAD, so an agent can tell whether the store still reflects the code or has fallen behind. |
|
gitinfo
Package gitinfo is the one place that shells out to git for read-only reflection.
|
Package gitinfo is the one place that shells out to git for read-only reflection. |
|
golden
Package golden is the never-break acceptance net: it gathers known repos — two small committed fixtures (a multi-module config repo and a plain csproj/sln repo) plus env-gated real corpora (linux, Newtonsoft.Json) — and asserts the extraction contract as exact golden snapshots and named landmark facts.
|
Package golden is the never-break acceptance net: it gathers known repos — two small committed fixtures (a multi-module config repo and a plain csproj/sln repo) plus env-gated real corpora (linux, Newtonsoft.Json) — and asserts the extraction contract as exact golden snapshots and named landmark facts. |
|
grammar
Package grammar is `ctx-optimize grammar build` — turn ANY tree-sitter grammar into a drop-in pack (<name>.wasm + <name>.json) with no shell script and nothing preinstalled: grammar source comes from a local dir or a GitHub tarball (no git), the compiler is zig (PATH or auto-downloaded, see zig.go), the tree-sitter runtime is fetched once and cached, and the JSON mapping skeleton is auto-suggested from the grammar's own node-types.json.
|
Package grammar is `ctx-optimize grammar build` — turn ANY tree-sitter grammar into a drop-in pack (<name>.wasm + <name>.json) with no shell script and nothing preinstalled: grammar source comes from a local dir or a GitHub tarball (no git), the compiler is zig (PATH or auto-downloaded, see zig.go), the tree-sitter runtime is fetched once and cached, and the JSON mapping skeleton is auto-suggested from the grammar's own node-types.json. |
|
graphfilter
Package graphfilter is the ONE predicate + projection engine shared by every read verb (nodes/edges/deps, export, query pre-rank narrowing, hubs, affected) so consumers never pipe our output through jq/python (ADR 2026-07-24-portable-export-consumption).
|
Package graphfilter is the ONE predicate + projection engine shared by every read verb (nodes/edges/deps, export, query pre-rank narrowing, hubs, affected) so consumers never pipe our output through jq/python (ADR 2026-07-24-portable-export-consumption). |
|
navigator
Package navigator writes the multi-module root's first-class artifact: a small module index instead of a giant merged graph.
|
Package navigator writes the multi-module root's first-class artifact: a small module index instead of a giant merged graph. |
|
project
instructions.md — the committed, self-contained usage card (ADR 2026-07-17-bundled-adapter-templates, "Scaffold additions").
|
instructions.md — the committed, self-contained usage card (ADR 2026-07-17-bundled-adapter-templates, "Scaffold additions"). |
|
query
Package query answers questions from the local store — lexical scoring (IDF-weighted token overlap) over node labels/sources, then 1-hop neighborhood expansion under a token budget.
|
Package query answers questions from the local store — lexical scoring (IDF-weighted token overlap) over node labels/sources, then 1-hop neighborhood expansion under a token budget. |
|
scan
Package scan discovers module roots inside a repository — the generator half of multi-module support.
|
Package scan discovers module roots inside a repository — the generator half of multi-module support. |
|
scene
Package scene derives a DRAWABLE architecture scene from a store's graph.
|
Package scene derives a DRAWABLE architecture scene from a store's graph. |
|
schema
Package schema is the emit contract — THE load-bearing boundary of ctx-optimize.
|
Package schema is the emit contract — THE load-bearing boundary of ctx-optimize. |
|
search
Package search is the cross-OS literal sweep (ADR 2026-08-13 boundary-model-and-defaults, D4).
|
Package search is the cross-OS literal sweep (ADR 2026-08-13 boundary-model-and-defaults, D4). |
|
selfupdate
Package selfupdate updates the ctx-optimize binary itself.
|
Package selfupdate updates the ctx-optimize binary itself. |
|
skills
Package skills embeds the bundled agent skill and installs it — the binary ships via npm/brew with no repo alongside, so embed-and-write-out is the only reliable delivery.
|
Package skills embeds the bundled agent skill and installs it — the binary ships via npm/brew with no repo alongside, so embed-and-write-out is the only reliable delivery. |
|
sources
Exec bridge (ADR 2026-07-17, "FINAL architecture: companion binary after all"): the MAIN binary carries zero driver imports — real connectors live in internal/sources/connectors, compiled ONLY into the sibling `ctx-optimize-adapters` binary.
|
Exec bridge (ADR 2026-07-17, "FINAL architecture: companion binary after all"): the MAIN binary carries zero driver imports — real connectors live in internal/sources/connectors, compiled ONLY into the sibling `ctx-optimize-adapters` binary. |
|
sources/connectors
mssql.go — the mssql:// / sqlserver:// native-source connector (ADR 2026-07-17-bundled-adapter-templates, Stage 2).
|
mssql.go — the mssql:// / sqlserver:// native-source connector (ADR 2026-07-17-bundled-adapter-templates, Stage 2). |
|
store
Package store is the central, file-based artifact store — the "gathered world".
|
Package store is the central, file-based artifact store — the "gathered world". |
|
usage
Package usage is the served-counter: every read verb appends one ndjson line (what was asked, how many hits, bytes out, duration) to the store's metrics file.
|
Package usage is the served-counter: every read verb appends one ndjson line (what was asked, how many hits, bytes out, duration) to the store's metrics file. |
|
version
Package version carries the build-time version stamp.
|
Package version carries the build-time version stamp. |
|
wiki
Package wiki renders the store's graph into an agent-crawlable markdown wiki — pages derived from nodes+edges ONLY, no LLM, no interpretation (graphify's wiki.py proved the shape works zero-model).
|
Package wiki renders the store's graph into an agent-crawlable markdown wiki — pages derived from nodes+edges ONLY, no LLM, no interpretation (graphify's wiki.py proved the shape works zero-model). |
|
scripts
|
|
|
spikes/queryphases
command
SPIKE: where does query's O(N) second actually go, and what would postings buy?
|
SPIKE: where does query's O(N) second actually go, and what would postings buy? |
Click to show internal directories.
Click to hide internal directories.