@holmes-lab/holmes-kit 0.38.0 → 0.40.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 +370 -6
- package/README.md +58 -40
- package/dist/.build-id +1 -1
- package/dist/holmes/admission/core/admission-policy.d.ts +37 -0
- package/dist/holmes/admission/core/admission-policy.js +147 -0
- package/dist/holmes/admission/core/bounded-reader.d.ts +56 -0
- package/dist/holmes/admission/core/bounded-reader.js +135 -0
- package/dist/holmes/admission/core/change-classifier.d.ts +34 -0
- package/dist/holmes/admission/core/change-classifier.js +278 -0
- package/dist/holmes/admission/core/config-loader.d.ts +30 -0
- package/dist/holmes/admission/core/config-loader.js +145 -0
- package/dist/holmes/admission/core/event-judgement.d.ts +37 -0
- package/dist/holmes/admission/core/event-judgement.js +251 -0
- package/dist/holmes/admission/core/path-rules.d.ts +35 -0
- package/dist/holmes/admission/core/path-rules.js +88 -0
- package/dist/holmes/admission/core/pin.d.ts +7 -0
- package/dist/holmes/admission/core/pin.js +29 -0
- package/dist/holmes/admission/core/ports.d.ts +48 -0
- package/dist/holmes/admission/core/ports.js +11 -0
- package/dist/holmes/admission/core/range-resolver.d.ts +32 -0
- package/dist/holmes/admission/core/range-resolver.js +51 -0
- package/dist/holmes/admission/core/self-containment.d.ts +1 -0
- package/dist/holmes/admission/core/self-containment.js +125 -0
- package/dist/holmes/admission/core/signature-source.d.ts +9 -0
- package/dist/holmes/admission/core/signature-source.js +4 -0
- package/dist/holmes/admission/core/transition-planner.d.ts +15 -0
- package/dist/holmes/admission/core/transition-planner.js +14 -0
- package/dist/holmes/admission/core/verdict.d.ts +38 -0
- package/dist/holmes/admission/core/verdict.js +17 -0
- package/dist/holmes/admission/core/wiring.d.ts +44 -0
- package/dist/holmes/admission/core/wiring.js +618 -0
- package/dist/holmes/admission/forge/git-object-port.d.ts +4 -0
- package/dist/holmes/admission/forge/git-object-port.js +132 -0
- package/dist/holmes/assoc/assoc-arm.d.ts +1 -1
- package/dist/holmes/assoc/assoc-arm.js +1 -1
- package/dist/holmes/cli/agents.d.ts +8 -0
- package/dist/holmes/cli/agents.js +9 -5
- package/dist/holmes/cli/approve-cli.d.ts +2 -0
- package/dist/holmes/cli/approve-cli.js +392 -0
- package/dist/holmes/cli/approve-ref.d.ts +13 -7
- package/dist/holmes/cli/approve-ref.js +30 -10
- package/dist/holmes/cli/approve-status.d.ts +26 -2
- package/dist/holmes/cli/approve-status.js +98 -18
- package/dist/holmes/cli/approve-watch.d.ts +5 -0
- package/dist/holmes/cli/approve-watch.js +10 -5
- package/dist/holmes/cli/approve.d.ts +50 -13
- package/dist/holmes/cli/approve.js +260 -67
- package/dist/holmes/cli/attest.js +2 -1
- package/dist/holmes/cli/autonomy.d.ts +4 -1
- package/dist/holmes/cli/autonomy.js +17 -10
- package/dist/holmes/cli/codex-oracle.d.ts +11 -0
- package/dist/holmes/cli/codex-oracle.js +5 -1
- package/dist/holmes/cli/codex-toml.d.ts +10 -0
- package/dist/holmes/cli/codex-toml.js +36 -2
- package/dist/holmes/cli/doctor-boundary.d.ts +76 -0
- package/dist/holmes/cli/doctor-boundary.js +308 -0
- package/dist/holmes/cli/doctor-locks.d.ts +15 -0
- package/dist/holmes/cli/doctor-locks.js +119 -0
- package/dist/holmes/cli/doctor.d.ts +2 -0
- package/dist/holmes/cli/doctor.js +45 -5
- package/dist/holmes/cli/flags.d.ts +23 -0
- package/dist/holmes/cli/flags.js +89 -0
- package/dist/holmes/cli/index.d.ts +5 -1
- package/dist/holmes/cli/index.js +206 -424
- package/dist/holmes/cli/init.js +33 -0
- package/dist/holmes/cli/lock-recover.d.ts +5 -0
- package/dist/holmes/cli/lock-recover.js +126 -0
- package/dist/holmes/cli/mcp-processes.d.ts +32 -0
- package/dist/holmes/cli/mcp-processes.js +132 -0
- package/dist/holmes/cli/release-docs.js +1 -1
- package/dist/holmes/cli/run-exec.d.ts +141 -0
- package/dist/holmes/cli/run-exec.js +1435 -0
- package/dist/holmes/cli/run-provision.d.ts +8 -0
- package/dist/holmes/cli/run-provision.js +325 -0
- package/dist/holmes/cli/run-wiring.d.ts +69 -0
- package/dist/holmes/cli/run-wiring.js +270 -0
- package/dist/holmes/cli/run.d.ts +26 -0
- package/dist/holmes/cli/run.js +364 -83
- package/dist/holmes/cli/runtime-binding-approval.js +32 -19
- package/dist/holmes/cli/screen-safe.d.ts +3 -92
- package/dist/holmes/cli/screen-safe.js +18 -756
- package/dist/holmes/config/config.d.ts +2 -0
- package/dist/holmes/config/config.js +5 -2
- package/dist/holmes/cpg/foundation/language-matrix.js +2 -2
- package/dist/holmes/cpg/import-resolver.js +1 -1
- package/dist/holmes/governance/approval-decisions.d.ts +47 -0
- package/dist/holmes/governance/approval-decisions.js +29 -0
- package/dist/holmes/governance/approval-grants.d.ts +220 -1
- package/dist/holmes/governance/approval-grants.js +612 -33
- package/dist/holmes/governance/approval-queue.d.ts +31 -0
- package/dist/holmes/governance/approval-queue.js +122 -11
- package/dist/holmes/governance/approval-spend.d.ts +95 -0
- package/dist/holmes/governance/approval-spend.js +191 -0
- package/dist/holmes/governance/autonomous-shell.d.ts +61 -0
- package/dist/holmes/governance/autonomous-shell.js +332 -0
- package/dist/holmes/governance/autonomy.d.ts +5 -0
- package/dist/holmes/governance/autonomy.js +16 -11
- package/dist/holmes/governance/constitution.d.ts +5 -0
- package/dist/holmes/governance/constitution.js +32 -12
- package/dist/holmes/governance/full-autonomy.d.ts +10 -0
- package/dist/holmes/governance/full-autonomy.js +103 -7
- package/dist/holmes/governance/harness-catalog.d.ts +103 -0
- package/dist/holmes/governance/harness-catalog.js +348 -0
- package/dist/holmes/governance/human-channel.d.ts +38 -0
- package/dist/holmes/governance/human-channel.js +49 -0
- package/dist/holmes/governance/install-manifest.d.ts +22 -0
- package/dist/holmes/governance/install-manifest.js +160 -0
- package/dist/holmes/governance/ledger-rechain.js +2 -0
- package/dist/holmes/governance/ledger-store.conformance.d.ts +7 -1
- package/dist/holmes/governance/ledger-store.conformance.js +66 -0
- package/dist/holmes/governance/ledger-store.d.ts +88 -11
- package/dist/holmes/governance/ledger-store.js +186 -8
- package/dist/holmes/governance/provenance-chain.d.ts +16 -4
- package/dist/holmes/governance/provenance-chain.js +19 -4
- package/dist/holmes/governance/provenance-ledger.d.ts +6 -3
- package/dist/holmes/governance/provenance-ledger.js +53 -18
- package/dist/holmes/governance/push-gate-runner.js +11 -7
- package/dist/holmes/governance/recorded-pairs.d.ts +96 -0
- package/dist/holmes/governance/recorded-pairs.js +522 -0
- package/dist/holmes/governance/replica-id.d.ts +1 -1
- package/dist/holmes/governance/replica-id.js +1 -1
- package/dist/holmes/governance/spec-seam.d.ts +59 -0
- package/dist/holmes/governance/spec-seam.js +587 -0
- package/dist/holmes/governance/spend-kinds.d.ts +16 -0
- package/dist/holmes/governance/spend-kinds.js +18 -0
- package/dist/holmes/governance/tool-actions.js +2 -0
- package/dist/holmes/guardrail/decision-ledger.d.ts +2 -1
- package/dist/holmes/guardrail/decision-ledger.js +2 -1
- package/dist/holmes/guardrail/impact-gate.d.ts +1 -0
- package/dist/holmes/guardrail/impact-gate.js +1 -1
- package/dist/holmes/guardrail/line-continuation.d.ts +8 -0
- package/dist/holmes/guardrail/line-continuation.js +39 -0
- package/dist/holmes/guardrail/operator-person.d.ts +28 -4
- package/dist/holmes/guardrail/operator-person.js +57 -11
- package/dist/holmes/guardrail/refusal-codes.d.ts +8 -3
- package/dist/holmes/guardrail/refusal-codes.js +70 -10
- package/dist/holmes/guardrail/risk-classifier.d.ts +15 -9
- package/dist/holmes/guardrail/risk-classifier.js +245 -15
- package/dist/holmes/guardrail/risk-gate.d.ts +2 -8
- package/dist/holmes/guardrail/risk-gate.js +7 -34
- package/dist/holmes/guardrail/risk-types.d.ts +10 -0
- package/dist/holmes/guardrail/run-plan-scope.js +3 -1
- package/dist/holmes/guardrail/run-refusals.d.ts +6 -1
- package/dist/holmes/guardrail/run-refusals.js +36 -14
- package/dist/holmes/guardrail/run-stages.d.ts +10 -0
- package/dist/holmes/guardrail/run-stages.js +46 -6
- package/dist/holmes/guardrail/scope-judgment.js +1 -1
- package/dist/holmes/guardrail/shell-words.js +24 -3
- package/dist/holmes/guardrail/unresolved-write.d.ts +40 -0
- package/dist/holmes/guardrail/unresolved-write.js +556 -0
- package/dist/holmes/guardrail/write-target.d.ts +3 -0
- package/dist/holmes/guardrail/write-target.js +26 -5
- package/dist/holmes/hooks/pre-tool-use.d.ts +105 -1
- package/dist/holmes/hooks/pre-tool-use.js +1167 -168
- package/dist/holmes/hooks/rtm-refresh-child.d.ts +1 -1
- package/dist/holmes/hooks/rtm-refresh-child.js +1 -1
- package/dist/holmes/hooks/session-start.d.ts +5 -0
- package/dist/holmes/hooks/session-start.js +29 -1
- package/dist/holmes/hooks/stop.d.ts +23 -0
- package/dist/holmes/hooks/stop.js +88 -33
- package/dist/holmes/mcp/approval-adapters.js +3 -1
- package/dist/holmes/mcp/approval-commit.js +3 -2
- package/dist/holmes/mcp/approval-policy.d.ts +2 -1
- package/dist/holmes/mcp/approval-policy.js +3 -1
- package/dist/holmes/mcp/handlers/adoption.d.ts +1 -1
- package/dist/holmes/mcp/handlers/approval-ask.d.ts +14 -0
- package/dist/holmes/mcp/handlers/approval-ask.js +31 -6
- package/dist/holmes/mcp/handlers/entity-integration.d.ts +3 -3
- package/dist/holmes/mcp/handlers/entity-integration.js +29 -11
- package/dist/holmes/mcp/handlers/entity-renumber.d.ts +4 -4
- package/dist/holmes/mcp/handlers/entity-renumber.js +29 -11
- package/dist/holmes/mcp/handlers/entity-store.d.ts +2 -2
- package/dist/holmes/mcp/handlers/entity-store.js +133 -59
- package/dist/holmes/mcp/handlers/operator-inspection.d.ts +9 -5
- package/dist/holmes/mcp/handlers/operator-inspection.js +79 -16
- package/dist/holmes/mcp/handlers/phase-queries.d.ts +1 -1
- package/dist/holmes/mcp/handlers/requirement-triage.d.ts +4 -4
- package/dist/holmes/mcp/handlers/review-evidence.d.ts +2 -2
- package/dist/holmes/mcp/handlers/review-evidence.js +35 -11
- package/dist/holmes/mcp/handlers/review-queries.d.ts +5 -0
- package/dist/holmes/mcp/handlers/review-queries.js +8 -1
- package/dist/holmes/mcp/handlers/review-verdict.d.ts +3 -0
- package/dist/holmes/mcp/handlers/review-verdict.js +10 -3
- package/dist/holmes/mcp/handlers/risk-assessment.d.ts +7 -2
- package/dist/holmes/mcp/handlers/risk-assessment.js +34 -12
- package/dist/holmes/mcp/handlers/runtime-binding-tool.d.ts +2 -2
- package/dist/holmes/mcp/handlers/slice-orchestration.d.ts +6 -1
- package/dist/holmes/mcp/handlers/slice-orchestration.js +14 -1
- package/dist/holmes/mcp/handlers/spec-approval.d.ts +15 -3
- package/dist/holmes/mcp/handlers/spec-approval.js +32 -5
- package/dist/holmes/mcp/handlers/spec-authoring.d.ts +2 -2
- package/dist/holmes/mcp/handlers/spec-authoring.js +19 -2
- package/dist/holmes/mcp/handlers/spec-lifecycle.d.ts +11 -38
- package/dist/holmes/mcp/handlers/spec-lifecycle.js +441 -94
- package/dist/holmes/mcp/handlers/spec-queries.d.ts +2 -2
- package/dist/holmes/mcp/handlers/taint-screening.d.ts +1 -1
- package/dist/holmes/mcp/handlers/taint-screening.js +2 -2
- package/dist/holmes/mcp/handlers/test-execution.d.ts +1 -1
- package/dist/holmes/mcp/handlers/workspace-preflight.d.ts +5 -0
- package/dist/holmes/mcp/handlers/workspace-preflight.js +10 -2
- package/dist/holmes/mcp/handlers/workspace-queries.d.ts +2 -2
- package/dist/holmes/mcp/handlers.d.ts +99 -79
- package/dist/holmes/mcp/handlers.js +93 -25
- package/dist/holmes/mcp/harness-attestation.d.ts +78 -5
- package/dist/holmes/mcp/harness-attestation.js +325 -53
- package/dist/holmes/mcp/maintenance-analyze.d.ts +1 -1
- package/dist/holmes/mcp/maintenance-analyze.js +9 -9
- package/dist/holmes/mcp/maintenance-evidence.js +31 -2
- package/dist/holmes/mcp/requirement-triage-evidence.js +22 -13
- package/dist/holmes/mcp/server-staleness.d.ts +43 -0
- package/dist/holmes/mcp/server-staleness.js +158 -0
- package/dist/holmes/mcp/server.js +34 -9
- package/dist/holmes/mcp/spec-id-guard.js +1 -1
- package/dist/holmes/mcp/tool-schemas.d.ts +13 -0
- package/dist/holmes/mcp/tool-schemas.js +42 -2
- package/dist/holmes/project/act-root.d.ts +19 -0
- package/dist/holmes/project/act-root.js +100 -0
- package/dist/holmes/project/baseline.js +4 -3
- package/dist/holmes/project/bounded-group.d.ts +47 -0
- package/dist/holmes/project/bounded-group.js +140 -0
- package/dist/holmes/project/bounded-io.d.ts +50 -2
- package/dist/holmes/project/bounded-io.js +138 -6
- package/dist/holmes/project/change-source.js +2 -2
- package/dist/holmes/project/instance-id.d.ts +10 -0
- package/dist/holmes/project/instance-id.js +233 -0
- package/dist/holmes/project/machine-identity.d.ts +25 -0
- package/dist/holmes/project/machine-identity.js +133 -0
- package/dist/holmes/project/owned-lock.d.ts +84 -0
- package/dist/holmes/project/owned-lock.js +263 -0
- package/dist/holmes/project/plain-lock-fs.d.ts +2 -0
- package/dist/holmes/project/plain-lock-fs.js +126 -0
- package/dist/holmes/project/request-lock.d.ts +85 -0
- package/dist/holmes/project/request-lock.js +459 -0
- package/dist/holmes/project/root.d.ts +12 -4
- package/dist/holmes/project/root.js +26 -7
- package/dist/holmes/project/run-records.d.ts +19 -0
- package/dist/holmes/project/run-records.js +94 -12
- package/dist/holmes/project/screen-text.d.ts +94 -0
- package/dist/holmes/project/screen-text.js +763 -0
- package/dist/holmes/project/spend-lock.d.ts +82 -0
- package/dist/holmes/project/spend-lock.js +413 -0
- package/dist/holmes/project/workspace-preflight.d.ts +5 -0
- package/dist/holmes/project/workspace-preflight.js +24 -1
- package/dist/holmes/refresh/freshness-coordinator.d.ts +1 -1
- package/dist/holmes/refresh/freshness-coordinator.js +1 -1
- package/dist/holmes/review/condition-hunk-replay.js +4 -2
- package/dist/holmes/review/confidence-calibration.d.ts +1 -1
- package/dist/holmes/review/confidence-calibration.js +1 -1
- package/dist/holmes/review/content-verify.js +1 -1
- package/dist/holmes/review/hop-ablation.d.ts +4 -4
- package/dist/holmes/review/hop-ablation.js +5 -5
- package/dist/holmes/review/point-in-time-replay.js +12 -3
- package/dist/holmes/review/rank-diagnosis.d.ts +2 -2
- package/dist/holmes/review/rank-diagnosis.js +1 -1
- package/dist/holmes/review/replay-corpus.d.ts +10 -4
- package/dist/holmes/review/replay-corpus.js +25 -9
- package/dist/holmes/review/requirement-triage.js +2 -2
- package/dist/holmes/review/semantic-arm.d.ts +3 -3
- package/dist/holmes/review/semantic-arm.js +3 -3
- package/dist/holmes/review/test-outcomes.js +3 -1
- package/dist/holmes/review/test-runner.d.ts +11 -0
- package/dist/holmes/review/test-runner.js +31 -10
- package/dist/holmes/review/test-selection-breadth.js +2 -2
- package/dist/holmes/review/verdicts.d.ts +109 -7
- package/dist/holmes/review/verdicts.js +653 -34
- package/dist/holmes/rtm/anchor-census.d.ts +9 -0
- package/dist/holmes/rtm/anchor-census.js +151 -0
- package/dist/holmes/rtm/anchor-ids.d.ts +25 -1
- package/dist/holmes/rtm/anchor-ids.js +45 -2
- package/dist/holmes/rtm/comment-ranges.d.ts +2 -0
- package/dist/holmes/rtm/comment-ranges.js +104 -0
- package/dist/holmes/rtm/counted-tests.d.ts +1 -0
- package/dist/holmes/rtm/counted-tests.js +63 -0
- package/dist/holmes/rtm/impact-advisory.d.ts +1 -1
- package/dist/holmes/rtm/known-defects.js +1 -1
- package/dist/holmes/rtm/localize.js +1 -1
- package/dist/holmes/rtm/taint-benchmark.d.ts +1 -1
- package/dist/holmes/rtm/taint-vocabulary.d.ts +1 -1
- package/dist/holmes/rtm/test-scope.d.ts +31 -0
- package/dist/holmes/rtm/test-scope.js +166 -5
- package/dist/holmes/rtm/trace-gaps.js +1 -1
- package/dist/holmes/runtime/dispatch.d.ts +10 -0
- package/dist/holmes/runtime/dispatch.js +12 -1
- package/dist/holmes/semantic/cloud-usage.d.ts +1 -1
- package/dist/holmes/semantic/cloud-usage.js +1 -1
- package/dist/holmes/semantic/unreadable-paths.d.ts +1 -1
- package/dist/holmes/semantic/unreadable-paths.js +1 -1
- package/dist/holmes/spec/approval-blockers.js +1 -1
- package/dist/holmes/spec/entity-store.d.ts +6 -1
- package/dist/holmes/spec/entity-store.js +16 -2
- package/dist/holmes/spec/entity-transaction.d.ts +7 -2
- package/dist/holmes/spec/entity-transaction.js +87 -170
- package/dist/holmes/spec/spec-store.d.ts +12 -6
- package/dist/holmes/spec/spec-store.js +4 -2
- package/dist/holmes/spec/spec-types.js +1 -1
- package/dist/holmes/spec/succession-guard.d.ts +56 -0
- package/dist/holmes/spec/succession-guard.js +187 -0
- package/dist/holmes/spec/succession.d.ts +70 -0
- package/dist/holmes/spec/succession.js +171 -0
- package/dist/holmes/spec/transition-policy.d.ts +2 -2
- package/docs/install-guide.md +9 -3
- package/docs/language-support.md +78 -0
- package/package.json +4 -3
- package/playbooks/author-slice/PLAYBOOK.md +1 -1
- package/playbooks/promote-slice/PLAYBOOK.md +5 -1
- package/playbooks/publish/PLAYBOOK.md +45 -33
- package/dist/holmes/review/manual-baseline.d.ts +0 -209
- package/dist/holmes/review/manual-baseline.js +0 -2847
|
@@ -33,13 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.HandlerRefusal = void 0;
|
|
36
|
+
exports.HOST_APPROVAL_PROBE = exports.HandlerRefusal = void 0;
|
|
37
37
|
exports.fetchJson = fetchJson;
|
|
38
38
|
exports.isHandlerRefusal = isHandlerRefusal;
|
|
39
39
|
exports.unreadableAmong = unreadableAmong;
|
|
40
40
|
exports.makeHandlers = makeHandlers;
|
|
41
41
|
exports.collectDecisions = collectDecisions;
|
|
42
|
-
// @implements A-SPEC-774.25, A-SPEC-770.12,
|
|
42
|
+
// @implements A-SPEC-251.4, 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, A-SPEC-792.4
|
|
43
43
|
const operator_recovery_1 = require("./operator-recovery");
|
|
44
44
|
// @implements A-SPEC-643
|
|
45
45
|
// @implements A-SPEC-642
|
|
@@ -122,6 +122,7 @@ const cachedScanWithReport = (root, repoRoot = root) => {
|
|
|
122
122
|
return { scanned, skipped: scanner.scanSkipped() };
|
|
123
123
|
};
|
|
124
124
|
const basis_1 = require("./basis");
|
|
125
|
+
const server_staleness_1 = require("./server-staleness");
|
|
125
126
|
const write_target_1 = require("../guardrail/write-target");
|
|
126
127
|
const spec_store_1 = require("../spec/spec-store");
|
|
127
128
|
const risk_gate_1 = require("../guardrail/risk-gate");
|
|
@@ -175,6 +176,7 @@ function isHandlerRefusal(e) {
|
|
|
175
176
|
const root_1 = require("../project/root");
|
|
176
177
|
const change_source_1 = require("../project/change-source");
|
|
177
178
|
const ignore_1 = require("../project/ignore");
|
|
179
|
+
const human_channel_1 = require("../governance/human-channel");
|
|
178
180
|
// @implements A-SPEC-126
|
|
179
181
|
const adr_refs_1 = require("../spec/adr-refs");
|
|
180
182
|
// @implements A-SPEC-128
|
|
@@ -223,7 +225,7 @@ function resolveHandlerApproval(rootArg, store, envApproval, action, now) {
|
|
|
223
225
|
const r = (0, approval_grants_1.resolveApproval)(root, envApproval, action, now);
|
|
224
226
|
return r ? { ...r, root } : undefined;
|
|
225
227
|
}
|
|
226
|
-
function refusalQueueHint(rootArg, store, req, operation) {
|
|
228
|
+
function refusalQueueHint(rootArg, store, req, operation, noForm) {
|
|
227
229
|
try {
|
|
228
230
|
// The SpecStore interface carries no root; the file-backed store exposes one. A store without a
|
|
229
231
|
// root files nothing — the queue lives on disk, and with no disk location there is nothing to do.
|
|
@@ -233,7 +235,13 @@ function refusalQueueHint(rootArg, store, req, operation) {
|
|
|
233
235
|
return '';
|
|
234
236
|
const root = projectRootOf(base);
|
|
235
237
|
// @implements A-SPEC-770.12 — the request's title rides into the queue and into the line the operator reads.
|
|
236
|
-
|
|
238
|
+
const recovery = (0, operator_recovery_1.operatorRecovery)(root, req.target, operation, { label: (0, approval_queue_1.requestLabel)(req.kind, req.target, req.title) });
|
|
239
|
+
// @implements A-SPEC-792.23 — a session that cannot show a form is not sent to approval_ask (that line led an agent to
|
|
240
|
+
// the open route, review 19:2x); it is told the request waits and why no form appears here.
|
|
241
|
+
if (typeof noForm === 'string' && noForm !== '') {
|
|
242
|
+
return (0, approval_queue_1.queueHint)(root, req, { ...recovery, pendingHint: (id) => `\n[승인 대기 ${id}${(0, approval_queue_1.requestLabel)(req.kind, req.target, req.title)}]\nNo approval form can be shown in this session: ${noForm}.` });
|
|
243
|
+
}
|
|
244
|
+
return (0, approval_queue_1.queueHint)(root, req, recovery);
|
|
237
245
|
}
|
|
238
246
|
catch {
|
|
239
247
|
return '';
|
|
@@ -556,6 +564,8 @@ async function deriveChangedContext(store, rootArg, a, toolName) {
|
|
|
556
564
|
* information, and mtime would manufacture divergence on a checkout or a copy.
|
|
557
565
|
*/
|
|
558
566
|
const LOADED_BUILD = (0, basis_1.loadedBuildId)(path.resolve(__dirname, '..', '..', '..'));
|
|
567
|
+
/** @implements A-SPEC-251.4 — the version this process loaded, read once beside the build id. */
|
|
568
|
+
const SERVER_VERSION = (0, server_staleness_1.readInstallIdentity)(path.resolve(__dirname, '..', '..', '..'))?.version ?? 'unknown';
|
|
559
569
|
/**
|
|
560
570
|
* @implements A-SPEC-299
|
|
561
571
|
* Ids that were written but cannot be read back. The store drops documents it cannot parse, so
|
|
@@ -565,6 +575,11 @@ function unreadableAmong(listed, created) {
|
|
|
565
575
|
const present = new Set(listed.map((s) => s.id));
|
|
566
576
|
return created.filter((id) => !present.has(id));
|
|
567
577
|
}
|
|
578
|
+
/**
|
|
579
|
+
* @implements A-SPEC-792.26 — the in-process handle on the host-gated preparation, so a test can call it directly on a
|
|
580
|
+
* gated session (F1-e.0e f); a symbol key is skipped by every name-based listing, so the wire never sees it.
|
|
581
|
+
*/
|
|
582
|
+
exports.HOST_APPROVAL_PROBE = Symbol('holmes.hostApprovalProbe');
|
|
568
583
|
function makeHandlers(store, opts) {
|
|
569
584
|
const raw = makeRawHandlers(store, opts);
|
|
570
585
|
const wrapped = {};
|
|
@@ -583,8 +598,23 @@ function makeHandlers(store, opts) {
|
|
|
583
598
|
throw e;
|
|
584
599
|
}
|
|
585
600
|
};
|
|
586
|
-
|
|
601
|
+
const based = (0, basis_1.withBasis)(scoped, (a) => basisFor(diagnostic ? undefined : a?.root));
|
|
602
|
+
// @implements A-SPEC-251.4 — a server whose install changed under it says so on every result (objects only, as basis).
|
|
603
|
+
wrapped[name] = opts?.serverStaleness === undefined ? based : async (a) => {
|
|
604
|
+
const out = await based(a);
|
|
605
|
+
if (out === null || typeof out !== 'object' || Array.isArray(out))
|
|
606
|
+
return out;
|
|
607
|
+
let stale = null;
|
|
608
|
+
try {
|
|
609
|
+
stale = opts.serverStaleness();
|
|
610
|
+
}
|
|
611
|
+
catch {
|
|
612
|
+
stale = null;
|
|
613
|
+
}
|
|
614
|
+
return stale === null ? out : { ...out, serverStale: (0, server_staleness_1.staleNotice)(stale) };
|
|
615
|
+
};
|
|
587
616
|
}
|
|
617
|
+
wrapped[exports.HOST_APPROVAL_PROBE] = raw[exports.HOST_APPROVAL_PROBE];
|
|
588
618
|
wrapped.basis_detail = async (a) => {
|
|
589
619
|
const b = basisFor(a?.root, true);
|
|
590
620
|
return { ...b, basis: (0, basis_1.basisDigest)(b) };
|
|
@@ -727,36 +757,67 @@ function makeRawHandlers(store, opts) {
|
|
|
727
757
|
return HARNESS_NAMES[raw] ?? raw;
|
|
728
758
|
};
|
|
729
759
|
const attestation = () => {
|
|
760
|
+
// @implements A-SPEC-792.22 — a server with no attestation wired is not attested (it used to count as attested)
|
|
730
761
|
try {
|
|
731
|
-
return opts?.harnessAttestation?.() ?? { attested:
|
|
762
|
+
return opts?.harnessAttestation?.() ?? { attested: false, reason: 'no harness attestation is wired into this server' };
|
|
732
763
|
}
|
|
733
764
|
catch {
|
|
734
765
|
return { attested: false, reason: 'the server could not tell who launched it' };
|
|
735
766
|
}
|
|
736
767
|
};
|
|
768
|
+
// @implements A-SPEC-792.21 — a harness whose form is not measured to wait for a person gets no form of any kind: under
|
|
769
|
+
// codex 0.164.0 the server's parent is the shared app-server daemon, so whichever daemon client answers decides (F1-e.0).
|
|
770
|
+
// @implements A-SPEC-792.23 — an allow-list: the client name and the attested harness must both be a harness whose form
|
|
771
|
+
// is measured to wait for a person (claude alone today); naming the ones to refuse let every other name through.
|
|
772
|
+
const MEASURED_FORM = new Set(['claude']);
|
|
773
|
+
const unmeasuredForm = () => {
|
|
774
|
+
const named = canonicalHarness();
|
|
775
|
+
if (!MEASURED_FORM.has(named))
|
|
776
|
+
return named;
|
|
777
|
+
const attested = attestation().harness;
|
|
778
|
+
return attested !== undefined && MEASURED_FORM.has(attested) ? null : (attested ?? 'unattested');
|
|
779
|
+
};
|
|
780
|
+
// @implements A-SPEC-792.22 — the one gate every in-session form passes: tryElicit, approval_ask and review_verdict.
|
|
781
|
+
// approval_ask asked an ELICITABLE_KINDS request on any client without it (F1-e.0b).
|
|
782
|
+
const formGate = () => {
|
|
783
|
+
if ((0, elicit_approval_1.elicitationDisabled)(process.env))
|
|
784
|
+
return 'this session cannot show an approval form (HOLMES_ELICIT is off)';
|
|
785
|
+
const at = attestation();
|
|
786
|
+
if (!at.attested)
|
|
787
|
+
return `this session cannot show an approval form (${at.reason ?? 'not launched by a harness'})`;
|
|
788
|
+
const form = unmeasuredForm();
|
|
789
|
+
return form === null ? null : `the ${form} form is not yet measured to wait for a person (A-SPEC-792.6)`;
|
|
790
|
+
};
|
|
737
791
|
// @implements A-SPEC-732 (round 2) — no in-session route when the operator turned forms off or when
|
|
738
792
|
// no harness launched this server: the queue is the only door.
|
|
739
|
-
|
|
793
|
+
// @implements A-SPEC-792.24 — and the host-gated continuation passes the same gate, for the attested harness: chosen by
|
|
794
|
+
// the self-claimed name, codex- and antigravity-attested sessions without a form sealed with no form call (F1-e.0c).
|
|
795
|
+
const attestedHarness = () => attestation().harness ?? 'unattested';
|
|
796
|
+
const approvalAdapter = () => (formGate() !== null
|
|
740
797
|
? (0, approval_adapters_1.selectApprovalAdapter)({ harness: 'unattested', formElicitation: false })
|
|
741
798
|
: (0, approval_adapters_1.selectApprovalAdapter)({
|
|
742
|
-
harness:
|
|
799
|
+
harness: attestedHarness(),
|
|
743
800
|
formElicitation: opts?.elicitationAvailable?.() ?? Boolean(opts?.elicit),
|
|
744
801
|
}));
|
|
745
802
|
const approvalWorkspace = (root) => projectRootOf(root ?? store.specsRoot);
|
|
746
803
|
const prepareHostApproval = (input) => {
|
|
804
|
+
const gated = formGate(); // @implements A-SPEC-792.24
|
|
805
|
+
if (gated !== null)
|
|
806
|
+
throw new HandlerRefusal(`no host-gated continuation in this session: ${gated}`);
|
|
747
807
|
// @implements A-SPEC-732 — `root` only resolves the workspace; it is not an intent field. Spreading
|
|
748
808
|
// it in made a rootless call (the way harnesses call spec_approve) fail with "root is required".
|
|
749
809
|
const intent = (0, approval_intent_1.createApprovalIntent)({
|
|
750
810
|
kind: input.kind, target: input.target, subject: input.subject,
|
|
751
|
-
workspace: approvalWorkspace(input.root), runId: approvalRunId, harness:
|
|
811
|
+
workspace: approvalWorkspace(input.root), runId: approvalRunId, harness: attestedHarness(), // @implements A-SPEC-792.24
|
|
752
812
|
});
|
|
753
813
|
approvalContinuations.prepare(intent);
|
|
754
814
|
return intent;
|
|
755
815
|
};
|
|
756
|
-
const consumeHostApproval = (input) =>
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
816
|
+
const consumeHostApproval = (input) => formGate() !== null ? undefined // @implements A-SPEC-792.24 — nothing is spent outside a gated session
|
|
817
|
+
: approvalContinuations.consumeForAction({
|
|
818
|
+
kind: input.kind, target: input.target, subject: input.subject,
|
|
819
|
+
workspace: approvalWorkspace(input.root), runId: approvalRunId,
|
|
820
|
+
});
|
|
760
821
|
// @implements A-SPEC-100.2, A-SPEC-102.1, A-SPEC-111.1, A-SPEC-121.2, A-SPEC-121.3, A-SPEC-121.4, A-SPEC-128, A-SPEC-130, A-SPEC-131, A-SPEC-189, A-SPEC-233, A-SPEC-419, A-SPEC-433, A-SPEC-614
|
|
761
822
|
// @implements A-SPEC-616, A-SPEC-100.2, A-SPEC-102.1, A-SPEC-121.2, A-SPEC-121.3, A-SPEC-128, A-SPEC-130, A-SPEC-189, A-SPEC-233, A-SPEC-419, A-SPEC-433, A-SPEC-534.5, A-SPEC-534.8, A-SPEC-578.4, A-SPEC-614
|
|
762
823
|
const testExecution = (0, test_execution_1.createTestExecutionHandlers)({
|
|
@@ -847,10 +908,8 @@ function makeRawHandlers(store, opts) {
|
|
|
847
908
|
// @implements A-SPEC-540.1 — operator opt-out: with HOLMES_ELICIT=off the server never shows the
|
|
848
909
|
// in-client prompt, folding to the byte-identical `silent` (refuse+enqueue) path so claude/agy/
|
|
849
910
|
// codex all converge on one out-of-band surface (holmes-kit approve). Unset ⇒ unchanged.
|
|
850
|
-
if ((
|
|
851
|
-
return { kind: 'silent' };
|
|
852
|
-
if (!attestation().attested)
|
|
853
|
-
return { kind: 'silent' };
|
|
911
|
+
if (formGate() !== null)
|
|
912
|
+
return { kind: 'silent' }; // @implements A-SPEC-792.21, A-SPEC-792.22
|
|
854
913
|
if (!opts?.elicit || !elicit_approval_1.ELICITABLE_KINDS.has(kind))
|
|
855
914
|
return { kind: 'silent' };
|
|
856
915
|
try {
|
|
@@ -876,7 +935,9 @@ function makeRawHandlers(store, opts) {
|
|
|
876
935
|
elicit: opts?.elicit,
|
|
877
936
|
clientName: () => opts?.clientName?.() ?? 'unknown',
|
|
878
937
|
attestation,
|
|
938
|
+
formGate, // @implements A-SPEC-792.22
|
|
879
939
|
env: () => process.env,
|
|
940
|
+
serverInstance: () => opts?.serverInstance?.(), // @implements A-SPEC-779.7
|
|
880
941
|
};
|
|
881
942
|
const approvalAsk = (0, approval_ask_1.createApprovalAskHandlers)(formContext);
|
|
882
943
|
// @implements A-SPEC-102.9 — the person's review verdict, answered in the same form.
|
|
@@ -887,7 +948,7 @@ function makeRawHandlers(store, opts) {
|
|
|
887
948
|
const elicitApproval = (reason) => {
|
|
888
949
|
const chain = attestation().chain;
|
|
889
950
|
return {
|
|
890
|
-
actor:
|
|
951
|
+
actor: (0, human_channel_1.humanChannelActor)('elicitation', attestedHarness()), // @implements A-SPEC-792.25 — the attested harness
|
|
891
952
|
token: crypto.randomUUID(),
|
|
892
953
|
// @implements A-SPEC-732 (round 2) — the attested launcher chain rides the audit line.
|
|
893
954
|
rationale: `${reason ?? 'elicitation grant'}${chain && chain.length > 0 ? ` [launched by ${chain.join(' <- ')}]` : ''}`,
|
|
@@ -916,18 +977,19 @@ function makeRawHandlers(store, opts) {
|
|
|
916
977
|
tryElicit,
|
|
917
978
|
elicitApproval,
|
|
918
979
|
resolveHandlerApproval: (root, approval, action, now) => resolveHandlerApproval(root, store, approval, action, now),
|
|
919
|
-
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request),
|
|
980
|
+
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request, undefined, formGate()),
|
|
920
981
|
});
|
|
921
982
|
// @implements 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
|
|
922
983
|
const specApproval = (0, spec_approval_1.createSpecApprovalHandlers)({
|
|
923
984
|
store, resolver, projectRootOf, cachedScan, tryElicit, elicitApproval, autonomousApproval,
|
|
924
985
|
approvalAdapter,
|
|
925
|
-
approvalHarness:
|
|
926
|
-
|
|
986
|
+
approvalHarness: attestedHarness, // @implements A-SPEC-792.24 — the recorded harness is the attested one
|
|
987
|
+
// @implements A-SPEC-792.21, A-SPEC-792.22, A-SPEC-792.24 — the note reads the gate instead of restating it
|
|
988
|
+
approvalRouteNote: () => { const gated = formGate(); return gated === null ? '' : `\n[in-session approval unavailable: ${gated}]`; },
|
|
927
989
|
prepareHostApproval,
|
|
928
990
|
consumeHostApproval,
|
|
929
991
|
resolveHandlerApproval: (root, approval, action, now) => resolveHandlerApproval(root, store, approval, action, now),
|
|
930
|
-
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request, 'spec_approve'),
|
|
992
|
+
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request, 'spec_approve', formGate()), // @implements A-SPEC-792.23
|
|
931
993
|
foreignRootReason: (root) => foreignRootReason(store, root),
|
|
932
994
|
...(opts?.fullAutonomyHome ? { fullAutonomyHome: opts.fullAutonomyHome } : {}), // @implements A-SPEC-792.4
|
|
933
995
|
});
|
|
@@ -979,7 +1041,8 @@ function makeRawHandlers(store, opts) {
|
|
|
979
1041
|
store,
|
|
980
1042
|
resolveLedgerRoot,
|
|
981
1043
|
resolveHandlerApproval: (root, approval, action, now) => resolveHandlerApproval(root, store, approval, action, now),
|
|
982
|
-
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request),
|
|
1044
|
+
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request, undefined, formGate()),
|
|
1045
|
+
...(opts?.fullAutonomyHome ? { fullAutonomyHome: opts.fullAutonomyHome } : {}), // @implements A-SPEC-222.5
|
|
983
1046
|
});
|
|
984
1047
|
const operatorInspection = (0, operator_inspection_1.createOperatorInspectionHandlers)({
|
|
985
1048
|
listSpecs: () => store.list(),
|
|
@@ -991,7 +1054,7 @@ function makeRawHandlers(store, opts) {
|
|
|
991
1054
|
fetchJson,
|
|
992
1055
|
cachedScan, // @implements A-SPEC-663
|
|
993
1056
|
resolveHandlerApproval: (root, approval, action, now) => resolveHandlerApproval(root, store, approval, action, now),
|
|
994
|
-
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request),
|
|
1057
|
+
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request, undefined, formGate()),
|
|
995
1058
|
});
|
|
996
1059
|
// @implements A-SPEC-189, A-SPEC-100.2 — shared store/root capabilities retain phase contracts.
|
|
997
1060
|
const phaseQueries = (0, phase_queries_1.createPhaseQueryHandlers)({
|
|
@@ -1045,6 +1108,8 @@ function makeRawHandlers(store, opts) {
|
|
|
1045
1108
|
: undefined,
|
|
1046
1109
|
});
|
|
1047
1110
|
return {
|
|
1111
|
+
// @implements A-SPEC-792.26 — reachable in process, never on the wire (a symbol is no tool name)
|
|
1112
|
+
[exports.HOST_APPROVAL_PROBE]: { prepareHostApproval },
|
|
1048
1113
|
spec_create: specAuthoring.spec_create,
|
|
1049
1114
|
spec_validate: specQueries.spec_validate,
|
|
1050
1115
|
spec_upgrade: specAuthoring.spec_upgrade,
|
|
@@ -1082,7 +1147,9 @@ function makeRawHandlers(store, opts) {
|
|
|
1082
1147
|
// citation_pin+4, phase_check+3, cpg_scan+3, taint_scan..issue_localize, test_run+3, issue_localize+3,
|
|
1083
1148
|
// rtm_impact+4, rtm_reindex..review_record, review_prepare..risk_check, risk_check±, and the tail).
|
|
1084
1149
|
ledger_reconcile: operatorInspection.ledger_reconcile,
|
|
1085
|
-
...(0, workspace_preflight_1.createWorkspacePreflightHandlers)({ storeRoot: store instanceof spec_store_1.LocalMarkdownRepository ? store.specsRoot : undefined
|
|
1150
|
+
...(0, workspace_preflight_1.createWorkspacePreflightHandlers)({ storeRoot: store instanceof spec_store_1.LocalMarkdownRepository ? store.specsRoot : undefined,
|
|
1151
|
+
// @implements A-SPEC-251.4 — the server's own loaded identity and staleness, for the mcp-build check.
|
|
1152
|
+
server: () => ({ loaded: { version: SERVER_VERSION, buildId: LOADED_BUILD }, stale: opts?.serverStaleness?.() ?? null }) }),
|
|
1086
1153
|
// @implements A-SPEC-752.10 — same unpinned slot. Re-applies the registered binding on the owner's answer in the
|
|
1087
1154
|
// dialog; never autonomous.
|
|
1088
1155
|
...(0, runtime_binding_tool_1.createRuntimeBindingToolHandlers)({
|
|
@@ -1097,6 +1164,7 @@ function makeRawHandlers(store, opts) {
|
|
|
1097
1164
|
// @implements A-SPEC-700.2 — same unpinned slot: `spec_retire..spec_unseal` is a pinned run.
|
|
1098
1165
|
spec_reconcile: specLifecycle.spec_reconcile,
|
|
1099
1166
|
approval_ask: approvalAsk.approval_ask, // @implements A-SPEC-718.4 — a slot no pinned key order covers
|
|
1167
|
+
approval_withdraw: approvalAsk.approval_withdraw, // @implements A-SPEC-779.7
|
|
1100
1168
|
review_verdict: reviewVerdict.review_verdict, // @implements A-SPEC-102.9
|
|
1101
1169
|
rtm_impact: graphOperations.rtm_impact,
|
|
1102
1170
|
rtm_reindex: graphOperations.rtm_reindex,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
1
2
|
import { spawnSync } from 'node:child_process';
|
|
2
3
|
/** `image` is the real executable (symlinks resolved); absent when it could not be read. */
|
|
3
4
|
export interface ProcRow {
|
|
@@ -5,8 +6,12 @@ export interface ProcRow {
|
|
|
5
6
|
ppid: number;
|
|
6
7
|
args: string;
|
|
7
8
|
image?: string;
|
|
8
|
-
/** The executable
|
|
9
|
+
/** The executable as `ps -o comm=` or Windows ExecutablePath gives it, read apart from the args. A-SPEC-732.12 — on
|
|
10
|
+
* macOS comm is argv[0], which the launcher chooses, so it is no independent executable path there (lsof's image is).
|
|
11
|
+
* A-SPEC-732.13 — on Linux it is the task name, which the process can set (PR_SET_NAME). */
|
|
9
12
|
exe?: string;
|
|
13
|
+
/** A-SPEC-792.19 — why `image` is absent (lsof's failure), carried into the refusal. */
|
|
14
|
+
imageError?: string;
|
|
10
15
|
/** A-SPEC-779.6 — creation time in ms, where the platform gives it (Windows CreationDate). */
|
|
11
16
|
created?: number;
|
|
12
17
|
}
|
|
@@ -19,8 +24,37 @@ export interface HarnessAttestation {
|
|
|
19
24
|
harness?: string;
|
|
20
25
|
reason?: string;
|
|
21
26
|
}
|
|
22
|
-
/**
|
|
23
|
-
|
|
27
|
+
/**
|
|
28
|
+
* @implements A-SPEC-732.2 — how a process may be claude through a version path; every caller names one. `layout`: the
|
|
29
|
+
* path may be anywhere (the operator and review-independence direction, where a false match only refuses more).
|
|
30
|
+
* `installed`: directly inside an install directory, by realpath (the attestation direction).
|
|
31
|
+
*/
|
|
32
|
+
export type InstalledRule = {
|
|
33
|
+
kind: 'installed';
|
|
34
|
+
installDirs: readonly string[];
|
|
35
|
+
platform: NodeJS.Platform;
|
|
36
|
+
realpath?: (p: string) => string;
|
|
37
|
+
};
|
|
38
|
+
export type HarnessRule = {
|
|
39
|
+
kind: 'layout';
|
|
40
|
+
} | InstalledRule;
|
|
41
|
+
export declare const LAYOUT_RULE: HarnessRule;
|
|
42
|
+
/**
|
|
43
|
+
* @implements A-SPEC-732.1 — the directories a native Claude install keeps its versions in: `$XDG_DATA_HOME/claude/versions`
|
|
44
|
+
* when XDG_DATA_HOME is absolute, and `<home>/.local/share/claude/versions` (on Windows under the profile). `home` is an
|
|
45
|
+
* argument, so nothing here reads the process's own home.
|
|
46
|
+
*/
|
|
47
|
+
export declare function nativeInstallDirs(env: NodeJS.ProcessEnv, home: string, platform?: NodeJS.Platform): string[];
|
|
48
|
+
/** The executable names only: argv0's, then exe's. */
|
|
49
|
+
export declare function harnessByName(args: string, exe?: string): string | null;
|
|
50
|
+
/** Exported for A-SPEC-102.8 (review independence walks the same names, under its own rule). */
|
|
51
|
+
export declare function harnessOf(args: string, exe: string | undefined, rule: HarnessRule): string | null;
|
|
52
|
+
/** @implements A-SPEC-732.3 (L-d) — `rule`, when given, is used as is, so the lookup's directories and these are one value. */
|
|
53
|
+
/** @implements A-SPEC-732.6 — the walk's rule is given: it builds no default install rule of its own (a path only tests used). */
|
|
54
|
+
export interface AttestOptions {
|
|
55
|
+
rule: InstalledRule;
|
|
56
|
+
statImage?: (p: string) => fs.Stats;
|
|
57
|
+
}
|
|
24
58
|
/**
|
|
25
59
|
* @implements A-SPEC-751.3 — is `script` one of the operator runtime registry's own MCP dispatcher files, unchanged
|
|
26
60
|
* since its installation receipt. Measured 2026-10-04: A-SPEC-751 starts the server through
|
|
@@ -31,7 +65,34 @@ export declare function harnessOf(args: string, exe?: string): string | null;
|
|
|
31
65
|
*/
|
|
32
66
|
export declare function dispatcherVerifier(registryPath: string): (script: string) => boolean;
|
|
33
67
|
/** Walk up from `pid` (the server's parent) through launchers to a harness executable. */
|
|
34
|
-
export declare function attestHarness(pid: number, lookup: ProcLookup, maxDepth
|
|
68
|
+
export declare function attestHarness(pid: number, lookup: ProcLookup, maxDepth: number, isDispatcher: ((script: string) => boolean) | undefined, options: AttestOptions): HarnessAttestation;
|
|
69
|
+
/**
|
|
70
|
+
* @implements A-SPEC-732.3 (L-d, 19:16) — the live attestation the server runs: one InstalledRule, handed to the process
|
|
71
|
+
* lookup and the walk alike, its platform read from the rule only. The server called the two with separate defaults,
|
|
72
|
+
* equal today by accident. `deps` is for tests: the lookup maker and the stat.
|
|
73
|
+
*/
|
|
74
|
+
export declare function liveAttestation(pid: number, isDispatcher: (script: string) => boolean, deps: {
|
|
75
|
+
rule: InstalledRule;
|
|
76
|
+
lookupOf?: typeof systemProcLookup;
|
|
77
|
+
statImage?: (p: string) => fs.Stats;
|
|
78
|
+
}): HarnessAttestation;
|
|
79
|
+
/**
|
|
80
|
+
* @implements A-SPEC-732.4 — the server's live attestation, in the one entry its tests reach: the install directories
|
|
81
|
+
* from `env` and `home`, the runtime registry's dispatcher under `home`, and the walk of `liveAttestation`. `server.ts`
|
|
82
|
+
* builds nothing else; home and env are arguments, so a test gives them (jest's process.env never reaches os.homedir()).
|
|
83
|
+
*/
|
|
84
|
+
export declare function serverAttestation(ppid: number, ctx: {
|
|
85
|
+
env: NodeJS.ProcessEnv;
|
|
86
|
+
home: string;
|
|
87
|
+
platform?: NodeJS.Platform;
|
|
88
|
+
lookupOf?: typeof systemProcLookup;
|
|
89
|
+
statImage?: (p: string) => fs.Stats;
|
|
90
|
+
}): HarnessAttestation;
|
|
91
|
+
/**
|
|
92
|
+
* @implements A-SPEC-732.5 — the operator walk's process lookup, given the walk's own layout rule. verdicts.ts built it
|
|
93
|
+
* with `spawnSync` itself; every live lookup is now assembled here.
|
|
94
|
+
*/
|
|
95
|
+
export declare function operatorLookup(make?: typeof systemProcLookup): ProcLookup;
|
|
35
96
|
/**
|
|
36
97
|
* The live process table: `ps` on POSIX, CIM through PowerShell on Windows. Null when unreadable.
|
|
37
98
|
* @implements A-SPEC-779.6 — on Windows, PROC_GONE when the query answered with no row. Windows keeps an exited
|
|
@@ -40,4 +101,16 @@ export declare function attestHarness(pid: number, lookup: ProcLookup, maxDepth?
|
|
|
40
101
|
* print GONE; only status 0 without a spawn error is believed. POSIX reparents an orphan to pid 1 and is unchanged.
|
|
41
102
|
* `spawn` is injectable so the Windows branch is tested on every OS.
|
|
42
103
|
*/
|
|
43
|
-
export declare function systemProcLookup(platform
|
|
104
|
+
export declare function systemProcLookup(platform: NodeJS.Platform, spawn: typeof spawnSync, rule: HarnessRule): ProcLookup;
|
|
105
|
+
/**
|
|
106
|
+
* The real executable of `pid`: Linux `/proc/<pid>/exe`, macOS the `txt` descriptor from lsof, or why it could not be read.
|
|
107
|
+
* @implements A-SPEC-792.17 — lsof by absolute path: a server whose PATH lacks /usr/sbin found no lsof (measured).
|
|
108
|
+
* @implements A-SPEC-792.19 — lsof alone. `ps -o comm=` is argv[0] on macOS, chosen by the launcher, so standing it in
|
|
109
|
+
* for the image let `exec -a …/bin/claude /bin/sleep` attest whenever lsof gave no line (review 18:26, F2.1-a).
|
|
110
|
+
*/
|
|
111
|
+
export declare function imageRead(pid: number, platform: NodeJS.Platform, env?: NodeJS.ProcessEnv, spawn?: typeof spawnSync): {
|
|
112
|
+
image: string;
|
|
113
|
+
} | {
|
|
114
|
+
reason: string;
|
|
115
|
+
};
|
|
116
|
+
export declare function imageOf(pid: number, platform: NodeJS.Platform, env?: NodeJS.ProcessEnv): string | undefined;
|