@holmes-lab/holmes-kit 0.35.24 → 0.36.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.
- package/CHANGELOG.md +363 -0
- package/README.md +4 -2
- package/dist/.build-id +1 -1
- package/dist/holmes/cli/approve-status.js +4 -1
- package/dist/holmes/cli/approve-watch.js +3 -1
- package/dist/holmes/cli/approve.d.ts +10 -0
- package/dist/holmes/cli/approve.js +34 -4
- package/dist/holmes/cli/claude-switches.d.ts +7 -1
- package/dist/holmes/cli/claude-switches.js +11 -7
- package/dist/holmes/cli/codex-toml.d.ts +3 -0
- package/dist/holmes/cli/codex-toml.js +2 -1
- package/dist/holmes/cli/doctor.d.ts +31 -1
- package/dist/holmes/cli/doctor.js +204 -7
- package/dist/holmes/cli/index.js +115 -4
- package/dist/holmes/cli/init.js +4 -3
- package/dist/holmes/cli/os-notify.d.ts +3 -1
- package/dist/holmes/cli/os-notify.js +10 -4
- package/dist/holmes/cli/review.d.ts +25 -0
- package/dist/holmes/cli/review.js +111 -0
- package/dist/holmes/cli/roles-readme.d.ts +11 -0
- package/dist/holmes/cli/roles-readme.js +38 -16
- package/dist/holmes/cli/roles.d.ts +12 -0
- package/dist/holmes/cli/roles.js +86 -0
- package/dist/holmes/cli/run.d.ts +65 -0
- package/dist/holmes/cli/run.js +308 -0
- package/dist/holmes/cli/runtime-binding-approval.js +3 -2
- package/dist/holmes/cli/runtime-binding.d.ts +30 -0
- package/dist/holmes/cli/runtime-binding.js +116 -11
- package/dist/holmes/cli/scratch.d.ts +12 -0
- package/dist/holmes/cli/scratch.js +20 -0
- package/dist/holmes/cli/test-platform.d.ts +16 -0
- package/dist/holmes/cli/test-platform.js +31 -1
- package/dist/holmes/config/config.d.ts +49 -0
- package/dist/holmes/config/config.js +146 -3
- package/dist/holmes/config/project-caps.d.ts +21 -0
- package/dist/holmes/config/project-caps.js +114 -0
- package/dist/holmes/governance/approval-queue.d.ts +17 -3
- package/dist/holmes/governance/approval-queue.js +51 -8
- package/dist/holmes/governance/autonomy.d.ts +6 -0
- package/dist/holmes/governance/autonomy.js +21 -0
- package/dist/holmes/governance/push-gate-runner.d.ts +8 -0
- package/dist/holmes/governance/push-gate-runner.js +49 -1
- package/dist/holmes/governance/replica-id.d.ts +9 -0
- package/dist/holmes/governance/replica-id.js +44 -7
- package/dist/holmes/governance/role-policy.d.ts +41 -1
- package/dist/holmes/governance/role-policy.js +137 -20
- package/dist/holmes/governance/run-mode.d.ts +14 -0
- package/dist/holmes/governance/run-mode.js +120 -0
- package/dist/holmes/governance/tool-actions.d.ts +30 -0
- package/dist/holmes/governance/tool-actions.js +121 -0
- package/dist/holmes/guardrail/agent-launch-policy.d.ts +15 -0
- package/dist/holmes/guardrail/agent-launch-policy.js +177 -0
- package/dist/holmes/guardrail/classification-mode.d.ts +17 -0
- package/dist/holmes/guardrail/classification-mode.js +135 -0
- package/dist/holmes/guardrail/dynamic-write.d.ts +43 -0
- package/dist/holmes/guardrail/dynamic-write.js +304 -0
- package/dist/holmes/guardrail/impact-gate.d.ts +2 -0
- package/dist/holmes/guardrail/impact-gate.js +34 -11
- package/dist/holmes/guardrail/phase.d.ts +2 -1
- package/dist/holmes/guardrail/phase.js +22 -8
- package/dist/holmes/guardrail/powershell-shell.d.ts +21 -0
- package/dist/holmes/guardrail/powershell-shell.js +801 -0
- package/dist/holmes/guardrail/refusal-codes.d.ts +24 -0
- package/dist/holmes/guardrail/refusal-codes.js +140 -0
- package/dist/holmes/guardrail/risk-classifier.d.ts +17 -0
- package/dist/holmes/guardrail/risk-classifier.js +255 -27
- package/dist/holmes/guardrail/risk-types.d.ts +16 -0
- package/dist/holmes/guardrail/run-plan-scope.d.ts +23 -0
- package/dist/holmes/guardrail/run-plan-scope.js +155 -0
- package/dist/holmes/guardrail/run-refusals.d.ts +116 -0
- package/dist/holmes/guardrail/run-refusals.js +348 -0
- package/dist/holmes/guardrail/run-stages.d.ts +67 -0
- package/dist/holmes/guardrail/run-stages.js +188 -0
- package/dist/holmes/guardrail/scope-judgment.d.ts +5 -1
- package/dist/holmes/guardrail/scope-judgment.js +8 -10
- package/dist/holmes/guardrail/scope-refusal-memory.d.ts +3 -0
- package/dist/holmes/guardrail/scope-refusal-memory.js +85 -0
- package/dist/holmes/guardrail/shell-words.js +7 -7
- package/dist/holmes/guardrail/write-target.d.ts +31 -2
- package/dist/holmes/guardrail/write-target.js +118 -16
- package/dist/holmes/hooks/pre-tool-use.d.ts +36 -2
- package/dist/holmes/hooks/pre-tool-use.js +740 -81
- package/dist/holmes/hooks/session-start.js +5 -3
- package/dist/holmes/hooks/stop.d.ts +35 -1
- package/dist/holmes/hooks/stop.js +142 -7
- package/dist/holmes/mcp/elicit-approval.js +4 -4
- package/dist/holmes/mcp/handlers/graph-operations.js +5 -5
- package/dist/holmes/mcp/handlers/maintenance-analysis.js +2 -2
- package/dist/holmes/mcp/handlers/operator-inspection.d.ts +2 -1
- package/dist/holmes/mcp/handlers/operator-inspection.js +3 -1
- package/dist/holmes/mcp/handlers/phase-queries.js +16 -1
- package/dist/holmes/mcp/handlers/requirement-triage.js +2 -2
- package/dist/holmes/mcp/handlers/spec-approval.d.ts +3 -3
- package/dist/holmes/mcp/handlers/spec-approval.js +56 -9
- package/dist/holmes/mcp/handlers/spec-lifecycle.d.ts +1 -0
- package/dist/holmes/mcp/handlers/spec-lifecycle.js +3 -3
- package/dist/holmes/mcp/handlers/spec-queries.d.ts +7 -0
- package/dist/holmes/mcp/handlers/spec-queries.js +5 -0
- package/dist/holmes/mcp/handlers/workspace-queries.js +2 -2
- package/dist/holmes/mcp/handlers.d.ts +2 -3
- package/dist/holmes/mcp/handlers.js +22 -2
- package/dist/holmes/mcp/harness-attestation.d.ts +2 -0
- package/dist/holmes/mcp/harness-attestation.js +3 -1
- package/dist/holmes/mcp/operator-recovery.d.ts +2 -0
- package/dist/holmes/mcp/operator-recovery.js +4 -3
- package/dist/holmes/mcp/server.js +9 -0
- package/dist/holmes/mcp/tool-schemas.js +6 -3
- package/dist/holmes/project/npx-bin.d.ts +26 -0
- package/dist/holmes/project/npx-bin.js +272 -2
- package/dist/holmes/project/root.js +6 -1
- package/dist/holmes/project/run-records.d.ts +17 -0
- package/dist/holmes/project/run-records.js +126 -0
- package/dist/holmes/project/scratch-root.d.ts +12 -0
- package/dist/holmes/project/scratch-root.js +132 -0
- package/dist/holmes/review/mrp.d.ts +35 -0
- package/dist/holmes/review/mrp.js +119 -0
- package/dist/holmes/review/verdicts.d.ts +117 -0
- package/dist/holmes/review/verdicts.js +345 -0
- package/dist/holmes/runtime/dispatch.js +6 -3
- package/dist/holmes/semantic/cloud-usage.d.ts +20 -0
- package/dist/holmes/semantic/cloud-usage.js +106 -0
- package/dist/holmes/semantic/embedder.d.ts +15 -6
- package/dist/holmes/semantic/embedder.js +84 -3
- package/dist/holmes/semantic/local-model.d.ts +21 -2
- package/dist/holmes/semantic/local-model.js +14 -3
- package/dist/holmes/semantic/tier.d.ts +25 -0
- package/dist/holmes/semantic/tier.js +86 -1
- package/dist/holmes/semantic/vector-cache.d.ts +1 -0
- package/dist/holmes/semantic/vector-cache.js +4 -1
- package/dist/holmes/spec/approval-blockers.d.ts +11 -1
- package/dist/holmes/spec/approval-blockers.js +70 -2
- package/dist/holmes/spec/renumber.d.ts +1 -1
- package/dist/holmes/spec/renumber.js +5 -2
- package/dist/holmes/spec/transition-policy.d.ts +5 -7
- package/dist/holmes/spec/transition-policy.js +17 -2
- package/package.json +1 -1
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.createSpecApprovalHandlers = createSpecApprovalHandlers;
|
|
37
37
|
exports.readProjectFile = readProjectFile;
|
|
38
|
-
// @implements A-SPEC-718.3, A-SPEC-718.1,
|
|
38
|
+
// @implements A-SPEC-182.3, A-SPEC-718.3, A-SPEC-770.6, A-SPEC-718.1,A-SPEC-718.2, A-SPEC-718, A-SPEC-551.1, A-SPEC-551.2, A-SPEC-627.1, A-SPEC-622, A-SPEC-100.2, A-SPEC-128, A-SPEC-132, A-SPEC-133, A-SPEC-151, A-SPEC-188, A-SPEC-189, A-SPEC-244, A-SPEC-245, A-SPEC-729
|
|
39
39
|
// @implements A-SPEC-631, A-SPEC-733
|
|
40
40
|
const fs = __importStar(require("node:fs"));
|
|
41
41
|
const compat_impact_1 = require("../../spec/compat-impact");
|
|
@@ -45,6 +45,7 @@ const transition_policy_1 = require("../../spec/transition-policy");
|
|
|
45
45
|
const validator_1 = require("../../spec/validator");
|
|
46
46
|
const elicit_approval_1 = require("../elicit-approval");
|
|
47
47
|
const autonomy_1 = require("../../governance/autonomy");
|
|
48
|
+
const config_1 = require("../../config/config");
|
|
48
49
|
const write_target_1 = require("../../guardrail/write-target");
|
|
49
50
|
const delegation_1 = require("../../governance/delegation"); // @implements A-SPEC-771
|
|
50
51
|
const approval_grants_1 = require("../../governance/approval-grants");
|
|
@@ -56,6 +57,7 @@ const review_targets_1 = require("../../review/review-targets");
|
|
|
56
57
|
const requirement_triage_evidence_1 = require("../requirement-triage-evidence");
|
|
57
58
|
const approval_policy_1 = require("../approval-policy");
|
|
58
59
|
const approval_blockers_1 = require("../../spec/approval-blockers");
|
|
60
|
+
const npx_bin_1 = require("../../project/npx-bin");
|
|
59
61
|
function createSpecApprovalHandlers(context) {
|
|
60
62
|
const { store, resolver, projectRootOf, cachedScan, tryElicit, elicitApproval, autonomousApproval } = context;
|
|
61
63
|
return {
|
|
@@ -95,6 +97,8 @@ function createSpecApprovalHandlers(context) {
|
|
|
95
97
|
// @implements A-SPEC-532.4 — the declared direction of a gate change sealed without the owner (said in the ledger).
|
|
96
98
|
let sealedDirection = '';
|
|
97
99
|
let subject;
|
|
100
|
+
// @implements A-SPEC-770.12 — the title the operator reads beside the request id.
|
|
101
|
+
let title;
|
|
98
102
|
// @implements A-SPEC-732 (round 2) — the digest a person or the autonomy grade decided on; the
|
|
99
103
|
// seal must be built from that same content.
|
|
100
104
|
let decidedSubject;
|
|
@@ -117,13 +121,14 @@ function createSpecApprovalHandlers(context) {
|
|
|
117
121
|
const target = await store.read(a.id).catch(() => null);
|
|
118
122
|
// @implements A-SPEC-649 — the digest of what the operator will read rides the request.
|
|
119
123
|
subject = target ? (0, spec_digest_1.specDigest)(target.spec) : undefined;
|
|
124
|
+
title = target?.spec.title;
|
|
120
125
|
if (target) {
|
|
121
126
|
// @implements A-SPEC-551.2 — a spec no approval could seal as written is answered with WHY, before
|
|
122
127
|
// any channel is chosen: no elicitation, no queue entry. Measured 2026-09-30: an invalid
|
|
123
128
|
// breaking_change grade graded `hitl`, went to the owner's queue, and the refusal named the approval
|
|
124
129
|
// channel instead of the blocker — the agent asked the owner for an approval that could not help.
|
|
125
130
|
// Same predicate `approval_status.blockers` reports. A covered act (above) keeps its own order.
|
|
126
|
-
const blockers = (0, approval_blockers_1.approvalBlockers)(target.spec, resolver(await store.list()));
|
|
131
|
+
const blockers = (0, approval_blockers_1.approvalBlockers)(target.spec, resolver(await store.list()), { scaffold: scaffoldStrictFor(context.projectRootOf, a.root ?? store.specsRoot) }); // A-SPEC-182.2
|
|
127
132
|
if (blockers.length > 0) {
|
|
128
133
|
return {
|
|
129
134
|
ok: false,
|
|
@@ -188,7 +193,21 @@ function createSpecApprovalHandlers(context) {
|
|
|
188
193
|
})();
|
|
189
194
|
if (noIntake)
|
|
190
195
|
risk = 'hitl';
|
|
191
|
-
|
|
196
|
+
// @implements A-SPEC-532.6 — the owner's ceiling binds every automatic seal, the delegation included: above it,
|
|
197
|
+
// the seal is the operator's and is routed like any operator-graded seal (dialog or queue).
|
|
198
|
+
let ceilingNote = null;
|
|
199
|
+
if (autonomyOn && autonomyRoot !== undefined) {
|
|
200
|
+
const ceiling = (0, config_1.loadConfig)(autonomyRoot).autonomy.ceiling;
|
|
201
|
+
const why = (0, autonomy_1.ceilingRefusal)(ceiling, target.spec, below);
|
|
202
|
+
if (why !== null) {
|
|
203
|
+
risk = 'hitl';
|
|
204
|
+
ceilingNote = `\n[autonomy: the owner's ceiling "${ceiling}" keeps this seal with the operator — ${why}]`;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (ceilingNote !== null) {
|
|
208
|
+
autonomyNote = ceilingNote;
|
|
209
|
+
}
|
|
210
|
+
else if (autonomyOn && risk === 'hitl') {
|
|
192
211
|
const rule = noIntake ? 'requirement-without-intake' : (0, autonomy_1.specApprovalAutonomyReason)(target.spec, resolver([target.spec]), below);
|
|
193
212
|
if (rule !== null) {
|
|
194
213
|
autonomyNote = `\n[autonomy: this seal is the operator's — ${rule} (${(0, autonomy_1.autonomyRuleMeaning)(rule)})]`;
|
|
@@ -276,7 +295,7 @@ function createSpecApprovalHandlers(context) {
|
|
|
276
295
|
}
|
|
277
296
|
return { ok: false, reason: (elicitExpiredMs !== undefined ? (0, elicit_approval_1.expiredNotice)(elicitExpiredMs) : '') + refusedGrants + (context.approvalRouteNote?.() ?? '') + autonomyNote
|
|
278
297
|
+ 'spec_approve requires an out-of-band HOLMES_APPROVAL that COVERS this act — a request-payload approval is not a channel, and an expired or elsewhere-scoped token does not open this door (scoped approvals need kind "spec-approve"). (fail-closed)'
|
|
279
|
-
+ context.refusalQueueHint(a.root, { kind: 'spec-approve', target: a.id, why: '스펙 봉인 승인', ...(subject ? { subject } : {}), ...(risk ? { risk } : {}) }) };
|
|
298
|
+
+ context.refusalQueueHint(a.root, { kind: 'spec-approve', target: a.id, why: '스펙 봉인 승인', ...(subject ? { subject } : {}), ...(risk ? { risk } : {}), ...(title ? { title } : {}) }) };
|
|
280
299
|
}
|
|
281
300
|
// @implements A-SPEC-188 — destination BEFORE seal.
|
|
282
301
|
// The old order (seal at :481, resolve the ledger at :483) produced both measured harms: a
|
|
@@ -359,14 +378,14 @@ function createSpecApprovalHandlers(context) {
|
|
|
359
378
|
// Measured 2026-09-14: a grant read against "Original title" sealed "CHANGED after the grant".
|
|
360
379
|
if (cur && decidedSubject !== undefined && (0, spec_digest_1.specDigest)(cur.spec) !== decidedSubject) {
|
|
361
380
|
return { ok: false, reason: `spec_approve: ${a.id} changed after the decision was made — the content decided on is not the content that would be sealed. Nothing was sealed; ask again.`
|
|
362
|
-
+ context.refusalQueueHint(a.root, { kind: 'spec-approve', target: a.id, why: '스펙 봉인 승인', subject: (0, spec_digest_1.specDigest)(cur.spec) }) };
|
|
381
|
+
+ context.refusalQueueHint(a.root, { kind: 'spec-approve', target: a.id, why: '스펙 봉인 승인', subject: (0, spec_digest_1.specDigest)(cur.spec), title: cur.spec.title }) };
|
|
363
382
|
}
|
|
364
383
|
if (cur && approveResolved.source === 'grant') {
|
|
365
384
|
const bound = approveResolved.approval;
|
|
366
385
|
if (typeof bound.subject === 'string' && bound.subject !== '' && bound.subject !== (0, spec_digest_1.specDigest)(cur.spec)) {
|
|
367
386
|
const current = (0, spec_digest_1.specDigest)(cur.spec);
|
|
368
|
-
return { ok: false, reason: `[grant ${bound.nonce ?? '?'} refused: stale-subject] the grant was minted for another content of ${a.id}; the operator must read the current content and decide again (revoke the stale grant with
|
|
369
|
-
+ context.refusalQueueHint(a.root, { kind: 'spec-approve', target: a.id, why: '스펙 봉인 승인', subject: current }) };
|
|
387
|
+
return { ok: false, reason: `[grant ${bound.nonce ?? '?'} refused: stale-subject] the grant was minted for another content of ${a.id}; the operator must read the current content and decide again (revoke the stale grant with ${(0, npx_bin_1.holmesKitCommand)(a.root)} approve --revoke).`
|
|
388
|
+
+ context.refusalQueueHint(a.root, { kind: 'spec-approve', target: a.id, why: '스펙 봉인 승인', subject: current, title: cur.spec.title }) };
|
|
370
389
|
}
|
|
371
390
|
}
|
|
372
391
|
// @implements A-SPEC-536.1 — BUG-1: a spec whose YAML is broken is dropped by read()/list(),
|
|
@@ -379,9 +398,21 @@ function createSpecApprovalHandlers(context) {
|
|
|
379
398
|
return { ok: false, reason: (0, spec_store_1.notFoundReason)(a.id, unreadable) };
|
|
380
399
|
}
|
|
381
400
|
const spec = cur.spec;
|
|
382
|
-
|
|
401
|
+
// @implements A-SPEC-182.2 — scaffold bodies refuse the seal in a run or under strict; interactively it proceeds
|
|
402
|
+
// and the result names them.
|
|
403
|
+
const scaffoldStrict = scaffoldStrictFor(context.projectRootOf, a.root ?? store.specsRoot);
|
|
404
|
+
const prepared = (0, transition_policy_1.prepareApprovedSpec)(spec, specs, resolver, (rel) => (a.root ? readProjectFile(a.root, rel) : null), { scaffold: scaffoldStrict ? 'refuse' : 'allow', ancestors: scaffoldStrict ? 'refuse' : 'allow' });
|
|
383
405
|
if (!prepared.ok)
|
|
384
406
|
return prepared;
|
|
407
|
+
// @implements A-SPEC-182.3 — an ancestor above the parents that is not approved: refused in a run or under strict
|
|
408
|
+
// (above); interactively sealed as in 0.35.25 and named in the result.
|
|
409
|
+
const ancestorWarning = prepared.ancestorWarnings
|
|
410
|
+
? `${prepared.ancestorWarnings.join('; ')} — sealed; a run or classification.strict refuses this`
|
|
411
|
+
: undefined;
|
|
412
|
+
const scaffoldLeft = scaffoldStrict ? [] : (0, approval_blockers_1.scaffoldSections)(prepared.candidate);
|
|
413
|
+
const scaffoldWarning = scaffoldLeft.length > 0
|
|
414
|
+
? `${scaffoldLeft.join(', ')} still hold the spec_slice_init scaffold — sealed; a run or classification.strict refuses this`
|
|
415
|
+
: undefined;
|
|
385
416
|
const { candidate, digest } = prepared;
|
|
386
417
|
const priorDigest = (0, spec_digest_1.sealOf)(spec).approvedDigest;
|
|
387
418
|
// @implements A-SPEC-188 — the seal is written only at the version this act READ. On
|
|
@@ -618,7 +649,8 @@ function createSpecApprovalHandlers(context) {
|
|
|
618
649
|
return { approved: a.id, digest, ...(impactAdvisory ? { impactAdvisory } : {}), ...(anchorDensity ? { anchorDensity } : {}),
|
|
619
650
|
...(impactGraph ? { impactGraph } : {}), ...(impactAdvisoryUnavailable ? { impactAdvisoryUnavailable } : {}),
|
|
620
651
|
...(fttFulfilment ? { fttFulfilment } : {}), ...(killsAdvisory ? { killsAdvisory } : {}),
|
|
621
|
-
...(advisoryIds ? { advisoryIds } : {}), ...(advisoryHistory ? { advisoryHistory } : {}), ...(dismissUnknown ? { dismissUnknown } : {})
|
|
652
|
+
...(advisoryIds ? { advisoryIds } : {}), ...(advisoryHistory ? { advisoryHistory } : {}), ...(dismissUnknown ? { dismissUnknown } : {}),
|
|
653
|
+
...(scaffoldWarning ? { scaffoldWarning } : {}), ...(ancestorWarning ? { ancestorWarning } : {}) };
|
|
622
654
|
},
|
|
623
655
|
/**
|
|
624
656
|
* Pin a REQ's citations: compute the content digest of every cited source that resolves inside
|
|
@@ -705,6 +737,21 @@ function createSpecApprovalHandlers(context) {
|
|
|
705
737
|
};
|
|
706
738
|
}
|
|
707
739
|
/** Largest Files-to-Touch file the approval act reads (A-SPEC-733 round 3). */
|
|
740
|
+
/**
|
|
741
|
+
* @implements A-SPEC-182.2 — whether this seal is judged in a run or under classification.strict, where a
|
|
742
|
+
* spec_slice_init scaffold body refuses it. A root that cannot be resolved still sees a run named in the environment.
|
|
743
|
+
*/
|
|
744
|
+
function scaffoldStrictFor(projectRootOf, root) {
|
|
745
|
+
if (typeof root === 'string' && root !== '') {
|
|
746
|
+
try {
|
|
747
|
+
const r = projectRootOf(root);
|
|
748
|
+
const { runMode } = require('../../governance/run-mode');
|
|
749
|
+
return runMode(process.env, r).run || (0, config_1.loadConfig)(r).classification.strict;
|
|
750
|
+
}
|
|
751
|
+
catch { /* fall through to the environment */ }
|
|
752
|
+
}
|
|
753
|
+
return typeof process.env.HOLMES_RUN_ID === 'string' && process.env.HOLMES_RUN_ID.trim() !== '';
|
|
754
|
+
}
|
|
708
755
|
const PROJECT_READ_LIMIT = 2 * 1024 * 1024;
|
|
709
756
|
/**
|
|
710
757
|
* @implements A-SPEC-733 (round 3) — the approval act reads a Files-to-Touch path only when it is a
|
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.createSpecLifecycleHandlers = createSpecLifecycleHandlers;
|
|
37
|
-
// @implements A-SPEC-628, A-SPEC-627.1, A-SPEC-621, A-SPEC-100.2, A-SPEC-128, A-SPEC-151, A-SPEC-222, A-SPEC-538.1, A-SPEC-255, A-SPEC-133, A-SPEC-188, A-SPEC-189, A-SPEC-244, A-SPEC-245
|
|
37
|
+
// @implements A-SPEC-770.12, A-SPEC-628, A-SPEC-627.1, A-SPEC-621, A-SPEC-100.2, A-SPEC-128, A-SPEC-151, A-SPEC-222, A-SPEC-538.1, A-SPEC-255, A-SPEC-133, A-SPEC-188, A-SPEC-189, A-SPEC-244, A-SPEC-245
|
|
38
38
|
// @implements A-SPEC-638
|
|
39
39
|
const path = __importStar(require("node:path"));
|
|
40
40
|
const spec_store_1 = require("../../spec/spec-store");
|
|
@@ -255,7 +255,7 @@ function createSpecLifecycleHandlers(context) {
|
|
|
255
255
|
reason: `${a.id}은(는) 봉인된 문서입니다 — 폐기는 이 행위를 덮는 유효한 대역외 HOLMES_APPROVAL 이 필요합니다.`
|
|
256
256
|
+ ' 코드 게이트를 막고 있는 approved T-SPEC 을 폐기하면 그 게이트가 열리므로, 폐기가 승인 우회 경로가 되지 않도록 fail-closed 로 막습니다.'
|
|
257
257
|
+ ' (범위를 쓰면 kind "spec-approve")'
|
|
258
|
-
+ context.refusalQueueHint(a.root, { kind: 'spec-approve', target: a.id, why: '봉인된 스펙의 폐기' }),
|
|
258
|
+
+ context.refusalQueueHint(a.root, { kind: 'spec-approve', target: a.id, why: '봉인된 스펙의 폐기', title: spec.title }),
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
// @implements A-SPEC-245 — a grant that authorized breaking a seal is spent by it.
|
|
@@ -484,7 +484,7 @@ function createSpecLifecycleHandlers(context) {
|
|
|
484
484
|
reason: `${a.id}은(는) 봉인된 문서입니다 — 봉인 해제는 이 행위를 덮는 유효한 대역외 HOLMES_APPROVAL 이 필요합니다.`
|
|
485
485
|
+ ' 봉인을 해제하면 코드 게이트가 요구하던 approved 스펙의 봉인이 사라지므로, 해제가 승인 우회 경로가 되지 않도록 fail-closed 로 막습니다.'
|
|
486
486
|
+ ' (범위를 쓰면 kind "spec-approve")'
|
|
487
|
-
+ context.refusalQueueHint(a.root, { kind: 'spec-approve', target: a.id, why: '봉인된 스펙의 해제' }),
|
|
487
|
+
+ context.refusalQueueHint(a.root, { kind: 'spec-approve', target: a.id, why: '봉인된 스펙의 해제', title: spec.title }),
|
|
488
488
|
};
|
|
489
489
|
}
|
|
490
490
|
// @implements A-SPEC-245 — a grant that authorized breaking a seal is spent by it.
|
|
@@ -3,6 +3,13 @@ export interface SpecQueryContext {
|
|
|
3
3
|
listSpecs(): Promise<Spec[]>;
|
|
4
4
|
assertStoreReachable(tool: string, root: unknown): void;
|
|
5
5
|
resolver(specs: Spec[]): (id: string) => Spec | null;
|
|
6
|
+
/** @implements A-SPEC-774.25 — the store the answer comes from; nulls for a store that is not a directory. */
|
|
7
|
+
storeIdentity(): {
|
|
8
|
+
projectRoot: string | null;
|
|
9
|
+
specsRoot: string | null;
|
|
10
|
+
};
|
|
11
|
+
foreignRootReason(root: string | undefined): string | null;
|
|
12
|
+
refusal(reason: string): Error;
|
|
6
13
|
}
|
|
7
14
|
type NextAction = {
|
|
8
15
|
id: string;
|
|
@@ -119,6 +119,10 @@ function createSpecQueryHandlers(context) {
|
|
|
119
119
|
const badLimit = (0, phase_queries_1.limitProblem)(a?.limit); // @implements A-SPEC-746 — refused before the corpus is read
|
|
120
120
|
if (badLimit)
|
|
121
121
|
return { ok: false, reason: badLimit };
|
|
122
|
+
// @implements A-SPEC-774.25 — a root naming another project is not answered from this store.
|
|
123
|
+
const foreign = context.foreignRootReason(typeof a?.root === 'string' ? a.root : undefined);
|
|
124
|
+
if (foreign)
|
|
125
|
+
throw context.refusal(foreign);
|
|
122
126
|
const specs = await context.listSpecs();
|
|
123
127
|
// @implements A-SPEC-186
|
|
124
128
|
// The parent travels with the id because a bare one cannot be read. Measured: a reader took
|
|
@@ -179,6 +183,7 @@ function createSpecQueryHandlers(context) {
|
|
|
179
183
|
note: 'More rows follow this page (total counts every matching row) — pass nextCursor as cursor to continue, or ask for specific specs with ids.',
|
|
180
184
|
} : {}),
|
|
181
185
|
...(page.unknownIds !== undefined ? { unknownIds: page.unknownIds, unknownIdsTotal: page.unknownIdsTotal } : {}),
|
|
186
|
+
store: context.storeIdentity(), // @implements A-SPEC-774.25
|
|
182
187
|
};
|
|
183
188
|
},
|
|
184
189
|
async spec_next(a) {
|
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.createWorkspaceQueryHandlers = createWorkspaceQueryHandlers;
|
|
37
|
-
// @implements A-SPEC-610, A-SPEC-100.2, A-SPEC-121.2, A-SPEC-128, A-SPEC-131, A-SPEC-146, A-SPEC-189, A-SPEC-419, A-SPEC-461, A-SPEC-496, A-SPEC-506.1
|
|
37
|
+
// @implements A-SPEC-476.1, A-SPEC-610, A-SPEC-100.2, A-SPEC-121.2, A-SPEC-128, A-SPEC-131, A-SPEC-146, A-SPEC-189, A-SPEC-419, A-SPEC-461, A-SPEC-496, A-SPEC-506.1
|
|
38
38
|
const fs = __importStar(require("node:fs"));
|
|
39
39
|
const path = __importStar(require("node:path"));
|
|
40
40
|
const validator_1 = require("../../spec/validator");
|
|
@@ -177,7 +177,7 @@ function createWorkspaceQueryHandlers(context) {
|
|
|
177
177
|
try {
|
|
178
178
|
if (report.hits.length > 1
|
|
179
179
|
&& (0, localize_1.citationsIn)(a.issue, new Set(governed.map((s) => s.id))).cited.length === 0) {
|
|
180
|
-
const rt = (0, embedder_1.makeTierEmbedder)((0, tier_1.
|
|
180
|
+
const rt = (0, embedder_1.makeTierEmbedder)((0, tier_1.resolveProjectSemanticTier)(root), new vector_cache_1.VectorCache(root)); // A-SPEC-476.1
|
|
181
181
|
if (rt !== null) {
|
|
182
182
|
const qv = await rt.embedQuery(a.issue);
|
|
183
183
|
const docTextByFile = (0, vector_coverage_1.docTextIndex)(scanned);
|
|
@@ -1300,9 +1300,6 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
|
|
|
1300
1300
|
ok: false;
|
|
1301
1301
|
reason: string;
|
|
1302
1302
|
findings: import("../spec/validator").Finding[];
|
|
1303
|
-
candidate?: undefined;
|
|
1304
|
-
digest?: undefined;
|
|
1305
|
-
parentDigests?: undefined;
|
|
1306
1303
|
} | {
|
|
1307
1304
|
ok: boolean;
|
|
1308
1305
|
reason: string;
|
|
@@ -1328,6 +1325,8 @@ declare function makeRawHandlers(store: SpecStore, opts?: ElicitOpts): {
|
|
|
1328
1325
|
blockers?: undefined;
|
|
1329
1326
|
approvalIntent?: undefined;
|
|
1330
1327
|
} | {
|
|
1328
|
+
ancestorWarning?: string | undefined;
|
|
1329
|
+
scaffoldWarning?: string | undefined;
|
|
1331
1330
|
dismissUnknown?: string[] | undefined;
|
|
1332
1331
|
advisoryHistory?: import("../rtm/advisory-outcomes").AdvisoryState[] | undefined;
|
|
1333
1332
|
advisoryIds?: Partial<Record<string, string>> | undefined;
|
|
@@ -39,7 +39,7 @@ exports.isHandlerRefusal = isHandlerRefusal;
|
|
|
39
39
|
exports.unreadableAmong = unreadableAmong;
|
|
40
40
|
exports.makeHandlers = makeHandlers;
|
|
41
41
|
exports.collectDecisions = collectDecisions;
|
|
42
|
-
// @implements A-SPEC-718.1, A-SPEC-718.2, A-SPEC-723, A-SPEC-723.1, A-SPEC-545.6, A-SPEC-720, A-SPEC-718, A-SPEC-703, A-SPEC-629, A-SPEC-628, A-SPEC-599, A-SPEC-603, A-SPEC-604, A-SPEC-605, A-SPEC-606, A-SPEC-607, A-SPEC-608, A-SPEC-609, A-SPEC-610, A-SPEC-611, A-SPEC-612, A-SPEC-613, A-SPEC-614, A-SPEC-615, A-SPEC-616, A-SPEC-617, A-SPEC-618, A-SPEC-621, A-SPEC-622, A-SPEC-624, A-SPEC-625, A-SPEC-627, A-SPEC-713, A-SPEC-732, A-SPEC-754
|
|
42
|
+
// @implements A-SPEC-774.25, A-SPEC-770.12, A-SPEC-718.1, A-SPEC-718.2, A-SPEC-723, A-SPEC-723.1, A-SPEC-545.6, A-SPEC-720, A-SPEC-718, A-SPEC-703, A-SPEC-629, A-SPEC-628, A-SPEC-599, A-SPEC-603, A-SPEC-604, A-SPEC-605, A-SPEC-606, A-SPEC-607, A-SPEC-608, A-SPEC-609, A-SPEC-610, A-SPEC-611, A-SPEC-612, A-SPEC-613, A-SPEC-614, A-SPEC-615, A-SPEC-616, A-SPEC-617, A-SPEC-618, A-SPEC-621, A-SPEC-622, A-SPEC-624, A-SPEC-625, A-SPEC-627, A-SPEC-713, A-SPEC-732, A-SPEC-754
|
|
43
43
|
const operator_recovery_1 = require("./operator-recovery");
|
|
44
44
|
// @implements A-SPEC-643
|
|
45
45
|
// @implements A-SPEC-642
|
|
@@ -230,7 +230,8 @@ function refusalQueueHint(rootArg, store, req, operation) {
|
|
|
230
230
|
if (base === undefined)
|
|
231
231
|
return '';
|
|
232
232
|
const root = projectRootOf(base);
|
|
233
|
-
|
|
233
|
+
// @implements A-SPEC-770.12 — the request's title rides into the queue and into the line the operator reads.
|
|
234
|
+
return (0, approval_queue_1.queueHint)(root, req, (0, operator_recovery_1.operatorRecovery)(root, req.target, operation, { label: (0, approval_queue_1.requestLabel)(req.kind, req.target, req.title) }));
|
|
234
235
|
}
|
|
235
236
|
catch {
|
|
236
237
|
return '';
|
|
@@ -239,6 +240,22 @@ function refusalQueueHint(rootArg, store, req, operation) {
|
|
|
239
240
|
function projectRootOf(root) {
|
|
240
241
|
return (0, root_1.resolveProjectRoot)(root).root;
|
|
241
242
|
}
|
|
243
|
+
/**
|
|
244
|
+
* @implements A-SPEC-774.25 — which store answered: its specs directory, and the project derived from it (null when
|
|
245
|
+
* that has no `.ax` marker). A store that is not a directory (an in-memory one) has neither.
|
|
246
|
+
*/
|
|
247
|
+
function specStoreIdentity(store) {
|
|
248
|
+
if (!(store instanceof spec_store_1.LocalMarkdownRepository))
|
|
249
|
+
return { projectRoot: null, specsRoot: null };
|
|
250
|
+
const specsRoot = path.resolve(store.specsRoot);
|
|
251
|
+
try {
|
|
252
|
+
const derived = projectRootOf(specsRoot);
|
|
253
|
+
return { projectRoot: fs.existsSync(path.join(derived, '.ax')) ? derived : null, specsRoot };
|
|
254
|
+
}
|
|
255
|
+
catch {
|
|
256
|
+
return { projectRoot: null, specsRoot };
|
|
257
|
+
}
|
|
258
|
+
}
|
|
242
259
|
// @implements A-SPEC-191 §10 — WHERE a single-use approval is spent must not be a caller's choice.
|
|
243
260
|
// r8 measured all three escapes at once: a second `root`, a `root` naming a subdirectory, and an
|
|
244
261
|
// omitted `root` (cwd-relative) each handed the same nonce a fresh, empty ledger — 'N-RISK' opened a
|
|
@@ -811,6 +828,9 @@ function makeRawHandlers(store, opts) {
|
|
|
811
828
|
listSpecs: () => store.list(),
|
|
812
829
|
assertStoreReachable: (tool, root) => assertSpecStoreReachable(tool, store, root),
|
|
813
830
|
resolver,
|
|
831
|
+
storeIdentity: () => specStoreIdentity(store), // @implements A-SPEC-774.25
|
|
832
|
+
foreignRootReason: root => foreignRootReason(store, root),
|
|
833
|
+
refusal: reason => new HandlerRefusal(reason),
|
|
814
834
|
});
|
|
815
835
|
// @implements A-SPEC-263.1
|
|
816
836
|
// The in-session approval channel: ask ONLY when (a) an elicitor was injected (the server wires
|
|
@@ -14,6 +14,8 @@ export interface HarnessAttestation {
|
|
|
14
14
|
harness?: string;
|
|
15
15
|
reason?: string;
|
|
16
16
|
}
|
|
17
|
+
/** Exported for A-SPEC-102.8 (review independence walks the same names). */
|
|
18
|
+
export declare function harnessOf(args: string, exe?: string): string | null;
|
|
17
19
|
/**
|
|
18
20
|
* @implements A-SPEC-751.3 — is `script` one of the operator runtime registry's own MCP dispatcher files, unchanged
|
|
19
21
|
* since its installation receipt. Measured 2026-10-04: A-SPEC-751 starts the server through
|
|
@@ -33,10 +33,11 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.harnessOf = harnessOf;
|
|
36
37
|
exports.dispatcherVerifier = dispatcherVerifier;
|
|
37
38
|
exports.attestHarness = attestHarness;
|
|
38
39
|
exports.systemProcLookup = systemProcLookup;
|
|
39
|
-
// @implements A-SPEC-732, A-SPEC-751.3
|
|
40
|
+
// @implements A-SPEC-732, A-SPEC-751.3, A-SPEC-102.8
|
|
40
41
|
// In-session approval (a form, or the host-gated continuation) trusts the client that answers it. An
|
|
41
42
|
// agent can start its own copy of this server, name itself `claude-code` and answer for a person
|
|
42
43
|
// (measured, H7 round 1). So before offering either route, the server asks who launched it: the
|
|
@@ -78,6 +79,7 @@ const firstToken = (args) => {
|
|
|
78
79
|
return t.split(/\s+/)[0] ?? '';
|
|
79
80
|
};
|
|
80
81
|
const exeName = (args) => path.win32.basename(path.posix.basename(firstToken(args))).toLowerCase().replace(/\.exe$/, '');
|
|
82
|
+
/** Exported for A-SPEC-102.8 (review independence walks the same names). */
|
|
81
83
|
function harnessOf(args, exe) {
|
|
82
84
|
const name = exeName(args);
|
|
83
85
|
if (HARNESS_EXES.has(name))
|
|
@@ -3,6 +3,8 @@ export declare function operatorRecovery(root: string, target: string, operation
|
|
|
3
3
|
platform?: NodeJS.Platform;
|
|
4
4
|
executable?: string;
|
|
5
5
|
cli?: string;
|
|
6
|
+
/** @implements A-SPEC-770.12 — `requestLabel(kind, target, title)`, set inside the bracket after the id. */
|
|
7
|
+
label?: string;
|
|
6
8
|
}): {
|
|
7
9
|
reviewCommand: string;
|
|
8
10
|
pendingHint(id: string): string;
|
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.operatorRecovery = operatorRecovery;
|
|
37
|
-
// @implements A-SPEC-754, A-SPEC-532.3, A-SPEC-768
|
|
37
|
+
// @implements A-SPEC-754, A-SPEC-532.3, A-SPEC-768, A-SPEC-770.12
|
|
38
38
|
const path = __importStar(require("node:path"));
|
|
39
39
|
const unsafeDisplay = /[\u0000-\u001f\u007f-\u009f\u202a-\u202e\u2066-\u2069]/;
|
|
40
40
|
function literal(value, platform) {
|
|
@@ -42,6 +42,7 @@ function literal(value, platform) {
|
|
|
42
42
|
}
|
|
43
43
|
/** Formatting only: the caller must return pending text only after a successful enqueue. */
|
|
44
44
|
function operatorRecovery(root, target, operation, options) {
|
|
45
|
+
const label = options?.label ?? '';
|
|
45
46
|
const platform = options?.platform ?? process.platform;
|
|
46
47
|
const executable = options?.executable ?? process.execPath;
|
|
47
48
|
// Both src/holmes/mcp (tests) and dist/holmes/mcp (installed) have the same depth.
|
|
@@ -55,12 +56,12 @@ function operatorRecovery(root, target, operation, options) {
|
|
|
55
56
|
if (!/^req-[a-f0-9]{12}$/.test(id))
|
|
56
57
|
return '';
|
|
57
58
|
if (!command)
|
|
58
|
-
return `\n[승인 대기 ${id}] The request was recorded. Use the installed approval UI; a path exceeds the safe command display limit. No truncated command is provided.`;
|
|
59
|
+
return `\n[승인 대기 ${id}${label}] The request was recorded. Use the installed approval UI; a path exceeds the safe command display limit. No truncated command is provided.`;
|
|
59
60
|
// @implements A-SPEC-532.3 — the resident surface is offered beside the one-off command (owner, 2026-10-04:
|
|
60
61
|
// "why am I still pasting commands"): one key per arriving request.
|
|
61
62
|
// @implements A-SPEC-768 — the three lines above are the operator's; measured 2026-10-11 (HG arm) the agent read
|
|
62
63
|
// "keep the approval surface open" as its own instruction and polled a sealed spec 58 times. One line is the agent's.
|
|
63
|
-
return `\n[승인 대기 ${id}] 운영자: ${command} --grant ${literal(id, platform)}`
|
|
64
|
+
return `\n[승인 대기 ${id}${label}] 운영자: ${command} --grant ${literal(id, platform)}`
|
|
64
65
|
+ `\nOr keep the approval surface open and decide each arriving request with one key: ${command} --watch`
|
|
65
66
|
+ `\nAfter official approval, retry ${operation ? display(operation) : 'the original MCP operation'} for target ${display(target)} in the same workspace. Do not retry until approval is available.`
|
|
66
67
|
+ '\nAgent: check approval_status for the target; sealed:true or request.state granted means retry now — polling a sealed spec is wasted; request.state held carries the operator\'s question.';
|
|
@@ -11,6 +11,8 @@ const tool_schemas_1 = require("./tool-schemas");
|
|
|
11
11
|
Object.defineProperty(exports, "HOOK_ENFORCED_TOOLS", { enumerable: true, get: function () { return tool_schemas_1.HOOK_ENFORCED_TOOLS; } });
|
|
12
12
|
const validate_args_1 = require("./validate-args");
|
|
13
13
|
const approval_adapters_1 = require("./approval-adapters");
|
|
14
|
+
const tool_actions_1 = require("../governance/tool-actions");
|
|
15
|
+
const identity_1 = require("../governance/identity");
|
|
14
16
|
// @implements A-SPEC-100.2
|
|
15
17
|
// @implements A-SPEC-652.2 — the store is opened at an ABSOLUTE path resolved against the project
|
|
16
18
|
// root (CLAUDE_PROJECT_DIR, then the nearest .mcp.json/.ax ancestor, then cwd), and the path is
|
|
@@ -175,11 +177,18 @@ server.setRequestHandler(types_js_1.CallToolRequestSchema, async (req) => {
|
|
|
175
177
|
// refusal is a plain `Error` thrown by a handler; a programming fault (TypeError, RangeError…)
|
|
176
178
|
// keeps failing loudly, because dressing a crash as an orderly refusal is how a bug becomes a
|
|
177
179
|
// policy decision in the caller's log.
|
|
180
|
+
// @implements A-SPEC-774 — the role is asked here, the one point all three harnesses share; a tool call carries
|
|
181
|
+
// no path field, so the hook let `spec_create` and `spec_remediate` through for a role that could only write tests.
|
|
182
|
+
const roleRefusal = fn && check.ok
|
|
183
|
+
? (0, tool_actions_1.toolRoleRefusal)(req.params.name, args, process.cwd(), new identity_1.EnvIdentityProvider().current())
|
|
184
|
+
: null;
|
|
178
185
|
let out;
|
|
179
186
|
if (!fn)
|
|
180
187
|
out = { error: 'unknown tool' };
|
|
181
188
|
else if (!check.ok)
|
|
182
189
|
out = check;
|
|
190
|
+
else if (roleRefusal)
|
|
191
|
+
out = { ok: false, reason: `${req.params.name}: ${roleRefusal}` };
|
|
183
192
|
else {
|
|
184
193
|
try {
|
|
185
194
|
out = await fn(args);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TOOL_SCHEMAS = exports.HOOK_ENFORCED_TOOLS = void 0;
|
|
4
|
-
// @implements A-SPEC-743, A-SPEC-736, A-SPEC-735, A-SPEC-729, A-SPEC-719, A-SPEC-720, A-SPEC-718, A-SPEC-703, A-SPEC-629, A-SPEC-628, A-SPEC-623, A-SPEC-277, A-SPEC-624, A-SPEC-627, A-SPEC-713
|
|
4
|
+
// @implements A-SPEC-743, A-SPEC-736, A-SPEC-735, A-SPEC-729, A-SPEC-719, A-SPEC-720, A-SPEC-718, A-SPEC-703, A-SPEC-629, A-SPEC-628, A-SPEC-623, A-SPEC-277, A-SPEC-624, A-SPEC-627, A-SPEC-713, A-SPEC-774.25, A-SPEC-255.1
|
|
5
5
|
// @implements A-SPEC-495 — the maintenance_analyze description carries the semantic-evidence
|
|
6
6
|
// consumer contract (sem-verify / semCos / semanticAlternates) beside the anti-prediction warning.
|
|
7
7
|
// @implements A-SPEC-642
|
|
@@ -176,7 +176,7 @@ exports.TOOL_SCHEMAS = {
|
|
|
176
176
|
},
|
|
177
177
|
},
|
|
178
178
|
spec_renumber: {
|
|
179
|
-
description: "Move a whole spec FAMILY (REQ/H-SPEC/A-SPEC/T-SPEC sharing one base, dot-suffixed members included) from one number to another, and report what a machine must not touch. The tool rewrites only places with a definite grammar: filenames, frontmatter `id`, every `depends_on` in the store, `slice` tags, and source `@implements` anchors. Prose — comments, test titles, CHANGELOG entries, `source.ref` citations — is REPORTED as candidates with file and line, never substituted: measured 2026-08-23, a bulk regex doing exactly that turned REQ-253's own source citation into a reference to itself, while a hand renumber left seven prose sites behind including a comment in the shipped install.ps1. Re-sealing is NOT performed here; `spec_approve` remains the only sealer. Instead the plan returns two orders, which are opposites because the two acts refuse in opposite directions: `unsealOrder` is child-first (spec_unseal refuses while an approved child depends on the target) and `approveOrder` is parent-first (spec_approve refuses while a parent is unsealed). A spec whose `depends_on` is
|
|
179
|
+
description: "Move a whole spec FAMILY (REQ/H-SPEC/A-SPEC/T-SPEC sharing one base, dot-suffixed members included) from one number to another, and report what a machine must not touch. The tool rewrites only places with a definite grammar: filenames, frontmatter `id`, every `depends_on` in the store, `slice` tags, and source `@implements` anchors. Prose — comments, test titles, CHANGELOG entries, `source.ref` citations — is REPORTED as candidates with file and line, never substituted: measured 2026-08-23, a bulk regex doing exactly that turned REQ-253's own source citation into a reference to itself, while a hand renumber left seven prose sites behind including a comment in the shipped install.ps1. Re-sealing is NOT performed here; `spec_approve` remains the only sealer. Instead the plan returns two orders, which are opposites because the two acts refuse in opposite directions: `unsealOrder` is child-first (spec_unseal refuses while an approved child depends on the target) and `approveOrder` is parent-first (spec_approve refuses while a parent is unsealed). A moved spec whose seal survives (specDigest does not hash `id`, so e.g. the family REQ with an empty `depends_on`) is never in `unsealOrder` but IS in `approveOrder`: the ledger records the approving act by id, and until it is re-approved under the new id the Stop hook refuses it (ART-5). Refuses outright when the destination base is already claimed or the source base does not exist, emptying every list so a partial plan cannot become a partial move. `dryRun` defaults to TRUE.",
|
|
180
180
|
inputSchema: {
|
|
181
181
|
type: 'object',
|
|
182
182
|
properties: {
|
|
@@ -272,10 +272,13 @@ exports.TOOL_SCHEMAS = {
|
|
|
272
272
|
description: `List specs (id, type, status; plus parent when depends_on names one, and legacy: true when the status is outside the canonical ${spec_types_1.SPEC_STATUSES.join('|')} union — absence of legacy speaks only to the STATUS being canonical, not to governance). `
|
|
273
273
|
+ 'Answers with `summary` { total, counts[type][status] }, `pending` (first 100 specs that are not approved — what needs action) with `pendingTotal`, '
|
|
274
274
|
+ 'and one page of `specs` in id order (default 100, `limit` 1..500) with `total` and `nextCursor` while rows remain — pass it back as `cursor`. '
|
|
275
|
-
+ 'To ask whether a spec exists, pass `ids`: only those rows come back, and missing ids are named in `unknownIds`.'
|
|
275
|
+
+ 'To ask whether a spec exists, pass `ids`: only those rows come back, and missing ids are named in `unknownIds`. '
|
|
276
|
+
// @implements A-SPEC-774.25
|
|
277
|
+
+ '`store` { projectRoot, specsRoot } names the store that answered.',
|
|
276
278
|
inputSchema: {
|
|
277
279
|
type: 'object',
|
|
278
280
|
properties: {
|
|
281
|
+
root: str('Optional when the server is bound to a file store; if supplied it must resolve to the SAME project.'),
|
|
279
282
|
type: str('Optional spec kind to filter by (e.g. A-SPEC).'),
|
|
280
283
|
ids: strArray('Only these spec ids; ids that do not exist are listed in `unknownIds`.'),
|
|
281
284
|
status: str('Only this status, e.g. draft | approved | outdated.'),
|
|
@@ -1,3 +1,29 @@
|
|
|
1
|
+
/** @implements A-SPEC-770.6 — the running package's CLI (src/holmes/project and dist/holmes/project share a depth). */
|
|
2
|
+
export declare function runningCli(): string;
|
|
3
|
+
export interface ShadowCopy {
|
|
4
|
+
link: string;
|
|
5
|
+
packageDir: string | null;
|
|
6
|
+
version: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* @implements A-SPEC-770.7 — the holmes-kit npx would run from `dir`, when it is not this install; null otherwise.
|
|
10
|
+
* npx walks every ancestor `node_modules/.bin` and takes the first entry that `stat` says is a FILE (a dangling link or
|
|
11
|
+
* a directory is skipped). Round 2 measured npm-on-Windows and pnpm `.bin` entries as shim files, not links: the
|
|
12
|
+
* package is therefore found as `node_modules/{@holmes-lab/holmes-kit,holmes-kit}` beside the `.bin`, and only for a
|
|
13
|
+
* link with neither beside it through the link's target — never past a node_modules boundary (that read the consumer
|
|
14
|
+
* project's own package.json). Not memoized: a copy installed later is seen (the MCP server lives long).
|
|
15
|
+
*/
|
|
16
|
+
export declare function binEntryNames(platform?: string): string[];
|
|
17
|
+
export declare function shadowCopy(dir: string, platform?: string): ShadowCopy | null;
|
|
18
|
+
/** @implements A-SPEC-770.7 — a PowerShell single-quoted literal: PowerShell also treats U+2018–U+201B as quotes. */
|
|
19
|
+
export declare function powershellLiteral(value: string): string;
|
|
20
|
+
export declare function posixLiteral(value: string): string;
|
|
21
|
+
/**
|
|
22
|
+
* @implements A-SPEC-770.3
|
|
23
|
+
* The holmes-kit command an approval hint names, so that the install that issued it is the one that answers. Field
|
|
24
|
+
* incident 2026-10-17: ~/node_modules 0.19.3 answered a 0.35.23 hint with "no pending request matches".
|
|
25
|
+
*/
|
|
26
|
+
export declare function holmesKitCommand(root?: string, platform?: string, home?: string): string;
|
|
1
27
|
/**
|
|
2
28
|
* @implements A-SPEC-542.1
|
|
3
29
|
* The npx binary an OPERATOR can actually run on the platform this process runs on — which is the
|