codebase-snapshot 0.20.3 → 0.20.4

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,69 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
30
30
 
31
31
  ---
32
32
 
33
+ ## 0.20.4
34
+
35
+ **The 0.20 hardening audit found fifteen material defects, almost all of them a guard that existed
36
+ on one route and not on its twin. This release closes every one and adds a regression for each
37
+ critical path.**
38
+
39
+ Security and confinement:
40
+
41
+ - A configured `brief` is now confined to the repository and refused when it is a sensitive file.
42
+ Previously `snapshot.config.json` in an untrusted repository could name `/etc/passwd` or
43
+ `~/.ssh/id_rsa`, and the contents were embedded in `PROMPT.md`. The brief is also redacted with
44
+ the full content scanner, so a PEM body is masked as a block instead of only its header.
45
+ - The ambient `GITHUB_TOKEN`/`GH_TOKEN` is attached only for `github.com` (or hosts named in
46
+ `CODEBASE_SNAPSHOT_GITHUB_HOSTS`). A `--remote` URL for any other host no longer receives it.
47
+ - `--remote` refuses IPv4-mapped IPv6, the full link-local range, multicast and other non-public
48
+ IPv4 ranges, and passes `http.followRedirects=false` plus a protocol allow-list to git, so a
49
+ public host cannot redirect the clone into the local network.
50
+ - The default git discovery path applies the same sensitive-target rule as the walker: a tracked
51
+ symlink such as `public-context.txt -> .env` is skipped as `sensitive-file`.
52
+ - `reports/diff.md` filters sensitive and excluded paths per file section, and both it and
53
+ `reports/log.md` are passed through the secret scanner before they are written. Byte truncation
54
+ is UTF-8 safe.
55
+ - `snapshot_workspace` goes through `prepare()`, so its `root` and `outDir` are confined like
56
+ every other tool.
57
+ - `serve` resolves symlinks before its allowed-root check, applies the check to
58
+ `POST /api/generate`, forces a remote clone's `outDir`/`tmpDir` to the clone, and refuses to
59
+ serve a manifest that fails the shape guard.
60
+ - The browser file list is built with text nodes, not `innerHTML`; a crafted `manifest.json`
61
+ can no longer run script in the serve origin.
62
+
63
+ State and lifecycle:
64
+
65
+ - `generate --sign` signs inside staging, before the ownership marker is written. A signed
66
+ snapshot is now replaceable by the next run instead of being refused as foreign; an existing
67
+ signed directory is accepted when its signature verifies.
68
+ - A terminated MCP generate worker removes its own lock and staging directory by run id, so the
69
+ next `snapshot_generate` no longer waits 120 seconds for a heartbeat that the terminated worker
70
+ cannot send.
71
+ - MCP over HTTP gives each session its own era and cancellation state, caps batches at 100
72
+ messages, and answers an oversized chunked body exactly once instead of throwing
73
+ `ERR_HTTP_HEADERS_SENT`.
74
+ - `health --all-members --deep` now passes `deep` to every member.
75
+
76
+ Contract and validation:
77
+
78
+ - `stripComments`, `removeEmptyLines`, `logCount` and `pack` are accepted in every config file;
79
+ the generated config lists them, and a compile-time check now proves both directions of the key
80
+ set.
81
+ - `validate` and `explain` pass `tsconfig` path aliases to the import resolver, so
82
+ `--with-dependents` does not produce immediate false drift.
83
+ - `validate --staged` hashes the git index blob, matching what `generate --staged` wrote.
84
+ - `generate --watch` uses the same option builder as a one-shot run; `--only`, transforms, packs,
85
+ reports, slice/budget and `--sign` survive a reload. `--watch --delta` is refused rather than
86
+ silently ignored.
87
+ - `validate` compares config-file settings against the current file and uses the manifest record
88
+ only for settings that a run flag supplied.
89
+ - Monolith packs record `comments-stripped` and `emptyLinesRemoved` when those transforms shaped
90
+ the body; a `#ref` in a remote URL is actually cloned and recorded.
91
+
92
+ Compatibility notes: a brief outside the repository is now a hard error; `--sign` requires
93
+ `manifest.json`; `--watch --delta` is refused; GitHub Enterprise users must set
94
+ `CODEBASE_SNAPSHOT_GITHUB_HOSTS` if they rely on the ambient token.
95
+
33
96
  ## 0.20.3
34
97
 
35
98
  **The deep sweep found one real bottleneck: the skipped-secret check re-read the snapshot per token.**
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.3 mcp # or serve it over MCP
214
+ npx -y codebase-snapshot@0.20.4 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