@holmes-lab/holmes-kit 0.35.6 → 0.35.7

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
@@ -5,6 +5,25 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
  <!-- @implements A-SPEC-209 -->
8
+ ## [0.35.7] - 2026-10-05
9
+
10
+ ### Fixed
11
+
12
+ - **The Stop hook no longer judges repositories that are not Holmes projects** (A-SPEC-452.1). In a git repository
13
+ with no `.ax` directory and an untracked source file, the Stop hook answered a block: `[ART-1] … the changed source
14
+ has no @implements anchor`. Codex wires the Stop hook at user level, shared by every workspace on the machine, so
15
+ with that hook trusted every repository there had its turns held and was told to write Holmes specs. Where no
16
+ project can be found — no `.ax` marker and no wired spec directory at or above the working directory, and no
17
+ approval in a ledger there — the hook now answers nothing and creates nothing. Inside a project nothing changes,
18
+ and a project whose spec tree is gone while its ledger records approvals is still blocked with the
19
+ governance-lost reason. If you use Codex with Holmes hooks and saw turns blocked in unrelated repositories,
20
+ upgrade.
21
+ - **A Jest each-table written with a type argument is counted** (A-SPEC-750.1). The static case counter behind ART-4
22
+ recognised `it.each(table)(…)` and the template form, and stopped at the `<` of `it.each<Row>(table)(…)`, so a
23
+ TypeScript suite that types its tables on the call was counted below what Jest runs (measured: 7 where Jest ran 8).
24
+ The typed form now counts, including nested generics and arrow types in the argument. The counter remains a lower
25
+ bound: a type argument list that never closes counts nothing.
26
+
8
27
  ## [0.35.6] - 2026-10-05
9
28
 
10
29
  ### Added
package/README.md CHANGED
@@ -24,6 +24,7 @@ Measured at `173b99650442` (specs `sha256:215f84d4e9f4`) — reproduce with `hol
24
24
  ### 🛡️ Currently Supported Features (Production Features)
25
25
 
26
26
  - **The protected store is recognised however a shell command spells it** *(new in 0.35.2 — security fix, upgrade recommended)*: through 0.35.1 a path into `.ax/specs`, `.ax/ledger`, `.ax/approvals` or `.ax/state` written directly after a shell expansion, a variable, or a character the shell removes at run time was not seen as protected, so a removal, move or overwrite of governance state could pass the gate. The store spelling now counts wherever it appears in a command, and an output redirect to a computed target is not a read. Reads still pass. A directory that merely ends in `.ax` and has a child named like the store's is judged as the store. Limit: a path assembled so the spelling never appears in the command text is outside this rule.
27
+ - **The Stop hook leaves other repositories alone** *(new in 0.35.7 — upgrade recommended for Codex users)*: Codex wires the Holmes Stop hook at user level, so it is called in every repository on the machine. Through 0.35.6 it blocked the end of a turn in a repository that is not a Holmes project (`[ART-1] … no @implements anchor`). It now answers nothing where no project can be found; inside a project nothing changes.
27
28
  - **Re-apply a registered runtime binding without leaving the session** *(new in 0.35.6)*: the MCP tool `runtime_binding` previews and applies the plan `runtime-binding setup` would make for the registered workspace, including `activate_hooks`. It never chooses a build — it uses the package the operator registry already names — and it writes only when you answer approve in the approval dialog, which shows the plan digest and the files. No answer, a denial, a client without the dialog, or autonomous approval write nothing and leave the usual queue request. Native hook trust in Codex is still given in Codex's `/hooks`.
28
29
  - **`doctor` shows when a checkout's hooks are not the ones its sessions run** *(new in 0.35.5)*: when you develop Holmes-Kit itself with sessions routed to a released install, the `development hooks` row compares the compiled files and has both hook programs judge the same payloads, so a hook change that is not live yet is visible instead of assumed. In the same release, `runtime-binding setup` refuses a plan that would write the Codex gate where Codex has it switched off *(security fix — if you ran setup with 0.35.2–0.35.4, check `doctor` for `FAIL codex user hooks`)*.
29
30
  - **No in-session shortcut around a person while autonomy is on** *(new in 0.35.4 — security fix, upgrade recommended)*: on a client without the MCP form dialog, the `approval_commit` continuation is no longer offered or accepted while autonomous approval is on — the request goes to the approval queue. Its only human check is the host's own tool confirmation, which an allow rule or auto mode removes. With autonomy off it works as before; seals made through it are recorded as `host-gated:<harness>`.
package/dist/.build-id CHANGED
@@ -1 +1 @@
1
- be58f332-muva91ep
1
+ d2e28281-muvdpxtn
@@ -219,6 +219,25 @@ export declare function rolledBackLedgers(root: string): string[] | undefined;
219
219
  * Returns the reason to block with, or null when there is nothing to report.
220
220
  */
221
221
  export declare function governanceLostPreflight(specsDir: string, projectRoot?: string): string | null;
222
+ /**
223
+ * @implements A-SPEC-452.1
224
+ * Is this turn outside every Holmes project?
225
+ *
226
+ * Measured 2026-10-05: in a plain git repository with no `.ax` directory and one untracked `a.js` this hook answered
227
+ * an ART-1 block. Codex wires Stop at user level, shared by every workspace on the machine, so every repository there
228
+ * had its turns held and was told to write Holmes specs. A-SPEC-452 guarded "no repository" and missed the
229
+ * repository that is not a project.
230
+ *
231
+ * All three must hold: the project lookup found nothing (no `.ax` marker and no wired spec directory at or above the
232
+ * working directory), the wired spec directory does not exist, and no ledger here records an approval. A project
233
+ * whose spec tree is gone while its ledger remembers approvals is NOT outside — that is A-SPEC-175's block, and the
234
+ * caller checks it first.
235
+ */
236
+ export declare function outsideAnyProject(a: {
237
+ foundRoot: string | null;
238
+ specsDir: string;
239
+ cwd: string;
240
+ }): boolean;
222
241
  /**
223
242
  * One line per ARTICLE, each under its own name.
224
243
  *
@@ -47,6 +47,7 @@ exports.escalateReappraisals = escalateReappraisals;
47
47
  exports.unrecordedApprovals = unrecordedApprovals;
48
48
  exports.rolledBackLedgers = rolledBackLedgers;
49
49
  exports.governanceLostPreflight = governanceLostPreflight;
50
+ exports.outsideAnyProject = outsideAnyProject;
50
51
  exports.trackedLines = trackedLines;
51
52
  exports.evaluateStop = evaluateStop;
52
53
  exports.stopDebtAction = stopDebtAction;
@@ -676,6 +677,23 @@ function governanceLostPreflight(specsDir, projectRoot) {
676
677
  const root = projectRoot ?? path.resolve(specsDir, '..', '..');
677
678
  return (0, governance_history_1.hasGovernanceHistory)(root) ? governance_history_1.GOVERNANCE_LOST_HINT : null;
678
679
  }
680
+ /**
681
+ * @implements A-SPEC-452.1
682
+ * Is this turn outside every Holmes project?
683
+ *
684
+ * Measured 2026-10-05: in a plain git repository with no `.ax` directory and one untracked `a.js` this hook answered
685
+ * an ART-1 block. Codex wires Stop at user level, shared by every workspace on the machine, so every repository there
686
+ * had its turns held and was told to write Holmes specs. A-SPEC-452 guarded "no repository" and missed the
687
+ * repository that is not a project.
688
+ *
689
+ * All three must hold: the project lookup found nothing (no `.ax` marker and no wired spec directory at or above the
690
+ * working directory), the wired spec directory does not exist, and no ledger here records an approval. A project
691
+ * whose spec tree is gone while its ledger remembers approvals is NOT outside — that is A-SPEC-175's block, and the
692
+ * caller checks it first.
693
+ */
694
+ function outsideAnyProject(a) {
695
+ return a.foundRoot === null && !fs.existsSync(a.specsDir) && !(0, governance_history_1.hasGovernanceHistory)(a.cwd);
696
+ }
679
697
  // @implements A-SPEC-578.1
680
698
  /** What each article's track observations are called on the operator's screen. */
681
699
  const TRACK_LABELS = {
@@ -1293,6 +1311,10 @@ if (require.main === module) {
1293
1311
  process.stderr.write(`${lost}\n`);
1294
1312
  return;
1295
1313
  }
1314
+ // @implements A-SPEC-452.1 — a user-level entry (Codex) is called in every repository on the machine. Where
1315
+ // there is no project this hook has nothing to judge: no answer, no notice, no file.
1316
+ if (outsideAnyProject({ foundRoot: findProjectRoot(wired), specsDir, cwd: process.cwd() }))
1317
+ return;
1296
1318
  const specs = (0, pre_tool_use_1.readSpecsSync)(specsDir);
1297
1319
  // H1 evidence: count EXECUTABLE test cases per anchored A-SPEC (countTestCases strips comments/
1298
1320
  // strings — sham-resistant). A scan FAILURE yields `undefined` (ART-4 skipped this turn, true
@@ -41,7 +41,7 @@ exports.countTestCases = countTestCases;
41
41
  exports.extractAnchors = extractAnchors;
42
42
  exports.scanTestAnchors = scanTestAnchors;
43
43
  exports.computeTestScope = computeTestScope;
44
- // @implements A-SPEC-121.2, A-SPEC-734, A-SPEC-750
44
+ // @implements A-SPEC-121.2, A-SPEC-734, A-SPEC-750, A-SPEC-750.1
45
45
  const anchor_ids_1 = require("./anchor-ids");
46
46
  const fs = __importStar(require("node:fs"));
47
47
  const path = __importStar(require("node:path"));
@@ -356,6 +356,33 @@ function skipGroup(code, j) {
356
356
  }
357
357
  return code.length;
358
358
  }
359
+ /**
360
+ * @implements A-SPEC-750.1
361
+ * Index just past the type argument list opened by the `<` at `j`, or -1 when it does not close. Round, square and
362
+ * curly groups inside it are skipped whole, and the `>` of an arrow does not close it. A `;` outside every group ends
363
+ * the search: no type argument holds one.
364
+ */
365
+ function skipTypeArguments(code, j) {
366
+ let depth = 0;
367
+ for (; j < code.length; j++) {
368
+ const ch = code[j];
369
+ if (ch === '(' || ch === '[' || ch === '{' || ch === '`') {
370
+ j = skipGroup(code, j) - 1;
371
+ continue;
372
+ }
373
+ if (ch === '<')
374
+ depth++;
375
+ else if (ch === '=' && code[j + 1] === '>')
376
+ j++;
377
+ else if (ch === '>') {
378
+ if (--depth === 0)
379
+ return j + 1;
380
+ }
381
+ else if (ch === ';' || ch === ')' || ch === ']' || ch === '}')
382
+ return -1;
383
+ }
384
+ return -1;
385
+ }
359
386
  const JEST_HEADS = ['it', 'test', 'fit'];
360
387
  // @implements A-SPEC-653 — the platform helpers of A-SPEC-220.3 (`posixOnly('why')(…)`) are heads too: a POSIX-only suite
361
388
  // written with the REPORTING skip must not read as "no real cases". `.skip` on a helper is still not a head.
@@ -391,6 +418,10 @@ function jestCount(code) {
391
418
  }
392
419
  const names = [...direct, ...[...JEST_HELPERS].filter((h) => !direct.has(h))].map((s) => s.replace(/\$/g, '\\$'));
393
420
  let cases = 0;
421
+ // @implements A-SPEC-750.1 — a type argument list that does not close is searched to the end of the text. The searches
422
+ // of one file share an allowance of two passes over it; a file that spends it (it is not TypeScript that compiles)
423
+ // has its later typed tables left uncounted, which is the direction a lower bound may err in.
424
+ let typeArgumentWork = 2 * code.length + 1024;
394
425
  for (const m of code.matchAll(new RegExp(`(?<![\\w$.])(?:${names.join('|')})(?![\\w$])`, 'g'))) {
395
426
  let j = m.index + m[0].length;
396
427
  if (!direct.has(m[0])) {
@@ -410,6 +441,15 @@ function jestCount(code) {
410
441
  if (!code.startsWith('each', k) || /[\w$]/.test(code[k + 4] ?? ''))
411
442
  continue;
412
443
  k = skipSpace(code, k + 4);
444
+ if (code[k] === '<') {
445
+ if (typeArgumentWork <= 0)
446
+ continue;
447
+ const end = skipTypeArguments(code, k);
448
+ typeArgumentWork -= (end < 0 ? code.length : end) - k;
449
+ if (end < 0)
450
+ continue;
451
+ k = skipSpace(code, end);
452
+ }
413
453
  if (code[k] !== '(' && code[k] !== '`')
414
454
  continue;
415
455
  k = skipSpace(code, skipGroup(code, k));
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.35.6",
4
+ "version": "0.35.7",
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",