@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
|
@@ -9,12 +9,14 @@
|
|
|
9
9
|
* gates own security). And `git push --no-verify` is git's own escape hatch — respected, not
|
|
10
10
|
* re-litigated: this gate safens the default, it does not take the human's final say.
|
|
11
11
|
*/
|
|
12
|
-
import type
|
|
12
|
+
import { type ScopedEvidence, type TestEvidence } from '../review/test-evidence';
|
|
13
|
+
import { FULL_RUN_CALL } from '../review/evidence-mode';
|
|
13
14
|
/** Identifies OUR installed hook — the single truth doctor and re-install both key on. */
|
|
14
15
|
export declare const PUSH_HOOK_SIGNATURE = "HOLMES-KIT PUSH GATE v1";
|
|
15
16
|
export interface PushJudgeInput {
|
|
16
17
|
pushedHead: string;
|
|
17
|
-
evidence
|
|
18
|
+
/** @implements A-SPEC-128.5 — `'unreadable'`: the test-evidence file exists but is not a record. */
|
|
19
|
+
evidence: TestEvidence | 'unreadable' | null;
|
|
18
20
|
/** `.ax` exists — the repo opted into governance. */
|
|
19
21
|
hasGovernance: boolean;
|
|
20
22
|
/** Commits in the pushed range, for the claim cross-check (surfacing only). */
|
|
@@ -22,11 +24,20 @@ export interface PushJudgeInput {
|
|
|
22
24
|
sha: string;
|
|
23
25
|
subject: string;
|
|
24
26
|
}>;
|
|
27
|
+
/**
|
|
28
|
+
* @implements A-SPEC-128.3 — the record of a run that was not full; read only when there is no test-evidence.
|
|
29
|
+
* @implements A-SPEC-128.4 — `'unreadable'`: the file exists but is not a record.
|
|
30
|
+
*/
|
|
31
|
+
scopedEvidence?: ScopedEvidence | 'unreadable' | null;
|
|
25
32
|
}
|
|
33
|
+
/** @implements A-SPEC-128.4 — the one call that clears a refusal (A-SPEC-128.5: it lives in review/evidence-mode). */
|
|
34
|
+
export { FULL_RUN_CALL };
|
|
26
35
|
export interface PushVerdict {
|
|
27
36
|
allow: boolean;
|
|
28
37
|
reason?: string;
|
|
29
38
|
notices: string[];
|
|
39
|
+
/** @implements A-SPEC-128.8 — D3: allowed without evidence because the root has nothing to run; the runner records it. */
|
|
40
|
+
noEvidencePush?: true;
|
|
30
41
|
}
|
|
31
42
|
export declare function judgePush(input: PushJudgeInput): PushVerdict;
|
|
32
43
|
/**
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PUSH_HOOK_SIGNATURE = void 0;
|
|
3
|
+
exports.FULL_RUN_CALL = exports.PUSH_HOOK_SIGNATURE = void 0;
|
|
4
4
|
exports.judgePush = judgePush;
|
|
5
5
|
exports.parsePushLines = parsePushLines;
|
|
6
|
+
// @implements A-SPEC-509.1, A-SPEC-128.2, A-SPEC-128.3, A-SPEC-128.4, A-SPEC-128.5, A-SPEC-128.6, A-SPEC-128.7, A-SPEC-128.8, A-SPEC-128.9, A-SPEC-128.10, A-SPEC-128.12
|
|
7
|
+
/**
|
|
8
|
+
* The push gate's PURE judgment. A push is the moment a commit becomes other agents' baseline
|
|
9
|
+
* (field basis: a multi-agent regression reached production unguarded), so the default is made
|
|
10
|
+
* safe: the test-evidence ledger must vouch for EXACTLY the head being pushed, green, with real
|
|
11
|
+
* executions. Deterministic facts only — commit-message prose ("전체 스위트 초록") never moves
|
|
12
|
+
* the verdict; an unbacked claim is SURFACED as a notice so the dishonesty is audible.
|
|
13
|
+
*
|
|
14
|
+
* Deliberately NOT a security boundary: collection failures and un-adopted repos pass (the tool
|
|
15
|
+
* gates own security). And `git push --no-verify` is git's own escape hatch — respected, not
|
|
16
|
+
* re-litigated: this gate safens the default, it does not take the human's final say.
|
|
17
|
+
*/
|
|
18
|
+
const test_evidence_1 = require("../review/test-evidence");
|
|
19
|
+
const evidence_mode_1 = require("../review/evidence-mode");
|
|
20
|
+
Object.defineProperty(exports, "FULL_RUN_CALL", { enumerable: true, get: function () { return evidence_mode_1.FULL_RUN_CALL; } });
|
|
6
21
|
/** Identifies OUR installed hook — the single truth doctor and re-install both key on. */
|
|
7
22
|
exports.PUSH_HOOK_SIGNATURE = 'HOLMES-KIT PUSH GATE v1';
|
|
23
|
+
/** @implements A-SPEC-128.2, A-SPEC-128.3, A-SPEC-128.4 — the recovery and escape every refusal carries. */
|
|
24
|
+
const RECOVERY = `복구: 현재 HEAD에서 ${evidence_mode_1.FULL_RUN_CALL}를 초록으로 실행해 원장을 갱신한 뒤 다시 push하십시오. 의도적 우회는 git push --no-verify.`;
|
|
8
25
|
/** Prose that CLAIMS a test success — a surfacing pattern, never a judgment input. */
|
|
9
26
|
const SUCCESS_CLAIM_RE = /초록|green|pass(es|ed)?\b|✅/i;
|
|
10
27
|
// @implements A-SPEC-509.1
|
|
@@ -12,37 +29,112 @@ function judgePush(input) {
|
|
|
12
29
|
if (!input.hasGovernance)
|
|
13
30
|
return { allow: true, notices: [] }; // un-adopted: never coerce adoption
|
|
14
31
|
const notices = [];
|
|
15
|
-
const ev = input.evidence;
|
|
32
|
+
const ev = input.evidence === 'unreadable' ? null : input.evidence;
|
|
16
33
|
// Claim cross-check first — it rides allow AND deny alike.
|
|
17
34
|
for (const c of input.claimCommits) {
|
|
18
35
|
if (!SUCCESS_CLAIM_RE.test(c.subject))
|
|
19
36
|
continue;
|
|
20
|
-
|
|
21
|
-
|
|
37
|
+
// the ledger backs this claim (A-SPEC-128.2: full only; @implements A-SPEC-128.7 — by the one predicate)
|
|
38
|
+
if (ev && (0, test_evidence_1.isPushEvidence)(ev, c.sha))
|
|
39
|
+
continue;
|
|
22
40
|
notices.push(`[Holmes-Kit] 커밋 ${c.sha.slice(0, 7)}의 메시지가 테스트 성공을 주장하지만 test_run 원장이 그 커밋을 뒷받침하지 않습니다: "${flatSubject(c.subject)}"`);
|
|
23
41
|
}
|
|
42
|
+
// @implements A-SPEC-128.5 — an unreadable ledger is a run history the gate cannot read: refused, not the unrun pass
|
|
43
|
+
if (input.evidence === 'unreadable') {
|
|
44
|
+
return {
|
|
45
|
+
allow: false,
|
|
46
|
+
reason: `[Holmes-Kit push 게이트] test-evidence 원장 파일(${test_evidence_1.EVIDENCE_FILE})이 있지만 읽을 수 있는 기록이 아닙니다 — full test_run 필요. ${RECOVERY}`,
|
|
47
|
+
notices,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
24
50
|
if (!ev) {
|
|
51
|
+
// @implements A-SPEC-128.3 — a repository whose runs have all been scoped has run tests: it is not the unrun pass.
|
|
52
|
+
// @implements A-SPEC-128.4 — a scoped record that exists but cannot be read is still a run history
|
|
53
|
+
if (input.scopedEvidence === 'unreadable') {
|
|
54
|
+
return {
|
|
55
|
+
allow: false,
|
|
56
|
+
reason: `[Holmes-Kit push 게이트] full 실행 원장이 없고, 범위 실행 기록 파일(${test_evidence_1.SCOPED_EVIDENCE_FILE})이 있지만 읽을 수 있는 기록이 아닙니다 — 실행 이력이 있으므로 full test_run 필요. ${RECOVERY}`,
|
|
57
|
+
notices,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (input.scopedEvidence) {
|
|
61
|
+
noticeNotDetected(input.scopedEvidence, notices);
|
|
62
|
+
// @implements A-SPEC-128.5 — a full attempt (red, stopped, or short of an ecosystem) is named as such
|
|
63
|
+
// @implements A-SPEC-128.6 — the ecosystems that ran nothing are named
|
|
64
|
+
// @implements A-SPEC-128.7 — with the act that clears it (I2), read fail-closed on shape
|
|
65
|
+
if (input.scopedEvidence.mode === 'full-attempt') {
|
|
66
|
+
const allowed = nothingTestable(input.scopedEvidence, input.pushedHead, notices);
|
|
67
|
+
if (allowed)
|
|
68
|
+
return allowed;
|
|
69
|
+
const v = (0, test_evidence_1.attemptVerdict)(input.scopedEvidence, input.pushedHead);
|
|
70
|
+
return { allow: false, reason: `[Holmes-Kit push 게이트] full 실행 원장이 없고 full 실행 시도 기록만 있습니다: ${v.problem} — ${recoveryFor(v)}`, notices };
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
allow: false,
|
|
74
|
+
reason: `[Holmes-Kit push 게이트] full 실행 원장이 없고 범위 실행 기록만 있습니다(${(0, test_evidence_1.evidenceKind)(input.scopedEvidence)}) — 범위 초록은 증빙이 아닙니다, full test_run 필요. ${RECOVERY}`,
|
|
75
|
+
notices,
|
|
76
|
+
};
|
|
77
|
+
}
|
|
25
78
|
// Adopted but no ledger yet: pass honestly, say how to activate. A broken ledger folds here
|
|
26
79
|
// too — the gate is a default-safener, not a security boundary, so it must not dead-lock a
|
|
27
80
|
// repo whose ledger file was corrupted.
|
|
28
|
-
notices.push(
|
|
81
|
+
notices.push(`[Holmes-Kit] test-evidence 원장이 없어 push 증빙 대조를 건너뜁니다 — ${evidence_mode_1.FULL_RUN_CALL}를 실행하면 다음 push부터 대조가 활성화됩니다`);
|
|
29
82
|
return { allow: true, notices };
|
|
30
83
|
}
|
|
31
|
-
|
|
32
|
-
|
|
84
|
+
// @implements A-SPEC-128.2, A-SPEC-128.5 — only a full run's record, counting what the runner ran, is push evidence
|
|
85
|
+
// @implements A-SPEC-128.6 — decided by THE predicate the writer and mrp read; its reason is the refusal's
|
|
86
|
+
// @implements A-SPEC-128.7 — and its act words the recovery (I2)
|
|
87
|
+
noticeNotDetected(ev, notices);
|
|
88
|
+
// also where an attempt voided the older evidence in place
|
|
89
|
+
const allowed = nothingTestable(ev, input.pushedHead, notices);
|
|
90
|
+
if (allowed)
|
|
91
|
+
return allowed;
|
|
92
|
+
const v = (0, test_evidence_1.pushEvidenceVerdict)(ev, input.pushedHead);
|
|
93
|
+
if (v === null)
|
|
33
94
|
return { allow: true, notices };
|
|
34
|
-
}
|
|
35
|
-
const why = ev.head !== input.pushedHead
|
|
36
|
-
? `원장 head ${ev.head.slice(0, 7)} ≠ push head ${input.pushedHead.slice(0, 7)} — 증빙 이후 커밋이 있습니다`
|
|
37
|
-
: ev.passed !== true
|
|
38
|
-
? `원장이 붉은 실행(passed: false)입니다 — 붉은 스위트는 기준선이 될 수 없습니다`
|
|
39
|
-
: `원장이 아무것도 실행하지 않았습니다(executed 0) — no-op 초록은 증빙이 아닙니다`;
|
|
40
95
|
return {
|
|
41
96
|
allow: false,
|
|
42
|
-
reason: `[Holmes-Kit push 게이트] ${
|
|
97
|
+
reason: `[Holmes-Kit push 게이트] 원장이 push 증빙이 아닙니다: ${v.problem} — ${recoveryFor(v)}`,
|
|
43
98
|
notices,
|
|
44
99
|
};
|
|
45
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* @implements A-SPEC-128.7 — I2: the recovery a refusal carries is the act that reaches allow. Running the same call again
|
|
103
|
+
* cannot pass a real red or a suite of the project's own that ran nothing, so those say the fix is the tests.
|
|
104
|
+
*/
|
|
105
|
+
function recoveryFor(v) {
|
|
106
|
+
if (v.act === 'fix-tests') {
|
|
107
|
+
return `복구: 고칠 것은 시험입니다 — 시험을 고쳐 커밋한 뒤 ${evidence_mode_1.FULL_RUN_CALL}로 다시 증빙하십시오(같은 상태에서 다시 실행해도 결과는 같습니다). 의도적 우회는 git push --no-verify.`;
|
|
108
|
+
}
|
|
109
|
+
// @implements A-SPEC-128.9 — E4: environment carries its own words and no generic recovery (A L1)
|
|
110
|
+
if (v.act === 'environment')
|
|
111
|
+
return '복구: 실행 환경을 고치십시오(위 사유). 같은 환경에서 다시 실행해도 결과는 같습니다. 의도적 우회는 git push --no-verify.';
|
|
112
|
+
// @implements A-SPEC-128.10 — I3: a fact about tests that did not run; the remedy is the runner's configuration or the
|
|
113
|
+
// user's own exclusion, then the full call
|
|
114
|
+
if (v.act === 'collect')
|
|
115
|
+
return `복구: 위 시험이 실행되도록 러너 설정을 고치거나, 프로젝트 것이 아니면 제외한 뒤 ${evidence_mode_1.FULL_RUN_CALL}를 실행하십시오. 의도적 우회는 git push --no-verify.`;
|
|
116
|
+
return `full test_run 필요. ${RECOVERY}`;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* @implements A-SPEC-128.9 — E2, one place (B L3: the D3 notice was written twice): a full attempt that found nothing
|
|
120
|
+
* testable — no unit and no implementation code — is allowed, said, and recorded by the runner.
|
|
121
|
+
*/
|
|
122
|
+
function nothingTestable(rec, head, notices) {
|
|
123
|
+
if (!(0, test_evidence_1.noTestableCode)(rec, head))
|
|
124
|
+
return null;
|
|
125
|
+
notices.push('[Holmes-Kit] 시험할 대상이 없습니다(시험 파일도 구현 코드도 없음) — 이 push는 증빙 없이 허용되고 원장(no-evidence-pushes)에 기록됩니다');
|
|
126
|
+
return { allow: true, notices, noEvidencePush: true };
|
|
127
|
+
}
|
|
128
|
+
/** @implements A-SPEC-128.7 — build files the run left out are named on every push that reads the record. */
|
|
129
|
+
function noticeNotDetected(rec, notices) {
|
|
130
|
+
const list = rec.notDetected;
|
|
131
|
+
if (!Array.isArray(list) || list.length === 0)
|
|
132
|
+
return;
|
|
133
|
+
const names = list.map((n) => (n && typeof n === 'object' ? `${String(n.path)} (${String(n.ecosystem)})` : String(n)));
|
|
134
|
+
// @implements A-SPEC-128.10 — B M4: sub-modules run as units now; what is named here is a file no unit runs
|
|
135
|
+
// @implements A-SPEC-128.12 — and git submodules, which are always outside the evidence: one heading for both
|
|
136
|
+
notices.push(`[Holmes-Kit] 증빙 밖에 둔 것 — full 실행이 판정하지 않았습니다: ${names.join(', ')}`);
|
|
137
|
+
}
|
|
46
138
|
/** One control-character-free line of a commit subject for interpolation into gate text. */
|
|
47
139
|
function flatSubject(s) {
|
|
48
140
|
return s.replace(/[\u0000-\u001f\u007f]+/g, ' ').replace(/\s{2,}/g, ' ').trim().slice(0, 80);
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { FileLedgerStore } from './ledger-store';
|
|
2
|
+
import { type ProvenanceEvent } from './provenance-chain';
|
|
3
|
+
import { type RecordedPair } from '../spec/succession';
|
|
4
|
+
type StoreEvent = ReturnType<FileLedgerStore['loadAll']>[number];
|
|
5
|
+
export interface IgnoredEvent {
|
|
6
|
+
file: string;
|
|
7
|
+
seq?: number;
|
|
8
|
+
kind?: string;
|
|
9
|
+
why: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TrustDeps {
|
|
12
|
+
/** Every chain's replica id (null for the legacy chain). */
|
|
13
|
+
chains(): Array<string | null>;
|
|
14
|
+
ownReplica(): string | null;
|
|
15
|
+
/** The events of ledger files as they stand in HEAD (`rels` from the root, '/'-separated); null when one is not there. */
|
|
16
|
+
heads(rels: string[]): Map<string, ProvenanceEvent[] | null>;
|
|
17
|
+
/** The replica ids whose chain does not verify in the worktree. */
|
|
18
|
+
broken(): Set<string | null>;
|
|
19
|
+
/** Every event in the worktree. */
|
|
20
|
+
events(): StoreEvent[];
|
|
21
|
+
/** The ledger key, when one is set: verification of a HEAD blob checks keyed hashes as the store does. */
|
|
22
|
+
key?(): string | undefined;
|
|
23
|
+
}
|
|
24
|
+
/** Every literal actor production code appends as a tool (the reader census holds the list to the code). */
|
|
25
|
+
export declare const TOOL_ACTORS: readonly ["holmes-kit", "holmes-kit init", "holmes-spec-seam", "spec_renumber", "spec_reconcile"];
|
|
26
|
+
/** @implements A-SPEC-222.14 — the ref HEAD names (`refs/heads/feat`), `detached` for a commit, null with no `.git` here. */
|
|
27
|
+
export declare function headRefOf(root: string): string | null;
|
|
28
|
+
export declare function headCommitOf(root: string): string | null;
|
|
29
|
+
/** @implements A-SPEC-222.13 — HEAD could not be read: never "absent", so every reader fails closed on it. */
|
|
30
|
+
export declare class CommittedReadError extends Error {
|
|
31
|
+
constructor(m: string);
|
|
32
|
+
}
|
|
33
|
+
export declare function committedLedgerTexts(root: string, rels: string[]): Map<string, string | null>;
|
|
34
|
+
/** Whether a row's actor and authorization are a tool's or a well-formed person's (M-1). */
|
|
35
|
+
export declare function trustedActor(e: {
|
|
36
|
+
actor?: unknown;
|
|
37
|
+
authorization?: unknown;
|
|
38
|
+
}): boolean;
|
|
39
|
+
/** Every trusted event across the ledger's chains, and every event or chain that was ignored with its reason. */
|
|
40
|
+
export declare function trustedLedgerEvents(root: string, deps?: TrustDeps): {
|
|
41
|
+
events: StoreEvent[];
|
|
42
|
+
ignored: IgnoredEvent[];
|
|
43
|
+
};
|
|
44
|
+
export declare function ownLedgerShortened(root: string, ledgerDir?: string): boolean;
|
|
45
|
+
/** A-SPEC-222.10 (H-B) — the seals a trusted `spec-approved` event recorded, as `[id, digest]`. */
|
|
46
|
+
export declare function approvedSeals(events: ReadonlyArray<{
|
|
47
|
+
kind?: string;
|
|
48
|
+
inputs?: unknown;
|
|
49
|
+
}>): (id: string, digest: string) => boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The successor pairs and seals the trusted events record, and the ignored rows or chains that could have recorded
|
|
52
|
+
* one: a chain ignored whole could hold any record, so it is named; an ignored row is named when it is of a succession
|
|
53
|
+
* kind or a seal.
|
|
54
|
+
*/
|
|
55
|
+
export declare function recordedPairsPort(root: string, deps?: TrustDeps): {
|
|
56
|
+
recorded: RecordedPair;
|
|
57
|
+
approved: (id: string, digest: string) => boolean;
|
|
58
|
+
ignored: IgnoredEvent[];
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* A-SPEC-222.10 (H-C) — a ledger store whose reads are the trusted events only; appends and every other operation are
|
|
62
|
+
* the file store's. Readers that need trust construct this instead of FileLedgerStore (the reader census holds it).
|
|
63
|
+
*/
|
|
64
|
+
export declare class TrustedLedgerStore extends FileLedgerStore {
|
|
65
|
+
private readonly ledgerDir;
|
|
66
|
+
private readonly id;
|
|
67
|
+
private memo;
|
|
68
|
+
constructor(dir: string, givenId?: string);
|
|
69
|
+
/**
|
|
70
|
+
* @implements A-SPEC-222.12 (low a, b) — the trusted read, memoised per instance until a chain file's size or mtime or
|
|
71
|
+
* HEAD changes (untrusted() and repeated audits reuse it); the store it reads carries this instance's replica id.
|
|
72
|
+
*/
|
|
73
|
+
private read;
|
|
74
|
+
loadAll(): StoreEvent[];
|
|
75
|
+
/**
|
|
76
|
+
* @implements A-SPEC-222.12 (H1) — whether this writer's own chain was ignored as not verifying: a reader that would
|
|
77
|
+
* otherwise take "no trusted events" for "nothing recorded yet" fails closed on it.
|
|
78
|
+
*/
|
|
79
|
+
ownChainBroken(): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Every row, trusted or not, for a check that only refuses: a conflicting row, even an untrusted one, stops an act
|
|
82
|
+
* (fail-closed), while what an act takes as granted or already done comes from `loadAll()` only.
|
|
83
|
+
*/
|
|
84
|
+
loadAllRaw(): StoreEvent[];
|
|
85
|
+
/** The rows among `rows` (read with loadAllRaw) that are not trusted: for an audit, each one is a conflict. */
|
|
86
|
+
untrusted(rows: StoreEvent[]): StoreEvent[];
|
|
87
|
+
/**
|
|
88
|
+
* @implements A-SPEC-222.12 (L1) — an audit refusal that names the replica files holding the untrusted rows and the
|
|
89
|
+
* way out, so one row is not a refusal with no recovery: commit that replica's file (a person stages another replica),
|
|
90
|
+
* or, for an old replica of this machine whose hostname changed, commit or remove it.
|
|
91
|
+
*/
|
|
92
|
+
untrustedReason(rows: StoreEvent[]): string;
|
|
93
|
+
}
|
|
94
|
+
/** One line naming ignored ledger entries, for a refusal or an unproven reason (at most three named). */
|
|
95
|
+
export declare function describeIgnored(ignored: IgnoredEvent[]): string;
|
|
96
|
+
export {};
|