codebase-snapshot 0.12.13 → 0.12.14

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
@@ -26,6 +26,19 @@ deprecated with an explanatory message instead. `latest` has pointed at 0.9.0 si
26
26
 
27
27
  ---
28
28
 
29
+ ## 0.12.14
30
+
31
+ - **A brief written without a manifest still pointed at one.** With `--skip-artifacts manifest`,
32
+ `PROMPT.md` sent the reader to `manifest.skipped[]` for per-path reasons, to "the call graph in
33
+ `manifest.json`" for entry points, and to `manifest.validation.status` for the check — none of
34
+ which existed. `README.md` did the same. Each sentence now says what the run actually wrote.
35
+ - **The attachment arithmetic counted files that were not written.** "1 part plus `manifest.json`,
36
+ `README.md` and the three reports — 6 of 10" became 5 of 10 the moment the manifest was skipped,
37
+ and the list of accompanying files is built from what exists.
38
+
39
+ Both are the same failure as 0.12.12/0.12.13: an artifact describing a run it was not given.
40
+
41
+ Verified: 1 190 tests, 1 182 pass, 0 fail, 8 host skips; every gate clean at 0.12.14.
29
42
  ## 0.12.13
30
43
 
31
44
  - **`README.md` counted a part it had just said was not written.** With `--skip-artifacts parts`,
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.13 mcp # or serve it over MCP
213
+ npx -y codebase-snapshot@0.12.14 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.13";
2194
+ var GENERATOR_VERSION = "0.12.14";
2195
2195
  var SCHEMA_VERSION = "3.0.0";
2196
2196
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
2197
2197
  function isOurGeneratorName(name) {
@@ -10052,6 +10052,10 @@ var MAX_CENTRAL_FILES = 5;
10052
10052
  var MAX_ENTRY_POINTS = 4;
10053
10053
  var MAX_LARGEST_FILES = 3;
10054
10054
  var partWord = (count) => count === 1 ? "part" : "parts";
10055
+ function joinNames(names) {
10056
+ if (names.length <= 1) return names[0] ?? "";
10057
+ return names.slice(0, -1).join(", ") + " and " + names[names.length - 1];
10058
+ }
10055
10059
  var UNLIMITED_SLOTS = 0;
10056
10060
  var ENTRY_POINT = /(^|\/)(index|cli|main|bin|server|app|mod)\.[cm]?[jt]sx?$/;
10057
10061
  var TEST_PATH = /(^|\/)(tests?|__tests__)\//;
@@ -10063,6 +10067,7 @@ function generatePrompt(manifest, artifacts, context = {}) {
10063
10067
  const overview = context.overview ?? { releases: [] };
10064
10068
  const brief = context.brief;
10065
10069
  const wrote = (name) => artifacts?.[name] !== false;
10070
+ const sawManifest = wrote("manifest");
10066
10071
  const code = (value) => inlineCode(escapeControls(value));
10067
10072
  const text2 = (value) => escapeControls(value);
10068
10073
  const hasOwnerHistory = (brief?.history ?? "").trim().length > 0;
@@ -10088,15 +10093,21 @@ function generatePrompt(manifest, artifacts, context = {}) {
10088
10093
  lines.push(...stakesSection(brief, code, text2));
10089
10094
  lines.push(...haveSection(wrote), "");
10090
10095
  lines.push(...whatThisIsSection(overview, text2), "");
10091
- lines.push(...systemSection(manifest, code, brief, text2), "");
10096
+ lines.push(...systemSection(manifest, code, brief, text2, sawManifest), "");
10092
10097
  lines.push(...historySection(history, brief, code, text2), "");
10093
10098
  lines.push(...barSection(brief, code, text2), "");
10094
- lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts")), "");
10099
+ lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts"), sawManifest), "");
10095
10100
  lines.push(...answerSection(), "");
10096
10101
  lines.push(...calibrationSection(brief, code, text2), "");
10097
10102
  lines.push(...ownerNotesSection(brief, code, text2));
10098
10103
  lines.push(...snapshotSection(manifest, code, wrote("parts")), "");
10099
- lines.push(...deliverySection(manifest, wrote("parts"), slots));
10104
+ const accompanying = [];
10105
+ if (wrote("manifest")) accompanying.push("`manifest.json`");
10106
+ if (wrote("readme")) accompanying.push("`README.md`");
10107
+ if (wrote("navigation")) accompanying.push("`reports/navigation.md`");
10108
+ if (wrote("projectTree")) accompanying.push("`reports/project-tree.md`");
10109
+ if (wrote("audit")) accompanying.push("`reports/audit.md`");
10110
+ lines.push(...deliverySection(manifest, wrote("parts"), slots, accompanying));
10100
10111
  lines.push(
10101
10112
  "## Your task",
10102
10113
  "",
@@ -10116,8 +10127,8 @@ function generatePrompt(manifest, artifacts, context = {}) {
10116
10127
  "",
10117
10128
  "## Keeping it true",
10118
10129
  "",
10119
- "- It is one of the artifacts recorded in `manifest.json` under `artifacts.prompt`, so deleting",
10120
- " or editing `PROMPT.md` makes `snapshot validate` fail.",
10130
+ sawManifest ? "- It is one of the artifacts recorded in `manifest.json` under `artifacts.prompt`, so deleting" : "- It is one of the artifacts of this run, so a later check notices it changed \u2014 except that",
10131
+ sawManifest ? " or editing `PROMPT.md` makes `snapshot validate` fail." : " `manifest.json` was not written in this run, so `validate` has nothing to check against.",
10121
10132
  "- `--skip-artifacts prompt`, or `artifacts: { prompt: false }` in the config, turns it off.",
10122
10133
  "- The history section disappears when git cannot be read, rather than being invented.",
10123
10134
  "- If the code moves, regenerate. A brief naming the previous run parts is worse than no",
@@ -10175,7 +10186,7 @@ function haveSection(wrote) {
10175
10186
  out.push(...bullets);
10176
10187
  return out;
10177
10188
  }
10178
- function systemSection(manifest, code, brief, escape) {
10189
+ function systemSection(manifest, code, brief, escape, sawManifest) {
10179
10190
  const out = ["## The system", ""];
10180
10191
  if (brief?.system !== void 0) {
10181
10192
  out.push(...ownerBlock(brief.system, brief.path, code, escape), "", "What the index records:", "");
@@ -10198,7 +10209,11 @@ function systemSection(manifest, code, brief, escape) {
10198
10209
  out.push(
10199
10210
  entryPoints.length > 0 ? "- Entry points by convention: " + entryPoints.map(code).join(", ") + "." : "- No entry point was identifiable by name. The largest files below are where execution"
10200
10211
  );
10201
- if (entryPoints.length === 0) out.push(" starts, and the call graph in `manifest.json` is the map.");
10212
+ if (entryPoints.length === 0) {
10213
+ out.push(
10214
+ sawManifest ? " starts, and the call graph in `manifest.json` is the map." : " starts, and no manifest was written in this run, so the index is not here to read."
10215
+ );
10216
+ }
10202
10217
  const routes = manifest.indexes.routes.length;
10203
10218
  const handlers = manifest.indexes.handlers.length;
10204
10219
  const components = manifest.indexes.components.length;
@@ -10288,7 +10303,7 @@ function barSection(brief, code, text2) {
10288
10303
  " findings; they have different owners and different fixes."
10289
10304
  ];
10290
10305
  }
10291
- function coverageSection(manifest, code, auditWritten, partsWritten) {
10306
+ function coverageSection(manifest, code, auditWritten, partsWritten, sawManifest) {
10292
10307
  const out = ["## Coverage", ""];
10293
10308
  const reasons = /* @__PURE__ */ new Map();
10294
10309
  for (const record of manifest.skipped) {
@@ -10301,7 +10316,7 @@ function coverageSection(manifest, code, auditWritten, partsWritten) {
10301
10316
  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 + ")" : "") + ".";
10302
10317
  out.push(
10303
10318
  "- " + 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."
10319
+ partsWritten ? sawManifest ? " `manifest.skipped[]` names each one and why. An absent path is not a clean path." : " No manifest was written in this run, so the per-path reasons are not in this snapshot." : " The code itself is not in this snapshot: only the index and the reports were written."
10305
10320
  );
10306
10321
  out.push(...incompleteSection(manifest, code));
10307
10322
  out.push(...redactionSection(manifest, auditWritten));
@@ -10438,7 +10453,7 @@ function snapshotSection(manifest, code, partsWritten) {
10438
10453
  manifest.git.isDirty ? " The working tree had uncommitted changes at generation time." : " The working tree was clean at generation time."
10439
10454
  );
10440
10455
  out.push(
10441
- "- Validation: `manifest.validation.status` was " + code(manifest.validation.status) + " at generation time.",
10456
+ "- Validation: the generation-time check was " + code(manifest.validation.status) + ".",
10442
10457
  " That describes the run, not now: if the tree may have moved since, the snapshot is a",
10443
10458
  " claim that needs re-checking, not a fact."
10444
10459
  );
@@ -10499,10 +10514,11 @@ function redactionSection(manifest, auditWritten) {
10499
10514
  " " + where
10500
10515
  ];
10501
10516
  }
10502
- function deliverySection(manifest, partsWritten, slots) {
10517
+ function deliverySection(manifest, partsWritten, slots, others) {
10503
10518
  if (!partsWritten || manifest.parts.length === 0) return [];
10504
10519
  const parts = manifest.parts.length;
10505
- const wholeSet = parts + 5;
10520
+ const wholeSet = parts + others.length;
10521
+ const rest = others.length === 0 ? "and nothing else" : "plus " + joinNames(others);
10506
10522
  const unlimited = slots <= UNLIMITED_SLOTS;
10507
10523
  const out = ["## Attaching this", ""];
10508
10524
  out.push(
@@ -10513,22 +10529,21 @@ function deliverySection(manifest, partsWritten, slots) {
10513
10529
  );
10514
10530
  if (unlimited) {
10515
10531
  out.push(
10516
- "- No attachment limit is configured, so every file can travel: " + parts + " " + partWord(parts) + " plus `manifest.json`, `README.md` and the three reports (" + wholeSet + " files)."
10532
+ "- No attachment limit is configured, so every file can travel: " + parts + " " + partWord(parts) + " " + rest + " (" + wholeSet + " files)."
10517
10533
  );
10518
10534
  } else if (wholeSet <= slots) {
10519
10535
  out.push(
10520
- "- A " + slots + "-file destination carries the whole set: " + parts + " " + partWord(parts) + " plus `manifest.json`, `README.md` and the three reports - " + wholeSet + " of " + slots + "."
10536
+ "- A " + slots + "-file destination carries the whole set: " + parts + " " + partWord(parts) + " " + rest + " - " + wholeSet + " of " + slots + "."
10521
10537
  );
10522
10538
  } else if (parts + 1 <= slots) {
10523
10539
  out.push(
10524
10540
  "- A " + slots + "-file destination carries " + parts + " " + partWord(parts) + " and",
10525
- " `manifest.json` (" + (parts + 1) + " of " + slots + "); `README.md` and",
10526
- " `reports/` stay behind - the brief above carries what they add."
10541
+ " " + (others[0] ?? "one more file") + " (" + (parts + 1) + " of " + slots + "); " + (others.length > 1 ? joinNames(others.slice(1)) + " stay" : "the rest stays") + " behind - the brief above carries what they add."
10527
10542
  );
10528
10543
  } else if (parts <= slots) {
10529
10544
  out.push(
10530
- parts === 1 ? "- The only part fills a " + slots + "-file destination, so `manifest.json` and" : "- The " + parts + " parts fill a " + slots + "-file destination, so `manifest.json` and",
10531
- " `reports/` stay behind. The brief above carries what they add."
10545
+ parts === 1 ? "- The only part fills a " + slots + "-file destination, so " + rest + " stay behind." : "- The " + parts + " parts fill a " + slots + "-file destination, so " + rest + " stay",
10546
+ " behind. The brief above carries what they add."
10532
10547
  );
10533
10548
  if (parts > 1) {
10534
10549
  out.push(
@@ -10660,7 +10675,7 @@ function generateReadme(manifest, artifacts) {
10660
10675
  );
10661
10676
  }
10662
10677
  readOrder.push(
10663
- `${readOrder.length + 1}. Check \`manifest.validation.status\` before trusting the snapshot; \`snapshot validate\` re-checks it against disk.`
10678
+ wrote("manifest") ? `${readOrder.length + 1}. Check \`manifest.validation.status\` before trusting the snapshot; \`snapshot validate\` re-checks it against disk.` : `${readOrder.length + 1}. No manifest was written, so this snapshot cannot be re-checked; regenerate with the manifest artifact enabled before trusting it.`
10664
10679
  );
10665
10680
  lines.push("", "## AI Agent Ingestion Guide", "", ...readOrder, "");
10666
10681
  return lines.join("\n");
@@ -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-32UVARCT.js';
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-UQHIG2KN.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.13";
3996
+ var GENERATOR_VERSION = "0.12.14";
3997
3997
  var SCHEMA_VERSION = "3.0.0";
3998
3998
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
3999
3999
  function isOurGeneratorName(name) {
@@ -6900,6 +6900,10 @@ var MAX_CENTRAL_FILES = 5;
6900
6900
  var MAX_ENTRY_POINTS = 4;
6901
6901
  var MAX_LARGEST_FILES = 3;
6902
6902
  var partWord = (count) => count === 1 ? "part" : "parts";
6903
+ function joinNames(names) {
6904
+ if (names.length <= 1) return names[0] ?? "";
6905
+ return names.slice(0, -1).join(", ") + " and " + names[names.length - 1];
6906
+ }
6903
6907
  var UNLIMITED_SLOTS = 0;
6904
6908
  var ENTRY_POINT = /(^|\/)(index|cli|main|bin|server|app|mod)\.[cm]?[jt]sx?$/;
6905
6909
  var TEST_PATH = /(^|\/)(tests?|__tests__)\//;
@@ -6911,6 +6915,7 @@ function generatePrompt(manifest, artifacts, context = {}) {
6911
6915
  const overview = context.overview ?? { releases: [] };
6912
6916
  const brief = context.brief;
6913
6917
  const wrote = (name) => artifacts?.[name] !== false;
6918
+ const sawManifest = wrote("manifest");
6914
6919
  const code = (value) => inlineCode(escapeControls(value));
6915
6920
  const text2 = (value) => escapeControls(value);
6916
6921
  const hasOwnerHistory = (brief?.history ?? "").trim().length > 0;
@@ -6936,15 +6941,21 @@ function generatePrompt(manifest, artifacts, context = {}) {
6936
6941
  lines.push(...stakesSection(brief, code, text2));
6937
6942
  lines.push(...haveSection(wrote), "");
6938
6943
  lines.push(...whatThisIsSection(overview, text2), "");
6939
- lines.push(...systemSection(manifest, code, brief, text2), "");
6944
+ lines.push(...systemSection(manifest, code, brief, text2, sawManifest), "");
6940
6945
  lines.push(...historySection(history, brief, code, text2), "");
6941
6946
  lines.push(...barSection(brief, code, text2), "");
6942
- lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts")), "");
6947
+ lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts"), sawManifest), "");
6943
6948
  lines.push(...answerSection(), "");
6944
6949
  lines.push(...calibrationSection(brief, code, text2), "");
6945
6950
  lines.push(...ownerNotesSection(brief, code, text2));
6946
6951
  lines.push(...snapshotSection(manifest, code, wrote("parts")), "");
6947
- lines.push(...deliverySection(manifest, wrote("parts"), slots));
6952
+ const accompanying = [];
6953
+ if (wrote("manifest")) accompanying.push("`manifest.json`");
6954
+ if (wrote("readme")) accompanying.push("`README.md`");
6955
+ if (wrote("navigation")) accompanying.push("`reports/navigation.md`");
6956
+ if (wrote("projectTree")) accompanying.push("`reports/project-tree.md`");
6957
+ if (wrote("audit")) accompanying.push("`reports/audit.md`");
6958
+ lines.push(...deliverySection(manifest, wrote("parts"), slots, accompanying));
6948
6959
  lines.push(
6949
6960
  "## Your task",
6950
6961
  "",
@@ -6964,8 +6975,8 @@ function generatePrompt(manifest, artifacts, context = {}) {
6964
6975
  "",
6965
6976
  "## Keeping it true",
6966
6977
  "",
6967
- "- It is one of the artifacts recorded in `manifest.json` under `artifacts.prompt`, so deleting",
6968
- " or editing `PROMPT.md` makes `snapshot validate` fail.",
6978
+ sawManifest ? "- It is one of the artifacts recorded in `manifest.json` under `artifacts.prompt`, so deleting" : "- It is one of the artifacts of this run, so a later check notices it changed \u2014 except that",
6979
+ sawManifest ? " or editing `PROMPT.md` makes `snapshot validate` fail." : " `manifest.json` was not written in this run, so `validate` has nothing to check against.",
6969
6980
  "- `--skip-artifacts prompt`, or `artifacts: { prompt: false }` in the config, turns it off.",
6970
6981
  "- The history section disappears when git cannot be read, rather than being invented.",
6971
6982
  "- If the code moves, regenerate. A brief naming the previous run parts is worse than no",
@@ -7023,7 +7034,7 @@ function haveSection(wrote) {
7023
7034
  out.push(...bullets);
7024
7035
  return out;
7025
7036
  }
7026
- function systemSection(manifest, code, brief, escape) {
7037
+ function systemSection(manifest, code, brief, escape, sawManifest) {
7027
7038
  const out = ["## The system", ""];
7028
7039
  if (brief?.system !== void 0) {
7029
7040
  out.push(...ownerBlock(brief.system, brief.path, code, escape), "", "What the index records:", "");
@@ -7046,7 +7057,11 @@ function systemSection(manifest, code, brief, escape) {
7046
7057
  out.push(
7047
7058
  entryPoints.length > 0 ? "- Entry points by convention: " + entryPoints.map(code).join(", ") + "." : "- No entry point was identifiable by name. The largest files below are where execution"
7048
7059
  );
7049
- if (entryPoints.length === 0) out.push(" starts, and the call graph in `manifest.json` is the map.");
7060
+ if (entryPoints.length === 0) {
7061
+ out.push(
7062
+ sawManifest ? " starts, and the call graph in `manifest.json` is the map." : " starts, and no manifest was written in this run, so the index is not here to read."
7063
+ );
7064
+ }
7050
7065
  const routes = manifest.indexes.routes.length;
7051
7066
  const handlers = manifest.indexes.handlers.length;
7052
7067
  const components = manifest.indexes.components.length;
@@ -7136,7 +7151,7 @@ function barSection(brief, code, text2) {
7136
7151
  " findings; they have different owners and different fixes."
7137
7152
  ];
7138
7153
  }
7139
- function coverageSection(manifest, code, auditWritten, partsWritten) {
7154
+ function coverageSection(manifest, code, auditWritten, partsWritten, sawManifest) {
7140
7155
  const out = ["## Coverage", ""];
7141
7156
  const reasons = /* @__PURE__ */ new Map();
7142
7157
  for (const record of manifest.skipped) {
@@ -7149,7 +7164,7 @@ function coverageSection(manifest, code, auditWritten, partsWritten) {
7149
7164
  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 + ")" : "") + ".";
7150
7165
  out.push(
7151
7166
  "- " + 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."
7167
+ partsWritten ? sawManifest ? " `manifest.skipped[]` names each one and why. An absent path is not a clean path." : " No manifest was written in this run, so the per-path reasons are not in this snapshot." : " The code itself is not in this snapshot: only the index and the reports were written."
7153
7168
  );
7154
7169
  out.push(...incompleteSection(manifest, code));
7155
7170
  out.push(...redactionSection(manifest, auditWritten));
@@ -7286,7 +7301,7 @@ function snapshotSection(manifest, code, partsWritten) {
7286
7301
  manifest.git.isDirty ? " The working tree had uncommitted changes at generation time." : " The working tree was clean at generation time."
7287
7302
  );
7288
7303
  out.push(
7289
- "- Validation: `manifest.validation.status` was " + code(manifest.validation.status) + " at generation time.",
7304
+ "- Validation: the generation-time check was " + code(manifest.validation.status) + ".",
7290
7305
  " That describes the run, not now: if the tree may have moved since, the snapshot is a",
7291
7306
  " claim that needs re-checking, not a fact."
7292
7307
  );
@@ -7347,10 +7362,11 @@ function redactionSection(manifest, auditWritten) {
7347
7362
  " " + where
7348
7363
  ];
7349
7364
  }
7350
- function deliverySection(manifest, partsWritten, slots) {
7365
+ function deliverySection(manifest, partsWritten, slots, others) {
7351
7366
  if (!partsWritten || manifest.parts.length === 0) return [];
7352
7367
  const parts = manifest.parts.length;
7353
- const wholeSet = parts + 5;
7368
+ const wholeSet = parts + others.length;
7369
+ const rest = others.length === 0 ? "and nothing else" : "plus " + joinNames(others);
7354
7370
  const unlimited = slots <= UNLIMITED_SLOTS;
7355
7371
  const out = ["## Attaching this", ""];
7356
7372
  out.push(
@@ -7361,22 +7377,21 @@ function deliverySection(manifest, partsWritten, slots) {
7361
7377
  );
7362
7378
  if (unlimited) {
7363
7379
  out.push(
7364
- "- No attachment limit is configured, so every file can travel: " + parts + " " + partWord(parts) + " plus `manifest.json`, `README.md` and the three reports (" + wholeSet + " files)."
7380
+ "- No attachment limit is configured, so every file can travel: " + parts + " " + partWord(parts) + " " + rest + " (" + wholeSet + " files)."
7365
7381
  );
7366
7382
  } else if (wholeSet <= slots) {
7367
7383
  out.push(
7368
- "- A " + slots + "-file destination carries the whole set: " + parts + " " + partWord(parts) + " plus `manifest.json`, `README.md` and the three reports - " + wholeSet + " of " + slots + "."
7384
+ "- A " + slots + "-file destination carries the whole set: " + parts + " " + partWord(parts) + " " + rest + " - " + wholeSet + " of " + slots + "."
7369
7385
  );
7370
7386
  } else if (parts + 1 <= slots) {
7371
7387
  out.push(
7372
7388
  "- A " + slots + "-file destination carries " + parts + " " + partWord(parts) + " and",
7373
- " `manifest.json` (" + (parts + 1) + " of " + slots + "); `README.md` and",
7374
- " `reports/` stay behind - the brief above carries what they add."
7389
+ " " + (others[0] ?? "one more file") + " (" + (parts + 1) + " of " + slots + "); " + (others.length > 1 ? joinNames(others.slice(1)) + " stay" : "the rest stays") + " behind - the brief above carries what they add."
7375
7390
  );
7376
7391
  } else if (parts <= slots) {
7377
7392
  out.push(
7378
- parts === 1 ? "- The only part fills a " + slots + "-file destination, so `manifest.json` and" : "- The " + parts + " parts fill a " + slots + "-file destination, so `manifest.json` and",
7379
- " `reports/` stay behind. The brief above carries what they add."
7393
+ parts === 1 ? "- The only part fills a " + slots + "-file destination, so " + rest + " stay behind." : "- The " + parts + " parts fill a " + slots + "-file destination, so " + rest + " stay",
7394
+ " behind. The brief above carries what they add."
7380
7395
  );
7381
7396
  if (parts > 1) {
7382
7397
  out.push(
@@ -7508,7 +7523,7 @@ function generateReadme(manifest, artifacts) {
7508
7523
  );
7509
7524
  }
7510
7525
  readOrder.push(
7511
- `${readOrder.length + 1}. Check \`manifest.validation.status\` before trusting the snapshot; \`snapshot validate\` re-checks it against disk.`
7526
+ wrote("manifest") ? `${readOrder.length + 1}. Check \`manifest.validation.status\` before trusting the snapshot; \`snapshot validate\` re-checks it against disk.` : `${readOrder.length + 1}. No manifest was written, so this snapshot cannot be re-checked; regenerate with the manifest artifact enabled before trusting it.`
7512
7527
  );
7513
7528
  lines.push("", "## AI Agent Ingestion Guide", "", ...readOrder, "");
7514
7529
  return lines.join("\n");
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.13";
2223
+ var GENERATOR_VERSION = "0.12.14";
2224
2224
  var SCHEMA_VERSION = "3.0.0";
2225
2225
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
2226
2226
  function isOurGeneratorName(name) {
@@ -10000,6 +10000,10 @@ var MAX_CENTRAL_FILES = 5;
10000
10000
  var MAX_ENTRY_POINTS = 4;
10001
10001
  var MAX_LARGEST_FILES = 3;
10002
10002
  var partWord = (count) => count === 1 ? "part" : "parts";
10003
+ function joinNames(names) {
10004
+ if (names.length <= 1) return names[0] ?? "";
10005
+ return names.slice(0, -1).join(", ") + " and " + names[names.length - 1];
10006
+ }
10003
10007
  var UNLIMITED_SLOTS = 0;
10004
10008
  var ENTRY_POINT = /(^|\/)(index|cli|main|bin|server|app|mod)\.[cm]?[jt]sx?$/;
10005
10009
  var TEST_PATH = /(^|\/)(tests?|__tests__)\//;
@@ -10011,6 +10015,7 @@ function generatePrompt(manifest, artifacts, context = {}) {
10011
10015
  const overview = context.overview ?? { releases: [] };
10012
10016
  const brief = context.brief;
10013
10017
  const wrote = (name) => artifacts?.[name] !== false;
10018
+ const sawManifest = wrote("manifest");
10014
10019
  const code = (value) => inlineCode(escapeControls(value));
10015
10020
  const text2 = (value) => escapeControls(value);
10016
10021
  const hasOwnerHistory = (brief?.history ?? "").trim().length > 0;
@@ -10036,15 +10041,21 @@ function generatePrompt(manifest, artifacts, context = {}) {
10036
10041
  lines.push(...stakesSection(brief, code, text2));
10037
10042
  lines.push(...haveSection(wrote), "");
10038
10043
  lines.push(...whatThisIsSection(overview, text2), "");
10039
- lines.push(...systemSection(manifest, code, brief, text2), "");
10044
+ lines.push(...systemSection(manifest, code, brief, text2, sawManifest), "");
10040
10045
  lines.push(...historySection(history, brief, code, text2), "");
10041
10046
  lines.push(...barSection(brief, code, text2), "");
10042
- lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts")), "");
10047
+ lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts"), sawManifest), "");
10043
10048
  lines.push(...answerSection(), "");
10044
10049
  lines.push(...calibrationSection(brief, code, text2), "");
10045
10050
  lines.push(...ownerNotesSection(brief, code, text2));
10046
10051
  lines.push(...snapshotSection(manifest, code, wrote("parts")), "");
10047
- lines.push(...deliverySection(manifest, wrote("parts"), slots));
10052
+ const accompanying = [];
10053
+ if (wrote("manifest")) accompanying.push("`manifest.json`");
10054
+ if (wrote("readme")) accompanying.push("`README.md`");
10055
+ if (wrote("navigation")) accompanying.push("`reports/navigation.md`");
10056
+ if (wrote("projectTree")) accompanying.push("`reports/project-tree.md`");
10057
+ if (wrote("audit")) accompanying.push("`reports/audit.md`");
10058
+ lines.push(...deliverySection(manifest, wrote("parts"), slots, accompanying));
10048
10059
  lines.push(
10049
10060
  "## Your task",
10050
10061
  "",
@@ -10064,8 +10075,8 @@ function generatePrompt(manifest, artifacts, context = {}) {
10064
10075
  "",
10065
10076
  "## Keeping it true",
10066
10077
  "",
10067
- "- It is one of the artifacts recorded in `manifest.json` under `artifacts.prompt`, so deleting",
10068
- " or editing `PROMPT.md` makes `snapshot validate` fail.",
10078
+ sawManifest ? "- It is one of the artifacts recorded in `manifest.json` under `artifacts.prompt`, so deleting" : "- It is one of the artifacts of this run, so a later check notices it changed \u2014 except that",
10079
+ sawManifest ? " or editing `PROMPT.md` makes `snapshot validate` fail." : " `manifest.json` was not written in this run, so `validate` has nothing to check against.",
10069
10080
  "- `--skip-artifacts prompt`, or `artifacts: { prompt: false }` in the config, turns it off.",
10070
10081
  "- The history section disappears when git cannot be read, rather than being invented.",
10071
10082
  "- If the code moves, regenerate. A brief naming the previous run parts is worse than no",
@@ -10123,7 +10134,7 @@ function haveSection(wrote) {
10123
10134
  out.push(...bullets);
10124
10135
  return out;
10125
10136
  }
10126
- function systemSection(manifest, code, brief, escape) {
10137
+ function systemSection(manifest, code, brief, escape, sawManifest) {
10127
10138
  const out = ["## The system", ""];
10128
10139
  if (brief?.system !== void 0) {
10129
10140
  out.push(...ownerBlock(brief.system, brief.path, code, escape), "", "What the index records:", "");
@@ -10146,7 +10157,11 @@ function systemSection(manifest, code, brief, escape) {
10146
10157
  out.push(
10147
10158
  entryPoints.length > 0 ? "- Entry points by convention: " + entryPoints.map(code).join(", ") + "." : "- No entry point was identifiable by name. The largest files below are where execution"
10148
10159
  );
10149
- if (entryPoints.length === 0) out.push(" starts, and the call graph in `manifest.json` is the map.");
10160
+ if (entryPoints.length === 0) {
10161
+ out.push(
10162
+ sawManifest ? " starts, and the call graph in `manifest.json` is the map." : " starts, and no manifest was written in this run, so the index is not here to read."
10163
+ );
10164
+ }
10150
10165
  const routes = manifest.indexes.routes.length;
10151
10166
  const handlers = manifest.indexes.handlers.length;
10152
10167
  const components = manifest.indexes.components.length;
@@ -10236,7 +10251,7 @@ function barSection(brief, code, text2) {
10236
10251
  " findings; they have different owners and different fixes."
10237
10252
  ];
10238
10253
  }
10239
- function coverageSection(manifest, code, auditWritten, partsWritten) {
10254
+ function coverageSection(manifest, code, auditWritten, partsWritten, sawManifest) {
10240
10255
  const out = ["## Coverage", ""];
10241
10256
  const reasons = /* @__PURE__ */ new Map();
10242
10257
  for (const record of manifest.skipped) {
@@ -10249,7 +10264,7 @@ function coverageSection(manifest, code, auditWritten, partsWritten) {
10249
10264
  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 + ")" : "") + ".";
10250
10265
  out.push(
10251
10266
  "- " + 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."
10267
+ partsWritten ? sawManifest ? " `manifest.skipped[]` names each one and why. An absent path is not a clean path." : " No manifest was written in this run, so the per-path reasons are not in this snapshot." : " The code itself is not in this snapshot: only the index and the reports were written."
10253
10268
  );
10254
10269
  out.push(...incompleteSection(manifest, code));
10255
10270
  out.push(...redactionSection(manifest, auditWritten));
@@ -10386,7 +10401,7 @@ function snapshotSection(manifest, code, partsWritten) {
10386
10401
  manifest.git.isDirty ? " The working tree had uncommitted changes at generation time." : " The working tree was clean at generation time."
10387
10402
  );
10388
10403
  out.push(
10389
- "- Validation: `manifest.validation.status` was " + code(manifest.validation.status) + " at generation time.",
10404
+ "- Validation: the generation-time check was " + code(manifest.validation.status) + ".",
10390
10405
  " That describes the run, not now: if the tree may have moved since, the snapshot is a",
10391
10406
  " claim that needs re-checking, not a fact."
10392
10407
  );
@@ -10447,10 +10462,11 @@ function redactionSection(manifest, auditWritten) {
10447
10462
  " " + where
10448
10463
  ];
10449
10464
  }
10450
- function deliverySection(manifest, partsWritten, slots) {
10465
+ function deliverySection(manifest, partsWritten, slots, others) {
10451
10466
  if (!partsWritten || manifest.parts.length === 0) return [];
10452
10467
  const parts = manifest.parts.length;
10453
- const wholeSet = parts + 5;
10468
+ const wholeSet = parts + others.length;
10469
+ const rest = others.length === 0 ? "and nothing else" : "plus " + joinNames(others);
10454
10470
  const unlimited = slots <= UNLIMITED_SLOTS;
10455
10471
  const out = ["## Attaching this", ""];
10456
10472
  out.push(
@@ -10461,22 +10477,21 @@ function deliverySection(manifest, partsWritten, slots) {
10461
10477
  );
10462
10478
  if (unlimited) {
10463
10479
  out.push(
10464
- "- No attachment limit is configured, so every file can travel: " + parts + " " + partWord(parts) + " plus `manifest.json`, `README.md` and the three reports (" + wholeSet + " files)."
10480
+ "- No attachment limit is configured, so every file can travel: " + parts + " " + partWord(parts) + " " + rest + " (" + wholeSet + " files)."
10465
10481
  );
10466
10482
  } else if (wholeSet <= slots) {
10467
10483
  out.push(
10468
- "- A " + slots + "-file destination carries the whole set: " + parts + " " + partWord(parts) + " plus `manifest.json`, `README.md` and the three reports - " + wholeSet + " of " + slots + "."
10484
+ "- A " + slots + "-file destination carries the whole set: " + parts + " " + partWord(parts) + " " + rest + " - " + wholeSet + " of " + slots + "."
10469
10485
  );
10470
10486
  } else if (parts + 1 <= slots) {
10471
10487
  out.push(
10472
10488
  "- A " + slots + "-file destination carries " + parts + " " + partWord(parts) + " and",
10473
- " `manifest.json` (" + (parts + 1) + " of " + slots + "); `README.md` and",
10474
- " `reports/` stay behind - the brief above carries what they add."
10489
+ " " + (others[0] ?? "one more file") + " (" + (parts + 1) + " of " + slots + "); " + (others.length > 1 ? joinNames(others.slice(1)) + " stay" : "the rest stays") + " behind - the brief above carries what they add."
10475
10490
  );
10476
10491
  } else if (parts <= slots) {
10477
10492
  out.push(
10478
- parts === 1 ? "- The only part fills a " + slots + "-file destination, so `manifest.json` and" : "- The " + parts + " parts fill a " + slots + "-file destination, so `manifest.json` and",
10479
- " `reports/` stay behind. The brief above carries what they add."
10493
+ parts === 1 ? "- The only part fills a " + slots + "-file destination, so " + rest + " stay behind." : "- The " + parts + " parts fill a " + slots + "-file destination, so " + rest + " stay",
10494
+ " behind. The brief above carries what they add."
10480
10495
  );
10481
10496
  if (parts > 1) {
10482
10497
  out.push(
@@ -10608,7 +10623,7 @@ function generateReadme(manifest, artifacts) {
10608
10623
  );
10609
10624
  }
10610
10625
  readOrder.push(
10611
- `${readOrder.length + 1}. Check \`manifest.validation.status\` before trusting the snapshot; \`snapshot validate\` re-checks it against disk.`
10626
+ wrote("manifest") ? `${readOrder.length + 1}. Check \`manifest.validation.status\` before trusting the snapshot; \`snapshot validate\` re-checks it against disk.` : `${readOrder.length + 1}. No manifest was written, so this snapshot cannot be re-checked; regenerate with the manifest artifact enabled before trusting it.`
10612
10627
  );
10613
10628
  lines.push("", "## AI Agent Ingestion Guide", "", ...readOrder, "");
10614
10629
  return lines.join("\n");
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
- import { buildAgentContract, runStdioServer, COMMAND_OPTION_SCOPE, commandsForOption, SKILL_NAME, renderSkill, renderContractText } from './chunk-7GZR5IKG.js';
2
- export { buildAgentContract } from './chunk-7GZR5IKG.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-32UVARCT.js';
1
+ import { buildAgentContract, runStdioServer, COMMAND_OPTION_SCOPE, commandsForOption, SKILL_NAME, renderSkill, renderContractText } from './chunk-6EGIFYWK.js';
2
+ export { buildAgentContract } from './chunk-6EGIFYWK.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-UQHIG2KN.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.13";
4013
+ var GENERATOR_VERSION = "0.12.14";
4014
4014
  var SCHEMA_VERSION = "3.0.0";
4015
4015
  var LEGACY_GENERATOR_NAMES = ["@ankurhalder/codebase-snapshot"];
4016
4016
  function isOurGeneratorName(name) {
@@ -6895,6 +6895,10 @@ var MAX_CENTRAL_FILES = 5;
6895
6895
  var MAX_ENTRY_POINTS = 4;
6896
6896
  var MAX_LARGEST_FILES = 3;
6897
6897
  var partWord = (count) => count === 1 ? "part" : "parts";
6898
+ function joinNames(names) {
6899
+ if (names.length <= 1) return names[0] ?? "";
6900
+ return names.slice(0, -1).join(", ") + " and " + names[names.length - 1];
6901
+ }
6898
6902
  var UNLIMITED_SLOTS = 0;
6899
6903
  var ENTRY_POINT = /(^|\/)(index|cli|main|bin|server|app|mod)\.[cm]?[jt]sx?$/;
6900
6904
  var TEST_PATH = /(^|\/)(tests?|__tests__)\//;
@@ -6906,6 +6910,7 @@ function generatePrompt(manifest, artifacts, context = {}) {
6906
6910
  const overview = context.overview ?? { releases: [] };
6907
6911
  const brief = context.brief;
6908
6912
  const wrote = (name) => artifacts?.[name] !== false;
6913
+ const sawManifest = wrote("manifest");
6909
6914
  const code = (value) => inlineCode(escapeControls(value));
6910
6915
  const text2 = (value) => escapeControls(value);
6911
6916
  const hasOwnerHistory = (brief?.history ?? "").trim().length > 0;
@@ -6931,15 +6936,21 @@ function generatePrompt(manifest, artifacts, context = {}) {
6931
6936
  lines.push(...stakesSection(brief, code, text2));
6932
6937
  lines.push(...haveSection(wrote), "");
6933
6938
  lines.push(...whatThisIsSection(overview, text2), "");
6934
- lines.push(...systemSection(manifest, code, brief, text2), "");
6939
+ lines.push(...systemSection(manifest, code, brief, text2, sawManifest), "");
6935
6940
  lines.push(...historySection(history, brief, code, text2), "");
6936
6941
  lines.push(...barSection(brief, code, text2), "");
6937
- lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts")), "");
6942
+ lines.push(...coverageSection(manifest, code, wrote("audit"), wrote("parts"), sawManifest), "");
6938
6943
  lines.push(...answerSection(), "");
6939
6944
  lines.push(...calibrationSection(brief, code, text2), "");
6940
6945
  lines.push(...ownerNotesSection(brief, code, text2));
6941
6946
  lines.push(...snapshotSection(manifest, code, wrote("parts")), "");
6942
- lines.push(...deliverySection(manifest, wrote("parts"), slots));
6947
+ const accompanying = [];
6948
+ if (wrote("manifest")) accompanying.push("`manifest.json`");
6949
+ if (wrote("readme")) accompanying.push("`README.md`");
6950
+ if (wrote("navigation")) accompanying.push("`reports/navigation.md`");
6951
+ if (wrote("projectTree")) accompanying.push("`reports/project-tree.md`");
6952
+ if (wrote("audit")) accompanying.push("`reports/audit.md`");
6953
+ lines.push(...deliverySection(manifest, wrote("parts"), slots, accompanying));
6943
6954
  lines.push(
6944
6955
  "## Your task",
6945
6956
  "",
@@ -6959,8 +6970,8 @@ function generatePrompt(manifest, artifacts, context = {}) {
6959
6970
  "",
6960
6971
  "## Keeping it true",
6961
6972
  "",
6962
- "- It is one of the artifacts recorded in `manifest.json` under `artifacts.prompt`, so deleting",
6963
- " or editing `PROMPT.md` makes `snapshot validate` fail.",
6973
+ sawManifest ? "- It is one of the artifacts recorded in `manifest.json` under `artifacts.prompt`, so deleting" : "- It is one of the artifacts of this run, so a later check notices it changed \u2014 except that",
6974
+ sawManifest ? " or editing `PROMPT.md` makes `snapshot validate` fail." : " `manifest.json` was not written in this run, so `validate` has nothing to check against.",
6964
6975
  "- `--skip-artifacts prompt`, or `artifacts: { prompt: false }` in the config, turns it off.",
6965
6976
  "- The history section disappears when git cannot be read, rather than being invented.",
6966
6977
  "- If the code moves, regenerate. A brief naming the previous run parts is worse than no",
@@ -7018,7 +7029,7 @@ function haveSection(wrote) {
7018
7029
  out.push(...bullets);
7019
7030
  return out;
7020
7031
  }
7021
- function systemSection(manifest, code, brief, escape) {
7032
+ function systemSection(manifest, code, brief, escape, sawManifest) {
7022
7033
  const out = ["## The system", ""];
7023
7034
  if (brief?.system !== void 0) {
7024
7035
  out.push(...ownerBlock(brief.system, brief.path, code, escape), "", "What the index records:", "");
@@ -7041,7 +7052,11 @@ function systemSection(manifest, code, brief, escape) {
7041
7052
  out.push(
7042
7053
  entryPoints.length > 0 ? "- Entry points by convention: " + entryPoints.map(code).join(", ") + "." : "- No entry point was identifiable by name. The largest files below are where execution"
7043
7054
  );
7044
- if (entryPoints.length === 0) out.push(" starts, and the call graph in `manifest.json` is the map.");
7055
+ if (entryPoints.length === 0) {
7056
+ out.push(
7057
+ sawManifest ? " starts, and the call graph in `manifest.json` is the map." : " starts, and no manifest was written in this run, so the index is not here to read."
7058
+ );
7059
+ }
7045
7060
  const routes = manifest.indexes.routes.length;
7046
7061
  const handlers = manifest.indexes.handlers.length;
7047
7062
  const components = manifest.indexes.components.length;
@@ -7131,7 +7146,7 @@ function barSection(brief, code, text2) {
7131
7146
  " findings; they have different owners and different fixes."
7132
7147
  ];
7133
7148
  }
7134
- function coverageSection(manifest, code, auditWritten, partsWritten) {
7149
+ function coverageSection(manifest, code, auditWritten, partsWritten, sawManifest) {
7135
7150
  const out = ["## Coverage", ""];
7136
7151
  const reasons = /* @__PURE__ */ new Map();
7137
7152
  for (const record of manifest.skipped) {
@@ -7144,7 +7159,7 @@ function coverageSection(manifest, code, auditWritten, partsWritten) {
7144
7159
  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 + ")" : "") + ".";
7145
7160
  out.push(
7146
7161
  "- " + 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."
7162
+ partsWritten ? sawManifest ? " `manifest.skipped[]` names each one and why. An absent path is not a clean path." : " No manifest was written in this run, so the per-path reasons are not in this snapshot." : " The code itself is not in this snapshot: only the index and the reports were written."
7148
7163
  );
7149
7164
  out.push(...incompleteSection(manifest, code));
7150
7165
  out.push(...redactionSection(manifest, auditWritten));
@@ -7281,7 +7296,7 @@ function snapshotSection(manifest, code, partsWritten) {
7281
7296
  manifest.git.isDirty ? " The working tree had uncommitted changes at generation time." : " The working tree was clean at generation time."
7282
7297
  );
7283
7298
  out.push(
7284
- "- Validation: `manifest.validation.status` was " + code(manifest.validation.status) + " at generation time.",
7299
+ "- Validation: the generation-time check was " + code(manifest.validation.status) + ".",
7285
7300
  " That describes the run, not now: if the tree may have moved since, the snapshot is a",
7286
7301
  " claim that needs re-checking, not a fact."
7287
7302
  );
@@ -7342,10 +7357,11 @@ function redactionSection(manifest, auditWritten) {
7342
7357
  " " + where
7343
7358
  ];
7344
7359
  }
7345
- function deliverySection(manifest, partsWritten, slots) {
7360
+ function deliverySection(manifest, partsWritten, slots, others) {
7346
7361
  if (!partsWritten || manifest.parts.length === 0) return [];
7347
7362
  const parts = manifest.parts.length;
7348
- const wholeSet = parts + 5;
7363
+ const wholeSet = parts + others.length;
7364
+ const rest = others.length === 0 ? "and nothing else" : "plus " + joinNames(others);
7349
7365
  const unlimited = slots <= UNLIMITED_SLOTS;
7350
7366
  const out = ["## Attaching this", ""];
7351
7367
  out.push(
@@ -7356,22 +7372,21 @@ function deliverySection(manifest, partsWritten, slots) {
7356
7372
  );
7357
7373
  if (unlimited) {
7358
7374
  out.push(
7359
- "- No attachment limit is configured, so every file can travel: " + parts + " " + partWord(parts) + " plus `manifest.json`, `README.md` and the three reports (" + wholeSet + " files)."
7375
+ "- No attachment limit is configured, so every file can travel: " + parts + " " + partWord(parts) + " " + rest + " (" + wholeSet + " files)."
7360
7376
  );
7361
7377
  } else if (wholeSet <= slots) {
7362
7378
  out.push(
7363
- "- A " + slots + "-file destination carries the whole set: " + parts + " " + partWord(parts) + " plus `manifest.json`, `README.md` and the three reports - " + wholeSet + " of " + slots + "."
7379
+ "- A " + slots + "-file destination carries the whole set: " + parts + " " + partWord(parts) + " " + rest + " - " + wholeSet + " of " + slots + "."
7364
7380
  );
7365
7381
  } else if (parts + 1 <= slots) {
7366
7382
  out.push(
7367
7383
  "- A " + slots + "-file destination carries " + parts + " " + partWord(parts) + " and",
7368
- " `manifest.json` (" + (parts + 1) + " of " + slots + "); `README.md` and",
7369
- " `reports/` stay behind - the brief above carries what they add."
7384
+ " " + (others[0] ?? "one more file") + " (" + (parts + 1) + " of " + slots + "); " + (others.length > 1 ? joinNames(others.slice(1)) + " stay" : "the rest stays") + " behind - the brief above carries what they add."
7370
7385
  );
7371
7386
  } else if (parts <= slots) {
7372
7387
  out.push(
7373
- parts === 1 ? "- The only part fills a " + slots + "-file destination, so `manifest.json` and" : "- The " + parts + " parts fill a " + slots + "-file destination, so `manifest.json` and",
7374
- " `reports/` stay behind. The brief above carries what they add."
7388
+ parts === 1 ? "- The only part fills a " + slots + "-file destination, so " + rest + " stay behind." : "- The " + parts + " parts fill a " + slots + "-file destination, so " + rest + " stay",
7389
+ " behind. The brief above carries what they add."
7375
7390
  );
7376
7391
  if (parts > 1) {
7377
7392
  out.push(
@@ -7503,7 +7518,7 @@ function generateReadme(manifest, artifacts) {
7503
7518
  );
7504
7519
  }
7505
7520
  readOrder.push(
7506
- `${readOrder.length + 1}. Check \`manifest.validation.status\` before trusting the snapshot; \`snapshot validate\` re-checks it against disk.`
7521
+ wrote("manifest") ? `${readOrder.length + 1}. Check \`manifest.validation.status\` before trusting the snapshot; \`snapshot validate\` re-checks it against disk.` : `${readOrder.length + 1}. No manifest was written, so this snapshot cannot be re-checked; regenerate with the manifest artifact enabled before trusting it.`
7507
7522
  );
7508
7523
  lines.push("", "## AI Agent Ingestion Guide", "", ...readOrder, "");
7509
7524
  return lines.join("\n");
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.13";
551
+ declare const GENERATOR_VERSION = "0.12.14";
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.13";
551
+ declare const GENERATOR_VERSION = "0.12.14";
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-32UVARCT.js';
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-UQHIG2KN.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.13";
2549
+ var GENERATOR_VERSION = "0.12.14";
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-7GZR5IKG.js';
2
- export { generateInWorker } from './chunk-32UVARCT.js';
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-6EGIFYWK.js';
2
+ export { generateInWorker } from './chunk-UQHIG2KN.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.13 (project dependency ^0.12.13)
100
+ Branch: main | Part budget: 300 KB | Generator: 0.12.14 (project dependency ^0.12.14)
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.13
195
+ Added devDependency: codebase-snapshot ^0.12.14
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.13
247
+ Added devDependency: codebase-snapshot ^0.12.14
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 mcp
13
+ npx -y codebase-snapshot@0.12.14 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.13", "mcp", "--cwd", "/absolute/path/to/repo"]
28
+ "args": ["-y", "codebase-snapshot@0.12.14", "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.13 mcp --cwd /absolute/path/to/repo
37
+ claude mcp add codebase-snapshot -- npx -y codebase-snapshot@0.12.14 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.13",
3
+ "version": "0.12.14",
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",