codebase-snapshot 0.13.0 → 0.15.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/CHANGELOG.md +225 -0
- package/README.md +1 -1
- package/SECURITY.md +2 -2
- package/dist/bin.js +412 -92
- package/dist/{chunk-NESEHOPU.js → chunk-4OHQULCV.js} +41 -1
- package/dist/{chunk-BOJYZQFB.js → chunk-KHHUC6UT.js} +364 -92
- package/dist/cli.cjs +410 -92
- package/dist/cli.d.cts +11 -1
- package/dist/cli.d.ts +11 -1
- package/dist/cli.js +9 -3
- package/dist/index.cjs +364 -92
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +404 -92
- package/dist/mcp.d.cts +6 -15
- package/dist/mcp.d.ts +6 -15
- package/dist/mcp.js +2 -2
- package/dist/{types-CbD8yQRZ.d.cts → types-5G2Q6tWP.d.cts} +4 -0
- package/dist/{types-CbD8yQRZ.d.ts → types-5G2Q6tWP.d.ts} +4 -0
- package/docs/benchmarks.md +54 -9
- package/docs/cli.md +6 -4
- package/docs/deploy.md +2 -2
- package/docs/health.md +31 -0
- package/docs/mcp.md +9 -5
- package/docs/tools.md +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,231 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
|
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
+
## 0.15.0
|
|
34
|
+
|
|
35
|
+
**Parity, measured on someone else's repositories.**
|
|
36
|
+
|
|
37
|
+
0.15.x was the parity phase, and the honest test of parity is not a feature list — it is running the
|
|
38
|
+
same repositories through both tools and publishing what happened.
|
|
39
|
+
|
|
40
|
+
- **Ten public repositories, three tools, one command** (`scripts/benchmark-suite.mjs`): is-odd,
|
|
41
|
+
chalk, co, minimatch, luxon, requests, click, express, zod and github-readme-stats, cloned shallow
|
|
42
|
+
and packed by this tool, repomix 1.19.0 and gitingest. Nine of ten land within about plus or minus
|
|
43
|
+
30% of repomix's own token count. The tenth, minimatch, is a policy difference: five 20–25 MB
|
|
44
|
+
benchmark fixtures are emitted by repomix (64.8M tokens) and bounded-previewed by us (319,879).
|
|
45
|
+
The page says which is which instead of celebrating a ratio.
|
|
46
|
+
- **`--only` and `--ignore`** narrow a single run without editing a configuration: `--only` replaces
|
|
47
|
+
the allow-list, `--ignore` adds to the deny-list, and both enter the config digest so `validate`
|
|
48
|
+
and `explain` compare like with like. An ignored path is recorded in `skipped[]`, never dropped.
|
|
49
|
+
- **gitingest runs in the harness** now, with `PYTHONIOENCODING=utf-8` for the child process;
|
|
50
|
+
without it, gitingest aborts on Windows while printing its tree and the comparison silently
|
|
51
|
+
degrades to two tools.
|
|
52
|
+
|
|
53
|
+
### What parity means here
|
|
54
|
+
|
|
55
|
+
Feature-for-feature, the floor is covered: diffs, logs, a token tree, single-file packs in three
|
|
56
|
+
formats, comment stripping, blank-line stripping, and structural parsers for seven non-TypeScript
|
|
57
|
+
languages. What is different is deliberate and stated: a selection (slice, budget, delta) that neither
|
|
58
|
+
competitor produces, an audit that verifies the manifest instead of trusting it, and a token estimate
|
|
59
|
+
that is documented as an estimate.
|
|
60
|
+
|
|
61
|
+
### How it was verified
|
|
62
|
+
|
|
63
|
+
Full `npm run verify`: 1328 tests, 1320 pass, 0 fail, 8 host skips; 29 site pages with no link or
|
|
64
|
+
metadata problems; a 52-file tarball whose lockfile agrees with `package.json`. The ten-repository
|
|
65
|
+
run is reproducible with one command and reports its own skips.
|
|
66
|
+
## 0.14.6
|
|
67
|
+
|
|
68
|
+
**Per-run narrowing: `--only` and `--ignore`.**
|
|
69
|
+
|
|
70
|
+
- Both tools this is measured against let one run narrow the files without editing a config. This
|
|
71
|
+
tool did not: `--include`/`--exclude` only wrote settings into a config during `init`/`setup`.
|
|
72
|
+
- `--only <globs>` **replaces** the include allow-list for the run; `--ignore <globs>` **adds to** the
|
|
73
|
+
exclude list. The directions differ on purpose — a narrower allow-list is a statement about the
|
|
74
|
+
whole run, while "also ignore this" is naturally cumulative with what the config already denies.
|
|
75
|
+
- Both enter the config digest, so `validate` and `explain` accept them and need them to compare like
|
|
76
|
+
with like; an ignored path is recorded in `skipped[]`, not dropped.
|
|
77
|
+
|
|
78
|
+
Verified: an ignored file disappears from `files[]` and appears in `skipped[]`; `validate` with the
|
|
79
|
+
same flag passes and without it reports drift; `explain --ignore` answers "excluded".
|
|
80
|
+
## 0.14.5
|
|
81
|
+
|
|
82
|
+
**Ten public repositories, three tools, one run.**
|
|
83
|
+
|
|
84
|
+
- `scripts/benchmark-suite.mjs` shallow-clones a list of repositories, packs each with this tool,
|
|
85
|
+
repomix and gitingest, and prints one table (or `--json`). A repository it cannot clone is a skip
|
|
86
|
+
with the reason, never a missing row.
|
|
87
|
+
- `docs/benchmarks.md` carries the run: ten repositories from `jonschlinkert/is-odd` (5,450 tokens)
|
|
88
|
+
to `colinhacks/zod` (1.76M). Nine of ten land within about plus or minus 30% of repomix's own
|
|
89
|
+
token count — expected for two estimators.
|
|
90
|
+
- The tenth is the interesting one: `isaacs/minimatch` holds five 20–25 MB benchmark fixtures.
|
|
91
|
+
repomix emits them (64.8M tokens); our large-file rule emits a bounded preview and records the
|
|
92
|
+
omission, so the pack is 319,879 tokens. The page says exactly that instead of celebrating a ratio
|
|
93
|
+
that a policy difference produced.
|
|
94
|
+
|
|
95
|
+
Verified: the suite runs end to end, and a test pins that an uncloneable input becomes a skip with
|
|
96
|
+
its reason.
|
|
97
|
+
## 0.14.4
|
|
98
|
+
|
|
99
|
+
- The goal log records the 0.14.2-0.14.3 round. `ROADMAP.md` marks item 27 (`--remove-empty-lines`)
|
|
100
|
+
and item 33 (call-site evidence) as shipped, and item 36 as measured three ways on this repository
|
|
101
|
+
with ten public repositories still to run.
|
|
102
|
+
## 0.14.3
|
|
103
|
+
|
|
104
|
+
- **`snapshot_symbol` reports call sites.** The definition says what a symbol is; the call sites say
|
|
105
|
+
who depends on it. Unless `references: false`, the tool scans the parts (never the working tree) for
|
|
106
|
+
the name, bounded by `MAX_SEARCH_BYTES` and `maxReferences` (default 20), and returns path, line and
|
|
107
|
+
the line text — marking the definition line itself.
|
|
108
|
+
- Case-sensitive matching on purpose: a case-insensitive scan of a common word is noise. Import lines
|
|
109
|
+
count as sites, which is why a rename sees them.
|
|
110
|
+
|
|
111
|
+
Verified: a call in `src/auth.ts` is reported with its line, the import line is included, and
|
|
112
|
+
`references: false` skips the scan.
|
|
113
|
+
## 0.14.2
|
|
114
|
+
|
|
115
|
+
- **The comparison harness runs gitingest, and now does.** `--gitingest` reported "not available" here
|
|
116
|
+
because gitingest aborts on Windows with `charmap codec can't encode` while printing its tree; the
|
|
117
|
+
harness sets `PYTHONIOENCODING=utf-8` for that child process and it completes.
|
|
118
|
+
- `docs/benchmarks.md` carries the three-way table from a real run: our full pack 336 files /
|
|
119
|
+
1,060,727 estimated tokens, repomix 335 / 888,168, gitingest 3.12 MB of digest with no token count.
|
|
120
|
+
The caveats say which numbers are comparable (bytes) and which are not (tokenizers).
|
|
121
|
+
|
|
122
|
+
## 0.14.1
|
|
123
|
+
|
|
124
|
+
- The goal log records the second published milestone: 0.14.0 tagged, released on GitHub and
|
|
125
|
+
published to npm (the registry reports `latest = 0.14.0`), after the same few-minute processing
|
|
126
|
+
window that 0.13.0 had. `ROADMAP.md` marks it published.
|
|
127
|
+
|
|
128
|
+
## 0.14.0
|
|
129
|
+
|
|
130
|
+
**The audit now proves the manifest, instead of trusting it.**
|
|
131
|
+
|
|
132
|
+
0.13.x was the health service facing its own claims. Each sub-bump asked "what does this audit
|
|
133
|
+
actually verify?", and five answers were uncomfortable:
|
|
134
|
+
|
|
135
|
+
- **0.13.3** `GET /metrics`: request totals, per-method counts, refusals, rate limits, tool count and
|
|
136
|
+
uptime in Prometheus text, with no path or credential as a label.
|
|
137
|
+
- **0.13.4** a workspace member is compared with its `WORKSPACE.json`: fingerprint and file count must
|
|
138
|
+
agree, and a stale index warns with the field that disagrees.
|
|
139
|
+
- **0.13.6** every file body in a part is compared with the manifest's `includedBytes` and
|
|
140
|
+
`includedLines`, by anchor. A truncated part with an updated hash used to pass every check.
|
|
141
|
+
- **0.13.7** `counts.totalFiles`, `counts.partsCount`, `counts.skippedCount`, `totals.totalContentBytes`
|
|
142
|
+
and the per-layer counts are recomputed from the manifest's own arrays. A manifest claiming five
|
|
143
|
+
more files than it held passed everything before this.
|
|
144
|
+
- **0.13.9/0.13.10** each single-file pack (JSON, XML, markdown) must hold exactly the files the
|
|
145
|
+
manifest lists. A digest proves the pack is the recorded file, not that the recorded pack is
|
|
146
|
+
complete.
|
|
147
|
+
|
|
148
|
+
### What this milestone changes for a reader
|
|
149
|
+
|
|
150
|
+
- A snapshot that says it contains something it does not now fails the audit with the field and both
|
|
151
|
+
numbers, instead of scoring 100.
|
|
152
|
+
- The audit is stricter about its own bookkeeping, so a hand-edited manifest is a failure even when
|
|
153
|
+
every hash was updated to match.
|
|
154
|
+
- The JSON, XML and markdown packs are audited as deliverables rather than as opaque artifacts.
|
|
155
|
+
|
|
156
|
+
### How it was verified
|
|
157
|
+
|
|
158
|
+
Full `npm run verify`: 1323 tests, 1315 pass, 0 fail, 8 host skips; 29 site pages with no link or
|
|
159
|
+
metadata problems; a 52-file tarball whose lockfile agrees with `package.json`. Each new check was
|
|
160
|
+
probed by breaking the thing it checks: a truncated part, an edited count, a pack minus one entry, an
|
|
161
|
+
index with a wrong fingerprint — and each probe became a test.
|
|
162
|
+
## 0.13.10
|
|
163
|
+
|
|
164
|
+
- **Every single-file pack is checked for membership, not only the JSON one.** The XML pack writes
|
|
165
|
+
paths as `<file path="…">` and the markdown pack as `## File: …`; each has a small reader and the
|
|
166
|
+
same both-directions comparison against `manifest.files`. A pack entry deleted and the digest
|
|
167
|
+
updated is a critical failure in all three formats.
|
|
168
|
+
|
|
169
|
+
Verified: clean `--pack xml`, `--pack single` and `--pack json` snapshots pass their checks; removing
|
|
170
|
+
one file section from the XML and the markdown pack and re-digesting fails with
|
|
171
|
+
`is in the manifest but not the pack`.
|
|
172
|
+
## 0.13.9
|
|
173
|
+
|
|
174
|
+
- **The JSON monolith must hold every file the manifest lists.** The pack's digest proves it is the
|
|
175
|
+
file the manifest recorded, not that the manifest recorded a complete pack. The audit parses it and
|
|
176
|
+
compares the file set both ways: an entry removed and the digest updated is now a critical failure.
|
|
177
|
+
- Membership only, deliberately: the pack keeps a file's final newline and a part body does not, and
|
|
178
|
+
normalising that difference would duplicate the per-file body accounting with a fragile check.
|
|
179
|
+
|
|
180
|
+
Verified: a clean `--pack json` snapshot passes; removing one entry and re-digesting the artifact
|
|
181
|
+
fails with `is in the manifest but not the pack`.
|
|
182
|
+
## 0.13.8
|
|
183
|
+
|
|
184
|
+
- The goal log records the 0.13.6-0.13.7 round: per-file body accounting and the count recomputation,
|
|
185
|
+
with the probes that found both gaps.
|
|
186
|
+
## 0.13.7
|
|
187
|
+
|
|
188
|
+
**The audit checks the counts against the data they summarise.**
|
|
189
|
+
|
|
190
|
+
- `counts.totalFiles`, `counts.partsCount`, `counts.skippedCount`, `totals.totalContentBytes` and the
|
|
191
|
+
per-layer counts were quoted, never verified. A manifest edited to claim five more files than the
|
|
192
|
+
parts hold passed every check — each part hashed correctly and the artifacts were present.
|
|
193
|
+
- The audit recomputes all of them from the manifest's own arrays and fails with the field and both
|
|
194
|
+
numbers when they disagree (probed: `counts.totalFiles: manifest says 7, the data has 2`).
|
|
195
|
+
|
|
196
|
+
Verified: a clean snapshot passes the check, and one edited count field fails with its name.
|
|
197
|
+
## 0.13.6
|
|
198
|
+
|
|
199
|
+
**The audit checks every file body against the manifest accounting.**
|
|
200
|
+
|
|
201
|
+
- The manifest records `includedBytes` and `includedLines` per file; nothing verified them against
|
|
202
|
+
the parts. A part could be truncated or edited, its hash updated in the manifest, and every
|
|
203
|
+
integrity check would agree while the reader received less than the manifest promised.
|
|
204
|
+
- Each part is parsed once with the same parser the MCP reader uses (moved to
|
|
205
|
+
`src/partitioner/part-format.ts` so the auditor does not import the server), and every file's
|
|
206
|
+
section is compared by anchor: bytes must equal `includedBytes`, lines must equal `includedLines`.
|
|
207
|
+
A missing section is a failure with the path named.
|
|
208
|
+
|
|
209
|
+
Verified: the check passes on this repository in five modes (full, strip-comments,
|
|
210
|
+
remove-empty-lines, skeleton, forced previews); deleting one line from a part without touching the
|
|
211
|
+
manifest fails the audit.
|
|
212
|
+
## 0.13.5
|
|
213
|
+
|
|
214
|
+
- The goal log records the 0.13.3-0.13.4 round: Prometheus metrics on the HTTP transport and the
|
|
215
|
+
workspace-index check in the health audit.
|
|
216
|
+
## 0.13.4
|
|
217
|
+
|
|
218
|
+
- **The health audit checks a workspace member against its index.** When `WORKSPACE.json` sits beside
|
|
219
|
+
the snapshot, the member's recorded fingerprint and file count must match the snapshot; a stale or
|
|
220
|
+
edited index warns (and `--strict` exits 1) rather than leaving the deliverable saying two things
|
|
221
|
+
about one directory. An index that cannot be read warns with the parse error; an index that does not
|
|
222
|
+
list this member is a skip with the reason.
|
|
223
|
+
|
|
224
|
+
Verified: editing a member's fingerprint makes the audit warn with the field that disagrees, and
|
|
225
|
+
regenerating the workspace makes it pass again.
|
|
226
|
+
## 0.13.3
|
|
227
|
+
|
|
228
|
+
- **`GET /metrics` on the HTTP transport.** Prometheus text, no dependency: request totals, a count
|
|
229
|
+
per method, refusals (a disallowed CORS origin) and rate-limit rejections, plus the tool count and
|
|
230
|
+
uptime. Labels are fixed — no path, no tool name, no credential — because a label built from a URL
|
|
231
|
+
is an unbounded map and would publish what was asked for to the monitoring system.
|
|
232
|
+
- `/healthz` and `/metrics` need no token (neither exposes repository data); everything else still
|
|
233
|
+
does.
|
|
234
|
+
|
|
235
|
+
Verified: a refused origin and a normal request move their counters, and no request path appears in
|
|
236
|
+
the output.
|
|
237
|
+
## 0.13.2
|
|
238
|
+
|
|
239
|
+
- The goal log records the milestone: 0.13.0 tagged, released on GitHub and **published to npm**
|
|
240
|
+
through the train (the registry reports `latest = 0.13.0`), plus the 0.12.99 security fix and the
|
|
241
|
+
0.13.1 portability fix the release workflow exposed.
|
|
242
|
+
- `ROADMAP.md` carries a milestone table with the published state, so the next milestone has a place
|
|
243
|
+
to be recorded rather than being inferred from the changelog.
|
|
244
|
+
## 0.13.1
|
|
245
|
+
|
|
246
|
+
**The test suite could not run on Linux, so the release workflow never passed.**
|
|
247
|
+
|
|
248
|
+
- Twelve test files built the binary path with `new URL(import.meta.url).pathname` and stripped a
|
|
249
|
+
leading slash. On Windows that yields `C:/…` and works; on Linux it yields `home/runner/…` — a
|
|
250
|
+
*relative* path — so `dist/bin.js` resolved under the scratch directory and the test failed with
|
|
251
|
+
`Cannot find module`. The release workflow runs the suite on Ubuntu, so the first milestone release
|
|
252
|
+
failed there even though every local run was green.
|
|
253
|
+
- All twelve now use `fileURLToPath(import.meta.url)`, which is absolute on both platforms. The
|
|
254
|
+
rewrite was mechanical; the eleven suites it touches were re-run.
|
|
255
|
+
|
|
256
|
+
Verified: 49 tests across the eleven rewritten suites pass locally, and the construct no longer
|
|
257
|
+
depends on the platform.
|
|
33
258
|
## 0.13.0
|
|
34
259
|
|
|
35
260
|
**The first published milestone.** Every release from 0.12.15 to 0.12.99 is tagged in this
|
package/README.md
CHANGED
|
@@ -210,7 +210,7 @@ Everything an agent needs is available as data, and the tool can install its own
|
|
|
210
210
|
```bash
|
|
211
211
|
npx codebase-snapshot describe --format json # contract: workflow, options, exit codes
|
|
212
212
|
npx codebase-snapshot skill --install # into .claude/skills + .cursor/rules
|
|
213
|
-
npx -y codebase-snapshot@0.
|
|
213
|
+
npx -y codebase-snapshot@0.15.0 mcp # or serve it over MCP
|
|
214
214
|
```
|
|
215
215
|
|
|
216
216
|
An agent told only "use `npx codebase-snapshot`" can read the contract, follow its ordered
|
package/SECURITY.md
CHANGED
|
@@ -6,11 +6,11 @@ Only the latest published release receives security fixes.
|
|
|
6
6
|
|
|
7
7
|
| Version | Supported |
|
|
8
8
|
| :--- | :--- |
|
|
9
|
-
| <!--@majorMinor-->0.
|
|
9
|
+
| <!--@majorMinor-->0.15<!--/@majorMinor-->.x | ✅ |
|
|
10
10
|
| anything older | ❌ |
|
|
11
11
|
|
|
12
12
|
The number line restarted at 0.9.0 when the package moved to the unscoped `codebase-snapshot` name,
|
|
13
|
-
so <!--@majorMinor-->0.
|
|
13
|
+
so <!--@majorMinor-->0.15<!--/@majorMinor-->.x is newer than 4.4.1, not older. That is explained in full in the
|
|
14
14
|
[changelog](CHANGELOG.md#a-note-on-version-numbers).
|
|
15
15
|
|
|
16
16
|
## Reporting a vulnerability
|