codebase-snapshot 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -30,6 +30,705 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
30
30
 
31
31
  ---
32
32
 
33
+ ## 0.18.0
34
+
35
+ **"A newer version is available" now has a command, and stops hiding after one failure.**
36
+
37
+ - The notice has existed since 0.9.6, and a reader running an old global copy reported seeing it
38
+ never. The cause was in their cache file: `{"checkedAt":…,"latest":null}` — a **failed** request
39
+ remembered for an hour. One slow answer (the deadline was 1.2 s) made every run in the next hour
40
+ silent, which is indistinguishable from "you are current".
41
+ - A failed check is now remembered for **five minutes**, and the request deadline is **2.5 s**. The
42
+ request overlaps the command, so the longer deadline adds no wall time to real work.
43
+ - New command: **`snapshot update`**. It bypasses the cache, works without a terminal, prints the
44
+ version it compared against even when that answer is "current", and sets an exit code a script can
45
+ branch on: `0` current, `1` newer release, `2` registry unreachable. `--format json` returns
46
+ `{ current, latest, updateAvailable, command }`. `CODEBASE_SNAPSHOT_REGISTRY_URL` points it at a
47
+ mirror.
48
+ - The command is registered in the contract, the option scope, the usage text, the README table and
49
+ the CLI reference; five tests drive it against a local registry, including a directory whose
50
+ `snapshot.config.ts` this server refuses to run.
51
+ ## 0.17.58
52
+
53
+ **The changelog lost its first 4,278 lines, and nothing noticed for eight releases.**
54
+
55
+ - The 0.17.50 release rewrote `CHANGELOG.md` in a PowerShell one-liner meant to normalise the final
56
+ newline. It wrote back only the head of the file: 5,120 lines became 884, and every section older
57
+ than 0.13.4 — 118 tagged versions, the 0.9.x, 0.10.x, 0.11.x and most of the 0.12.x line — was
58
+ gone from the working tree. The commit recorded the deletion honestly; the changelog that was
59
+ supposed to be the release record no longer was one.
60
+ - Restored from `git show v0.17.49:CHANGELOG.md` spliced with the eight sections written since: 227
61
+ sections, 5,226 lines, ending at 1.0.0, and **every one of the 203 `v0.*` tags now has its section**
62
+ (checked individually, not just counted).
63
+ - A hygiene test now compares the tag list with the changelog: a tagged version without a section fails
64
+ the suite. It reads tags from git, so a truncated file cannot pass again. The one-liner is gone from
65
+ this repository's release procedure; file rewrites go through a script that reads and writes the
66
+ whole file.
67
+
68
+ This also explains part of what the tags looked like from outside: with the history gone, most recent
69
+ release diffs were only the few files a small fix touched.
70
+ ## 0.17.57
71
+
72
+ - The goal log records the 0.17.52-0.17.56 backlog round: docs prose, SSE end to end, answer/query
73
+ edges, and a benchmark re-run that reproduced every published number.
74
+ ## 0.17.56
75
+
76
+ **The ten-repository benchmark was re-run, not assumed.**
77
+
78
+ - `node scripts/benchmark-suite.mjs --json` cloned all ten default repositories shallow, packed each
79
+ with ours, repomix 1.19.0 and gitingest: **10/10 succeeded for all three tools**, and every file
80
+ count, token count and byte count is identical to the table already in `docs/benchmarks.md`. The
81
+ scanner is deterministic across 0.14.5 → 0.17.55, which is the result a refresh is meant to
82
+ establish.
83
+ - The page now says so, and the minimatch ratio carries its second decimal (202.72).
84
+
85
+ Verified: the run itself (exit 0, 10 rows, no skips); site checks unchanged.
86
+ ## 0.17.55
87
+
88
+ **The output page's tree omitted two artifacts it documents elsewhere.**
89
+
90
+ - `reports/selection.md` (written by `--slice` and `--budget-tokens`, referenced in `slice.md`,
91
+ `answer.md` and `migration.md`) and `reports/audit.sarif` (`--sarif`) were missing from the tree in
92
+ `docs/output.md`.
93
+ - The `artifacts` row counted "a digest of every artifact" and listed eight keys, leaving out
94
+ `selection` and `fullXml` — both real keys in the manifest's digest map.
95
+
96
+ Verified: site rebuilt, 66 files / 742 links / 0 problems, `audit-site` clean.
97
+ ## 0.17.54
98
+
99
+ **`snapshot_answer` said "1 skipped for budget" and named nothing.**
100
+
101
+ - With a tight budget the planner leaves a strong match out and packs a cheap one; the text said
102
+ "1 skipped for budget" while the structured `omitted` array stayed empty. A client reading the
103
+ reply could not tell which file it had missed or why.
104
+ - The planner's own skips now flow into the answer: `omitted` carries `{ path, reason }`, and the
105
+ text lists them under "Not included". The same 500-token question now says
106
+ `src/auth/login.ts - does not fit the remaining budget`.
107
+ - Probed the rest of both tools' edges and left them as they are: `snapshot_query` caps at `maxFiles`,
108
+ reports `0 file(s) matched` when nothing matches, and rejects an invalid `pathPattern` with the
109
+ reason; `snapshot_answer` measures `usedTokens` on the text it returns, marks clipped blocks, and
110
+ keeps the planner notes when nothing was assembled.
111
+
112
+ Verified: the new test asserts the omitted path in both the text and the structured reply;
113
+ `mcp-tools` 42/42.
114
+ ## 0.17.53
115
+
116
+ **SSE probed end to end for the first time outside its unit tests.**
117
+
118
+ - Stream with `?token=`: 200, `event: endpoint`, then `initialize` and `tools/list` answered over a
119
+ `POST /messages` that carries no Authorization header but the token in the query — the pattern a
120
+ browser client with only `EventSource` needs. Both replies arrived as `message` events; a POST with
121
+ neither form of the token is 401.
122
+ - The page told clients to POST "to that path" without saying how a header-less client authenticates.
123
+ It now says to append `&token=<token>`, and a test drives the whole session that way and asserts a
124
+ supported version (`2025-06-18`) is echoed rather than upgraded.
125
+ - Also confirmed what the page already documents: a client asking for `2024-11-05` is answered with the
126
+ newest legacy revision (`2025-11-25`) because that request names a version this server does not
127
+ support; the version table in `docs/mcp.md` is accurate.
128
+
129
+ Verified: `mcp-http` 13/13, including the new query-token session.
130
+ ## 0.17.52
131
+
132
+ **The resource page described a layout the server did not have.**
133
+
134
+ - `docs/mcp.md` said "the first four rows are always listed" above a table whose first four rows were
135
+ manifest, `parts/{index}`, `reports/audit` and `reports/tree` — two of which are conditional. The
136
+ always-listed set is `manifest`, `contract`, `skill`, `prompt`; the table now leads with those, then
137
+ the part template, then the six reports that appear only when written. The same page counted "the
138
+ three reports" when there are six.
139
+ - `docs/cli.md` still said "resources and two prompts"; the server serves seven.
140
+ - Three statements still described the browser surface as generating "with the default settings"
141
+ after 0.17.45 made it apply the repository's JSON configuration: `docs/serve.md`,
142
+ `docs/security-review.md` and the header comment in `src/web/server.ts`. All three now say the JSON
143
+ config is applied and an executable config is refused.
144
+ - The URI constants are exported from the MCP entry (`STATIC_RESOURCE_URIS`, `REPORT_RESOURCE_URIS`,
145
+ `RESOURCE_TEMPLATE_URIS`) so a test can compare the page with the server: every published URI must
146
+ appear on the page, and the page's prompt count must equal `buildPrompts().length`.
147
+
148
+ Verified: `check-site-links` (66 files, 742 links, 0 problems), `audit-site` clean, and both new docs
149
+ tests pass.
150
+ ## 0.17.51
151
+
152
+ - The goal log records the 0.17.49-0.17.50 round: the README tool list that disagreed with the
153
+ server, the monolith warning about a pack that was never built, and the release gate that read a
154
+ pipe's exit code instead of the test run's.
155
+ ## 0.17.50
156
+
157
+ **A warning about a file the run never tried to build.**
158
+
159
+ - With `--pack json --max-monolith-bytes 100`, the run printed two skip warnings: one for the JSON
160
+ pack (8 174 B, true) and one for the markdown pack reading
161
+ `full-codebase.md skipped: 0 B exceeds maxMonolithBytes 100 B`. Markdown was not requested; no size
162
+ existed; the 0 B was a placeholder compared against the ceiling.
163
+ - A pack that was not built can no longer be reported as too large. The warning is emitted only in
164
+ the branch where the pack exists and its real byte count exceeds the ceiling.
165
+
166
+ Verified: the same command now prints exactly one skip warning, for the JSON pack; a test filters the
167
+ warnings and asserts the markdown one is absent, with no `skipped: 0 B`.
168
+
169
+ `0.17.50` was tagged while a test run reported two failures from a stale `dist` and one from a fixture
170
+ this change forgot to remove. The exit code of that check had been lost in a pipe (`node --test … |
171
+ Select-String`), so the gate passed on a red run. The commit, tag and branch head were corrected
172
+ before the round ended; the fixture now removes itself. A gate reads the exit code of the command, not
173
+ of the filter at the end of its pipe.
174
+
175
+ ## 0.17.49
176
+
177
+ **The README listed the tools in a different order than the server builds them — and was missing five.
178
+ **
179
+
180
+ - The tool-count test guaranteed the number, not the list. The README sentence introduced "26 tools"
181
+ and then named a different set in a different order: `budget` before `health`, `stats` after
182
+ `search`, and `history`, `tests`, `workspace` tacked on at the end.
183
+ - A test now parses the sentence and compares it with `buildTools()` name by name, in order. The
184
+ sentence was rewritten to the server's own order.
185
+
186
+ Also probed this round, and clean: the three `--pack` formats. XML escapes the CDATA terminator by
187
+ splitting it (`]]]]><![CDATA[>`), the JSON pack embeds `manifest` and `files[]`, and the markdown
188
+ pack uses `## File:`. The pack's `includedBytes` differing from the manifest is documented, not a
189
+ bug: it counts the raw content including the trailing newline.
190
+ ## 0.17.48
191
+
192
+ - The goal log records the 0.17.47 round: remote provenance (clean), and the fallback branch that
193
+ every surface presented as fact.
194
+ ## 0.17.47
195
+
196
+ **A directory that is not a repository was described as being on `main`.**
197
+
198
+ - The `branch` setting exists so a tree with no git history still gets deterministic metadata — but
199
+ nothing downstream said the value was a fallback. `README.md`, the audit, `PROMPT.md`, the CLI
200
+ header and `snapshot_status` all printed `Branch: main` (or `Git: main @ unknown`) for a plain
201
+ directory: a claim about a branch that does not exist, indistinguishable from a real one.
202
+ - `GitInfo` now carries `branchFromGit`, the manifest records it (optional, so older manifests still
203
+ read), and every surface that prints the branch says `fallback` when git did not report one.
204
+ Detached HEAD counts as a fallback too, which is what the recorded value always was.
205
+
206
+ Verified: a non-repository fixture prints `Branch: main (fallback)` on the terminal and `fallback;
207
+ git reported no branch here` in README, with `"branchFromGit": false` in the manifest; a repository
208
+ keeps the plain form.
209
+ ## 0.17.46
210
+
211
+ - The goal log records the 0.17.45 round: the browser surface that ignored the repository config,
212
+ and the executable config it silently skipped.
213
+ ## 0.17.45
214
+
215
+ **The web page generated on defaults and silently ignored the repository's config.**
216
+
217
+ - `POST /api/generate` called `generateSnapshot({ cwd })` directly, and the library never loads a
218
+ config file — the CLI and the MCP server do that before calling it. So a project with
219
+ `snapshot.config.json` got one snapshot from the browser and a different one from the terminal.
220
+ - Worse, an **executable** config (`snapshot.config.ts`) was silently ignored: the page generated on
221
+ defaults and said nothing, while the MCP server and the security review both promise this surface
222
+ refuses repository code. It now loads the config with `allowExecutableConfig: false` and answers
223
+ 400 with the same message the server gives (`… is an executable config, and this server does not
224
+ run repository code.`).
225
+
226
+ Verified: a JSON config excluding `src/generated/**` removes the path from the browser snapshot and
227
+ records the skip; a `.ts` config is refused and its side effect never runs.
228
+ ## 0.17.44
229
+
230
+ - The goal log records the 0.17.43 round: the health page covering 14 of 18 checks, and the
231
+ stats field named "sizes" that carried tokens.
232
+ ## 0.17.43
233
+
234
+ **The health page listed 14 of the 18 checks, and its sample output was from an older tool.**
235
+
236
+ - `docs/health.md` had a "What it checks" table with 14 rows and no ids. The audit emits **18** ids
237
+ (16 on a clean snapshot, plus `pipeline.monolith` and `workspace.index` when they apply);
238
+ `bookkeeping`, `pipeline.bodies`, `pipeline.monolith` and `workspace.index` were missing entirely,
239
+ and the table could not be compared with the code.
240
+ - Every row now carries the check id, and a test runs a real audit and fails if any emitted id is not
241
+ documented. The sample output ("13 passed") and the JSON example were updated to what a clean
242
+ snapshot prints today (15 passed, 1 skipped).
243
+ - `snapshot_stats` `partSizes` carried `{ filename, tokens }` under a name that promises bytes; it
244
+ now carries `bytes` and `tokens`, and `heaviest`/`partSizes` appear in the output schema they were
245
+ missing from.
246
+
247
+ Verified: the docs parity test passes; the stats test compares both numbers with the manifest.
248
+ ## 0.17.42
249
+
250
+ - The goal log records the 0.17.40-0.17.41 round: the concurrency probes that held, and the validate
251
+ tool that used to disagree with the snapshot it was validating.
252
+ ## 0.17.41
253
+
254
+ - A test from an earlier release asserted that `snapshot_validate` **without** the generating flags
255
+ reports drift ("the flag has to be doing something"). That was the documented behaviour then; with
256
+ 0.17.40 it is the bug, because a no-flag validate now compares against the manifest's recorded
257
+ settings. The assertion and its comment were updated to the new contract, and `docs/tools.md` says
258
+ it: validate uses the recorded settings, and a changed config file is still drift.
259
+ ## 0.17.40
260
+
261
+ **`snapshot_validate` called a fresh snapshot "out of date".**
262
+
263
+ - The tool resolved a bare config file and compared digests. A snapshot generated with `tokenTree`,
264
+ `includeDiffs`, `removeEmptyLines`, `stripComments`, a pack or `maxParts` therefore reported
265
+ "2 setting(s) changed since the snapshot" immediately after generating — the same defect
266
+ `snapshot_review` had (0.17.17), in the other tool that makes the same claim.
267
+ - Both now share `configAsGenerated`: the artifact selection and flag-only settings come from the
268
+ manifest's own record, while everything the config file sets (budgets, include/exclude, layers,
269
+ kinds, preset) still comes from the current config, so real configuration drift is still reported.
270
+
271
+ Verified: generate with `tokenTree` + `removeEmptyLines` then validate reports "matches the
272
+ repository"; one appended line turns it into "1 file(s) changed on disk".
273
+ ## 0.17.39
274
+
275
+ - The goal log records the 0.17.37-0.17.38 round: docs that pinned an unpublished version, and a
276
+ count test that could not fail catching two wrong counts once it could.
277
+ ## 0.17.38
278
+
279
+ **Two documents described a server that no longer exists, and the test could not notice.**
280
+
281
+ - The hygiene test that compares the documented tool count with the real one matched only the words
282
+ `zero`…`ten`, so with 26 tools it could never fail, and it could not see a count split across a line
283
+ ("serves the repository as 25\ntools"). It now parses digits and hyphenated number words and
284
+ tolerates whitespace, and it immediately found `AGENTS.md` saying **25** and `docs/agent.md` saying
285
+ **eleven**.
286
+ - A twin check for the prompt count found `README.md` and `docs/agent.md` saying **two** prompts where
287
+ the server serves **seven**, and the README's tool list was missing `budget`, `answer`, `history`,
288
+ `tests` and `workspace`. All corrected.
289
+
290
+ Verified: both counts come from `buildTools().length` and `buildPrompts().length`, so the documents
291
+ cannot drift from the server without failing.
292
+ ## 0.17.37
293
+
294
+ **The docs told readers to install a version that does not exist.**
295
+
296
+ - `sync-docs` rewrote every `npx -y codebase-snapshot@x.y.z` example to the **current** package
297
+ version. Under the publish-at-`x.y.0` policy that is an unpublished patch, so the install commands
298
+ in `README.md`, `docs/mcp.md` and `docs/deploy.md` named a version the registry does not carry and
299
+ a reader who copied one got a 404.
300
+ - A `PUBLISHED` file now records the last milestone on npm (`0.17.0`), `sync-docs` pins the examples
301
+ to it, and a test fails when any doc pin disagrees or names a non-milestone. The devDependency
302
+ sample stays on the current version, because that is what `init` prints.
303
+ - `AGENTS.md` says when to update `PUBLISHED` (in the same commit as the milestone publish).
304
+
305
+ Verified: all five pins in the docs read `codebase-snapshot@0.17.0`, which is on the registry; the
306
+ pin test passes and would fail on an unpublished patch.
307
+ ## 0.17.36
308
+
309
+ - The goal log records the 0.17.35 round: the history tool that repeated an edited report, and the
310
+ clean probes of stats, explain and tests.
311
+ ## 0.17.35
312
+
313
+ **`snapshot_history` repeated an edited report as fact.**
314
+
315
+ - The tool read `reports/log.md` and printed its commits. It never compared the file with the digest
316
+ the manifest records for it, so appending `- fake commit` to the report changed the history an agent
317
+ received, with no signal; `validate` and `health` would have caught the edit, the tool that serves
318
+ the history did not.
319
+ - It now hashes the file and refuses a report whose digest no longer matches the manifest, naming the
320
+ reason and telling the caller to regenerate. A snapshot without the recorded artifact (older
321
+ manifests) is read as before.
322
+
323
+ Verified: a git fixture lists its commits; after one line is appended the tool is an error; the
324
+ snapshot without a recorded digest (pre-0.12 log) still reads.
325
+ ## 0.17.34
326
+
327
+ - The goal log records the 0.17.33 round: the search summary that conflated searched with matched,
328
+ and the 3.5 MB harness artefact that had been tracked since 0.14.2.
329
+ ## 0.17.33
330
+
331
+ **A 3.5 MB benchmark artefact was hiding in the repository.**
332
+
333
+ - `snapshot_search` said `3 match(es) in 4 file(s)`, which reads as three matches spread over four
334
+ files; the four was the size of the snapshot, not the number of files with a hit. It now says
335
+ `3 match(es) in 2 file(s) of 4 searched.` and `No match in N file(s).` when there are none.
336
+ - `repomix-output.xml` — 3.5 MB of this repository in repomix's format, written by the comparison
337
+ harness into the working directory — was **tracked in git** since 0.14.2, swept in by `git add -A`.
338
+ It is removed from the index and the working tree, and `.gitignore` now names it beside the probe
339
+ patterns. A hygiene test asserts that this and the `full-codebase.*` monoliths are never tracked.
340
+
341
+ Verified: the search wording test covers both the match and no-match forms; the hygiene test fails
342
+ if a generated monolith or the harness output is committed again.
343
+ ## 0.17.32
344
+
345
+ - The goal log records the 0.17.30-0.17.31 round: routes that lost their paths, and the tests that
346
+ had pinned the loss.
347
+ ## 0.17.31
348
+
349
+ - Two tests written before this round asserted the **method-only** route shape, so `verify` failed
350
+ after 0.17.30 fixed the extractor. They had pinned the defect as the contract; both now assert
351
+ `METHOD /path`, and their names say so.
352
+ ## 0.17.30
353
+
354
+ **`snapshot_routes` printed a method and no route.**
355
+
356
+ - Probed the graph tools on a fixture with an import cycle and two Express routes. The cycle, the
357
+ entry points and the neighbors were right. The routes read:
358
+
359
+ ```text
360
+ GET (src/index.ts, part-001.md)
361
+ POST (src/index.ts, part-001.md)
362
+ ```
363
+
364
+ - The extractor pushed only the verb (`callee.name.text.toUpperCase()`) and **discarded the path
365
+ argument**. Every Express/Hono/Koa/Fastify route in every snapshot was recorded without its path,
366
+ and `/health` was indistinguishable from `/users/:id`.
367
+ - The handler now records `METHOD /path`; method-only handlers (Next.js route exports, decorators)
368
+ stay method-only because there is no literal to record, and the renderer trims so they do not print
369
+ a dangling double space.
370
+
371
+ Verified: the fixture reports `GET /health` and `POST /users/:id`, in text and in the structured
372
+ reply; the cycle/entrypoints/neighbors outputs are unchanged.
373
+
374
+ Two older tests asserted the method-only shape (`["DELETE", "GET", "POST"]`) — they had pinned the
375
+ defect as the contract. Both now assert `METHOD /path`, which is what the snapshot actually knows.
376
+ ## 0.17.29
377
+
378
+ - The goal log records the 0.17.27-0.17.28 round: the response cap missing in half the tools, and the
379
+ audit that failed its own signature about one run in forty.
380
+ ## 0.17.28
381
+
382
+ **`--sign` failed its own health check, about one run in forty.**
383
+
384
+ - Reproduced a full-`verify` failure: `health` reported `signature.json` as containing a
385
+ secret-shaped value, for a snapshot the tool had just signed with a fresh key. The rule was
386
+ `known-vendor-token-prefix`, whose Azure DevOps shape is **52 mixed-case alphanumerics** — a random
387
+ ed25519 public key or signature contains such a run often enough to match. A brute-force scan of
388
+ 5,000 generated records put the false-positive rate at 2.6%.
389
+ - The audit now exempts the record's **key material** (`publicKey`, `signature`, `manifestSha256`,
390
+ `fingerprint`) from the artifact scan and scans every other field of the record, so a token
391
+ smuggled into `keyOrigin` or `signedAt` is still a critical failure. The exempt bytes are random
392
+ by construction and are verified against the manifest by the signature check.
393
+ - The first test I wrote for this replaced the public key with a fake one and expected health to
394
+ pass; it failed for the right reason (the signature no longer verified). The test now finds a real
395
+ ed25519 key whose base64 contains the token shape and signs the manifest with it, so it exercises
396
+ the false positive without lying about validity.
397
+
398
+ Verified: 12 consecutive signed snapshots pass health; the crafted token-shaped-but-valid signature
399
+ passes; the same record with a vendor token in `keyOrigin` fails.
400
+ ## 0.17.27
401
+
402
+ **One limit, four tools, three of them ignoring it.**
403
+
404
+ - The 64 KiB per-response cap was applied in `snapshot_read` and, after 0.17.9, in `snapshot_answer`.
405
+ `snapshot_context`, `snapshot_diff_context` and `snapshot_symbol` rendered file bodies without it:
406
+ a 200 KB single-line file came back whole from `snapshot_context` — a 200 KB response measured and
407
+ unlabelled, while its siblings would have refused.
408
+ - One helper (`capResultText`) now applies the same limit and the same code-point-safe truncation in
409
+ all four places, and a clipped block says `first 64 KiB` in its heading.
410
+
411
+ Verified: the same 200 KB fixture returns under 80 KiB from all three formerly unbounded tools;
412
+ `snapshot_read` and `snapshot_answer` are unchanged.
413
+ ## 0.17.26
414
+
415
+ - The goal log records the 0.17.25 round: the two resolvers that disagreed about the same import
416
+ graph, and the alias dependents that vanished without a word.
417
+ ## 0.17.25
418
+
419
+ **`snapshot_diff_context` silently missed every alias import.**
420
+
421
+ - Probed a repository whose `src/app.ts` imports `@/user` through tsconfig `paths`. Asking
422
+ `snapshot_diff_context` for `src/user.ts` returned **no dependents**; `generate --delta` on the same
423
+ tree included `src/app.ts`, because the generator uses the real resolver. The tool had its own
424
+ hand-rolled loop that skipped any specifier not starting with `.` and tried a fixed extension list.
425
+ - The tool now builds the same `ImportResolver` the generator uses (`buildImportResolver` with
426
+ `tsconfigPathsFor`), so aliases, index files, `js`→`ts` mapping and non-JS languages resolve the
427
+ same way in the client and the CLI. The probe now reports `["src/app.ts"]`.
428
+
429
+ Verified: an alias-only fixture returns the dependent; the delta suite and the tool suite pass.
430
+ ## 0.17.24
431
+
432
+ - The goal log records the 0.17.23 round: the delta flow reproduced clean, and the signed manifest
433
+ that `validate` called valid after it had been edited.
434
+ ## 0.17.23
435
+
436
+ **`validate` did not verify signatures, and the docs implied it did.**
437
+
438
+ - Reproducing the signing flow end to end: `--sign` with `SNAPSHOT_SIGNING_KEY` writes a `configured`
439
+ record, `health` verifies it, and `validate` passed a manifest edited **after** signing — it never
440
+ looked at `signature.json`. A signature only matters if the tool that says "is this snapshot what
441
+ it claims" checks it.
442
+ - `validate` now verifies the record whenever it exists and fails with the reason:
443
+ `signature: manifest.json changed after it was signed.` (exit 1).
444
+ - `docs/signing.md` said health verifies; it now says validate does too, and shows the message.
445
+
446
+ Verified: a signed snapshot validates clean; editing one field of the manifest afterwards makes
447
+ `validate` exit 1 with the signature reason; `health` agrees.
448
+ ## 0.17.22
449
+
450
+ - The goal log records the 0.17.19-0.17.21 round: the silent non-git report flags, the warning that
451
+ leaked the host path the audit then caught, and the docs row that claimed agreement it did not have.
452
+ ## 0.17.21
453
+
454
+ - **The warning leaked the host path it was warning about.** 0.17.19 wrote "…was requested, but
455
+ C:\Users\… is not a git repository" into `manifest.warnings`; the health audit scans every written
456
+ artifact for host paths and failed the snapshot the run had just produced. That is the audit doing
457
+ its job.
458
+ - The message now says "the generated directory is not a git repository" and names no path. The
459
+ report test additionally asserts that a warning contains no drive-letter path.
460
+
461
+ Verified: the full health suite passes (15 tests), including the host-path check that caught this;
462
+ the non-git fixture still gets both warnings.
463
+ ## 0.17.20
464
+
465
+ - `docs/cli.md` still described `--include-logs` as if it always wrote its report, and the 0.17.19
466
+ changelog said the contract and the page agreed. They did not: the row now carries the same
467
+ warning as the contract. The docs row is hand-written, which is why the flag test (names only)
468
+ did not catch it.
469
+ ## 0.17.19
470
+
471
+ **A requested report that could not be written now says so.**
472
+
473
+ - `generate --include-diffs` outside a git repository accepted the flag, wrote no `reports/diff.md`,
474
+ recorded no artifact, printed no warning and exited 0. `--include-logs` did the same. The one
475
+ silent fallback this project forbids was in a documented feature.
476
+ - Both now warn with the reason and the path: "…was requested, but <cwd> is not a git repository;
477
+ reports/diff.md was not written." A clean tree in a real repository is a different fact — there is
478
+ nothing to show — and stays silent.
479
+ - The contract and `docs/cli.md` say the same thing, so the flag is not advertised as unconditional.
480
+
481
+ Verified: a non-git fixture generates with both flags, exit 0, neither artifact recorded, and both
482
+ warnings in `manifest.warnings`; the git tests still see their reports on a real repository.
483
+ ## 0.17.18
484
+
485
+ - The goal log records the 0.17.17 round: the review that called a freshly generated snapshot stale,
486
+ the manifest fields added so it cannot happen again, and the two-sided fix.
487
+ ## 0.17.17
488
+
489
+ **`snapshot_review` said "stale" about a snapshot it had just generated.**
490
+
491
+ - A review of a snapshot generated with `includeDiffs` (or `tokenTree`, `removeEmptyLines`, a pack,
492
+ `stripComments`, `sarif`) reported **"Snapshot: stale; run snapshot_generate before trusting it"**
493
+ immediately after the generate. The cause was honest and narrow: `validate` compares the config
494
+ digest, the digest covers the artifact selection and the run flags, and `snapshot_review` has no
495
+ flags — so it validated with a bare config file and blamed the user for a difference the review
496
+ tool itself could not see.
497
+ - The review now validates **as the snapshot was generated**: it takes the artifact selection and the
498
+ flag-only settings from `manifest.config`, where the run recorded them. Configuration drift the
499
+ config file still shows (budgets, include/exclude, layers, kinds, preset) is still reported.
500
+ - The manifest now records `removeEmptyLines`, `pack` and `logCount`, the three digest inputs it did
501
+ not carry, so a no-flag validator can reconstruct the run. The fields are optional; older
502
+ manifests are unaffected, and the digest does not change.
503
+
504
+ Verified: a review immediately after `snapshot_generate { tokenTree: true, removeEmptyLines: true }`
505
+ reports current; after appending one line to a file it reports stale. Same probe with a real git
506
+ diff and `includeDiffs`.
507
+ ## 0.17.16
508
+
509
+ - The goal log records the 0.17.15 round: the HTTP probe that found the refusal counter counting
510
+ only CORS refusals while 401/405/413/404 passed uncounted.
511
+ ## 0.17.15
512
+
513
+ **The refusal counter counted almost no refusals.**
514
+
515
+ - `GET /metrics` published `snapshot_requests_refused_total` with the help text "Requests refused
516
+ before dispatch", and only one path incremented it: a rejected CORS origin. A missing token (401),
517
+ a wrong method (405), an oversize body (413) and an unknown SSE session (404) were all served and
518
+ counted as nothing, so a server being probed with bad credentials reported **zero refusals**.
519
+ - Counting now happens in `send()` for every 4xx except 429, which keeps its own counter. The probe
520
+ that found it (401 + 403 + 405, then 90 requests into a 60-per-10s limit) now reads exactly 3
521
+ refusals and 30 rate-limited responses, and the test asserts both the totals and the 429 count.
522
+
523
+ Verified: `/metrics` after a 401, a cross-origin 403 and a 405 reports `refused 3`; the rate limit
524
+ fires at the documented threshold and `snapshot_requests_rate_limited_total` equals the number of
525
+ 429 responses the client saw.
526
+ ## 0.17.14
527
+
528
+ - The goal log records the 0.17.13 round: the prompts and resources probe, and the required argument
529
+ that `prompts/get` was not enforcing.
530
+ ## 0.17.13
531
+
532
+ **A prompt cannot be requested without its subject.**
533
+
534
+ - `prompts/list` marks `review`'s `change` and `explain`'s `path` as required, and `prompts/get` did
535
+ not check: a client that omitted one received "Review a change" with no change named, and the
536
+ model had nothing to review. The request is now refused with `-32602`, the argument names and the
537
+ descriptions, in the same place the other argument checks live.
538
+ - Optional arguments stay optional: `orient` without `focus` still works.
539
+
540
+ Verified: `review` without `change` is refused and names the argument; with it, the text carries the
541
+ change; `orient` without `focus` is accepted.
542
+ ## 0.17.12
543
+
544
+ - The goal log records the 0.17.11 round: accessible names and a live status on the serve page, and
545
+ command/docs parity now pinned by a test.
546
+ ## 0.17.11
547
+
548
+ **The page works without a mouse, and the docs page is pinned.**
549
+
550
+ - The web form had four controls with no accessible names — only placeholders and `title` — and a
551
+ status line that screen readers never announced. Each control now carries an `aria-label`, and
552
+ `#status` is a `role="status" aria-live="polite"` region. A test fails if a future control arrives
553
+ without a name.
554
+ - `docs/cli.md` claims to document every command; nothing compared that list with the contract. A
555
+ new test compares `describe --format json` commands with the page's `### `command`` sections in
556
+ both directions, the way the options tests already did.
557
+
558
+ Verified: the page test asserts `lang`, the live region and a name on every control; the command
559
+ test fails on either an undocumented command or a section for a command that does not exist.
560
+ ## 0.17.10
561
+
562
+ - The goal log records the 0.17.9 round: the adversarial-content pass (parser sound) and the 200 KB
563
+ block it found leaving through `snapshot_answer`.
564
+ ## 0.17.9
565
+
566
+ **A block cannot flood the transport.**
567
+
568
+ - Probing adversarial content found the circular risk that survived the earlier checks: a file whose
569
+ body is one 200 KB line. The planner accepted it under a 60k budget, and `snapshot_answer`
570
+ returned the whole line — a 200 KB response, no note, while `snapshot_read` caps one response at
571
+ 64 KiB.
572
+ - Each block is now capped at `MAX_RESULT_BYTES` (64 KiB) with the same code-point-safe truncation;
573
+ the header says `first 64 KiB of the window` and the structured entry carries `clippedAtBytes`.
574
+ - `usedTokens` is measured on **what is returned** rather than on the window before clipping: it used
575
+ to describe 200 KB while 64 KB was sent, which is the contract lying about its own size.
576
+
577
+ Verified: a 200 KB single-line file under a 60k budget returns under 80 KiB, labels the cap, and
578
+ keeps `usedTokens` consistent with the text; the other adversarial cases (fake `### FILE:` headings,
579
+ embedded fences, anchors, CRLF, EOF fence) all round-trip and pass the audit's body accounting.
580
+ ## 0.17.8
581
+
582
+ - The goal log records the 0.17.7 round: the silent empty slice, the 100/100 member whose source was
583
+ gone, and the web page probe that found the first one.
584
+ ## 0.17.7
585
+
586
+ **A slice that selected nothing, and a member whose source is gone.**
587
+
588
+ - `--slice "question"` that matched no file wrote an empty snapshot with no warning (`web` reported
589
+ `files: 0, dropped: 2, warning: null`). It now carries a warning with the planner's own reason,
590
+ the same way `--budget-tokens` already did.
591
+ - `health --all-members` reported **100/100** for a member whose source directory had been deleted:
592
+ the written snapshot is intact, so every hash passed, but the workspace index still names a path
593
+ that no longer exists. The audit now warns with the path and "regenerate the workspace"; the
594
+ combined score drops to the weakest member (95/100 in the probe).
595
+
596
+ Verified: an empty slice has exactly one warning naming the reason; a matching slice has none; a
597
+ deleted member loses five points, names the path, and keeps exit 0 (a warning, not a failure).
598
+ ## 0.17.6
599
+
600
+ - The goal log records the 0.17.1-0.17.5 hardening round: the empty snapshot that warned nowhere, the
601
+ planner notes that blamed the wrong thing, the impossible line windows that were clamped, and the
602
+ docs slip the schema test caught.
603
+ ## 0.17.5
604
+
605
+ - **`snapshot_read` refused nothing it could not do.** `lines: 0`, `lines: -3`, `fromLine: -5` and
606
+ `fromLine: 2.7` all returned a one-line window and said nothing: the schema declared a minimum, the
607
+ handler clamped. A request that cannot be honoured is now an error naming the argument and the
608
+ value.
609
+
610
+ Verified: the four impossible requests are refused with an explanatory message; a valid window is
611
+ unchanged.
612
+ ## 0.17.4
613
+
614
+ **When the answer is empty, say why.**
615
+
616
+ - `snapshot_answer` dropped the planner's notes entirely, so a zero-file answer was a header and
617
+ nothing else. The notes now close the block under `Notes:`.
618
+ - The planner had one budget sentence for two different failures: "Nothing fit the budget" was
619
+ printed even when no file matched at all, sending the reader to the wrong number. It now says
620
+ "No candidate file matched the question…" when there were no candidates, and only blames the
621
+ budget when candidates existed and the cheapest one did not fit — with its cost named.
622
+ - The fallback sentence is emitted only when the centrality fallback produced files; saying "the
623
+ plan falls back to the most-imported files" and then "<no files> and no fallback to offer" said it
624
+ twice and contradicted itself.
625
+
626
+ Verified: an unmatched question on a repository without imports reports "no centrality data"; one
627
+ with imports lists its centrality reasons; neither claims the budget was the problem.
628
+ ## 0.17.3
629
+
630
+ - The 0.17.2 docs change put the `snapshot_generate` note in the reading list as its own bullet,
631
+ which left the real entry without its example call; the docs/schema test caught it after the
632
+ commit. The note now sits inside the generate entry, where it belongs.
633
+ ## 0.17.2
634
+
635
+ **An empty snapshot says it is empty.**
636
+
637
+ - `--only "nomatch/**"` produced a legitimate-looking empty snapshot: exit 0, no parts, "Integrity:
638
+ passed", no warning. The manifest now carries one: "No file matched the include allow-list (N
639
+ pattern(s): …), so the snapshot is empty."
640
+ - The planner said two false things about an empty snapshot at once ("no file matched … the plan
641
+ falls back" and "the budget is too small for any file"). It now says the one true thing and stops:
642
+ the snapshot holds no files, and `manifest.skipped` explains why.
643
+ - `snapshot_answer` and `snapshot_budget` repeat that sentence instead of returning zeros with no
644
+ explanation.
645
+ - **`snapshot_generate` takes `only` and `ignore`**, the last CLI narrowing flags without an MCP
646
+ equivalent; the tool description and `docs/tools.md` say so.
647
+
648
+ Verified: an allow-list matching nothing warns in stderr and in `manifest.warnings`; a matching one
649
+ does not; the empty-snapshot messages are pinned by a test that generates a real empty snapshot.
650
+ ## 0.17.1
651
+
652
+ - The goal log records the final milestone: 0.17.0 published, and the registry carrying exactly the
653
+ five `x.y.0` versions with `latest = 0.17.0`. `ROADMAP.md` marks it published.
654
+ - What follows is 0.17.x: hardening and coverage until the deadline, with no new milestone promised.
655
+ ## 0.17.0
656
+
657
+ **The endgame: what this is, and how it is proven.**
658
+
659
+ `codebase-snapshot` reads a repository and writes a text representation of it that an AI reader can
660
+ use: budgeted parts, a manifest that accounts for every path, and — since 0.12.15 — a server that
661
+ answers questions about the repository instead of making the reader open all of it.
662
+
663
+ ### What a reader gets
664
+
665
+ - **A dump that fits.** Byte-budgeted parts, a per-file accounting of what was written, previewed,
666
+ stripped or skipped, and an audit that recomputes those claims from the parts.
667
+ - **A selection, when the question is narrower than the repository**: `--slice` for a question,
668
+ `--budget-tokens` for a ceiling, `--delta` for a change set. Each explains itself in
669
+ `reports/selection.md`, and each records what it left out.
670
+ - **A server that answers questions.** 26 MCP tools over stdio or Streamable HTTP with bearer tokens,
671
+ from `snapshot_answer` (question to cited windows) to `snapshot_health` (an audit of the snapshot
672
+ itself), plus prompts and resources. Reads come from the snapshot, so redaction and exclusions
673
+ still apply.
674
+ - **Proof of its own output.** Ed25519 signatures, artifact digests, a workspace index that must
675
+ agree with its members, and `snapshot health` with a score and a strict exit code.
676
+
677
+ ### The program, by milestone
678
+
679
+ | Version | Theme | Published |
680
+ | :--- | :--- | :--- |
681
+ | 0.13.0 | The MCP server, remote ingestion, signing, slicing, delta packs, multi-repo | 2026-11-18 |
682
+ | 0.14.0 | The audit proves the manifest: bodies, counts, packs, workspace index, metrics | 2026-11-18 |
683
+ | 0.15.0 | Parity measured on ten public repositories; per-run `--only`/`--ignore` | 2026-11-18 |
684
+ | 0.16.0 | Beyond parity: self-explaining selections, what-if budgets, `snapshot_answer` | 2026-11-18 |
685
+ | 0.17.0 | This milestone: the site, the security review, the migration guide, the final number | 2026-11-18 |
686
+
687
+ Every version in between was committed, tagged and pushed; `x.y.0` is what the registry carries, and
688
+ `latest` never points at a patch. The number is not the promise — the changelog entry is.
689
+
690
+ ### How it is proven
691
+
692
+ - **Tests**: 1333 in the suite, 1325 passing, 0 failing, 8 skipped because they need a host this
693
+ runner is not. The suite treats the tool as a black box where it can: generate, validate, serve,
694
+ ask, and check the answer.
695
+ - **The audit**: every generated snapshot in the suite is audited, and the audit is itself probed by
696
+ breaking what it claims to check — a truncated part, an edited count, a pack minus one entry, an
697
+ index with a wrong fingerprint, an edited selection report.
698
+ - **Measurement**: ten public repositories through this tool, repomix and gitingest in one command
699
+ (`scripts/benchmark-suite.mjs`), with the page saying where the numbers are comparable and where
700
+ they are a policy difference.
701
+ - **The artifact**: a 53-file tarball whose lockfile agrees with `package.json`, checked before every
702
+ publish by the same `verify` a reader can run.
703
+ - **The site**: 30 pages, every one with a description, a canonical URL and no broken link
704
+ (`audit-site`), generated from the same documents the repository ships.
705
+
706
+ ### What is deliberately not here
707
+
708
+ - **No 1.0.0.** The line ends at 0.17.0 because a version number is a promise about stability, and
709
+ this project would rather make the next promise in a changelog than in a semver jump.
710
+ - **No runtime dependencies.** Node built-ins and the TypeScript compiler (a dev dependency) only.
711
+ - **No silent fallback.** An unknown flag, preset, budget or config key is an error, and a path that
712
+ leaves the snapshot is recorded with the reason it left.
713
+ ## 0.16.2
714
+
715
+ **The endgame pages.**
716
+
717
+ - `docs/answer.md` is a site page of its own: one call from question to cited, line-numbered
718
+ context, the four-way comparison with `plan_for`/`read`/`budget`, and what the tool deliberately
719
+ will not do (invent a path, truncate silently, read the working tree, exceed the budget without
720
+ saying so). 30 pages, audit-site clean.
721
+ - The site builder still described the tool reference as "All 22 MCP tools"; it is 26, and the
722
+ number now matches `tools/list`.
723
+ - `docs/security-review.md` gains "What changed since this review was written": metrics labels, the
724
+ web server's allowed roots, the audit that stopped trusting the manifest, `snapshot_answer`, and
725
+ `--only`/`--ignore` — each reviewed for what new input arrives and what it can reach.
726
+ - `docs/migration.md` gains the 0.13.0-0.17.0 table: what a reader upgrading across those milestones
727
+ will notice, and why nothing was removed.
728
+ ## 0.16.1
729
+
730
+ - The goal log records the fourth published milestone: 0.16.0 tagged, released on GitHub and
731
+ published to npm (`latest` at 01:52Z). `ROADMAP.md` marks it published.
33
732
  ## 0.16.0
34
733
 
35
734
  **Things neither competitor has.**