codebase-snapshot 0.10.1 → 0.10.2

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
@@ -23,6 +23,76 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
23
23
 
24
24
  ---
25
25
 
26
+ ## 0.10.2
27
+
28
+ Every finding from the 0.10.1 deep analysis, fixed and verified. The report that produced the list
29
+ is `audit/reports/0.10.1-code-analysis.md`; the finding-to-fix mapping is `audit/work/fix-log.md`.
30
+
31
+ This is a patch release, but three of the fixes change something a script can observe. They are
32
+ listed first rather than buried, because each is the point of its fix.
33
+
34
+ **Upgrading.** `validate` now fails a manifest whose `incomplete[]` and `files[]` disagree — a
35
+ hand-edited or foreign `manifest.json` that used to report "valid and up to date" is refused, which
36
+ is the point. `partitionFiles` (a library export) now throws for a byte budget below the 2 610 B a
37
+ part header needs, instead of silently clamping it to that size. A new built-in secret rule, the
38
+ 32nd, masks a quoted value whose closing quote is missing, so a snapshot that used to emit such a
39
+ line now carries the marker — and one more line in `totals.redactedLines`. No option was added or
40
+ removed, and no existing manifest field changed meaning.
41
+
42
+ **Security**
43
+
44
+ - A quoted assignment whose closing quote is not on the line (`API_KEY="value` in a truncated file,
45
+ a hand-edited `.env`, or a string that continues on the next line) matched no rule at all: it was
46
+ emitted in clear and the run reported zero redactions. `credential-assignment-unterminated` now
47
+ masks it and records a finding. When a mask would unbalance an otherwise balanced line, the value
48
+ is now masked around its quotes instead of being left untouched with no finding at all.
49
+ - `diff` applies the caller's `secretRules`. `compareManifests` gained the parameter, every masking
50
+ call in `diff.ts` passes it through, and the payload block's `layers` maps are masked too — they
51
+ were printed verbatim while every line of prose beside them was masked.
52
+ - `validate` verifies the completeness contract. `incomplete[]`, `counts.incompleteCount`,
53
+ `omittedRanges`, `omittedLines`, `includedLines` and `incomplete[].relativePath` are checked against
54
+ each other and against `files[]`; `relativePath` was the only unconfined member of the three
55
+ path-bearing arrays. Ten tampered variants of a real record used to report "valid and up to date".
56
+
57
+ **Correctness**
58
+
59
+ - The monolith entries no longer carry a `truncationReason` or `omittedRanges` beside
60
+ `inclusionMode: "full"` — one object said "complete file" and "large-file-budget" at once.
61
+ - A previewed or oversized importer is in `indexes.imports.byFile`, so `snapshot_dependents` no
62
+ longer answers "0 importer(s)" for a file that has one. Its `exports` list says `exportsOmitted`.
63
+ - `snapshot_plan` runs on the worker thread, like `snapshot_generate`: a dry run parses the whole
64
+ repository and blocked the JSON-RPC loop for as long as a generate did.
65
+ - `discovery` is a member of `SnapshotConfig`, so a TypeScript config containing it compiles; a
66
+ compile-time proof on `CONFIG_KEY_NAMES` keeps the parsed key list from drifting from the
67
+ interface again — `CONFIG_KEYS` is built from that tuple, so both follow it.
68
+ - SARIF results are ordered by code unit, not `localeCompare`: the same commit produced different
69
+ bytes under different host locales.
70
+ - `generatorOrigin` reads a `package.json` behind a byte-order mark, so a pinned project is no
71
+ longer told it has a "global or direct install".
72
+ - A nested `.DS_Store` is Finder noise in the ownership check, compared by basename like the other
73
+ four sites; `reports/.DS_Store` used to make the tool refuse a directory it had just written.
74
+ - `init --out-dir .context` ignores `/.context/` rather than `/snapshot/`, so the snapshot it
75
+ generates is actually untracked; a nested or out-of-tree outDir is handled.
76
+ - `exportsKind: "esm"` is produced for a file whose exports are all ES exports, so absence means
77
+ "no exports" again.
78
+ - Both project-tree caps (lines and depth) are recorded as manifest warnings; only the depth cap was.
79
+ - `diff --format json` carries a stable `payload.codes` array — one code per prose reason.
80
+
81
+ **Documentation**
82
+
83
+ - The published site no longer requests two 404s: `docs/assets/*` is rewritten to the `assets/`
84
+ copy the build writes, and the link gate now checks `src` as well as `href`.
85
+ - `docs/configuration.md` lists the placeholder shapes that survive redaction, exhaustively, with a
86
+ test that pins the list to `PLACEHOLDER_PATTERNS`; the "a placeholder is indistinguishable from a
87
+ secret" claim it contradicted is gone.
88
+ - Three surfaces that disagreed with the binary are corrected: the `.gitignore` entries in
89
+ `docs/cli.md` (they are anchored), `validate`'s actual output in
90
+ `docs/stale-context-is-your-bug.md`, and `explain`'s `{ rules, line }` shape.
91
+ - `codebase-token-budget.md`'s measured example is re-measured; `how-to-context-budget.md` no
92
+ longer cites a `manifest.totals.events` field that does not exist.
93
+ - Eight test failure messages interpolate their variables; on a security failure they printed the
94
+ literal `${…}`.
95
+
26
96
  ## 0.10.1
27
97
 
28
98
  Documentation only. The build is 0.10.0 with the documentation that describes it — no behaviour,
package/README.md CHANGED
@@ -201,7 +201,7 @@ Everything an agent needs is available as data, and the tool can install its own
201
201
  ```bash
202
202
  npx codebase-snapshot describe --format json # contract: workflow, options, exit codes
203
203
  npx codebase-snapshot skill --install # into .claude/skills + .cursor/rules
204
- npx -y codebase-snapshot@0.10.1 mcp # or serve it over MCP
204
+ npx -y codebase-snapshot@0.10.2 mcp # or serve it over MCP
205
205
  ```
206
206
 
207
207
  An agent told only "use `npx codebase-snapshot`" can read the contract, follow its ordered