codebase-snapshot 0.9.16 → 0.9.18
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 +136 -0
- package/README.md +4 -4
- package/SECURITY.md +18 -6
- package/dist/bin.js +2024 -622
- package/dist/{chunk-WIL536QD.js → chunk-XAW5GY6X.js} +98 -25
- package/dist/{chunk-6TRFLA7N.js → chunk-ZXWAVHSZ.js} +1758 -444
- package/dist/cli.cjs +2006 -608
- package/dist/cli.d.cts +1 -11
- package/dist/cli.d.ts +1 -11
- package/dist/cli.js +17 -6
- package/dist/index.cjs +1752 -438
- package/dist/index.d.cts +106 -9
- package/dist/index.d.ts +106 -9
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +1761 -341
- package/dist/mcp.d.cts +7 -0
- package/dist/mcp.d.ts +7 -0
- package/dist/mcp.js +2 -2
- package/dist/{types-DIX6zWSt.d.cts → types-KbJvBjmV.d.cts} +46 -1
- package/dist/{types-DIX6zWSt.d.ts → types-KbJvBjmV.d.ts} +46 -1
- package/docs/cli.md +20 -13
- package/docs/configuration.md +16 -1
- package/docs/mcp.md +17 -7
- package/docs/output.md +3 -3
- package/docs/vs-gitingest.md +6 -2
- package/docs/vs-repomix.md +9 -5
- package/package.json +16 -18
package/CHANGELOG.md
CHANGED
|
@@ -23,6 +23,138 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
|
|
|
23
23
|
|
|
24
24
|
---
|
|
25
25
|
|
|
26
|
+
## 0.9.18
|
|
27
|
+
|
|
28
|
+
A release about what the listing says. The generator is unchanged; what changed is every place
|
|
29
|
+
that describes it — the npm page, the README, the machine-readable summary, and one comparison
|
|
30
|
+
table that had two rows wrong.
|
|
31
|
+
|
|
32
|
+
### The update notice waited a day
|
|
33
|
+
|
|
34
|
+
The check remembered "you are already current" for 24 hours, so a release published two hours
|
|
35
|
+
after a run went unnoticed until the next day — even though the tool exists to prove a thing is
|
|
36
|
+
current. A cached answer that names a newer release still keeps the daily interval, because the
|
|
37
|
+
upgrade command is already known; a "you are current" answer is now re-asked after an hour. An
|
|
38
|
+
active run therefore notices a release within the hour, and a machine that is up to date makes at
|
|
39
|
+
most one request an hour instead of one a day.
|
|
40
|
+
|
|
41
|
+
### The npm description did not contain the product's name
|
|
42
|
+
|
|
43
|
+
"Pack a codebase for an LLM into budgeted Markdown parts" described the mechanism and never said
|
|
44
|
+
*snapshot*. The package is called `codebase-snapshot` and the words people type are "codebase
|
|
45
|
+
snapshot"; the description now opens with that phrase, names the clients it is used with, and says
|
|
46
|
+
it is local.
|
|
47
|
+
|
|
48
|
+
The keyword list lost the words that describe the implementation rather than the job —
|
|
49
|
+
`partitioner`, `ast`, `ai`, `code-analysis`, `prompt-engineering` — and gained the ones a person
|
|
50
|
+
searching for this would use: `llm-context`, `codebase-to-markdown`, `token-budget`, `claude-code`,
|
|
51
|
+
`drift-detection`. Twenty terms, and none of them a competitor's name.
|
|
52
|
+
|
|
53
|
+
### Two rows in the repomix comparison were wrong
|
|
54
|
+
|
|
55
|
+
`docs/vs-repomix.md` said repomix emits "a single packed file" with "no per-artifact ceiling". It
|
|
56
|
+
has `--split-output <size>` and `--token-budget <n>`, and the second exits non-zero above a token
|
|
57
|
+
count — a ceiling of the kind the table denied it. Both rows are corrected, and the page now lists
|
|
58
|
+
a token budget under *where repomix is the better choice*: tokens are what a context window
|
|
59
|
+
measures, and this project budgets bytes.
|
|
60
|
+
|
|
61
|
+
The page was also the first thing a search for "repomix alternative" could land on. A comparison
|
|
62
|
+
that is wrong about the other tool is worse than no comparison, and the correction costs less than
|
|
63
|
+
the credibility it protects.
|
|
64
|
+
|
|
65
|
+
### The README asked for a command the reader did not have yet
|
|
66
|
+
|
|
67
|
+
The first block led with `snapshot`, which exists only after a global install, so the very first
|
|
68
|
+
thing a visitor copied could fail. It leads with `npx codebase-snapshot generate` now, with the
|
|
69
|
+
short form after it.
|
|
70
|
+
|
|
71
|
+
The weekly-downloads badge is gone. On a repository with two stars it advertised a number that is
|
|
72
|
+
mostly registry mirrors and old lockfiles, in a README whose central claim is that it does not
|
|
73
|
+
overstate what it has proven.
|
|
74
|
+
|
|
75
|
+
### `llms.txt` described three of the four pillars
|
|
76
|
+
|
|
77
|
+
The summary an agent reads first mentioned budgeted parts, the manifest and a secret audit, and
|
|
78
|
+
left out `validate` and the MCP server — the two things the project argues about. Both are in the
|
|
79
|
+
summary now.
|
|
80
|
+
|
|
81
|
+
### The scaffolder now says it is the scaffolder
|
|
82
|
+
|
|
83
|
+
`create-codebase-snapshot` described itself as "Set up codebase-snapshot in a repository", which
|
|
84
|
+
reads as the tool itself when it is the first npm result for the name. It describes the scaffolding
|
|
85
|
+
it actually performs.
|
|
86
|
+
|
|
87
|
+
### Also
|
|
88
|
+
|
|
89
|
+
- The 0.9.5 paragraph beginning "The MCP server has not been run against a real client" now carries
|
|
90
|
+
a note pointing at what superseded it: the digit-as-string fix in 0.9.6 was reported from a live
|
|
91
|
+
client session, and `snapshot_dependents` arrived in 0.9.8. The paragraph is history, not a
|
|
92
|
+
current disclaimer, and a reader who found it by search had no way to tell.
|
|
93
|
+
|
|
94
|
+
## 0.9.17
|
|
95
|
+
|
|
96
|
+
Closes the remaining entries of the 0.9.16 verified-bug report and the follow-up report from a
|
|
97
|
+
CommonJS gateway. The theme is that a gate now proves what it claims: the manifest is the schema
|
|
98
|
+
it says it is, an artifact cannot be deleted while `validate` stays green, a staged snapshot is
|
|
99
|
+
what `git commit` will write, and a mask never changes what a file means.
|
|
100
|
+
|
|
101
|
+
**Redaction.** Unquoted assignments in source files are expressions, not credentials:
|
|
102
|
+
`SEARXNG_SECRET_KEY: optionalString`, `{ "x-api-key": key }` and `? "PASS" : "MUTATE"` survive
|
|
103
|
+
verbatim, while the same text in YAML, a `.env` or a shell file is still masked. A shell
|
|
104
|
+
expansion (`"${VAR:-…}"`, `$(date -u …)`) is a reference and is never partially masked; the
|
|
105
|
+
`-u` userinfo rule no longer matches a date format; `${VAR:?message}` keeps its message; and
|
|
106
|
+
placeholders (`replace-me-…`, `sk-...`, `<…>`) stay readable. A line whose quotes were balanced
|
|
107
|
+
before masking and not after is left untouched rather than emitted broken.
|
|
108
|
+
|
|
109
|
+
**Scope and graph.** `--staged` reads the index blob, so further unstaged edits are not
|
|
110
|
+
snapshotted, and a staged deletion is recorded as `deleted`. Git paths keep their bytes (no
|
|
111
|
+
`.trim()`, no backslash rewrite). A deleted module is a tombstone, so its importers are found by
|
|
112
|
+
`--with-dependents`. `tsconfig` `baseUrl`/`paths` aliases resolve. Case folding is a
|
|
113
|
+
platform property. `**` inside a segment no longer crosses `/`. `.gitignore` updates preserve
|
|
114
|
+
UTF-8/UTF-16 BOMs and dedupe by meaning; the entries written are root-anchored.
|
|
115
|
+
|
|
116
|
+
**Lifecycle.** The run lock carries a heartbeat refreshed from a worker thread (the main loop is
|
|
117
|
+
synchronous), so a zero-byte or pid-reused lock recovers in two minutes instead of an hour or
|
|
118
|
+
never. An async `afterGenerate` hook holds both locks until it settles, so it cannot mutate a
|
|
119
|
+
newer snapshot. Size limits are checked before the skeleton parse and before serialising a
|
|
120
|
+
monolith that cannot fit.
|
|
121
|
+
|
|
122
|
+
**Validation.** The manifest shape guard checks the schema it claims (`generator`, `git`,
|
|
123
|
+
`config`, `budgets`, `indexes`, `kinds`, per-file part/hash/size/mode, per-part
|
|
124
|
+
sha256/byteSize/index). `README.md`, `reports/navigation.md`, `reports/project-tree.md` and
|
|
125
|
+
`reports/audit.md` carry recorded digests and are verified; a navigation link that points at
|
|
126
|
+
nothing fails. `counts.totalLines` is summed from `files[]`, and the fingerprint is recomputed
|
|
127
|
+
from the manifest's files and recorded settings digest. A file deleted from disk is `missing`
|
|
128
|
+
with a detail, not a bare `read-error`, and `validate` surfaces unreadable skips.
|
|
129
|
+
|
|
130
|
+
**Internals.** Module configs are re-evaluated only when their bytes change. Layer/kind registries
|
|
131
|
+
are ordered-safe (`constructor`, `__proto__`). The derivation cache subtracts replaced entries
|
|
132
|
+
and is LRU. Part assembly is memoised. The ownership marker reuses digests recorded at write time.
|
|
133
|
+
`.js` is parsed as JavaScript, CommonJS exports are summarised, and Express/Hono/Koa/Fastify
|
|
134
|
+
route registrations populate route methods.
|
|
135
|
+
|
|
136
|
+
**MCP.** At most four requests run at once, with a typed `overloaded` error for the rest. The route
|
|
137
|
+
lookup is indexed rather than quadratic. A `snapshot_read` page that ends inside one very long line
|
|
138
|
+
reports `pageable: false` instead of advancing `fromLine` past the only line.
|
|
139
|
+
|
|
140
|
+
**Contracts and repository gates.** `describe` says JS/JSX for `--skeleton` and nested
|
|
141
|
+
`.gitignore` files for `--discovery`, and says `--autopilot` chooses the preset. `explain`
|
|
142
|
+
rejects the partitioning/artifact flags it never read and reports the inclusion mode
|
|
143
|
+
`generate` would choose. Every workflow action is pinned to a commit SHA, enforced by
|
|
144
|
+
`scripts/check-workflows.mjs` in `npm run verify`. Secret scanning no longer ignores `docs/**`,
|
|
145
|
+
`**/*.md` or `llms.txt`; the residual risk and the documented example values are stated in
|
|
146
|
+
`SECURITY.md`.
|
|
147
|
+
|
|
148
|
+
### Verified
|
|
149
|
+
|
|
150
|
+
`npm run verify` — lint, typecheck, 1,080 tests (0 failures, 8 skipped), the workflow pin check,
|
|
151
|
+
the docs sync check, the site build, the site link check, the site audit, the readme lint and the
|
|
152
|
+
tarball check
|
|
153
|
+
(38 files, lockfile agrees with 0.9.17). The publish workflow runs the same gate on Node 18, 20
|
|
154
|
+
and 22 before it uploads.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
26
158
|
## 0.9.16
|
|
27
159
|
|
|
28
160
|
A run refused by the lock it did not get could leave a lock of its own behind — one naming a
|
|
@@ -1243,6 +1375,10 @@ The MCP server has not been run against a real client. Its protocol is exercised
|
|
|
1243
1375
|
binary, but a client's own configuration, timeouts and approval prompts are theirs. That is the next
|
|
1244
1376
|
thing to check, not something this release proves.
|
|
1245
1377
|
|
|
1378
|
+
> Superseded since: the digit-as-string fix in 0.9.6 was reported from a live client session, and
|
|
1379
|
+
> `snapshot_dependents` arrived in 0.9.8 on the same basis. This paragraph describes 0.9.5 and is
|
|
1380
|
+
> left as written — it is history, not a disclaimer about the current server.
|
|
1381
|
+
|
|
1246
1382
|
## 0.9.4
|
|
1247
1383
|
|
|
1248
1384
|
### The snapshot is now something an agent can ask for
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
<p>
|
|
11
11
|
<a href="https://www.npmjs.com/package/codebase-snapshot"><img alt="npm version" src="https://img.shields.io/npm/v/codebase-snapshot.svg"></a>
|
|
12
|
-
<a href="https://
|
|
12
|
+
<a href="https://github.com/ankurhalder/codebase-snapshot/actions/workflows/pr.yml"><img alt="verify" src="https://img.shields.io/github/actions/workflow/status/ankurhalder/codebase-snapshot/pr.yml?label=verify"></a>
|
|
13
13
|
<a href="#license"><img alt="license: MIT" src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
|
|
14
14
|
<a href="https://nodejs.org"><img alt="node: 18 or newer" src="https://img.shields.io/badge/node-%3E%3D18-brightgreen.svg"></a>
|
|
15
15
|
<a href="https://ankurhalder.github.io/codebase-snapshot/"><img alt="documentation" src="https://img.shields.io/badge/docs-read-1a7f37"></a>
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
</div>
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
snapshot
|
|
21
|
-
|
|
20
|
+
npx codebase-snapshot generate # no install: straight to the snapshot
|
|
21
|
+
snapshot # once installed: detects the project, sets it up, generates
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
That writes `./snapshot/` — a directory you can drop into a chat, a prompt, a RAG pipeline or a
|
|
@@ -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.
|
|
203
|
+
npx -y codebase-snapshot@0.9.18 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
|
|
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
|
-
|
|
93
|
-
and
|
|
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
|