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