codebase-snapshot 0.12.11 → 0.12.12
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 +14 -0
- package/README.md +1 -1
- package/dist/bin.js +19 -10
- package/dist/{chunk-RH3B2CJU.js → chunk-7YBN2KMT.js} +1 -1
- package/dist/{chunk-XODWBL4O.js → chunk-GNKUHRLS.js} +19 -10
- package/dist/cli.cjs +19 -10
- package/dist/cli.js +3 -3
- package/dist/index.cjs +19 -10
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp.cjs +1 -1
- package/dist/mcp.js +2 -2
- package/docs/cli.md +3 -3
- package/docs/mcp.md +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -26,6 +26,20 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
|
|
|
26
26
|
|
|
27
27
|
---
|
|
28
28
|
|
|
29
|
+
## 0.12.12
|
|
30
|
+
|
|
31
|
+
- **A brief written without parts described parts that were never written.** With
|
|
32
|
+
`--skip-artifacts parts`, `PROMPT.md` said "Paste this file first, then the parts it names",
|
|
33
|
+
listed `part-001.md` under "Parts: 1 at a 300 KB ceiling", claimed the files "are in the parts",
|
|
34
|
+
and pointed at `reports/navigation.md` to "locate here before you read anything" — while zero
|
|
35
|
+
part files existed. The manifest records the partition either way (`files[].part` needs it), so
|
|
36
|
+
the brief now says what happened: no part files were written, the index still records the
|
|
37
|
+
planned partition, and the code itself is not in the snapshot.
|
|
38
|
+
|
|
39
|
+
`docs/output.md` had claimed since 0.11.0 that `--skip-artifacts parts,audit` produces a brief that
|
|
40
|
+
does not tell a model to read parts. It does now.
|
|
41
|
+
|
|
42
|
+
Verified: 1 189 tests, 1 181 pass, 0 fail, 8 host skips; every gate clean at 0.12.12.
|
|
29
43
|
## 0.12.11
|
|
30
44
|
|
|
31
45
|
- **`setup` wrote the scaffold and did not mention it.** `init` said "Wrote BRIEF.md …"; `setup`,
|
package/README.md
CHANGED
|
@@ -210,7 +210,7 @@ Everything an agent needs is available as data, and the tool can install its own
|
|
|
210
210
|
```bash
|
|
211
211
|
npx codebase-snapshot describe --format json # contract: workflow, options, exit codes
|
|
212
212
|
npx codebase-snapshot skill --install # into .claude/skills + .cursor/rules
|
|
213
|
-
npx -y codebase-snapshot@0.12.
|
|
213
|
+
npx -y codebase-snapshot@0.12.12 mcp # or serve it over MCP
|
|
214
214
|
```
|
|
215
215
|
|
|
216
216
|
An agent told only "use `npx codebase-snapshot`" can read the contract, follow its ordered
|
package/dist/bin.js
CHANGED
|
@@ -2191,7 +2191,7 @@ function applySpansKeepingQuotes(line, spans) {
|
|
|
2191
2191
|
|
|
2192
2192
|
// src/version.ts
|
|
2193
2193
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
2194
|
-
var GENERATOR_VERSION = "0.12.
|
|
2194
|
+
var GENERATOR_VERSION = "0.12.12";
|
|
2195
2195
|
var SCHEMA_VERSION = "3.0.0";
|
|
2196
2196
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
2197
2197
|
function isOurGeneratorName(name) {
|
|
@@ -10069,7 +10069,7 @@ function generatePrompt(manifest, artifacts, context = {}) {
|
|
|
10069
10069
|
const lines = [
|
|
10070
10070
|
"# PROMPT.md",
|
|
10071
10071
|
"",
|
|
10072
|
-
"The brief and the apparatus for this snapshot. Paste this file first, then the parts it names.",
|
|
10072
|
+
wrote("parts") ? "The brief and the apparatus for this snapshot. Paste this file first, then the parts it names." : "The brief and the apparatus for this snapshot. Paste this file first; this run wrote no parts, and the brief says what it did write.",
|
|
10073
10073
|
"",
|
|
10074
10074
|
"It is generated rather than written once: the system map, the omissions, the fingerprint and",
|
|
10075
10075
|
"the history below are read from `manifest.json` and this repository, so they describe this run.",
|
|
@@ -10091,11 +10091,11 @@ function generatePrompt(manifest, artifacts, context = {}) {
|
|
|
10091
10091
|
lines.push(...systemSection(manifest, code, brief, text2), "");
|
|
10092
10092
|
lines.push(...historySection(history, brief, code, text2), "");
|
|
10093
10093
|
lines.push(...barSection(brief, code, text2), "");
|
|
10094
|
-
lines.push(...coverageSection(manifest, code, wrote("audit")), "");
|
|
10094
|
+
lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts")), "");
|
|
10095
10095
|
lines.push(...answerSection(), "");
|
|
10096
10096
|
lines.push(...calibrationSection(brief, code, text2), "");
|
|
10097
10097
|
lines.push(...ownerNotesSection(brief, code, text2));
|
|
10098
|
-
lines.push(...snapshotSection(manifest, code), "");
|
|
10098
|
+
lines.push(...snapshotSection(manifest, code, wrote("parts")), "");
|
|
10099
10099
|
lines.push(...deliverySection(manifest, wrote("parts"), slots));
|
|
10100
10100
|
lines.push(
|
|
10101
10101
|
"## Your task",
|
|
@@ -10141,7 +10141,9 @@ function haveSection(wrote) {
|
|
|
10141
10141
|
);
|
|
10142
10142
|
}
|
|
10143
10143
|
if (wrote("navigation")) {
|
|
10144
|
-
bullets.push(
|
|
10144
|
+
bullets.push(
|
|
10145
|
+
wrote("parts") ? "- `reports/navigation.md` - file to part. Locate here before you read anything." : "- `reports/navigation.md` - file to part. Its links point at part files that were not written in this run, so it locates files rather than files you were given."
|
|
10146
|
+
);
|
|
10145
10147
|
}
|
|
10146
10148
|
if (wrote("projectTree")) {
|
|
10147
10149
|
bullets.push("- `reports/project-tree.md` - the directory shape of what was included.");
|
|
@@ -10286,7 +10288,7 @@ function barSection(brief, code, text2) {
|
|
|
10286
10288
|
" findings; they have different owners and different fixes."
|
|
10287
10289
|
];
|
|
10288
10290
|
}
|
|
10289
|
-
function coverageSection(manifest, code, auditWritten) {
|
|
10291
|
+
function coverageSection(manifest, code, auditWritten, partsWritten) {
|
|
10290
10292
|
const out = ["## Coverage", ""];
|
|
10291
10293
|
const reasons = /* @__PURE__ */ new Map();
|
|
10292
10294
|
for (const record of manifest.skipped) {
|
|
@@ -10296,9 +10298,10 @@ function coverageSection(manifest, code, auditWritten) {
|
|
|
10296
10298
|
const found = manifest.totals.candidateFiles;
|
|
10297
10299
|
const included = manifest.totals.includedFiles;
|
|
10298
10300
|
const skipped = manifest.counts.skippedCount;
|
|
10301
|
+
const counted = formatNumber(found) + (found === 1 ? " path was" : " paths were") + " found; " + (partsWritten ? formatNumber(included) + (included === 1 ? " is" : " are") + " in the parts" : formatNumber(included) + (included === 1 ? " was" : " were") + " partitioned, but no part file was written") + " and " + formatNumber(skipped) + (skipped === 1 ? " was" : " were") + " skipped" + (tally.length > 0 ? " (" + tally + ")" : "") + ".";
|
|
10299
10302
|
out.push(
|
|
10300
|
-
"- " +
|
|
10301
|
-
" `manifest.skipped[]` names each one and why. An absent path is not a clean path."
|
|
10303
|
+
"- " + counted,
|
|
10304
|
+
partsWritten ? " `manifest.skipped[]` names each one and why. An absent path is not a clean path." : " The code itself is not in this snapshot: only the index and the reports were written."
|
|
10302
10305
|
);
|
|
10303
10306
|
out.push(...incompleteSection(manifest, code));
|
|
10304
10307
|
out.push(...redactionSection(manifest, auditWritten));
|
|
@@ -10425,7 +10428,7 @@ function ownerNotesSection(brief, code, text2) {
|
|
|
10425
10428
|
function ownerBlock(body, path23, code, escape) {
|
|
10426
10429
|
return ["> Written by the project owner in " + code(path23) + ", not generated.", "", escape(body)];
|
|
10427
10430
|
}
|
|
10428
|
-
function snapshotSection(manifest, code) {
|
|
10431
|
+
function snapshotSection(manifest, code, partsWritten) {
|
|
10429
10432
|
const out = ["## This snapshot", ""];
|
|
10430
10433
|
out.push("- Fingerprint: " + code(manifest.fingerprint) + " - quote it verbatim in your answer.");
|
|
10431
10434
|
out.push(
|
|
@@ -10439,7 +10442,13 @@ function snapshotSection(manifest, code) {
|
|
|
10439
10442
|
" That describes the run, not now: if the tree may have moved since, the snapshot is a",
|
|
10440
10443
|
" claim that needs re-checking, not a fact."
|
|
10441
10444
|
);
|
|
10442
|
-
if (
|
|
10445
|
+
if (!partsWritten) {
|
|
10446
|
+
out.push(
|
|
10447
|
+
"- No part files were written: the `parts` artifact was disabled for this run.",
|
|
10448
|
+
" `manifest.parts[]` still records the partition that was planned, so the index lines up",
|
|
10449
|
+
" with `files[].part`; the code itself is not in this snapshot."
|
|
10450
|
+
);
|
|
10451
|
+
} else if (manifest.parts.length > 0) {
|
|
10443
10452
|
out.push(
|
|
10444
10453
|
"- Parts: " + formatNumber(manifest.parts.length) + " at a " + formatNumber(Math.round(manifest.budgets.maxPartBytes / 1024)) + " KB ceiling" + (manifest.parts.length === 1 ? ":" : " each:")
|
|
10445
10454
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GENERATOR_VERSION, anchorForPath, displayPath, MIN_MAX_PART_BYTES, SCHEMA_VERSION, GENERATOR_NAME, ARTIFACT_NAMES, PRESETS, generateInWorker, validateSnapshot, buildImportResolver, resolveSpecifier, truncateToBytes, explainPath, renderExplainText, describeManifestShapeProblem, loadConfigFileDetailed, parseByteSize, resolveConfig } from './chunk-
|
|
1
|
+
import { GENERATOR_VERSION, anchorForPath, displayPath, MIN_MAX_PART_BYTES, SCHEMA_VERSION, GENERATOR_NAME, ARTIFACT_NAMES, PRESETS, generateInWorker, validateSnapshot, buildImportResolver, resolveSpecifier, truncateToBytes, explainPath, renderExplainText, describeManifestShapeProblem, loadConfigFileDetailed, parseByteSize, resolveConfig } from './chunk-GNKUHRLS.js';
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import * as path from 'path';
|
|
4
4
|
|
|
@@ -3993,7 +3993,7 @@ function applySpansKeepingQuotes(line, spans) {
|
|
|
3993
3993
|
|
|
3994
3994
|
// src/version.ts
|
|
3995
3995
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
3996
|
-
var GENERATOR_VERSION = "0.12.
|
|
3996
|
+
var GENERATOR_VERSION = "0.12.12";
|
|
3997
3997
|
var SCHEMA_VERSION = "3.0.0";
|
|
3998
3998
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
3999
3999
|
function isOurGeneratorName(name) {
|
|
@@ -6917,7 +6917,7 @@ function generatePrompt(manifest, artifacts, context = {}) {
|
|
|
6917
6917
|
const lines = [
|
|
6918
6918
|
"# PROMPT.md",
|
|
6919
6919
|
"",
|
|
6920
|
-
"The brief and the apparatus for this snapshot. Paste this file first, then the parts it names.",
|
|
6920
|
+
wrote("parts") ? "The brief and the apparatus for this snapshot. Paste this file first, then the parts it names." : "The brief and the apparatus for this snapshot. Paste this file first; this run wrote no parts, and the brief says what it did write.",
|
|
6921
6921
|
"",
|
|
6922
6922
|
"It is generated rather than written once: the system map, the omissions, the fingerprint and",
|
|
6923
6923
|
"the history below are read from `manifest.json` and this repository, so they describe this run.",
|
|
@@ -6939,11 +6939,11 @@ function generatePrompt(manifest, artifacts, context = {}) {
|
|
|
6939
6939
|
lines.push(...systemSection(manifest, code, brief, text2), "");
|
|
6940
6940
|
lines.push(...historySection(history, brief, code, text2), "");
|
|
6941
6941
|
lines.push(...barSection(brief, code, text2), "");
|
|
6942
|
-
lines.push(...coverageSection(manifest, code, wrote("audit")), "");
|
|
6942
|
+
lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts")), "");
|
|
6943
6943
|
lines.push(...answerSection(), "");
|
|
6944
6944
|
lines.push(...calibrationSection(brief, code, text2), "");
|
|
6945
6945
|
lines.push(...ownerNotesSection(brief, code, text2));
|
|
6946
|
-
lines.push(...snapshotSection(manifest, code), "");
|
|
6946
|
+
lines.push(...snapshotSection(manifest, code, wrote("parts")), "");
|
|
6947
6947
|
lines.push(...deliverySection(manifest, wrote("parts"), slots));
|
|
6948
6948
|
lines.push(
|
|
6949
6949
|
"## Your task",
|
|
@@ -6989,7 +6989,9 @@ function haveSection(wrote) {
|
|
|
6989
6989
|
);
|
|
6990
6990
|
}
|
|
6991
6991
|
if (wrote("navigation")) {
|
|
6992
|
-
bullets.push(
|
|
6992
|
+
bullets.push(
|
|
6993
|
+
wrote("parts") ? "- `reports/navigation.md` - file to part. Locate here before you read anything." : "- `reports/navigation.md` - file to part. Its links point at part files that were not written in this run, so it locates files rather than files you were given."
|
|
6994
|
+
);
|
|
6993
6995
|
}
|
|
6994
6996
|
if (wrote("projectTree")) {
|
|
6995
6997
|
bullets.push("- `reports/project-tree.md` - the directory shape of what was included.");
|
|
@@ -7134,7 +7136,7 @@ function barSection(brief, code, text2) {
|
|
|
7134
7136
|
" findings; they have different owners and different fixes."
|
|
7135
7137
|
];
|
|
7136
7138
|
}
|
|
7137
|
-
function coverageSection(manifest, code, auditWritten) {
|
|
7139
|
+
function coverageSection(manifest, code, auditWritten, partsWritten) {
|
|
7138
7140
|
const out = ["## Coverage", ""];
|
|
7139
7141
|
const reasons = /* @__PURE__ */ new Map();
|
|
7140
7142
|
for (const record of manifest.skipped) {
|
|
@@ -7144,9 +7146,10 @@ function coverageSection(manifest, code, auditWritten) {
|
|
|
7144
7146
|
const found = manifest.totals.candidateFiles;
|
|
7145
7147
|
const included = manifest.totals.includedFiles;
|
|
7146
7148
|
const skipped = manifest.counts.skippedCount;
|
|
7149
|
+
const counted = formatNumber(found) + (found === 1 ? " path was" : " paths were") + " found; " + (partsWritten ? formatNumber(included) + (included === 1 ? " is" : " are") + " in the parts" : formatNumber(included) + (included === 1 ? " was" : " were") + " partitioned, but no part file was written") + " and " + formatNumber(skipped) + (skipped === 1 ? " was" : " were") + " skipped" + (tally.length > 0 ? " (" + tally + ")" : "") + ".";
|
|
7147
7150
|
out.push(
|
|
7148
|
-
"- " +
|
|
7149
|
-
" `manifest.skipped[]` names each one and why. An absent path is not a clean path."
|
|
7151
|
+
"- " + counted,
|
|
7152
|
+
partsWritten ? " `manifest.skipped[]` names each one and why. An absent path is not a clean path." : " The code itself is not in this snapshot: only the index and the reports were written."
|
|
7150
7153
|
);
|
|
7151
7154
|
out.push(...incompleteSection(manifest, code));
|
|
7152
7155
|
out.push(...redactionSection(manifest, auditWritten));
|
|
@@ -7273,7 +7276,7 @@ function ownerNotesSection(brief, code, text2) {
|
|
|
7273
7276
|
function ownerBlock(body, path18, code, escape) {
|
|
7274
7277
|
return ["> Written by the project owner in " + code(path18) + ", not generated.", "", escape(body)];
|
|
7275
7278
|
}
|
|
7276
|
-
function snapshotSection(manifest, code) {
|
|
7279
|
+
function snapshotSection(manifest, code, partsWritten) {
|
|
7277
7280
|
const out = ["## This snapshot", ""];
|
|
7278
7281
|
out.push("- Fingerprint: " + code(manifest.fingerprint) + " - quote it verbatim in your answer.");
|
|
7279
7282
|
out.push(
|
|
@@ -7287,7 +7290,13 @@ function snapshotSection(manifest, code) {
|
|
|
7287
7290
|
" That describes the run, not now: if the tree may have moved since, the snapshot is a",
|
|
7288
7291
|
" claim that needs re-checking, not a fact."
|
|
7289
7292
|
);
|
|
7290
|
-
if (
|
|
7293
|
+
if (!partsWritten) {
|
|
7294
|
+
out.push(
|
|
7295
|
+
"- No part files were written: the `parts` artifact was disabled for this run.",
|
|
7296
|
+
" `manifest.parts[]` still records the partition that was planned, so the index lines up",
|
|
7297
|
+
" with `files[].part`; the code itself is not in this snapshot."
|
|
7298
|
+
);
|
|
7299
|
+
} else if (manifest.parts.length > 0) {
|
|
7291
7300
|
out.push(
|
|
7292
7301
|
"- Parts: " + formatNumber(manifest.parts.length) + " at a " + formatNumber(Math.round(manifest.budgets.maxPartBytes / 1024)) + " KB ceiling" + (manifest.parts.length === 1 ? ":" : " each:")
|
|
7293
7302
|
);
|
package/dist/cli.cjs
CHANGED
|
@@ -2220,7 +2220,7 @@ function applySpansKeepingQuotes(line, spans) {
|
|
|
2220
2220
|
|
|
2221
2221
|
// src/version.ts
|
|
2222
2222
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
2223
|
-
var GENERATOR_VERSION = "0.12.
|
|
2223
|
+
var GENERATOR_VERSION = "0.12.12";
|
|
2224
2224
|
var SCHEMA_VERSION = "3.0.0";
|
|
2225
2225
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
2226
2226
|
function isOurGeneratorName(name) {
|
|
@@ -10017,7 +10017,7 @@ function generatePrompt(manifest, artifacts, context = {}) {
|
|
|
10017
10017
|
const lines = [
|
|
10018
10018
|
"# PROMPT.md",
|
|
10019
10019
|
"",
|
|
10020
|
-
"The brief and the apparatus for this snapshot. Paste this file first, then the parts it names.",
|
|
10020
|
+
wrote("parts") ? "The brief and the apparatus for this snapshot. Paste this file first, then the parts it names." : "The brief and the apparatus for this snapshot. Paste this file first; this run wrote no parts, and the brief says what it did write.",
|
|
10021
10021
|
"",
|
|
10022
10022
|
"It is generated rather than written once: the system map, the omissions, the fingerprint and",
|
|
10023
10023
|
"the history below are read from `manifest.json` and this repository, so they describe this run.",
|
|
@@ -10039,11 +10039,11 @@ function generatePrompt(manifest, artifacts, context = {}) {
|
|
|
10039
10039
|
lines.push(...systemSection(manifest, code, brief, text2), "");
|
|
10040
10040
|
lines.push(...historySection(history, brief, code, text2), "");
|
|
10041
10041
|
lines.push(...barSection(brief, code, text2), "");
|
|
10042
|
-
lines.push(...coverageSection(manifest, code, wrote("audit")), "");
|
|
10042
|
+
lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts")), "");
|
|
10043
10043
|
lines.push(...answerSection(), "");
|
|
10044
10044
|
lines.push(...calibrationSection(brief, code, text2), "");
|
|
10045
10045
|
lines.push(...ownerNotesSection(brief, code, text2));
|
|
10046
|
-
lines.push(...snapshotSection(manifest, code), "");
|
|
10046
|
+
lines.push(...snapshotSection(manifest, code, wrote("parts")), "");
|
|
10047
10047
|
lines.push(...deliverySection(manifest, wrote("parts"), slots));
|
|
10048
10048
|
lines.push(
|
|
10049
10049
|
"## Your task",
|
|
@@ -10089,7 +10089,9 @@ function haveSection(wrote) {
|
|
|
10089
10089
|
);
|
|
10090
10090
|
}
|
|
10091
10091
|
if (wrote("navigation")) {
|
|
10092
|
-
bullets.push(
|
|
10092
|
+
bullets.push(
|
|
10093
|
+
wrote("parts") ? "- `reports/navigation.md` - file to part. Locate here before you read anything." : "- `reports/navigation.md` - file to part. Its links point at part files that were not written in this run, so it locates files rather than files you were given."
|
|
10094
|
+
);
|
|
10093
10095
|
}
|
|
10094
10096
|
if (wrote("projectTree")) {
|
|
10095
10097
|
bullets.push("- `reports/project-tree.md` - the directory shape of what was included.");
|
|
@@ -10234,7 +10236,7 @@ function barSection(brief, code, text2) {
|
|
|
10234
10236
|
" findings; they have different owners and different fixes."
|
|
10235
10237
|
];
|
|
10236
10238
|
}
|
|
10237
|
-
function coverageSection(manifest, code, auditWritten) {
|
|
10239
|
+
function coverageSection(manifest, code, auditWritten, partsWritten) {
|
|
10238
10240
|
const out = ["## Coverage", ""];
|
|
10239
10241
|
const reasons = /* @__PURE__ */ new Map();
|
|
10240
10242
|
for (const record of manifest.skipped) {
|
|
@@ -10244,9 +10246,10 @@ function coverageSection(manifest, code, auditWritten) {
|
|
|
10244
10246
|
const found = manifest.totals.candidateFiles;
|
|
10245
10247
|
const included = manifest.totals.includedFiles;
|
|
10246
10248
|
const skipped = manifest.counts.skippedCount;
|
|
10249
|
+
const counted = formatNumber(found) + (found === 1 ? " path was" : " paths were") + " found; " + (partsWritten ? formatNumber(included) + (included === 1 ? " is" : " are") + " in the parts" : formatNumber(included) + (included === 1 ? " was" : " were") + " partitioned, but no part file was written") + " and " + formatNumber(skipped) + (skipped === 1 ? " was" : " were") + " skipped" + (tally.length > 0 ? " (" + tally + ")" : "") + ".";
|
|
10247
10250
|
out.push(
|
|
10248
|
-
"- " +
|
|
10249
|
-
" `manifest.skipped[]` names each one and why. An absent path is not a clean path."
|
|
10251
|
+
"- " + counted,
|
|
10252
|
+
partsWritten ? " `manifest.skipped[]` names each one and why. An absent path is not a clean path." : " The code itself is not in this snapshot: only the index and the reports were written."
|
|
10250
10253
|
);
|
|
10251
10254
|
out.push(...incompleteSection(manifest, code));
|
|
10252
10255
|
out.push(...redactionSection(manifest, auditWritten));
|
|
@@ -10373,7 +10376,7 @@ function ownerNotesSection(brief, code, text2) {
|
|
|
10373
10376
|
function ownerBlock(body, path23, code, escape) {
|
|
10374
10377
|
return ["> Written by the project owner in " + code(path23) + ", not generated.", "", escape(body)];
|
|
10375
10378
|
}
|
|
10376
|
-
function snapshotSection(manifest, code) {
|
|
10379
|
+
function snapshotSection(manifest, code, partsWritten) {
|
|
10377
10380
|
const out = ["## This snapshot", ""];
|
|
10378
10381
|
out.push("- Fingerprint: " + code(manifest.fingerprint) + " - quote it verbatim in your answer.");
|
|
10379
10382
|
out.push(
|
|
@@ -10387,7 +10390,13 @@ function snapshotSection(manifest, code) {
|
|
|
10387
10390
|
" That describes the run, not now: if the tree may have moved since, the snapshot is a",
|
|
10388
10391
|
" claim that needs re-checking, not a fact."
|
|
10389
10392
|
);
|
|
10390
|
-
if (
|
|
10393
|
+
if (!partsWritten) {
|
|
10394
|
+
out.push(
|
|
10395
|
+
"- No part files were written: the `parts` artifact was disabled for this run.",
|
|
10396
|
+
" `manifest.parts[]` still records the partition that was planned, so the index lines up",
|
|
10397
|
+
" with `files[].part`; the code itself is not in this snapshot."
|
|
10398
|
+
);
|
|
10399
|
+
} else if (manifest.parts.length > 0) {
|
|
10391
10400
|
out.push(
|
|
10392
10401
|
"- Parts: " + formatNumber(manifest.parts.length) + " at a " + formatNumber(Math.round(manifest.budgets.maxPartBytes / 1024)) + " KB ceiling" + (manifest.parts.length === 1 ? ":" : " each:")
|
|
10393
10402
|
);
|
package/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { buildAgentContract, runStdioServer, COMMAND_OPTION_SCOPE, commandsForOption, SKILL_NAME, renderSkill, renderContractText } from './chunk-
|
|
2
|
-
export { buildAgentContract } from './chunk-
|
|
3
|
-
import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, loadConfigFileDetailed, resolveConfig, validateSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, installPreCommitHook, PromptCancelled, findConfigFile, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, firstRunMessage, stripJsonComments, parseByteSize, gitignorePath, appendGitignoreEntries, runWithStdoutCapture, escapeControls, MIN_MAX_PART_TOKENS, MIN_MAX_PART_BYTES, renderExplainText } from './chunk-
|
|
1
|
+
import { buildAgentContract, runStdioServer, COMMAND_OPTION_SCOPE, commandsForOption, SKILL_NAME, renderSkill, renderContractText } from './chunk-7YBN2KMT.js';
|
|
2
|
+
export { buildAgentContract } from './chunk-7YBN2KMT.js';
|
|
3
|
+
import { shouldCheck, checkForUpdate, GENERATOR_VERSION, cacheFilePath, formatUpdateNotice, installKind, loadConfigFileDetailed, resolveConfig, validateSnapshot, describeManifestShapeProblem, explainPath, compareManifests, loadManifest, renderDiffText, generateSnapshot, formatNumber, isDiscoveryMode, ARTIFACT_NAMES, getPreset, unknownPresetMessage, GENERATOR_NAME, runInit, installPreCommitHook, PromptCancelled, findConfigFile, planFirstRun, isEffectivelyEmpty, isInteractive, defaultIO, hasPriorSnapshot, DEFAULT_ANSWERS, firstRunMessage, stripJsonComments, parseByteSize, gitignorePath, appendGitignoreEntries, runWithStdoutCapture, escapeControls, MIN_MAX_PART_TOKENS, MIN_MAX_PART_BYTES, renderExplainText } from './chunk-GNKUHRLS.js';
|
|
4
4
|
import { spawnSync } from 'child_process';
|
|
5
5
|
import * as fs2 from 'fs';
|
|
6
6
|
import * as path2 from 'path';
|
package/dist/index.cjs
CHANGED
|
@@ -4010,7 +4010,7 @@ function applySpansKeepingQuotes(line, spans) {
|
|
|
4010
4010
|
|
|
4011
4011
|
// src/version.ts
|
|
4012
4012
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
4013
|
-
var GENERATOR_VERSION = "0.12.
|
|
4013
|
+
var GENERATOR_VERSION = "0.12.12";
|
|
4014
4014
|
var SCHEMA_VERSION = "3.0.0";
|
|
4015
4015
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
4016
4016
|
function isOurGeneratorName(name) {
|
|
@@ -6912,7 +6912,7 @@ function generatePrompt(manifest, artifacts, context = {}) {
|
|
|
6912
6912
|
const lines = [
|
|
6913
6913
|
"# PROMPT.md",
|
|
6914
6914
|
"",
|
|
6915
|
-
"The brief and the apparatus for this snapshot. Paste this file first, then the parts it names.",
|
|
6915
|
+
wrote("parts") ? "The brief and the apparatus for this snapshot. Paste this file first, then the parts it names." : "The brief and the apparatus for this snapshot. Paste this file first; this run wrote no parts, and the brief says what it did write.",
|
|
6916
6916
|
"",
|
|
6917
6917
|
"It is generated rather than written once: the system map, the omissions, the fingerprint and",
|
|
6918
6918
|
"the history below are read from `manifest.json` and this repository, so they describe this run.",
|
|
@@ -6934,11 +6934,11 @@ function generatePrompt(manifest, artifacts, context = {}) {
|
|
|
6934
6934
|
lines.push(...systemSection(manifest, code, brief, text2), "");
|
|
6935
6935
|
lines.push(...historySection(history, brief, code, text2), "");
|
|
6936
6936
|
lines.push(...barSection(brief, code, text2), "");
|
|
6937
|
-
lines.push(...coverageSection(manifest, code, wrote("audit")), "");
|
|
6937
|
+
lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts")), "");
|
|
6938
6938
|
lines.push(...answerSection(), "");
|
|
6939
6939
|
lines.push(...calibrationSection(brief, code, text2), "");
|
|
6940
6940
|
lines.push(...ownerNotesSection(brief, code, text2));
|
|
6941
|
-
lines.push(...snapshotSection(manifest, code), "");
|
|
6941
|
+
lines.push(...snapshotSection(manifest, code, wrote("parts")), "");
|
|
6942
6942
|
lines.push(...deliverySection(manifest, wrote("parts"), slots));
|
|
6943
6943
|
lines.push(
|
|
6944
6944
|
"## Your task",
|
|
@@ -6984,7 +6984,9 @@ function haveSection(wrote) {
|
|
|
6984
6984
|
);
|
|
6985
6985
|
}
|
|
6986
6986
|
if (wrote("navigation")) {
|
|
6987
|
-
bullets.push(
|
|
6987
|
+
bullets.push(
|
|
6988
|
+
wrote("parts") ? "- `reports/navigation.md` - file to part. Locate here before you read anything." : "- `reports/navigation.md` - file to part. Its links point at part files that were not written in this run, so it locates files rather than files you were given."
|
|
6989
|
+
);
|
|
6988
6990
|
}
|
|
6989
6991
|
if (wrote("projectTree")) {
|
|
6990
6992
|
bullets.push("- `reports/project-tree.md` - the directory shape of what was included.");
|
|
@@ -7129,7 +7131,7 @@ function barSection(brief, code, text2) {
|
|
|
7129
7131
|
" findings; they have different owners and different fixes."
|
|
7130
7132
|
];
|
|
7131
7133
|
}
|
|
7132
|
-
function coverageSection(manifest, code, auditWritten) {
|
|
7134
|
+
function coverageSection(manifest, code, auditWritten, partsWritten) {
|
|
7133
7135
|
const out = ["## Coverage", ""];
|
|
7134
7136
|
const reasons = /* @__PURE__ */ new Map();
|
|
7135
7137
|
for (const record of manifest.skipped) {
|
|
@@ -7139,9 +7141,10 @@ function coverageSection(manifest, code, auditWritten) {
|
|
|
7139
7141
|
const found = manifest.totals.candidateFiles;
|
|
7140
7142
|
const included = manifest.totals.includedFiles;
|
|
7141
7143
|
const skipped = manifest.counts.skippedCount;
|
|
7144
|
+
const counted = formatNumber(found) + (found === 1 ? " path was" : " paths were") + " found; " + (partsWritten ? formatNumber(included) + (included === 1 ? " is" : " are") + " in the parts" : formatNumber(included) + (included === 1 ? " was" : " were") + " partitioned, but no part file was written") + " and " + formatNumber(skipped) + (skipped === 1 ? " was" : " were") + " skipped" + (tally.length > 0 ? " (" + tally + ")" : "") + ".";
|
|
7142
7145
|
out.push(
|
|
7143
|
-
"- " +
|
|
7144
|
-
" `manifest.skipped[]` names each one and why. An absent path is not a clean path."
|
|
7146
|
+
"- " + counted,
|
|
7147
|
+
partsWritten ? " `manifest.skipped[]` names each one and why. An absent path is not a clean path." : " The code itself is not in this snapshot: only the index and the reports were written."
|
|
7145
7148
|
);
|
|
7146
7149
|
out.push(...incompleteSection(manifest, code));
|
|
7147
7150
|
out.push(...redactionSection(manifest, auditWritten));
|
|
@@ -7268,7 +7271,7 @@ function ownerNotesSection(brief, code, text2) {
|
|
|
7268
7271
|
function ownerBlock(body, path18, code, escape) {
|
|
7269
7272
|
return ["> Written by the project owner in " + code(path18) + ", not generated.", "", escape(body)];
|
|
7270
7273
|
}
|
|
7271
|
-
function snapshotSection(manifest, code) {
|
|
7274
|
+
function snapshotSection(manifest, code, partsWritten) {
|
|
7272
7275
|
const out = ["## This snapshot", ""];
|
|
7273
7276
|
out.push("- Fingerprint: " + code(manifest.fingerprint) + " - quote it verbatim in your answer.");
|
|
7274
7277
|
out.push(
|
|
@@ -7282,7 +7285,13 @@ function snapshotSection(manifest, code) {
|
|
|
7282
7285
|
" That describes the run, not now: if the tree may have moved since, the snapshot is a",
|
|
7283
7286
|
" claim that needs re-checking, not a fact."
|
|
7284
7287
|
);
|
|
7285
|
-
if (
|
|
7288
|
+
if (!partsWritten) {
|
|
7289
|
+
out.push(
|
|
7290
|
+
"- No part files were written: the `parts` artifact was disabled for this run.",
|
|
7291
|
+
" `manifest.parts[]` still records the partition that was planned, so the index lines up",
|
|
7292
|
+
" with `files[].part`; the code itself is not in this snapshot."
|
|
7293
|
+
);
|
|
7294
|
+
} else if (manifest.parts.length > 0) {
|
|
7286
7295
|
out.push(
|
|
7287
7296
|
"- Parts: " + formatNumber(manifest.parts.length) + " at a " + formatNumber(Math.round(manifest.budgets.maxPartBytes / 1024)) + " KB ceiling" + (manifest.parts.length === 1 ? ":" : " each:")
|
|
7288
7297
|
);
|
package/dist/index.d.cts
CHANGED
|
@@ -548,7 +548,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
|
|
|
548
548
|
* `package.json` carries the same version; `npm run verify` compares the two.
|
|
549
549
|
*/
|
|
550
550
|
declare const GENERATOR_NAME = "codebase-snapshot";
|
|
551
|
-
declare const GENERATOR_VERSION = "0.12.
|
|
551
|
+
declare const GENERATOR_VERSION = "0.12.12";
|
|
552
552
|
/**
|
|
553
553
|
* The manifest and ownership-marker schema this build writes and understands.
|
|
554
554
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -548,7 +548,7 @@ declare function validateSnapshot(configInput: ResolvedSnapshotConfig | Snapshot
|
|
|
548
548
|
* `package.json` carries the same version; `npm run verify` compares the two.
|
|
549
549
|
*/
|
|
550
550
|
declare const GENERATOR_NAME = "codebase-snapshot";
|
|
551
|
-
declare const GENERATOR_VERSION = "0.12.
|
|
551
|
+
declare const GENERATOR_VERSION = "0.12.12";
|
|
552
552
|
/**
|
|
553
553
|
* The manifest and ownership-marker schema this build writes and understands.
|
|
554
554
|
*
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ARTIFACT_NAMES, CHECK_INTERVAL_MS, CONFIG_KEYS, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, FAILURE_INTERVAL_MS, GENERATOR_NAME, GENERATOR_VERSION, HOOK_MARKER, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, MIN_MAX_PART_TOKENS, PACKAGE_LATEST_URL, PRESETS, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, UP_TO_DATE_INTERVAL_MS, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayPath, displayWidth, enforceBudget, estimateTokens, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findSecretInPath, firstRunMessage, formatTokens, formatUpdateNotice, generateProjectTree, generateSarifReport, generateSnapshot, generateSnapshotAsync, getGitInfo, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, importsChangedFile, importsOfFile, importsOfText, installKind, installPreCommitHook, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, treeTruncationWarnings, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, workerEntry, wrapLines } from './chunk-
|
|
1
|
+
export { ARTIFACT_NAMES, CHECK_INTERVAL_MS, CONFIG_KEYS, DEFAULT_ANSWERS, DEFAULT_SECRET_PATTERNS, FAILURE_INTERVAL_MS, GENERATOR_NAME, GENERATOR_VERSION, HOOK_MARKER, LANGUAGE_PROFILES, MIN_MAX_PART_BYTES, MIN_MAX_PART_TOKENS, PACKAGE_LATEST_URL, PRESETS, PromptBack, PromptCancelled, REQUEST_TIMEOUT_MS, SCHEMA_VERSION, UP_TO_DATE_INTERVAL_MS, anchorForPath, appendGitignoreEntries, assertReplaceable, assertUsableConfigInput, buildImportResolver, bytesForTokens, cacheDirectory, cacheFilePath, checkForUpdate, classifyKind, classifyLayer, collectFiles, compareManifests, configDigest, countInvalidUtf8Bytes, countLines, decodeText, defineConfig, detectLanguage, detectPreset, displayPath, displayWidth, enforceBudget, estimateTokens, explainPath, fenceForContent, fenceForText, fetchLatestVersion, findSecretInPath, firstRunMessage, formatTokens, formatUpdateNotice, generateProjectTree, generateSarifReport, generateSnapshot, generateSnapshotAsync, getGitInfo, getPreset, gitignorePath, globToRegExp, hasPriorSnapshot, importsChangedFile, importsOfFile, importsOfText, installKind, installPreCommitHook, isBinaryBuffer, isBinaryExtension, isBinaryFile, isEffectivelyEmpty, isInteractive, isNewer, isResolvedConfig, isSensitivePath, isSkeletonizable, isTsxFileName, listPresetNames, loadConfigFile, loadConfigFileDetailed, loadManifest, lockPathFor, markResolvedConfig, matchRule, matchesExclude, normalizeResolvedConfig, parseByteSize, partitionFiles, planFirstRun, profileForPath, renderConfig, renderDiffText, renderExplainText, renumberParts, resolveChangedScope, resolveConfig, resolveSafeOutputDirs, resolveSpecifier, runInit, scanAndRedactSecrets, shouldCheck, skeletonizeTypeScript, stripJsonComments, summarizeJson, summarizeMarkdown, summarizeTypeScriptSource, summarizeWithProfile, supportsTypeScriptImports, treeTruncationWarnings, truncatePreview, truncateToBytes, tsconfigPathsFor, updateCommand, validateSnapshot, workerEntry, wrapLines } from './chunk-GNKUHRLS.js';
|
package/dist/mcp.cjs
CHANGED
|
@@ -2546,7 +2546,7 @@ function applySpansKeepingQuotes(line, spans) {
|
|
|
2546
2546
|
|
|
2547
2547
|
// src/version.ts
|
|
2548
2548
|
var GENERATOR_NAME = "codebase-snapshot";
|
|
2549
|
-
var GENERATOR_VERSION = "0.12.
|
|
2549
|
+
var GENERATOR_VERSION = "0.12.12";
|
|
2550
2550
|
var SCHEMA_VERSION = "3.0.0";
|
|
2551
2551
|
var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
|
|
2552
2552
|
function isOurGeneratorName(name) {
|
package/dist/mcp.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ERROR_CODES, LEGACY_PROTOCOL_VERSIONS, MAX_LINE_BYTES, METHOD, MODERN_PROTOCOL_VERSIONS, SERVER_INSTRUCTIONS, SUPPORTED_PROTOCOL_VERSIONS, buildPrompts, buildResourceProvider, buildTools, classifyRequest, coerceNumericStrings, createLineReader, createMcpServer, createServer, createSession, createWriter, findSection, inspectModernMeta, negotiateLegacyVersion, parsePartSections, runStdioServer, validateArguments, windowText } from './chunk-
|
|
2
|
-
export { generateInWorker } from './chunk-
|
|
1
|
+
export { ERROR_CODES, LEGACY_PROTOCOL_VERSIONS, MAX_LINE_BYTES, METHOD, MODERN_PROTOCOL_VERSIONS, SERVER_INSTRUCTIONS, SUPPORTED_PROTOCOL_VERSIONS, buildPrompts, buildResourceProvider, buildTools, classifyRequest, coerceNumericStrings, createLineReader, createMcpServer, createServer, createSession, createWriter, findSection, inspectModernMeta, negotiateLegacyVersion, parsePartSections, runStdioServer, validateArguments, windowText } from './chunk-7YBN2KMT.js';
|
|
2
|
+
export { generateInWorker } from './chunk-GNKUHRLS.js';
|
package/docs/cli.md
CHANGED
|
@@ -97,7 +97,7 @@ Exit `0` when the snapshot passes its own integrity check, `1` when it does not.
|
|
|
97
97
|
|
|
98
98
|
```
|
|
99
99
|
📸 Generating snapshot for: /path/to/repo
|
|
100
|
-
Branch: main | Part budget: 300 KB | Generator: 0.12.
|
|
100
|
+
Branch: main | Part budget: 300 KB | Generator: 0.12.12 (project dependency ^0.12.12)
|
|
101
101
|
|
|
102
102
|
✅ Snapshot generated in 0.14s:
|
|
103
103
|
- Tracked files: 121 included of 128 paths found — 7 skipped (default-ignore 5, binary 1, sensitive-file 1); every one is listed in snapshot/reports/audit.md
|
|
@@ -192,7 +192,7 @@ The whole first run in one command, with defaults and no prompts. This is the sa
|
|
|
192
192
|
🚀 Setup for: /path/to/repo
|
|
193
193
|
✅ Created snapshot.config.ts (preset: nextjs)
|
|
194
194
|
Added npm scripts: snapshot, snapshot:validate
|
|
195
|
-
Added devDependency: codebase-snapshot ^0.12.
|
|
195
|
+
Added devDependency: codebase-snapshot ^0.12.12
|
|
196
196
|
Added to .gitignore: /snapshot/, /snapshot.tmp/
|
|
197
197
|
⏳ Installing dependencies…
|
|
198
198
|
✅ Installed dependencies (npm install, 2.1s)
|
|
@@ -244,7 +244,7 @@ It also has three side effects on files you own, and it says so when it does the
|
|
|
244
244
|
```
|
|
245
245
|
✅ Created snapshot.config.ts (preset: node-lib)
|
|
246
246
|
Added npm scripts: snapshot, snapshot:validate
|
|
247
|
-
Added devDependency: codebase-snapshot ^0.12.
|
|
247
|
+
Added devDependency: codebase-snapshot ^0.12.12
|
|
248
248
|
Added to .gitignore: /snapshot/, /snapshot.tmp/
|
|
249
249
|
```
|
|
250
250
|
|
package/docs/mcp.md
CHANGED
|
@@ -10,7 +10,7 @@ walk — that the client sees.
|
|
|
10
10
|
## Start it
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
npx -y codebase-snapshot@0.12.
|
|
13
|
+
npx -y codebase-snapshot@0.12.12 mcp
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
The server serves the directory it was started in. `--cwd <path>` points it elsewhere, and that
|
|
@@ -25,7 +25,7 @@ Claude Desktop and Cursor:
|
|
|
25
25
|
"mcpServers": {
|
|
26
26
|
"codebase-snapshot": {
|
|
27
27
|
"command": "npx",
|
|
28
|
-
"args": ["-y", "codebase-snapshot@0.12.
|
|
28
|
+
"args": ["-y", "codebase-snapshot@0.12.12", "mcp", "--cwd", "/absolute/path/to/repo"]
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -34,7 +34,7 @@ Claude Desktop and Cursor:
|
|
|
34
34
|
Claude Code registers the same thing from a shell:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
claude mcp add codebase-snapshot -- npx -y codebase-snapshot@0.12.
|
|
37
|
+
claude mcp add codebase-snapshot -- npx -y codebase-snapshot@0.12.12 mcp --cwd /absolute/path/to/repo
|
|
38
38
|
```
|
|
39
39
|
|
|
40
40
|
On Windows, wrap the command as `cmd /c npx` with the same arguments — `npx` is a `.cmd` shim
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codebase-snapshot",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.12",
|
|
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",
|