@holmes-lab/holmes-kit 0.39.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 +344 -6
- package/README.md +54 -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 +202 -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.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 +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 +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 +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/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 +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 +105 -1
- package/dist/holmes/hooks/pre-tool-use.js +1134 -167
- 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/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/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-queries.d.ts +2 -2
- package/dist/holmes/mcp/handlers.d.ts +89 -79
- package/dist/holmes/mcp/handlers.js +69 -22
- 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.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 +29 -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/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 +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 +45 -33
- package/dist/holmes/review/manual-baseline.d.ts +0 -209
- package/dist/holmes/review/manual-baseline.js +0 -2847
|
@@ -43,6 +43,7 @@ const path = __importStar(require("node:path"));
|
|
|
43
43
|
const crypto = __importStar(require("node:crypto"));
|
|
44
44
|
const node_child_process_1 = require("node:child_process");
|
|
45
45
|
const bounded_io_1 = require("../project/bounded-io");
|
|
46
|
+
const root_1 = require("../project/root");
|
|
46
47
|
/**
|
|
47
48
|
* A pathspec is ours to control, but a caller mistake here writes outside the destination, so it is
|
|
48
49
|
* checked rather than trusted: repo-relative, no escape, no absolute root.
|
|
@@ -53,8 +54,10 @@ function pathspecIsSafe(pathspec) {
|
|
|
53
54
|
const normalized = path.normalize(pathspec);
|
|
54
55
|
return !normalized.startsWith('..') && !normalized.split(path.sep).includes('..');
|
|
55
56
|
}
|
|
57
|
+
// @implements A-SPEC-792.42 — the shared inert git environment (its archive ran the repository's smudge filters)
|
|
58
|
+
const replayEnv = () => (0, bounded_io_1.gitEnv)((0, root_1.cleanSubprocessEnv)());
|
|
56
59
|
function git(repoRoot, args) {
|
|
57
|
-
return (0, node_child_process_1.execFileSync)('git', ['-C', repoRoot, ...args], { timeout: bounded_io_1.GIT_LONG_TIMEOUT_MS, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024 });
|
|
60
|
+
return (0, node_child_process_1.execFileSync)('git', ['-C', repoRoot, ...args], { timeout: bounded_io_1.GIT_LONG_TIMEOUT_MS, encoding: 'utf8', maxBuffer: 64 * 1024 * 1024, env: replayEnv() });
|
|
58
61
|
}
|
|
59
62
|
/** `path mode sha` triples the commit records for the pathspec, keyed by repo-relative path. */
|
|
60
63
|
function blobsAt(repoRoot, commitish, pathspec) {
|
|
@@ -96,6 +99,11 @@ function materializeTreeAt(repoRoot, commitish, pathspec, destDir, opts) {
|
|
|
96
99
|
return { ok: false, reason: `destination-not-empty: destination is not empty: ${destDir}` };
|
|
97
100
|
}
|
|
98
101
|
fs.mkdirSync(destDir, { recursive: true });
|
|
102
|
+
// @implements A-SPEC-792.44 — the filter and hook names first: neither the listing nor the archive runs without them
|
|
103
|
+
const env = replayEnv();
|
|
104
|
+
const drivers = (0, bounded_io_1.inertDriverArgs)(repoRoot, env);
|
|
105
|
+
if (drivers.error)
|
|
106
|
+
return { ok: false, reason: `archive-or-extract-failed: ${drivers.error}` };
|
|
99
107
|
let blobs;
|
|
100
108
|
try {
|
|
101
109
|
blobs = blobsAt(repoRoot, commitish, pathspec);
|
|
@@ -120,7 +128,8 @@ function materializeTreeAt(repoRoot, commitish, pathspec, destDir, opts) {
|
|
|
120
128
|
// the fidelity check would see a file the commit never had.
|
|
121
129
|
const tarPath = path.join(fs.mkdtempSync(path.join(os.tmpdir(), 'pit-tar-')), 'tree.tar');
|
|
122
130
|
try {
|
|
123
|
-
|
|
131
|
+
// @implements A-SPEC-792.43 — no archive without the overrides (read above, A-SPEC-792.44)
|
|
132
|
+
const tar = (0, node_child_process_1.execFileSync)('git', ['-C', repoRoot, ...drivers.args, 'archive', '--format=tar', commitish, '--', pathspec], { timeout: bounded_io_1.GIT_LONG_TIMEOUT_MS, maxBuffer: 512 * 1024 * 1024, env });
|
|
124
133
|
fs.writeFileSync(tarPath, tar);
|
|
125
134
|
(0, node_child_process_1.execFileSync)('tar', ['-x', '-C', destDir, '-f', tarPath], { maxBuffer: 512 * 1024 * 1024 });
|
|
126
135
|
// Archive preserves modes/layout, but applies EOL/export substitutions. Read raw objects in
|
|
@@ -130,7 +139,7 @@ function materializeTreeAt(repoRoot, commitish, pathspec, destDir, opts) {
|
|
|
130
139
|
const refs = fs.openSync(refsPath, 'r');
|
|
131
140
|
let raw;
|
|
132
141
|
try {
|
|
133
|
-
raw = (0, node_child_process_1.execFileSync)('git', ['-C', repoRoot, 'cat-file', '--batch'], { timeout: bounded_io_1.GIT_LONG_TIMEOUT_MS,
|
|
142
|
+
raw = (0, node_child_process_1.execFileSync)('git', ['-C', repoRoot, 'cat-file', '--batch'], { timeout: bounded_io_1.GIT_LONG_TIMEOUT_MS, env,
|
|
134
143
|
stdio: [refs, 'pipe', 'pipe'], maxBuffer: 512 * 1024 * 1024,
|
|
135
144
|
});
|
|
136
145
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* does nothing). Thirteen rejected retrieval mechanisms were all attempts at the first one. This
|
|
8
8
|
* module measures which it actually is, so the next attempt is aimed at the measured cause.
|
|
9
9
|
*
|
|
10
|
-
* On the eight blind
|
|
10
|
+
* On the eight blind consumer-corpus cases of A-SPEC-404 the answer is unambiguous, and it is the second:
|
|
11
11
|
* every truth file was already in the pool.
|
|
12
12
|
*/
|
|
13
13
|
export interface PooledTruth {
|
|
@@ -34,7 +34,7 @@ export declare function diagnoseRanking(cases: ReadonlyArray<{
|
|
|
34
34
|
truth: readonly PooledTruth[];
|
|
35
35
|
}>, cut: number): RankDiagnosis;
|
|
36
36
|
/**
|
|
37
|
-
* Measured 2026-08-29 on the eight A-SPEC-404 blind
|
|
37
|
+
* Measured 2026-08-29 on the eight A-SPEC-404 blind consumer-corpus cases, through the shipped pipeline
|
|
38
38
|
* (localizeIssue at pool 500, then the recency x commit-text re-rank of A-SPEC-378/388).
|
|
39
39
|
*/
|
|
40
40
|
export declare const S405_POOLED_TRUTH: ReadonlyArray<{
|
|
@@ -33,7 +33,7 @@ function diagnoseRanking(cases, cut) {
|
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
* Measured 2026-08-29 on the eight A-SPEC-404 blind
|
|
36
|
+
* Measured 2026-08-29 on the eight A-SPEC-404 blind consumer-corpus cases, through the shipped pipeline
|
|
37
37
|
* (localizeIssue at pool 500, then the recency x commit-text re-rank of A-SPEC-378/388).
|
|
38
38
|
*/
|
|
39
39
|
exports.S405_POOLED_TRUTH = [
|
|
@@ -61,10 +61,16 @@ export declare const HOLMES_CORPUS: ReplayCorpus;
|
|
|
61
61
|
* truth files, and its own `.ax/specs`. Tests live in `tests/` rather than beside the source, which
|
|
62
62
|
* is precisely the assumption that had to stop being hard-coded.
|
|
63
63
|
*
|
|
64
|
-
* Absent
|
|
65
|
-
* someone else's checkout is a benchmark nobody else can run.
|
|
64
|
+
* Absent unless HOLMES_CONSUMER_CORPUS names a checkout of it, and callers skip rather than fail — a benchmark that
|
|
65
|
+
* requires someone else's checkout is a benchmark nobody else can run. A-SPEC-794.57: a caller that skips says so
|
|
66
|
+
* (`absentCorpusNotice`), so a green run does not hide that nothing was measured.
|
|
66
67
|
*/
|
|
67
|
-
export declare const
|
|
68
|
+
export declare const CONSUMER_CORPUS: ReplayCorpus;
|
|
69
|
+
/**
|
|
70
|
+
* @implements A-SPEC-794.57 — the line a caller prints when it skips because `corpus` is not checked out, or null when it
|
|
71
|
+
* is. The variable that names it is said, so the run says how to measure it.
|
|
72
|
+
*/
|
|
73
|
+
export declare function absentCorpusNotice(corpus: ReplayCorpus, label: string, variable: string): string | null;
|
|
68
74
|
/**
|
|
69
75
|
* A third party's repository, with no spec store at all.
|
|
70
76
|
*
|
|
@@ -110,7 +116,7 @@ export declare function casesFor(corpus: ReplayCorpus, limit: number, offset?: n
|
|
|
110
116
|
* A deterministic sub-sample of a spec store, for holding a repository fixed while varying only how
|
|
111
117
|
* many specs it has.
|
|
112
118
|
*
|
|
113
|
-
* The advantage over a no-graph baseline is 2.5x on this repository (585 specs) and a wash on
|
|
119
|
+
* The advantage over a no-graph baseline is 2.5x on this repository (585 specs) and a wash on the consumer corpus
|
|
114
120
|
* (54). Reading that as a DENSITY effect is, so far, a correlation: the two corpora differ in
|
|
115
121
|
* language, size, subject and commit style as well. Thinning one corpus is the controlled version of
|
|
116
122
|
* the same question — everything else stays exactly where it is.
|
|
@@ -33,18 +33,21 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.GEMINI_CLI_MEASUREMENT = exports.GEMINI_CLI_CORPUS = exports.
|
|
36
|
+
exports.GEMINI_CLI_MEASUREMENT = exports.GEMINI_CLI_CORPUS = exports.CONSUMER_CORPUS = exports.HOLMES_CORPUS = void 0;
|
|
37
37
|
exports.changedParentLines = changedParentLines;
|
|
38
|
+
exports.absentCorpusNotice = absentCorpusNotice;
|
|
38
39
|
exports.casesFor = casesFor;
|
|
39
40
|
exports.thinSpecs = thinSpecs;
|
|
40
41
|
exports.casesAvoidingRecent = casesAvoidingRecent;
|
|
41
|
-
// @implements A-SPEC-345, A-SPEC-734
|
|
42
|
+
// @implements A-SPEC-345, A-SPEC-734, A-SPEC-794.56, A-SPEC-794.57, A-SPEC-794.58
|
|
42
43
|
// @implements A-SPEC-387
|
|
44
|
+
const fs = __importStar(require("node:fs"));
|
|
43
45
|
const os = __importStar(require("node:os"));
|
|
44
46
|
const path = __importStar(require("node:path"));
|
|
45
47
|
const node_child_process_1 = require("node:child_process");
|
|
46
48
|
const maintenance_analyze_1 = require("../mcp/maintenance-analyze");
|
|
47
49
|
const bounded_io_1 = require("../project/bounded-io");
|
|
50
|
+
const root_1 = require("../project/root");
|
|
48
51
|
const TS_FAMILY = (f) => f.endsWith('.ts') && !f.endsWith('.d.ts');
|
|
49
52
|
// @implements A-SPEC-573.3
|
|
50
53
|
/**
|
|
@@ -60,7 +63,8 @@ const TS_FAMILY = (f) => f.endsWith('.ts') && !f.endsWith('.d.ts');
|
|
|
60
63
|
function changedParentLines(root, commit, file) {
|
|
61
64
|
let raw;
|
|
62
65
|
try {
|
|
63
|
-
|
|
66
|
+
// @implements A-SPEC-792.39 — the shared inert git environment, no external diff or textconv.
|
|
67
|
+
raw = (0, node_child_process_1.execFileSync)('git', ['-C', root, 'show', '--no-ext-diff', '--no-textconv', '--unified=0', '--format=', commit, '--', file], { timeout: bounded_io_1.GIT_LONG_TIMEOUT_MS, encoding: 'utf8', maxBuffer: 16 * 1024 * 1024, env: (0, bounded_io_1.gitEnv)((0, root_1.cleanSubprocessEnv)()) });
|
|
64
68
|
}
|
|
65
69
|
catch {
|
|
66
70
|
return [];
|
|
@@ -94,11 +98,14 @@ exports.HOLMES_CORPUS = {
|
|
|
94
98
|
* truth files, and its own `.ax/specs`. Tests live in `tests/` rather than beside the source, which
|
|
95
99
|
* is precisely the assumption that had to stop being hard-coded.
|
|
96
100
|
*
|
|
97
|
-
* Absent
|
|
98
|
-
* someone else's checkout is a benchmark nobody else can run.
|
|
101
|
+
* Absent unless HOLMES_CONSUMER_CORPUS names a checkout of it, and callers skip rather than fail — a benchmark that
|
|
102
|
+
* requires someone else's checkout is a benchmark nobody else can run. A-SPEC-794.57: a caller that skips says so
|
|
103
|
+
* (`absentCorpusNotice`), so a green run does not hide that nothing was measured.
|
|
99
104
|
*/
|
|
100
|
-
exports.
|
|
101
|
-
|
|
105
|
+
exports.CONSUMER_CORPUS = {
|
|
106
|
+
// A-SPEC-794.56 — the package names no consumer: the checkout is named by HOLMES_CONSUMER_CORPUS, and without it the
|
|
107
|
+
// root is a path that does not exist, so callers skip as they do when the corpus is absent
|
|
108
|
+
root: process.env.HOLMES_CONSUMER_CORPUS || path.join(os.tmpdir(), 'holmes-consumer-corpus-unset'),
|
|
102
109
|
// @implements A-SPEC-443 — the last commit before 2026-08-30, the day five landed and moved a
|
|
103
110
|
// six-decimal assertion with no product change.
|
|
104
111
|
pin: '7b58e40ba3723b9d85390fdadf1d407cdf7bb9ec',
|
|
@@ -107,6 +114,14 @@ exports.JARVIS_CORPUS = {
|
|
|
107
114
|
isTest: (f) => f.startsWith('tests/') || f.includes('.test.') || f.includes('.spec.'),
|
|
108
115
|
isSource: (f) => (f.endsWith('.ts') || f.endsWith('.py') || f.endsWith('.js')) && !f.endsWith('.d.ts'),
|
|
109
116
|
};
|
|
117
|
+
/**
|
|
118
|
+
* @implements A-SPEC-794.57 — the line a caller prints when it skips because `corpus` is not checked out, or null when it
|
|
119
|
+
* is. The variable that names it is said, so the run says how to measure it.
|
|
120
|
+
*/
|
|
121
|
+
function absentCorpusNotice(corpus, label, variable) {
|
|
122
|
+
return fs.existsSync(path.join(corpus.root, '.git')) ? null
|
|
123
|
+
: `[${label}-corpus] ${variable} is unset or names no checkout (${corpus.root}): not checked`;
|
|
124
|
+
}
|
|
110
125
|
// @implements A-SPEC-426
|
|
111
126
|
/**
|
|
112
127
|
* A third party's repository, with no spec store at all.
|
|
@@ -120,7 +135,8 @@ exports.JARVIS_CORPUS = {
|
|
|
120
135
|
* Whatever the remaining layers are worth, they are worth something on their own.
|
|
121
136
|
*/
|
|
122
137
|
exports.GEMINI_CLI_CORPUS = {
|
|
123
|
-
|
|
138
|
+
// A-SPEC-794.57 — named by HOLMES_GEMINI_CLI_CORPUS, as the consumer corpus is; without it, a path that does not exist
|
|
139
|
+
root: process.env.HOLMES_GEMINI_CLI_CORPUS || path.join(os.tmpdir(), 'holmes-reference-gemini-cli-unset'),
|
|
124
140
|
sourcePathspec: ['packages'],
|
|
125
141
|
specPathspec: '.ax/specs',
|
|
126
142
|
isTest: (f) => f.includes('.test.') || f.includes('.spec.'),
|
|
@@ -196,7 +212,7 @@ function casesFor(corpus, limit, offset = 0) {
|
|
|
196
212
|
* A deterministic sub-sample of a spec store, for holding a repository fixed while varying only how
|
|
197
213
|
* many specs it has.
|
|
198
214
|
*
|
|
199
|
-
* The advantage over a no-graph baseline is 2.5x on this repository (585 specs) and a wash on
|
|
215
|
+
* The advantage over a no-graph baseline is 2.5x on this repository (585 specs) and a wash on the consumer corpus
|
|
200
216
|
* (54). Reading that as a DENSITY effect is, so far, a correlation: the two corpora differ in
|
|
201
217
|
* language, size, subject and commit style as well. Thinning one corpus is the controlled version of
|
|
202
218
|
* the same question — everything else stays exactly where it is.
|
|
@@ -4,7 +4,7 @@ exports.canonicalRequirementDocument = void 0;
|
|
|
4
4
|
exports.requestIdentifiers = requestIdentifiers;
|
|
5
5
|
exports.triageRequirements = triageRequirements;
|
|
6
6
|
exports.requirementSemanticCoverage = requirementSemanticCoverage;
|
|
7
|
-
// @implements A-SPEC-713.1, A-SPEC-713.2, A-SPEC-713.3, A-SPEC-713.4, A-SPEC-742, A-SPEC-713, A-SPEC-757
|
|
7
|
+
// @implements A-SPEC-713.1, A-SPEC-713.2, A-SPEC-713.3, A-SPEC-713.4, A-SPEC-742, A-SPEC-713, A-SPEC-757, A-SPEC-794.56
|
|
8
8
|
/** Pure, conservative lifecycle triage over governed requirement documents. */
|
|
9
9
|
const semantic_retrieval_1 = require("./semantic-retrieval");
|
|
10
10
|
const localize_1 = require("../rtm/localize");
|
|
@@ -200,7 +200,7 @@ function triageCore(input) {
|
|
|
200
200
|
const contentTerms = promptTerms.filter((term) => textLower.includes(term));
|
|
201
201
|
const operational = input.evidence?.[row.reqId] ?? {};
|
|
202
202
|
// @implements A-SPEC-713.4 — judged by the documents, not their count: `length === 4` left 62 of 672 fully
|
|
203
|
-
// approved lineages here (8 of 671 in
|
|
203
|
+
// approved lineages here (8 of 671 in the consumer corpus) unapproved because they carry sub-slices or retired documents,
|
|
204
204
|
// and counted REQ, H-SPEC and two A-SPECs without any T-SPEC as approved.
|
|
205
205
|
const live = row.docs.filter((d) => d.status !== 'outdated');
|
|
206
206
|
const kinds = new Set(live.map((d) => d.type));
|
|
@@ -130,7 +130,7 @@ export declare function anchorCoverage(scanned: readonly ScannedFile[], specs?:
|
|
|
130
130
|
* Measured on one repository with only the spec count varied (A-SPEC-364): 585 specs gave Top-10
|
|
131
131
|
* recall 0.770, but 146 gave 0.253 and 59 gave 0.264 — BELOW the 0.305 of no spec layer at all. A
|
|
132
132
|
* partly populated spec store is worse than an empty one, and every project that adopts Holmes
|
|
133
|
-
* passes through that valley on its way to the peak.
|
|
133
|
+
* passes through that valley on its way to the peak. The consumer corpus, at 54 specs, is sitting in it.
|
|
134
134
|
*
|
|
135
135
|
* Scaling by coverage makes the layer fade in rather than switch on: at zero coverage the ranking is
|
|
136
136
|
* exactly the lexical arm (the floor a project starts from), and at full coverage the bonus is
|
|
@@ -160,7 +160,7 @@ export declare function rankCitationConditioned(issueText: string, scanned: read
|
|
|
160
160
|
*
|
|
161
161
|
* Conditioning on whether the request cited a spec repaired this repository and cost the second
|
|
162
162
|
* corpus its lead, because that corpus cites nothing and would always take the strict path. Both
|
|
163
|
-
* measurements point at the same underlying quantity: HOW MANY specs the request matched.
|
|
163
|
+
* measurements point at the same underlying quantity: HOW MANY specs the request matched. The consumer corpus
|
|
164
164
|
* matches 0.87 per case, this repository 26.6 (A-SPEC-367).
|
|
165
165
|
*
|
|
166
166
|
* One matching spec is a claim about where the request belongs. Twenty-six matching specs is a fact
|
|
@@ -222,7 +222,7 @@ export declare function ablate(issueText: string, scanned: readonly ScannedFile[
|
|
|
222
222
|
* Limit how many files each matched spec may lift.
|
|
223
223
|
*
|
|
224
224
|
* The ablation isolated the cost: turning the spec bonus off restores the baseline exactly, so that
|
|
225
|
-
* layer buys Top-1 (0.244 → 0.267 here, 0.400 → 0.433 on
|
|
225
|
+
* layer buys Top-1 (0.244 → 0.267 here, 0.400 → 0.433 on the consumer corpus) and sells precision (0.156 → 0.104).
|
|
226
226
|
*
|
|
227
227
|
* Three earlier attempts all changed WHICH specs are admitted — breadth damping, coverage scaling,
|
|
228
228
|
* a cap on matched specs — and all three were rejected. This changes something else: once a spec is
|
|
@@ -403,7 +403,7 @@ function anchorCoverage(scanned, specs = []) {
|
|
|
403
403
|
* Measured on one repository with only the spec count varied (A-SPEC-364): 585 specs gave Top-10
|
|
404
404
|
* recall 0.770, but 146 gave 0.253 and 59 gave 0.264 — BELOW the 0.305 of no spec layer at all. A
|
|
405
405
|
* partly populated spec store is worse than an empty one, and every project that adopts Holmes
|
|
406
|
-
* passes through that valley on its way to the peak.
|
|
406
|
+
* passes through that valley on its way to the peak. The consumer corpus, at 54 specs, is sitting in it.
|
|
407
407
|
*
|
|
408
408
|
* Scaling by coverage makes the layer fade in rather than switch on: at zero coverage the ranking is
|
|
409
409
|
* exactly the lexical arm (the floor a project starts from), and at full coverage the bonus is
|
|
@@ -460,7 +460,7 @@ function rankCitationConditioned(issueText, scanned, specs, topN, weight, citedT
|
|
|
460
460
|
*
|
|
461
461
|
* Conditioning on whether the request cited a spec repaired this repository and cost the second
|
|
462
462
|
* corpus its lead, because that corpus cites nothing and would always take the strict path. Both
|
|
463
|
-
* measurements point at the same underlying quantity: HOW MANY specs the request matched.
|
|
463
|
+
* measurements point at the same underlying quantity: HOW MANY specs the request matched. The consumer corpus
|
|
464
464
|
* matches 0.87 per case, this repository 26.6 (A-SPEC-367).
|
|
465
465
|
*
|
|
466
466
|
* One matching spec is a claim about where the request belongs. Twenty-six matching specs is a fact
|
|
@@ -617,7 +617,7 @@ function ablate(issueText, scanned, specs, topN, opts) {
|
|
|
617
617
|
* Limit how many files each matched spec may lift.
|
|
618
618
|
*
|
|
619
619
|
* The ablation isolated the cost: turning the spec bonus off restores the baseline exactly, so that
|
|
620
|
-
* layer buys Top-1 (0.244 → 0.267 here, 0.400 → 0.433 on
|
|
620
|
+
* layer buys Top-1 (0.244 → 0.267 here, 0.400 → 0.433 on the consumer corpus) and sells precision (0.156 → 0.104).
|
|
621
621
|
*
|
|
622
622
|
* Three earlier attempts all changed WHICH specs are admitted — breadth damping, coverage scaling,
|
|
623
623
|
* a cap on matched specs — and all three were rejected. This changes something else: once a spec is
|
|
@@ -45,7 +45,7 @@ exports.appendOutcomes = appendOutcomes;
|
|
|
45
45
|
exports.readOutcomes = readOutcomes;
|
|
46
46
|
exports.buildOutcomeRecords = buildOutcomeRecords;
|
|
47
47
|
exports.groupOutcomesByAspec = groupOutcomesByAspec;
|
|
48
|
-
// @implements A-SPEC-724.1, A-SPEC-714, A-SPEC-734, A-SPEC-748
|
|
48
|
+
// @implements A-SPEC-724.1, A-SPEC-714, A-SPEC-734, A-SPEC-748, A-SPEC-794.58
|
|
49
49
|
// @implements A-SPEC-534.3, A-SPEC-625
|
|
50
50
|
// @implements A-SPEC-645
|
|
51
51
|
const node_crypto_1 = require("node:crypto");
|
|
@@ -109,6 +109,8 @@ exports.REQUIRED_DOCS_TESTS = [
|
|
|
109
109
|
'src/holmes/playbooks/packaging.test.ts',
|
|
110
110
|
'src/holmes/cpg/foundation/language-matrix.test.ts',
|
|
111
111
|
'src/holmes/project/dependency-overrides.test.ts',
|
|
112
|
+
// A-SPEC-794.58 — a docs-only change can carry a name into README; the publish path checks the pack too
|
|
113
|
+
'src/holmes/governance/private-names.test.ts',
|
|
112
114
|
];
|
|
113
115
|
/**
|
|
114
116
|
* @implements A-SPEC-748 — every path of every change (both sides of a rename or copy) must be `README.md` or under
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ExecFileSyncOptionsWithStringEncoding } from 'node:child_process';
|
|
1
2
|
import { RegressionTier, TestScope } from '../rtm/test-scope';
|
|
2
3
|
/**
|
|
3
4
|
* @implements A-SPEC-734 (round 13) — every runner child is bounded, and a tool probe is short. One passing jest
|
|
@@ -5,6 +6,16 @@ import { RegressionTier, TestScope } from '../rtm/test-scope';
|
|
|
5
6
|
* A run stopped at the bound is red and says so — never green.
|
|
6
7
|
*/
|
|
7
8
|
export declare const RUNNER_TIMEOUT_MS: number;
|
|
9
|
+
/**
|
|
10
|
+
* @implements A-SPEC-734.3 — the child leads a process group of its own (POSIX), and a child stopped at the bound takes
|
|
11
|
+
* that group with it: SIGKILL to the child alone left jest's forked workers running at 100% CPU (two per stopped run,
|
|
12
|
+
* 2026-10-26). The group id is the pid of the child this call spawned, ended as soon as the call returns. Windows has
|
|
13
|
+
* no groups; there the child alone is stopped, as before. Otherwise execFileSync's contract: stdout on exit 0, else a
|
|
14
|
+
* throw carrying stdout, stderr, status and code.
|
|
15
|
+
*/
|
|
16
|
+
export declare function runBounded(cmd: string, args: string[], opts: ExecFileSyncOptionsWithStringEncoding, timeoutMs?: number): string;
|
|
17
|
+
/** @implements A-SPEC-734.4 — the last stop note (tests read it). */
|
|
18
|
+
export declare function runnerStopNote(): string | null;
|
|
8
19
|
/**
|
|
9
20
|
* Operational wiring for the intelligent test-scope (target-arch §5): turn a TestScope decision into
|
|
10
21
|
* an actual test run. The PLAN is pure/deterministic (testable); the EXECUTE half shells out to jest.
|
|
@@ -34,6 +34,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.TAIL_MAX_CHARS = exports.RUNNER_TIMEOUT_MS = void 0;
|
|
37
|
+
exports.runBounded = runBounded;
|
|
38
|
+
exports.runnerStopNote = runnerStopNote;
|
|
37
39
|
exports.planTestRun = planTestRun;
|
|
38
40
|
exports.ecosystemOf = ecosystemOf;
|
|
39
41
|
exports.parseGoTestJson = parseGoTestJson;
|
|
@@ -58,6 +60,7 @@ exports.summarizeJestJson = summarizeJestJson;
|
|
|
58
60
|
// @implements A-SPEC-647
|
|
59
61
|
// @implements A-SPEC-734
|
|
60
62
|
const node_child_process_1 = require("node:child_process");
|
|
63
|
+
const bounded_group_1 = require("../project/bounded-group");
|
|
61
64
|
const fs = __importStar(require("node:fs"));
|
|
62
65
|
const os = __importStar(require("node:os"));
|
|
63
66
|
const path = __importStar(require("node:path"));
|
|
@@ -80,16 +83,33 @@ exports.RUNNER_TIMEOUT_MS = 30 * 60_000;
|
|
|
80
83
|
const PROBE_TIMEOUT_MS = 10_000;
|
|
81
84
|
/** Round 14: the stop is recorded here and appended AFTER the runner's tail is taken (`tailOf` cut it — measured). */
|
|
82
85
|
let STOPPED = null;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
86
|
+
/**
|
|
87
|
+
* @implements A-SPEC-734.3 — the child leads a process group of its own (POSIX), and a child stopped at the bound takes
|
|
88
|
+
* that group with it: SIGKILL to the child alone left jest's forked workers running at 100% CPU (two per stopped run,
|
|
89
|
+
* 2026-10-26). The group id is the pid of the child this call spawned, ended as soon as the call returns. Windows has
|
|
90
|
+
* no groups; there the child alone is stopped, as before. Otherwise execFileSync's contract: stdout on exit 0, else a
|
|
91
|
+
* throw carrying stdout, stderr, status and code.
|
|
92
|
+
*/
|
|
93
|
+
function runBounded(cmd, args, opts, timeoutMs = exports.RUNNER_TIMEOUT_MS) {
|
|
94
|
+
// @implements A-SPEC-734.4 — the group's whole lifetime lives in bounded-group: a watch shim ends it when this process
|
|
95
|
+
// goes, and the call ends it on the bound, an overflow or a signal, or when members outlive a normal exit
|
|
96
|
+
const { result: r, stopped, leftovers } = (0, bounded_group_1.boundedGroupSpawnSync)(cmd, args, opts, timeoutMs);
|
|
97
|
+
if (leftovers)
|
|
98
|
+
LEFTOVER = '[holmes-kit] the runner left processes in its group after it exited; they were ended';
|
|
99
|
+
if (!r.error && r.status === 0)
|
|
100
|
+
return r.stdout;
|
|
101
|
+
const e = (r.error ?? new Error(`Command failed: ${[cmd, ...args].join(' ')}\n${r.stderr ?? ''}`));
|
|
102
|
+
// execFileSync's fields, `output` included
|
|
103
|
+
Object.assign(e, { status: r.status, signal: r.signal, stdout: r.stdout, stderr: r.stderr, pid: r.pid, output: r.output });
|
|
104
|
+
if (stopped)
|
|
105
|
+
STOPPED = `[holmes-kit] the test run was stopped after ${boundText(timeoutMs)} — not judged`;
|
|
106
|
+
throw e;
|
|
92
107
|
}
|
|
108
|
+
/** @implements A-SPEC-734.4 — the bound in minutes, or in seconds below a minute. */
|
|
109
|
+
const boundText = (ms) => (ms >= 60_000 ? `${Math.round(ms / 60_000)} minutes` : `${Math.round(ms / 1000)} seconds`);
|
|
110
|
+
let LEFTOVER = null;
|
|
111
|
+
/** @implements A-SPEC-734.4 — the last stop note (tests read it). */
|
|
112
|
+
function runnerStopNote() { return STOPPED; }
|
|
93
113
|
function planTestRun(scope) {
|
|
94
114
|
if (scope.tier === 'full') {
|
|
95
115
|
return { mode: 'full', testFiles: [], reason: 'full regression — run the entire suite' };
|
|
@@ -813,10 +833,11 @@ function runTestScope(scope, cwd) {
|
|
|
813
833
|
const outcomeByFile = {}; // @implements A-SPEC-534.5 — jest only
|
|
814
834
|
for (const eco of [...groups.keys()].sort()) {
|
|
815
835
|
STOPPED = null;
|
|
836
|
+
LEFTOVER = null;
|
|
816
837
|
const r = runners[eco](groups.get(eco), plan.mode, cwd);
|
|
817
838
|
ran.push(eco);
|
|
818
839
|
passed = passed && r.passed && STOPPED === null;
|
|
819
|
-
tails.push(`[${eco}] ${r.tail}${STOPPED !== null ? `\n${STOPPED}` : ''}`);
|
|
840
|
+
tails.push(`[${eco}] ${r.tail}${STOPPED !== null ? `\n${STOPPED}` : ''}${LEFTOVER !== null ? `\n${LEFTOVER}` : ''}`);
|
|
820
841
|
Object.assign(executedByFile, r.executed);
|
|
821
842
|
const adapterOutcomes = r.outcomes;
|
|
822
843
|
if (adapterOutcomes)
|
|
@@ -14,7 +14,7 @@ exports.TEST_SELECTION = [
|
|
|
14
14
|
naiveAvgSelected: 6.6, naiveHits: 49, truthTotal: 67,
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
|
-
corpus: '
|
|
17
|
+
corpus: 'consumer newest-30', cases: 30,
|
|
18
18
|
avgSelected: 89.9, avgUniverse: 110.6, avgTruth: 1.2,
|
|
19
19
|
recall: 0.867, precision: 0.012,
|
|
20
20
|
naiveAvgSelected: 2.6, naiveHits: 14, truthTotal: 36,
|
|
@@ -39,7 +39,7 @@ exports.NARROWING_CURVE = [
|
|
|
39
39
|
{ k: 10, recall: 0.668 }, { k: 20, recall: 0.789 }, { k: 40, recall: 0.833 }, { k: 80, recall: 0.883 }],
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
|
-
corpus: '
|
|
42
|
+
corpus: 'consumer newest-30', avgSelected: 89.9, full: 0.867,
|
|
43
43
|
at: [{ k: 1, recall: 0.067 }, { k: 3, recall: 0.150 }, { k: 5, recall: 0.150 },
|
|
44
44
|
{ k: 10, recall: 0.283 }, { k: 20, recall: 0.283 }, { k: 40, recall: 0.333 }, { k: 80, recall: 0.767 }],
|
|
45
45
|
},
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { type ProcLookup } from '../mcp/harness-attestation';
|
|
1
|
+
import { type HarnessRule, type ProcLookup } from '../mcp/harness-attestation';
|
|
2
|
+
import { type HarnessCatalog } from '../governance/harness-catalog';
|
|
3
|
+
import { LedgerActor } from '../governance/human-channel';
|
|
2
4
|
/** @implements A-SPEC-102.7 — the S·O·L·I·D checklist: each item compliant, violation or n-a, with its evidence. */
|
|
3
5
|
export type SolidItem = 'S' | 'O' | 'L' | 'I' | 'D';
|
|
4
6
|
export type SolidChecklist = Record<SolidItem, {
|
|
@@ -28,6 +30,7 @@ export interface VerdictRecord {
|
|
|
28
30
|
person: boolean;
|
|
29
31
|
channel?: string;
|
|
30
32
|
harness?: string;
|
|
33
|
+
harnessSources?: string[];
|
|
31
34
|
ancestry?: string;
|
|
32
35
|
};
|
|
33
36
|
authors: string[];
|
|
@@ -46,7 +49,13 @@ export interface VerdictInput {
|
|
|
46
49
|
session?: string;
|
|
47
50
|
solid?: SolidChecklist;
|
|
48
51
|
}
|
|
49
|
-
|
|
52
|
+
/**
|
|
53
|
+
* @implements A-SPEC-102.7 — the environment marker of an agent tool call: the harnesses set these in the processes
|
|
54
|
+
* their tools start. @implements A-SPEC-102.8 — agy: any ANTIGRAVITY_* variable (which one was not measured).
|
|
55
|
+
* @implements A-SPEC-102.27 — the markers are the harness catalog's (cursor-agent and opencode among them); a user or
|
|
56
|
+
* project file may only add to them. @implements A-SPEC-102.29 — the catalog is the caller's: no default reads cwd or home
|
|
57
|
+
*/
|
|
58
|
+
export declare function agentHarnessMarker(env: NodeJS.ProcessEnv, catalog: HarnessCatalog): string | null;
|
|
50
59
|
/**
|
|
51
60
|
* @implements A-SPEC-102.8 — whether an agent harness is among the ancestors of `pid`. Variables are what the agent
|
|
52
61
|
* controls (`env -u CLAUDECODE …`); the process tree above the CLI is not. A name match is enough here: a false match
|
|
@@ -58,11 +67,17 @@ export type HarnessAncestry = {
|
|
|
58
67
|
kind: 'harness';
|
|
59
68
|
harness: string;
|
|
60
69
|
chain: string[];
|
|
70
|
+
sources?: readonly string[];
|
|
61
71
|
} | {
|
|
62
72
|
kind: 'unreadable';
|
|
63
73
|
reason: string;
|
|
64
74
|
};
|
|
65
|
-
export declare function harnessAncestor(pid: number, lookup: ProcLookup, maxDepth
|
|
75
|
+
export declare function harnessAncestor(pid: number, lookup: ProcLookup, rule: HarnessRule, maxDepth: number, catalog: HarnessCatalog): HarnessAncestry;
|
|
76
|
+
/**
|
|
77
|
+
* @implements A-SPEC-732.2 — the walk the operator-act guard and review independence run: any claude version path counts
|
|
78
|
+
* (an agent under a version-path session with its markers removed passed an operator act as the person; reproduced)
|
|
79
|
+
*/
|
|
80
|
+
export declare function operatorAncestry(pid: number, catalog: HarnessCatalog, lookup?: ProcLookup): HarnessAncestry;
|
|
66
81
|
/**
|
|
67
82
|
* @implements A-SPEC-102.7 — the files a resolved range changes and the A-SPEC anchors that speak for it: each changed
|
|
68
83
|
* file's line-1 claim and the claims on the lines the range adds. A file's every inline anchor would make one hub file
|
|
@@ -80,11 +95,32 @@ export interface VerdictContext {
|
|
|
80
95
|
cwd?: string;
|
|
81
96
|
interactive: boolean;
|
|
82
97
|
now?: () => Date;
|
|
83
|
-
ancestry?: () => HarnessAncestry;
|
|
98
|
+
ancestry?: (catalog: HarnessCatalog) => HarnessAncestry;
|
|
84
99
|
/** @implements A-SPEC-102.9 — the form channel a person answered this verdict through; only review_verdict passes it. */
|
|
85
|
-
answeredBy?:
|
|
100
|
+
answeredBy?: LedgerActor;
|
|
86
101
|
}
|
|
87
102
|
export declare const verdictsFile: (main: string) => string;
|
|
103
|
+
/**
|
|
104
|
+
* @implements A-SPEC-102.22, A-SPEC-102.26 — the git of a judgment reads the repository as stored: no inherited GIT_* variable (a
|
|
105
|
+
* shallow file, an object directory, alternates, config entries or a namespace all steered it), replace objects off,
|
|
106
|
+
* no grafts file (A-SPEC-102.22) and no prompt.
|
|
107
|
+
*/
|
|
108
|
+
export declare function judgmentGitEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
109
|
+
/**
|
|
110
|
+
* @implements A-SPEC-102.22 — the sha256 of the common dir's `shallow` and `info/grafts` (null when absent); null when
|
|
111
|
+
* the common dir or a present file cannot be read. Run start records it; a run review compares it.
|
|
112
|
+
*/
|
|
113
|
+
export declare function historyFiles(main: string): {
|
|
114
|
+
shallow: string | null;
|
|
115
|
+
grafts: string | null;
|
|
116
|
+
alternates: string | null;
|
|
117
|
+
http_alternates: string | null;
|
|
118
|
+
} | null;
|
|
119
|
+
/**
|
|
120
|
+
* @implements A-SPEC-102.25 — the history files, among those `atStart` recorded, that differ now (all of them when they
|
|
121
|
+
* cannot be read now). A key `atStart` does not hold is not compared: a record made before it was read.
|
|
122
|
+
*/
|
|
123
|
+
export declare function historyMoved(main: string, atStart: Record<string, unknown>): string[];
|
|
88
124
|
/** Both revisions as full commit ids, or the one that does not resolve. */
|
|
89
125
|
export declare function resolveRange(root: string, base: string, head: string): {
|
|
90
126
|
base: string;
|
|
@@ -92,8 +128,68 @@ export declare function resolveRange(root: string, base: string, head: string):
|
|
|
92
128
|
} | {
|
|
93
129
|
error: string;
|
|
94
130
|
};
|
|
95
|
-
/**
|
|
96
|
-
|
|
131
|
+
/**
|
|
132
|
+
* @implements A-SPEC-102.11 — authorship is the commits a run made, recorded when it stops, not the head it sits on.
|
|
133
|
+
* A run stopped earlier left its line in the main checkout's authors ledger.
|
|
134
|
+
*/
|
|
135
|
+
export declare const authorsFile: (main: string) => string;
|
|
136
|
+
type RunLike = {
|
|
137
|
+
run_id: string;
|
|
138
|
+
worktree: string;
|
|
139
|
+
engine?: unknown;
|
|
140
|
+
base?: unknown;
|
|
141
|
+
started?: unknown;
|
|
142
|
+
git_dir?: unknown;
|
|
143
|
+
};
|
|
144
|
+
/** `unreadable`: git could not read what the run made (A-SPEC-102.16), so it is taken as the author of the range. */
|
|
145
|
+
export interface Author {
|
|
146
|
+
run: string;
|
|
147
|
+
engine?: string;
|
|
148
|
+
unreadable?: true;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* @implements A-SPEC-102.13 — the commits a run made: its whole `base..HEAD` and every reflog entry but its base, with
|
|
152
|
+
* no message, time or branch filter (each was an escape: Fast-forward, a backdated committer date, a branch keeping a
|
|
153
|
+
* detached commit — measured). Over-attribution errs on the blocking side. Null for a record without a base.
|
|
154
|
+
*/
|
|
155
|
+
export declare function runAuthoredCommits(rec: RunLike): string[] | null;
|
|
156
|
+
/**
|
|
157
|
+
* @implements A-SPEC-102.16 — a run's authored commits (A-SPEC-102.13/102.15) and whether git could not read them: its
|
|
158
|
+
* HEAD, its reflog or its base..HEAD did not answer, or its pointer names another git dir (A-SPEC-102.17). An unreadable
|
|
159
|
+
* run never reads as "made nothing". Null for a record without a base.
|
|
160
|
+
*/
|
|
161
|
+
export declare function runAuthorship(rec: RunLike, main?: string, objects?: Set<string> | null): {
|
|
162
|
+
commits: string[];
|
|
163
|
+
unreadable: boolean;
|
|
164
|
+
candidates: string[];
|
|
165
|
+
snapshotRead: boolean;
|
|
166
|
+
} | null;
|
|
167
|
+
/** @implements A-SPEC-102.19 — where run start keeps a run's commit snapshot: the main checkout, out of the engine's reach. */
|
|
168
|
+
export declare const commitSnapshotFile: (main: string, runId: string) => string;
|
|
169
|
+
/** @implements A-SPEC-102.19 — every commit object in the store `cwd` reads (loose, packed and alternates); null when git cannot list them. */
|
|
170
|
+
export declare function commitObjects(cwd: string): Set<string> | null;
|
|
171
|
+
/** @implements A-SPEC-102.19 — run start's snapshot of the store's commit objects; false when it could not be written. */
|
|
172
|
+
export declare function snapshotRunCommits(main: string, runId: string): boolean;
|
|
173
|
+
/** @implements A-SPEC-102.15 — the number of entries in a worktree's HEAD reflog, recorded at run start. */
|
|
174
|
+
export declare function reflogLength(worktree: string): number;
|
|
175
|
+
/** Appends the stopped run's authored commits to the authors ledger; false when they could not be recorded. */
|
|
176
|
+
export declare function recordRunAuthorship(main: string, rec: RunLike, now?: () => Date): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* The runs that authored a commit of `base..head` (`head` alone without a base), by sha or stable patch-id: active
|
|
179
|
+
* runs first, then the ledger. An active run without a recorded base keeps the old rule: its worktree HEAD is the head.
|
|
180
|
+
*/
|
|
181
|
+
export declare function rangeAuthors(main: string, headSha: string, base?: string): Author[];
|
|
182
|
+
/**
|
|
183
|
+
* @implements A-SPEC-102.19 — the authors of `base..head` and the commits of it no recorded run made: attributed by sha
|
|
184
|
+
* or stable patch-id to an active run's authorship (its snapshot delta included) or an authors ledger line. A run whose
|
|
185
|
+
* authorship is unreadable is an author of the ranges from its base (A-SPEC-102.16) but attributes no commit (102.20).
|
|
186
|
+
*/
|
|
187
|
+
export declare function rangeAuthorship(main: string, headSha: string, base?: string): {
|
|
188
|
+
authors: Author[];
|
|
189
|
+
unattributed: string[];
|
|
190
|
+
};
|
|
191
|
+
/** The ids of the runs that authored `base..head` (`head` alone without a base). */
|
|
192
|
+
export declare function authorRuns(main: string, headSha: string, base?: string): string[];
|
|
97
193
|
export declare function readVerdicts(main: string): VerdictRecord[];
|
|
98
194
|
export declare function recordVerdict(root: string, input: VerdictInput, ctx: VerdictContext): {
|
|
99
195
|
ok: true;
|
|
@@ -112,7 +208,7 @@ export declare function gateRange(root: string, base: string, head: string, opts
|
|
|
112
208
|
* @implements A-SPEC-102.10 — the run's review rounds that failed: independent `fail` verdicts on the run's base, across
|
|
113
209
|
* every head the remediation moved to. Returned oldest first, so the last carries the findings still unresolved.
|
|
114
210
|
*/
|
|
115
|
-
export declare function failingRounds(main: string, base: string): VerdictRecord[];
|
|
211
|
+
export declare function failingRounds(main: string, base: string, head?: string, cwd?: string, rec?: RunLike): VerdictRecord[];
|
|
116
212
|
export declare function rangeStatus(root: string, base: string, head: string): {
|
|
117
213
|
base: string;
|
|
118
214
|
head: string;
|
|
@@ -124,3 +220,4 @@ export declare function rangeStatus(root: string, base: string, head: string): {
|
|
|
124
220
|
} | {
|
|
125
221
|
error: string;
|
|
126
222
|
};
|
|
223
|
+
export {};
|