codebase-snapshot 0.12.15 → 0.14.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.
Files changed (44) hide show
  1. package/CHANGELOG.md +1063 -3
  2. package/README.md +14 -3
  3. package/SECURITY.md +2 -2
  4. package/dist/bin.js +10092 -5998
  5. package/dist/{chunk-FZB2FTHF.js → chunk-2YNQ42B3.js} +7971 -865
  6. package/dist/chunk-7WSZUMT6.js +306 -0
  7. package/dist/cli.cjs +9763 -5718
  8. package/dist/cli.d.cts +115 -2
  9. package/dist/cli.d.ts +115 -2
  10. package/dist/cli.js +389 -8
  11. package/dist/{generate-worker-BK4uJx7Z.d.cts → generate-worker-B79yGkQO.d.cts} +16 -0
  12. package/dist/{generate-worker-BK4uJx7Z.d.ts → generate-worker-B79yGkQO.d.ts} +16 -0
  13. package/dist/index.cjs +7655 -744
  14. package/dist/index.d.cts +145 -6
  15. package/dist/index.d.ts +145 -6
  16. package/dist/index.js +1 -1
  17. package/dist/mcp.cjs +3595 -1093
  18. package/dist/mcp.d.cts +92 -19
  19. package/dist/mcp.d.ts +92 -19
  20. package/dist/mcp.js +2 -2
  21. package/dist/{types-c0tLF2WC.d.cts → types-CbD8yQRZ.d.cts} +145 -1
  22. package/dist/{types-c0tLF2WC.d.ts → types-CbD8yQRZ.d.ts} +145 -1
  23. package/docs/agent.md +1 -1
  24. package/docs/benchmarks.md +80 -0
  25. package/docs/budget.md +59 -0
  26. package/docs/cli.md +41 -4
  27. package/docs/configuration.md +27 -0
  28. package/docs/delta.md +50 -0
  29. package/docs/deploy.md +75 -0
  30. package/docs/health.md +44 -0
  31. package/docs/mcp.md +116 -11
  32. package/docs/migration.md +68 -0
  33. package/docs/output.md +9 -3
  34. package/docs/remote.md +60 -0
  35. package/docs/security-review.md +117 -0
  36. package/docs/serve.md +66 -0
  37. package/docs/signing.md +61 -0
  38. package/docs/slice.md +57 -0
  39. package/docs/tools.md +161 -0
  40. package/docs/troubleshooting.md +63 -0
  41. package/docs/vs-repomix.md +1 -1
  42. package/docs/workspace.md +93 -0
  43. package/package.json +1 -1
  44. package/dist/chunk-EPAXW6QJ.js +0 -3749
package/CHANGELOG.md CHANGED
@@ -10,9 +10,13 @@ This package started its public life as `@ankurhalder/codebase-snapshot`, which
10
10
  moved to the unscoped name and **restarted at 0.9.0**, so the numbers below are not a continuation of
11
11
  the old line — `0.9.0` is newer than `4.4.1`, not older.
12
12
 
13
- The line stays at **`0.12.x`**. Every change ships as a patch release: there is no `0.13`, and
14
- `1.0.0` is not planned. A feature that would normally justify a minor bump is released as
15
- `0.12.<n+1>` with the same rigour; the number is not the promise, the entry below is.
13
+ The line now runs **`0.12.x` to `0.17.0`, with literal sub-bumps**: every change ships as its
14
+ own version, `0.12.15` through `0.12.99`, then `0.13.0` and the same ladder again. The number is not
15
+ the promise; the entry below is. `1.0.0` is never released.
16
+
17
+ GitHub carries a tag for every version and `main` carries every commit. **npm publication happens
18
+ only at `x.y.0`** (`0.13.0`, `0.14.0`, …), so the registry stays clean while the repository keeps a
19
+ complete, buildable history.
16
20
 
17
21
  Two versions exist on the registry that are not releases, and both are deprecated:
18
22
 
@@ -26,6 +30,1062 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
26
30
 
27
31
  ---
28
32
 
33
+ ## 0.14.0
34
+
35
+ **The audit now proves the manifest, instead of trusting it.**
36
+
37
+ 0.13.x was the health service facing its own claims. Each sub-bump asked "what does this audit
38
+ actually verify?", and five answers were uncomfortable:
39
+
40
+ - **0.13.3** `GET /metrics`: request totals, per-method counts, refusals, rate limits, tool count and
41
+ uptime in Prometheus text, with no path or credential as a label.
42
+ - **0.13.4** a workspace member is compared with its `WORKSPACE.json`: fingerprint and file count must
43
+ agree, and a stale index warns with the field that disagrees.
44
+ - **0.13.6** every file body in a part is compared with the manifest's `includedBytes` and
45
+ `includedLines`, by anchor. A truncated part with an updated hash used to pass every check.
46
+ - **0.13.7** `counts.totalFiles`, `counts.partsCount`, `counts.skippedCount`, `totals.totalContentBytes`
47
+ and the per-layer counts are recomputed from the manifest's own arrays. A manifest claiming five
48
+ more files than it held passed everything before this.
49
+ - **0.13.9/0.13.10** each single-file pack (JSON, XML, markdown) must hold exactly the files the
50
+ manifest lists. A digest proves the pack is the recorded file, not that the recorded pack is
51
+ complete.
52
+
53
+ ### What this milestone changes for a reader
54
+
55
+ - A snapshot that says it contains something it does not now fails the audit with the field and both
56
+ numbers, instead of scoring 100.
57
+ - The audit is stricter about its own bookkeeping, so a hand-edited manifest is a failure even when
58
+ every hash was updated to match.
59
+ - The JSON, XML and markdown packs are audited as deliverables rather than as opaque artifacts.
60
+
61
+ ### How it was verified
62
+
63
+ Full `npm run verify`: 1323 tests, 1315 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`. Each new check was
65
+ probed by breaking the thing it checks: a truncated part, an edited count, a pack minus one entry, an
66
+ index with a wrong fingerprint — and each probe became a test.
67
+ ## 0.13.10
68
+
69
+ - **Every single-file pack is checked for membership, not only the JSON one.** The XML pack writes
70
+ paths as `<file path="…">` and the markdown pack as `## File: …`; each has a small reader and the
71
+ same both-directions comparison against `manifest.files`. A pack entry deleted and the digest
72
+ updated is a critical failure in all three formats.
73
+
74
+ Verified: clean `--pack xml`, `--pack single` and `--pack json` snapshots pass their checks; removing
75
+ one file section from the XML and the markdown pack and re-digesting fails with
76
+ `is in the manifest but not the pack`.
77
+ ## 0.13.9
78
+
79
+ - **The JSON monolith must hold every file the manifest lists.** The pack's digest proves it is the
80
+ file the manifest recorded, not that the manifest recorded a complete pack. The audit parses it and
81
+ compares the file set both ways: an entry removed and the digest updated is now a critical failure.
82
+ - Membership only, deliberately: the pack keeps a file's final newline and a part body does not, and
83
+ normalising that difference would duplicate the per-file body accounting with a fragile check.
84
+
85
+ Verified: a clean `--pack json` snapshot passes; removing one entry and re-digesting the artifact
86
+ fails with `is in the manifest but not the pack`.
87
+ ## 0.13.8
88
+
89
+ - The goal log records the 0.13.6-0.13.7 round: per-file body accounting and the count recomputation,
90
+ with the probes that found both gaps.
91
+ ## 0.13.7
92
+
93
+ **The audit checks the counts against the data they summarise.**
94
+
95
+ - `counts.totalFiles`, `counts.partsCount`, `counts.skippedCount`, `totals.totalContentBytes` and the
96
+ per-layer counts were quoted, never verified. A manifest edited to claim five more files than the
97
+ parts hold passed every check — each part hashed correctly and the artifacts were present.
98
+ - The audit recomputes all of them from the manifest's own arrays and fails with the field and both
99
+ numbers when they disagree (probed: `counts.totalFiles: manifest says 7, the data has 2`).
100
+
101
+ Verified: a clean snapshot passes the check, and one edited count field fails with its name.
102
+ ## 0.13.6
103
+
104
+ **The audit checks every file body against the manifest accounting.**
105
+
106
+ - The manifest records `includedBytes` and `includedLines` per file; nothing verified them against
107
+ the parts. A part could be truncated or edited, its hash updated in the manifest, and every
108
+ integrity check would agree while the reader received less than the manifest promised.
109
+ - Each part is parsed once with the same parser the MCP reader uses (moved to
110
+ `src/partitioner/part-format.ts` so the auditor does not import the server), and every file's
111
+ section is compared by anchor: bytes must equal `includedBytes`, lines must equal `includedLines`.
112
+ A missing section is a failure with the path named.
113
+
114
+ Verified: the check passes on this repository in five modes (full, strip-comments,
115
+ remove-empty-lines, skeleton, forced previews); deleting one line from a part without touching the
116
+ manifest fails the audit.
117
+ ## 0.13.5
118
+
119
+ - The goal log records the 0.13.3-0.13.4 round: Prometheus metrics on the HTTP transport and the
120
+ workspace-index check in the health audit.
121
+ ## 0.13.4
122
+
123
+ - **The health audit checks a workspace member against its index.** When `WORKSPACE.json` sits beside
124
+ the snapshot, the member's recorded fingerprint and file count must match the snapshot; a stale or
125
+ edited index warns (and `--strict` exits 1) rather than leaving the deliverable saying two things
126
+ about one directory. An index that cannot be read warns with the parse error; an index that does not
127
+ list this member is a skip with the reason.
128
+
129
+ Verified: editing a member's fingerprint makes the audit warn with the field that disagrees, and
130
+ regenerating the workspace makes it pass again.
131
+ ## 0.13.3
132
+
133
+ - **`GET /metrics` on the HTTP transport.** Prometheus text, no dependency: request totals, a count
134
+ per method, refusals (a disallowed CORS origin) and rate-limit rejections, plus the tool count and
135
+ uptime. Labels are fixed — no path, no tool name, no credential — because a label built from a URL
136
+ is an unbounded map and would publish what was asked for to the monitoring system.
137
+ - `/healthz` and `/metrics` need no token (neither exposes repository data); everything else still
138
+ does.
139
+
140
+ Verified: a refused origin and a normal request move their counters, and no request path appears in
141
+ the output.
142
+ ## 0.13.2
143
+
144
+ - The goal log records the milestone: 0.13.0 tagged, released on GitHub and **published to npm**
145
+ through the train (the registry reports `latest = 0.13.0`), plus the 0.12.99 security fix and the
146
+ 0.13.1 portability fix the release workflow exposed.
147
+ - `ROADMAP.md` carries a milestone table with the published state, so the next milestone has a place
148
+ to be recorded rather than being inferred from the changelog.
149
+ ## 0.13.1
150
+
151
+ **The test suite could not run on Linux, so the release workflow never passed.**
152
+
153
+ - Twelve test files built the binary path with `new URL(import.meta.url).pathname` and stripped a
154
+ leading slash. On Windows that yields `C:/…` and works; on Linux it yields `home/runner/…` — a
155
+ *relative* path — so `dist/bin.js` resolved under the scratch directory and the test failed with
156
+ `Cannot find module`. The release workflow runs the suite on Ubuntu, so the first milestone release
157
+ failed there even though every local run was green.
158
+ - All twelve now use `fileURLToPath(import.meta.url)`, which is absolute on both platforms. The
159
+ rewrite was mechanical; the eleven suites it touches were re-run.
160
+
161
+ Verified: 49 tests across the eleven rewritten suites pass locally, and the construct no longer
162
+ depends on the platform.
163
+ ## 0.13.0
164
+
165
+ **The first published milestone.** Every release from 0.12.15 to 0.12.99 is tagged in this
166
+ repository; 0.13.0 is the first one published to npm under the policy that patches are tagged and
167
+ only `x.y.0` is published. The code is the same code those 85 sub-bumps tested — this entry is the
168
+ map of what they built.
169
+
170
+ ### Retrieval, which is the point
171
+
172
+ - `snapshot_plan_for` — the plan for a question: which files fit a budget, why each was chosen, what
173
+ did not fit. Matches stems (`charge`/`chargeCard`), follows imports **and** callers, prefers entry
174
+ points, and resolves `.js` specifiers to their `.ts` files.
175
+ - `snapshot_context`, `snapshot_query`, `snapshot_symbol`, `snapshot_read`, `snapshot_locate`,
176
+ `snapshot_dependents`, `snapshot_neighbors`, `snapshot_routes`, `snapshot_cycles`,
177
+ `snapshot_tests`, `snapshot_entrypoints`, `snapshot_search`, `snapshot_stats`, `snapshot_history`
178
+ — 24 tools in total, each with a cost class, structured output and a reference page.
179
+ - `snapshot_diff_context` and `snapshot_review` for a change set; `snapshot_health` for the proof.
180
+
181
+ ### Transports and the browser
182
+
183
+ - Streamable HTTP with a bearer token, loopback by default, CORS for loopback origins, a 2 MB body
184
+ cap, 60 requests per 10 seconds and a real `/healthz`; legacy SSE for older clients.
185
+ - `snapshot serve`: one loopback process for the page, the API, MCP and a store-only zip; the page
186
+ can generate, slice for a question, fit a token budget, audit what it wrote and download it.
187
+ - `generate --remote`: https only, DNS-checked public addresses, shallow clone, `GITHUB_TOKEN` from
188
+ the environment, provenance in the manifest.
189
+
190
+ ### The proof
191
+
192
+ - `snapshot health`: hashes, artifacts, secrets, values from excluded files, host paths, token
193
+ accounting, freshness and signatures, with a score, severities and `--strict`. It audits a whole
194
+ `--workspace` with `--all-members` and takes the weakest member as the combined score.
195
+ - `--sign` writes an Ed25519 signature over the manifest; health verifies it.
196
+
197
+ ### Parity, and past it
198
+
199
+ - `--include-diffs`, `--include-logs <n>`, `--token-tree`, `--pack single|xml|json`,
200
+ `--strip-comments`, `--remove-empty-lines`, and parsers for Python, Go, Rust, Java, C#, Ruby and
201
+ PHP.
202
+ - Neither competitor has: `--slice` (the retrieval planner at generate time), `--delta` (what
203
+ changed plus its importers), `--budget-tokens` with a coverage report, `--workspace` with
204
+ cross-member links, and signed manifests.
205
+
206
+ ### What changed for an existing snapshot
207
+
208
+ - A snapshot generated with `--strip-comments`, `--pack` or a non-default `--include-logs` count now
209
+ reports configuration drift once, because those settings entered the config digest (0.12.84).
210
+ Regenerate with the same flags; the drift is the digest telling the truth about bytes it had not
211
+ been covering.
212
+ - `resources/list` advertises a report only when the run wrote it, and `describe` publishes the six
213
+ report resources separately as `reportResources` (0.12.62, 0.12.69).
214
+ - `--slice` and `--budget-tokens` together are refused; `validate` no longer reports unselected
215
+ files of a selection as drift (0.12.55, 0.12.56).
216
+
217
+ ### How it was verified
218
+
219
+ Full `npm run verify` at 0.12.99: 1316 tests, 1308 pass, 0 fail, 8 host skips; 29 site pages with no
220
+ link or metadata problems; a 52-file tarball whose lockfile agrees with `package.json`. The
221
+ benchmarks in [Benchmarks](benchmarks.md) are generated by a script that can be re-run, and the
222
+ head-to-head against repomix is measured rather than claimed.
223
+ ## 0.12.99
224
+
225
+ **The last sub-bump before the milestone: the browser API cannot be pointed anywhere.**
226
+
227
+ - `/api/snapshot`, `/api/snapshot.zip` and `/api/health` took a `path` and resolved it with
228
+ `path.resolve`, which accepts an absolute one. With a bearer token, that made the page an
229
+ arbitrary-file-read endpoint for anything the process could read — the token was the only boundary,
230
+ and a leaked token (or a tunnel) widened it to the whole disk.
231
+ - The server now records the directory it was started for and the clones it created, and answers
232
+ `403` for anything else. The token still decides who may ask; this decides what may be asked
233
+ about. The docs say which is which.
234
+
235
+ Verified: all three endpoints refuse the parent directory with `403` and still serve the generated
236
+ snapshot inside it; the nine serve tests pass.
237
+ ## 0.12.98
238
+
239
+ - The goal log records the 0.12.96-0.12.97 round and the last verify before the milestone: 1316
240
+ tests, 1308 pass, 0 fail.
241
+ ## 0.12.97
242
+
243
+ - **`GET /healthz` says which build is answering.** It returned `ok`, the name and a tool count; a
244
+ probe that reaches a stale process had no way to tell. It now carries `version` and
245
+ `uptimeSeconds`, needs no token, and is covered by a test.
246
+ - `health --all-members --format json` is pinned by a test: one record per member with its score and
247
+ counts, the combined score equal to the weakest, and no `error` field for a healthy member.
248
+ ## 0.12.96
249
+
250
+ - **`snapshot_generate` can pack and can narrow.** `pack` (single/xml/json) is a config setting the
251
+ tool could not reach, and `slice`/`sliceTokens`/`budgetTokens` are generate options it never had —
252
+ so an MCP client could ask for the whole repository but not for the twenty thousand tokens of it
253
+ that answer its question. Both travel as the CLI sends them: `pack` through the configuration, the
254
+ narrowing through the worker's generate options. Passing `slice` and `budgetTokens` together is
255
+ refused with the same reason the CLI gives.
256
+
257
+ Verified: `pack: "xml"` writes `full-codebase.xml`; a slice records its question and budget; a budget
258
+ records its block; the pair is an error.
259
+ ## 0.12.95
260
+
261
+ - The goal log records the 0.12.93-0.12.94 round, including the probes that found nothing: an empty
262
+ repository generates as 0 files / 0 parts and still validates, and two concurrent generates are
263
+ serialised by the staging lock with a message that says which lock and how old its heartbeat is.
264
+ ## 0.12.94
265
+
266
+ **Two tools answered a missing path with silence.**
267
+
268
+ - `snapshot_context` returned an empty text block for a path that is not in the snapshot, with the
269
+ path only in `structuredContent.missing`. Most clients render the text, so "not here" read as "this
270
+ file is empty". It now ends with `Not returned: <paths>.`
271
+ - `snapshot_diff_context` said "No file in the snapshot imports the changed paths" when the changed
272
+ paths were never read. That is a fact it had not checked; it now says
273
+ `Not in the snapshot: <paths>.` — and names any path it could not include alongside the dependents
274
+ it did find.
275
+
276
+ Verified: both tools name the missing path in their text, and the diff context no longer claims a
277
+ dependent fact it did not check.
278
+ ## 0.12.93
279
+
280
+ - **`snapshot_status` reports an unreadable manifest as an error, not as a status.** "No snapshot
281
+ yet" and "the manifest is not a snapshot manifest" were both returned as a normal result with
282
+ `present: false`, so a client reading the second planned around a snapshot it could never read. The
283
+ missing case stays a successful answer (that is what the tool is for); a manifest that exists and
284
+ fails the shape check sets `isError`.
285
+
286
+ Verified: a repository without a snapshot answers with `present: false` and no error; a manifest with
287
+ `indexes` removed answers with `isError` and the shape message.
288
+ ## 0.12.92
289
+
290
+ - The goal log records the 0.12.90-0.12.91 round, including the three probes that found nothing: a
291
+ BOM+CRLF config parses, a zip round-trips non-ASCII and bracketed names through Expand-Archive, and
292
+ a path beyond 260 characters scans correctly on this host.
293
+ ## 0.12.91
294
+
295
+ - **The host-path check missed a Windows path written as a string literal.** `C:\Users\name` was
296
+ caught; `C:\\Users\\name` — the exact spelling inside a JavaScript or JSON string, which is how
297
+ such a path usually reaches a source file — was not, and `C:/Users/name` was not either. On a
298
+ Windows host that is the most likely shape of the leak the check exists to find. The pattern now
299
+ accepts one or more separators, either kind.
300
+
301
+ Verified: a source file with the doubled form warns and reports `C:\\Users\\someone`; the plain and
302
+ forward-slash spellings still warn.
303
+ ## 0.12.90
304
+
305
+ - **The configuration page documents the transforms and the opt-in reports.** `stripComments`,
306
+ `removeEmptyLines`, `logCount` and `pack`, plus the `diff`, `log`, `tokenTree` and `sarif` artifacts,
307
+ were readable only in the CLI page or the source. The new section says which of them change line
308
+ numbering, that all four are part of the config digest, and that `validate` must be given the same
309
+ flags — the rule a user discovers the hard way otherwise.
310
+
311
+ Verified: site builds 29 pages and `audit-site` reports no problems.
312
+ ## 0.12.89
313
+
314
+ - The goal log records the 0.12.87-0.12.88 round: the CLI page completed and guarded, and the
315
+ unusual-file probes pinned as tests.
316
+ ## 0.12.88
317
+
318
+ - **Unusual files are a pinned test, not a one-off probe.** An empty file, a CRLF file, a file that
319
+ is nothing but comments under `--strip-comments`, a non-ASCII name, spaces and brackets in a name,
320
+ and a path deep enough to make a Windows path long: generate, `validate` and `health` all pass, the
321
+ manifest records the right line counts and mode, and `snapshot_read` and `snapshot_locate` answer
322
+ for `src/odd [name] (v2).ts`.
323
+ - The probes ran against the built binary before they became tests; nothing needed fixing, which is
324
+ worth recording too — the scan and part code handles these cases already, and now a regression
325
+ would be caught rather than discovered.
326
+ ## 0.12.87
327
+
328
+ **The CLI reference was missing ten options.**
329
+
330
+ - `docs/cli.md` is described as "Every command and option". It was missing the six transport flags
331
+ (`--http`, `--port`, `--host`, `--token`, `--no-auth`, `--allow-origin`) and `--all-members`,
332
+ `--strict`, `--mode`, `--no-update-check`. All ten have rows now, in the same five-column shape as
333
+ the rest, with the contract's own defaults and applies-to text.
334
+ - A new test compares the page with `describe --format json` in both directions: a published option
335
+ the page omits, and a documented option the contract no longer publishes, both fail.
336
+
337
+ Verified: 60 contract options, 60 documented, none missing and none unknown.
338
+ ## 0.12.86
339
+
340
+ - The phase checklists in `GOAL.md` are ticked against what actually shipped, with the two judgment
341
+ calls written down rather than left as unticked boxes: base64/binary is closed as not applicable
342
+ (binaries are skipped, never encoded), and gitingest is supported by the comparison harness but not
343
+ installed in this environment, so only repomix appears in the measured table.
344
+ ## 0.12.85
345
+
346
+ **`--remove-empty-lines`: the last parity flag.**
347
+
348
+ - Blank and whitespace-only lines are dropped from emitted bodies, on the CLI and through
349
+ `snapshot_generate { removeEmptyLines: true }`. It is the one transform that moves line numbers,
350
+ so every affected file records `emptyLinesRemoved: true`, the brief states how many files were
351
+ renumbered and tells the reader not to cite a line number for them, and the config digest covers
352
+ the setting.
353
+ - Because the digest now covers it, `validate` must be given the same flag: without it the run
354
+ reports configuration drift, which is the same contract `--strip-comments` has had since 0.12.84.
355
+
356
+ Verified: a body with blank lines is emitted without them, the file entry carries the marker, the
357
+ brief says so, `validate --remove-empty-lines` passes and `validate` without it reports drift.
358
+ ## 0.12.84
359
+
360
+ **`validate` compared a digest that did not cover three settings that change the bytes.**
361
+
362
+ - `--strip-comments`, `--pack` and the `--include-logs` count were missing from `configDigest`, so a
363
+ snapshot generated with `--strip-comments` and validated without it compared equal: the bodies on
364
+ disk were comment-free and the configuration said comments were kept. `option-scope.ts` already
365
+ claimed `validate` accepted `--strip-comments` "because the digest is computed over all of them" —
366
+ it was not, and now it is.
367
+ - Each field is written into the digest material only when it is not the default, so a snapshot
368
+ taken with the defaults keeps the digest it was recorded with and does not report drift after an
369
+ upgrade. A snapshot actually generated with one of these flags reports the change it was made
370
+ with, which is the answer `validate` promises.
371
+
372
+ Verified: the digest moves for `stripComments`, `pack` and a non-default `logCount`, and an explicit
373
+ default compares equal to the default.
374
+ ## 0.12.83
375
+
376
+ - **The troubleshooting page covers the features added since it was written.** A new section maps the
377
+ failure modes of selections, workspaces and signatures to their real messages: the `--slice`/`--delta`
378
+ and `--slice`/`--budget-tokens` refusals, the selection warning `validate` prints, the `not-selected`
379
+ answer from `explain`, a missing workspace index or member, why the combined score is the weakest
380
+ member, a signature that does not verify, the https-only and 1 GB refusals for `--remote`, and the
381
+ opt-in log report `snapshot_history` needs.
382
+ - These are the messages a user hits first, and until now the page that promises "every message below
383
+ is the real text the tool prints" did not list them.
384
+
385
+ Verified: site builds 29 pages and `audit-site` reports no problems.
386
+ ## 0.12.82
387
+
388
+ - The goal log records the 0.12.80-0.12.81 round: `health --all-members` and the workspace workflow
389
+ page.
390
+ ## 0.12.81
391
+
392
+ - **The workspace page now shows the whole workflow**, not just the generate call: the health audit
393
+ across members, validating one member against its repository, and serving the index to an agent
394
+ through `snapshot_workspace`. Each command in it was run on a fixture while the feature shipped.
395
+ ## 0.12.80
396
+
397
+ - **`health --all-members` audits a whole workspace.** It reads `WORKSPACE.json` and audits every
398
+ member snapshot a `--workspace` run wrote, one row each; the combined score is the weakest member,
399
+ and a missing member snapshot is an error row rather than a silent skip. `--format json` returns
400
+ the members with their counts and failed check ids.
401
+ - The flag is registered in the parser, the option-scope table and the contract, so `describe` says
402
+ it applies to `health` and nowhere else — the parser rejects it anywhere else.
403
+
404
+ Verified: a two-member workspace audits to 0 with both members listed; tampering with one member's
405
+ part fails the run and names that member; no index gives exit 1 with the instruction.
406
+ ## 0.12.79
407
+
408
+ - The goal log records the 0.12.77-0.12.78 round: `snapshot_history`, the `--include-logs` count fix,
409
+ `maxScanBytes` on the health tool, and the page-parity test.
410
+ ## 0.12.78
411
+
412
+ - **`snapshot_health` takes `maxScanBytes`.** The audit reads text to look for secrets and host
413
+ paths; on a multi-gigabyte snapshot that is the expensive half, and a client may want the structural
414
+ checks without it. The bound is stated in the result like every other audit cap.
415
+ - A test now compares `docs/mcp.md`'s tool table with the served set, so a tool added without its
416
+ row — or a row left behind — fails the suite. It and the argument check from 0.12.73 keep the two
417
+ MCP pages from drifting apart.
418
+
419
+ Verified: 26 MCP/docs tests pass, including the new page parity check and the `maxScanBytes` example.
420
+ ## 0.12.77
421
+
422
+ - **`snapshot_history`, the 24th tool.** The commits behind the snapshot, read from
423
+ `reports/log.md`: hash, date, subject. When the report was not written it says how to make one
424
+ (`includeLogs`) instead of returning an empty list.
425
+ - **`--include-logs <n>` was ignored.** The flag turned the report on, but the count was read from
426
+ `logCount` alone, so `--include-logs 3` wrote the default twenty and told nobody. A request that
427
+ is accepted and dropped is exactly the silent fallback this project forbids; the number is now
428
+ the count, for the CLI and for `snapshot_generate { includeLogs: n }` alike.
429
+
430
+ Verified: a generated log report is parsed into commits with a hash, a date and a subject; the
431
+ count from the flag is the count in the file; a snapshot without the report says how to make one.
432
+ ## 0.12.76
433
+
434
+ - The goal log records the 0.12.72-0.12.75 round: the tool reference and the test that guards it,
435
+ `snapshot_tests` as the 23rd tool, and the verify totals.
436
+ ## 0.12.75
437
+
438
+ - `tests/mcp-tools.test.js` ended with two newlines after the new test was appended; the lint gate
439
+ caught it, and it is one newline again.
440
+ ## 0.12.74
441
+
442
+ - **`snapshot_tests`, the 23rd tool.** Given a path, the tests that import it — plus the ones named
443
+ after it, because a test file and the source it exercises often share a stem without importing
444
+ each other. With no path, every test file and the files it covers. "Which tests should I run?" is
445
+ the second question after "what changed".
446
+ - Counts follow everywhere: README, the site description, `AGENTS.md`, the skill, the reference page
447
+ and the MCP tool table.
448
+
449
+ Verified: a test importing `src/user.ts` is found by the path query and by the full listing; a path
450
+ no test mentions says so instead of returning an empty list.
451
+ ## 0.12.73
452
+
453
+ - **The tool reference is checked against the real schemas.** Three examples on the new page were
454
+ wrong — `snapshot_locate` takes `query`/`by`, not `path`; `snapshot_context` takes `files`, not
455
+ `paths`; `snapshot_dependents` takes `direction`/`limit`, not `depth` — and a reader who sent them
456
+ would have got an error from the page that promised they worked. The examples are fixed, and
457
+ `tests/docs-tools.test.js` now parses the page and fails when a documented tool does not exist, an
458
+ argument is not in its schema, a type disagrees, or a required argument is missing.
459
+
460
+ Verified: both checks pass over all 22 documented tools.
461
+ ## 0.12.72
462
+
463
+ **A tool reference page: all 22 tools, with a call you can send.**
464
+
465
+ - `docs/tools.md` lists every tool by name, cost class and read-only status, with one ready-to-send
466
+ JSON-RPC call each and the conventions they share (root, outDir, errors that say why). The site is
467
+ now 29 pages; `docs/mcp.md` links to it.
468
+ - The page states what the tools will not do: a tool that cannot answer returns `isError` with a
469
+ reason instead of an empty list that looks like a true negative.
470
+
471
+ Verified: `npm run site` builds 29 pages and `audit-site` reports no problems.
472
+ ## 0.12.71
473
+
474
+ - The goal log records the 0.12.65-0.12.70 stretch: the head-to-head harness and its measured
475
+ numbers, `snapshot_workspace` (22 tools), route methods in a review, the contract's static/report
476
+ resource split, and the selection section in `report`.
477
+ ## 0.12.70
478
+
479
+ - **`report` says which selection produced the snapshot.** A budget or slice snapshot is a choice,
480
+ and the summary printed only totals: now it prints the slice question and cost, the budget usage
481
+ and coverage (entry points, symbols), and the delta base with its changed/added/removed/unchanged
482
+ counts. The data was in the manifest; the first screen a reader opens did not show it.
483
+
484
+ Verified: a budget snapshot reports its section, usage and entry-point coverage.
485
+ ## 0.12.69
486
+
487
+ - **The contract distinguishes static resources from report resources.** Splitting the list fixed two
488
+ real failures: `resources/list` no longer advertises a report that was never written (0.12.62), but
489
+ `describe` still claimed all six unconditionally, so the parity tests — correctly — failed.
490
+ `describe` now publishes `resources` (the four always-present) and `reportResources` (the six, served
491
+ only when written); the tests assert that split.
492
+
493
+ Verified: 48 MCP/contract/hygiene tests pass, including the two that caught it.
494
+ ## 0.12.68
495
+
496
+ - **`snapshot_review` names the route methods a change touches.** A review of `route.ts` that says
497
+ only "3 files, 120 lines" hides the fact that a `GET` and a `POST` changed shape. The summary
498
+ already recorded the methods; the review now prints them and returns them as `routes`.
499
+
500
+ Verified: a file exporting `handler as GET, handler as POST` is reviewed with
501
+ `Routes touched: GET/POST src/users/route.ts`.
502
+ ## 0.12.67
503
+
504
+ - **`snapshot_workspace` joins the server: 22 tools.** It reads `WORKSPACE.json` and answers which
505
+ members exist and which imports cross between them — the first question on a monorepo. Without a
506
+ workspace index it says how to make one rather than returning an empty list.
507
+
508
+ Verified: two members and an app→shared link are reported and printed; a missing index is an error
509
+ that names `--workspace`.
510
+ ## 0.12.66
511
+
512
+ - `scripts/compare.mjs` is the one change: the file ends with a newline, and the lint gate is clean
513
+ again. 0.12.65 shipped the harness with that rule failing, which is exactly what the gate exists to
514
+ catch and what `npm run verify` would have refused.
515
+ ## 0.12.65
516
+
517
+ **A measured head-to-head, not a claim.**
518
+
519
+ - `scripts/compare.mjs` runs this tool's full, slice and budget packs and, with `--repomix`, repomix
520
+ through `npx` (never a dependency), in one run on one repository. `--gitingest` does the same for
521
+ gitingest when it is installed; a missing competitor is reported, not silently skipped into a
522
+ misleading table.
523
+ - Measured here at 0.12.65 against repomix 1.19.0: 330 files / 1,027,911 estimated tokens for us,
524
+ 329 files / 854,178 for repomix, with slice at 6.5% and budget at 3.5% of our full pack. The
525
+ difference is the estimator — we count one token per four bytes, repomix uses a tokenizer — and
526
+ the page says so, including that our number is the conservative one.
527
+ - `docs/benchmarks.md` carries the table, the caveats and the exact command to reproduce it; a test
528
+ runs the harness on a fixture so it cannot rot.
529
+ ## 0.12.64
530
+
531
+ - The goal log records the 0.12.50-0.12.63 round: cancellation, the opt-in reports through MCP,
532
+ tool cost classes, the page's slice/budget modes and health score, and the five correctness fixes
533
+ the probes found (selection validate, signature and report expectations, explain, resources).
534
+
535
+ ## 0.12.63
536
+
537
+ - Removed four `.probe-*.mjs` scratch scripts that an earlier `add -A` committed. They were
538
+ investigation scaffolding, not source, and they had no place in the tree.
539
+
540
+ ## 0.12.62
541
+
542
+ - **`resources/list` no longer advertises a report that was never written.** The three opt-in
543
+ reports were listed unconditionally, so a client that trusted the list got an error on every read
544
+ of a report the run did not produce. A resource in the list is now a promise that the read works;
545
+ asking for an absent report directly still explains why it is not there.
546
+ - The reports directory is resolved against the repository root, so a relative `outDir` in the
547
+ configured project is found instead of being resolved against the process's working directory.
548
+
549
+ Verified: a default snapshot lists `reports/audit` and not `reports/diff`; generating with
550
+ `tokenTree: true` makes `reports/tokens` appear and readable.
551
+ ## 0.12.61
552
+
553
+ - **`explain` answers why a selection dropped a file.** On a slice or budget snapshot, a file that
554
+ passes every per-file rule was reported as "part: (not in the last snapshot; run generate)" — true
555
+ and useless. The manifest records the decision, so explain now reads it and answers
556
+ `included: no, reason: not-selected` with the detail the run wrote.
557
+ - The same lookup covers `unchanged` for a snapshot that records a changed-files scope.
558
+
559
+ Verified: on a slice snapshot, explaining a dropped file reports `not-selected` and names the
560
+ selection; the six earlier slice tests still pass.
561
+ ## 0.12.60
562
+
563
+ - The version note at the top of this file still claimed there would be no `0.13` and that every
564
+ change was a patch; the project has moved to the 0.12.x→0.17.0 ladder with npm publication at
565
+ `x.y.0`. The note now states the policy that is actually in force.
566
+ - `tests/mcp-cancel.test.js` created its scratch directory at module load and never removed it; the
567
+ hygiene test caught the leak and the directory now dies with the test.
568
+
569
+ Verified: full `verify` green at 1291 tests, 1283 pass, 0 fail; the changelog/version agreement test
570
+ passes.
571
+
572
+ ## 0.12.59
573
+
574
+ - **The workspace docs named a command that cannot work.** A member snapshot lives at
575
+ `<outDir>/<name>`, not `<name>/snapshot`, so `snapshot health --cwd api` finds nothing. The page now
576
+ shows the real invocation (`--cwd api --out-dir ../context/api`) and says what the MCP server needs
577
+ to serve one member.
578
+ - A delta pack and a token budget compose, and a test now pins it: narrow to the change, then fit the
579
+ window, with both blocks recorded.
580
+ ## 0.12.58
581
+
582
+ **The health audit knows every artifact the run wrote.**
583
+
584
+ - `reports/diff.md`, `reports/log.md`, `reports/tokens.md`, `full-codebase.xml` and
585
+ `reports/audit.sarif` were missing from the audit's expected set, so a snapshot that used any of
586
+ them warned "unexpected path" about a file the tool had just written. All five are known now, and
587
+ their digests are verified when the manifest records them.
588
+ - Expected paths are derived from what the manifest declares rather than from a static list, so an
589
+ artifact a run did not write is not expected and a file it did not declare is still unexpected.
590
+
591
+ Verified: a snapshot with every artifact reports 13 passed, 0 warnings, no unexpected path.
592
+ ## 0.12.57
593
+
594
+ - **A signed snapshot no longer reports `signature.json` as an unexpected file.** The health audit
595
+ knew every artifact the manifest records, and the signature is written after the manifest, so it
596
+ was not among them. It is now part of the expected set, and the check still verifies it.
597
+
598
+ Verified: generating with `--sign` and auditing reports no unexpected path and says the signature
599
+ verifies; an unsigned snapshot keeps the skip.
600
+ ## 0.12.56
601
+
602
+ **`validate` no longer fails a correct slice or budget snapshot.**
603
+
604
+ - Files a `--slice` or `--budget-tokens` run deliberately left out were reported as "new file …
605
+ missing from the snapshot", so `validate` exited 1 on a snapshot that was exactly right. They are
606
+ skipped with reason `not-selected`, and that is now treated as accounted for rather than drift.
607
+ - `validate` cannot re-run the planner — the question and the budget are not in the manifest — so it
608
+ says so in a warning: it checks what is present and does not second-guess the selection. A changed
609
+ file that *is* in the snapshot is still drift, which the test pins.
610
+
611
+ Verified: a slice validates clean, a budget snapshot validates clean, and editing a selected file
612
+ still fails with its path.
613
+ ## 0.12.55
614
+
615
+ - **`--slice` and `--budget-tokens` together are refused.** Both narrow the selection, nothing defined
616
+ which should win, and the combination produced an empty snapshot in testing. The error points at
617
+ `--slice-tokens` for the slice's own budget. `--delta` still composes with a budget, which is
618
+ defined: narrow to the change, then fit it.
619
+
620
+ Verified: the combination exits non-zero with the reason; the slice tests still pass.
621
+ ## 0.12.54
622
+
623
+ - **The page audits what it just wrote.** `POST /api/generate` returns a health summary (score,
624
+ failed check ids, warning count) and the page shows it beside the fingerprint. `GET /api/health?path=`
625
+ re-runs the audit for the snapshot on screen.
626
+ - A page that can produce a snapshot and not say whether it is safe to hand over was only half a
627
+ tool; the health service was already there, and now it is on the surface.
628
+
629
+ Verified: generation returns a score, the standalone endpoint returns the same score with the full
630
+ check list, and the eight serve tests pass.
631
+ ## 0.12.53
632
+
633
+ - **The browser page can slice and budget, not only dump everything.** A mode selector offers *whole
634
+ repository*, *a slice for a question* and *fit a token budget*; the API accepts
635
+ `{ mode, question, budgetTokens }`, validates them (a slice needs a real question, a budget at least
636
+ 500) and reports how many paths were not selected.
637
+ - The page sends the mode and the result line says which one ran, so the same page is useful for a
638
+ question, a context window and a full audit.
639
+
640
+ Verified: slice and budget modes generate through the API with their `dropped` counts; a slice with
641
+ an empty question and a budget below 500 are 400s.
642
+ ## 0.12.52
643
+
644
+ - **Every tool states its cost**: `cheap` (manifest), `medium` (one or a few parts), `expensive`
645
+ (reads the repository or writes), published as `_meta["codebase-snapshot/cost"]` in `tools/list`
646
+ and as `cost` in `describe --format json`. The table lives in one place and `buildTools` throws if
647
+ a tool is added without one.
648
+
649
+ Verified: every one of the 21 tools reports a valid class through the protocol, and the contract lists
650
+ them.
651
+ ## 0.12.51
652
+
653
+ - **`snapshot_generate` can write the opt-in reports.** `includeDiffs`, `includeLogs <n>`,
654
+ `tokenTree` and `stripComments` are tool arguments now, so a client can ask for the diff, the log,
655
+ the token tree or comment stripping without shelling out to the CLI. The options travel to the
656
+ worker exactly as the CLI passes them, and `--skip-artifacts` semantics are unchanged.
657
+
658
+ Verified: generating with `tokenTree: true` writes `reports/tokens.md` and records it in
659
+ `artifacts.tokenTree`.
660
+ ## 0.12.50
661
+
662
+ **Cancellation reaches the tool.**
663
+
664
+ - `notifications/cancelled` with a `requestId` now runs a callback the running call registered.
665
+ `snapshot_generate` terminates its worker and answers "The generation was cancelled."; the
666
+ staging rules remove what was half-written, so no snapshot claims to be complete.
667
+ - Every tool is offered the hook; the ones that are bounded simply finish before they could notice.
668
+ The response says the call was cancelled rather than pretending it never ran.
669
+ - The docs no longer claim cancellation is ignored.
670
+
671
+ Verified: a stub tool registers its callback, the notification reaches it, and the call resolves with
672
+ the cancelled result; the existing progress tests still pass.
673
+
674
+ ## 0.12.49
675
+
676
+ - The goal log records the 0.12.15-0.12.48 stretch: what shipped, the verify totals, and the work
677
+ still open for the next rounds. Documentation only.
678
+
679
+ ## 0.12.48
680
+
681
+ - **The brief names the opt-in reports this run wrote.** `PROMPT.md` has one list of "what else you
682
+ were given"; `reports/diff.md`, `reports/log.md` and `reports/tokens.md` were missing from it, so a
683
+ reader was never told to open a report the run had just produced. Each is listed when — and only
684
+ when — the manifest records it.
685
+ - Roadmap statuses brought up to date: 21 tools, workspace cross-links, the budget coverage report,
686
+ and the binary files item closed as not applicable (binaries are skipped, never base64-encoded).
687
+
688
+ Verified: a run with `--token-tree --include-diffs` names both reports and does not name the log it
689
+ was not asked for; full `verify` green at 1279 tests, 1271 pass, 0 fail.
690
+ ## 0.12.47
691
+
692
+ - **`snapshot_plan_for` includes the callers of its strongest matches.** Dependencies alone answer
693
+ "what does this use"; a reader editing a function also needs "what uses this". Up to four callers
694
+ of the top three files are pulled in with `why: "imports <path>"`, still inside the budget.
695
+ - The planner now resolves `.js` specifiers to their `.ts`/`.tsx` files and extension-less
696
+ specifiers, so a TypeScript repository's caller edges are found rather than looking empty.
697
+
698
+ Verified: a question matching `getUser` plans `src/user.ts` and its caller `src/auth.ts`, with the
699
+ caller's reason naming the dependency.
700
+ ## 0.12.46
701
+
702
+ **Four graph tools: 21 in total.**
703
+
704
+ - `snapshot_entrypoints`: the files a reader should start from (manifests first, then `index`/`main`/
705
+ `app`/`server`/`cli`), with importer counts and token costs. The same heuristic the budget planner
706
+ uses, exposed so an agent can start where a maintainer would.
707
+ - `snapshot_neighbors`: both directions of the import graph for one path — what it imports and what
708
+ imports it, resolved against the snapshot and listed with their parts.
709
+ - `snapshot_routes`: every route a summary recorded, with the file and part. A project without
710
+ framework routes reports none rather than an empty table with no explanation.
711
+ - `snapshot_cycles`: strongly connected components in the import graph, computed with the same
712
+ resolver the generator uses, so a reported cycle is one the snapshot really has.
713
+ - `docs/mcp.md` lists all 21, and the hygiene test holds the count.
714
+
715
+ Verified: a two-file loop is found and a clean tree reports none; neighbors names both directions;
716
+ entry points sort manifests first; routes reports a count even when it is zero.
717
+ ## 0.12.45
718
+
719
+ - **Workspaces record cross-member imports.** A relative import in one member that resolves inside
720
+ another becomes a link in `WORKSPACE.json` — from, to, specifier count and a few example paths —
721
+ and the summary prints it. It is the one thing a per-member snapshot cannot see, and the first
722
+ thing a reader of a monorepo needs.
723
+ - The edge is a static link from the specifier text: it says the members are coupled, not that the
724
+ target file is present in the other member's snapshot. The docs say so.
725
+
726
+ Verified: an app→shared import is recorded with its example path and printed; the three earlier
727
+ workspace behaviours still pass.
728
+ ## 0.12.44
729
+
730
+ - **The token-budget report says what survived.** `budget.coverage` records, per layer, how many
731
+ files were kept of how many, plus entry points and exported symbols. The brief quotes the symbol
732
+ and entry-point counts, and a lost entry point is a warning rather than a silent omission.
733
+
734
+ Verified: the coverage block exists, every `kept` is at most its `total`, symbols are counted from
735
+ the summaries, and the fixture's entry points are counted.
736
+ ## 0.12.43
737
+
738
+ - **MCP progress notifications.** A `tools/call` carrying `_meta.progressToken` receives
739
+ `notifications/progress` while it runs; `snapshot_generate` reports "generating" and "writing the
740
+ snapshot" with a 2-step total. A call without a token emits nothing.
741
+ - Notifications are delivered by the stdio loop; the HTTP transport answers one request with one
742
+ document and cannot interleave them.
743
+ - `notifications/cancelled` is still accepted and ignored, and the docs now say so instead of leaving
744
+ a client to guess: there is no cancellation signal inside a generate.
745
+
746
+ Verified: a call with a token emits notifications carrying that token and a numeric progress before
747
+ the response; a call without one emits nothing.
748
+ ## 0.12.42
749
+
750
+ - **The language profiles are pinned by a test.** Python, Go, Rust, Java, C#, Ruby and PHP each get a
751
+ fixture asserting what the docs claim: imports, top-level definitions and, for Python, route
752
+ decorators. The profiles predate this stretch; the test exists so a regression in the import graph
753
+ or `snapshot_locate` for those languages fails here instead of in a user's repository.
754
+ ## 0.12.41
755
+
756
+ **Two more tools: `snapshot_search` and `snapshot_stats`.**
757
+
758
+ - `snapshot_search` answers "where is this mentioned?" across the emitted parts, case-insensitive or
759
+ as a regular expression, with a match cap, a scan budget and optional context lines. It reads only
760
+ what the snapshot contains, so a redacted value and an excluded file cannot be found by searching
761
+ for them. A query under three characters is refused rather than matching everything.
762
+ - `snapshot_stats` reads the manifest: files by layer and kind, part sizes, token estimate, the
763
+ heaviest files and the most expensive parts.
764
+ - Seventeen tools now, and every count in the docs follows.
765
+
766
+ Verified: a symbol is found with real line numbers, an absent string finds nothing, a two-character
767
+ query and an invalid regex are refused, and stats agree with the manifest exactly.
768
+ ## 0.12.40
769
+
770
+ **`--strip-comments`: less prose, same line numbers.**
771
+
772
+ - Removes comment text from JavaScript and TypeScript bodies before emission. The TypeScript
773
+ **parser** decides what is a comment, so a marker inside a string, a template literal, a regex
774
+ literal or JSX attribute is left alone — the case a regular expression gets wrong.
775
+ - Newlines inside removed comments are kept, so every line number in the manifest still points at
776
+ the same source line. Files record `inclusionMode: "comments-stripped"` rather than `full`, and
777
+ the brief says comments were removed.
778
+ - `--strip-comments` is accepted by `validate` (it changes the recorded configuration), and `explain`
779
+ reports the same mode `generate` would choose.
780
+
781
+ Verified: a fixture with a URL, a template literal, a regex and block comments loses only the
782
+ comments; line counts and `originalLines` are unchanged; markdown is untouched; health stays clean.
783
+
784
+ ## 0.12.39
785
+
786
+ - The roadmap records what shipped, with the version that shipped it, rather than a wall of
787
+ `planned` rows that no longer describe the repository.
788
+ - The workspace page title fits the site title budget that `audit-site` enforces.
789
+
790
+ ## 0.12.38
791
+
792
+ **`--workspace a,b`: several repositories, one deliverable.**
793
+
794
+ - One snapshot per member under `<outDir>/<name>`, plus `WORKSPACE.json` listing each member's
795
+ fingerprint, file count, part count and token estimate. Each member directory is a normal
796
+ snapshot: `health`, `validate` and the MCP server work on it.
797
+ - Members are generated on the defaults: a member may contain a config that runs code, and a
798
+ workspace is a set of repositories the caller named, not one they configured.
799
+ - A missing member is named and the run exits 1 **after** writing the members that succeeded, so a
800
+ partial workspace is never mistaken for a complete one.
801
+ - Refused with `--remote`, `--delta`, `--slice`, `--budget-tokens` and `--sign`: those narrow or sign
802
+ one snapshot.
803
+
804
+ Verified: two members produce two manifests and two records; a missing member exits 1 with the good
805
+ member written; the combination refusal names the conflicting flags.
806
+ ## 0.12.37
807
+
808
+ - **A migration guide** for 0.12.14 → 0.17.0: every new command, `generate` flag and config key with
809
+ the version that added it, the MCP surface from eight to fifteen tools and two to seven prompts,
810
+ and the two behaviour changes (`validate` accepts the report flags; npm publishes only at
811
+ `x.y.0`). It also says what did not change, which for a reader deciding whether to upgrade is the
812
+ first question.
813
+ ## 0.12.36
814
+
815
+ - **The opt-in reports are resources too**: `snapshot://reports/diff`, `snapshot://reports/log` and
816
+ `snapshot://reports/tokens` are listed and readable when the snapshot has them. When it does not,
817
+ the read is a not-found that names the artifact, not an empty document that looks like an answer.
818
+
819
+ Verified: all three are advertised by `resources/list`, and reading one from a snapshot generated
820
+ without the flag raises the documented not-found error.
821
+ ## 0.12.35
822
+
823
+ - **A Dockerfile, entrypoint and deploy page.** The image copies the built bundle and runs as the
824
+ `node` user; the entrypoint **refuses to start without `SNAPSHOT_TOKEN`**, because `serve` on
825
+ `0.0.0.0` without one would expose the repository. Compose and systemd examples are on the page.
826
+ - The packaging suite pins the mistakes that make a Dockerfile rot: a `COPY` of a path that no
827
+ longer exists, a floating `latest` base, an entrypoint that starts without a token, and a
828
+ `.dockerignore` that stops excluding repository state. The build itself is not exercised here
829
+ because Docker is not available in this environment, and the page says the image is not published.
830
+ ## 0.12.34
831
+
832
+ - **`scripts/benchmark.mjs` and a benchmarks page.** Three modes on this repository: full 987,750
833
+ estimated tokens across 313 files and 11 parts; a task slice 66,430 tokens (6.7%); a 30,000-token
834
+ budget 36,315 tokens across 21 whole files (3.7%). Generation time is about the same in all three,
835
+ which is the point: the saving is in what is written, not in what is read. The script is runnable
836
+ against any repository.
837
+ - **A security review page.** The threat model (malicious repository, URL, browser page, MCP client,
838
+ log reader), the controls for each surface, the tests that pin them, and six residual risks stated
839
+ rather than hidden — including the SSE query token, DNS rebinding and prompt injection.
840
+ ## 0.12.33
841
+
842
+ **`--budget-tokens <n>`: fit a repository into a limit without tearing files.**
843
+
844
+ - Part budgets truncate; a token budget **selects whole files**. Entry points first, then the
845
+ most-imported, configuration before source and tests last, with a small penalty for cost so a
846
+ cheap file that matters beats an expensive one that barely does.
847
+ - The selection is recorded in `budget { maxTokens, usedTokens, files, dropped }`; every path that
848
+ did not fit is in `skipped[]` with reason `not-selected`, and the brief states the budget, the
849
+ selection size and the drop count.
850
+ - It composes with `--delta`, so a budget can be spent only on what changed.
851
+
852
+ Verified: the selection fits the budget, the entry point survives, every selected file is
853
+ `inclusionMode: full`, and a budget too small for anything still exits cleanly and says so.
854
+ ## 0.12.32
855
+
856
+ **Signed snapshots (`--sign`).**
857
+
858
+ - Signs the exact bytes of `manifest.json` with Ed25519 and writes `signature.json` beside it:
859
+ algorithm, fingerprint, `manifestSha256`, public key, signature, and whether the key was
860
+ configured or generated. One signature covers every part and artifact through the manifest digests.
861
+ - The key comes from `SNAPSHOT_SIGNING_KEY` (PEM). With none set, a fresh key is generated and its
862
+ public half is written in the record — trust on first use, stated as such in the file and the docs.
863
+ - `snapshot health` verifies a signature when present: a manifest changed after signing is a
864
+ critical failure; no signature is a skip, because absence is not tampering.
865
+
866
+ Verified: a generated signature verifies and health agrees; a tampered manifest fails with
867
+ "changed after it was signed"; a configured key produces a record the matching public key verifies;
868
+ an unsigned snapshot skips the check.
869
+ ## 0.12.31
870
+
871
+ **`--pack single|xml|json`: one full-repository file, in the shape you asked for.**
872
+
873
+ - `--pack xml` writes `full-codebase.xml` (one `<file>` element per source, attributes for layer,
874
+ kind, language, lines and bytes, the body in CDATA). `]]>` cannot appear in CDATA, so it is split
875
+ across two sections — a file containing that sequence still produces valid XML.
876
+ - `--pack single` writes only `full-codebase.md`; `--pack json` only `full-codebase.json`. Unset
877
+ keeps the historical `--include-monolith` pair, so nothing that worked before changes.
878
+ - The chosen pack is gated by `--max-monolith-bytes` like the pair, records its digest in
879
+ `artifacts` (`fullXml` for XML), and `validate` requires it to exist and match.
880
+
881
+ Verified: XML parses and has one element per file including a `]]>` body; each mode writes only its
882
+ file; a deleted XML fails validate with its path; an invalid mode is a usage error.
883
+ ## 0.12.30
884
+
885
+ **`snapshot_review`: three questions in one call.**
886
+
887
+ - Returns whether the snapshot is current (validate), the health score with every failed check, and
888
+ the head window of the paths a change touched. A reviewer starts with one call instead of three.
889
+ - Fifteen tools now; every count in the docs follows, enforced by the hygiene test.
890
+
891
+ Verified: a current snapshot reviews clean with the requested body; an edited file makes the same
892
+ call report stale while still returning the body.
893
+ ## 0.12.29
894
+
895
+ - **Legacy SSE transport** for clients that predate Streamable HTTP: `GET /sse` announces
896
+ `/messages?sessionId=…`, the client POSTs JSON-RPC and reads the answer as a `message` event.
897
+ The token may arrive as `?token=` on this path only, because `EventSource` cannot set headers;
898
+ the docs say that is a leak into logs. A heartbeat every 15 s keeps the stream alive, and
899
+ shutdown ends the streams instead of waiting on them forever.
900
+ - `/healthz` reports the real tool count (it said 12 while the server served 14).
901
+
902
+ Verified: a full SSE handshake and JSON-RPC answer, 401 without the token, 404 for an unknown
903
+ session id, and the suite no longer hangs on teardown.
904
+ ## 0.12.28
905
+
906
+ - `validate` now checks the opt-in reports the manifest declares (`reports/diff.md`,
907
+ `reports/log.md`, `reports/tokens.md`), like it already checked the README, brief, navigation,
908
+ tree, audit and monoliths. Deleting one fails with its path instead of leaving validate green.
909
+ - `validate` accepts `--include-diffs`, `--include-logs` and `--token-tree`, because those flags
910
+ change the artifact selection the manifest records: without them validate reported the selection
911
+ as drift. Comparing like with like is the point of a drift check.
912
+ ## 0.12.27
913
+
914
+ - Site: hand-written meta descriptions for the five pages added in this stretch (`health`, `serve`,
915
+ `remote`, `delta`, `slice`), each 100–160 characters and stating the problem, the artifact and the
916
+ differentiator. `audit-site` caught the fallback descriptions as too long, which is what it is for.
917
+ ## 0.12.26
918
+
919
+ **Task slices: `--slice "<question>"`.**
920
+
921
+ - The retrieval planner runs at generate time: only the files it chooses for the question are written,
922
+ within `--slice-tokens` (default 30000). For a focused question about one subsystem, the snapshot
923
+ is small enough to paste and carries the callers it needs.
924
+ - Every scanned path that was not chosen is in `skipped[]` with reason `not-selected` — deliberately
925
+ not `unchanged`, which would be a different and untrue statement. The manifest records the
926
+ question, the budget, the used tokens, the chosen paths and the dropped count.
927
+ - `PROMPT.md` says at the top that the snapshot is a slice, quotes the question and warns that
928
+ unselected paths are not in the parts.
929
+ - Symbol matching learned stems: `charge` matches `chargeCard`, `authenticated` matches `auth`, which
930
+ is what makes a real question plan something.
931
+ - `--slice` and `--delta` are refused together: they narrow in different directions.
932
+
933
+ Verified: the matching file is kept and the unrelated document is dropped and recorded; the budget
934
+ is a ceiling; the contradiction is refused.
935
+ ## 0.12.25
936
+
937
+ **Delta packs: `--delta <base>`.**
938
+
939
+ - The snapshot contains only the files that changed since a base snapshot (compared by content
940
+ hash, not mtime), plus the one-hop importers of those files. For a change review, that is the new
941
+ bytes and the callers that might break, and nothing else.
942
+ - Nothing is dropped silently. Unchanged files go into `skipped[]` with reason `unchanged` **and**
943
+ into `delta.unchanged`; the manifest records `base { path, fingerprint, generatedAt }` and the
944
+ added/changed/removed lists.
945
+ - `PROMPT.md` states the delta at the top with the counts and the warning that unchanged files are
946
+ not in the parts, so a reader cannot describe them from memory.
947
+ - The shared narrowing is now one function (`narrowTo`): totals, layer/kind counts, findings,
948
+ warnings and monolith bodies are undone together, which `--with-dependents` and `--delta` both use.
949
+
950
+ Verified: changed file plus its importer are in the parts and the unrelated file is not; an added
951
+ and a removed file are classified; a missing base is an error that names the path.
952
+ ## 0.12.24
953
+
954
+ **Three opt-in reports: the diff, the log, the token tree.**
955
+
956
+ - `--include-diffs` writes `reports/diff.md` from the unstaged and staged diff, names the git
957
+ command, is bounded to 200 KiB with a truncation note, and is **absent when the tree is clean** —
958
+ an empty report is noise. It records `artifacts.diff` in the manifest.
959
+ - `--include-logs <n>` writes `reports/log.md` with the last n commits (1–500, one line each). An
960
+ invalid n is a usage error, not a silent default.
961
+ - `--token-tree` writes `reports/tokens.md`: per-file estimates sorted by cost with directory
962
+ rollups, using the same estimate the manifest carries, and the rows add up to the stated total.
963
+ - All three are also config keys (`artifacts.diff`, `artifacts.log`, `artifacts.tokenTree`,
964
+ `logCount`), default off, and `--skip-artifacts` still wins.
965
+
966
+ Verified: a clean tree produces no diff artifact and a changed one contains the change and the
967
+ command; the log names its range and the commit; the token rows sum to the stated total; a bad
968
+ `--include-logs` value is refused.
969
+ ## 0.12.23
970
+
971
+ **Two more retrieval tools, aimed at the questions an agent actually asks.**
972
+
973
+ - `snapshot_symbol`: where is this function/class/constant defined? Returns the emitted window around
974
+ the definition with a real line number, searched in the parts so redaction still applies. A miss
975
+ says the symbol may be excluded, unsupported or named differently, and points at `snapshot_explain`.
976
+ - `snapshot_diff_context`: given the paths a change touched, the body window of each plus the files
977
+ that import it, within a token budget. Dependents resolve through extension-less and `.js` → `.ts`
978
+ specifiers, because that is how the repository writes them.
979
+ - Fourteen tools; the count in every document follows, enforced by the hygiene test.
980
+
981
+ Verified: symbol definition with line number, a clean miss, an empty name refused; diff context with
982
+ its dependent named, a missing path reported, and an empty list refused.
983
+ ## 0.12.22
984
+
985
+ **Seven MCP prompts: two about order, five about a job.**
986
+
987
+ - `audit` (health, drift, exclusions, findings), `review` (plan the reading for a change, name the
988
+ dependents), `explain` (why a path is here, what it does), `onboard` (a reading order for a new
989
+ contributor), `security-review` (authn/authz, secrets, injection, and what the snapshot cannot
990
+ see). `orient` and `keep-current` stay.
991
+ - Every tool a prompt names is a tool the server serves, and a test holds the two lists together so
992
+ a prompt cannot point an agent at a name that does not exist.
993
+ - The docs no longer claim there is no HTTP transport, because there is one.
994
+
995
+ Verified: the seven prompts exist with descriptions, every `snapshot_*` name in every prompt is a
996
+ served tool, required arguments reach the text, and a missing optional argument yields the base
997
+ prompt.
998
+ ## 0.12.21
999
+
1000
+ - **The browser page accepts repository URLs.** `serve` uses the same parser, private-address
1001
+ refusal and shallow clone as `generate --remote`, generates into a temporary snapshot, and keeps
1002
+ the clone alive for the page until the server exits. `--allow-private` opts out deliberately;
1003
+ without it a URL pointing at the local network is a 400 with the reason.
1004
+ - The API returns the snapshot directory (not the clone root), so preview and zip work on a remote
1005
+ exactly as they do on a local path.
1006
+
1007
+ Verified: a `file:` source clones through the API, the manifest carries the provenance, and
1008
+ `https://127.0.0.1` is refused with "private address".
1009
+ ## 0.12.20
1010
+
1011
+ **`generate --remote`: a repository URL in, a traceable snapshot out.**
1012
+
1013
+ - https only, no credentials in the URL, and the resolved address must be public: loopback,
1014
+ RFC1918, link-local (including cloud metadata `169.254.169.254`), CGNAT and their v6 equivalents
1015
+ are refused unless `--allow-private` says otherwise. The host is checked again after DNS, because
1016
+ a name can point at 127.0.0.1.
1017
+ - Shallow clone (`--depth 1`, one branch, no tags, no submodules, no LFS) into a temporary
1018
+ directory that is removed on exit; `--keep-clone` keeps it. `GITHUB_TOKEN` reaches git through
1019
+ the environment, never argv, and never enters the manifest.
1020
+ - The manifest records `source: { url, host, owner, repo, ref, commit, fetchedAt }`, so the snapshot
1021
+ names the commit it describes instead of a branch that may have moved. A fetched repository is
1022
+ not a trusted one, so its config file is not loaded.
1023
+ - `--allow-private` for air-gapped mirrors and `file:` tests; it is an explicit override, not a
1024
+ fallback.
1025
+
1026
+ Verified: parser and refusal table, private-address classification (v4 and v6), `file:` gated behind
1027
+ `--allow-private`, and an end-to-end clone whose manifest carries a 40-character commit and writes
1028
+ into the caller directory rather than the temp clone.
1029
+ ## 0.12.19
1030
+
1031
+ **`snapshot serve`: the browser face.**
1032
+
1033
+ - One process serves the page, the API it calls, and MCP at `POST /mcp`, all on loopback with one
1034
+ bearer token, generated on first run and printed once. The page asks for the token and keeps it
1035
+ in `localStorage`, so serving `/` can never leak the credential.
1036
+ - `POST /api/generate` runs the same `generateSnapshot` the CLI runs, with the defaults (a page
1037
+ request must not execute repository config code); `GET /api/snapshot` returns the brief and the
1038
+ file list from the written snapshot; `GET /api/snapshot.zip` returns the directory as a zip.
1039
+ - A store-only zip writer, no dependencies, with a parser test that reads the central directory back
1040
+ and a manual check that Windows `Expand-Archive` opens it.
1041
+ - A remote URL is refused with the reason ("not enabled in this build") rather than a pretend fetch.
1042
+
1043
+ Verified: page without token, API without token 401, generate → preview → zip round trip, the
1044
+ remote refusal, MCP on the same port, 404 for an unknown path.
1045
+ ## 0.12.18
1046
+
1047
+ **MCP over HTTP, for the clients that cannot spawn a process.**
1048
+
1049
+ - `snapshot mcp --http` serves the same twelve tools as Streamable HTTP: POST a JSON-RPC message
1050
+ (or an array) to `/mcp`, read the answer from the response body. `GET /healthz` answers
1051
+ `{ ok, name, tools }`.
1052
+ - Loopback by default (`127.0.0.1:4789`). A bearer token is generated on first run and printed;
1053
+ `--token` picks one, `--no-auth` turns the requirement off and is refused on a non-loopback bind.
1054
+ - CORS for loopback origins and any `--allow-origin` listed; everything else gets 403. Bodies are
1055
+ capped at 2 MB, requests at 60 per 10 s per address, and every error is a JSON-RPC error document.
1056
+
1057
+ Verified: initialize and tools/list over POST, 401 without the token, `--no-auth` refusing a
1058
+ non-loopback bind, CORS allow/deny, a notification answered 202, invalid JSON answered -32700, and
1059
+ the health endpoint.
1060
+ ## 0.12.17
1061
+
1062
+ - **`snapshot_context`**: named files or exported symbols in, one bounded context block out, read
1063
+ from the snapshot (so redacted and preview-bounded). Each file contributes a head window; a file
1064
+ that does not fit is shortened and says "first N lines", never silently dropped, and a file that
1065
+ cannot be shortened is listed in `missing` with the reason.
1066
+ - Twelve tools. The counts in the docs move with the server, enforced by the hygiene test.
1067
+
1068
+ Verified: file and symbol lookup, honest `missing`, the budget ceiling and the shortened-file
1069
+ notice are covered in `tests/mcp-retrieval.test.js`.
1070
+ ## 0.12.16
1071
+
1072
+ **Two retrieval tools, which are the point of the product.**
1073
+
1074
+ - `snapshot_plan_for`: given a question and a token budget, the smallest set of files that answer
1075
+ it, in reading order, each with the reason it was chosen and the part it lives in. Deterministic:
1076
+ path and symbol matches first (a question saying "authenticated" matches `auth.ts`), then the
1077
+ imports of the strongest matches, packed to the budget. A file too large for what remains is
1078
+ offered as a head-only read rather than dropped; every skip says why.
1079
+ - `snapshot_query`: filter the index by layer, kind, a path regular expression or a symbol name,
1080
+ with the part, line count and token estimate. Invalid regular expressions are an error, not an
1081
+ empty result.
1082
+
1083
+ The MCP server now serves eleven tools. Every document that states the count agrees, enforced by
1084
+ the existing hygiene test. npm publication now happens only at `x.y.0`; this version is tagged and
1085
+ pushed, not published.
1086
+
1087
+ Verified: the new suite covers reading order, the budget ceiling, determinism, test exclusion, an
1088
+ empty question, a missing snapshot, filtering, capping and an invalid pattern.
29
1089
  ## 0.12.15
30
1090
 
31
1091
  **New command: `snapshot health`.** `validate` answers "did the code move?"; health answers the