@holmes-lab/holmes-kit 0.32.0 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/CHANGELOG.md +88 -0
  2. package/README.md +3 -1
  3. package/dist/.build-id +1 -1
  4. package/dist/holmes/cli/autonomy.js +15 -1
  5. package/dist/holmes/guardrail/impact-gate.js +50 -1
  6. package/dist/holmes/guardrail/risk-classifier.js +218 -6
  7. package/dist/holmes/hooks/pre-tool-use.d.ts +12 -0
  8. package/dist/holmes/hooks/pre-tool-use.js +55 -2
  9. package/dist/holmes/mcp/handlers/adoption.d.ts +17 -3
  10. package/dist/holmes/mcp/handlers/adoption.js +70 -2
  11. package/dist/holmes/mcp/handlers/graph-operations.js +6 -1
  12. package/dist/holmes/mcp/handlers/maintenance-analysis.js +9 -16
  13. package/dist/holmes/mcp/handlers/phase-queries.d.ts +30 -2
  14. package/dist/holmes/mcp/handlers/phase-queries.js +5 -1
  15. package/dist/holmes/mcp/handlers/review-evidence.d.ts +44 -1
  16. package/dist/holmes/mcp/handlers/review-evidence.js +48 -2
  17. package/dist/holmes/mcp/handlers/spec-approval.d.ts +10 -0
  18. package/dist/holmes/mcp/handlers/spec-approval.js +16 -1
  19. package/dist/holmes/mcp/handlers/spec-queries.d.ts +1 -9
  20. package/dist/holmes/mcp/handlers/spec-queries.js +40 -15
  21. package/dist/holmes/mcp/handlers.d.ts +43 -14
  22. package/dist/holmes/mcp/maintenance-analyze.js +64 -6
  23. package/dist/holmes/mcp/supervisor.d.ts +8 -0
  24. package/dist/holmes/mcp/supervisor.js +32 -2
  25. package/dist/holmes/mcp/tool-schemas.js +26 -5
  26. package/dist/holmes/reverse/scan.d.ts +6 -0
  27. package/dist/holmes/reverse/scan.js +4 -2
  28. package/dist/holmes/review/requirement-triage.d.ts +6 -0
  29. package/dist/holmes/review/requirement-triage.js +78 -9
  30. package/dist/holmes/review/test-outcomes.d.ts +53 -1
  31. package/dist/holmes/review/test-outcomes.js +156 -8
  32. package/dist/holmes/semantic/unreadable-paths.d.ts +30 -0
  33. package/dist/holmes/semantic/unreadable-paths.js +104 -0
  34. package/package.json +1 -1
  35. package/playbooks/author-slice/PLAYBOOK.md +1 -1
  36. package/playbooks/promote-slice/PLAYBOOK.md +1 -1
@@ -33,8 +33,11 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.RELEASE_TEST_LANE_SCHEMA = exports.RELEASE_TEST_LANE_FILE = exports.OUTCOMES_FILE = void 0;
36
+ exports.REQUIRED_DOCS_TESTS = exports.RELEASE_TEST_LANE_FULL_FILE = exports.RELEASE_TEST_LANE_SCHEMA = exports.RELEASE_TEST_LANE_FILE = exports.OUTCOMES_FILE = void 0;
37
37
  exports.writeReleaseTestLaneReceipt = writeReleaseTestLaneReceipt;
38
+ exports.inheritablePaths = inheritablePaths;
39
+ exports.laneGit = laneGit;
40
+ exports.inheritReleaseTestLane = inheritReleaseTestLane;
38
41
  exports.validateReleaseTestLaneReceipt = validateReleaseTestLaneReceipt;
39
42
  exports.outcomesFilename = outcomesFilename;
40
43
  exports.isOutcomesFilename = isOutcomesFilename;
@@ -42,10 +45,11 @@ exports.appendOutcomes = appendOutcomes;
42
45
  exports.readOutcomes = readOutcomes;
43
46
  exports.buildOutcomeRecords = buildOutcomeRecords;
44
47
  exports.groupOutcomesByAspec = groupOutcomesByAspec;
45
- // @implements A-SPEC-724.1, A-SPEC-714, A-SPEC-734
48
+ // @implements A-SPEC-724.1, A-SPEC-714, A-SPEC-734, A-SPEC-748
46
49
  // @implements A-SPEC-534.3, A-SPEC-625
47
50
  // @implements A-SPEC-645
48
51
  const node_crypto_1 = require("node:crypto");
52
+ const node_child_process_1 = require("node:child_process");
49
53
  const execution_context_1 = require("../project/execution-context");
50
54
  const fs = __importStar(require("node:fs"));
51
55
  const path = __importStar(require("node:path"));
@@ -55,10 +59,12 @@ exports.OUTCOMES_FILE = path.join('.ax', 'ledger', 'test-outcomes.jsonl');
55
59
  exports.RELEASE_TEST_LANE_FILE = path.join('.ax', 'evidence', 'release-test-lane.json');
56
60
  exports.RELEASE_TEST_LANE_SCHEMA = 'release-test-lane/1';
57
61
  const RELEASE_TEST_LANE_MAX_AGE_MS = 24 * 60 * 60 * 1000;
62
+ // A full receipt signs exactly what it always signed; `inheritedFrom` is signed only where it exists.
58
63
  const stableReceipt = (receipt) => JSON.stringify({
59
64
  schema: receipt.schema, root: receipt.root, head: receipt.head, completedAt: receipt.completedAt,
60
65
  passed: receipt.passed, externalAccess: receipt.externalAccess, command: receipt.command,
61
66
  include: receipt.include, exclusions: receipt.exclusions,
67
+ ...(receipt.inheritedFrom ? { inheritedFrom: receipt.inheritedFrom } : {}),
62
68
  });
63
69
  const releaseReceiptDigest = (receipt) => `sha256:${(0, node_crypto_1.createHash)('sha256').update(stableReceipt(receipt)).digest('hex')}`;
64
70
  /** Persist only evidence whose scope is explicit and bounded; callers cannot choose its path. */
@@ -68,24 +74,142 @@ function writeReleaseTestLaneReceipt(root, input) {
68
74
  const receipt = normalizeReleaseTestLaneReceipt(root, { ...input, schema: exports.RELEASE_TEST_LANE_SCHEMA });
69
75
  if (receipt === null)
70
76
  return null;
71
- const file = path.join(path.resolve(root), exports.RELEASE_TEST_LANE_FILE);
77
+ if (!writeAtomic(path.join(path.resolve(root), exports.RELEASE_TEST_LANE_FILE), receipt))
78
+ return null;
79
+ // @implements A-SPEC-748 — a FULL lane is also kept as the base later docs-only commits inherit from.
80
+ if (!receipt.inheritedFrom && !writeAtomic(path.join(path.resolve(root), exports.RELEASE_TEST_LANE_FULL_FILE), receipt))
81
+ return null;
82
+ return receipt;
83
+ }
84
+ function writeAtomic(file, receipt) {
72
85
  const tmp = `${file}.${process.pid}.${Date.now()}.tmp`;
73
86
  try {
74
87
  fs.mkdirSync(path.dirname(file), { recursive: true });
75
88
  fs.writeFileSync(tmp, `${JSON.stringify(receipt)}\n`, { encoding: 'utf8', mode: 0o600 });
76
89
  fs.renameSync(tmp, file);
77
- return receipt;
90
+ return true;
78
91
  }
79
92
  catch {
80
93
  try {
81
94
  fs.unlinkSync(tmp);
82
95
  }
83
96
  catch { /* no partial receipt is valid */ }
84
- return null;
97
+ return false;
85
98
  }
86
99
  }
100
+ /** @implements A-SPEC-748 — the last FULL lane receipt, kept beside the current one (git-ignored like it). */
101
+ exports.RELEASE_TEST_LANE_FULL_FILE = path.join('.ax', 'evidence', 'release-test-lane.full.json');
102
+ /**
103
+ * @implements A-SPEC-748 — the tests an inherited receipt runs: every test that reads the repository's own README or
104
+ * docs/, plus the docs-currency, publish-docs-gate and packaging tests. A ratchet test fails when a new reader is missing.
105
+ */
106
+ exports.REQUIRED_DOCS_TESTS = [
107
+ 'src/holmes/project/docs-currency.test.ts',
108
+ 'src/holmes/playbooks/publish-docs-gate.test.ts',
109
+ 'src/holmes/playbooks/packaging.test.ts',
110
+ 'src/holmes/cpg/foundation/language-matrix.test.ts',
111
+ 'src/holmes/project/dependency-overrides.test.ts',
112
+ ];
113
+ /**
114
+ * @implements A-SPEC-748 — every path of every change (both sides of a rename or copy) must be `README.md` or under
115
+ * `docs/`, and none may be shipped (equal to, or under a directory entry of, package.json `files`).
116
+ */
117
+ function inheritablePaths(changes, shipped) {
118
+ const isShipped = (p) => shipped.some((raw) => {
119
+ const e = raw.replace(/\\/g, '/').replace(/^\.\//, '');
120
+ return e.endsWith('/') ? p.startsWith(e) : p === e || p.startsWith(`${e}/`);
121
+ });
122
+ for (const change of changes) {
123
+ for (const raw of change.paths) {
124
+ const p = raw.replace(/\\/g, '/');
125
+ if (!(p === 'README.md' || p.startsWith('docs/')) || isShipped(p))
126
+ return { ok: false, path: p };
127
+ }
128
+ }
129
+ return { ok: true };
130
+ }
131
+ /** @implements A-SPEC-748 — the two git questions inheritance asks, answered by git in `root`; `null`/false when git cannot. */
132
+ function laneGit(root) {
133
+ const run = (args) => {
134
+ const r = (0, node_child_process_1.spawnSync)('git', ['-C', root, ...args], { encoding: 'utf8', timeout: 30_000, maxBuffer: 64 * 1024 * 1024 });
135
+ return { status: r.status, stdout: typeof r.stdout === 'string' ? r.stdout : '' };
136
+ };
137
+ return {
138
+ isAncestor: (base, head) => run(['merge-base', '--is-ancestor', base, head]).status === 0,
139
+ changes: (base, head) => {
140
+ const r = run(['diff', '--name-status', '-M', '-z', base, head]);
141
+ if (r.status !== 0)
142
+ return null;
143
+ const parts = r.stdout.split('\0').filter((s) => s !== '');
144
+ const out = [];
145
+ for (let i = 0; i < parts.length;) {
146
+ const status = parts[i++];
147
+ const n = /^[RC]/.test(status) ? 2 : 1;
148
+ out.push({ status, paths: parts.slice(i, i + n) });
149
+ i += n;
150
+ }
151
+ return out;
152
+ },
153
+ };
154
+ }
155
+ /** @implements A-SPEC-748 — the kept FULL receipt, valid for its own head and not older than the lane's limit. */
156
+ function readFullReceipt(root, now) {
157
+ let parsed;
158
+ try {
159
+ parsed = JSON.parse(fs.readFileSync(path.join(path.resolve(root), exports.RELEASE_TEST_LANE_FULL_FILE), 'utf8'));
160
+ }
161
+ catch {
162
+ return { ok: false, reason: 'no full release test-lane receipt to inherit from — run the full lane (--record-release-test-lane)' };
163
+ }
164
+ const receipt = normalizeReleaseTestLaneReceipt(root, parsed);
165
+ if (receipt === null || receipt.digest !== parsed.digest) {
166
+ return { ok: false, reason: 'the kept full release test-lane receipt is malformed or its digest is invalid' };
167
+ }
168
+ if (receipt.inheritedFrom)
169
+ return { ok: false, reason: 'the kept full receipt is itself inherited — only a full lane can be inherited from' };
170
+ const completedMs = Date.parse(receipt.completedAt);
171
+ if (completedMs > now || now - completedMs > RELEASE_TEST_LANE_MAX_AGE_MS) {
172
+ return { ok: false, reason: 'the kept full release test-lane receipt is older than 24 hours (or in the future)' };
173
+ }
174
+ return { ok: true, receipt };
175
+ }
176
+ /** @implements A-SPEC-748 — whether HEAD may stand on the full receipt: an ancestor, and only inheritable changes since it. */
177
+ function inheritableSince(full, head, git, shipped) {
178
+ if (!git.isAncestor(full.head, head))
179
+ return `the full lane's HEAD ${full.head.slice(0, 12)} is not an ancestor of ${head.slice(0, 12)}`;
180
+ const changes = git.changes(full.head, head);
181
+ if (changes === null)
182
+ return 'git could not list the changes since the full lane';
183
+ const verdict = inheritablePaths(changes, shipped);
184
+ return verdict.ok ? null : `${verdict.path} changed since the full lane — only README.md and unshipped docs/ files may be inherited; run the full lane`;
185
+ }
186
+ /**
187
+ * @implements A-SPEC-748 — record a receipt for HEAD by inheriting the kept full lane receipt: refused unless the full
188
+ * receipt is valid, fresh and an ancestor, every change since it is inheritable, and the required docs tests pass.
189
+ */
190
+ function inheritReleaseTestLane(root, head, opts) {
191
+ const now = opts.now ?? Date.now();
192
+ const full = readFullReceipt(root, now);
193
+ if (!full.ok)
194
+ return full;
195
+ if (full.receipt.head === head)
196
+ return { ok: false, reason: 'HEAD already has the full release test-lane receipt — nothing to inherit' };
197
+ const blocked = inheritableSince(full.receipt, head, opts.git, opts.shipped);
198
+ if (blocked !== null)
199
+ return { ok: false, reason: blocked };
200
+ if (!opts.runDocsTests(exports.REQUIRED_DOCS_TESTS))
201
+ return { ok: false, reason: 'the required docs tests failed — this commit is not published on an inherited receipt' };
202
+ const receipt = writeReleaseTestLaneReceipt(root, {
203
+ root: path.resolve(root), head, completedAt: new Date(now).toISOString(), passed: true, externalAccess: 'forbidden',
204
+ command: ['npm', 'test', '--', '--runInBand', ...exports.REQUIRED_DOCS_TESTS],
205
+ include: ['required docs tests on a docs-only commit, inheriting the full lane'],
206
+ exclusions: full.receipt.exclusions,
207
+ inheritedFrom: { head: full.receipt.head, completedAt: full.receipt.completedAt, digest: full.receipt.digest },
208
+ });
209
+ return receipt === null ? { ok: false, reason: 'the inherited release test-lane receipt could not be written' } : { ok: true, receipt };
210
+ }
87
211
  /** Read the sole project-local receipt and fail closed for every missing or unprovable condition. */
88
- function validateReleaseTestLaneReceipt(root, head, now = Date.now()) {
212
+ function validateReleaseTestLaneReceipt(root, head, now = Date.now(), inherit) {
89
213
  const expectedRoot = path.resolve(root);
90
214
  if (typeof head !== 'string' || head === '' || head.includes('/') || head.includes('\\'))
91
215
  return { valid: false, reason: 'invalid current HEAD' };
@@ -105,6 +229,22 @@ function validateReleaseTestLaneReceipt(root, head, now = Date.now()) {
105
229
  return { valid: false, reason: 'release test-lane receipt belongs to a different root' };
106
230
  if (receipt.head !== head)
107
231
  return { valid: false, reason: 'release test-lane receipt HEAD does not match' };
232
+ // @implements A-SPEC-748 — an inherited receipt stands only on the kept full receipt it names, and on a diff
233
+ // recomputed now: a path list written into the receipt is never trusted.
234
+ if (receipt.inheritedFrom) {
235
+ if (!inherit)
236
+ return { valid: false, reason: 'an inherited release test-lane receipt needs the publish-time diff to be checked' };
237
+ const full = readFullReceipt(root, now);
238
+ if (!full.ok)
239
+ return { valid: false, reason: full.reason };
240
+ const f = full.receipt;
241
+ if (f.head !== receipt.inheritedFrom.head || f.completedAt !== receipt.inheritedFrom.completedAt || f.digest !== receipt.inheritedFrom.digest) {
242
+ return { valid: false, reason: 'the inherited receipt does not name the kept full release test-lane receipt' };
243
+ }
244
+ const blocked = inheritableSince(f, head, inherit.git, inherit.shipped);
245
+ if (blocked !== null)
246
+ return { valid: false, reason: blocked };
247
+ }
108
248
  const completedMs = Date.parse(receipt.completedAt);
109
249
  if (!Number.isFinite(completedMs) || completedMs > now || now - completedMs > RELEASE_TEST_LANE_MAX_AGE_MS) {
110
250
  return { valid: false, reason: 'release test-lane receipt is stale or has an invalid timestamp' };
@@ -122,10 +262,17 @@ function normalizeReleaseTestLaneReceipt(root, input) {
122
262
  || typeof value.completedAt !== 'string' || !Number.isFinite(Date.parse(value.completedAt))
123
263
  || value.passed !== true || value.externalAccess !== 'forbidden')
124
264
  return null;
265
+ // @implements A-SPEC-748 — an inherited receipt names its full receipt and ran named docs tests; a full one keeps
266
+ // today's command requirements.
267
+ const from = value.inheritedFrom;
268
+ if (from !== undefined && (!from || typeof from.head !== 'string' || from.head === '' || /[\\/]/.test(from.head)
269
+ || typeof from.completedAt !== 'string' || !Number.isFinite(Date.parse(from.completedAt))
270
+ || typeof from.digest !== 'string' || !/^sha256:[0-9a-f]{64}$/.test(from.digest)))
271
+ return null;
125
272
  if (!Array.isArray(value.command) || value.command.some((part) => typeof part !== 'string' || part === '')
126
273
  || value.command.length < 5 || value.command[0] !== 'npm' || value.command[1] !== 'test'
127
274
  || value.command[2] !== '--' || !value.command.includes('--runInBand')
128
- || !value.command.some((part) => part.startsWith('--testPathIgnorePatterns=')))
275
+ || (from === undefined && !value.command.some((part) => part.startsWith('--testPathIgnorePatterns='))))
129
276
  return null;
130
277
  if (!Array.isArray(value.include) || value.include.length === 0 || value.include.some((part) => typeof part !== 'string' || part.trim() === ''))
131
278
  return null;
@@ -134,7 +281,8 @@ function normalizeReleaseTestLaneReceipt(root, input) {
134
281
  return null;
135
282
  const unsigned = { schema: exports.RELEASE_TEST_LANE_SCHEMA, root: rootPath, head: value.head, completedAt: value.completedAt,
136
283
  passed: true, externalAccess: 'forbidden', command: [...value.command], include: [...value.include],
137
- exclusions: value.exclusions.map((entry) => ({ pattern: entry.pattern, reason: entry.reason })) };
284
+ exclusions: value.exclusions.map((entry) => ({ pattern: entry.pattern, reason: entry.reason })),
285
+ ...(from !== undefined ? { inheritedFrom: { head: from.head, completedAt: from.completedAt, digest: from.digest } } : {}) };
138
286
  return { ...unsigned, digest: releaseReceiptDigest(unsigned) };
139
287
  }
140
288
  // @implements A-SPEC-562.1 — outcomes join the ledger's REPLICA convention (A-SPEC-148): one file per
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Cosine at or above which an unreadable file's path words are "about" a non-ASCII request, keyed by
3
+ * the semantic runtime label. Measured 2026-09-30 (docs/goals/EVIDENCE-nonlatin-relevance-2026-09-30.md):
4
+ * on gemini-embedding-001 mixed requests naming the file scored 0.701–0.765 and no unmatched jarvis
5
+ * request exceeded 0.640. On local bge-m3 the populations overlapped (pin 0.486 against 0.489), so it
6
+ * has no entry — a label without a threshold keeps the language relevant.
7
+ */
8
+ export declare const UNREADABLE_PATH_THRESHOLDS: Readonly<Record<string, number>>;
9
+ /** `scripts/holmes_session_key.sh` -> `scripts holmes session key`: the words of the path, no extension. */
10
+ export declare function unreadablePathText(file: string): string;
11
+ /**
12
+ * Tracked and untracked-not-ignored files whose extension the scanner cannot read. Throws when git
13
+ * fails: the analysis handler turns that into its `not-enumerated(non-git)` gap.
14
+ */
15
+ export declare function listUnreadableFiles(root: string): {
16
+ languages: string[];
17
+ files: string[];
18
+ truncated: boolean;
19
+ };
20
+ /**
21
+ * Warm the path vectors the analysis compares a non-ASCII request with. Best effort: a tree git cannot
22
+ * list, or an embedder that fails, leaves vectors missing — and a missing vector keeps the language
23
+ * relevant, which is the behavior before this existed.
24
+ */
25
+ export declare function warmUnreadablePaths(rt: {
26
+ warm(texts: string[]): Promise<{
27
+ computed: number;
28
+ cached: number;
29
+ }>;
30
+ }, root: string): Promise<void>;
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.UNREADABLE_PATH_THRESHOLDS = void 0;
37
+ exports.unreadablePathText = unreadablePathText;
38
+ exports.listUnreadableFiles = listUnreadableFiles;
39
+ exports.warmUnreadablePaths = warmUnreadablePaths;
40
+ // @implements A-SPEC-741.1
41
+ // The files the scanner cannot read, and the ONE definition of their path-vector key. The warm
42
+ // (writer) and maintenance analysis (reader) both key through `unreadablePathText`: a writer key that
43
+ // drifts from the reader's misses for ever while both sides look correct (A-SPEC-683).
44
+ const path = __importStar(require("node:path"));
45
+ const node_child_process_1 = require("node:child_process");
46
+ const cpg_scanner_1 = require("../cpg/cpg-scanner");
47
+ const root_1 = require("../project/root");
48
+ const bounded_io_1 = require("../project/bounded-io");
49
+ /** Code extensions the scanner does not read (the handler's list since A-SPEC-741). */
50
+ const KNOWN_CODE_EXTENSIONS = ['.rb', '.php', '.kt', '.kts', '.swift', '.scala', '.sh', '.ex', '.exs', '.lua', '.r'];
51
+ const MAX_UNREADABLE_FILES = 5000;
52
+ /**
53
+ * Cosine at or above which an unreadable file's path words are "about" a non-ASCII request, keyed by
54
+ * the semantic runtime label. Measured 2026-09-30 (docs/goals/EVIDENCE-nonlatin-relevance-2026-09-30.md):
55
+ * on gemini-embedding-001 mixed requests naming the file scored 0.701–0.765 and no unmatched jarvis
56
+ * request exceeded 0.640. On local bge-m3 the populations overlapped (pin 0.486 against 0.489), so it
57
+ * has no entry — a label without a threshold keeps the language relevant.
58
+ */
59
+ exports.UNREADABLE_PATH_THRESHOLDS = {
60
+ 'cloud:gemini-embedding-001': 0.65,
61
+ };
62
+ /** `scripts/holmes_session_key.sh` -> `scripts holmes session key`: the words of the path, no extension. */
63
+ function unreadablePathText(file) {
64
+ const ext = path.posix.extname(file);
65
+ const stem = ext === '' ? file : file.slice(0, -ext.length);
66
+ return stem.replace(/([a-z0-9])([A-Z])/g, '$1 $2').split(/[^A-Za-z0-9]+/).filter(Boolean).join(' ').toLowerCase();
67
+ }
68
+ /**
69
+ * Tracked and untracked-not-ignored files whose extension the scanner cannot read. Throws when git
70
+ * fails: the analysis handler turns that into its `not-enumerated(non-git)` gap.
71
+ */
72
+ function listUnreadableFiles(root) {
73
+ const supported = new Set(cpg_scanner_1.SCANNABLE_EXTENSIONS);
74
+ const unreadable = new Set(KNOWN_CODE_EXTENSIONS.filter((ext) => !supported.has(ext)));
75
+ // A-SPEC-734 (round 15): with the fsmonitor hook off; round 16: the shared bound.
76
+ const listed = (0, node_child_process_1.execFileSync)('git', ['-c', 'core.fsmonitor=false', '-C', root, 'ls-files', '-z', '--cached', '--others', '--exclude-standard'], { timeout: 5000, encoding: 'utf8', env: (0, root_1.cleanSubprocessEnv)(), maxBuffer: bounded_io_1.GIT_MAX_BUFFER, stdio: ['ignore', 'pipe', 'pipe'] }).split('\0');
77
+ const languages = new Set();
78
+ const files = [];
79
+ let truncated = false;
80
+ for (const file of listed) {
81
+ const ext = path.extname(file).toLowerCase();
82
+ if (!unreadable.has(ext))
83
+ continue;
84
+ languages.add(ext);
85
+ if (files.length < MAX_UNREADABLE_FILES)
86
+ files.push(file);
87
+ else
88
+ truncated = true;
89
+ }
90
+ return { languages: [...languages].sort(), files, truncated };
91
+ }
92
+ /**
93
+ * Warm the path vectors the analysis compares a non-ASCII request with. Best effort: a tree git cannot
94
+ * list, or an embedder that fails, leaves vectors missing — and a missing vector keeps the language
95
+ * relevant, which is the behavior before this existed.
96
+ */
97
+ async function warmUnreadablePaths(rt, root) {
98
+ try {
99
+ const texts = [...new Set(listUnreadableFiles(root).files.map(unreadablePathText))].filter((t) => t !== '');
100
+ if (texts.length > 0)
101
+ await rt.warm(texts);
102
+ }
103
+ catch { /* best effort — see above */ }
104
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "@implements A-SPEC-209",
3
3
  "name": "@holmes-lab/holmes-kit",
4
- "version": "0.32.0",
4
+ "version": "0.34.0",
5
5
  "description": "Holmes-Kit — deterministic Agentic Software Engineering (ASE) harness with causal traceability (spec chain + D-CPG + RTM + phase guardrail)",
6
6
  "main": "dist/holmes/mcp/server.js",
7
7
  "types": "dist/holmes/mcp/server.d.ts",
@@ -10,7 +10,7 @@ description: >-
10
10
  # author-slice
11
11
 
12
12
  거부가 요구하는 문서가 **아직 없을 때** 이 플레이북이다. 문서는 있는데 `status`가 막고 있다면
13
- `promote-slice`다 — `spec_list`로 먼저 갈라라. `approved H-SPEC이 없습니다` / `approved A-SPEC이
13
+ `promote-slice`다 — `spec_list({ ids: ["<id>"] })`로 먼저 갈라라. `approved H-SPEC이 없습니다` / `approved A-SPEC이
14
14
  없습니다`는 "없음"과 "draft로 있음" 두 상황에서 같은 문구로 나오므로 문구가 아니라 스토어 상태가
15
15
  판별 기준이고, `선행 REQ가 없습니다`만은 존재 검사라서 언제나 이쪽이다.
16
16
 
@@ -42,7 +42,7 @@ description: >-
42
42
  말하지 않는다 — 두 개의 서로 다른 실패가 같은 `missing`을 낸다. 「T-SPEC 거부는 상태를 구별해 말한다」를 함께 읽는다.
43
43
  2. **대상을 특정한다.** `구현 대상 A-SPEC(미지정)` 이 나왔다면 스펙이 아니라 호출이 문제다 —
44
44
  `targetAspecId`를 넘기지 않은 것이고, 승인할 것은 없다.
45
- 3. **그 스펙이 존재하는가.** `spec_list`로 확인한다. 없으면 이것은 승격이 아니라 저작이다 →
45
+ 3. **그 스펙이 존재하는가.** `spec_list({ ids: ["<id>"] })`로 확인한다(없으면 `unknownIds`에 이름이 나온다). 없으면 이것은 승격이 아니라 저작이다 →
46
46
  `author-slice`. 있으면 계속한다.
47
47
  4. **검증을 확인한다 — 부르는 게 아니라 받는 것이다.** `spec_validate`는 기본 프로파일에서
48
48
  **광고되지 않는다**. `phase_check` · `risk_check` · `rtm_check`와 함께 훅이 push로 강제하는