@holmes-lab/holmes-kit 0.40.0 → 0.41.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 (119) hide show
  1. package/CHANGELOG.md +312 -0
  2. package/README.md +79 -5
  3. package/dist/.build-id +1 -1
  4. package/dist/holmes/cli/approve-context.js +4 -3
  5. package/dist/holmes/cli/approve.js +22 -12
  6. package/dist/holmes/cli/autonomy.d.ts +21 -0
  7. package/dist/holmes/cli/autonomy.js +35 -5
  8. package/dist/holmes/cli/doctor.js +58 -6
  9. package/dist/holmes/cli/index.js +394 -267
  10. package/dist/holmes/cli/init.js +17 -6
  11. package/dist/holmes/cli/interactive-prompt.d.ts +39 -2
  12. package/dist/holmes/cli/interactive-prompt.js +98 -16
  13. package/dist/holmes/cli/ledger-witness.d.ts +61 -0
  14. package/dist/holmes/cli/ledger-witness.js +212 -0
  15. package/dist/holmes/cli/playbook-skills.d.ts +3 -56
  16. package/dist/holmes/cli/playbook-skills.js +26 -349
  17. package/dist/holmes/config/config.d.ts +21 -0
  18. package/dist/holmes/config/config.js +22 -3
  19. package/dist/holmes/governance/approval-queue.d.ts +65 -1
  20. package/dist/holmes/governance/approval-queue.js +279 -9
  21. package/dist/holmes/governance/autonomous-shell.d.ts +13 -1
  22. package/dist/holmes/governance/autonomous-shell.js +157 -4
  23. package/dist/holmes/governance/autonomy.d.ts +216 -0
  24. package/dist/holmes/governance/autonomy.js +1162 -10
  25. package/dist/holmes/governance/install-manifest.d.ts +7 -4
  26. package/dist/holmes/governance/install-manifest.js +144 -14
  27. package/dist/holmes/governance/ledger-witness.d.ts +63 -0
  28. package/dist/holmes/governance/ledger-witness.js +296 -0
  29. package/dist/holmes/governance/provenance-chain.d.ts +8 -1
  30. package/dist/holmes/governance/provenance-chain.js +23 -4
  31. package/dist/holmes/governance/push-gate-runner.d.ts +2 -0
  32. package/dist/holmes/governance/push-gate-runner.js +40 -3
  33. package/dist/holmes/governance/push-gate.d.ts +13 -2
  34. package/dist/holmes/governance/push-gate.js +106 -14
  35. package/dist/holmes/governance/recorded-pairs.d.ts +4 -0
  36. package/dist/holmes/governance/recorded-pairs.js +25 -1
  37. package/dist/holmes/governance/session-context.d.ts +7 -0
  38. package/dist/holmes/governance/session-context.js +34 -6
  39. package/dist/holmes/guardrail/advisory-line.d.ts +102 -0
  40. package/dist/holmes/guardrail/advisory-line.js +718 -0
  41. package/dist/holmes/guardrail/anchor-scope-text.d.ts +9 -0
  42. package/dist/holmes/guardrail/anchor-scope-text.js +7 -0
  43. package/dist/holmes/guardrail/command-traits.d.ts +102 -0
  44. package/dist/holmes/guardrail/command-traits.js +379 -0
  45. package/dist/holmes/guardrail/fixtures/manager-builtins.json +23 -0
  46. package/dist/holmes/guardrail/fixtures/npm-commands.json +7 -0
  47. package/dist/holmes/guardrail/impact-gate.d.ts +6 -0
  48. package/dist/holmes/guardrail/impact-gate.js +32 -5
  49. package/dist/holmes/guardrail/outward-acts.d.ts +47 -0
  50. package/dist/holmes/guardrail/outward-acts.js +1102 -0
  51. package/dist/holmes/guardrail/refusal-codes.js +8 -1
  52. package/dist/holmes/guardrail/refusal-templates.d.ts +15 -0
  53. package/dist/holmes/guardrail/refusal-templates.js +71 -0
  54. package/dist/holmes/guardrail/risk-classifier.d.ts +22 -6
  55. package/dist/holmes/guardrail/risk-classifier.js +12 -118
  56. package/dist/holmes/guardrail/shell-lexer.d.ts +69 -0
  57. package/dist/holmes/guardrail/shell-lexer.js +567 -0
  58. package/dist/holmes/guardrail/write-target.js +7 -1
  59. package/dist/holmes/hooks/pre-tool-use.d.ts +71 -0
  60. package/dist/holmes/hooks/pre-tool-use.js +1466 -14
  61. package/dist/holmes/hooks/session-start.js +27 -1
  62. package/dist/holmes/hooks/stop.d.ts +7 -0
  63. package/dist/holmes/hooks/stop.js +39 -2
  64. package/dist/holmes/mcp/elicit-approval.d.ts +0 -21
  65. package/dist/holmes/mcp/elicit-approval.js +5 -2
  66. package/dist/holmes/mcp/handlers/approval-ask.js +3 -2
  67. package/dist/holmes/mcp/handlers/entity-integration.d.ts +1 -1
  68. package/dist/holmes/mcp/handlers/entity-integration.js +9 -6
  69. package/dist/holmes/mcp/handlers/entity-renumber.js +2 -1
  70. package/dist/holmes/mcp/handlers/entity-store.js +7 -2
  71. package/dist/holmes/mcp/handlers/maintenance-analysis.d.ts +13 -0
  72. package/dist/holmes/mcp/handlers/maintenance-analysis.js +59 -2
  73. package/dist/holmes/mcp/handlers/operator-inspection.d.ts +2 -0
  74. package/dist/holmes/mcp/handlers/operator-inspection.js +25 -4
  75. package/dist/holmes/mcp/handlers/spec-approval.d.ts +3 -1
  76. package/dist/holmes/mcp/handlers/spec-approval.js +28 -10
  77. package/dist/holmes/mcp/handlers/spec-lifecycle.js +10 -7
  78. package/dist/holmes/mcp/handlers/test-execution.d.ts +470 -3
  79. package/dist/holmes/mcp/handlers/test-execution.js +201 -21
  80. package/dist/holmes/mcp/handlers.d.ts +473 -8
  81. package/dist/holmes/mcp/handlers.js +6 -1
  82. package/dist/holmes/mcp/maintenance-analyze.d.ts +5 -0
  83. package/dist/holmes/mcp/maintenance-analyze.js +4 -2
  84. package/dist/holmes/mcp/maintenance-evidence.d.ts +9 -0
  85. package/dist/holmes/mcp/maintenance-evidence.js +4 -1
  86. package/dist/holmes/mcp/tool-schemas.js +16 -10
  87. package/dist/holmes/project/baseline.d.ts +15 -2
  88. package/dist/holmes/project/baseline.js +11 -6
  89. package/dist/holmes/project/bounded-io.d.ts +1 -0
  90. package/dist/holmes/project/bounded-io.js +4 -2
  91. package/dist/holmes/project/change-source.d.ts +4 -0
  92. package/dist/holmes/project/change-source.js +13 -5
  93. package/dist/holmes/project/playbook-reference.d.ts +50 -0
  94. package/dist/holmes/project/playbook-reference.js +259 -0
  95. package/dist/holmes/project/playbook-skill-states.d.ts +94 -0
  96. package/dist/holmes/project/playbook-skill-states.js +396 -0
  97. package/dist/holmes/project/root.d.ts +9 -1
  98. package/dist/holmes/project/root.js +26 -3
  99. package/dist/holmes/project/running-package.d.ts +15 -0
  100. package/dist/holmes/project/running-package.js +87 -0
  101. package/dist/holmes/review/evidence-mode.d.ts +21 -0
  102. package/dist/holmes/review/evidence-mode.js +33 -0
  103. package/dist/holmes/review/head-worktree.d.ts +55 -0
  104. package/dist/holmes/review/head-worktree.js +329 -0
  105. package/dist/holmes/review/mrp.js +13 -3
  106. package/dist/holmes/review/run-provenance.d.ts +45 -0
  107. package/dist/holmes/review/run-provenance.js +314 -0
  108. package/dist/holmes/review/test-evidence.d.ts +174 -0
  109. package/dist/holmes/review/test-evidence.js +330 -2
  110. package/dist/holmes/review/test-reports.d.ts +94 -0
  111. package/dist/holmes/review/test-reports.js +382 -0
  112. package/dist/holmes/review/test-runner.d.ts +178 -65
  113. package/dist/holmes/review/test-runner.js +551 -319
  114. package/dist/holmes/review/test-units.d.ts +159 -0
  115. package/dist/holmes/review/test-units.js +814 -0
  116. package/dist/holmes/spec/entity-integration-transaction.d.ts +19 -2
  117. package/dist/holmes/spec/entity-integration-transaction.js +68 -7
  118. package/package.json +5 -2
  119. package/playbooks/publish/PLAYBOOK.md +2 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,318 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
  <!-- @implements A-SPEC-209 -->
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.41.0] - 2026-11-12
11
+
12
+ ### Upgrading
13
+ - **Un-seal and retire are their own approval kinds.** A grant or an out-of-band approval scoped to `spec-approve` no longer covers `spec_unseal` or `spec_retire`; scope it to `spec-unseal` or `spec-retire` (an unscoped approval still covers them). A 0.40 `holmes-kit approve --list` does not list requests of the new kinds — decide them in the session form (`approval_ask`) or with the 0.41 CLI.
14
+ - **Requests close by themselves after 24 hours.** A hook's or the CLI's request that nobody decided is closed unrun (`closed-expired`) at the next session start; asking again files it anew. A 0.40 reader ignores the event and keeps such a request pending.
15
+ - **Principle 7.** Under a full profile, a spec whose Files to Touch names the gate and approval-processing category (now much wider — see Changed) goes to the person's form instead of sealing as full-autonomy, and a declared `gate-behavior: tightens|wording` no longer self-seals such a spec in any autonomy mode.
16
+ - **R1 sealed-spec staging is on by default under a full profile.** `"autonomy": { "specStaging": "off" }` in `ax.config.json` brings back the person's form for every spec path.
17
+ - **An autonomy command with an approval set in the command is refused (`profile.own-request`).** Run `holmes-kit autonomy full|on|delegate` without the variable: it files its own request for the session form.
18
+ - **Holmes-Kit's own checkout: vouch for the ledger once (A-SPEC-794.114).** The gate now reads its provenance chain only when a witness in the git directory says the chain is the one this repository wrote. A checkout upgraded from 0.40.x, a new clone or worktree, and a changed replica id start with no witness: Stop, commits and builds are closed there until a person runs `holmes-kit ledger witness` and approves its request in the session form. npm-installed consumers are not affected.
19
+ - **`holmes-kit ledger rechain` asks a person, and does not vouch (A-SPEC-794.114, 794.116).** The rewrite applies only to a plan a person approved in the session form or at their own terminal; `--dry-run` is unchanged. Measured 2026-11-12: inside a session it rechained a forked chain with no person, and the hook let `npx holmes-kit ledger rechain` through. The rechain's form shows how the judgement reads the chain now; approving it does not move the ledger witness — after a rechain that changed this writer's chain, run `holmes-kit ledger witness` (one more form), whose form compares the chain with the pushed one.
20
+
21
+ ### Known limitations
22
+ - The ledger witness (A-SPEC-794.114, 794.115) is as strong as the hook's refusal of writes to it: a script the command does not name, run with the same uid, can call the store's own append and write a witnessed row (without `HOLMES_LEDGER_KEY` the chain is a plain hash). Without an upstream branch the vouching form has no pushed chain to compare with and says so. The form's comparison with the pushed chain reads the local upstream ref (`@{u}`), which a session can move (`git branch -u`, `git update-ref refs/remotes/...`), so that line can be made to say the chain is the pushed one; the verdict line below it is the witness's and a session cannot move it — read the verdict, and do not approve `taken-back`, `extended` or `broken` (supervisor review M1, 2026-11-12; for 0.41.x).
23
+ - **Under full autonomy, removing a backup `init` left closes governance staging, with no request (present since 0.40.1; repair planned for 0.41.1).** When `init` overwrites a product recovery skill a user edited, it leaves `SKILL.md.holmes-bak-<id>` beside it and records that backup in the install manifest as a product file. If a person then removes the backup, the product-installed judgement reports it `missing`, and under a full autonomy profile the gate refuses a command that stages governance files (`full-autonomy.refused`) without filing a request — the agent has no route in the session. Workspaces without a full profile are not affected (their staging goes to a person's request as before). Ways out: put the backup back, run `holmes-kit init` at a person's terminal to refresh the install record, or stage the files at a person's terminal. Measured 2026-11-12 on consumer fixtures of 0.41.0 and of the published 0.40.1 (same result; the backup restored passes). In Holmes-Kit's own checkout, principle 7 also counts such an ignored backup as a change (it closes build, commit and Stop), so there it can neither stay nor go until a person refreshes the record. A rechain or a vouch run by a person at their own terminal is not shown in a form. Measured cost: reading and hashing a 30.6 MB chain takes 14 ms per judgement (no cache is kept).
24
+ - The hook judges `holmes-kit runtime-binding setup|remove` and `holmes-kit ledger rechain` by the words after the CLI word, behind any runner — not by the outward judgement's own unwrapping (A-SPEC-794.72), so a CLI word held in a variable, an alias or a pipe into a shell is not seen by the hook; the CLI's own person approval holds there (both commands ask for one). Measured on the recorded corpus (300 session commands, 500 commit messages, npm's commands): no false positive.
25
+ - The product-installed judgement of recovery skills (A-SPEC-794.100, 794.106) does not follow links: a linked skill file or directory keeps the digest judgement of the install record, and so do an aliased, unresolvable or orphaned skill and the case where the skills cannot be judged at all. What holds that record: only `init` rewrites it, and `init` refused in the two states measured (a drifted skill in a checkout; an unreadable playbook of a deployed package). In a checkout, a skill whose playbook is gone or unreadable is `drifted` and no longer goes to that record (A-SPEC-794.113). It judges only the `SKILL.md` of each skill, not other files in a skill directory. When the ledger file a command stages has not changed, the refusal text does not say so (review A-L1, A-L2, B-L3). The hook does not refuse a write to `.git/refs/replace/` or `.git/packed-refs`; the skills' judgement reads no git object, and principle 7 reads git with replacement objects off, so such a write does not reach either (A-SPEC-794.110, 794.113).
26
+ - **The runtime that dispatches the hooks was writable from a session (present in 0.40.1 — observed 2026-11-12 in the owner's terminal with the published 0.40.1 hook: a Write to `~/.holmes/runtime/bindings.json` and to a runtime launcher, and a shell redirect, copy and removal there, were all allowed).** Who: an agent session in any governed workspace. When: the session deliberately writes one of those files. Closed in 0.41.0: the hook refuses writes, moves and removals under `~/.holmes/runtime` (A-SPEC-794.113), and judges `holmes-kit runtime-binding setup|remove` and `holmes-kit ledger rechain` wherever the CLI word sits, behind any runner (`npx`, `npm exec`, `pnpm dlx`, `bunx`, `env`, `node …/holmes-kit.js`, a `sh -c` program). Upgrade to 0.41.0.
27
+ - In a deployed install — a package whose real path has a `node_modules` segment: global, npx, or under a project's `node_modules` — the reference playbooks, the launchers and the gate's own code live in one package, and the hook now refuses a write, move or removal from the session anywhere under that package's root (A-SPEC-794.113: the Write and Edit tools, and a shell copy, move, redirect, link, mode change, removal or interpreter write, judged where the write lands). **The gate's own code was writable from the session in 0.40.1 too** — measured 2026-11-12 before this: the playbooks by every route, the dist by the shell (and by the file tools for a package outside the project); closed in 0.41.0. The package manager is not affected (`npm install`, `update`, `uninstall`, `-g`, `holmes-kit upgrade` name no file of the package), nor is a checkout of Holmes-Kit used as its own package. What the hook does not see is still open: a program that writes the package without naming it in the command (a script, a package manager's lifecycle), a relative path after a `cd` whose target the gate cannot read, and the person's own terminal. Forgery resistance against the same user is not claimed (owner decision 11/03).
28
+ - A package that is not deployed is judged against the playbook digests its gate recorded in its own ledger (A-SPEC-794.110). A package unpacked by hand outside any `node_modules` (a vendor directory, an extracted tarball) has no such record, so the autonomous approval of governance staging is closed there with the reason named, and a person approves; installing holmes-kit with npm frees it. The record is a row of the provenance ledger, as a person's seal is: the hook refuses a shell append, copy, move, interpreter write and git checkout over the ledger, and a row added or rewritten without the chain's hash closes the judgement, but without `HOLMES_LEDGER_KEY` a chain-valid row written with the package's own API by the same user is not told apart (the limit `doctor` names for seals).
29
+ - The recorded digest of a playbook moves only at a build the hook judged, while a person's window naming that playbook is open on this machine (a window row of this writer's chain, recorded after its latest baseline, carries the bytes' sha256) — so a playbook changed outside a window, checked out from an earlier version, or brought by a pull keeps its earlier digest here and its skill is not shown current until a person seals an A-SPEC naming it on this machine and a build follows inside that window. A change committed inside a window and built after it closed is not recorded either — the way out is the same: `spec_approve` again on the A-SPEC that names the playbook (the form says it is a re-seal; one answer), or a new A-SPEC naming it, then the build inside that window. A build run outside a governed agent session records nothing (A-SPEC-794.113). A digest reaches a baseline row in those two ways only — carried from this chain's latest row that has digests, or under such a window; nothing is taken from a commit, and where the ledger or a playbook cannot be read no row is written.
30
+ - A chain with no baseline row of its own starts closed: a new clone, a linked worktree (its replica id is `<host>-wt-<name>`) and a `run` execution (`<host>-run-<id>`, a new id every run) each write a chain of their own. Its first playbook digests are written only by a build inside a person's seal window of that chain whose A-SPEC names the playbooks (`playbooks/**`, or each `playbooks/<name>/PLAYBOOK.md` — `playbooks` alone names nothing in Files to Touch), so in a checkout that is not an npm install the autonomous approval of governance staging goes to a person there until then — in every automated run, as each starts a new chain. Reading the host's chain for a run is a 0.41.x candidate.
31
+ - A package reached through a link (`npm link`, a `file:` dependency, a workspace) is the checkout the link points at, not a deployed install: it is judged against that checkout's own recorded build, and closed while it has none.
32
+ - `doctor` judges the recovery skills with the package it runs from, and the gate with the package the sessions load. Run from another install than the routed one, doctor's verdict is that install's; its `recovery skills reference` row says so and names the command that asks the gate's install. Principle 7's git reads ignore `core.worktree`, configured filters, `core.trustctime`, `core.checkStat` and inherited `GIT_*` variables; they still trust git's own comparison of tree objects, so the hook refuses a program that is not git writing under `.git/objects` (objects, packs, `info/alternates`), changing a mode there, or moving or replacing the `.git` entry — in every project, by the file tools and the shell, judged where the write lands and, for a linked worktree, over the store of the repository it belongs to (A-SPEC-794.113; all of these passed the hook before, measured 2026-11-12). Git's own commands, reads and copies out of `.git`, and `rm` are not touched by the rule: removing an object makes git fail, and a judgement git cannot answer is closed. `HEAD`, refs, `packed-refs` and the index are not refused to a program that is not git either — a git command moves them as well, and the judgement compares the state with the ledger's baseline whoever moved it (tested by writing them directly). The skills' reference reads no git object.
33
+ - In Holmes-Kit's own repository a build and a commit are refused, and the turn's end is held, while git cannot read the repository (an unknown format version, `.git` moved away, git missing, or no answer within 10 seconds): principle 7 cannot judge the tree then, and says which it was — after a timeout, only "run this again" (A-SPEC-794.113). In that repository, content a window saw before the baseline in force no longer opens a gate file after the window closed: going back to an earlier version of a gate file needs a person's window. A directory that holds neither `.git` nor a baseline row is not judged.
34
+ - In that repository the judgement also closes where something used to stand in (A-SPEC-794.113): when the latest baseline row's commit is not in the repository (history rewritten and collected, a shallow clone that does not reach it, a commit never pushed) no older baseline stands in — bring the commit back (`git fetch`, `git fetch --unshallow`), or a person seals an A-SPEC naming the principle 7 paths as they are and the build inside that window records the tree; when the provenance ledger cannot be read; and when git cannot hash a changed file (one file git cannot open closes the judgement — a new gate source beside it read as unchanged before). A shallow CI clone of a Holmes-Kit checkout whose ledger names a baseline outside its depth is closed by the first of these until it fetches the commit. A directory git cannot open is not listed by `git status`, so a new file inside it is not seen while it stays closed (not closed in this release).
35
+ - Upgrading a Holmes-Kit checkout to this gate takes two builds and a person's window: the baseline row is written by the hook that runs before the build, so the first build is recorded by the earlier gate without playbook digests and the new gate is closed, naming that; the build once more, inside a person's seal window whose A-SPEC names `playbooks/**`, records them. Reconnect the MCP server after each build (it keeps the code it started with).
36
+ - Principle 7 applies where the judged root lies inside the checkout the running gate is built from (A-SPEC-794.111). A Holmes-Kit clone governed by an npm-installed package is therefore not judged by principle 7 — its source is not the running gate's source — and neither is a consumer repository that happens to hold a directory `src/holmes`.
37
+ - The outward judgement closes a command too large to judge (more than 400,000 words, a clause of more than 20,000 words, more than 2,000 package directories, more than 900 ms, more than eight readings of unknown options, subshell groups nested more than 64 deep) under every flag; the 1-second bound is the judgement's, and the hook's whole time on a 1 MB command adds 1.3–1.8 s in other gates.
38
+ - In a project that holds no spec file yet, a gate error (a deadline, a crash) lets the command through, so a deadline there does not stop an outward act.
39
+ - R1's session item for R8 (`session:<server instance>`) names the MCP server process, which sub-agents and a codex app-server daemon share; R8 itself (re-sealing what this session sealed) stays closed until a per-harness session key is measured (0.42).
40
+ - An approval read from a file the hook never sees (`set -a; . f; …`) is refused by the CLI only where the operator guard finds an agent; forgery resistance by the same user is not claimed.
41
+ - The principle 7 write rule reads the trusted ledger only when an approved A-SPEC names the file; the read is remembered within one process only (a cache other processes could write would forge seals). The hook runs one process per call, so an allowed write to a gate file costs about 1.2–1.5 s in this repository (0.52 s of it the ledger's verification), and a 1 MB Write about 1.13–1.19 s whether refused or allowed (review B's measurement; a refusal with no spec naming the file skips the ledger) (A-SPEC-794.95).
42
+ - The working-tree check (A-SPEC-794.96, 794.97) runs at Stop, at a `git commit` the gate reads and at a build the gate reads (through env, command, time, nohup, npx, npm exec, `sh -c`, eval, cd into the root or under it, the manager's options, package scripts five levels deep, `tsc` by any path): `bun`, a node script calling the compiler API or writing a gate file, make, just, task, concurrently, npm-run-all, `script -q`, a shell function or alias, a one-line `case`, `npm x tsc`, a package's lifecycle scripts, a build in a directory the gate cannot resolve (a variable it does not hold, `$(mktemp -d)`: left to Stop, so a variable pointing at the root is not caught before it acts), and the same user changing dist or the hooks on purpose are not caught before they act (the next Stop judges what they changed). A build in the same command after a step that changes the working tree (git pull, merge, checkout or switch to another tree, rebase, cherry-pick, am, revert, reset --hard/--keep/--merge, stash, restore of the working tree, apply; gh pr checkout, gh repo sync) is refused — run the build as its own command. A new branch at HEAD, a soft or mixed reset, unstaging and an index-only apply are not such steps. The walk reads the values a shell fixes — `$0` in a script, `$(dirname …)`, `$(cd … && pwd)`, `$(pwd)`, `$PWD`, `$OLDPWD`, `cd -`, `$(git rev-parse --show-toplevel)` and variables holding them — and a shell script under the root (by `bash`, `sh`, `.`, `source` or a path whose first line runs a shell); inside such a script a cd it cannot resolve is taken as the root — so a script under the root that builds in a temporary clone or a directory it was handed is also refused while a gate change is unopened. `popd` is not modelled: a build after it is judged where the walk last was, and Stop judges what it changed. `tsc -p X` is a build only where X's outDir (through relative `extends`) is dist and no config in the chain sets noEmit. With nothing changed in the category since the baseline, Stop, a commit and a build take a fast path that finds the baseline in this replica's tracked chain without verifying the row's chain (forging one needs a ledger write the gate refuses). The first baseline's check picks commits by committer date, so a commit made in the same second as the seal, or rewritten by rebase or amend, can fall on the wrong side — the gate prevents accidents; its forgery resistance is not verified (owner decision 11/03). SubagentStop is not wired in any harness: a subagent's change is judged when the parent's turn ends, so the gap is the time between the subagent's change and the parent's Stop (0.42 wires it in the three harnesses). The consecutive-block cap of the Stop hook still applies to this rule.
43
+ - A gate file changed inside a window but never passed through a Stop, a commit or a build before the window closed has no recorded blob, and needs a person's seal again (A-SPEC-794.97). A commit made outside the gate — an owner's terminal commit, a pull, a branch switch — and a person's own build in a terminal record no baseline: those changes stay judged until a person seals an A-SPEC naming the files, or the branch switch or pull is undone (a gate build is refused while they are unopened, so it cannot move the baseline past them; a restore from the baseline would also discard those commits). JavaScript a build emits through `allowJs` from files git ignores is not judged. The harness's runtime paths (`.claude/settings.local.json`, `.claude/worktrees/`, `.claude/scheduled_tasks.lock`) are excluded from the judgement; the repository's `.gitignore` does not list them yet.
44
+ - An approval read from a file the hook never sees (`set -a; . f; holmes-kit autonomy full`) is refused by the CLI, not by the hook (owner decision 11/10: a named limit under "forgery resistance not verified").
45
+ - The window record (`principle7-window-write`) is written when the gate opens the write, before the act: it records what a window opened, not that a write took place.
46
+ - Principle 7's category is named seams plus a census of the gate entry points' import closure (372 modules, 129 of them in the category). Modules outside the closure that use a seal judgement stay outside because no entry point reaches them — admission/core's admission-policy and change-classifier, and two test-support modules; the census turns red if an import makes one reachable (A-SPEC-794.94).
47
+ - A seal recorded under a plain operator name (4,127 rows in this repository, 368 of them the current seal of a gate-category spec) is not counted as a person's: it carries no channel or grant nonce and cannot be told from an approval an agent set in the environment. Only seals from the session form (or a host's approval dialog) count; the owner's terminal path (`holmes-kit approve` grants) opens no gate-file window in 0.41.
48
+ - `init --autonomy` refused for an environment approval names `grant.operator-only`, whose remediation mentions a request id, though init files none; `autonomyWideningGate` ignores its inputs (A-L3 and B-L3 of review round 2, next round). A path holding glob characters is judged by its literal prefix (B-L1).
49
+ - `git checkout .` or `git checkout -- <dir>` reaching the gate category is refused in Holmes-Kit's own repository; a branch switch that rewrites gate files is not judged as a principle 7 write.
50
+ - A request's occurrence count is read from this machine's refusal logs and the tracked queue; two machines that file the same request between syncs can count its occurrences differently, so a decision made on one may leave an occurrence filed on the other open (A-SPEC-794.92, L-1). Queue rows written by this repository's own pre-release build (98c58e31) carry the bound in `covered` without `through`.
51
+
52
+ ### Changed
53
+ - **A full profile's publish flag reads registry writes where a program takes its subcommand (A-SPEC-794.65, 794.66, 794.68, 794.69, 794.70).** With the publish flag off, a registry write is refused when it is a command: `npm publish`, `unpublish`, `deprecate`, `star`, and the writing forms of `dist-tag`, `owner`, `access`, `team`, `token`, `org`, `profile`, `stage` and `trust` (npm's own spellings: `npm pu`, `npm unp`, `npm own`, read from npm's command list), the same through `pnpm`, `yarn` (and `yarn npm`) and `bun`, release tools (semantic-release, np, release-it, `nx release`, `changeset publish`, `lerna publish`), behind wrappers (`sudo`, `env`, `corepack`, `npx`, `pnpm dlx`, `node …/npm-cli.js`, `"$NPM"`), and inside what a command runs: a command or process substitution, `eval`, a shell's `-c` string, `xargs`, `find -exec`, `rg --pre`, `git -c`, an editor variable, a shell's stdin program, a git hook a command writes, and the package scripts a run executes, read from the `package.json` npm would use. A `--dry-run` exempts only the write of the subcommands npm runs dry (publish, unpublish, deprecate, pack, and `stage publish`, whose class extends publish's); the lifecycle scripts a publish runs (prepublishOnly, postpublish, …) are still judged, as npm runs them under --dry-run. Only the programs listed as taking data (echo, printf, cat, grep, rg, jq, git, gh, test runners, file tools) have their arguments read as data: `git commit -m "…publish…"`, `gh pr create --body …`, `grep publish`, a quoted here-document. Wrappers (`timeout`, `caffeinate`, `op run --`, `doppler run`, `dotenv --`, `cross-env`, `aws-vault exec`, `nvm exec`, `nix develop -c`, `launchctl submit`, …) are unwrapped once, the same way for a push and a publish. A command string is judged only where the gate's table says a program runs one (`sh -c`, `doppler --command`, `nodemon --exec`, `concurrently`, `watch`, `watchexec`, `entr -s`, `ssh`, `tmux new`, `parallel`, `git rebase --exec`, `bisect run`, `submodule foreach`, `difftool -x`, `filter-branch` filters, `tar --to-command`, `zip -TT`, `wget --use-askpass`, `gh alias set --shell`). In any other program only standalone words are read: `npm`, `pnpm`, `yarn` or `bun` followed by a write subcommand, or `git` followed by `push`, is judged from there; a quoted string is data, so a prompt to an LLM CLI that mentions `npm publish` passes, and a release tool's name is a publish only where it is the program. `npm run <s> --ignore-scripts` still runs (and is judged for) the named script; only its pre and post scripts are skipped. The script name is read after the run's own options (`npm run --prefix pkg release`); `yarn <script>` and `bun <script>` run a script by its name; the version lifecycle of `yarn version`, the publish lifecycle of `yarn`/`pnpm`/`bun publish` and the install lifecycle of the install family (`npm install`, `ci`, `rebuild`, `link`, bare `yarn`, `pnpm install`, `bun install`) are judged; `pnpm m|multi|recursive` runs in every package; `npm exec --call=`, `mise exec <tool> --` and `mise x --` are read; a release tool's `--help` and `--version` pass; `--dry-run=<v>` is read as npm's option parser reads it (`false`, `null` and a numeric zero, the empty value included, are false). Valued options are skipped before `npm exec -c`/`--call` and before yarn's subcommand; `yarn workspaces run` and `foreach` are read; `publish <folder>` reads that folder's lifecycle; an install into a `--prefix` without a package.json and a global install read no lifecycle; a second publish or push later in an unknown program's arguments is found. A global install with no argument, `.` or a folder runs that folder's install lifecycle and is judged (a global install of registry names is not); an option the gate does not know never takes a following option as its value; yarn, pnpm and bun each have their own built-in commands (frozen from yarn 1.22.22's and pnpm 9.15.9's published bundles and the yarn 4 and bun 1 CLI references), so `yarn deploy` runs a script while `pnpm deploy` is pnpm's own. yarn's built-ins are the names both yarn 1 and yarn 4 own, so a script named after a command only one of them has (`patch`, `check`) is judged. Package scripts are judged for a push too (`postversion: git push --follow-tags`). A variable gives a directory only from a literal, unconditional assignment; any other assignment (`for`, `read`, `+=`, after `&&`) makes it unknown. A lone `&` and `|&` now end a clause for every shell reader of the gate. Measured on the committed fixtures: this repository's last 500 commit messages in seven forms (3,500 commands) give no refusal, and the 312 labelled commands of `fixtures/outward-commands.json` (this project's own session commands, masked, rebuilt by `scripts/outward-corpus.js`) are all judged as labelled.
54
+ - **Known limits of that judgement.** It prevents accidents; it is not a barrier against a determined agent. A script run in a directory the gate cannot resolve (a variable without a literal value, `~`, `-ws`, `pnpm -r`, `--filter`, `yarn workspace`, `lerna run`, `turbo run`) is looked up in the repository's `package.json` files as git lists them (tracked ones, submodules included, and untracked ones that are not ignored; node_modules excluded; outside a git work tree, a walk of at most 8,000 directories that skips hidden directories but `.github`, virtual environments and build output) and refused only when a script of that name publishes or pushes there; an unreadable `package.json` is skipped and named, not a reason to refuse. Closed, so refused with the reason named: a missing `--prefix` directory, a listing past its limit (the limit is named), a command whose structure the gate cannot read (an unclosed quote, nesting past the bound) when it names a registry program or git, a shell that runs the output of a program the gate cannot read when the command names a registry write, and an interpreter's inline or stdin program in which a registry tool is followed by a registry write — that last one is a text search inside another language, a named limit rather than an argv reading. Not read: a script file a command runs (`./release.sh`, `source ./release.sh`), `make release`, a program reached through an alias or a function, and a word assembled at run time (`npm ${V}lish`, `$(printf pub)lish`); quotes are removed as the shell removes them, so `npm "pub""lish"` is read as `npm publish`. The barrier to a registry write is the npm account's two-factor authentication and its token scopes: keep 2FA required for publishing and give agents a token without publish rights.
55
+ - **The outward judgement has a budget (A-SPEC-794.80).** Under a full profile without the publish or push flag, a command too large to judge — more than 400,000 words, more than 2,000 package directories read, or more than 900 ms — is refused with its size named and the advice to split it, instead of being judged slowly. The longest of this project's 14,531 session commands has 153 words. A global install of many folders, pnpm's recursive aliases, a `yarn workspace` chain and repeated unknown option pairs are judged in linear time; a 1 MB command of each of these shapes is judged in 0.2 s or less.
56
+ - **BREAKING: un-seal and retire are their own approval kinds (A-SPEC-794.81).** `spec_unseal` asks for kind `spec-unseal` and retiring a sealed spec for kind `spec-retire`; a grant or a `HOLMES_APPROVAL` scoped to `spec-approve` no longer covers either (an unscoped approval still does). A request filed as `spec-approve` for an un-seal or a retirement before this change stays pending and is not spent by the act, which files a request of its own kind. The session form asks both kinds, and `holmes-kit approve` shows the spec for them. A seal made through the MCP server records the server instance as `session:<instance>`, the last of the `spec-approved` event's inputs.
57
+ - **BREAKING: principle 7 — the gate and approval-processing source is sealed by a person only (A-SPEC-794.88).** The gate category now covers every module that reads or writes a grant, an actor, a seal or a decision judgement (the CLI's approve, autonomy, init and index; the MCP approval, lifecycle, entity, inspection, review and risk handlers; review verdicts; runtime dispatch; the spec transition policy, approval status and blockers), and a census test keeps it so. An A-SPEC whose Files to Touch names such a file, or a REQ or H-SPEC above one, is sealed only by a person: a declared `gate-behavior: tightens|wording` no longer self-seals it (owner decision Q4(b), 11/10, changing the decision of 10/05), a run delegation does not cover it, and under a full profile it goes to the person's form instead of sealing as full-autonomy.
58
+ - **Review repairs of the agent approval policy (A-SPEC-794.89, 794.90).** An autonomy command in a command that uses an out-of-band approval variable is refused as `profile.own-request` in any spelling; an approval read from the environment issues no profile or session autonomy where the operator guard finds an agent (a grant from the session form still does); a directory token at or above a gate root and the built gate (`dist/holmes/`) are in the gate category; R1 walks the whole chain to the REQ with trusted seal events and refuses a root-only scope. A decision records the bound of the occurrences it decided, so a second decision no longer reopens decided ones and a decision after a closed-expired request was filed again is recorded and stands; an integration's un-seal step needs `spec-unseal` before anything is published; `approval_status` advice names the act its request is for.
59
+ - **BREAKING: a sealed spec with an unbroken chain is staged without a person under a full profile (A-SPEC-794.86, R1).** This changes the 11/04 rule "spec staging is a person's form" (owner decision Q4(a), 11/10). Under a full profile with `autonomy.shellStaging` and the new `autonomy.specStaging` on (both on when absent), a staging command in the staging grammar is approved without a person when every staged spec is sealed (the seal holds and a spec-approved event names its digest), every parent is sealed and pinned by `parent_digests`, the file sits where its type and id say (REQ, H-SPEC, A-SPEC, T-SPEC), and its Files to Touch — a T-SPEC's A-SPECs' — names nothing in the gate category. Anything else still goes to the person's form, with the failed R1 condition named. `"autonomy": { "specStaging": "off" }` in `ax.config.json` brings back the form for every spec path.
60
+ - **A request no requester can follow up closes unrun after 24 hours (A-SPEC-794.84).** At session start, an approval request with no requester run or server (a hook's or a CLI's filing), not held by a person, more than 24 hours old (from the first filing of a decision-inbox request, whose repeats are not recorded, and from the last refusal of a refusal-log request), is closed with the queue event `closed-expired` (actor `policy:ttl`). Nothing runs; it is not a decision, so asking again files the request anew. It leaves the inbox and `approve --list`, a late grant of it is refused with the reason, and the session banner says how many were closed. The refusal log itself is not changed. A 0.40 reader ignores the event and keeps such a request pending, as before.
61
+ - **Every path names a spec transition's kind from one table (A-SPEC-794.85).** Entity recovery, the integration audit and renumber now resolve an un-seal by `spec-unseal` and a retirement by `spec-retire`, as the MCP tools do since 794.81 — a `spec-approve` authority no longer recovers an interrupted un-seal or retirement. `approval_status` reports a spec's un-seal and retirement requests as well as its seal request, naming the kind. Upgrading note: a 0.40 `holmes-kit approve --list` does not list `spec-unseal` or `spec-retire` requests; decide them in the session form (`approval_ask`) or with the 0.41 CLI.
62
+ - **An autonomy profile is issued only through its own request (A-SPEC-794.83).** A shell command that sets an out-of-band approval variable itself and runs `holmes-kit autonomy full`, `on` or `delegate` is refused with the code `profile.own-request` and files nothing, so no config-write grant opens it — before, it was filed as an "environment read" whose grant ran the command with the approval the agent wrote. Run the same command without the variable: it files its own request, and the session form now names what that request changes against the profile in force (`push off → on`, a new profile with its flags, or no flag change).
63
+ - **Deeply nested groups are closed too (A-SPEC-794.87).** A command whose subshell groups nest more than 64 deep (1,000 in 794.87; 64 since 794.92 — real commands nest at most 2) is unjudged and refused under a full profile, naming the depth (45,000 groups ran the hook to its 20-second deadline and the refusal blamed an internal error); group bookkeeping is linear; a refusal lists at most 200 findings and counts the rest.
64
+ - **A command too large to judge is refused whatever the flags (A-SPEC-794.82).** The budget's closure is a verdict of its own ("unjudged"), not a publish: a profile with the publish flag on and the push flag off no longer lets a push inside such a command through, and a profile with both flags on refuses it too. A clause of more than 20,000 words is not judged; recursive pnpm aliases and `yarn workspace` chains keep the options between their links in one loop (they ran out of memory at 1 MB); an unknown program before nine unknown option pairs and a registry write is closed again (794.80 let it pass); the clock is read in the global-install loop and per finding, and the clause text of a finding folds only a window.
65
+ - **A person's seal opens a gate file for 12 hours (A-SPEC-794.95).** The write rule below is bound to one seal: a principle 7 file is written only within `autonomy.sealWindowHours` (12; a setting from 1 to 12 shortens it, and a larger one is read as 12 — it was clamped to 1..24, and raising it in `ax.config.json` reopened a window that had closed, A-SPEC-794.113) of a person's seal of an approved A-SPEC whose Files to Touch names it, timed by the ledger; an older seal opens nothing (sealing the spec again is one answer in the session form). Each write a window opens is recorded (`principle7-window-write`: the file, the spec, the seal's time and actor). A person's seal is an allow-list: the session form's channel (or a host's approval dialog) only; autonomous, full-autonomy, delegated, plain-name and grant-spent seals do not count. A seal spent from a grant the person minted with `holmes-kit approve` records `channel:cli-terminal` and the grant's nonce for audit, but is not counted: a grant file can be written by a patch, and the server cannot tell the two apart (proving a grant's origin from the ledger is planned for 0.42). The rule judges where the write lands (a doubled slash, a symbolic link inside the project, a second hard link) and git writing a gate file from its store (`checkout`, `restore`, `apply`, `stash pop|apply`). The category gains the seams of the gate's decisions (spec parser, digest, store and succession, the anchor reader, configuration, the project root, the MCP server and supervisor, and others) and four seal judgements, held by a census of the entry points' imports (A-SPEC-794.94).
66
+ - **Principle 7 judges against the live gate's baseline (A-SPEC-794.97).** The working-tree check below compares with the commit the live gate was built from, recorded in the ledger when the gate allows a build with no unopened gate change — not with HEAD: a gate change committed without a person's window still blocks the turn's end, a commit and a build, whatever command made the commit. A window opens a committed file only for the content (blob) it saw at a Stop, commit or build inside it. The judgement reads the working tree, the index and HEAD, each against the baseline (staging a change and then restoring the working tree no longer hides it), untracked and ignored gate sources, and entries marked assume-unchanged or skip-worktree whose content differs; git is read with replacement objects off, and `git replace`, a refs/replace ref and `git update-index` on a gate file are refused. The refusal warns first that a restore from the baseline also discards other people's commits made after it, then names the ways out: a person's seal; undoing a branch switch or a pull; restoring from HEAD where a window saw HEAD's content; or making the file equal to the baseline (lists stop at 20 files). With no baseline row (a new clone or worktree) HEAD stands in, and the first baseline is recorded only by a build inside person-seal windows that name every gate file the commits since they opened changed — or the ledger holding the baseline row is committed or pulled. A latest baseline row whose commit this repository no longer holds closes the judgement and the text says so; it fell back to the latest baseline held, and moving a ref back and collecting the newer commit then made an older gate the baseline (A-SPEC-794.113). A window records the content it saw whether or not another file is unopened, and with nothing changed since a baseline at HEAD, Stop, a commit and a build skip the ledger's trusted read. A git apply or `patch` into `.ax/ledger` or `.ax/approvals`, and a shell write into a gate file without a window, are refused; a package script that reaches the build is a build.
67
+ - **The working tree is principle 7's seam (A-SPEC-794.96).** In Holmes-Kit's own repository, a change to a gate file (staged, unstaged or untracked; the gate's JSON tables and, there, `.claude/` and `.mcp.json` included) that no open person-seal window names keeps the agent's turn from ending, refuses `git commit` (its staged changes; with `-a`, its tracked ones) and refuses a build — with two ways out: a person seals an A-SPEC naming the file, or the file is restored from HEAD. The git-command pre-judgement is narrowed to fast feedback (a checkout or restore from another tree, an `apply` that writes the working tree, `stash pop|apply`); restoring from HEAD or the index, `--check`/`--stat`, a command run with `-C` or after `cd`, and `git` as an argument are left to the working-tree check. A window also opens the test files an approved T-SPEC of the open A-SPEC names. A 0.41 decision row writes `covered` as the absolute bound, equal to `through`, so a 0.40.1 reader no longer reopens decided occurrences.
68
+ - **Round-2 review repairs (A-SPEC-794.91, 794.92, 794.95).** A command substitution inside arithmetic (`$(( $(…) ))`, `(( x = $(…) ))`, `for (( … ))`) is read, and `$((cmd) )` is read as the subshell it is; a 0.40 or 0.40.1 decision row bounds no more occurrences than were filed by its time (on a 0.40.1 queue a request filed again after such rows stayed hidden); an integration retirement is judged by the spec id, and deleting a sealed spec's document is a retirement; the queue lock's re-entry is per root and a stale lock is reclaimed by renaming it; a sweep appends its closures in one write.
69
+ - **Principle 7 binds the write too (A-SPEC-794.91 N2).** Holmes-Kit's own gate and approval-processing source (the principle 7 paths under `src/`, and `bin/holmes-*`) has no tenure any more: an anchor already in the file does not open it. An Edit or Write needs an approved A-SPEC whose current seal a person made (the ledger's `spec-approved` actor is neither autonomous, full-autonomy, delegated nor a tool) and whose Files to Touch names the file; an environment code-write approval does not open it. `dist/holmes/` is refused to Edit and Write — the build writes it. This applies to paths only Holmes-Kit's own repository has. A scope that names a root-level configuration file among directory paths (any root file but a Markdown document; AGENTS.md, CLAUDE.md and GEMINI.md count as configuration) no longer self-seals and is not staged by R1 — measured over this repository's A-SPECs, 26 of the 221 scopes that mix a root file would have gone to a person, not the 195 that name only CHANGELOG.md or README.md. R1 stages a REQ or an H-SPEC only when every A-SPEC beneath it would be staged (one with none beneath goes to a person). `dist`, `dist/` and `dist/holmes` are gate tokens both ways. `profile.own-request` reads the command by words per clause: a subcommand the gate cannot read statically (`autonomy $S`, `${A}nomy full`, `autonomy $'\x66ull'`) is refused, and an `on` in another clause (`autonomy status; git commit -m "turn it on"`) no longer is.
70
+ - **Review repairs before release (A-SPEC-794.91 N1, 794.92).** One operator guard decides every autonomy widening: an environment approval issues no session autonomy, full profile, run delegation or `init --autonomy` where the guard finds an agent (a grant from the session form still does). A here-document holding a group nested too deep to read no longer hides the substitutions after it: the command is unjudged and refused under a full profile; group nesting is bounded at 64 (real commands nest at most 2 deep) and the group stack is no longer copied per clause. A decision row keeps 0.40's meaning of `covered` (the occurrences it decided) and records the occurrence bound in a new field `through`, so a 0.40 and a 0.41 CLI deciding on one queue no longer reopen each other's decided occurrences. An entity integration that retires a sealed spec needs a `spec-retire` authority (a `spec-unseal` one no longer completes it) and records `spec-retired`, as `spec_retire` does. The expiry sweep reads and closes under a queue lock that a person's decision or hold also takes, so a hold written during a sweep is not closed over; a lock not taken in 2 seconds closes nothing, and a lock older than 30 seconds is broken.
71
+
72
+ ### Fixed
73
+ - **A full `test_run` gives its tests the tree it runs in as `CLAUDE_PROJECT_DIR` (A-SPEC-794.119; present since 0.40.1).** A full run executes in a HEAD worktree, but its test children kept the MCP server's `CLAUDE_PROJECT_DIR`, which names the live checkout. A test that read it judged the live working tree, not the HEAD snapshot the evidence names. So did a test that started a process following it, such as the Holmes-Kit stdio server, whose spec store follows that variable. Measured 2026-11-12/13: Holmes-Kit's own surface-conformance suite failed only in MCP-run full runs, and only while the checkout held spec files HEAD did not. Where the server's environment carries the variable, the test children that `test_run`'s runners start for its units (jest, pytest, go and the others) now get the real path of the tree the run executes in: the HEAD worktree of a full run, the work tree of a scoped one. A server that does not carry the variable passes none, as before. Not reached (named limits): the project's `testRun.prepare` command, which runs in the worktree before the units with the server's variable unchanged; `test_run --mutate`, whose mutation runs keep the variable as the server carries it; and a test that reads the path from a file, or from a process it did not start.
74
+ - **Session usage is counted once per response (A-SPEC-564.5).** Claude Code writes one response as several transcript records, each carrying the same usage, and the Stop hook's session summary added every record — about 2.7 times the real tokens and turns on this repository's largest transcripts. It now counts one usage per distinct message id (the line with the largest output; ties go to the later line). Lines without an id still count on their own. `session-context` records written from 0.41 on are therefore about 1/2.7 of earlier ones; do not compare `tokenTotalsExact` across that boundary. Records already in the ledger are not rewritten.
75
+ - **The usage record names its counting rule (A-SPEC-564.7).** New `session-context` usage records carry `count: "per-message-id"`. The maintainer's field report adds only marked records into `tokenTotalsExact` and the `byModel` usage sums, and reports unmarked (older, per-record) ones as `legacyRecordCount`, so the two counts are never added together.
76
+ - **A refreshed recovery skill is no longer called changed (A-SPEC-794.100).** Under a full profile, the autonomous shell approval refused staging, saying the installed recovery skills were "product-installed … (changed)". In the same workspace, `doctor --target` called those skills current. The approval compared each skill with the digest the last `init` recorded in `.ax/state/install-manifest.json`, and `holmes-kit skills refresh` does not rewrite that record. Doctor compared each skill with the running build's own playbook. When the approval and doctor run from the same install, they now ask that one question through doctor's `playbookSkillStates` (A-SPEC-794.106: for a skill doctor calls current, drifted or missing). A skill that differs from the playbook is refused as `drifted`. The refusal names the install it was judged against (version and path) and the route: run `holmes-kit skills refresh --target <root>` with that install, then a person commits the file. A skill doctor calls foreign (user-owned, no holmes-kit marker), aliased, unresolvable or source-unreadable, and a linked skill file or directory, keeps the digest judgement it had before. All other manifest entries, the manifest-tampered and manifest-invalid checks and the staged and in-index checks are unchanged.
77
+ - **The reference cannot be chosen by the judged workspace (A-SPEC-794.106, 794.107, 794.110; review A critical three times).** In a checkout the package root is the workspace, so each reference the approval read was one the workspace could move: the working tree's playbooks (edit the playbook with the skill), HEAD (an agent commit of `playbooks/`, even with `--no-verify`), then a baseline commit behind a binding that read the target's git state (remove `package.json` from the index, or point `core.worktree` elsewhere, and the binding read "deployed"; move a ref back and garbage-collect the newer baseline, and an older commit became the reference).
78
+ - The binding reads one fact: the real path of the running package. It is deployed when that path has a `node_modules` segment, and judged against the package's own playbooks. No git command, index, HEAD, `core.worktree`, environment variable or file of the target decides it.
79
+ - Any other package is judged against the sha256 of each `PLAYBOOK.md` that the gate wrote into its ledger — in the `principle7-baseline` row, in this writer's own chain — when it last allowed a build. No git object is read. With no such row, a latest row without digests, or a chain that does not verify, no skill is shown current and the refusal names which of these it is; an older row never stands in.
80
+ - Doctor, init and the approval read that reference through one function, so they agree when they run from the same install; `doctor` prints a `recovery skills reference` row naming the recorded build it judged against, or why there is none (and, run from another install than the one the sessions load, that the gate judges against that one).
81
+ - `playbooks/` is a principle 7 write, commit and Stop path in Holmes-Kit's own repository. `src/holmes/project/playbook-skill-states.ts`, `playbook-reference.ts`, `running-package.ts`, `installer-markers.ts` and `bounded-io.ts` are category paths.
82
+ - The refusal names the route for the state found. A skill that differs from the reference playbook: `node <install>/bin/holmes-kit.js skills refresh --target <root>`, then a person commits the file. A playbook that is not the recorded one: if the change is wanted, a person seals an A-SPEC naming the playbook in a session in that checkout, a build run in a governed agent session inside that window records it (only a build the hook judged records; one run outside such a session does not), then refresh and commit the refreshed `SKILL.md` — in Holmes-Kit's own repository a `SKILL.md` under `.claude/skills` is itself a principle 7 path, so the sealed spec names it as well as the playbook; if the change is not wanted, restore the playbook. With no recorded build at all the reason is given once, with the skills it closes: a build inside a person's seal window, in a governed agent session, makes the baseline.
83
+ - **Principle 7 no longer turns off when `src/holmes` is moved (A-SPEC-794.111, 794.112).** Principle 7 applied "where a directory `src/holmes` exists under the root", and the hook allows `mv src/holmes src/h2`, `git mv` and replacing the directory by a link (measured 2026-11-12). While the directory was away, the write judgement no longer treated `.claude/`, `tsconfig*.json` and `playbooks/` as principle 7 paths, and the commit judgement and Stop were skipped. The predicate now reads the running package's real path — whether the judged root lies inside the checkout the running gate is built from — and holds no switch: the suites replace that module in jest's registry only, and a census test refuses a setter or an environment read on the predicate's path.
84
+ - **A test run no longer rebuilds the live gate (A-SPEC-794.109).** In Holmes-Kit's own checkout, the seven cpg inline-parser suites ran `tsc` in the repository whenever `dist` was older than the source. A plain `jest` run therefore replaced `dist` — the live gate of a development binding — with the working tree's code, without the hook's build gate, a build id or a principle 7 baseline (measured 2026-11-12: all 449 files under `dist/holmes` rewritten). The suites now build into a directory under the system's temporary directory, one per source state, and neither read nor write the repository's `dist`. A ratchet test refuses a test or test-support file that runs the compiler without `--outDir`. The build's parent is a directory of the user's own (mode 0700, the user id in its name), its lock names the process holding it so a holder that died is not waited on, and at most four builds are kept (A-SPEC-794.110). Consumers are not affected: the helper never shipped.
85
+ - **init records only the skills it owns (A-SPEC-794.107).** A skill init left untouched ("Left your own … untouched") is no longer written to the install record, and re-running init drops an earlier record of it. A recorded skill without the holmes-kit marker keeps the digest judgement, because a product skill stripped of its marker is changed bytes. When it changed, the refusal first warns that on a path holmes-kit installs (`holmes-*`) a skill stripped of its marker is a changed product file, then names the way out for your own skill: `node <install>/bin/holmes-kit.js init --force --target <root>`, which needs the operator's approval and rewrites the wiring with its defaults (A-SPEC-794.110).
86
+ - **Known limit, not a basis for judgement:** `tokenTotalsExact` is the value at a session's first Stop, not the whole session (the Stop hook writes usage once per session). A resumed session is counted under two session keys. A transcript larger than about 512 MB cannot be read as one string and is skipped without a record. The repair is planned after the 0.41 goals.
87
+
88
+ ## [0.40.1] - 2026-11-09
89
+
90
+ ### Upgrading
91
+ - **Run full push evidence again.** The push gate now accepts only a full `test_run` that ran in a clean worktree of HEAD (`ranIn: head-worktree`). Records written by 0.40.0, and any scoped run, are refused: run `test_run({ root, full: true })` once at the commit you push. Nothing has to be added to `.gitignore`.
92
+ - **New `ax.config.json` settings, both optional:** `testRun.prepare` (an argv run in HEAD's worktree before the suite, for example `["npm", "run", "build"]`), `testRun.linkWalk` (`{ "entries", "seconds" }`, the node_modules walk bound, default 500000 entries and 20 s) and `testRun.pythonNames` (the module-name cap of the environment question, default 20000).
93
+ - A pytest project needs python 3.11 or later for push evidence.
94
+
95
+ ### Known limitations
96
+ - A package that requires your work tree by absolute path (`node-abs-require`) is not detected.
97
+ - Forgery resistance is not claimed: a HEAD conftest can rewrite the loaded-module record (the environment question still holds).
98
+ - A legacy sparse checkout (`core.sparseCheckout` in the shared git config) keeps HEAD's worktree sparse, because turning it off would write the shared configuration.
99
+ - A JavaScript workspace monorepo whose `node_modules` links into the work tree is refused as `environment` (re-pointing the links to HEAD is a 0.41 candidate).
100
+ - A `NODE_PATH` entry inside the work tree is refused as `environment`.
101
+ - The environment question imports HEAD's packages to find their submodules, so a package `__init__` runs during it.
102
+ - xdist is judged by the environment question; no xdist run was measured.
103
+
104
+ ### Added
105
+ - **`test_run` takes `workers` (A-SPEC-466.1 to 466.3).** An integer from 1 to 64 reaches jest as `--maxWorkers` on a scoped and on a full run. A non-number is refused by the argument validator; a number outside 1 to 64 is refused as a handler refusal before anything is derived or run; `null` reads as omitted. Omitted, jest keeps the project's own setting, as before.
106
+ - The answer carries `workers`, the count that reached the jest argv (`null` when none did), and the green evidence record keeps the same value.
107
+ - Runners other than jest take no count. When they ran, they are listed in `workersIgnoredBy`, in the answer and in the evidence.
108
+ - When nothing took the count, `workersIgnored` says why: `mutate`, `no jest group` or `nothing ran`.
109
+ - **`test_run` takes `timeoutMinutes` (A-SPEC-466.6).**
110
+ - It is a time budget for each runner child of the run: an integer from 1 to 180 minutes, 30 when omitted or `null`. Any other number is refused before the run, never clamped.
111
+ - Every runner child takes it, a `mutate` run's jest runs included. It bounds each child, not the run as a whole: a run with jest and pytest children can take up to twice the budget. Every answer, `mutate` included, and the green evidence record carry the applied value.
112
+ - A run past the budget still ends "not judged" and records nothing. No gate judges on the value.
113
+ - Before this, a two-worker full run could not finish inside the fixed 30 minutes (measured 2026-11-04: stopped, not judged).
114
+ - **Limit:** the pre-push gate does not read the recorded worker count. Running the push-gate evidence at two workers is an operating promise, with no machine check.
115
+
116
+ ### Changed
117
+ - **BREAKING (gate behaviour, tightens): push evidence is a full `test_run`, asked for with `full: true` (A-SPEC-128.2, 128.3, 128.4, 128.5).**
118
+ - **Each push now needs a full run at the pushed commit.** Its cost is the whole suite: on this repository, about 40 minutes at two workers.
119
+ - `full: true` defaults to a 120-minute budget.
120
+ - A run stopped at its budget answers with the next call (`nextCall`, a doubled budget up to 180, keeping `workers`). At 180 it says the ceiling is reached instead.
121
+ - A scoped run is never push evidence.
122
+ - **The gate counts the tests the runner ran (`testsRun`), not their attribution to A-SPECs.** A full run of a Go module, or of tests that carry no anchor, used to attribute nothing. The gate then refused with "executed 0" and named the same call again (A-SPEC-128.5).
123
+ - **Every detected ecosystem must have run at least one test (`testsRunBy`).**
124
+ - Push evidence is one predicate, shared by the writer, the gate and `review mrp`. It needs an integer `testsRun` of at least 1 and a per-ecosystem count of at least 1 for each detected ecosystem (A-SPEC-128.6).
125
+ - Before this, a Go module beside an all-skipped jest suite passed.
126
+ - **Build-file ecosystems are detected at the run root only.** go.mod, Cargo.toml, pom.xml/build.gradle and *.csproj/*.sln count there, so a nested test-fixture module no longer makes a jest repository "need" go.
127
+ - A `tox.ini` counts only with a `[pytest]` or `[tool:pytest]` section.
128
+ - jest and pytest test files still count at any depth.
129
+ - **The newest observation decides.** A failed full attempt is written first and then voids the older test evidence, whatever head that evidence was taken at; when the evidence cannot be removed, the attempt is written over it in place. Its record names the ecosystems that ran nothing (`missing`). A record that could not be written or voided is named in the answer (`recordFailed`) (A-SPEC-128.7, A-SPEC-128.8).
130
+ - **A full run runs exactly the detected ecosystems.** An impacted test file of an undetected ecosystem (a fixture go test in a jest repository) is named in `notRun` instead of running its runner at the root. Nested build files are named in `notDetected`, and the push gate repeats them as a notice (A-SPEC-128.7).
131
+ - **Every push refusal names the act that clears it.** That act is the full call or "the fix is the tests" (a real red run, a repository with no test, or a suite with every test skipped). A record of the wrong shape (a string `detected` or `missing`, an array `testsRunBy`, a `testsRun` that is not the sum of its parts) is refused by name. An exception inside the judgement now refuses the push instead of exiting 0 (A-SPEC-128.7).
132
+ - **`testRun.excludeDirs` takes a root-relative path prefix.** An entry with a `/` (`test/fixtures/pyproj`) is a path from the root. An entry without one is still a directory name at any depth (A-SPEC-128.7).
133
+ - `./x` and `x/` are root paths too, and doubled or dotted segments fold.
134
+ - Absolute entries, entries that leave the root, and entries that name nothing are ignored, and the answer names them in `excludeDirsIgnored` (A-SPEC-128.8).
135
+ - **The push refusal never suggests an exclusion** (A-SPEC-128.8). Its acts are "run the full call" and "fix the tests"; a red run is always "fix the tests". 128.7 named an `excludeDirs` entry for a tree it judged foreign. That inference could hide the project's own red suite, and it alternated between two trees.
136
+ - **A full run runs every execution unit, each in its own directory** (A-SPEC-128.9). A unit is the root or a directory with its own build or configuration file, holding something of its language to test.
137
+ - Covered: a nested go module, a go.work member, a cargo, gradle/maven or dotnet project, a `frontend/` with its own package.json, a `backend/` with its own pyproject.toml.
138
+ - jest and pytest trees under a root that already runs them stay with the root.
139
+ - A sub-module's red test is refused. 128.8 allowed it unrun, and that hid the red.
140
+ - jest is assumed only beside a root `package.json`, and only where there is code to test.
141
+ - **A push without evidence is allowed only when nothing is testable**: no test file and no implementation code, as with README, settings or docs (owner, 2026-11-06). It comes with a notice and a `{ts, head, reason: "no-tests"}` line in `no-evidence-pushes.jsonl`. Implementation code without tests is refused: "write tests" (A-SPEC-128.9).
142
+ - **`.gitignore` and `testRun.excludeDirs` reach the runners.** jest's exclusions are appended to the patterns `jest --showConfig` resolves, so a `jest.config.*` list survives. pytest gets `--ignore`, and go gets a package filter. A tree the user excludes is not detected, counted or run. cargo, gradle/maven and dotnet take no directory exclusion (A-SPEC-128.9, A-SPEC-128.10).
143
+ - **The file universe is what git sees** (`git ls-files --cached --others --exclude-standard`) minus `excludeDirs`. Nested `.gitignore` files count, and a tracked file under a later ignore pattern stays in (A-SPEC-128.10).
144
+ - **After the run, every detected test must have run** (A-SPEC-128.10). jest and pytest are checked per file, go per package, and cargo, gradle/maven and dotnet per build root.
145
+ - A test that a runner configuration (jest `roots` or `testPathIgnorePatterns`, pytest `testpaths`) left unrun is named, and the push is refused as `collect`.
146
+ - A directory with its own jest or pytest configuration is its own unit, and its parent skips it.
147
+ - **Code is judged per build root.** A build root whose code has no executed test is refused, and code with no build file names the file to add. Configuration and docs files (`*.config.*`, `conf.py`, `.eslintrc.*`, `setup.py`) are not code; `.groovy` and `.scala` are (A-SPEC-128.10).
148
+ - **A refusal is `fix-tests`, `collect`, `rerun` or `environment`.**
149
+ - `environment` is the runner itself missing, or a stop at the 180-minute ceiling: install the runner, or split the suite or ask the owner. An ENOENT inside a test, or a module a test imports, is the tests. Neither act names an exclusion.
150
+ - pytest runs with `-p no:cacheprovider`, so a run leaves no `.pytest_cache` (A-SPEC-128.9, A-SPEC-128.10).
151
+ - **A `test_*.py` with no test function, under no collection rule, is not a test.** It is named in `notTests` and never required (A-SPEC-128.10).
152
+ - **Every module name, and the channels themselves** (A-SPEC-128.17).
153
+ - The environment question now asks every dotted module name of HEAD's tracked python files. That covers namespace packages, `python/` and `packages/x/src` layouts, and a finder that redirects only a submodule. HEAD is appended last to `sys.path`, so a parent package resolves.
154
+ - The cap is `testRun.pythonNames` (default 20,000).
155
+ - An interpreter import-path entry or a `NODE_PATH` entry inside the work tree is environment on its own.
156
+ - `loadConfig` now keeps `testRun.linkWalk` (it was dropped, so the setting never took effect).
157
+ - The question runs with `-P`, so HEAD's own `json.py` cannot run in it; python 3.11 or later is needed.
158
+ - The answer is read from a file, not stdout, and the question runs within the run's budget and process group.
159
+ - **The run's environment is asked where HEAD's own names resolve, before any test** (A-SPEC-128.16). The 128.15 record was one snapshot of the main process. A subprocess import, xdist workers and a fixture that restores `sys.modules` all escaped it, because all three use an environment that already resolves HEAD's names to the work tree.
160
+ - The interpreter is started in HEAD's worktree with the unit's environment, the current directory removed from `sys.path`. It reports `find_spec` for each of HEAD's top-level names (the unit, its `src/`, the root and the root's `src/`). One resolving into the work tree is environment.
161
+ - node resolves HEAD's package names from each package directory, `NODE_PATH` included.
162
+ - Exemptions are the interpreter's library directories (sysconfig stdlib, platstdlib, purelib, platlib), so a venv at the work tree root no longer exempts the whole tree.
163
+ - `testRun.linkWalk` sets the walk bound, and an unreadable directory is environment.
164
+ - Install detection reads `pnpm@8`, `npm exec -- …` and `--workspace <x>`.
165
+ - **The run's provenance is judged by what it loaded, not by listing channels** (A-SPEC-128.15). A re-review of 128.14 found two channels the list missed:
166
+ - a `.pth` import that installs a `sys.meta_path` finder (how editables, hatch, pdm, scikit-build-core and meson-python work);
167
+ - a workspace link deeper than two levels of `node_modules`.
168
+ - What changed:
169
+ - pytest now runs with a holmes plugin that records every loaded module; one from the work tree, outside HEAD's worktree and the interpreter's prefixes, is environment. The import-path pre-check is gone.
170
+ - Every link of a linked `node_modules` is resolved at any depth (bounded: 500,000 entries or 20 s).
171
+ - GOFLAGS is go's own value (`go env`, so a `go env -w` file counts), and `-test.run`/`-test.skip` count.
172
+ - `PYTEST_PLUGINS` is dropped.
173
+ - `--confcutdir` is the inifile's directory again, pytest's own default.
174
+ - Short-option clusters stop at a value-taking option, so `-Wmodule` and `-pmypkg` are not selections. An indented line continues addopts.
175
+ - The worktree base is `holmes-headwt-<user>`, not `holmes-run-<user>`: run exec sweeps `<tmp>/holmes-run-*`. A group- or world-writable base is refused. A worktree git cannot remove is named in the answer (`worktreeLeft`). Empty key directories are removed. Sparsity inherited through the worktree's own config is turned off there.
176
+ - Install detection skips flag values and reads through `npx`, `corepack` and `sh -c`. Prepare and the units share one budget.
177
+ - **HEAD's worktree moves out of the repository, and holmes removes only what git lists there** (A-SPEC-128.14, security). In 128.13 the leftover sweep built a path from any `*.owner.json` name and deleted it without asking git. A file named `...owner.json` removed the repository root and `.git`; a link with an owner file removed a user's linked worktree and its uncommitted work.
178
+ - The location is `<os tmp>/holmes-run-<user>/<key>/<id>/`. The base directories are 0700 and refused when they are a link or another user's. `.holmes-run/` no longer has to be gitignored.
179
+ - Removal is `git worktree remove --force` of an exact listed path that is id-shaped and directly under the key directory. No `rmSync`, no repository-wide `git worktree prune`.
180
+ - The worktree is made with `--no-checkout`, then `reset --hard` with sparsity off for that call: no post-checkout hook runs, and the shared `.git/config` is untouched.
181
+ - `testRun.prepare` runs within the run's `timeoutMinutes`. A package-manager install is refused.
182
+ - **The run reads only HEAD:**
183
+ - a `node_modules` entry linking into the work tree, or a python import path inside it (editable install), is environment;
184
+ - pytest gets HEAD's configuration file with `-c` (an empty one when HEAD has none) and `--confcutdir` at the worktree root;
185
+ - attribution and RED-first records read HEAD's anchors.
186
+ - **Selection is judged conservatively:**
187
+ - `-k`, `-m`, a clustered `k`/`m`, `--deselect`, `--lf` or `--sw` anywhere in the addopts of any pytest configuration file at or above the unit is environment, in INI continuation, TOML string and multi-line array forms alike;
188
+ - `PYTEST_ADDOPTS` is dropped;
189
+ - `GOFLAGS -run/-skip` is environment.
190
+ - The outside-the-repository judgement is made from the repository root.
191
+ - **A full test_run tests the commit: a clean worktree of HEAD** (A-SPEC-128.13; location amended by 128.14). Untracked, ignored, modified, assume-unchanged and skip-worktree files never reach the run. 128.12 refused only modified or deleted tracked source; a red HEAD still pushed with an untracked helper, a modified json, snap or jest config, or an assume-unchanged file (both re-reviewers reproduced it).
192
+ - holmes links the gitignored `node_modules` and runs `ax.config.json` `testRun.prepare` (an argv; never guessed) before the units. This repository declares `npm run build`.
193
+ - The record carries `ranIn: head-worktree` and the times of creation, preparation and run. The push gate accepts no full record without the marker; an older one is rerun.
194
+ - The work-tree rule of 128.12 is removed, and editing after a green run no longer voids the commit's evidence.
195
+ - **Passed means exit 0 and no failure in the report**: jest `numFailedTests`/runtime errors, JUnit failures/errors, go `fail` events. `testFailureExitCode: 0`, pytest `session.exitstatus = 0` and `TestMain`'s `os.Exit(0)` no longer pass a red.
196
+ - Code is credited only by executed tests of the scanned universe; a test outside the repository is environment. A gitlink under a dot directory is excluded and named too.
197
+ - go expects only the `_test.go` files `go list` builds on this platform with no tags; the others are named in `notBuilt`. A red behind a build tag is a named limit.
198
+ - Also outside the surface: test files of rust, java, C# or go under no build root; unsupported build files (Gemfile, composer.json, …); pytest `python_functions`, `python_classes`, `-k`/`-m` in addopts; jest `testNamePattern`. "Nothing to test" also needs no test file.
199
+ - jest: one configuration source (the root's or one directory's); a script's `--config` is outside the surface, a `jest.config.base.js` fragment is not. pytest skips its default norecursedirs and gets `--confcutdir`.
200
+ - **Push evidence only on the 0.40.x supported surface; outside it, one honest refusal** (A-SPEC-128.12, owner decision 2026-11-08). The same axis broke a third time on new inputs, so 0.40.x was narrowed. README opens with the table.
201
+ - Evidenced: jest with one configuration and one project, pytest under default names, go. Refused as `environment`, "이 구성은 0.40.x가 증빙하지 않습니다 — 0.41 / 오너 결정":
202
+ - cargo, maven/gradle and dotnet build roots;
203
+ - jest `projects`, several jest configurations, or one chosen with `--config`;
204
+ - a declared pytest `python_files`;
205
+ - a work tree whose tracked tests or code differ from HEAD.
206
+ - holmes passes jest no ignore argument and makes no `--listTests` call. Exclusions (`.gitignore`, `excludeDirs`, submodules) are judged after the run. A test jest reported under one leaves the judgement; if it ran red, the push is `environment`, naming it. 128.11 merged every project's ignore list onto the CLI, and jest applied it to every project, so one project's red was hidden.
207
+ - A build root's code is tested only by an executed test whose own nearest build root is that root. 128.11 also counted "a unit ran at this root", and a root unit that ran a nested package's tests credited the root.
208
+ - A git submodule is excluded whatever `excludeDirs` says. Before, an entry naming the gitlink dropped it from the exclusions and its red ran.
209
+ - go: GOOS/GOARCH file names are matched to this platform; test names are Unicode identifiers; the module's `vendor/` is not expected (a nested `internal/vendor` is, since go runs it).
210
+ - No runner reader throws: a config logging a JSON list of paths that do not exist made 128.11 throw out of the handler.
211
+ - A run that names an environment is never "nothing to test": a cargo crate whose only code held its tests passed that way.
212
+ - The jest, JUnit and go report readers moved to `review/test-reports.ts`; `test-runner.ts` is 1,073 lines.
213
+ - **No inference before the run; an unreadable output is refused, never defaulted** (A-SPEC-128.11).
214
+ - The expected tests are named by default naming only, plus a declared pytest `python_files`. pytest `testpaths` and a narrower `python_files` no longer remove a file, so a test they leave unrun is refused as `collect`.
215
+ - A build root's code is tested only by a test whose own nearest build root is that root, or by a unit run at it. Before, a nested jest package's tests counted for the root's python code.
216
+ - jest's report is read from `--outputFile`, and `--listTests` / `--showConfig` from well-shaped JSON only. A config that logs `[…]` or `{…}` no longer drops the user's patterns to jest's default. Every project's `testPathIgnorePatterns` is kept. An output that cannot be read makes the unit `environment`. pytest gets `--rootdir=<unit>`.
217
+ - A git submodule is an excluded tree, named in `notDetected`. A sparse checkout that leaves a test file out of the work tree is `environment`.
218
+ - go: a package whose tests all skip counts as run; `testdata/` and `_`/`.` directories are not expected; a `_test.go` with no test function is in `notTests`.
219
+ - The scan decides each directory once: 20,000 files under 2,000 build roots scan in about 0.55 s measured alone.
220
+ - Named limits: a pytest `-k` deselection inside a file, and go build tags, are below the evidence granularity.
221
+ - **A full run is evidence only when every test ecosystem the project has ran.**
222
+ - Detection also reads configuration files: `pytest.ini`, `tox.ini`, `setup.cfg` with `[tool:pytest]`, `pyproject.toml` with `[tool.pytest…]`, `go.mod`, `Cargo.toml`, `pom.xml`, `build.gradle` and `*.csproj`.
223
+ - A green full run that missed one records a full attempt and names the missing ecosystem (`notFullBecause`).
224
+ - **`reference/` is no longer skipped by default.** List vendored or reference trees in `ax.config.json` under `testRun.excludeDirs`.
225
+ - A full run that is red, stopped or short of an ecosystem leaves a `full-attempt` record. A push after it is refused instead of passing as an unrun repository.
226
+ - A test-evidence file that exists but cannot be read is a push refusal. Before, it passed with the activation notice.
227
+ - `full: true` is refused together with `mutate`, or with `base` or `head` alone; a `null` base or head reads as omitted.
228
+ - The defect this closes: in 0.40.0 a passing scoped run wrote the same two records a full run writes. Those were the test evidence the push gate reads and the `last-green` baseline that later runs narrow against.
229
+ - Measured on this repository on 2026-11-05:
230
+ - one scoped run of 25 tests passed after two full runs of the same line had failed;
231
+ - the push gate then accepted the head;
232
+ - `last-green` held a tree no full run had verified.
233
+ - **`test_run({root, full: true})`** runs the whole suite whatever changed. It is refused together with `base`/`head`.
234
+ - The push refusal, the gate's no-ledger notice and the publish playbook all name this call.
235
+ - Running exactly that call clears the refusal.
236
+ - Only a full run writes the test evidence and a baseline. Both carry `mode: full` and the tier. The test evidence also carries the number of test files that executed (`ranFileCount`) and the ecosystems that ran (`ranWith`).
237
+ - **A full run runs every test ecosystem the project has** (for example jest and pytest), not only those the change touched. A full run can therefore now fail on an ecosystem it used to skip.
238
+ - A scoped run writes `.ax/ledger/scoped-evidence.json`. It does not write the test evidence or any baseline, so `mark` on a scoped run records nothing. The answer says `baselineSkipped: "not a full run"`. A noop run writes nothing.
239
+ - The push gate accepts only full evidence, and so does `holmes-kit review mrp`. The refusal names the record's tier and mode and says "full test_run 필요".
240
+ - A record written before this release has no mode. It is refused once, until the next full run replaces it.
241
+ - A repository with only scoped records is refused too, and so is one whose scoped record exists but cannot be read.
242
+ - One with no record at all still passes with the activation notice.
243
+ - Narrowing trusts a baseline only when its provenance anchor says `mode:full`.
244
+ - The first `test_run` after the upgrade therefore runs the full suite.
245
+ - A label written with `mark` before this release is untrusted.
246
+ - Known limitation: a full Go run is not attributed to package directories, and a cargo run is not attributed to crate files, so the Stop hook's ART-4 sees no execution for Go and Rust A-SPECs after a full run. The push gate does not depend on it.
247
+ - Known limitation: the Stop hook's execution counts, `requirement_triage` and `maintenance_analyze` read the test evidence only.
248
+ - Between full runs they see it as stale; scoped runs do not refresh it.
249
+ - The Stop hook's "an explicit 0 is a violation" check therefore sees fewer zeros.
250
+ - `requirement_triage` reports fewer requirements as fulfilled.
251
+ - **BREAKING (gate-behavior, owner decision 2026-11-05): `holmes-kit init`'s autonomy question defaults to Y on a first install at a person's own terminal (A-SPEC-552.2, 552.3).**
252
+ - There, Enter turns autonomous spec approval on, and the question shows `[Y/n]`. Only low-risk specs approve themselves; governance-critical, high-risk and irreversible ones still ask.
253
+ - Under an agent harness or with `CI` set, Enter keeps the current value, and a first install stays off (`[y/N]`). Only a typed `y` turns it on. A harness is a harness marker in the environment or a harness among init's parent processes. Any other answer turns it off.
254
+ - A re-init defaults to the project's current value, read as the runtime reads it.
255
+ - Enter on a re-init writes nothing, so the value stays where it was. A switch another server entry holds is never copied into Holmes-Kit's own entry (A-SPEC-552.4).
256
+ - A `.mcp.json` that cannot be read or parsed counts as off. So do `{}`, a non-object `mcpServers` and a dangling link.
257
+ - To turn the project default off: `holmes-kit init --no-autonomy`, or remove `HOLMES_AUTONOMOUS_APPROVAL` from `.mcp.json`. `holmes-kit autonomy off` ends session autonomy only.
258
+ - When another server entry in `.mcp.json` still holds the switch, `init --no-autonomy` names that entry and exits 1. It does not edit another entry's env. `--no-autonomy` with `--no-mcp` prints a note that the posture is unchanged.
259
+ - Every non-interactive path is unchanged: with no terminal and no flag the posture is preserved, and `--autonomy` still needs an out-of-band `autonomy-grant` approval.
260
+ - **Limits:** a program that types `y` into a terminal it drives is a forgery this does not stop; the hook prevents accidents and is not a security boundary.
261
+ - **BREAKING (narrow): `test_run` refuses a key its schema does not declare (A-SPEC-466.2).** A call such as `{ root, maxWorkers: 2 }` used to run with the key ignored; it is now refused before the run.
262
+ - **BREAKING (text only): in a Claude Code session, a pre-edit impact warning is said once, then not again while it is in context (A-SPEC-333.1 to 333.8).**
263
+ - Under `warn`, the warning is a line that says the verdict's strength and the outcome first: `[Holmes-Kit:<codes>] <file> — refuse→allowed (warn); to clear: run maintenance_analyze naming this file … [<analysis digest>]`.
264
+ - Each code's explanation (what was found and how to clear it, with the call's arguments) is added once per compaction epoch. SessionStart opens a new epoch, first thing, for every source, compaction included.
265
+ - The epoch is void when the transcript shrank or a newer compact boundary is in its tail. A boundary counts only when its line parses as one, and the void persists.
266
+ - The same line is not said again in the epoch until 29 more warnings have passed, until that file has been judged silent 5 times since it was last said, or until its detail changes (another analysis, another file). A target-drift step says to re-analyze before the commit, not before every edit.
267
+ - `contract-untested` belongs to the analysis, not to the edited file. It is said in the first warning under an analysis in each epoch, and the same agent's later warnings under that analysis leave it out of their line (A-SPEC-333.7, 333.8).
268
+ - A subagent and its parent each hear it once: one's context does not hold what the other was told.
269
+ - Beside other codes it is left out only while recent: after 29 judgements it is said again (A-SPEC-333.9).
270
+ - A warning whose only code it is says nothing, under the same caps as every other silence: it is said again after 29 judgements or 5 silences of that file.
271
+ - The ledger row keeps every code.
272
+ - An allowed `git commit` carries, once per epoch, one line naming up to 3 files whose last judgement was a refuse verdict, and how many more. The line counts every agent of the session: a subagent's warned file is named at the parent's commit. The command is read with quotes, line continuations, `sh -c` scripts and the `env`, `command`, `time` and `nohup` prefixes; `git commit --dry-run` does not count.
273
+ - Each committed warning, in every harness, appends one row to a judgement ledger kept outside the epoch store, rotated at 1MB and kept to 5 rotated files per session. The behaviour metric over it is descriptive, not a gate.
274
+ - The row holds `said`, `line` or `silent`, its project, its tool_use id and `wording_version`.
275
+ - It also holds `said_chars` and `full_chars` (A-SPEC-333.8), and `harness` and `compress` (A-SPEC-333.9). A later holdout can judge occupancy from the ledger alone. A said commit reminder is a `reminder` row.
276
+ - **Limits:**
277
+ - The store and the ledger live under the OS temp directory, so a reboot or a temp cleanup can erase them.
278
+ - A commit made outside Bash, through an alias or a script file, is not reminded.
279
+ - The commit reader misses a commit inside backticks, after `xargs`, `sudo`, `exec`, `timeout`, `nice` or `env -u`, inside a `{ …; }` group, or after `!`. It counts one in a here-document's body or after a `#` comment mark.
280
+ - W and K rows written without a time by an earlier build are read as time 0.
281
+ - Two hooks evicting the same table at once can lose one append.
282
+ - Eviction keeps the newest 50 W, K, P and streak rows.
283
+ - Codex and Antigravity warnings stay in full: their compaction signal is not observed yet.
284
+ - Nothing is recorded while judging. Only what the final allow actually carried is recorded, so a counterfactual re-ask or a later layer's deny never counts as "said".
285
+ - The decision, the codes, the ledgers and every `block` denial are unchanged.
286
+ - The warning stays in full when:
287
+ - the hook input has no session id;
288
+ - this hook saw no SessionStart for the session;
289
+ - the store under `<tmp>/holmes-kit-<uid>` cannot be trusted. That means inside the project, a link, another owner, group- or other-writable, not a regular file, or over its 64KB bound (old keys are evicted at the bound). It also covers any I/O error or a read over 50ms.
290
+ - **Target not met (grey zone).** The registered target is c/d ≤ 0.15, both pooled and as the session median. The pooled value is under it and the median over it.
291
+ - The replay ran the shipped code and keys over this repository's transcripts.
292
+ - Scope: 5 sessions with their subagents (379 files, listed with their sizes), uuid de-duplicated across files, the commit reminder included, an epoch opened at every compact boundary.
293
+ - Counted: 9,405 warnings. Left out: 212 (2.2%), split as follows:
294
+ - 0 unparsable lines;
295
+ - 0 lines already in the compact form;
296
+ - 206 uuid duplicates;
297
+ - 6 with a target the replay could not place.
298
+ - The 9,279 of an earlier count is the same corpus before its sessions grew.
299
+ - The advisory change alone brings the warning text to 0.174 of its size. Per session: 0.166, 0.179, 0.221, 0.331, 0.263 (median 0.221).
300
+ - The architecture-axis change below is measured by a model replay that takes a tree as dirty after an edit and clean after a commit. It removes 3,455 of the 3,621 `architecture-unchecked` warnings. With it the replay gives 0.145 pooled; per session 0.133, 0.156, 0.195, 0.264, 0.263 (median 0.195).
301
+ - These replace the 0.147 and 0.198 stated in the earlier draft. They were re-measured after the review repairs (A-SPEC-333.8, 333.9). One repair applies the repeat rule before `contract-untested` is left out, so an identical warning on the same file stays silent.
302
+ - The two largest sessions hold 94.8% of the text, so this is a development-set estimate. The final judgement is left to a prospective holdout of at least 8 sessions of a compressing harness, read from the ledger's `said_chars`, `full_chars`, `harness` and `compress`. Today only Claude Code compresses, so a second-harness condition waits until another harness does.
303
+
304
+ - **`maintenance_analyze` assesses the architecture axis from the working tree's own diff when no `changedFiles` is given (A-SPEC-293.1).**
305
+ - The diff (`git diff --name-only --relative HEAD` plus untracked files under the analysed root, without the governance store's runtime state) feeds the architecture axis only. The prediction is the same with or without it, and it is never recorded as the caller's `changedFiles`, which the pre-edit gate reads as "named by the request".
306
+ - The two git children run with the repository's programs switched off (no fsmonitor, no hooks path, no untracked cache, no optional locks) and share one 5-second deadline. Decision and C-SPEC documents are taken first into the 2,000-file bound, and a cut list says so in `unknowns` (A-SPEC-333.8).
307
+ - `unknowns` also says the basis came from the working tree's diff, which holds no file the request has yet to change.
308
+ - The persisted analysis records the governing files that basis held (`uncertainty.architectureTouched`).
309
+ - The pre-edit gate keeps `architecture-unchecked` (widen) for an edit of a decision or C-SPEC document the basis did not hold (A-SPEC-333.9).
310
+ - It reads the persisted `changedFilesSource`, not the explaining sentence, which the persisted analysis never held (A-SPEC-333.10).
311
+ - **Limit:** the hook does not run the pre-edit evidence gate on an edit of a governing document, so this edge holds through `impact_gate_check` and the library only. Wiring the hook to it is listed for a later release.
312
+ - A timeout under that deadline is the analysis's own and blocks no later git call for the root.
313
+ - A clean or non-git tree keeps the axis disclosed as not assessed. The answer and the persisted analysis say `changedFilesSource`: `caller`, `git-diff-default` or `none`.
314
+ - Measured on this repository's transcripts: `architecture-unchecked` rode 38% of the pre-edit warnings, all from analyses asked without `changedFiles`.
315
+
316
+ ### Fixed
317
+ - **A red `test_run` names its failing tests (A-SPEC-466.3, 466.4).** The names came first, but one tail over the names and jest's stderr kept only the last 40 lines, so a long stderr pushed every name out (measured: a five-failure run named none).
318
+ - The names and the stderr are now bounded apart: up to five names, each `file › title` cut at 200 characters and its first message line cut at 300, then the last 30 lines of stderr (at most 4,000 characters). The whole red tail stays under 7,000 characters.
319
+ - A suite that failed to run is named with its cause line, the one after jest's `● Test suite failed to run` header. Such suites come before failing assertions, so the five-name bound always shows them (A-SPEC-466.5).
320
+ - **The verify-release stale-sweep row and the two doctor FIFO rows no longer depend on the clock (A-SPEC-466.1, 466.2).** The stale-sweep row sets the kept file's time to exactly the build start. The two FIFO rows take the same budget as their sibling rows.
321
+
10
322
  ## [0.40.0] - 2026-11-03
11
323
 
12
324
  The orchestration hardening, the full profile's push and publish flags, the gate's reading of commands that build a path into `.ax`, the full profile named where people look, and a published package that names no consumer workspace or personal host. The hook prevents accidents; its forgery resistance is not verified (Known limitations).