@holmes-lab/holmes-kit 0.39.0 → 0.40.1
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 +578 -6
- package/README.md +120 -41
- 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 +49 -13
- package/dist/holmes/cli/approve.js +249 -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 +34 -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 +226 -442
- package/dist/holmes/cli/init.js +33 -0
- package/dist/holmes/cli/interactive-prompt.d.ts +39 -2
- package/dist/holmes/cli/interactive-prompt.js +98 -16
- 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.js +1 -1
- 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 +3 -1
- package/dist/holmes/cli/run-provision.js +255 -44
- 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 +21 -0
- package/dist/holmes/cli/run.js +341 -92
- 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 +19 -0
- package/dist/holmes/config/config.js +18 -3
- 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 +26 -0
- package/dist/holmes/governance/approval-queue.js +109 -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 +12 -0
- package/dist/holmes/governance/autonomy.js +51 -15
- 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.d.ts +2 -0
- package/dist/holmes/governance/push-gate-runner.js +50 -9
- package/dist/holmes/governance/push-gate.d.ts +13 -2
- package/dist/holmes/governance/push-gate.js +106 -14
- 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/guardrail/advisory-line.d.ts +102 -0
- package/dist/holmes/guardrail/advisory-line.js +718 -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 +7 -0
- package/dist/holmes/guardrail/impact-gate.js +33 -6
- 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 +64 -10
- package/dist/holmes/guardrail/risk-classifier.d.ts +15 -9
- package/dist/holmes/guardrail/risk-classifier.js +228 -16
- 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.js +24 -8
- package/dist/holmes/guardrail/run-stages.d.ts +5 -0
- package/dist/holmes/guardrail/run-stages.js +25 -5
- 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 +116 -1
- package/dist/holmes/hooks/pre-tool-use.js +1176 -170
- 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.js +17 -1
- package/dist/holmes/hooks/stop.d.ts +23 -0
- package/dist/holmes/hooks/stop.js +86 -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 +3 -0
- package/dist/holmes/mcp/handlers/approval-ask.js +18 -7
- 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/maintenance-analysis.d.ts +13 -0
- package/dist/holmes/mcp/handlers/maintenance-analysis.js +59 -2
- 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 +471 -4
- package/dist/holmes/mcp/handlers/test-execution.js +199 -21
- package/dist/holmes/mcp/handlers/workspace-queries.d.ts +2 -2
- package/dist/holmes/mcp/handlers.d.ts +557 -82
- package/dist/holmes/mcp/handlers.js +74 -23
- 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 +6 -1
- package/dist/holmes/mcp/maintenance-analyze.js +13 -11
- package/dist/holmes/mcp/maintenance-evidence.d.ts +9 -0
- package/dist/holmes/mcp/maintenance-evidence.js +35 -3
- package/dist/holmes/mcp/requirement-triage-evidence.js +22 -13
- package/dist/holmes/mcp/server-staleness.js +1 -1
- package/dist/holmes/mcp/server.js +9 -8
- 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 -9
- package/dist/holmes/project/act-root.d.ts +19 -0
- package/dist/holmes/project/act-root.js +100 -0
- package/dist/holmes/project/baseline.d.ts +15 -2
- package/dist/holmes/project/baseline.js +14 -8
- 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 +51 -2
- package/dist/holmes/project/bounded-io.js +140 -6
- package/dist/holmes/project/change-source.d.ts +4 -0
- package/dist/holmes/project/change-source.js +14 -6
- 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 +29 -8
- 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/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/evidence-mode.d.ts +21 -0
- package/dist/holmes/review/evidence-mode.js +33 -0
- package/dist/holmes/review/head-worktree.d.ts +55 -0
- package/dist/holmes/review/head-worktree.js +329 -0
- package/dist/holmes/review/hop-ablation.d.ts +4 -4
- package/dist/holmes/review/hop-ablation.js +5 -5
- package/dist/holmes/review/mrp.js +13 -3
- 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/run-provenance.d.ts +45 -0
- package/dist/holmes/review/run-provenance.js +314 -0
- package/dist/holmes/review/semantic-arm.d.ts +3 -3
- package/dist/holmes/review/semantic-arm.js +3 -3
- package/dist/holmes/review/test-evidence.d.ts +174 -0
- package/dist/holmes/review/test-evidence.js +330 -2
- package/dist/holmes/review/test-outcomes.js +3 -1
- package/dist/holmes/review/test-reports.d.ts +94 -0
- package/dist/holmes/review/test-reports.js +382 -0
- package/dist/holmes/review/test-runner.d.ts +180 -58
- package/dist/holmes/review/test-runner.js +560 -324
- package/dist/holmes/review/test-selection-breadth.js +2 -2
- package/dist/holmes/review/test-units.d.ts +159 -0
- package/dist/holmes/review/test-units.js +814 -0
- package/dist/holmes/review/verdicts.d.ts +105 -8
- package/dist/holmes/review/verdicts.js +640 -36
- 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 +47 -34
- 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-251.4,
|
|
42
|
+
// @implements A-SPEC-128.2, A-SPEC-128.5, A-SPEC-251.4,A-SPEC-466.2,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
|
|
@@ -175,7 +175,9 @@ function isHandlerRefusal(e) {
|
|
|
175
175
|
// @implements A-SPEC-128
|
|
176
176
|
const root_1 = require("../project/root");
|
|
177
177
|
const change_source_1 = require("../project/change-source");
|
|
178
|
+
const evidence_mode_1 = require("../review/evidence-mode");
|
|
178
179
|
const ignore_1 = require("../project/ignore");
|
|
180
|
+
const human_channel_1 = require("../governance/human-channel");
|
|
179
181
|
// @implements A-SPEC-126
|
|
180
182
|
const adr_refs_1 = require("../spec/adr-refs");
|
|
181
183
|
// @implements A-SPEC-128
|
|
@@ -224,7 +226,7 @@ function resolveHandlerApproval(rootArg, store, envApproval, action, now) {
|
|
|
224
226
|
const r = (0, approval_grants_1.resolveApproval)(root, envApproval, action, now);
|
|
225
227
|
return r ? { ...r, root } : undefined;
|
|
226
228
|
}
|
|
227
|
-
function refusalQueueHint(rootArg, store, req, operation) {
|
|
229
|
+
function refusalQueueHint(rootArg, store, req, operation, noForm) {
|
|
228
230
|
try {
|
|
229
231
|
// The SpecStore interface carries no root; the file-backed store exposes one. A store without a
|
|
230
232
|
// root files nothing — the queue lives on disk, and with no disk location there is nothing to do.
|
|
@@ -234,7 +236,13 @@ function refusalQueueHint(rootArg, store, req, operation) {
|
|
|
234
236
|
return '';
|
|
235
237
|
const root = projectRootOf(base);
|
|
236
238
|
// @implements A-SPEC-770.12 — the request's title rides into the queue and into the line the operator reads.
|
|
237
|
-
|
|
239
|
+
const recovery = (0, operator_recovery_1.operatorRecovery)(root, req.target, operation, { label: (0, approval_queue_1.requestLabel)(req.kind, req.target, req.title) });
|
|
240
|
+
// @implements A-SPEC-792.23 — a session that cannot show a form is not sent to approval_ask (that line led an agent to
|
|
241
|
+
// the open route, review 19:2x); it is told the request waits and why no form appears here.
|
|
242
|
+
if (typeof noForm === 'string' && noForm !== '') {
|
|
243
|
+
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}.` });
|
|
244
|
+
}
|
|
245
|
+
return (0, approval_queue_1.queueHint)(root, req, recovery);
|
|
238
246
|
}
|
|
239
247
|
catch {
|
|
240
248
|
return '';
|
|
@@ -476,6 +484,8 @@ function makeChangeSource(root, a) {
|
|
|
476
484
|
return new change_source_1.SnapshotChangeSource(root, a.since ?? DEFAULT_BASELINE, {
|
|
477
485
|
isIgnored: (p) => ignore.isIgnored(p),
|
|
478
486
|
verify: path.join(root, '.ax', 'ledger', 'provenance.jsonl'),
|
|
487
|
+
// @implements A-SPEC-128.2 — narrow only against a tree a full run verified (A-SPEC-128.5: the shared token)
|
|
488
|
+
requireMode: evidence_mode_1.FULL_MODE,
|
|
479
489
|
});
|
|
480
490
|
}
|
|
481
491
|
// ContentSource factory shared by context_bundle and review_prepare: specMap
|
|
@@ -568,6 +578,11 @@ function unreadableAmong(listed, created) {
|
|
|
568
578
|
const present = new Set(listed.map((s) => s.id));
|
|
569
579
|
return created.filter((id) => !present.has(id));
|
|
570
580
|
}
|
|
581
|
+
/**
|
|
582
|
+
* @implements A-SPEC-792.26 — the in-process handle on the host-gated preparation, so a test can call it directly on a
|
|
583
|
+
* gated session (F1-e.0e f); a symbol key is skipped by every name-based listing, so the wire never sees it.
|
|
584
|
+
*/
|
|
585
|
+
exports.HOST_APPROVAL_PROBE = Symbol('holmes.hostApprovalProbe');
|
|
571
586
|
function makeHandlers(store, opts) {
|
|
572
587
|
const raw = makeRawHandlers(store, opts);
|
|
573
588
|
const wrapped = {};
|
|
@@ -602,6 +617,7 @@ function makeHandlers(store, opts) {
|
|
|
602
617
|
return stale === null ? out : { ...out, serverStale: (0, server_staleness_1.staleNotice)(stale) };
|
|
603
618
|
};
|
|
604
619
|
}
|
|
620
|
+
wrapped[exports.HOST_APPROVAL_PROBE] = raw[exports.HOST_APPROVAL_PROBE];
|
|
605
621
|
wrapped.basis_detail = async (a) => {
|
|
606
622
|
const b = basisFor(a?.root, true);
|
|
607
623
|
return { ...b, basis: (0, basis_1.basisDigest)(b) };
|
|
@@ -744,40 +760,72 @@ function makeRawHandlers(store, opts) {
|
|
|
744
760
|
return HARNESS_NAMES[raw] ?? raw;
|
|
745
761
|
};
|
|
746
762
|
const attestation = () => {
|
|
763
|
+
// @implements A-SPEC-792.22 — a server with no attestation wired is not attested (it used to count as attested)
|
|
747
764
|
try {
|
|
748
|
-
return opts?.harnessAttestation?.() ?? { attested:
|
|
765
|
+
return opts?.harnessAttestation?.() ?? { attested: false, reason: 'no harness attestation is wired into this server' };
|
|
749
766
|
}
|
|
750
767
|
catch {
|
|
751
768
|
return { attested: false, reason: 'the server could not tell who launched it' };
|
|
752
769
|
}
|
|
753
770
|
};
|
|
771
|
+
// @implements A-SPEC-792.21 — a harness whose form is not measured to wait for a person gets no form of any kind: under
|
|
772
|
+
// codex 0.164.0 the server's parent is the shared app-server daemon, so whichever daemon client answers decides (F1-e.0).
|
|
773
|
+
// @implements A-SPEC-792.23 — an allow-list: the client name and the attested harness must both be a harness whose form
|
|
774
|
+
// is measured to wait for a person (claude alone today); naming the ones to refuse let every other name through.
|
|
775
|
+
const MEASURED_FORM = new Set(['claude']);
|
|
776
|
+
const unmeasuredForm = () => {
|
|
777
|
+
const named = canonicalHarness();
|
|
778
|
+
if (!MEASURED_FORM.has(named))
|
|
779
|
+
return named;
|
|
780
|
+
const attested = attestation().harness;
|
|
781
|
+
return attested !== undefined && MEASURED_FORM.has(attested) ? null : (attested ?? 'unattested');
|
|
782
|
+
};
|
|
783
|
+
// @implements A-SPEC-792.22 — the one gate every in-session form passes: tryElicit, approval_ask and review_verdict.
|
|
784
|
+
// approval_ask asked an ELICITABLE_KINDS request on any client without it (F1-e.0b).
|
|
785
|
+
const formGate = () => {
|
|
786
|
+
if ((0, elicit_approval_1.elicitationDisabled)(process.env))
|
|
787
|
+
return 'this session cannot show an approval form (HOLMES_ELICIT is off)';
|
|
788
|
+
const at = attestation();
|
|
789
|
+
if (!at.attested)
|
|
790
|
+
return `this session cannot show an approval form (${at.reason ?? 'not launched by a harness'})`;
|
|
791
|
+
const form = unmeasuredForm();
|
|
792
|
+
return form === null ? null : `the ${form} form is not yet measured to wait for a person (A-SPEC-792.6)`;
|
|
793
|
+
};
|
|
754
794
|
// @implements A-SPEC-732 (round 2) — no in-session route when the operator turned forms off or when
|
|
755
795
|
// no harness launched this server: the queue is the only door.
|
|
756
|
-
|
|
796
|
+
// @implements A-SPEC-792.24 — and the host-gated continuation passes the same gate, for the attested harness: chosen by
|
|
797
|
+
// the self-claimed name, codex- and antigravity-attested sessions without a form sealed with no form call (F1-e.0c).
|
|
798
|
+
const attestedHarness = () => attestation().harness ?? 'unattested';
|
|
799
|
+
const approvalAdapter = () => (formGate() !== null
|
|
757
800
|
? (0, approval_adapters_1.selectApprovalAdapter)({ harness: 'unattested', formElicitation: false })
|
|
758
801
|
: (0, approval_adapters_1.selectApprovalAdapter)({
|
|
759
|
-
harness:
|
|
802
|
+
harness: attestedHarness(),
|
|
760
803
|
formElicitation: opts?.elicitationAvailable?.() ?? Boolean(opts?.elicit),
|
|
761
804
|
}));
|
|
762
805
|
const approvalWorkspace = (root) => projectRootOf(root ?? store.specsRoot);
|
|
763
806
|
const prepareHostApproval = (input) => {
|
|
807
|
+
const gated = formGate(); // @implements A-SPEC-792.24
|
|
808
|
+
if (gated !== null)
|
|
809
|
+
throw new HandlerRefusal(`no host-gated continuation in this session: ${gated}`);
|
|
764
810
|
// @implements A-SPEC-732 — `root` only resolves the workspace; it is not an intent field. Spreading
|
|
765
811
|
// it in made a rootless call (the way harnesses call spec_approve) fail with "root is required".
|
|
766
812
|
const intent = (0, approval_intent_1.createApprovalIntent)({
|
|
767
813
|
kind: input.kind, target: input.target, subject: input.subject,
|
|
768
|
-
workspace: approvalWorkspace(input.root), runId: approvalRunId, harness:
|
|
814
|
+
workspace: approvalWorkspace(input.root), runId: approvalRunId, harness: attestedHarness(), // @implements A-SPEC-792.24
|
|
769
815
|
});
|
|
770
816
|
approvalContinuations.prepare(intent);
|
|
771
817
|
return intent;
|
|
772
818
|
};
|
|
773
|
-
const consumeHostApproval = (input) =>
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
819
|
+
const consumeHostApproval = (input) => formGate() !== null ? undefined // @implements A-SPEC-792.24 — nothing is spent outside a gated session
|
|
820
|
+
: approvalContinuations.consumeForAction({
|
|
821
|
+
kind: input.kind, target: input.target, subject: input.subject,
|
|
822
|
+
workspace: approvalWorkspace(input.root), runId: approvalRunId,
|
|
823
|
+
});
|
|
777
824
|
// @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
|
|
778
825
|
// @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
|
|
779
826
|
const testExecution = (0, test_execution_1.createTestExecutionHandlers)({
|
|
780
827
|
defaultBaseline: DEFAULT_BASELINE,
|
|
828
|
+
refusal: reason => new HandlerRefusal(reason), // @implements A-SPEC-466.2
|
|
781
829
|
deriveChangedContext: (root, args, tool) => deriveChangedContext(store, root, args, tool),
|
|
782
830
|
});
|
|
783
831
|
const reviewQueries = (0, review_queries_1.createReviewQueryHandlers)({
|
|
@@ -864,10 +912,8 @@ function makeRawHandlers(store, opts) {
|
|
|
864
912
|
// @implements A-SPEC-540.1 — operator opt-out: with HOLMES_ELICIT=off the server never shows the
|
|
865
913
|
// in-client prompt, folding to the byte-identical `silent` (refuse+enqueue) path so claude/agy/
|
|
866
914
|
// codex all converge on one out-of-band surface (holmes-kit approve). Unset ⇒ unchanged.
|
|
867
|
-
if ((
|
|
868
|
-
return { kind: 'silent' };
|
|
869
|
-
if (!attestation().attested)
|
|
870
|
-
return { kind: 'silent' };
|
|
915
|
+
if (formGate() !== null)
|
|
916
|
+
return { kind: 'silent' }; // @implements A-SPEC-792.21, A-SPEC-792.22
|
|
871
917
|
if (!opts?.elicit || !elicit_approval_1.ELICITABLE_KINDS.has(kind))
|
|
872
918
|
return { kind: 'silent' };
|
|
873
919
|
try {
|
|
@@ -893,6 +939,7 @@ function makeRawHandlers(store, opts) {
|
|
|
893
939
|
elicit: opts?.elicit,
|
|
894
940
|
clientName: () => opts?.clientName?.() ?? 'unknown',
|
|
895
941
|
attestation,
|
|
942
|
+
formGate, // @implements A-SPEC-792.22
|
|
896
943
|
env: () => process.env,
|
|
897
944
|
serverInstance: () => opts?.serverInstance?.(), // @implements A-SPEC-779.7
|
|
898
945
|
};
|
|
@@ -905,7 +952,7 @@ function makeRawHandlers(store, opts) {
|
|
|
905
952
|
const elicitApproval = (reason) => {
|
|
906
953
|
const chain = attestation().chain;
|
|
907
954
|
return {
|
|
908
|
-
actor:
|
|
955
|
+
actor: (0, human_channel_1.humanChannelActor)('elicitation', attestedHarness()), // @implements A-SPEC-792.25 — the attested harness
|
|
909
956
|
token: crypto.randomUUID(),
|
|
910
957
|
// @implements A-SPEC-732 (round 2) — the attested launcher chain rides the audit line.
|
|
911
958
|
rationale: `${reason ?? 'elicitation grant'}${chain && chain.length > 0 ? ` [launched by ${chain.join(' <- ')}]` : ''}`,
|
|
@@ -934,18 +981,19 @@ function makeRawHandlers(store, opts) {
|
|
|
934
981
|
tryElicit,
|
|
935
982
|
elicitApproval,
|
|
936
983
|
resolveHandlerApproval: (root, approval, action, now) => resolveHandlerApproval(root, store, approval, action, now),
|
|
937
|
-
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request),
|
|
984
|
+
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request, undefined, formGate()),
|
|
938
985
|
});
|
|
939
986
|
// @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
|
|
940
987
|
const specApproval = (0, spec_approval_1.createSpecApprovalHandlers)({
|
|
941
988
|
store, resolver, projectRootOf, cachedScan, tryElicit, elicitApproval, autonomousApproval,
|
|
942
989
|
approvalAdapter,
|
|
943
|
-
approvalHarness:
|
|
944
|
-
|
|
990
|
+
approvalHarness: attestedHarness, // @implements A-SPEC-792.24 — the recorded harness is the attested one
|
|
991
|
+
// @implements A-SPEC-792.21, A-SPEC-792.22, A-SPEC-792.24 — the note reads the gate instead of restating it
|
|
992
|
+
approvalRouteNote: () => { const gated = formGate(); return gated === null ? '' : `\n[in-session approval unavailable: ${gated}]`; },
|
|
945
993
|
prepareHostApproval,
|
|
946
994
|
consumeHostApproval,
|
|
947
995
|
resolveHandlerApproval: (root, approval, action, now) => resolveHandlerApproval(root, store, approval, action, now),
|
|
948
|
-
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request, 'spec_approve'),
|
|
996
|
+
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request, 'spec_approve', formGate()), // @implements A-SPEC-792.23
|
|
949
997
|
foreignRootReason: (root) => foreignRootReason(store, root),
|
|
950
998
|
...(opts?.fullAutonomyHome ? { fullAutonomyHome: opts.fullAutonomyHome } : {}), // @implements A-SPEC-792.4
|
|
951
999
|
});
|
|
@@ -997,7 +1045,8 @@ function makeRawHandlers(store, opts) {
|
|
|
997
1045
|
store,
|
|
998
1046
|
resolveLedgerRoot,
|
|
999
1047
|
resolveHandlerApproval: (root, approval, action, now) => resolveHandlerApproval(root, store, approval, action, now),
|
|
1000
|
-
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request),
|
|
1048
|
+
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request, undefined, formGate()),
|
|
1049
|
+
...(opts?.fullAutonomyHome ? { fullAutonomyHome: opts.fullAutonomyHome } : {}), // @implements A-SPEC-222.5
|
|
1001
1050
|
});
|
|
1002
1051
|
const operatorInspection = (0, operator_inspection_1.createOperatorInspectionHandlers)({
|
|
1003
1052
|
listSpecs: () => store.list(),
|
|
@@ -1009,7 +1058,7 @@ function makeRawHandlers(store, opts) {
|
|
|
1009
1058
|
fetchJson,
|
|
1010
1059
|
cachedScan, // @implements A-SPEC-663
|
|
1011
1060
|
resolveHandlerApproval: (root, approval, action, now) => resolveHandlerApproval(root, store, approval, action, now),
|
|
1012
|
-
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request),
|
|
1061
|
+
refusalQueueHint: (root, request) => refusalQueueHint(root, store, request, undefined, formGate()),
|
|
1013
1062
|
});
|
|
1014
1063
|
// @implements A-SPEC-189, A-SPEC-100.2 — shared store/root capabilities retain phase contracts.
|
|
1015
1064
|
const phaseQueries = (0, phase_queries_1.createPhaseQueryHandlers)({
|
|
@@ -1063,6 +1112,8 @@ function makeRawHandlers(store, opts) {
|
|
|
1063
1112
|
: undefined,
|
|
1064
1113
|
});
|
|
1065
1114
|
return {
|
|
1115
|
+
// @implements A-SPEC-792.26 — reachable in process, never on the wire (a symbol is no tool name)
|
|
1116
|
+
[exports.HOST_APPROVAL_PROBE]: { prepareHostApproval },
|
|
1066
1117
|
spec_create: specAuthoring.spec_create,
|
|
1067
1118
|
spec_validate: specQueries.spec_validate,
|
|
1068
1119
|
spec_upgrade: specAuthoring.spec_upgrade,
|
|
@@ -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;
|