codebase-snapshot 0.16.0 → 0.18.0

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/docs/serve.md CHANGED
@@ -21,10 +21,10 @@ Serving http://127.0.0.1:4788/
21
21
  files to fit the number you give. The result line reports how many paths were not selected.
22
22
  2. **Generate.** Paste an absolute path or a public repository URL and press Generate. A URL is
23
23
  cloned shallowly into a temporary directory (removed when the server exits) with the same
24
- provenance record the CLI writes. The page calls the same
25
- `generateSnapshot` the CLI calls, with the default settings — the defaults are what a browser
26
- session can honestly promise, because a config file can run code and this process will not run
27
- repository code on a page's request. For a project config, use the CLI.
24
+ provenance record the CLI writes. The page calls the same `generateSnapshot` the CLI calls,
25
+ with the repository's `snapshot.config.json` (or the `snapshot` key of `package.json`) applied, so
26
+ the browser and the terminal produce the same snapshot. An executable config is refused rather
27
+ than run: this process does not execute repository code on a page's request.
28
28
  3. **Preview.** The brief (`PROMPT.md`) and the file list come back from the written snapshot, not
29
29
  from the working tree. If the snapshot is wrong, the page shows the wrongness.
30
30
  4. **See the health score.** The page audits what it just wrote and shows the score, with the
@@ -39,6 +39,14 @@ a path outside the directory it was started for, or outside a clone it created i
39
39
  decides who may ask; this decides what may be asked about — otherwise a leaked token would be an
40
40
  arbitrary-file-read primitive over the whole disk.
41
41
 
42
+ ## The repository's configuration
43
+
44
+ The page loads the repository's `snapshot.config.json` (or the `snapshot` key of `package.json`),
45
+ so a project configured to exclude a directory generates the same snapshot in the browser as it
46
+ does on the command line. An **executable** config (`snapshot.config.ts`, `.mjs`, `.cjs`) is
47
+ refused with the reason, exactly as the MCP server refuses it: this surface does not run
48
+ repository code.
49
+
42
50
  ## The token
43
51
 
44
52
  The page is HTML and is served without a token; everything that reads or writes a repository needs
@@ -51,6 +59,14 @@ off and is refused on a non-loopback bind.
51
59
  `POST /mcp` on the same port is the MCP endpoint from [MCP](mcp.md), with the same token. A browser
52
60
  agent and a human look at the same snapshot.
53
61
 
62
+ ## Using it without a mouse, or without sight
63
+
64
+ The page is a form with four controls, and each has an accessible name (`aria-label`) rather than
65
+ only a placeholder that disappears when you type. The status line is a `role="status"` live region,
66
+ so a screen reader announces "Generating…" and the result without the focus jumping. The mode
67
+ `select`, the token field and the budget field behave the same way, and the token is never
68
+ rendered into the page.
69
+
54
70
  ## Limits, stated
55
71
 
56
72
  | Limit | Value | Why |
package/docs/signing.md CHANGED
@@ -39,7 +39,9 @@ public half.
39
39
 
40
40
  ## Verifying
41
41
 
42
- `snapshot health` verifies the signature when `signature.json` exists:
42
+ Both `snapshot validate` and `snapshot health` verify the signature when `signature.json`
43
+ exists. `validate` reports it as an error (`signature: manifest.json changed after it was signed.`)
44
+ and exits 1; `health` reports it as a critical check with the same reason:
43
45
 
44
46
  - **critical failure** when the manifest changed after signing, the record is malformed, or the
45
47
  signature does not match;
package/docs/tools.md CHANGED
@@ -59,7 +59,10 @@ Every tool is read-only unless it says **writes**. Cost is the class `tools/list
59
59
  ```json
60
60
  { "name": "snapshot_symbol", "arguments": { "name": "generateSnapshot" } }
61
61
  ```
62
- - **`snapshot_routes`** — cheap, read-only. Every route the summaries recorded, with file and part.
62
+ - **`snapshot_routes`**
63
+ > Records the **path** with the method for framework route registration (`GET /health`). A
64
+ > method-only handler (`export async function GET()` in Next.js) has no literal path to record and
65
+ > is reported as the method alone. — cheap, read-only. Every route the summaries recorded, with file and part.
63
66
  ```json
64
67
  { "name": "snapshot_routes", "arguments": { "pattern": "users" } }
65
68
  ```
@@ -115,7 +118,10 @@ Every tool is read-only unless it says **writes**. Cost is the class `tools/list
115
118
 
116
119
  ## Reviewing a change
117
120
 
118
- - **`snapshot_review`** — expensive, read-only. Is the snapshot current, what does the health audit
121
+ - **`snapshot_review`**
122
+ > Validates with the settings the manifest recorded, not with a bare config file: a snapshot
123
+ > generated with `--token-tree`, `--include-diffs`, `--remove-empty-lines` or a pack is current
124
+ > if the files are, and the review says so instead of telling you to regenerate. — expensive, read-only. Is the snapshot current, what does the health audit
119
125
  say, what do the given paths contain, and which route methods do they touch?
120
126
  ```json
121
127
  { "name": "snapshot_review", "arguments": { "paths": ["src/mcp/tools.ts"] } }
@@ -151,12 +157,17 @@ Every tool is read-only unless it says **writes**. Cost is the class `tools/list
151
157
  ```json
152
158
  { "name": "snapshot_generate", "arguments": { "tokenTree": true, "pack": "xml" } }
153
159
  ```
160
+ It also takes `only` and `ignore` arrays — the CLI's per-run narrowing — which enter the config
161
+ digest, so `snapshot_validate` takes the same arrays to compare like with like.
154
162
  It can also narrow: `slice` with `sliceTokens`, or `budgetTokens` (not both — the tool refuses
155
163
  the pair, as the CLI does).
156
164
  ```json
157
165
  { "name": "snapshot_generate", "arguments": { "slice": "how is auth done", "sliceTokens": 20000 } }
158
166
  ```
159
167
  - **`snapshot_validate`** — medium, read-only. Drift check: files changed or deleted since the
168
+ snapshot, part damage, bookkeeping, **and the settings the manifest recorded** — a snapshot
169
+ generated with `tokenTree`, `includeDiffs`, `removeEmptyLines` or `skeleton` validates clean
170
+ without re-passing the flags, while a changed config file is still drift.
160
171
  snapshot, part hashes, bookkeeping. A selection snapshot is not second-guessed, and says so.
161
172
  ```json
162
173
  { "name": "snapshot_validate", "arguments": {} }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-snapshot",
3
- "version": "0.16.0",
3
+ "version": "0.18.0",
4
4
  "description": "Create a codebase snapshot an LLM can read: budgeted Markdown parts for Claude, ChatGPT and Cursor, a manifest of every included and skipped file, secret redaction, and validate, which fails when the snapshot drifts. Local CLI and MCP server.",
5
5
  "keywords": [
6
6
  "codebase-snapshot",