codebase-snapshot 0.20.4 → 0.20.6

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,102 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
30
30
 
31
31
  ---
32
32
 
33
+ ## 0.20.6
34
+
35
+ **The third 0.20 audit verified forty reported defects and fixed every one that reproduced, with a
36
+ regression for each security boundary.**
37
+
38
+ Ownership and confinement:
39
+
40
+ - A marker is evidence only when it describes the bytes on disk: the recorded manifest digest and
41
+ every recorded file digest are checked, and every file at every depth must be in the inventory.
42
+ A marker that names a directory but omits a file inside it no longer hides that file.
43
+ - `explain` no longer uses `existsSync` as a symlink oracle, reads staged bytes for `--staged`,
44
+ and drops included-only fields from a skipped answer.
45
+ - Overview, health, validator, workspace-index, hook, gitignore and delta reads all use canonical
46
+ containment; `.gitignore` is replaced atomically and refuses links; `.git` file fallbacks are
47
+ canonicalised; `WORKSPACE.json` stores relative member paths and refuses duplicate basenames.
48
+ - `serve` checks allowed roots before existence probes, generates in a worker, runs on a rate
49
+ limit, caps zip output, and refuses a remote checkout's config instead of executing its rules.
50
+ `health --all-members` confines the paths it reads from the index.
51
+
52
+ Secrets and parsing:
53
+
54
+ - Dockerfile `ENV` and `ARG` assignments are case-insensitive and keep values containing `|` or
55
+ `<`; an ellipsis no longer exempts any value that merely contains `...`.
56
+ - `id_rsa.example.pem` and `.env.example.local` stay sensitive; only a known data extension may
57
+ follow a template marker.
58
+ - SARIF paths are masked by the path rules and URI-encoded.
59
+ - A regex with a bounded or optional inner quantifier, or with flags inherited from a nested
60
+ group, is refused instead of being allowed to backtrack catastrophically.
61
+ - Signature records must name the fingerprint inside the manifest they verify.
62
+
63
+ Protocol and correctness:
64
+
65
+ - `SNAPSHOT_TOKEN` is read from the environment, so the Docker entrypoint no longer puts it in
66
+ argv; network-bind metrics require the bearer token; SSE sessions and session ids are bounded;
67
+ async request handlers have rejection handlers; cancellations are delivered at capacity.
68
+ - The MCP worker refuses executable configs and accepts a config already loaded on the parent
69
+ thread; `snapshot_plan` is cancellable and `snapshot_search` enforces a cumulative byte budget.
70
+ - `serve` and `mcp` report the real tool count; `update` is in the command order; `describe` and
71
+ `skill` accept `--no-update-check`; the hook validates the outDir it recorded.
72
+ - Hard-clipped parts fail generation instead of shipping a manifest that cannot describe them;
73
+ section-truncation notices are no longer counted as content; the monolith labels bodies `full`
74
+ and does not copy `emptyLinesRemoved`; XML replaces XML 1.0-illegal controls; control-byte
75
+ blobs are binary even when one byte is invalid UTF-8; CR-only files and BOM package.json files
76
+ parse; cache keys include the repository-relative path; the ownership ledger records the same
77
+ path the marker looks up.
78
+ - Token and selection tables are one line per row, sorted by code unit, and the token total no
79
+ longer claims to equal the manifest total. Zip timestamps are UTC.
80
+
81
+ Verified with `npm run verify` (1,433 tests, 1,421 passed, 0 failed, 12 skipped) and
82
+ `npm run verify:deep` (health 95/100; the one warning is the known documentation-path example).
83
+
84
+ ## 0.20.5
85
+
86
+ **The second 0.20 audit found twelve regressions and bypasses left by the first hardening pass.
87
+ This release closes all of them and records the regression that pins each route.**
88
+
89
+ Security and confinement:
90
+
91
+ - A tracked symlink is now emitted only when its target survived the snapshot's own filters. The
92
+ previous check compared the target to the sensitive-file list but not to include, exclude, the
93
+ built-in deny-list or .gitignore, so notes.txt -> .git/config shipped the CI token in the
94
+ repository config. The authorization-header rule is case-insensitive again without making its
95
+ mixed-case credential tests case-insensitive.
96
+ - snapshot://prompt, snapshot://reports/*, snapshot://manifest, snapshot_history,
97
+ snapshot_workspace, GET /api/snapshot and the web manifest read now go through one confined
98
+ reader that refuses a symlink and requires the canonical target inside the snapshot directory.
99
+ - reports/diff.md now runs git with core.quotepath=false and diff.noprefix=false, fails closed when
100
+ a section header cannot be attributed to a path, redacts before truncation using the diffed
101
+ file's own extension, and honours --only and the built-in ignore list.
102
+ - Owner-brief headings, project-overview prose and commit subjects/bodies use the full content
103
+ scanner, not the path-only rule set. A PEM body or a token in "## Incident ghp_..." no longer
104
+ reaches PROMPT.md.
105
+ - MCP regex tools refuse nested quantifiers and multiple unbounded repetitions instead of running a
106
+ main-thread ReDoS; HTTP MCP caps in-flight tool calls at four, evicts the oldest session at 64,
107
+ and prunes rate windows.
108
+ - serve confines a local config's tmpDir as well as its outDir; a failed or oversized remote clone
109
+ removes its temporary directory.
110
+ - init --install-hook refuses a symlinked hooks directory or hook file, and a hard-linked hook.
111
+
112
+ State and contract:
113
+
114
+ - If the Windows/OneDrive in-place swap removes the old snapshot and then cannot move the new one
115
+ in, staging is left on disk and named, instead of being deleted by the failure handler.
116
+ - generate --workspace --dry-run writes nothing, and a workspace output root equal to the working
117
+ directory or an ancestor is refused.
118
+ - validate --staged accepts a staged file that was deleted from the working tree by reading the
119
+ index and passing the staged paths to discovery.
120
+ - snapshot_validate, snapshot_explain and snapshot_plan accept only/ignore; --port 0 works again and
121
+ ports are bounded at 65535.
122
+ - The config-key parity proof is a real satisfies assertion rather than an inert as never. It
123
+ immediately found two accepted aliases, exclude and secretRules, that the TypeScript config type
124
+ could not spell; both are now in SnapshotConfig.
125
+ - Emitted-body lines count a trailing blank line, so a full file no longer reports "34 of 35 lines"
126
+ with incompleteCount: 0. The README ingestion guide numbers its steps once, and a YAML secret:
127
+ section that is a mapping is no longer masked wholesale.
128
+
33
129
  ## 0.20.4
34
130
 
35
131
  **The 0.20 hardening audit found fifteen material defects, almost all of them a guard that existed
package/README.md CHANGED
@@ -211,7 +211,7 @@ Everything an agent needs is available as data, and the tool can install its own
211
211
  ```bash
212
212
  npx codebase-snapshot describe --format json # contract: workflow, options, exit codes
213
213
  npx codebase-snapshot skill --install # into .claude/skills + .cursor/rules
214
- npx -y codebase-snapshot@0.20.4 mcp # or serve it over MCP
214
+ npx -y codebase-snapshot@0.20.6 mcp # or serve it over MCP
215
215
  ```
216
216
 
217
217
  An agent told only "use `npx codebase-snapshot`" can read the contract, follow its ordered