@holmes-lab/holmes-kit 0.35.5 β†’ 0.35.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
  <!-- @implements A-SPEC-209 -->
8
+ ## [0.35.6] - 2026-10-05
9
+
10
+ ### Added
11
+
12
+ - **A registered binding can be re-applied from inside the session** (A-SPEC-752.10). The new MCP tool
13
+ `runtime_binding` previews (`operation: "preview"`, the default) and applies (`operation: "apply"`) the plan
14
+ `holmes-kit runtime-binding setup` would make for the workspace the session is in, with `activate_hooks` naming the
15
+ harnesses whose Holmes hooks to restore. It takes no package argument: it plans only for the package and release
16
+ package the operator registry already names, so which build governs a workspace is still decided in a terminal, and
17
+ a workspace the registry does not name is refused. `apply` shows the plan digest and the files in the approval
18
+ dialog and writes only on an explicit approve answer there. A denial, an unanswered dialog, a client without the
19
+ form dialog and autonomous approval all write nothing; the request the CLI would file is filed and returned
20
+ instead. A plan with conflicts is not applied, and a plan that changed between the preview and the answer is
21
+ refused. An approved apply is recorded in the provenance ledger with the plan digest, like a terminal grant.
22
+ Limit: native trust of a hook in Codex is still given in Codex's own `/hooks` review.
23
+
8
24
  ## [0.35.5] - 2026-10-05
9
25
 
10
26
  ### Added
package/README.md CHANGED
@@ -24,6 +24,7 @@ Measured at `173b99650442` (specs `sha256:215f84d4e9f4`) β€” reproduce with `hol
24
24
  ### πŸ›‘οΈ Currently Supported Features (Production Features)
25
25
 
26
26
  - **The protected store is recognised however a shell command spells it** *(new in 0.35.2 β€” security fix, upgrade recommended)*: through 0.35.1 a path into `.ax/specs`, `.ax/ledger`, `.ax/approvals` or `.ax/state` written directly after a shell expansion, a variable, or a character the shell removes at run time was not seen as protected, so a removal, move or overwrite of governance state could pass the gate. The store spelling now counts wherever it appears in a command, and an output redirect to a computed target is not a read. Reads still pass. A directory that merely ends in `.ax` and has a child named like the store's is judged as the store. Limit: a path assembled so the spelling never appears in the command text is outside this rule.
27
+ - **Re-apply a registered runtime binding without leaving the session** *(new in 0.35.6)*: the MCP tool `runtime_binding` previews and applies the plan `runtime-binding setup` would make for the registered workspace, including `activate_hooks`. It never chooses a build β€” it uses the package the operator registry already names β€” and it writes only when you answer approve in the approval dialog, which shows the plan digest and the files. No answer, a denial, a client without the dialog, or autonomous approval write nothing and leave the usual queue request. Native hook trust in Codex is still given in Codex's `/hooks`.
27
28
  - **`doctor` shows when a checkout's hooks are not the ones its sessions run** *(new in 0.35.5)*: when you develop Holmes-Kit itself with sessions routed to a released install, the `development hooks` row compares the compiled files and has both hook programs judge the same payloads, so a hook change that is not live yet is visible instead of assumed. In the same release, `runtime-binding setup` refuses a plan that would write the Codex gate where Codex has it switched off *(security fix β€” if you ran setup with 0.35.2–0.35.4, check `doctor` for `FAIL codex user hooks`)*.
28
29
  - **No in-session shortcut around a person while autonomy is on** *(new in 0.35.4 β€” security fix, upgrade recommended)*: on a client without the MCP form dialog, the `approval_commit` continuation is no longer offered or accepted while autonomous approval is on β€” the request goes to the approval queue. Its only human check is the host's own tool confirmation, which an allow rule or auto mode removes. With autonomy off it works as before; seals made through it are recorded as `host-gated:<harness>`.
29
30
  - **An unanswered approval is held, never approved** *(new in 0.35.3 β€” security fix, upgrade recommended)*: with autonomous approval on, an in-session approval dialog that ran out of time used to be recorded as an approval (actor `autonomous-timeout:<harness>`) β€” for exactly the seals and critical-finding resolutions autonomy reserves for a person. An unanswered dialog now returns the request to the approval queue in every mode. To audit earlier sessions, search the provenance ledger for `autonomous-timeout`.
package/dist/.build-id CHANGED
@@ -1 +1 @@
1
- c1d856f5-muuyvc7w
1
+ be58f332-muva91ep
@@ -12,6 +12,8 @@ export interface RuntimeBindingOptions {
12
12
  installerPackageRoot?: string;
13
13
  approval?: Approval;
14
14
  activateHooks?: string[];
15
+ /** @implements A-SPEC-752.10 β€” the digest a reviewer was shown; a plan that computes to another one is not applied. */
16
+ expectedPlanDigest?: string;
15
17
  }
16
18
  export declare function runtimeHookCommand(registryPath: string, harness: RuntimeHarness, entry: RuntimeEntry): string;
17
19
  /**
@@ -41,7 +41,7 @@ exports.registryOwnedWiring = registryOwnedWiring;
41
41
  exports.runtimeBindingStatus = runtimeBindingStatus;
42
42
  exports.runRuntimeBinding = runRuntimeBinding;
43
43
  exports.trackedWorkspacePaths = trackedWorkspacePaths;
44
- // @implements A-SPEC-752.9, A-SPEC-751.5, A-SPEC-751, A-SPEC-752, A-SPEC-752.7, A-SPEC-752.8
44
+ // @implements A-SPEC-752.10, A-SPEC-752.9, A-SPEC-751.5, A-SPEC-751, A-SPEC-752, A-SPEC-752.7, A-SPEC-752.8
45
45
  const fs = __importStar(require("node:fs"));
46
46
  const os = __importStar(require("node:os"));
47
47
  const path = __importStar(require("node:path"));
@@ -645,6 +645,11 @@ function runRuntimeBinding(opts) {
645
645
  const changes = [...planned.values()].filter((c) => c.before !== c.after);
646
646
  const planDigest = (0, runtime_binding_approval_1.runtimePlanDigest)({ operation: opts.operation, root, selection, releasePackageRoot: next.releasePackageRoot,
647
647
  releaseBuild, activateHooks: [...activate].sort() }, changes);
648
+ // @implements A-SPEC-752.10 β€” what is applied is what was reviewed: the in-session dialog shows a digest, and a
649
+ // file that moved while the dialog was open makes this another plan.
650
+ if (opts.expectedPlanDigest !== undefined && opts.expectedPlanDigest !== planDigest) {
651
+ throw new Error(`Runtime plan changed since it was reviewed (reviewed ${opts.expectedPlanDigest}, now ${planDigest}); nothing written β€” preview it again`);
652
+ }
648
653
  if (!opts.dryRun) {
649
654
  if (conflicts.length)
650
655
  throw new Error(`Runtime configuration conflicts; nothing written: ${conflicts.join('; ')}`);
@@ -32,7 +32,8 @@ const npx_bin_1 = require("../project/npx-bin");
32
32
  * a fake elicitor.
33
33
  */
34
34
  /** Approval kinds that may ask in-session. Widening this set is a spec revision, not a drive-by. */
35
- exports.ELICITABLE_KINDS = new Set(['spec-approve', 'review-resolve']);
35
+ // @implements A-SPEC-752.10 β€” `governance-wiring`: re-applying the binding the registry already names (never choosing one).
36
+ exports.ELICITABLE_KINDS = new Set(['spec-approve', 'review-resolve', 'governance-wiring']);
36
37
  /** The `HOLMES_ELICIT` values that turn the in-client prompt OFF. */
37
38
  const ELICIT_DISABLED_TOKENS = new Set(['off', '0', 'false', 'no', 'disabled']);
38
39
  /**
@@ -0,0 +1,45 @@
1
+ import { Approval } from '../../guardrail/risk-gate';
2
+ import { ElicitOutcome } from '../elicit-approval';
3
+ export interface RuntimeBindingToolContext {
4
+ foreignRootReason(root?: string): string | null;
5
+ projectRootOf(root: string): string;
6
+ tryElicit(kind: string, target: string, summary: string): Promise<ElicitOutcome>;
7
+ elicitApproval(reason: string | undefined): Approval;
8
+ registryPath(): string;
9
+ home?: string;
10
+ installerPackageRoot?: string;
11
+ }
12
+ export declare function createRuntimeBindingToolHandlers(context: RuntimeBindingToolContext): {
13
+ runtime_binding(a: {
14
+ root: string;
15
+ operation?: string;
16
+ activate_hooks?: string[];
17
+ }): Promise<{
18
+ ok: boolean;
19
+ applied: boolean;
20
+ reason: string;
21
+ } | {
22
+ planDigest: string;
23
+ conflicts: string[];
24
+ changes: {
25
+ path: string;
26
+ added: number;
27
+ removed: number;
28
+ }[];
29
+ ok: boolean;
30
+ applied: boolean;
31
+ operation: string;
32
+ reason?: undefined;
33
+ } | {
34
+ planDigest: string;
35
+ conflicts: string[];
36
+ changes: {
37
+ path: string;
38
+ added: number;
39
+ removed: number;
40
+ }[];
41
+ ok: boolean;
42
+ applied: boolean;
43
+ reason?: undefined;
44
+ }>;
45
+ };
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.createRuntimeBindingToolHandlers = createRuntimeBindingToolHandlers;
37
+ // @implements A-SPEC-752.10
38
+ /**
39
+ * `runtime_binding` β€” re-apply the binding the operator registry ALREADY names for this workspace, from inside the
40
+ * session, on the owner's explicit answer in the approval dialog.
41
+ *
42
+ * What the out-of-band rule protects is the choice of which build governs a workspace. This tool makes no such
43
+ * choice: it takes no package argument, and plans for the package and release package the registry holds. It
44
+ * refreshes the dispatcher files and the wiring and can restore a harness's hooks β€” the act a reviewed plan waited
45
+ * three session restarts for on 2026-10-05, because only a terminal could perform it.
46
+ *
47
+ * Only an explicit approve answer applies a plan. A denial, an unanswered dialog, a client without the form dialog,
48
+ * autonomous approval: none of them write anything; the same queue request the CLI files is filed and returned.
49
+ */
50
+ const fs = __importStar(require("node:fs"));
51
+ const path = __importStar(require("node:path"));
52
+ const node_crypto_1 = require("node:crypto");
53
+ const binding_1 = require("../../runtime/binding");
54
+ const runtime_binding_1 = require("../../cli/runtime-binding");
55
+ const HARNESSES = ['claude', 'codex', 'antigravity'];
56
+ /** How many lines a change adds and removes β€” what a reviewer needs from a tool answer; the contents stay on disk. */
57
+ function lineCounts(change) {
58
+ const before = (change.before ?? '').split('\n');
59
+ const after = change.after.split('\n');
60
+ const was = new Set(before);
61
+ const now = new Set(after);
62
+ return { path: change.path, added: after.filter((line) => !was.has(line)).length, removed: before.filter((line) => !now.has(line)).length };
63
+ }
64
+ function createRuntimeBindingToolHandlers(context) {
65
+ return {
66
+ async runtime_binding(a) {
67
+ const foreign = context.foreignRootReason(a.root);
68
+ if (foreign)
69
+ return { ok: false, applied: false, reason: foreign };
70
+ const operation = a.operation ?? 'preview';
71
+ if (operation !== 'preview' && operation !== 'apply')
72
+ return { ok: false, applied: false, reason: 'runtime_binding: operation is preview or apply' };
73
+ const activate = a.activate_hooks ?? [];
74
+ if (!Array.isArray(activate) || activate.some((h) => !HARNESSES.includes(h))) {
75
+ return { ok: false, applied: false, reason: `runtime_binding: activate_hooks takes only ${HARNESSES.join(', ')}` };
76
+ }
77
+ const registryPath = context.registryPath();
78
+ const unregistered = { ok: false, applied: false,
79
+ reason: 'runtime_binding: this workspace is not registered in the operator runtime registry. Registering a workspace, or choosing which build governs it, is done by the operator with `holmes-kit runtime-binding setup` in a terminal; this tool only re-applies a registered binding.' };
80
+ let root;
81
+ let binding;
82
+ let releasePackageRoot;
83
+ try {
84
+ root = fs.realpathSync.native(context.projectRootOf(a.root));
85
+ if (!fs.existsSync(registryPath))
86
+ return unregistered;
87
+ const registry = (0, binding_1.readRuntimeRegistry)(registryPath);
88
+ binding = registry.bindings.find((b) => b.workspaceRoot === root);
89
+ releasePackageRoot = registry.releasePackageRoot;
90
+ }
91
+ catch (e) {
92
+ return { ok: false, applied: false, reason: `runtime_binding: ${e.message}` };
93
+ }
94
+ if (binding === undefined)
95
+ return unregistered;
96
+ const options = { operation: 'setup', workspace: root, packageRoot: binding.packageRoot, releasePackageRoot, registryPath,
97
+ activateHooks: activate, ...(context.home !== undefined ? { home: context.home } : {}),
98
+ ...(context.installerPackageRoot !== undefined ? { installerPackageRoot: context.installerPackageRoot } : {}) };
99
+ let plan;
100
+ try {
101
+ plan = (0, runtime_binding_1.runRuntimeBinding)({ ...options, dryRun: true });
102
+ }
103
+ catch (e) {
104
+ return { ok: false, applied: false, reason: `runtime_binding: ${e.message}` };
105
+ }
106
+ const changes = plan.changes.map(lineCounts);
107
+ const answer = { planDigest: plan.planDigest, conflicts: plan.conflicts, changes };
108
+ if (operation === 'preview')
109
+ return { ok: true, applied: false, operation, ...answer };
110
+ if (plan.conflicts.length > 0)
111
+ return { ok: false, applied: false, reason: `runtime_binding: the plan has conflicts and was not applied β€” ${plan.conflicts.join('; ')}`, ...answer };
112
+ if (plan.changes.length === 0)
113
+ return { ok: true, applied: false, reason: 'runtime_binding: the wiring already matches the registered binding; nothing to apply', ...answer };
114
+ const names = [...new Set(plan.changes.map((c) => path.basename(c.path)))].join(', ');
115
+ const out = await context.tryElicit('governance-wiring', root, `plan ${plan.planDigest.slice(0, 19)}… β€” ${plan.changes.length} file(s): ${names}`);
116
+ const approved = out.kind === 'answered' && out.decision.granted;
117
+ try {
118
+ // Without an approve answer no approval is passed: the planner then applies only if the operator already
119
+ // granted this exact plan in a terminal, and otherwise files the request and refuses β€” the CLI's own path.
120
+ // The single-use nonce is what makes the planner write the authorization to the ledger (actor, plan digest):
121
+ // an answer given in a dialog must leave the same audit line a terminal grant does.
122
+ (0, runtime_binding_1.runRuntimeBinding)({ ...options, dryRun: false, expectedPlanDigest: plan.planDigest,
123
+ ...(approved ? { approval: { ...context.elicitApproval(out.kind === 'answered' ? out.decision.reason : undefined), nonce: (0, node_crypto_1.randomUUID)() } } : {}) });
124
+ return { ok: true, applied: true, ...answer };
125
+ }
126
+ catch (e) {
127
+ const message = e.message;
128
+ const request = /\brequest (req-[0-9a-f]+)/.exec(message)?.[1];
129
+ const dialog = out.kind === 'answered' ? (approved ? 'approved in the dialog, but ' : `declined in the dialog${out.decision.reason ? ` (${out.decision.reason})` : ''}; `)
130
+ : out.kind === 'expired' ? 'the approval dialog was not answered; ' : 'no approval dialog could be shown in this session; ';
131
+ return { ok: false, applied: false, reason: `runtime_binding: nothing was applied β€” ${dialog}${message}`, ...(request ? { request } : {}), ...answer };
132
+ }
133
+ },
134
+ };
135
+ }
@@ -53,6 +53,12 @@ export interface ElicitOpts {
53
53
  continuations: ApprovalContinuationStore;
54
54
  runId: string;
55
55
  };
56
+ /** @implements A-SPEC-752.10 β€” test seam for `runtime_binding`: an isolated registry, home and installer package. */
57
+ runtimeBinding?: {
58
+ registryPath?: string;
59
+ home?: string;
60
+ installerPackageRoot?: string;
61
+ };
56
62
  }
57
63
  /**
58
64
  * @implements A-SPEC-299
@@ -652,6 +658,38 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
652
658
  reason: string;
653
659
  }[];
654
660
  }>;
661
+ runtime_binding(a: {
662
+ root: string;
663
+ operation?: string;
664
+ activate_hooks?: string[];
665
+ }): Promise<{
666
+ ok: boolean;
667
+ applied: boolean;
668
+ reason: string;
669
+ } | {
670
+ planDigest: string;
671
+ conflicts: string[];
672
+ changes: {
673
+ path: string;
674
+ added: number;
675
+ removed: number;
676
+ }[];
677
+ ok: boolean;
678
+ applied: boolean;
679
+ operation: string;
680
+ reason?: undefined;
681
+ } | {
682
+ planDigest: string;
683
+ conflicts: string[];
684
+ changes: {
685
+ path: string;
686
+ added: number;
687
+ removed: number;
688
+ }[];
689
+ ok: boolean;
690
+ applied: boolean;
691
+ reason?: undefined;
692
+ }>;
655
693
  workspace_preflight(a: {
656
694
  root: string;
657
695
  harness?: import("../cli/agents").Agent;
@@ -69,6 +69,8 @@ const spec_authoring_1 = require("./handlers/spec-authoring");
69
69
  const spec_lifecycle_1 = require("./handlers/spec-lifecycle");
70
70
  const spec_approval_1 = require("./handlers/spec-approval");
71
71
  const workspace_identity_2 = require("./handlers/workspace-identity");
72
+ const runtime_binding_tool_1 = require("./handlers/runtime-binding-tool");
73
+ const runtime_binding_1 = require("../cli/runtime-binding");
72
74
  const workspace_preflight_1 = require("./handlers/workspace-preflight");
73
75
  const operator_inspection_1 = require("./handlers/operator-inspection");
74
76
  const phase_queries_1 = require("./handlers/phase-queries");
@@ -1030,6 +1032,17 @@ function makeRawHandlers(store, opts) {
1030
1032
  // rtm_impact+4, rtm_reindex..review_record, review_prepare..risk_check, risk_checkΒ±, and the tail).
1031
1033
  ledger_reconcile: operatorInspection.ledger_reconcile,
1032
1034
  ...(0, workspace_preflight_1.createWorkspacePreflightHandlers)({ storeRoot: store instanceof spec_store_1.LocalMarkdownRepository ? store.specsRoot : undefined }),
1035
+ // @implements A-SPEC-752.10 β€” same unpinned slot. Re-applies the registered binding on the owner's answer in the
1036
+ // dialog; never autonomous.
1037
+ ...(0, runtime_binding_tool_1.createRuntimeBindingToolHandlers)({
1038
+ foreignRootReason: (root) => foreignRootReason(store, root),
1039
+ projectRootOf,
1040
+ tryElicit,
1041
+ elicitApproval,
1042
+ registryPath: () => opts?.runtimeBinding?.registryPath ?? (0, runtime_binding_1.defaultRuntimeRegistry)(),
1043
+ ...(opts?.runtimeBinding?.home !== undefined ? { home: opts.runtimeBinding.home } : {}),
1044
+ ...(opts?.runtimeBinding?.installerPackageRoot !== undefined ? { installerPackageRoot: opts.runtimeBinding.installerPackageRoot } : {}),
1045
+ }),
1033
1046
  // @implements A-SPEC-700.2 β€” same unpinned slot: `spec_retire..spec_unseal` is a pinned run.
1034
1047
  spec_reconcile: specLifecycle.spec_reconcile,
1035
1048
  rtm_impact: graphOperations.rtm_impact,
@@ -76,6 +76,19 @@ exports.TOOL_SCHEMAS = {
76
76
  description: 'Read-only diagnosis of this live MCP server workspace binding. Mismatched roots are not scanned. Identity and checkout are inspected only for a matching root. Does not rebind, initialize, register or prove client hook enforcement.',
77
77
  inputSchema: { type: 'object', properties: { root: ROOT_ANY, harness: { type: 'string', enum: [...agents_1.AGENTS] } }, required: ['root'] },
78
78
  },
79
+ // @implements A-SPEC-752.10
80
+ runtime_binding: {
81
+ description: 'Re-apply the runtime binding the operator registry ALREADY names for this workspace: refresh the dispatcher files and harness wiring, optionally restoring a harness\'s hooks. `preview` (default) writes nothing and returns the plan digest, conflicts and per-file line counts. `apply` opens the in-session approval dialog and writes the plan only on an explicit approve answer there; any other outcome writes nothing and returns the pending request. It cannot register a workspace or choose which build governs it β€” that is `holmes-kit runtime-binding setup`, run by the operator in a terminal. Native hook trust in each harness stays the operator\'s.',
82
+ inputSchema: {
83
+ type: 'object',
84
+ properties: {
85
+ root: ROOT_ANY,
86
+ operation: { type: 'string', enum: ['preview', 'apply'], description: 'Defaults to preview.' },
87
+ activate_hooks: { type: 'array', items: { type: 'string', enum: ['claude', 'codex', 'antigravity'] }, description: 'Harnesses whose Holmes hooks to restore in this workspace.' },
88
+ },
89
+ required: ['root'],
90
+ },
91
+ },
79
92
  workspace_identity: {
80
93
  description: 'Inspect canonical workspace and local replica identity without writes by default. Explicit initialize creates a Git-shareable .ax/workspace.json and registers this checkout; register requires an existing canonical identity. Preserve legacy specs and ledgers; these identifiers grant no approval authority. Share the manifest through Git and keep .ax/state local. Registered MCP writes include holmes-execution/1 provenance and require a reader supporting that schema; matching package versions alone do not establish this capability.',
81
94
  inputSchema: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "@implements A-SPEC-209",
3
3
  "name": "@holmes-lab/holmes-kit",
4
- "version": "0.35.5",
4
+ "version": "0.35.6",
5
5
  "description": "Holmes-Kit β€” deterministic Agentic Software Engineering (ASE) harness with causal traceability (spec chain + D-CPG + RTM + phase guardrail)",
6
6
  "main": "dist/holmes/mcp/server.js",
7
7
  "types": "dist/holmes/mcp/server.d.ts",