codebase-snapshot 0.9.16 → 0.9.17

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
@@ -23,6 +23,70 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
23
23
 
24
24
  ---
25
25
 
26
+ ## 0.9.17
27
+
28
+ Closes the remaining entries of the 0.9.16 verified-bug report and the follow-up report from a
29
+ CommonJS gateway. The theme is that a gate now proves what it claims: the manifest is the schema
30
+ it says it is, an artifact cannot be deleted while `validate` stays green, a staged snapshot is
31
+ what `git commit` will write, and a mask never changes what a file means.
32
+
33
+ **Redaction.** Unquoted assignments in source files are expressions, not credentials:
34
+ `SEARXNG_SECRET_KEY: optionalString`, `{ "x-api-key": key }` and `? "PASS" : "MUTATE"` survive
35
+ verbatim, while the same text in YAML, a `.env` or a shell file is still masked. A shell
36
+ expansion (`"${VAR:-…}"`, `$(date -u …)`) is a reference and is never partially masked; the
37
+ `-u` userinfo rule no longer matches a date format; `${VAR:?message}` keeps its message; and
38
+ placeholders (`replace-me-…`, `sk-...`, `<…>`) stay readable. A line whose quotes were balanced
39
+ before masking and not after is left untouched rather than emitted broken.
40
+
41
+ **Scope and graph.** `--staged` reads the index blob, so further unstaged edits are not
42
+ snapshotted, and a staged deletion is recorded as `deleted`. Git paths keep their bytes (no
43
+ `.trim()`, no backslash rewrite). A deleted module is a tombstone, so its importers are found by
44
+ `--with-dependents`. `tsconfig` `baseUrl`/`paths` aliases resolve. Case folding is a
45
+ platform property. `**` inside a segment no longer crosses `/`. `.gitignore` updates preserve
46
+ UTF-8/UTF-16 BOMs and dedupe by meaning; the entries written are root-anchored.
47
+
48
+ **Lifecycle.** The run lock carries a heartbeat refreshed from a worker thread (the main loop is
49
+ synchronous), so a zero-byte or pid-reused lock recovers in two minutes instead of an hour or
50
+ never. An async `afterGenerate` hook holds both locks until it settles, so it cannot mutate a
51
+ newer snapshot. Size limits are checked before the skeleton parse and before serialising a
52
+ monolith that cannot fit.
53
+
54
+ **Validation.** The manifest shape guard checks the schema it claims (`generator`, `git`,
55
+ `config`, `budgets`, `indexes`, `kinds`, per-file part/hash/size/mode, per-part
56
+ sha256/byteSize/index). `README.md`, `reports/navigation.md`, `reports/project-tree.md` and
57
+ `reports/audit.md` carry recorded digests and are verified; a navigation link that points at
58
+ nothing fails. `counts.totalLines` is summed from `files[]`, and the fingerprint is recomputed
59
+ from the manifest's files and recorded settings digest. A file deleted from disk is `missing`
60
+ with a detail, not a bare `read-error`, and `validate` surfaces unreadable skips.
61
+
62
+ **Internals.** Module configs are re-evaluated only when their bytes change. Layer/kind registries
63
+ are ordered-safe (`constructor`, `__proto__`). The derivation cache subtracts replaced entries
64
+ and is LRU. Part assembly is memoised. The ownership marker reuses digests recorded at write time.
65
+ `.js` is parsed as JavaScript, CommonJS exports are summarised, and Express/Hono/Koa/Fastify
66
+ route registrations populate route methods.
67
+
68
+ **MCP.** At most four requests run at once, with a typed `overloaded` error for the rest. The route
69
+ lookup is indexed rather than quadratic. A `snapshot_read` page that ends inside one very long line
70
+ reports `pageable: false` instead of advancing `fromLine` past the only line.
71
+
72
+ **Contracts and repository gates.** `describe` says JS/JSX for `--skeleton` and nested
73
+ `.gitignore` files for `--discovery`, and says `--autopilot` chooses the preset. `explain`
74
+ rejects the partitioning/artifact flags it never read and reports the inclusion mode
75
+ `generate` would choose. Every workflow action is pinned to a commit SHA, enforced by
76
+ `scripts/check-workflows.mjs` in `npm run verify`. Secret scanning no longer ignores `docs/**`,
77
+ `**/*.md` or `llms.txt`; the residual risk and the documented example values are stated in
78
+ `SECURITY.md`.
79
+
80
+ ### Verified
81
+
82
+ `npm run verify` — lint, typecheck, 1,080 tests (0 failures, 8 skipped), the workflow pin check,
83
+ the docs sync check, the site build, the site link check, the site audit, the readme lint and the
84
+ tarball check
85
+ (38 files, lockfile agrees with 0.9.17). The publish workflow runs the same gate on Node 18, 20
86
+ and 22 before it uploads.
87
+
88
+ ---
89
+
26
90
  ## 0.9.16
27
91
 
28
92
  A run refused by the lock it did not get could leave a lock of its own behind — one naming a
package/README.md CHANGED
@@ -200,7 +200,7 @@ Everything an agent needs is available as data, and the tool can install its own
200
200
  ```bash
201
201
  npx codebase-snapshot describe --format json # contract: workflow, options, exit codes
202
202
  npx codebase-snapshot skill --install # into .claude/skills + .cursor/rules
203
- npx -y codebase-snapshot@0.9.16 mcp # or serve it over MCP
203
+ npx -y codebase-snapshot@0.9.17 mcp # or serve it over MCP
204
204
  ```
205
205
 
206
206
  An agent told only "use `npx codebase-snapshot`" can read the contract, follow its ordered
package/SECURITY.md CHANGED
@@ -79,21 +79,33 @@ strings: the test suites, the rule definitions in `src/security/patterns.ts` and
79
79
  the engine is meant to detect, they cannot authenticate against any service, and they exist so
80
80
  that detection can be proved. They are **not** credentials.
81
81
 
82
- Secret scanners are therefore configured to skip those surfaces, instead of asking a human to
83
- dismiss the same alert on every push:
82
+ Secret scanners are therefore configured to skip the surfaces that are synthetic by
83
+ construction, instead of asking a human to dismiss the same alert on every push:
84
84
 
85
85
  | Surface | Why it is excluded |
86
86
  | :--- | :--- |
87
87
  | `tests/**` | the fixtures assert that detection fires |
88
+ | `audit/**` | verification reports quote the probes they describe |
88
89
  | `src/security/patterns.ts`, `src/security/redact.ts` | the rule definitions and their worked examples |
89
- | `**/*.md`, `**/docs/**`, `llms.txt` | documentation explains the shapes by showing them |
90
90
  | `package-lock.json` | integrity digests are not credentials |
91
91
 
92
- Both scanner configurations carry that list: `.github/secret_scanning.yml` for GitHub's scanner
93
- and `.gitguardian.yaml` for ggshield, the GitGuardian CLI and CI scanner. The GitGuardian
92
+ `docs/**`, `**/*.md` and `llms.txt` are **not** excluded any more. They used to be, which put
93
+ every published page and the README outside the detector: a real token pasted into documentation
94
+ would not have been reported. Those files are scanned now.
95
+
96
+ The documented example values that remain in scanned files are
97
+ `hunter2`/`hunter2hunter2`, `AKIAIOSFODNN7EXAMPLE`, `replace-me-…`, `<…>` placeholders and
98
+ `sk-...`. They are synthetic and cannot authenticate. An alert naming one of them is reviewed
99
+ and allowlisted by value in the scanner's dashboard rather than by excluding the whole file —
100
+ **owner: the maintainers**, reviewed when a scanner version changes its generic detectors. This is
101
+ a residual risk: a real credential in a Markdown file is outside the file-level exclusion list and
102
+ is reported, but a real credential *inside a documented example value* would not be.
103
+
104
+ Both scanner configurations carry the file-level list: `.github/secret_scanning.yml` for GitHub's
105
+ scanner and `.gitguardian.yaml` for ggshield, the GitGuardian CLI and CI scanner. The GitGuardian
94
106
  *dashboard* does not read either file — its exclusions live in workspace settings
95
107
  (**Secrets detection → Filepath exclusions**) and are applied retroactively, so adding them
96
- there also clears incidents that already exist.
108
+ there also clears incidents that already exist. Its allowlist is configured there too.
97
109
 
98
110
  Anywhere outside those paths, a real credential is handled normally: it is reported and it must
99
111
  be revoked. If you add a fixture outside them, use a placeholder no detector matches, or extend