codebase-snapshot 0.20.2 → 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 +75 -0
- package/README.md +1 -1
- package/dist/bin.js +904 -423
- package/dist/{chunk-DUDF3CR5.js → chunk-AQZNT3QL.js} +664 -260
- package/dist/{chunk-YL4VRORI.js → chunk-QB5TNXMZ.js} +90 -14
- package/dist/cli.cjs +815 -333
- package/dist/cli.d.cts +14 -2
- package/dist/cli.d.ts +14 -2
- package/dist/cli.js +72 -73
- package/dist/{generate-worker-C6Z1I0XS.d.cts → generate-worker-CNRsO_z7.d.cts} +4 -0
- package/dist/{generate-worker-C6Z1I0XS.d.ts → generate-worker-CNRsO_z7.d.ts} +4 -0
- package/dist/index.cjs +667 -236
- package/dist/index.d.cts +36 -4
- package/dist/index.d.ts +36 -4
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +679 -310
- package/dist/mcp.d.cts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +2 -2
- package/docs/brief.md +5 -0
- package/docs/cli.md +5 -5
- package/docs/configuration.md +5 -0
- package/docs/deploy.md +2 -2
- package/docs/health.md +2 -2
- package/docs/mcp.md +11 -4
- package/docs/security-review.md +16 -3
- package/docs/serve.md +8 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,81 @@ 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
|
+
|
|
96
|
+
## 0.20.3
|
|
97
|
+
|
|
98
|
+
**The deep sweep found one real bottleneck: the skipped-secret check re-read the snapshot per token.**
|
|
99
|
+
|
|
100
|
+
`secrets.skipped` compares values from excluded sensitive files against the artifacts. Each token
|
|
101
|
+
triggered a full directory walk plus a fresh read of every artifact file, so a snapshot with the
|
|
102
|
+
maximum 400+ tokens caused close to 2 GiB of reads for a single check. The artifact texts are now
|
|
103
|
+
read once and shared across all tokens; the comparison is byte-identical, only the I/O changed.
|
|
104
|
+
Found by the final pre-publish sweep, which also re-verified redaction idempotence, pack parity
|
|
105
|
+
(JSON/XML/markdown all normalise to LF), exit codes (0/1/2), the 0.20 patch-line guard and a
|
|
106
|
+
100/100 scratch snapshot with packs enabled.
|
|
107
|
+
|
|
33
108
|
## 0.20.2
|
|
34
109
|
|
|
35
110
|
**The release gate now proves the snapshot against the repository, and the JSON pack stops carrying
|
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.
|
|
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
|