codebase-snapshot 0.20.3 → 0.20.5
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 +108 -0
- package/README.md +1 -1
- package/dist/bin.js +1971 -939
- package/dist/{chunk-7JQRJBMP.js → chunk-C3WVC4FV.js} +1720 -850
- package/dist/{chunk-TUL3I7O6.js → chunk-HYTY6T7P.js} +147 -16
- package/dist/cli.cjs +2052 -1022
- package/dist/cli.d.cts +16 -2
- package/dist/cli.d.ts +16 -2
- package/dist/cli.js +103 -78
- 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 +1714 -817
- package/dist/index.d.cts +38 -6
- package/dist/index.d.ts +38 -6
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +1157 -494
- package/dist/mcp.d.cts +1 -1
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +2 -2
- package/dist/{types-Drw1J0e0.d.cts → types-DnYsA6_Y.d.cts} +4 -0
- package/dist/{types-Drw1J0e0.d.ts → types-DnYsA6_Y.d.ts} +4 -0
- 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/mcp.md +11 -4
- package/docs/security-review.md +42 -4
- package/docs/serve.md +8 -4
- package/docs/workspace.md +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -30,6 +30,114 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
|
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
+
## 0.20.5
|
|
34
|
+
|
|
35
|
+
**The second 0.20 audit found twelve regressions and bypasses left by the first hardening pass.
|
|
36
|
+
This release closes all of them and records the regression that pins each route.**
|
|
37
|
+
|
|
38
|
+
Security and confinement:
|
|
39
|
+
|
|
40
|
+
- A tracked symlink is now emitted only when its target survived the snapshot's own filters. The
|
|
41
|
+
previous check compared the target to the sensitive-file list but not to include, exclude, the
|
|
42
|
+
built-in deny-list or .gitignore, so notes.txt -> .git/config shipped the CI token in the
|
|
43
|
+
repository config. The authorization-header rule is case-insensitive again without making its
|
|
44
|
+
mixed-case credential tests case-insensitive.
|
|
45
|
+
- snapshot://prompt, snapshot://reports/*, snapshot://manifest, snapshot_history,
|
|
46
|
+
snapshot_workspace, GET /api/snapshot and the web manifest read now go through one confined
|
|
47
|
+
reader that refuses a symlink and requires the canonical target inside the snapshot directory.
|
|
48
|
+
- reports/diff.md now runs git with core.quotepath=false and diff.noprefix=false, fails closed when
|
|
49
|
+
a section header cannot be attributed to a path, redacts before truncation using the diffed
|
|
50
|
+
file's own extension, and honours --only and the built-in ignore list.
|
|
51
|
+
- Owner-brief headings, project-overview prose and commit subjects/bodies use the full content
|
|
52
|
+
scanner, not the path-only rule set. A PEM body or a token in "## Incident ghp_..." no longer
|
|
53
|
+
reaches PROMPT.md.
|
|
54
|
+
- MCP regex tools refuse nested quantifiers and multiple unbounded repetitions instead of running a
|
|
55
|
+
main-thread ReDoS; HTTP MCP caps in-flight tool calls at four, evicts the oldest session at 64,
|
|
56
|
+
and prunes rate windows.
|
|
57
|
+
- serve confines a local config's tmpDir as well as its outDir; a failed or oversized remote clone
|
|
58
|
+
removes its temporary directory.
|
|
59
|
+
- init --install-hook refuses a symlinked hooks directory or hook file, and a hard-linked hook.
|
|
60
|
+
|
|
61
|
+
State and contract:
|
|
62
|
+
|
|
63
|
+
- If the Windows/OneDrive in-place swap removes the old snapshot and then cannot move the new one
|
|
64
|
+
in, staging is left on disk and named, instead of being deleted by the failure handler.
|
|
65
|
+
- generate --workspace --dry-run writes nothing, and a workspace output root equal to the working
|
|
66
|
+
directory or an ancestor is refused.
|
|
67
|
+
- validate --staged accepts a staged file that was deleted from the working tree by reading the
|
|
68
|
+
index and passing the staged paths to discovery.
|
|
69
|
+
- snapshot_validate, snapshot_explain and snapshot_plan accept only/ignore; --port 0 works again and
|
|
70
|
+
ports are bounded at 65535.
|
|
71
|
+
- The config-key parity proof is a real satisfies assertion rather than an inert as never. It
|
|
72
|
+
immediately found two accepted aliases, exclude and secretRules, that the TypeScript config type
|
|
73
|
+
could not spell; both are now in SnapshotConfig.
|
|
74
|
+
- Emitted-body lines count a trailing blank line, so a full file no longer reports "34 of 35 lines"
|
|
75
|
+
with incompleteCount: 0. The README ingestion guide numbers its steps once, and a YAML secret:
|
|
76
|
+
section that is a mapping is no longer masked wholesale.
|
|
77
|
+
|
|
78
|
+
## 0.20.4
|
|
79
|
+
|
|
80
|
+
**The 0.20 hardening audit found fifteen material defects, almost all of them a guard that existed
|
|
81
|
+
on one route and not on its twin. This release closes every one and adds a regression for each
|
|
82
|
+
critical path.**
|
|
83
|
+
|
|
84
|
+
Security and confinement:
|
|
85
|
+
|
|
86
|
+
- A configured `brief` is now confined to the repository and refused when it is a sensitive file.
|
|
87
|
+
Previously `snapshot.config.json` in an untrusted repository could name `/etc/passwd` or
|
|
88
|
+
`~/.ssh/id_rsa`, and the contents were embedded in `PROMPT.md`. The brief is also redacted with
|
|
89
|
+
the full content scanner, so a PEM body is masked as a block instead of only its header.
|
|
90
|
+
- The ambient `GITHUB_TOKEN`/`GH_TOKEN` is attached only for `github.com` (or hosts named in
|
|
91
|
+
`CODEBASE_SNAPSHOT_GITHUB_HOSTS`). A `--remote` URL for any other host no longer receives it.
|
|
92
|
+
- `--remote` refuses IPv4-mapped IPv6, the full link-local range, multicast and other non-public
|
|
93
|
+
IPv4 ranges, and passes `http.followRedirects=false` plus a protocol allow-list to git, so a
|
|
94
|
+
public host cannot redirect the clone into the local network.
|
|
95
|
+
- The default git discovery path applies the same sensitive-target rule as the walker: a tracked
|
|
96
|
+
symlink such as `public-context.txt -> .env` is skipped as `sensitive-file`.
|
|
97
|
+
- `reports/diff.md` filters sensitive and excluded paths per file section, and both it and
|
|
98
|
+
`reports/log.md` are passed through the secret scanner before they are written. Byte truncation
|
|
99
|
+
is UTF-8 safe.
|
|
100
|
+
- `snapshot_workspace` goes through `prepare()`, so its `root` and `outDir` are confined like
|
|
101
|
+
every other tool.
|
|
102
|
+
- `serve` resolves symlinks before its allowed-root check, applies the check to
|
|
103
|
+
`POST /api/generate`, forces a remote clone's `outDir`/`tmpDir` to the clone, and refuses to
|
|
104
|
+
serve a manifest that fails the shape guard.
|
|
105
|
+
- The browser file list is built with text nodes, not `innerHTML`; a crafted `manifest.json`
|
|
106
|
+
can no longer run script in the serve origin.
|
|
107
|
+
|
|
108
|
+
State and lifecycle:
|
|
109
|
+
|
|
110
|
+
- `generate --sign` signs inside staging, before the ownership marker is written. A signed
|
|
111
|
+
snapshot is now replaceable by the next run instead of being refused as foreign; an existing
|
|
112
|
+
signed directory is accepted when its signature verifies.
|
|
113
|
+
- A terminated MCP generate worker removes its own lock and staging directory by run id, so the
|
|
114
|
+
next `snapshot_generate` no longer waits 120 seconds for a heartbeat that the terminated worker
|
|
115
|
+
cannot send.
|
|
116
|
+
- MCP over HTTP gives each session its own era and cancellation state, caps batches at 100
|
|
117
|
+
messages, and answers an oversized chunked body exactly once instead of throwing
|
|
118
|
+
`ERR_HTTP_HEADERS_SENT`.
|
|
119
|
+
- `health --all-members --deep` now passes `deep` to every member.
|
|
120
|
+
|
|
121
|
+
Contract and validation:
|
|
122
|
+
|
|
123
|
+
- `stripComments`, `removeEmptyLines`, `logCount` and `pack` are accepted in every config file;
|
|
124
|
+
the generated config lists them, and a compile-time check now proves both directions of the key
|
|
125
|
+
set.
|
|
126
|
+
- `validate` and `explain` pass `tsconfig` path aliases to the import resolver, so
|
|
127
|
+
`--with-dependents` does not produce immediate false drift.
|
|
128
|
+
- `validate --staged` hashes the git index blob, matching what `generate --staged` wrote.
|
|
129
|
+
- `generate --watch` uses the same option builder as a one-shot run; `--only`, transforms, packs,
|
|
130
|
+
reports, slice/budget and `--sign` survive a reload. `--watch --delta` is refused rather than
|
|
131
|
+
silently ignored.
|
|
132
|
+
- `validate` compares config-file settings against the current file and uses the manifest record
|
|
133
|
+
only for settings that a run flag supplied.
|
|
134
|
+
- Monolith packs record `comments-stripped` and `emptyLinesRemoved` when those transforms shaped
|
|
135
|
+
the body; a `#ref` in a remote URL is actually cloned and recorded.
|
|
136
|
+
|
|
137
|
+
Compatibility notes: a brief outside the repository is now a hard error; `--sign` requires
|
|
138
|
+
`manifest.json`; `--watch --delta` is refused; GitHub Enterprise users must set
|
|
139
|
+
`CODEBASE_SNAPSHOT_GITHUB_HOSTS` if they rely on the ambient token.
|
|
140
|
+
|
|
33
141
|
## 0.20.3
|
|
34
142
|
|
|
35
143
|
**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.
|
|
214
|
+
npx -y codebase-snapshot@0.20.5 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
|