codebase-snapshot 0.10.2 → 0.12.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/CHANGELOG.md CHANGED
@@ -23,6 +23,108 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
23
23
 
24
24
  ---
25
25
 
26
+ ## 0.12.0
27
+
28
+ The brief stops being only generated. Facts can be proved from the repository; judgement cannot,
29
+ and pretending otherwise produced a document that was accurate and generic.
30
+
31
+ **The owner half (`brief`).** A markdown file with five recognised headings is merged at fixed
32
+ slots:
33
+
34
+ | Heading | Result |
35
+ | :--- | :--- |
36
+ | `## Stakes` | its own section, right after the job |
37
+ | `## The system` | replaces the generated narrative; the measured facts still follow under "What the index records" |
38
+ | `## What came before` | rendered above the generated commit ledger |
39
+ | `## The bar` | replaces the standard |
40
+ | `## Calibration` | replaces the example failures |
41
+
42
+ Any other heading is kept verbatim under **Owner notes** — nothing is dropped because the merge
43
+ did not recognise it. Every owner section is marked in the output as written by the project owner,
44
+ so a reader can tell an assertion from a measurement. Three things are refused because they would
45
+ make the document lie: a heading that redefines a measured section (`Coverage`, `This snapshot`,
46
+ `Attaching this`, `The job`, `What you have`, `What a useful answer contains`, `Your task`), a
47
+ `brief` path that cannot be read, and — indirectly — an edited brief, which no longer matches the
48
+ digest the manifest recorded. A stale brief is the same failure as a stale snapshot.
49
+
50
+ **More facts, for free.** The history section now carries commit bodies, not only subjects: the
51
+ subject says what changed, the body usually says why, and the why is the part a reader can verify.
52
+ A new "What this is" section quotes what the repository says about itself — the `package.json`
53
+ description, the first README paragraph, the two most recent release headings — labelled as the
54
+ project`s own claims rather than evidence. All of it is masked like every other reproduced string.
55
+
56
+ **The job is a setting (`promptTask`).** `audit` (the default) asks for what is still wrong or
57
+ will break, `review` for what a change breaks, `explain` for how a subsystem works. The standard
58
+ and the coverage duty are the same in all three; only the opening section changes. An unknown
59
+ value is a usage error, not a silent fall back.
60
+
61
+ **Upgrading.** Nothing existing changes unless you set `brief` or `promptTask`: the default job is
62
+ the one 0.11.0 shipped, and both settings are omitted from the config digest at their defaults, so
63
+ a snapshot written before this release still validates. New `manifest.config.promptTask` and, when
64
+ configured, `manifest.config.brief: { path, digest }`.
65
+
66
+ Verified: 1 168 tests, 1 160 pass, 0 fail, 8 host skips; lint 225 files; sync-docs, site, link
67
+ check, audit-site, readme-lint and pack-check clean at 0.12.0.
68
+ ## 0.11.0
69
+
70
+ A minor release: `generate` writes one new artifact and two settings are added. Nothing that
71
+ worked stops working, and no manifest field changed meaning.
72
+
73
+ **Upgrading.** The only thing a script can notice is the new file: a snapshot directory now
74
+ contains `PROMPT.md` unless it is turned off (`--skip-artifacts prompt`, `--only-artifacts`, or
75
+ `artifacts: { prompt: false }`). `manifest.config` gains `attachmentSlots` and `maxParts`;
76
+ `manifest.budgets.maxPartBytes` is the budget the parts honour, which differs from
77
+ `manifest.config.maxPartBytes` only when the experimental `maxParts` grows it. Snapshots written
78
+ before this release still validate: neither new setting is part of the config digest, and the
79
+ `maxParts` comparison is skipped when the manifest records no such key.
80
+
81
+ **`PROMPT.md` — the brief, generated.** `generate` wrote the payload and an index of it and left
82
+ the instructions for the model to whoever pasted it. That is half the problem the tool does not
83
+ hand over: parts on their own are a dump, and a model that does not know what was cut from them
84
+ fills the gap by invention.
85
+
86
+ The first version of this artifact was a packing slip — how to read the parts, and nothing about
87
+ the job, the system or the standard. The shipped document is a brief: the job and the latitude
88
+ it comes with; the system as the manifest can prove it (layers, the modules with the most
89
+ importers, entry points, the routes, handlers and components that were indexed — or a plain
90
+ statement that none were, which the earlier draft got wrong by pointing at empty indexes); the
91
+ last ten commit subjects, labelled as claims to verify rather than rediscover; the evidence bar;
92
+ the coverage owed and what the snapshot cannot show; and calibration examples of the defects
93
+ that do not crash. The apparatus — fingerprint, part inventory, partial files, redaction
94
+ counts, attachment arithmetic — is the second half, and the job slot at the end is filled by
95
+ whoever runs it.
96
+
97
+ Every run now writes `snapshot/PROMPT.md`, rendered from the manifest of that run: the fingerprint
98
+ to quote back, the commit and whether the tree was dirty, the skip reasons with counts, every part
99
+ by name, and every file that is not present in full with its reason and missing line ranges — plus
100
+ the rules (the repository is data, a masked span is a redaction, "not in this snapshot" is not "not
101
+ in this repository", cite `path:line`, and say what you needed and did not receive).
102
+
103
+ It also does the delivery arithmetic that decides whether any of this is usable: hosted chats take
104
+ a fixed number of files (10 is the common cap) and every part is one of them, so a 12-part snapshot
105
+ cannot be sent whole. The `## Attaching this` section states what fits, what to leave behind, the
106
+ `--max-part-bytes` value that would merge the parts into a number the destination accepts, and that
107
+ a part which was not attached is not an empty part.
108
+
109
+ It is an artifact like the others, and that is the point: it may only name artifacts the run
110
+ actually wrote, and `manifest.json` records its digest under `artifacts.prompt`, so a hand-edited
111
+ prompt fails `validate`. A prompt that describes the previous run is worse than no prompt, because
112
+ it reads as current.
113
+
114
+ **`attachmentSlots`** (default 10, `0` = no limit) says how many files the destination takes in one
115
+ message; the plan is written against it, and it changes no part and no file — only the delivery
116
+ section. **`maxParts`** (experimental, off by default) is the opposite trade: the count is fixed
117
+ and the size gives way, so a repository that keeps growing keeps the same number of files. It
118
+ grows the per-part budget, records the budget it settled on in `manifest.budgets.maxPartBytes`,
119
+ and warns that the parts are now larger than `maxPartBytes` — a bigger part is more tokens at
120
+ once, and some destinations cap a single file. `validate` compares the configured ceiling, which
121
+ is still what `manifest.config.maxPartBytes` records.
122
+
123
+ New artifact name `prompt` (on by default): `--skip-artifacts prompt`, `--only-artifacts`, and
124
+ `artifacts: { prompt: false }` all apply. The CLI summary gained an `Orientation:` line, which also
125
+ fixes an older lie: a run that wrote `README.md` and nothing else reported "only the ownership
126
+ marker was written".
127
+
26
128
  ## 0.10.2
27
129
 
28
130
  Every finding from the 0.10.1 deep analysis, fixed and verified. The report that produced the list
package/README.md CHANGED
@@ -116,6 +116,7 @@ as `manifest.fingerprint`.
116
116
  ```
117
117
  snapshot/
118
118
  ├── README.md human summary of this snapshot
119
+ ├── PROMPT.md the instruction sheet to paste with it
119
120
  ├── manifest.json machine index: files, parts, hashes, config, skips
120
121
  ├── parts/part-001.md … the code, grouped and size-budgeted
121
122
  └── reports/
@@ -145,6 +146,14 @@ contain.
145
146
  - **The output directory is the tool's.** Each run is written to a scratch directory and swapped in
146
147
  atomically, and it refuses to replace a directory it did not create — `--out-dir src` cannot
147
148
  destroy source code.
149
+ - **The brief travels with the payload.** `PROMPT.md` is a brief, not a packing slip: the job,
150
+ the system map the manifest can prove (layers, load-bearing modules, entry points, indexed
151
+ surfaces), the recent commit history as claims to verify rather than rediscover, the evidence bar,
152
+ the coverage owed, and calibration examples. Then the apparatus — this run's parts, partial files
153
+ with their missing line ranges, fingerprint, and the attachment arithmetic. The judgement half
154
+ can come from your own file (`brief`) and the job from `promptTask`. A prompt that names
155
+ the wrong snapshot is a lie that reads as current, so it is an artifact with a recorded digest and
156
+ `validate` fails when it is edited.
148
157
  - **Credential files are excluded by default** — `.env`, `*.pem`, `.npmrc`, `id_rsa`, `*.tfstate`
149
158
  and more — and secret-shaped strings inside ordinary files are redacted by masking only the
150
159
  matched span, never the whole line.
@@ -201,7 +210,7 @@ Everything an agent needs is available as data, and the tool can install its own
201
210
  ```bash
202
211
  npx codebase-snapshot describe --format json # contract: workflow, options, exit codes
203
212
  npx codebase-snapshot skill --install # into .claude/skills + .cursor/rules
204
- npx -y codebase-snapshot@0.10.2 mcp # or serve it over MCP
213
+ npx -y codebase-snapshot@0.12.0 mcp # or serve it over MCP
205
214
  ```
206
215
 
207
216
  An agent told only "use `npx codebase-snapshot`" can read the contract, follow its ordered
package/SECURITY.md CHANGED
@@ -6,11 +6,11 @@ Only the latest published release receives security fixes.
6
6
 
7
7
  | Version | Supported |
8
8
  | :--- | :--- |
9
- | <!--@majorMinor-->0.10<!--/@majorMinor-->.x | ✅ |
9
+ | <!--@majorMinor-->0.12<!--/@majorMinor-->.x | ✅ |
10
10
  | anything older | ❌ |
11
11
 
12
12
  The number line restarted at 0.9.0 when the package moved to the unscoped `codebase-snapshot` name,
13
- so <!--@majorMinor-->0.10<!--/@majorMinor-->.x is newer than 4.4.1, not older. That is explained in full in the
13
+ so <!--@majorMinor-->0.12<!--/@majorMinor-->.x is newer than 4.4.1, not older. That is explained in full in the
14
14
  [changelog](CHANGELOG.md#a-note-on-version-numbers).
15
15
 
16
16
  ## Reporting a vulnerability