knodin 0.5.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/LICENSE +21 -0
- package/README.md +590 -0
- package/dist/bin/cli.js +1704 -0
- package/dist/src/agent-integration.js +250 -0
- package/dist/src/artifact-refresh.js +81 -0
- package/dist/src/cli-args.js +267 -0
- package/dist/src/cli-model.js +324 -0
- package/dist/src/compact-structural.js +96 -0
- package/dist/src/competitive-constraints.js +20 -0
- package/dist/src/competitive-manifest.js +330 -0
- package/dist/src/competitive-measurement.js +183 -0
- package/dist/src/competitive-runner.js +453 -0
- package/dist/src/competitive-sandbox.js +108 -0
- package/dist/src/context-export.js +422 -0
- package/dist/src/context.js +102 -0
- package/dist/src/docs-sections.js +141 -0
- package/dist/src/doctor.js +380 -0
- package/dist/src/engine/ann-hnsw.js +271 -0
- package/dist/src/engine/embeddings.js +193 -0
- package/dist/src/engine/file-walker.js +43 -0
- package/dist/src/engine/index.js +13030 -0
- package/dist/src/engine/perf.js +115 -0
- package/dist/src/engine/prune.js +112 -0
- package/dist/src/engine/source-policy.js +69 -0
- package/dist/src/engine/sqlite.js +71 -0
- package/dist/src/engine/symbol-delete.js +58 -0
- package/dist/src/failure-diagnosis.js +590 -0
- package/dist/src/fleet.js +7 -0
- package/dist/src/git-executable.js +31 -0
- package/dist/src/graph-query-health.js +115 -0
- package/dist/src/index-activity.js +125 -0
- package/dist/src/init-progress-worker.js +107 -0
- package/dist/src/init-progress.js +155 -0
- package/dist/src/init.js +985 -0
- package/dist/src/lifecycle-health.js +213 -0
- package/dist/src/lsp-readonly.js +217 -0
- package/dist/src/output-compression.js +629 -0
- package/dist/src/output-telemetry.js +359 -0
- package/dist/src/pr-triage.js +638 -0
- package/dist/src/relationship-adapters.js +370 -0
- package/dist/src/release-attestation.js +533 -0
- package/dist/src/repair-progress-worker.js +121 -0
- package/dist/src/repair-progress.js +262 -0
- package/dist/src/repository-init-process.js +173 -0
- package/dist/src/repository-management.js +1089 -0
- package/dist/src/response-budget.js +184 -0
- package/dist/src/server.js +53 -0
- package/dist/src/system-config.js +615 -0
- package/dist/src/terminal-help.js +83 -0
- package/dist/src/tools/knodin-tools.js +1438 -0
- package/dist/src/tools/reckon-tools.js +5 -0
- package/dist/src/update-policy.js +944 -0
- package/dist/src/update-trust.js +503 -0
- package/dist/src/version.js +13 -0
- package/dist/src/visualization.js +162 -0
- package/dist/src/wait-for-fresh.js +98 -0
- package/dist/src/worktree-lifecycle.js +231 -0
- package/docs/CLI.md +39 -0
- package/docs/COMMAND-OUTPUT-COMPRESSION.md +194 -0
- package/docs/DEAD-CODE-AND-IMPACT.md +27 -0
- package/docs/DOCTOR-AND-UPDATES.md +84 -0
- package/docs/INDEXING-POLICY-AND-PROVENANCE.md +37 -0
- package/docs/INSTALLATION.md +208 -0
- package/docs/MCP.md +100 -0
- package/docs/PT-ACCESS-RECOMMENDATION.md +91 -0
- package/docs/RELEASE-0.3-EVIDENCE.md +73 -0
- package/docs/REPOSITORIES-AND-WORKTREES.md +81 -0
- package/docs/SIGNED-UPDATES.md +146 -0
- package/docs/SYSTEMS-AND-RELATIONSHIPS.md +45 -0
- package/docs/TELEMETRY.md +42 -0
- package/docs/releases/0.3.0.md +46 -0
- package/docs/releases/0.4.0.md +68 -0
- package/docs/releases/0.4.1.md +28 -0
- package/docs/releases/0.4.2.md +27 -0
- package/docs/releases/0.4.3.md +23 -0
- package/docs/releases/0.5.0.md +29 -0
- package/package.json +110 -0
- package/schemas/release-attestation-v1.schema.json +210 -0
- package/tree-sitter-prisma.wasm +0 -0
- package/tree-sitter-sql.wasm +0 -0
- package/tree-sitter-xml.wasm +0 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Docusign, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
# knodin
|
|
2
|
+
|
|
3
|
+
<img src="docs/assets/knodin-favicon.svg" alt="knodin caret-beak logo" width="96" height="96">
|
|
4
|
+
|
|
5
|
+
> knodin remembers how your code is connected and shows what may move when it
|
|
6
|
+
> changes.
|
|
7
|
+
|
|
8
|
+
knodin is a native local code-intelligence engine, CLI, and one-tool MCP
|
|
9
|
+
gateway. It persists and refreshes a repository graph, resolves symbols without
|
|
10
|
+
hiding ambiguity, and delivers source-evidenced impact analysis, review,
|
|
11
|
+
architecture maps, hybrid search, bounded context export, and lifecycle
|
|
12
|
+
health/repair behind one compact local tool.
|
|
13
|
+
|
|
14
|
+
| Command | Job | Modeled on |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| `knodin explain <symbol>` | edit-ready verbatim source + call paths + blast radius | codegraph |
|
|
17
|
+
| `knodin review [base] [--scope unstaged\|staged\|all\|compare]` | risk-scored context for a selected diff; always reports changed files separately from mapped symbols | code-review-graph |
|
|
18
|
+
| `knodin map` | subsystems (communities) + confidence-tagged edges | Graphify |
|
|
19
|
+
|
|
20
|
+
For context efficiency, `knodin pack` exports bounded source and
|
|
21
|
+
`knodin compress` reduces already-produced build/test logs under hard line and
|
|
22
|
+
UTF-8 byte budgets. Compression preserves exit metadata and detected
|
|
23
|
+
diagnostics, reports exact omissions, and retains private local drill-down
|
|
24
|
+
without running a command. A retained failure can then be mapped to owning
|
|
25
|
+
symbols and packages, related tests, callers, dependencies, recent changes,
|
|
26
|
+
bounded source, and exact graph freshness with
|
|
27
|
+
`knodin compress diagnose <artifact-id>`. See the
|
|
28
|
+
[compression and command-security contract](docs/COMMAND-OUTPUT-COMPRESSION.md).
|
|
29
|
+
|
|
30
|
+
Its core graph runs **locally, with no auth** through standard CLI and MCP
|
|
31
|
+
interfaces. A generic JSON-RPC handshake is tested; named-client compatibility
|
|
32
|
+
is limited to the adapters and environments actually exercised. The optional
|
|
33
|
+
`prs` operation delegates to the user's authenticated `gh` CLI. An external gateway such as
|
|
34
|
+
an organization’s existing MCP gateway can optionally federate it; that
|
|
35
|
+
integration is not required for knodin’s engine, CLI, or MCP server.
|
|
36
|
+
|
|
37
|
+
## Show me the value
|
|
38
|
+
|
|
39
|
+
knodin is for an engineer or coding agent about to change unfamiliar code. It
|
|
40
|
+
answers three practical questions before the edit:
|
|
41
|
+
|
|
42
|
+
1. **What does this code do?** Read-ready source and resolved relationships
|
|
43
|
+
orient the next investigation.
|
|
44
|
+
2. **What else could this change affect?** Diff scope, typed traversal, and
|
|
45
|
+
bounded impact evidence make the review surface explicit.
|
|
46
|
+
3. **Can I adopt it tomorrow?** Run one local CLI or MCP gateway against the
|
|
47
|
+
existing repository from this source checkout or a locally built package—no
|
|
48
|
+
account, hosted index, source egress, or workflow migration.
|
|
49
|
+
|
|
50
|
+
The intended value is not “AI code intelligence.” It is fewer missed
|
|
51
|
+
dependencies and less manual context assembly in the orient → edit → review
|
|
52
|
+
loop. Those human/agent outcomes have not yet been established by an end-to-end
|
|
53
|
+
controlled study; checked-in replays measure narrower correctness, latency,
|
|
54
|
+
response-size, and retrieval outcomes. The engine,
|
|
55
|
+
CLI, and MCP gateway are implemented today; knodin reports only outcomes that
|
|
56
|
+
its checked-in fixtures and replays support. See
|
|
57
|
+
[`roadmap/competitive-roadmap.md`](roadmap/competitive-roadmap.md) for the
|
|
58
|
+
current evidence and known gaps.
|
|
59
|
+
|
|
60
|
+
## What is the ROI?
|
|
61
|
+
|
|
62
|
+
knodin compresses repeated “find the definition, read it, find callers, inspect
|
|
63
|
+
the diff, locate tests” work into bounded, source-evidenced calls. That means
|
|
64
|
+
fewer agent round trips, less duplicated context, and fewer changes reviewed
|
|
65
|
+
without their reachable dependencies. Operationally, it is one local process
|
|
66
|
+
with no account, hosted index, credential flow, source egress, or mandatory
|
|
67
|
+
database/vector daemon. ROI is measured in correctness, latency, response size,
|
|
68
|
+
safety, and effort by the checked-in replay harness—not an unsupported generic
|
|
69
|
+
productivity percentage.
|
|
70
|
+
|
|
71
|
+
## Where does knodin compete?
|
|
72
|
+
|
|
73
|
+
There is no canonical industry standard that divides code-intelligence products
|
|
74
|
+
into exactly four categories. Current products overlap. Their primary jobs do,
|
|
75
|
+
however, fall into four useful categories when deciding what to give an engineer
|
|
76
|
+
or coding agent:
|
|
77
|
+
|
|
78
|
+
| Category | Question it answers | Representative tools | knodin surface |
|
|
79
|
+
|---|---|---|---|
|
|
80
|
+
| **Symbol navigation and graph exploration** | Where is this symbol, what calls it, and what does it call? | [CodeGraph](https://github.com/colbymchenry/codegraph), [Serena](https://github.com/oraios/serena), [Sourcegraph code navigation](https://sourcegraph.com/docs/code-navigation) | `explain`, `query callers_of` / `callees_of`, `shortest_path`, LSP queries |
|
|
81
|
+
| **Change impact and code review** | What can this diff affect, how risky is it, and where are the test gaps? | [code-review-graph](https://github.com/tirth8205/code-review-graph), [Greptile](https://www.greptile.com/docs/introduction), Graphify’s [PR-impact tools](https://graphify.com/mcp) | `review`, `impact`, `traverse`, `tests_for`, `prs` |
|
|
82
|
+
| **Architecture and dependency mapping** | What are the subsystems, hubs, boundaries, and execution flows? | [Graphify](https://graphify.com/concepts), [GitNexus](https://github.com/abhigyanpatwari/GitNexus) | `map`, `architecture_overview`, `community`, `flows`, `wiki`, `visualize` |
|
|
83
|
+
| **Retrieval and context assembly** | Which code or diagnostic evidence should the agent receive for this task and token budget? | [Aider repo map](https://aider.chat/docs/repomap.html), [Repomix](https://repomix.com/guide/), semantic-search/context engines | `context`, hybrid `search`, bounded `pack`, recoverable `compress` |
|
|
84
|
+
|
|
85
|
+
This is a job-based taxonomy, not a claim that every product fits only one box.
|
|
86
|
+
CodeGraph and Graphify now expose impact features, for example, while
|
|
87
|
+
Sourcegraph combines search and precise navigation. knodin competes by composing
|
|
88
|
+
all four jobs over one fresh local index and exposing them through one CLI and
|
|
89
|
+
one operation-routed MCP tool. Breadth alone is not proof of superiority; the
|
|
90
|
+
[comparison notes](docs/COMPARISON.md) and
|
|
91
|
+
[competitive roadmap](roadmap/competitive-roadmap.md) distinguish checked-in
|
|
92
|
+
replays, attributed vendor claims, setup blockers, and known limitations.
|
|
93
|
+
The [Token Optimizer scorecard](docs/TOKEN-OPTIMIZER-SCORECARD.md) gives the
|
|
94
|
+
evidence-linked disposition for every pinned capability and records where
|
|
95
|
+
knodin is still weaker or intentionally different.
|
|
96
|
+
|
|
97
|
+
Static application-security products such as
|
|
98
|
+
[CodeQL](https://codeql.github.com/docs/codeql-overview/about-codeql/) and
|
|
99
|
+
[Semgrep](https://semgrep.dev/docs/) are adjacent, not substitutes: knodin can
|
|
100
|
+
report structural dead-code candidates and selected diagnostics, but it is not
|
|
101
|
+
a SAST engine or a proof that dynamically wired code is unreachable. That
|
|
102
|
+
distinction matters for framework and Salesforce entrypoints that static
|
|
103
|
+
analysis may not fully resolve.
|
|
104
|
+
|
|
105
|
+
## What happens tomorrow?
|
|
106
|
+
|
|
107
|
+
Public npm remains the primary cross-platform path. The commands below become
|
|
108
|
+
canonical when the first `knodin` release is published. Existing
|
|
109
|
+
`reckon-graph` installs continue to work through the legacy package and
|
|
110
|
+
`reckon` executable alias. Homebrew and GHES paths remain on their legacy names
|
|
111
|
+
until those external repositories are renamed and their knodin artifacts pass
|
|
112
|
+
the release gates.
|
|
113
|
+
|
|
114
|
+
On Windows, macOS, or Linux with Node.js 24 or newer, install the public
|
|
115
|
+
[npm package](https://www.npmjs.com/package/knodin):
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
npm install --global --ignore-scripts knodin
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
After the Homebrew tap migration, the macOS or Linux path will be:
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
brew install knowdin/tap/knodin
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
pnpm, Bun, mise, Volta, nvm, fnm, and asdf behavior and verification status are
|
|
128
|
+
listed in the installation matrix. Commands without a recorded release gate
|
|
129
|
+
are guidance, not verified support:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
pnpm add --global --ignore-scripts knodin@<version>
|
|
133
|
+
bun add --global --ignore-scripts knodin@<version>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Temporary runners are not suitable for the stable hook and MCP command paths
|
|
137
|
+
created by `knodin init`. See the [installation guide](docs/INSTALLATION.md)
|
|
138
|
+
for verified status, Node/version-manager behavior, registries, Homebrew,
|
|
139
|
+
upgrades, and uninstall commands.
|
|
140
|
+
|
|
141
|
+
P&T engineers without GitHub SaaS access can continue using the current GHES
|
|
142
|
+
mirror until the knodin path is promoted. See the
|
|
143
|
+
[P&T GHES procedure](docs/PT-ACCESS-RECOMMENDATION.md) for the migration gate.
|
|
144
|
+
|
|
145
|
+
Then initialize an existing checkout:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
cd /path/to/repository
|
|
149
|
+
knodin init
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
On an interactive terminal, `knodin init` asks how agent integration should be
|
|
153
|
+
scoped and configures all detected supported agents in one operation:
|
|
154
|
+
|
|
155
|
+
- **Personal (recommended):** configures local Claude Code, Codex, Gemini CLI,
|
|
156
|
+
and Antigravity adapters when detected. knodin-owned untracked files are
|
|
157
|
+
listed in `.git/info/exclude`, so the repository stays clean and teammates
|
|
158
|
+
are not required to install knodin.
|
|
159
|
+
- **Team:** creates merge-safe, commit-ready MCP configuration for the primary
|
|
160
|
+
agents in `.mcp.json`, `.codex/config.toml`, `.gemini/settings.json`, and
|
|
161
|
+
`.agents/mcp_config.json`, plus managed instruction blocks in `AGENTS.md` and
|
|
162
|
+
`GEMINI.md`. Commit these files so every supported agent sees the same
|
|
163
|
+
gateway. Repeated team initialization is byte-idempotent once they are
|
|
164
|
+
current.
|
|
165
|
+
- **CLI-only:** builds and refreshes the graph but does not configure agents.
|
|
166
|
+
Agents will generally not discover or invoke knodin; commands must be run
|
|
167
|
+
manually.
|
|
168
|
+
|
|
169
|
+
Non-interactive initialization defaults to `personal`. Select explicitly or
|
|
170
|
+
change the choice later:
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
knodin init --scope personal
|
|
174
|
+
knodin configure --scope team
|
|
175
|
+
knodin configure --scope cli-only
|
|
176
|
+
knodin configure --status
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Scope changes are reversible and modify only knodin-owned configuration.
|
|
180
|
+
Before adding any exclusion, knodin verifies that the path is untracked.
|
|
181
|
+
Already-tracked files are never added to `.git/info/exclude` or `.gitignore`,
|
|
182
|
+
and personal mode never overwrites tracked agent configuration.
|
|
183
|
+
|
|
184
|
+
The package is public on npm, and consumers do not need Bun. Organizations may
|
|
185
|
+
also mirror it through an approved npm-compatible registry without changing the
|
|
186
|
+
CLI workflow. To test an unpublished change, build and install the exact tarball
|
|
187
|
+
from a source checkout:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
npm ci
|
|
191
|
+
TARBALL=$(npm pack --silent)
|
|
192
|
+
npm install --global --ignore-scripts "./$TARBALL"
|
|
193
|
+
cd /path/to/repository
|
|
194
|
+
knodin init
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### About npm install warnings
|
|
198
|
+
|
|
199
|
+
knodin’s standard CPU workflow is verified with dependency lifecycle scripts
|
|
200
|
+
disabled. The `--ignore-scripts` flag makes that policy explicit and avoids
|
|
201
|
+
prompting users to approve transitive install code they do not need. The native
|
|
202
|
+
CPU binaries used by knodin are already supplied as platform packages.
|
|
203
|
+
|
|
204
|
+
Without that flag, recent npm releases may report blocked scripts from
|
|
205
|
+
`onnxruntime-node`, `sharp`, and `protobufjs`. Do not approve them blindly for a
|
|
206
|
+
normal knodin installation. ONNX Runtime’s script can fetch optional Linux x64
|
|
207
|
+
CUDA components; Sharp’s checks whether it needs a local source build; and
|
|
208
|
+
ProtobufJS performs a dependency-version compatibility check. None is required
|
|
209
|
+
by knodin’s verified CPU path.
|
|
210
|
+
|
|
211
|
+
You may also see a deprecation notice for `boolean@3.2.0`. It is an upstream
|
|
212
|
+
transitive dependency in the current
|
|
213
|
+
`@huggingface/transformers → onnxruntime-node → global-agent` chain, not a
|
|
214
|
+
package knodin calls directly. A deprecation notice is not by itself a
|
|
215
|
+
vulnerability, but it is dependency debt that must be removed when the upstream
|
|
216
|
+
runtime pin permits it. Use `npm audit --omit=dev` to check the installed
|
|
217
|
+
production tree for current advisories.
|
|
218
|
+
|
|
219
|
+
The package is verified for npm tarball consumption; registry publication is a
|
|
220
|
+
separate release action documented in the
|
|
221
|
+
[release runbook](docs/RELEASING.md). Use the CLI directly or connect the
|
|
222
|
+
single `knodin` MCP gateway. The first useful calls are:
|
|
223
|
+
|
|
224
|
+
- `knodin status --deep` to verify index health and coverage;
|
|
225
|
+
- `knodin context "<task>"` for bounded orientation;
|
|
226
|
+
- `knodin explain <symbol>` before an edit;
|
|
227
|
+
- `knodin review --scope all` before review or handoff;
|
|
228
|
+
- `knodin map`, `search`, and `query` for architecture and targeted graph facts.
|
|
229
|
+
|
|
230
|
+
No workflow migration or hosted rollout is required.
|
|
231
|
+
|
|
232
|
+
Dependency provenance, blocked-script behavior, and the scheduled upstream
|
|
233
|
+
deprecation canary are documented in
|
|
234
|
+
[`docs/dependency-hygiene.md`](docs/dependency-hygiene.md).
|
|
235
|
+
|
|
236
|
+
### Verify the locally built distributable package
|
|
237
|
+
|
|
238
|
+
Before tagging or publishing a release, run the clean-consumer acceptance
|
|
239
|
+
gate:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
npm run test:pack-install
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
The gate requires Node.js 24+, npm, `git`, `tar`, `ps`, and `expect` on the
|
|
246
|
+
release host. It creates a real `npm pack` tarball, checks its compiled CLI, engine,
|
|
247
|
+
MCP gateway, license, metadata, and parser WASMs, and installs that exact
|
|
248
|
+
artifact globally under a temporary prefix with an isolated npm cache and a
|
|
249
|
+
`PATH` that contains no Bun executable. It runs `knodin init` in two repositories,
|
|
250
|
+
then exercises foreground
|
|
251
|
+
post-commit, post-checkout, post-merge, and post-rewrite refreshes across
|
|
252
|
+
TypeScript and Salesforce source/metadata. It also checks deep index health,
|
|
253
|
+
graph query evidence, rename/deletion reconciliation, and repair output stream
|
|
254
|
+
separation for plain, JSON, JSONL, silent, and automatic TTY progress modes. A
|
|
255
|
+
real JSON-RPC initialize plus `tools/list` handshake proves that the packed MCP
|
|
256
|
+
server exposes the single `knodin` gateway.
|
|
257
|
+
|
|
258
|
+
Every child command is sequential and bounded by time, output, and a 2,750 MiB
|
|
259
|
+
aggregate process-tree RSS safety limit that includes the runner, command,
|
|
260
|
+
descendants, and sampler. Limit failures terminate the command process group.
|
|
261
|
+
The temporary artifact, cache, consumer checkout, and local graph are removed
|
|
262
|
+
whether the gate passes or fails. A passing run prints one JSON evidence record
|
|
263
|
+
containing tarball size, command time, and observed peak RSS.
|
|
264
|
+
|
|
265
|
+
This proves the exact locally built tarball. It does not claim registry
|
|
266
|
+
publication, remote release upload, or compatibility beyond the environments
|
|
267
|
+
covered by the gate.
|
|
268
|
+
|
|
269
|
+
### Model and repository storage
|
|
270
|
+
|
|
271
|
+
Each checkout keeps its graph in `.reckon/db.sqlite`. The local
|
|
272
|
+
`Xenova/all-MiniLM-L6-v2` model is downloaded once per user account into the
|
|
273
|
+
machine cache and shared by every repository:
|
|
274
|
+
|
|
275
|
+
- macOS: `~/Library/Caches/knodin/models`
|
|
276
|
+
- Linux: `${XDG_CACHE_HOME:-~/.cache}/knodin/models`
|
|
277
|
+
- Windows: `%LOCALAPPDATA%\knodin\models`
|
|
278
|
+
|
|
279
|
+
Set `RECKON_MODEL_CACHE` to use a different shared location. Repository
|
|
280
|
+
initialization never places a duplicate model inside `.reckon` or the installed
|
|
281
|
+
npm package. Managed networks can set `RECKON_MODEL_HOST` to an approved
|
|
282
|
+
HTTP(S) mirror of the Hugging Face repository; the mirror is used only when the
|
|
283
|
+
shared cache is cold.
|
|
284
|
+
|
|
285
|
+
### Language and metadata support
|
|
286
|
+
|
|
287
|
+
knodin does not claim universal programming-language support. Its native parser
|
|
288
|
+
set currently covers TypeScript, JavaScript, Python, Java, C#, Apex, SQL/PLSQL,
|
|
289
|
+
Prisma, and XML-backed formats. It also has specialized structural indexers for
|
|
290
|
+
Salesforce source and selected metadata, Terraform/HCL, Dockerfiles, dbt
|
|
291
|
+
manifests, Workday Studio XML, and LSIF graph imports.
|
|
292
|
+
|
|
293
|
+
Coverage is not identical across those formats, and a file being parseable does
|
|
294
|
+
not imply every dynamic dependency can be resolved. Go, Rust, PHP, Ruby, Kotlin,
|
|
295
|
+
Swift, Perl, PowerShell, Bash, and MuleSoft/RAML are among the currently known
|
|
296
|
+
native-parser gaps. See the
|
|
297
|
+
[language and metadata support matrix](docs/LANGUAGE-SUPPORT.md) for exact
|
|
298
|
+
extensions, capability tiers, Salesforce limitations, and the evidence-based
|
|
299
|
+
Docusign coverage assessment.
|
|
300
|
+
|
|
301
|
+
## What makes knodin unique? What is the secret sauce?
|
|
302
|
+
|
|
303
|
+
Individual graph features are easy to copy. knodin’s differentiator is the
|
|
304
|
+
combination of stable symbol resolution, source-evidenced review/impact answers,
|
|
305
|
+
truthful response budgets, explicit freshness, and a local one-tool MCP surface.
|
|
306
|
+
The native engine composes those constraints across orientation, editing,
|
|
307
|
+
review, architecture, search, and export. That system-level combination—not a
|
|
308
|
+
single algorithm—is the secret sauce. It must remain measurable,
|
|
309
|
+
privacy-preserving, and compatible with ordinary Git and editor workflows.
|
|
310
|
+
|
|
311
|
+
## Why an agent picks this over grep
|
|
312
|
+
|
|
313
|
+
One MCP tool with operation-routed capabilities, no account to create and
|
|
314
|
+
nothing sent off the machine—versus a Grep/Read loop, or a competitor that pays
|
|
315
|
+
a much larger fixed context cost every session for tools it may never call. See
|
|
316
|
+
[`docs/COMPARISON.md`](docs/COMPARISON.md) for the honest, claim-attributed
|
|
317
|
+
comparison against codegraph, code-review-graph, graphify, and the wider field.
|
|
318
|
+
|
|
319
|
+
### Review diff selection
|
|
320
|
+
|
|
321
|
+
`review` supports four explicit scopes: `unstaged` compares the index to the
|
|
322
|
+
working tree (and includes untracked files), `staged` compares `HEAD` to the
|
|
323
|
+
index, `all` compares the supplied base through the complete working tree, and
|
|
324
|
+
`compare` compares the supplied base (default `HEAD~1`) to `HEAD`. The legacy
|
|
325
|
+
`knodin review [base]` call remains compatible and maps to `scope=all`.
|
|
326
|
+
|
|
327
|
+
For a checkout-independent review, use `--from <older> --to <newer>` for an
|
|
328
|
+
explicit revision pair, or `--files <a,b>` for an explicit repo-relative file
|
|
329
|
+
list. MCP callers use `diffScope`, `from`/`toRevision`, and `reviewFiles`.
|
|
330
|
+
Results return `changedFiles` for every path plus `mappedChangedFiles`,
|
|
331
|
+
`unmappedChangedFiles`, and truthful counts; symbol analysis remains separate in
|
|
332
|
+
`changedSymbols`.
|
|
333
|
+
|
|
334
|
+
Capability alone does not win the routing decision. The compact always-on tool
|
|
335
|
+
description distinguishes orientation and graph work from exact literals,
|
|
336
|
+
non-code files, and recent edits where direct reads win. Full operation and
|
|
337
|
+
parameter guidance is retrieved on demand with
|
|
338
|
+
`{ "operation": "docs", "section": "quickstart" }`. See
|
|
339
|
+
[`src/tools/knodin-tools.ts`](src/tools/knodin-tools.ts) for the exact text an
|
|
340
|
+
agent sees.
|
|
341
|
+
|
|
342
|
+
## Status and proof
|
|
343
|
+
|
|
344
|
+
The native local engine, CLI, and MCP gateway are implemented and covered by
|
|
345
|
+
hundreds of tests and labeled replays. Competitive leadership claims are
|
|
346
|
+
narrower: symbol identity, diff/traversal, architecture, and context-packing
|
|
347
|
+
replays are complete. C28's frozen replay records stronger dead-code precision
|
|
348
|
+
and semantic relevance than pinned GitNexus on the shared oracle. C31's pinned
|
|
349
|
+
codebase-memory and grepai lifecycle replay covers stale-state detection,
|
|
350
|
+
documented refresh, healthy-symbol preservation, and native telemetry gaps;
|
|
351
|
+
Claude Context remains a separately classified setup blocker. C32's bounded
|
|
352
|
+
local API and statement-flow replay found no broader production-surface gap.
|
|
353
|
+
Local graph-artifact freshness across checkout and merge events is implemented
|
|
354
|
+
with bounded, auditable refresh states. See the
|
|
355
|
+
[competitive roadmap](roadmap/competitive-roadmap.md) and
|
|
356
|
+
[comparison notes](docs/COMPARISON.md) for the evidence rather than relying on
|
|
357
|
+
feature lists.
|
|
358
|
+
|
|
359
|
+
### Refresh optional graph artifacts
|
|
360
|
+
|
|
361
|
+
`knodin refresh-artifacts checkout|merge|code-change` is an explicit local
|
|
362
|
+
maintenance command for installed GitNexus and Graphify indexes. It prefers the
|
|
363
|
+
repository's GitNexus runner when present, bounds each rebuild to 30 seconds,
|
|
364
|
+
and records every artifact as `success`, `failed`, or `skipped` in
|
|
365
|
+
`.reckon/artifact-refresh.jsonl`. It never runs from a commit hook and never
|
|
366
|
+
reports an unavailable external index as fresh.
|
|
367
|
+
|
|
368
|
+
## Stack
|
|
369
|
+
|
|
370
|
+
Node.js 24+ · TypeScript · Node SQLite · `@modelcontextprotocol/sdk` · Zod ·
|
|
371
|
+
Biome · Vitest · lefthook.
|
|
372
|
+
Tools are registered via the low-level request-handler API (never the high-level
|
|
373
|
+
`server.tool()` overload — see `CLAUDE.md`).
|
|
374
|
+
|
|
375
|
+
## License
|
|
376
|
+
|
|
377
|
+
knodin is open-source software licensed under the
|
|
378
|
+
[MIT License](LICENSE). You may use, copy, modify, merge, publish, distribute,
|
|
379
|
+
sublicense, and sell copies subject to the license terms.
|
|
380
|
+
|
|
381
|
+
## Develop
|
|
382
|
+
|
|
383
|
+
```bash
|
|
384
|
+
npm ci
|
|
385
|
+
npm run dev
|
|
386
|
+
npm run cli -- map
|
|
387
|
+
npm run cli -- visualize createServer --output .reckon/architecture.html --depth 3
|
|
388
|
+
npm test
|
|
389
|
+
npm run test:handles
|
|
390
|
+
npm run lint
|
|
391
|
+
npm run typecheck
|
|
392
|
+
npm run test:pack-install
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
For the additional local SonarQube quality gate, see
|
|
396
|
+
[docs/SONARQUBE.md](docs/SONARQUBE.md). It uses a project-scoped token outside
|
|
397
|
+
Git and distinguishes the SonarQube CLI from the full repository scanner.
|
|
398
|
+
|
|
399
|
+
## Use as an MCP server
|
|
400
|
+
|
|
401
|
+
The installed package exposes a stdio MCP server through `knodin serve`.
|
|
402
|
+
`knodin init` registers it for detected clients according to the selected
|
|
403
|
+
scope. Manual registration remains available for unsupported clients or
|
|
404
|
+
custom setups. The server advertises exactly one top-level tool named
|
|
405
|
+
`knodin`, with capabilities selected by its `operation` argument.
|
|
406
|
+
For clients that accept the common `mcpServers` JSON shape:
|
|
407
|
+
|
|
408
|
+
```json
|
|
409
|
+
{
|
|
410
|
+
"mcpServers": {
|
|
411
|
+
"knodin": {
|
|
412
|
+
"command": "knodin",
|
|
413
|
+
"args": ["serve"]
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
If the client does not inherit the interactive shell's `PATH`, replace
|
|
420
|
+
`"knodin"` with the absolute path printed by `command -v knodin`. From this
|
|
421
|
+
source checkout, an uninstalled development fallback is:
|
|
422
|
+
|
|
423
|
+
```json
|
|
424
|
+
{
|
|
425
|
+
"mcpServers": {
|
|
426
|
+
"knodin": {
|
|
427
|
+
"command": "node",
|
|
428
|
+
"args": ["/absolute/path/to/knodin/dist/bin/cli.js", "serve"]
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
Run `npm run build` in the source checkout before using that compiled fallback.
|
|
435
|
+
|
|
436
|
+
After registration, an MCP `tools/list` call returns the single `knodin`
|
|
437
|
+
gateway. Its operations include `context`, `explain`, `review`, `map`,
|
|
438
|
+
`search`, `query`, `prs`, `wiki`, `docs`, `pack`, `status`, `repair`, and
|
|
439
|
+
`telemetry`. The `prs` operation uses the caller's local authenticated `gh`
|
|
440
|
+
CLI; knodin stores no GitHub credentials.
|
|
441
|
+
|
|
442
|
+
## Response budgets
|
|
443
|
+
|
|
444
|
+
Every gateway operation is bounded after JSON serialization and returns a
|
|
445
|
+
`responseBudget` block with the effective byte/token/item limits, serialized
|
|
446
|
+
size, estimated tokens, original collection totals, truncation state, and a
|
|
447
|
+
continuation instruction. Token estimates are deterministic: four serialized
|
|
448
|
+
UTF-8 bytes per token. Callers may override `byteBudget`, `tokenBudget`, and
|
|
449
|
+
`itemBudget`; the tightest limit wins. The minimum accepted envelope is 256
|
|
450
|
+
bytes (64 estimated tokens). Defaults are 64 KiB/16K tokens/100 items,
|
|
451
|
+
with operation-specific ceilings of 16 KiB for minimal explain, 32 KiB for
|
|
452
|
+
minimal map, 64 KiB for standard explain, and 128 KiB for standard map.
|
|
453
|
+
The CLI exposes the same envelope on every JSON command as `--bytes`,
|
|
454
|
+
`--tokens`, and `--items`; its compact JSON output is the exact serialization
|
|
455
|
+
used for accounting. `knodin search <query> [limit]` remains supported, with
|
|
456
|
+
`--limit` taking precedence when both forms are present.
|
|
457
|
+
|
|
458
|
+
Minimal explain omits source by default; pass `includeSource: true` to request
|
|
459
|
+
it. Standard explain retains edit-ready source and, if a requested budget is
|
|
460
|
+
too small, reports an explicit continuation instead of silently dropping it.
|
|
461
|
+
Minimal map contains only counts, aggregates, and bounded top summaries: it
|
|
462
|
+
does not return community member arrays or full edge lists.
|
|
463
|
+
|
|
464
|
+
`knodin status` audits the local index schema, embedding model, package
|
|
465
|
+
version, file/symbol coverage, missing and orphaned records, and last successful
|
|
466
|
+
reconciliation. It also verifies that active Git hooks still route to knodin's
|
|
467
|
+
background indexer and records the last failed background execution. A healthy
|
|
468
|
+
snapshot with displaced hooks or a failed refresh command carries explicit
|
|
469
|
+
`lifecycle-degraded` availability metadata, with `.reckon/indexer.log` named
|
|
470
|
+
for diagnosis. Graph reads may continue from an otherwise complete index while
|
|
471
|
+
preserving that degraded freshness state. `knodin repair` rebuilds only damaged or missing state and then
|
|
472
|
+
verifies it, preserving healthy data. MCP exposes the same `status` and
|
|
473
|
+
`repair` operations. The MCP `telemetry` operation reads the process-local,
|
|
474
|
+
metadata-only benchmark log (operation, latency, serialized bytes, estimated
|
|
475
|
+
tokens, truncation, and detail mode) without changing existing response shapes.
|
|
476
|
+
Persistence is off by default; `persistTelemetry: true`
|
|
477
|
+
explicitly appends source-free records to `.reckon-telemetry.jsonl`. No telemetry
|
|
478
|
+
or source is sent over the network.
|
|
479
|
+
|
|
480
|
+
Graph reads never turn missing health evidence into an ordinary empty answer.
|
|
481
|
+
CLI and MCP results distinguish `no-match`, `not-initialized`,
|
|
482
|
+
`empty-repository`, `empty-index`, `repair-needed`, `indexing`,
|
|
483
|
+
`lifecycle-degraded`, and `unknown`. Unavailable states fail closed with
|
|
484
|
+
remediation; a queryable but lifecycle-degraded graph retains that state in its
|
|
485
|
+
availability metadata.
|
|
486
|
+
|
|
487
|
+
### Repository and system management
|
|
488
|
+
|
|
489
|
+
`knodin repos discover|init|status|doctor <root...>` manages local checkouts
|
|
490
|
+
without declaring them one system. Linked worktrees require the explicit
|
|
491
|
+
`--linked-worktrees=include` option. Main worktrees, linked worktrees, nested
|
|
492
|
+
repositories, stale metadata, and unrelated repositories remain distinct.
|
|
493
|
+
`knodin repos search "<query>" --root <path>` searches those independent
|
|
494
|
+
checkouts sequentially under hard item/token/byte budgets. It fails closed for
|
|
495
|
+
unhealthy selected graphs unless `--allow-partial` is explicit, in which case
|
|
496
|
+
every omission is named.
|
|
497
|
+
`knodin fleet init` is a deprecated JSON-safe compatibility alias for two minor
|
|
498
|
+
releases.
|
|
499
|
+
|
|
500
|
+
Team-owned stable identities and cooperating components belong in
|
|
501
|
+
`reckon.yaml`; personal checkout paths belong under XDG configuration. Use
|
|
502
|
+
`knodin system list|show|validate|query`. See:
|
|
503
|
+
|
|
504
|
+
- [Repositories and worktrees](docs/REPOSITORIES-AND-WORKTREES.md)
|
|
505
|
+
- [Systems and relationships](docs/SYSTEMS-AND-RELATIONSHIPS.md)
|
|
506
|
+
- [Indexing policy and provenance](docs/INDEXING-POLICY-AND-PROVENANCE.md)
|
|
507
|
+
- [Dead code and impact](docs/DEAD-CODE-AND-IMPACT.md)
|
|
508
|
+
- [MCP configuration](docs/MCP.md)
|
|
509
|
+
- [Doctor and updates](docs/DOCTOR-AND-UPDATES.md)
|
|
510
|
+
|
|
511
|
+
`knodin init` and `knodin index` render phase-aware, asynchronous progress on
|
|
512
|
+
stderr, so terminal animation and elapsed time continue even while parsing or
|
|
513
|
+
embedding keeps the main process busy. An explicit `knodin index <files...>`
|
|
514
|
+
updates only files whose indexed snapshots differ from disk; files made current
|
|
515
|
+
by a preceding repair finish immediately. Use `--force` only when an unchanged
|
|
516
|
+
file truly needs rebuilding. Every index run ends with a forced graph-health
|
|
517
|
+
audit. If an explicit file list omitted other repository drift, the command
|
|
518
|
+
names the first remaining issue and exits nonzero instead of allowing a chained
|
|
519
|
+
review to consume an unhealthy graph. `knodin init` enforces the same verified
|
|
520
|
+
postcondition: lifecycle hooks may be installed, but initialization does not
|
|
521
|
+
report success when graph issues remain. Human `status` and initialization
|
|
522
|
+
errors name the first concrete inconsistency before directing the user to
|
|
523
|
+
`knodin repair`. When Lefthook is present, initialization keeps its generated
|
|
524
|
+
hook jobs active while disabling their implicit hook reinstall, so they do not
|
|
525
|
+
replace knodin's lifecycle wrappers. Repair scopes stable-identity and reference
|
|
526
|
+
rebinding to repaired files and reports embedding candidates as they complete,
|
|
527
|
+
while the final human summary remains on stdout.
|
|
528
|
+
|
|
529
|
+
For a Git checkout, full indexing, reconciliation, deep status, and repair use
|
|
530
|
+
the same source universe: tracked files plus unignored untracked files. Generated
|
|
531
|
+
files excluded by Git are not counted as missing coverage, and legacy indexed
|
|
532
|
+
rows that have since become ignored are removed during reconciliation or repair.
|
|
533
|
+
|
|
534
|
+
`knodin refresh-artifacts [checkout|merge|code-change]` is an explicit opt-in
|
|
535
|
+
refresh for locally installed GitNexus and Graphify indexes. Each rebuild is
|
|
536
|
+
bounded to 30 seconds and records only success, failure, or skipped metadata in
|
|
537
|
+
`.reckon/artifact-refresh.jsonl`; it never runs from a commit hook.
|
|
538
|
+
|
|
539
|
+
Search supports composable `languages`, `extensions`, `kinds`, `path`,
|
|
540
|
+
`testScope`, and `includeSource` filters. Its paged response contains
|
|
541
|
+
`results`, `total`, `offset`, `limit`, and `hasMore`; use `offset` to continue.
|
|
542
|
+
Large-code queries accept `minLines`, `minComplexity`, `kinds`, and `path`.
|
|
543
|
+
|
|
544
|
+
`knodin pack` creates portable Markdown, JSON, or XML source context with
|
|
545
|
+
deterministic relative-path ordering and an explicit local four-bytes-per-token
|
|
546
|
+
cost estimate. Includes, excludes, already-present/chat-file suppression, and
|
|
547
|
+
per-glob `full`, `summary`, or `structure-only` policies compose under hard byte
|
|
548
|
+
and token limits. Optional line numbers, a file tree, C5-compatible Git diff
|
|
549
|
+
scopes, and local log context are available. `knodin pack read` retrieves at
|
|
550
|
+
most 1,000 artifact lines under a byte cap; `knodin pack grep` applies an exact
|
|
551
|
+
regular expression with a bounded match count. Output paths are restricted to
|
|
552
|
+
the repository, and no pack operation sends code or metadata off-machine.
|
|
553
|
+
|
|
554
|
+
`knodin visualize <entry> --output <path.html>` writes an optional,
|
|
555
|
+
self-contained local HTML artifact from the existing persisted graph. It offers
|
|
556
|
+
native subsystem drill-down, hub/bridge inspection, and a bounded downstream
|
|
557
|
+
static call-flow view (`--depth 1..6`); `--identity`, `--file`, and `--kind`
|
|
558
|
+
disambiguate the entry symbol. Each displayed relationship is labeled with
|
|
559
|
+
bounded source evidence or an explicit heuristic label, and the artifact records
|
|
560
|
+
the local source commit plus index freshness. `--max-bytes` (4–64 KiB, 32 KiB
|
|
561
|
+
default) bounds generation; output paths must remain inside the repository. This
|
|
562
|
+
is a CLI export only: it adds no MCP tool, network service, credentials,
|
|
563
|
+
telemetry, or source egress.
|
|
564
|
+
Map and community/flow/traversal drill-downs accept `topN`, `sort`,
|
|
565
|
+
`relationKinds`, and `detailLevel`. The CLI exposes the same controls as
|
|
566
|
+
`--languages`, `--extensions`, `--kinds`, `--path`, `--tests-only`,
|
|
567
|
+
`--production-only`, `--offset`, `--min-lines`, `--min-complexity`, `--top`,
|
|
568
|
+
`--sort`, and `--relations`. Traversal also accepts `--direction` and `--data-flow`
|
|
569
|
+
and returns typed evidence for every hop. `architecture_overview` accepts `--facets`
|
|
570
|
+
(`packages,layers,boundaries,hotspots,entryPoints,languages`) and a consistent `--path` scope.
|
|
571
|
+
|
|
572
|
+
`knodin query feature_path <symbol>` follows a deterministic, downstream DFS
|
|
573
|
+
over resolved source references. It is bounded by depth (1–6) and the response
|
|
574
|
+
item cap, reports explicit truncation whenever either bound cuts off reachable
|
|
575
|
+
nodes, includes source file/line evidence on each hop, and guards cycles. It
|
|
576
|
+
is a static feature-navigation aid, not a
|
|
577
|
+
runtime execution trace; dynamic dispatch and unresolved references are omitted.
|
|
578
|
+
Gateway byte/token budgets can additionally crop the serialized response; that
|
|
579
|
+
separate C3 condition is reported in `responseBudget.truncated`.
|
|
580
|
+
|
|
581
|
+
`knodin query flow_analysis <symbol> [--variable name]` performs a compact,
|
|
582
|
+
on-demand source analysis of one selected TypeScript/JavaScript function. It returns
|
|
583
|
+
simple definition, use, and control facts with file/line/source evidence, is bounded
|
|
584
|
+
by knodin's normal response budgets, and never persists a program-dependence graph.
|
|
585
|
+
Aliases, destructuring, closures, dynamic properties, and runtime control flow are
|
|
586
|
+
explicitly heuristic or unresolved rather than presented as proof.
|
|
587
|
+
|
|
588
|
+
### MCP tool and handler map
|
|
589
|
+
|
|
590
|
+
After indexing, `knodin query mcp_tools` lists TypeScript MCP SDK registrations and associates each tool name with its description, schema declaration, handler symbol, and source file. Use `knodin query mcp_tools <tool-name>` for an exact-name lookup. Dynamic registrations are retained with `confidence: "heuristic"` instead of being presented as exact facts.
|