@lannguyensi/harness 0.44.0 → 0.45.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 +1213 -0
- package/dist/cli/adopt/derive.d.ts +16 -7
- package/dist/cli/adopt/derive.js +19 -2
- package/dist/cli/adopt/derive.js.map +1 -1
- package/dist/cli/adopt/index.js +18 -3
- package/dist/cli/adopt/index.js.map +1 -1
- package/dist/cli/apply/apply.d.ts +1 -0
- package/dist/cli/apply/apply.js +62 -6
- package/dist/cli/apply/apply.js.map +1 -1
- package/dist/cli/apply/generate-codex-config.js +5 -6
- package/dist/cli/apply/generate-codex-config.js.map +1 -1
- package/dist/cli/apply/generate-opencode-config.d.ts +58 -0
- package/dist/cli/apply/generate-opencode-config.js +210 -0
- package/dist/cli/apply/generate-opencode-config.js.map +1 -0
- package/dist/cli/apply/generate-settings.d.ts +90 -32
- package/dist/cli/apply/generate-settings.js +133 -10
- package/dist/cli/apply/generate-settings.js.map +1 -1
- package/dist/cli/apply/index.d.ts +2 -1
- package/dist/cli/apply/index.js +2 -1
- package/dist/cli/apply/index.js.map +1 -1
- package/dist/cli/approve/stdin-report.d.ts +15 -0
- package/dist/cli/approve/stdin-report.js +1 -1
- package/dist/cli/approve/stdin-report.js.map +1 -1
- package/dist/cli/approve/understanding.d.ts +75 -0
- package/dist/cli/approve/understanding.js +150 -2
- package/dist/cli/approve/understanding.js.map +1 -1
- package/dist/cli/audit.d.ts +1 -1
- package/dist/cli/audit.js +3 -2
- package/dist/cli/audit.js.map +1 -1
- package/dist/cli/doctor/claude-mcp.d.ts +19 -1
- package/dist/cli/doctor/claude-mcp.js +36 -10
- package/dist/cli/doctor/claude-mcp.js.map +1 -1
- package/dist/cli/doctor/codex.d.ts +3 -1
- package/dist/cli/doctor/codex.js +6 -9
- package/dist/cli/doctor/codex.js.map +1 -1
- package/dist/cli/doctor/format.js +94 -8
- package/dist/cli/doctor/format.js.map +1 -1
- package/dist/cli/doctor/index.d.ts +23 -0
- package/dist/cli/doctor/index.js +106 -2
- package/dist/cli/doctor/index.js.map +1 -1
- package/dist/cli/doctor/opencode.d.ts +24 -0
- package/dist/cli/doctor/opencode.js +107 -0
- package/dist/cli/doctor/opencode.js.map +1 -0
- package/dist/cli/doctor/target-checks.d.ts +11 -0
- package/dist/cli/doctor/target-checks.js +25 -0
- package/dist/cli/doctor/target-checks.js.map +1 -0
- package/dist/cli/doctor/toolchain-parity.d.ts +63 -0
- package/dist/cli/doctor/toolchain-parity.js +154 -0
- package/dist/cli/doctor/toolchain-parity.js.map +1 -0
- package/dist/cli/doctor/types.d.ts +85 -1
- package/dist/cli/doctor/types.js +1 -1
- package/dist/cli/doctor/types.js.map +1 -1
- package/dist/cli/doctor/understanding-mode-env.d.ts +39 -0
- package/dist/cli/doctor/understanding-mode-env.js +83 -0
- package/dist/cli/doctor/understanding-mode-env.js.map +1 -0
- package/dist/cli/dry-run.js +32 -17
- package/dist/cli/dry-run.js.map +1 -1
- package/dist/cli/explain.d.ts +1 -1
- package/dist/cli/explain.js +1 -1
- package/dist/cli/explain.js.map +1 -1
- package/dist/cli/index.js +58 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init/composer.js +36 -13
- package/dist/cli/init/composer.js.map +1 -1
- package/dist/cli/init/interactive.d.ts +7 -4
- package/dist/cli/init/interactive.js +79 -27
- package/dist/cli/init/interactive.js.map +1 -1
- package/dist/cli/init/profiles.d.ts +2 -2
- package/dist/cli/init/profiles.js +32 -1
- package/dist/cli/init/profiles.js.map +1 -1
- package/dist/cli/init/templates.d.ts +2 -1
- package/dist/cli/init/templates.js +130 -20
- package/dist/cli/init/templates.js.map +1 -1
- package/dist/cli/pack/approve-escape.js +69 -8
- package/dist/cli/pack/approve-escape.js.map +1 -1
- package/dist/cli/pack/hook-branch-protection.js +1 -1
- package/dist/cli/pack/hook-branch-protection.js.map +1 -1
- package/dist/cli/pack/hook-codex-pre-tool-use.js +27 -1
- package/dist/cli/pack/hook-codex-pre-tool-use.js.map +1 -1
- package/dist/cli/pack/hook-post-merge-gate.js +1 -1
- package/dist/cli/pack/hook-post-merge-gate.js.map +1 -1
- package/dist/cli/pack/hook-pre-tool-use.js +91 -4
- package/dist/cli/pack/hook-pre-tool-use.js.map +1 -1
- package/dist/cli/pack/hook-solution-acceptance.js +19 -2
- package/dist/cli/pack/hook-solution-acceptance.js.map +1 -1
- package/dist/cli/pack/understanding-report-schema-hint.d.ts +13 -0
- package/dist/cli/pack/understanding-report-schema-hint.js +52 -3
- package/dist/cli/pack/understanding-report-schema-hint.js.map +1 -1
- package/dist/cli/pause/index.js +1 -1
- package/dist/cli/pause/index.js.map +1 -1
- package/dist/cli/policy/intercept.d.ts +148 -0
- package/dist/cli/policy/intercept.js +379 -48
- package/dist/cli/policy/intercept.js.map +1 -1
- package/dist/cli/session-start/index.d.ts +12 -3
- package/dist/cli/session-start/index.js +67 -11
- package/dist/cli/session-start/index.js.map +1 -1
- package/dist/cli/session-start/stale-base-check.d.ts +71 -0
- package/dist/cli/session-start/stale-base-check.js +379 -0
- package/dist/cli/session-start/stale-base-check.js.map +1 -0
- package/dist/cli/session-start/toolchain-parity.d.ts +142 -8
- package/dist/cli/session-start/toolchain-parity.js +244 -36
- package/dist/cli/session-start/toolchain-parity.js.map +1 -1
- package/dist/cli/smoke/assertions.d.ts +9 -2
- package/dist/cli/smoke/assertions.js +9 -2
- package/dist/cli/smoke/assertions.js.map +1 -1
- package/dist/cli/uninstall/index.js +18 -2
- package/dist/cli/uninstall/index.js.map +1 -1
- package/dist/cli/validate/checks.d.ts +3 -1
- package/dist/cli/validate/checks.js +298 -3
- package/dist/cli/validate/checks.js.map +1 -1
- package/dist/io/claude-mcp.d.ts +122 -1
- package/dist/io/claude-mcp.js +214 -12
- package/dist/io/claude-mcp.js.map +1 -1
- package/dist/io/duration.js.map +1 -0
- package/dist/io/expand-home.js.map +1 -0
- package/dist/io/extract.js.map +1 -0
- package/dist/io/harness-lock.js +1 -1
- package/dist/io/harness-lock.js.map +1 -1
- package/dist/{runtime → io}/ledger-record.d.ts +1 -1
- package/dist/io/ledger-record.js.map +1 -0
- package/dist/policies/index.d.ts +2 -2
- package/dist/policies/index.js +2 -2
- package/dist/policies/index.js.map +1 -1
- package/dist/policies/ledger-client.js +10 -6
- package/dist/policies/ledger-client.js.map +1 -1
- package/dist/policies/producers.js +1 -1
- package/dist/policies/producers.js.map +1 -1
- package/dist/policies/requires.js +2 -2
- package/dist/policies/requires.js.map +1 -1
- package/dist/policy-packs/builtin/branch-protection.js +28 -3
- package/dist/policy-packs/builtin/branch-protection.js.map +1 -1
- package/dist/policy-packs/builtin/post-merge-gate.js +45 -9
- package/dist/policy-packs/builtin/post-merge-gate.js.map +1 -1
- package/dist/policy-packs/builtin/solution-acceptance-runtime.d.ts +139 -8
- package/dist/policy-packs/builtin/solution-acceptance-runtime.js +246 -12
- package/dist/policy-packs/builtin/solution-acceptance-runtime.js.map +1 -1
- package/dist/policy-packs/builtin/solution-acceptance.js +17 -3
- package/dist/policy-packs/builtin/solution-acceptance.js.map +1 -1
- package/dist/policy-packs/builtin/understanding-before-execution/active-claim.d.ts +25 -0
- package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js +89 -0
- package/dist/policy-packs/builtin/understanding-before-execution/active-claim.js.map +1 -0
- package/dist/policy-packs/builtin/understanding-before-execution/index.d.ts +13 -0
- package/dist/policy-packs/builtin/understanding-before-execution/index.js +39 -0
- package/dist/policy-packs/builtin/understanding-before-execution/index.js.map +1 -0
- package/dist/policy-packs/builtin/understanding-before-execution/ledger.d.ts +25 -0
- package/dist/policy-packs/builtin/understanding-before-execution/ledger.js +56 -0
- package/dist/policy-packs/builtin/understanding-before-execution/ledger.js.map +1 -0
- package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.d.ts +20 -0
- package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js +79 -0
- package/dist/policy-packs/builtin/understanding-before-execution/lifecycle.js.map +1 -0
- package/dist/policy-packs/builtin/understanding-before-execution/markers.d.ts +103 -0
- package/dist/policy-packs/builtin/understanding-before-execution/markers.js +203 -0
- package/dist/policy-packs/builtin/understanding-before-execution/markers.js.map +1 -0
- package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.d.ts +177 -0
- package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js +309 -0
- package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js.map +1 -0
- package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.d.ts +106 -0
- package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js +209 -0
- package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js.map +1 -0
- package/dist/policy-packs/builtin/understanding-before-execution/task-markers.d.ts +78 -0
- package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js +185 -0
- package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js.map +1 -0
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.d.ts +1 -536
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.js +9 -1095
- package/dist/policy-packs/builtin/understanding-before-execution-runtime.js.map +1 -1
- package/dist/policy-packs/builtin/understanding-before-execution.d.ts +109 -1
- package/dist/policy-packs/builtin/understanding-before-execution.js +183 -15
- package/dist/policy-packs/builtin/understanding-before-execution.js.map +1 -1
- package/dist/policy-packs/registry.d.ts +11 -0
- package/dist/policy-packs/registry.js +1 -1
- package/dist/policy-packs/registry.js.map +1 -1
- package/dist/policy-packs/runtime.d.ts +1 -1
- package/dist/policy-packs/runtime.js +10 -1
- package/dist/policy-packs/runtime.js.map +1 -1
- package/dist/runtime/agent-facing.js +1 -1
- package/dist/runtime/agent-facing.js.map +1 -1
- package/dist/runtime/bash-match-facts.d.ts +9 -7
- package/dist/runtime/bash-match-facts.js +9 -7
- package/dist/runtime/bash-match-facts.js.map +1 -1
- package/dist/runtime/bash-match-registry.d.ts +75 -38
- package/dist/runtime/bash-match-registry.js +279 -232
- package/dist/runtime/bash-match-registry.js.map +1 -1
- package/dist/runtime/bash-prefix-parse.d.ts +7 -0
- package/dist/runtime/bash-prefix-parse.js +205 -17
- package/dist/runtime/bash-prefix-parse.js.map +1 -1
- package/dist/runtime/command-normalize.d.ts +112 -0
- package/dist/runtime/command-normalize.js +411 -38
- package/dist/runtime/command-normalize.js.map +1 -1
- package/dist/runtime/hermetic-spawn-guard.js +6 -0
- package/dist/runtime/hermetic-spawn-guard.js.map +1 -1
- package/dist/runtime/index.d.ts +2 -2
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/intercept.d.ts +78 -3
- package/dist/runtime/intercept.js +151 -39
- package/dist/runtime/intercept.js.map +1 -1
- package/dist/runtime/ledger-add.js +1 -1
- package/dist/runtime/ledger-add.js.map +1 -1
- package/dist/runtime/read-only-bash.js +303 -24
- package/dist/runtime/read-only-bash.js.map +1 -1
- package/dist/schema/doctor.d.ts +25 -0
- package/dist/schema/doctor.js +23 -0
- package/dist/schema/doctor.js.map +1 -0
- package/dist/schema/extract.js +1 -1
- package/dist/schema/extract.js.map +1 -1
- package/dist/schema/index.d.ts +76 -0
- package/dist/schema/index.js +9 -0
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/requires.js +2 -2
- package/dist/schema/requires.js.map +1 -1
- package/dist/schema/risk.d.ts +7 -0
- package/dist/schema/risk.js +23 -0
- package/dist/schema/risk.js.map +1 -1
- package/dist/schema/stale-base-check.d.ts +18 -0
- package/dist/schema/stale-base-check.js +37 -0
- package/dist/schema/stale-base-check.js.map +1 -0
- package/dist/schema/toolchain-parity.d.ts +3 -0
- package/dist/schema/toolchain-parity.js +13 -0
- package/dist/schema/toolchain-parity.js.map +1 -1
- package/package.json +3 -2
- package/dist/policies/duration.js.map +0 -1
- package/dist/policies/extract.js.map +0 -1
- package/dist/runtime/expand-home.js.map +0 -1
- package/dist/runtime/ledger-record.js.map +0 -1
- /package/dist/{policies → io}/duration.d.ts +0 -0
- /package/dist/{policies → io}/duration.js +0 -0
- /package/dist/{runtime → io}/expand-home.d.ts +0 -0
- /package/dist/{runtime → io}/expand-home.js +0 -0
- /package/dist/{policies → io}/extract.d.ts +0 -0
- /package/dist/{policies → io}/extract.js +0 -0
- /package/dist/{runtime → io}/ledger-record.js +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type SignatureVerification } from "../../runtime/approval-signing.js";
|
|
1
2
|
import type { PolicyPack } from "../../schema/index.js";
|
|
2
3
|
export declare const PACK_NAME = "solution-acceptance";
|
|
3
4
|
/**
|
|
@@ -37,7 +38,18 @@ export declare const DEFAULT_PUSH_BASH_RE: RegExp;
|
|
|
37
38
|
* surface (mirrors `resolveProtectedBranches` in branch-protection-runtime).
|
|
38
39
|
*/
|
|
39
40
|
export declare function resolveProtectedCompletionTools(pack: PolicyPack): string[];
|
|
40
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* The verdict marker the producer writes. Keep field-for-field with
|
|
43
|
+
* grounding-mcp for the first 7 keys (golden-fixture-pinned below).
|
|
44
|
+
*
|
|
45
|
+
* `alg` / `signature` (harness/c7c3f606) are ADDITIVE and OPTIONAL: a
|
|
46
|
+
* legacy / not-yet-updated producer omits them entirely (parsed as
|
|
47
|
+
* `undefined`, never `null` — mirrors how `ApprovalMarker.reportContentHash`
|
|
48
|
+
* distinguishes "absent" from an explicit empty value), and such a verdict
|
|
49
|
+
* is REJECTED by `evaluateGate` (missing signature = forged/unsigned, fail
|
|
50
|
+
* closed) rather than silently accepted. See the module doc for the
|
|
51
|
+
* consumer-only / cross-repo-follow-up honesty.
|
|
52
|
+
*/
|
|
41
53
|
export interface Verdict {
|
|
42
54
|
id: string;
|
|
43
55
|
head: string;
|
|
@@ -46,7 +58,73 @@ export interface Verdict {
|
|
|
46
58
|
blockers: string[];
|
|
47
59
|
timestamp: string;
|
|
48
60
|
source: string;
|
|
61
|
+
/** Signature algorithm tag; only `SIGNING_ALG` (`src/runtime/approval-signing.ts`) verifies. */
|
|
62
|
+
alg?: string;
|
|
63
|
+
/** HMAC-SHA256 hex signature over the canonical identifying tuple (see `verifyVerdictSignature`). */
|
|
64
|
+
signature?: string;
|
|
49
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Marker-id namespace the verdict's HMAC signature is bound to (mirrors
|
|
68
|
+
* `BRANCH_PROTECTION_MARKER_PREFIX` in branch-protection-runtime.ts): a
|
|
69
|
+
* validly-signed verdict for one id can never be replayed as a validly-
|
|
70
|
+
* signed verdict — or a validly-signed understanding-gate / branch-
|
|
71
|
+
* protection marker — for a different id, because `markerId` is bound into
|
|
72
|
+
* the signed payload (`approval-signing.ts` `canonicalPayload`) and this
|
|
73
|
+
* prefix keeps the three id spaces disjoint even where the raw ids
|
|
74
|
+
* (task ids, session ids) could otherwise collide.
|
|
75
|
+
*/
|
|
76
|
+
export declare const VERDICT_MARKER_ID_PREFIX = "solution-verdict-";
|
|
77
|
+
/** The HMAC markerId for verdict `id` (NOT a filesystem path — see `verdictPathFor` for that). */
|
|
78
|
+
export declare function verdictMarkerId(id: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* Sign `verdict`, reusing `signMarker` (`src/runtime/approval-signing.ts`)
|
|
81
|
+
* unmodified — same crypto as the understanding-gate / branch-protection
|
|
82
|
+
* markers (harness/f9485cc7). Payload mapping mirrors the approval
|
|
83
|
+
* marker's shape (`approvedAt`/`approvedBy`/`reportContentHash`) onto the
|
|
84
|
+
* verdict's own fields:
|
|
85
|
+
* - `approvedAt` <- `verdict.timestamp` (when the attestation was made)
|
|
86
|
+
* - `approvedBy` <- `verdict.source` (what attests it, e.g. "preflight")
|
|
87
|
+
* - `reportContentHash` <- `verdictContentHash(verdict)` (binds
|
|
88
|
+
* head/ready/confidence/blockers, the fields signMarker's fixed shape
|
|
89
|
+
* has no dedicated slot for)
|
|
90
|
+
*
|
|
91
|
+
* NOT wired to any production write path in harness (harness is a pure
|
|
92
|
+
* CONSUMER of this marker, see module doc) — exported as the pattern +
|
|
93
|
+
* exemplar a grounding-mcp-side producer change reuses, and used directly
|
|
94
|
+
* by this module's own tests to construct validly-signed fixtures.
|
|
95
|
+
*
|
|
96
|
+
* Load-bearing on the producer side: `signMarker` is called with
|
|
97
|
+
* `verdictMarkerId(verdict.id)`, while the consumer (`verifyVerdictSignature`
|
|
98
|
+
* below) verifies with `verdictMarkerId(id)` where `id` is the CALLER's id,
|
|
99
|
+
* not `verdict.id`. Those two only agree when a mirroring producer sets
|
|
100
|
+
* `verdict.id` to the EXACT id string the consumer looks the marker up by —
|
|
101
|
+
* byte-identical, no trimming or case normalization on either side — and the
|
|
102
|
+
* consumer additionally rejects outright when `verdict.id !== id` even if
|
|
103
|
+
* the signature itself still verifies (belt-and-braces, see `evaluateGate`).
|
|
104
|
+
*/
|
|
105
|
+
export declare function signVerdict(generatedDir: string, verdict: Verdict): Verdict;
|
|
106
|
+
/**
|
|
107
|
+
* Verify `verdict`'s signature, reusing `verifyMarkerSignature` unmodified.
|
|
108
|
+
* Recomputes `verdictContentHash` from the (possibly tampered) verdict
|
|
109
|
+
* being checked — the SAME name-mapping `signVerdict` uses — so any
|
|
110
|
+
* post-signing edit to `head` / `ready` / `confidence` / `blockers` /
|
|
111
|
+
* `timestamp` / `source` fails verification, not just an edit to
|
|
112
|
+
* `signature` itself.
|
|
113
|
+
*
|
|
114
|
+
* `id` is the CALLER's id — the one `evaluateGate` is actually checking
|
|
115
|
+
* (`readVerdict`'s lookup key) — NOT `verdict.id` (a field read back out of
|
|
116
|
+
* the marker BODY, which is exactly the bytes an attacker controls when
|
|
117
|
+
* copying a validly-signed marker verbatim onto a different id's path).
|
|
118
|
+
* This mirrors the load-bearing invariant `approval-signing.ts`'s
|
|
119
|
+
* `signMarker` doc states explicitly: "verification always recomputes the
|
|
120
|
+
* HMAC using the id the caller is checking, NOT one read back out of the
|
|
121
|
+
* marker body." Trusting `verdict.id` here would let a byte-for-byte copy
|
|
122
|
+
* of one id's signed verdict pass verification under a DIFFERENT id's
|
|
123
|
+
* request, because the copy's `signature` and its own (also-copied)
|
|
124
|
+
* `verdict.id` field would always agree with each other regardless of which
|
|
125
|
+
* id actually asked.
|
|
126
|
+
*/
|
|
127
|
+
export declare function verifyVerdictSignature(generatedDir: string, id: string, verdict: Verdict): SignatureVerification;
|
|
50
128
|
/** Env knob that overrides the verdict directory (mirrors the producer). */
|
|
51
129
|
export declare const VERDICT_DIR_ENV = "SOLUTION_VERDICT_DIR";
|
|
52
130
|
/**
|
|
@@ -104,16 +182,69 @@ export interface GateResult {
|
|
|
104
182
|
allowed: boolean;
|
|
105
183
|
reason: string;
|
|
106
184
|
verdict: Verdict | null;
|
|
185
|
+
/**
|
|
186
|
+
* True when `allowed` is false SPECIFICALLY because a verdict file
|
|
187
|
+
* existed and parsed (the 7 producer keys), but carried a missing or
|
|
188
|
+
* invalid HMAC signature (harness/c7c3f606), or a body that identifies a
|
|
189
|
+
* different id than the one being checked (cross-id replay, see the
|
|
190
|
+
* `verdict.id !== id` check below) — a legacy/not-yet-signing producer, a
|
|
191
|
+
* marker planted through some write primitive the write-guard doesn't
|
|
192
|
+
* enumerate, or content tampered/copied post-signing. Distinct from
|
|
193
|
+
* `verdict === null` (no marker at all, `forged: false`), from a
|
|
194
|
+
* signing-key I/O failure (fail-closed but NOT classified as forged,
|
|
195
|
+
* mirroring `SignatureVerification`'s `kind: "key-unavailable"` — a
|
|
196
|
+
* broken key file must not read as an active forgery attempt in audit
|
|
197
|
+
* output), and from a verdict with NO `alg`/`signature` fields at all
|
|
198
|
+
* whose `timestamp` / `source` also reads blank (fail-closed but NOT
|
|
199
|
+
* classified as forged either — a legitimately malformed, never-signed
|
|
200
|
+
* marker, not evidence of an attack; see the `MISSING_*_REASON` carve-out
|
|
201
|
+
* below). That last carve-out is scoped tightly: a verdict that DOES carry
|
|
202
|
+
* `alg`/`signature` but still hits the same blank-field reason IS
|
|
203
|
+
* classified `forged: true` — a signed field reading blank only happens
|
|
204
|
+
* via post-signing tampering, so it does not get the "legitimately
|
|
205
|
+
* malformed" benefit of the doubt (review R2, closes an audit-fidelity
|
|
206
|
+
* gap where a forger could blank a real signed verdict's `timestamp` to
|
|
207
|
+
* suppress this tag while the block itself still held). `allowed` is
|
|
208
|
+
* always false when `forged` is true.
|
|
209
|
+
*/
|
|
210
|
+
forged: boolean;
|
|
107
211
|
}
|
|
108
212
|
/**
|
|
109
|
-
* Evaluate the gate for `id` at `currentHead`.
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
213
|
+
* Evaluate the gate for `id` at `currentHead`. First verifies the verdict's
|
|
214
|
+
* HMAC signature (harness/c7c3f606, fail-closed — see `verifyVerdictSignature`);
|
|
215
|
+
* a verdict that fails this is REJECTED before its `ready` / `head` fields
|
|
216
|
+
* are ever trusted, with a distinct forged/unsigned reason so an
|
|
217
|
+
* operator/auditor can tell that apart from the routine "not ready yet" or
|
|
218
|
+
* "no verdict" cases. Signature verification needs `generatedDir` (the
|
|
219
|
+
* harness `.generated/` dir holding the shared signing key, NOT the verdict
|
|
220
|
+
* dir) — `undefined` when it could not be resolved, which fails closed with
|
|
221
|
+
* its own distinct (non-forged) reason.
|
|
222
|
+
*
|
|
223
|
+
* `verifyVerdictSignature` is called with `id` — the CALLER's id, i.e. the
|
|
224
|
+
* one this function is asked to check — not `verdict.id`. A SECOND,
|
|
225
|
+
* belt-and-braces check below independently rejects `verdict.id !== id`:
|
|
226
|
+
* even though the signature check alone already closes the cross-id-replay
|
|
227
|
+
* hole (a byte-for-byte copy of a validly-signed verdict onto a different
|
|
228
|
+
* id's path fails signature verification, because the markerId the
|
|
229
|
+
* signature is bound to no longer matches `id`), the verdict body's `id`
|
|
230
|
+
* field itself is NOT part of the signed payload (only `timestamp` /
|
|
231
|
+
* `source` / the head-ready-confidence-blockers content hash are), so it
|
|
232
|
+
* can drift from the id that was actually verified without invalidating an
|
|
233
|
+
* otherwise-valid signature. This check makes that drift fail loudly too,
|
|
234
|
+
* rather than silently ignoring an inconsistency in the body of a verdict
|
|
235
|
+
* that otherwise passed.
|
|
236
|
+
*
|
|
237
|
+
* Once signed and identity-checked, mirrors grounding-mcp `evaluateGate`:
|
|
238
|
+
* allow iff `verdict.ready === true` AND `verdict.head === currentHead`.
|
|
239
|
+
* `confidence` is INFORMATIONAL ONLY and never gates — a `ready:true
|
|
240
|
+
* confidence:0` verdict at HEAD passes — so the harness consumer stays
|
|
241
|
+
* byte-parity with the producer's `solution_gate` for THAT decision.
|
|
242
|
+
* Signature verification itself is NOT (yet) mirrored on the producer side
|
|
243
|
+
* — see module doc, "HONEST RESIDUAL": grounding-mcp's own `solution_gate`
|
|
244
|
+
* does not enforce this signature, only this harness consumer does, until a
|
|
245
|
+
* matching producer release ships.
|
|
115
246
|
*/
|
|
116
|
-
export declare function evaluateGate(verdict: Verdict | null, currentHead: string | null, id: string): GateResult;
|
|
247
|
+
export declare function evaluateGate(verdict: Verdict | null, currentHead: string | null, id: string, generatedDir: string | undefined): GateResult;
|
|
117
248
|
/**
|
|
118
249
|
* Is `target` inside `dir` after resolution? Used for the path-tool arm
|
|
119
250
|
* (Write/Edit/MultiEdit/NotebookEdit `file_path`) and for a Bash shell whose
|
|
@@ -34,17 +34,47 @@
|
|
|
34
34
|
// agent could otherwise hand-write a `ready:true` marker. The write-guard
|
|
35
35
|
// blocks the agent's enumerated write paths into the verdict dir.
|
|
36
36
|
//
|
|
37
|
-
// Anti-forgery honesty (operator decision, 2026-05-30): v1
|
|
37
|
+
// Anti-forgery honesty (operator decision, 2026-05-30): v1 closed the
|
|
38
38
|
// ENUMERATED-WRITE-PATH residual (the Bash/Edit/Write spellings below), NOT
|
|
39
39
|
// arbitrary same-uid forgery. A `0500` chmod on the dir would be incoherent
|
|
40
40
|
// here because the producer (grounding-mcp) and the agent share a uid, so it
|
|
41
|
-
// would block the producer too.
|
|
42
|
-
//
|
|
43
|
-
//
|
|
44
|
-
//
|
|
41
|
+
// would block the producer too.
|
|
42
|
+
//
|
|
43
|
+
// Content-authenticity (harness/c7c3f606): the verdict now carries an HMAC
|
|
44
|
+
// signature, reusing the SAME `signMarker` / `verifyMarkerSignature`
|
|
45
|
+
// primitive `src/runtime/approval-signing.ts` shipped for the
|
|
46
|
+
// understanding-gate / branch-protection markers (harness/f9485cc7) — same
|
|
47
|
+
// crypto, same operator-side key at `<generatedDir>/.approval-signing.key`,
|
|
48
|
+
// same fail-closed contract (missing/invalid signature = NOT satisfied,
|
|
49
|
+
// distinct `forged` reason, strict no-migration-window back-compat). See
|
|
50
|
+
// `verifyVerdictSignature` / `signVerdict` below for the payload mapping.
|
|
51
|
+
//
|
|
52
|
+
// HONEST RESIDUAL — this is consumer-side only (pattern + exemplar). Unlike
|
|
53
|
+
// the understanding-gate marker, harness does not write this one: the
|
|
54
|
+
// producer is `@lannguyensi/grounding-mcp`, a SEPARATE package/repo (see
|
|
55
|
+
// module doc above). No currently-released producer signs its output, so
|
|
56
|
+
// until a matching grounding-mcp release ships (a tracked cross-repo
|
|
57
|
+
// follow-up), EVERY verdict this consumer reads is "unsigned" and the
|
|
58
|
+
// completion-gate denies it — the SAME strict, no-grace-period POLICY
|
|
59
|
+
// f9485cc7 made (no unsigned marker satisfies the gate). The RECOVERY shape
|
|
60
|
+
// differs, though: f9485cc7's producer and consumer live in this one repo,
|
|
61
|
+
// so an operator hitting that denial has a local fix (`harness approve
|
|
62
|
+
// understanding` / `harness approve branch-protection`, one command, this
|
|
63
|
+
// release). Here the producer is a separate package on its own release
|
|
64
|
+
// cadence, so there is NO operator-side command that resolves the denial —
|
|
65
|
+
// re-running `solution_evaluate` today still yields an unsigned verdict.
|
|
66
|
+
// Operators running this pack should expect the completion-gate to deny
|
|
67
|
+
// universally until the grounding-mcp producer release ships; `harness
|
|
68
|
+
// pause` remains the operator override in the interim.
|
|
69
|
+
// Glob-every-segment / interpreter-runtime-path-construction spellings of
|
|
70
|
+
// the write-guard's residual (see below) are UNCHANGED by this: signing
|
|
71
|
+
// verifies content authenticity of whatever bytes land at the marker path,
|
|
72
|
+
// it does not additionally restrict which write primitives can reach that
|
|
73
|
+
// path (the write-guard already does that, separately, best-effort).
|
|
45
74
|
import * as os from "node:os";
|
|
46
75
|
import * as path from "node:path";
|
|
47
76
|
import { readRegularFileRejectingSymlink } from "../../io/read-regular-file.js";
|
|
77
|
+
import { sha256Hex, signMarker, verifyMarkerSignature, } from "../../runtime/approval-signing.js";
|
|
48
78
|
export const PACK_NAME = "solution-acceptance";
|
|
49
79
|
/**
|
|
50
80
|
* agent-tasks MCP verbs that mark a completion boundary. The gate fires on
|
|
@@ -96,6 +126,99 @@ export function resolveProtectedCompletionTools(pack) {
|
|
|
96
126
|
}
|
|
97
127
|
return [...DEFAULT_PROTECTED_COMPLETION_TOOLS];
|
|
98
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Marker-id namespace the verdict's HMAC signature is bound to (mirrors
|
|
131
|
+
* `BRANCH_PROTECTION_MARKER_PREFIX` in branch-protection-runtime.ts): a
|
|
132
|
+
* validly-signed verdict for one id can never be replayed as a validly-
|
|
133
|
+
* signed verdict — or a validly-signed understanding-gate / branch-
|
|
134
|
+
* protection marker — for a different id, because `markerId` is bound into
|
|
135
|
+
* the signed payload (`approval-signing.ts` `canonicalPayload`) and this
|
|
136
|
+
* prefix keeps the three id spaces disjoint even where the raw ids
|
|
137
|
+
* (task ids, session ids) could otherwise collide.
|
|
138
|
+
*/
|
|
139
|
+
export const VERDICT_MARKER_ID_PREFIX = "solution-verdict-";
|
|
140
|
+
/** The HMAC markerId for verdict `id` (NOT a filesystem path — see `verdictPathFor` for that). */
|
|
141
|
+
export function verdictMarkerId(id) {
|
|
142
|
+
return `${VERDICT_MARKER_ID_PREFIX}${id}`;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Canonical JSON of the verdict fields the signature must bind BEYOND
|
|
146
|
+
* `(markerId, timestamp, source)` — i.e. the fields `signMarker`'s fixed
|
|
147
|
+
* `{approvedAt, approvedBy, reportContentHash}` shape has no dedicated slot
|
|
148
|
+
* for. Reusing that slot for this hash (rather than forking the primitive
|
|
149
|
+
* to add more parameters, per task scope) means `head` / `ready` /
|
|
150
|
+
* `confidence` / `blockers` are ALL covered by the signature: mutating any
|
|
151
|
+
* one of them after signing changes this hash and invalidates the
|
|
152
|
+
* signature. Fixed key order makes this injective (same argument as
|
|
153
|
+
* `canonicalPayload` in approval-signing.ts).
|
|
154
|
+
*/
|
|
155
|
+
function verdictContentHash(v) {
|
|
156
|
+
return sha256Hex(JSON.stringify({ head: v.head, ready: v.ready, confidence: v.confidence, blockers: v.blockers }));
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Sign `verdict`, reusing `signMarker` (`src/runtime/approval-signing.ts`)
|
|
160
|
+
* unmodified — same crypto as the understanding-gate / branch-protection
|
|
161
|
+
* markers (harness/f9485cc7). Payload mapping mirrors the approval
|
|
162
|
+
* marker's shape (`approvedAt`/`approvedBy`/`reportContentHash`) onto the
|
|
163
|
+
* verdict's own fields:
|
|
164
|
+
* - `approvedAt` <- `verdict.timestamp` (when the attestation was made)
|
|
165
|
+
* - `approvedBy` <- `verdict.source` (what attests it, e.g. "preflight")
|
|
166
|
+
* - `reportContentHash` <- `verdictContentHash(verdict)` (binds
|
|
167
|
+
* head/ready/confidence/blockers, the fields signMarker's fixed shape
|
|
168
|
+
* has no dedicated slot for)
|
|
169
|
+
*
|
|
170
|
+
* NOT wired to any production write path in harness (harness is a pure
|
|
171
|
+
* CONSUMER of this marker, see module doc) — exported as the pattern +
|
|
172
|
+
* exemplar a grounding-mcp-side producer change reuses, and used directly
|
|
173
|
+
* by this module's own tests to construct validly-signed fixtures.
|
|
174
|
+
*
|
|
175
|
+
* Load-bearing on the producer side: `signMarker` is called with
|
|
176
|
+
* `verdictMarkerId(verdict.id)`, while the consumer (`verifyVerdictSignature`
|
|
177
|
+
* below) verifies with `verdictMarkerId(id)` where `id` is the CALLER's id,
|
|
178
|
+
* not `verdict.id`. Those two only agree when a mirroring producer sets
|
|
179
|
+
* `verdict.id` to the EXACT id string the consumer looks the marker up by —
|
|
180
|
+
* byte-identical, no trimming or case normalization on either side — and the
|
|
181
|
+
* consumer additionally rejects outright when `verdict.id !== id` even if
|
|
182
|
+
* the signature itself still verifies (belt-and-braces, see `evaluateGate`).
|
|
183
|
+
*/
|
|
184
|
+
export function signVerdict(generatedDir, verdict) {
|
|
185
|
+
const signed = signMarker(generatedDir, verdictMarkerId(verdict.id), {
|
|
186
|
+
approvedAt: verdict.timestamp,
|
|
187
|
+
approvedBy: verdict.source,
|
|
188
|
+
reportContentHash: verdictContentHash(verdict),
|
|
189
|
+
});
|
|
190
|
+
return { ...verdict, alg: signed.alg, signature: signed.signature };
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Verify `verdict`'s signature, reusing `verifyMarkerSignature` unmodified.
|
|
194
|
+
* Recomputes `verdictContentHash` from the (possibly tampered) verdict
|
|
195
|
+
* being checked — the SAME name-mapping `signVerdict` uses — so any
|
|
196
|
+
* post-signing edit to `head` / `ready` / `confidence` / `blockers` /
|
|
197
|
+
* `timestamp` / `source` fails verification, not just an edit to
|
|
198
|
+
* `signature` itself.
|
|
199
|
+
*
|
|
200
|
+
* `id` is the CALLER's id — the one `evaluateGate` is actually checking
|
|
201
|
+
* (`readVerdict`'s lookup key) — NOT `verdict.id` (a field read back out of
|
|
202
|
+
* the marker BODY, which is exactly the bytes an attacker controls when
|
|
203
|
+
* copying a validly-signed marker verbatim onto a different id's path).
|
|
204
|
+
* This mirrors the load-bearing invariant `approval-signing.ts`'s
|
|
205
|
+
* `signMarker` doc states explicitly: "verification always recomputes the
|
|
206
|
+
* HMAC using the id the caller is checking, NOT one read back out of the
|
|
207
|
+
* marker body." Trusting `verdict.id` here would let a byte-for-byte copy
|
|
208
|
+
* of one id's signed verdict pass verification under a DIFFERENT id's
|
|
209
|
+
* request, because the copy's `signature` and its own (also-copied)
|
|
210
|
+
* `verdict.id` field would always agree with each other regardless of which
|
|
211
|
+
* id actually asked.
|
|
212
|
+
*/
|
|
213
|
+
export function verifyVerdictSignature(generatedDir, id, verdict) {
|
|
214
|
+
return verifyMarkerSignature(generatedDir, verdictMarkerId(id), {
|
|
215
|
+
approvedAt: verdict.timestamp,
|
|
216
|
+
approvedBy: verdict.source,
|
|
217
|
+
reportContentHash: verdictContentHash(verdict),
|
|
218
|
+
alg: verdict.alg,
|
|
219
|
+
signature: verdict.signature,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
99
222
|
/** Env knob that overrides the verdict directory (mirrors the producer). */
|
|
100
223
|
export const VERDICT_DIR_ENV = "SOLUTION_VERDICT_DIR";
|
|
101
224
|
/**
|
|
@@ -207,26 +330,133 @@ export function readVerdict(dir, id) {
|
|
|
207
330
|
blockers: Array.isArray(parsed.blockers) ? parsed.blockers : [],
|
|
208
331
|
timestamp: typeof parsed.timestamp === "string" ? parsed.timestamp : "",
|
|
209
332
|
source: typeof parsed.source === "string" ? parsed.source : "",
|
|
333
|
+
// Optional (harness/c7c3f606): absent on a legacy/unsigned producer
|
|
334
|
+
// marker. `evaluateGate` treats that absence as forged/unsigned, not
|
|
335
|
+
// as a parse failure — the 7 fields above are still ALL a marker
|
|
336
|
+
// needs to parse successfully; signing is a separate, later gate.
|
|
337
|
+
alg: typeof parsed.alg === "string" ? parsed.alg : undefined,
|
|
338
|
+
signature: typeof parsed.signature === "string" ? parsed.signature : undefined,
|
|
210
339
|
};
|
|
211
340
|
}
|
|
212
341
|
catch {
|
|
213
342
|
return null;
|
|
214
343
|
}
|
|
215
344
|
}
|
|
345
|
+
// `verifyMarkerSignature` (`src/runtime/approval-signing.ts`, NOT modified by
|
|
346
|
+
// this module) returns these exact literal reason strings when `verdict`'s
|
|
347
|
+
// `timestamp` / `source` map onto an empty `approvedAt` / `approvedBy`. That
|
|
348
|
+
// check runs FIRST, before `verifyMarkerSignature` ever looks at `signature`
|
|
349
|
+
// itself — so it fires identically whether the verdict carries NO signature
|
|
350
|
+
// at all (a genuinely legacy/unsigned marker) OR carries a well-formed
|
|
351
|
+
// `alg`/`signature` pair that no longer matches because the blank field was
|
|
352
|
+
// introduced AFTER signing (a forger tampering a real signed verdict to
|
|
353
|
+
// suppress the forged tag: blank `timestamp`, and the "missing approvedAt"
|
|
354
|
+
// short-circuit means the tampered signature is never even compared).
|
|
355
|
+
// `evaluateGate` below carves out ONLY the first case (no signature/alg
|
|
356
|
+
// present at all — the same carve-out shape as `SignatureVerification`'s
|
|
357
|
+
// `kind: "key-unavailable"`); a verdict that carries a signature/alg but
|
|
358
|
+
// still hits this reason falls through to the generic `forged: true`
|
|
359
|
+
// bucket, because "signed, yet a signed field reads blank" is post-signing
|
|
360
|
+
// tampering by construction (harness/c7c3f606 review R2). Matched by exact
|
|
361
|
+
// string since `verifyMarkerSignature` has no `kind` tag for this case; if
|
|
362
|
+
// its wording ever changes, these two constants must move with it.
|
|
363
|
+
const MISSING_APPROVED_AT_REASON = "missing approvedAt";
|
|
364
|
+
const MISSING_APPROVED_BY_REASON = "missing approvedBy";
|
|
216
365
|
/**
|
|
217
|
-
* Evaluate the gate for `id` at `currentHead`.
|
|
218
|
-
*
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
366
|
+
* Evaluate the gate for `id` at `currentHead`. First verifies the verdict's
|
|
367
|
+
* HMAC signature (harness/c7c3f606, fail-closed — see `verifyVerdictSignature`);
|
|
368
|
+
* a verdict that fails this is REJECTED before its `ready` / `head` fields
|
|
369
|
+
* are ever trusted, with a distinct forged/unsigned reason so an
|
|
370
|
+
* operator/auditor can tell that apart from the routine "not ready yet" or
|
|
371
|
+
* "no verdict" cases. Signature verification needs `generatedDir` (the
|
|
372
|
+
* harness `.generated/` dir holding the shared signing key, NOT the verdict
|
|
373
|
+
* dir) — `undefined` when it could not be resolved, which fails closed with
|
|
374
|
+
* its own distinct (non-forged) reason.
|
|
375
|
+
*
|
|
376
|
+
* `verifyVerdictSignature` is called with `id` — the CALLER's id, i.e. the
|
|
377
|
+
* one this function is asked to check — not `verdict.id`. A SECOND,
|
|
378
|
+
* belt-and-braces check below independently rejects `verdict.id !== id`:
|
|
379
|
+
* even though the signature check alone already closes the cross-id-replay
|
|
380
|
+
* hole (a byte-for-byte copy of a validly-signed verdict onto a different
|
|
381
|
+
* id's path fails signature verification, because the markerId the
|
|
382
|
+
* signature is bound to no longer matches `id`), the verdict body's `id`
|
|
383
|
+
* field itself is NOT part of the signed payload (only `timestamp` /
|
|
384
|
+
* `source` / the head-ready-confidence-blockers content hash are), so it
|
|
385
|
+
* can drift from the id that was actually verified without invalidating an
|
|
386
|
+
* otherwise-valid signature. This check makes that drift fail loudly too,
|
|
387
|
+
* rather than silently ignoring an inconsistency in the body of a verdict
|
|
388
|
+
* that otherwise passed.
|
|
389
|
+
*
|
|
390
|
+
* Once signed and identity-checked, mirrors grounding-mcp `evaluateGate`:
|
|
391
|
+
* allow iff `verdict.ready === true` AND `verdict.head === currentHead`.
|
|
392
|
+
* `confidence` is INFORMATIONAL ONLY and never gates — a `ready:true
|
|
393
|
+
* confidence:0` verdict at HEAD passes — so the harness consumer stays
|
|
394
|
+
* byte-parity with the producer's `solution_gate` for THAT decision.
|
|
395
|
+
* Signature verification itself is NOT (yet) mirrored on the producer side
|
|
396
|
+
* — see module doc, "HONEST RESIDUAL": grounding-mcp's own `solution_gate`
|
|
397
|
+
* does not enforce this signature, only this harness consumer does, until a
|
|
398
|
+
* matching producer release ships.
|
|
223
399
|
*/
|
|
224
|
-
export function evaluateGate(verdict, currentHead, id) {
|
|
400
|
+
export function evaluateGate(verdict, currentHead, id, generatedDir) {
|
|
225
401
|
if (!verdict) {
|
|
226
402
|
return {
|
|
227
403
|
allowed: false,
|
|
228
404
|
reason: `no solution-acceptance verdict recorded for "${id}" (run mcp__grounding-mcp__solution_evaluate first)`,
|
|
229
405
|
verdict: null,
|
|
406
|
+
forged: false,
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
if (generatedDir === undefined) {
|
|
410
|
+
return {
|
|
411
|
+
allowed: false,
|
|
412
|
+
reason: `cannot resolve harness.generated/ to verify the solution-acceptance verdict signature for "${id}"; treating as unapproved`,
|
|
413
|
+
verdict,
|
|
414
|
+
forged: false,
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
const verification = verifyVerdictSignature(generatedDir, id, verdict);
|
|
418
|
+
if (!verification.ok) {
|
|
419
|
+
if (verification.kind === "key-unavailable") {
|
|
420
|
+
return {
|
|
421
|
+
allowed: false,
|
|
422
|
+
reason: `solution-acceptance verdict for "${id}" could not be verified: ${verification.reason}; treating as unapproved`,
|
|
423
|
+
verdict,
|
|
424
|
+
forged: false,
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
if ((verification.reason === MISSING_APPROVED_AT_REASON ||
|
|
428
|
+
verification.reason === MISSING_APPROVED_BY_REASON) &&
|
|
429
|
+
verdict.signature === undefined &&
|
|
430
|
+
verdict.alg === undefined) {
|
|
431
|
+
// Scoped (harness/c7c3f606 review R2 MED): the carve-out applies ONLY
|
|
432
|
+
// to a verdict that carries NO signature/alg fields at all. A verdict
|
|
433
|
+
// that DOES carry them but still hits this reason is not "legitimately
|
|
434
|
+
// malformed" — it is a signature computed over content that now reads
|
|
435
|
+
// blank, which only happens via post-signing tampering (the blank
|
|
436
|
+
// field falls through to the generic forged:true branch below instead).
|
|
437
|
+
return {
|
|
438
|
+
allowed: false,
|
|
439
|
+
reason: `solution-acceptance verdict for "${id}" is missing a required field (${verification.reason}); ` +
|
|
440
|
+
`treating as unsigned, not forged (a legitimately malformed marker, re-run solution_evaluate)`,
|
|
441
|
+
verdict,
|
|
442
|
+
forged: false,
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
return {
|
|
446
|
+
allowed: false,
|
|
447
|
+
reason: `forged/unsigned solution-acceptance verdict rejected for "${id}": ${verification.reason} ` +
|
|
448
|
+
`(a producer that does not yet sign verdicts, or a marker written through an unguarded path)`,
|
|
449
|
+
verdict,
|
|
450
|
+
forged: true,
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
if (verdict.id !== id) {
|
|
454
|
+
return {
|
|
455
|
+
allowed: false,
|
|
456
|
+
reason: `forged/unsigned solution-acceptance verdict rejected for "${id}": verdict body identifies itself ` +
|
|
457
|
+
`as "${verdict.id}" (cross-id replay of a validly-signed verdict, or a corrupted marker)`,
|
|
458
|
+
verdict,
|
|
459
|
+
forged: true,
|
|
230
460
|
};
|
|
231
461
|
}
|
|
232
462
|
if (!verdict.ready) {
|
|
@@ -235,6 +465,7 @@ export function evaluateGate(verdict, currentHead, id) {
|
|
|
235
465
|
allowed: false,
|
|
236
466
|
reason: `solution-acceptance verdict for "${id}" is not ready${why} (fix, then re-run solution_evaluate)`,
|
|
237
467
|
verdict,
|
|
468
|
+
forged: false,
|
|
238
469
|
};
|
|
239
470
|
}
|
|
240
471
|
if (!currentHead) {
|
|
@@ -242,6 +473,7 @@ export function evaluateGate(verdict, currentHead, id) {
|
|
|
242
473
|
allowed: false,
|
|
243
474
|
reason: `cannot resolve the current git HEAD to confirm the verdict for "${id}" is at HEAD`,
|
|
244
475
|
verdict,
|
|
476
|
+
forged: false,
|
|
245
477
|
};
|
|
246
478
|
}
|
|
247
479
|
if (verdict.head !== currentHead) {
|
|
@@ -249,12 +481,14 @@ export function evaluateGate(verdict, currentHead, id) {
|
|
|
249
481
|
allowed: false,
|
|
250
482
|
reason: `stale solution-acceptance verdict for "${id}": recorded at ${verdict.head.slice(0, 7)}, current HEAD ${currentHead.slice(0, 7)} (re-run solution_evaluate after the rework)`,
|
|
251
483
|
verdict,
|
|
484
|
+
forged: false,
|
|
252
485
|
};
|
|
253
486
|
}
|
|
254
487
|
return {
|
|
255
488
|
allowed: true,
|
|
256
489
|
reason: `solution-acceptance verdict for "${id}" is ready at HEAD ${currentHead.slice(0, 7)} (confidence ${Math.round(verdict.confidence * 100)}%)`,
|
|
257
490
|
verdict,
|
|
491
|
+
forged: false,
|
|
258
492
|
};
|
|
259
493
|
}
|
|
260
494
|
// ── Write-guard target detection ──
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solution-acceptance-runtime.js","sourceRoot":"","sources":["../../../src/policy-packs/builtin/solution-acceptance-runtime.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,sEAAsE;AACtE,8EAA8E;AAC9E,4EAA4E;AAC5E,sEAAsE;AACtE,wEAAwE;AACxE,4EAA4E;AAC5E,6CAA6C;AAC7C,EAAE;AACF,uEAAuE;AACvE,yEAAyE;AACzE,2DAA2D;AAC3D,4EAA4E;AAC5E,yEAAyE;AACzE,8EAA8E;AAC9E,2EAA2E;AAC3E,0EAA0E;AAC1E,gEAAgE;AAChE,EAAE;AACF,2EAA2E;AAC3E,oCAAoC;AACpC,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,wEAAwE;AACxE,8DAA8D;AAC9D,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,uEAAuE;AACvE,EAAE;AACF,sEAAsE;AACtE,4EAA4E;AAC5E,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,2EAA2E;AAC3E,2EAA2E;AAC3E,gBAAgB;AAEhB,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAGhF,MAAM,CAAC,MAAM,SAAS,GAAG,qBAAqB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD,aAAa;IACb,gBAAgB;IAChB,YAAY;IACZ,qBAAqB;CACb,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAC/B,yFAAyF,CAAC;AAE5F;;;;;;GAMG;AACH,MAAM,UAAU,+BAA+B,C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D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,2EAA2E;IAC3E,yEAAyE;IACzE,yEAAyE;IACzE,0EAA0E;IAC1E,qEAAqE;IACrE,6EAA6E;IAC7E,wEAAwE;IACxE,2EAA2E;IAC3E,0EAA0E;IAC1E,4EAA4E;IAC5E,sEAAsE;IACtE,2EAA2E;IAC3E,uEAAuE;IACvE,oEAAoE;IACpE,sEAAsE;IACtE,oEAAoE;IACpE,mEAAmE;IACnE,mCAAmC;IACnC,EAAE;IACF,iEAAiE;IACjE,mEAAmE;IACnE,mEAAmE;IACnE,6DAA6D;IAC7D,mEAAmE;IACnE,uEAAuE;IACvE,sEAAsE;IACtE,oEAAoE;IACpE,gEAAgE;IAChE,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;QAC3E,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;IAC9D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
1
|
+
{"version":3,"file":"solution-acceptance-runtime.js","sourceRoot":"","sources":["../../../src/policy-packs/builtin/solution-acceptance-runtime.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,sEAAsE;AACtE,8EAA8E;AAC9E,4EAA4E;AAC5E,sEAAsE;AACtE,wEAAwE;AACxE,4EAA4E;AAC5E,6CAA6C;AAC7C,EAAE;AACF,uEAAuE;AACvE,yEAAyE;AACzE,2DAA2D;AAC3D,4EAA4E;AAC5E,yEAAyE;AACzE,8EAA8E;AAC9E,2EAA2E;AAC3E,0E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C3E,0EAA0E;IAC1E,4EAA4E;IAC5E,sEAAsE;IACtE,2EAA2E;IAC3E,uEAAuE;IACvE,oEAAoE;IACpE,sEAAsE;IACtE,oEAAoE;IACpE,mEAAmE;IACnE,mCAAmC;IACnC,EAAE;IACF,iEAAiE;IACjE,mEAAmE;IACnE,mEAAmE;IACnE,6DAA6D;IAC7D,mEAAmE;IACnE,uEAAuE;IACvE,sEAAsE;IACtE,oEAAoE;IACpE,gEAAgE;IAChE,IAAI,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;QAC3E,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAAE,OAAO,IAAI,CAAC;IAC9D,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -113,6 +113,21 @@ function buildHooks(runtime, tools, opts = {}) {
|
|
|
113
113
|
}
|
|
114
114
|
function buildInstructions(pack, tools, runtime) {
|
|
115
115
|
const description = pack.description?.trim() ?? "";
|
|
116
|
+
const isOpencode = runtime === "opencode";
|
|
117
|
+
// HIGH-F1 (batch18 fix-round, task f34eb233): unlike the sibling
|
|
118
|
+
// packs, this file previously had NO runtime-conditional text at all
|
|
119
|
+
// — "## Effect" unconditionally claimed the hooks below "are wired
|
|
120
|
+
// into the harness-managed settings", which is false under
|
|
121
|
+
// `--runtime opencode`: opencode has no declarative hook/event field
|
|
122
|
+
// and `harness apply --runtime opencode` never projects `hooks[]`
|
|
123
|
+
// into the generated opencode artefact (see runtime.ts's header).
|
|
124
|
+
// Mirrors post-merge-gate.ts's "## Runtime" UNSUPPORTED marker.
|
|
125
|
+
const runtimeUnsupportedNote = isOpencode
|
|
126
|
+
? " (UNSUPPORTED — opencode has no declarative hook/event wiring; this pack's hooks are not projected into any opencode artefact)"
|
|
127
|
+
: "";
|
|
128
|
+
const wiringSentence = isOpencode
|
|
129
|
+
? "This pack's hooks are **not wired** under `--runtime opencode`: opencode has no declarative hook/event field (only a JS/TS plugin API), and `harness apply --runtime opencode` never projects `hooks[]` into the generated opencode artefact. The mechanics below describe the Claude Code / Codex behavior this pack implements; none of it fires today under opencode."
|
|
130
|
+
: "Two `PreToolUse` hooks (both blocking: hard) are wired into the\nharness-managed settings:";
|
|
116
131
|
return `# Policy Pack: ${PACK_NAME}
|
|
117
132
|
|
|
118
133
|
> Operator audit copy. This pack makes task completion EARNED from a real
|
|
@@ -122,7 +137,7 @@ function buildInstructions(pack, tools, runtime) {
|
|
|
122
137
|
|
|
123
138
|
## Runtime
|
|
124
139
|
|
|
125
|
-
${runtime}
|
|
140
|
+
${runtime}${runtimeUnsupportedNote}
|
|
126
141
|
|
|
127
142
|
## Producer (required)
|
|
128
143
|
|
|
@@ -138,8 +153,7 @@ deadlock; \`harness validate\` / \`harness doctor\` warn about this.
|
|
|
138
153
|
|
|
139
154
|
## Effect
|
|
140
155
|
|
|
141
|
-
|
|
142
|
-
harness-managed settings:
|
|
156
|
+
${wiringSentence}
|
|
143
157
|
|
|
144
158
|
1. \`completion-gate\` (\`${COMPLETION_BLOCKER_COMMAND}\`): denies the
|
|
145
159
|
completion verbs unless a READY verdict exists at the CURRENT git HEAD.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solution-acceptance.js","sourceRoot":"","sources":["../../../src/policy-packs/builtin/solution-acceptance.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,oEAAoE;AACpE,wEAAwE;AACxE,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6EAA6E;AAC7E,oEAAoE;AACpE,uEAAuE;AACvE,wEA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G,gBAAgB,cAAc;YACvC,KAAK,EAAE,YAAY;YACnB,KAAK,EAAE,eAAe;YACtB,OAAO,EAAE,IAAI,CAAC,0BAA0B,CAAC;YACzC,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,IAAI;YACf,WAAW,EACT,2QAA2Q;SAC9Q;KACF,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CACxB,IAAgB,EAChB,KAAwB,EACxB,OAAgB;IAEhB,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACnD,OAAO,kBAAkB,SAAS;;;;;;;;;EASlC,OAAO
|
|
1
|
+
{"version":3,"file":"solution-acceptance.js","sourceRoot":"","sources":["../../../src/policy-packs/builtin/solution-acceptance.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,EAAE;AACF,2EAA2E;AAC3E,yEAAyE;AACzE,oEAAoE;AACpE,wEAAwE;AACxE,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6EAA6E;AAC7E,oEAAoE;AACpE,uEAAuE;AACvE,wEAAwE;AACxE,0EAA0E;AAC1E,4DAA4D;AAC5D,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,yEAAyE;AACzE,6EAA6E;AAC7E,6EAA6E;AAC7E,2EAA2E;AAC3E,wEAAwE;AACxE,wEAAwE;AACxE,4EAA4E;AAC5E,EAAE;AACF,oEAAoE;AACpE,0EAA0E;AAC1E,0EAA0E;AAC1E,2EAA2E;AAC3E,EAAE;AACF,sDAAsD;AACtD,4EAA4E;AAC5E,sEAAsE;AACtE,4EAA4E;AAC5E,2EAA2E;AAC3E,wEAAwE;AACxE,mBAAmB;AAEnB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAgB,MAAM,eAAe,CAAC;AAE9D,OAAO,EACL,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
/**
|
|
4
|
+
* Hook-side: write the active claim file. Atomic. Called from the
|
|
5
|
+
* track-active-claim PostToolUse hook on `task_start`. The body is
|
|
6
|
+
* just the taskId (no JSON) so an operator running
|
|
7
|
+
* `cat ~/.claude/harness.generated/active-claim` sees the id directly.
|
|
8
|
+
*/
|
|
9
|
+
export declare function writeActiveClaim(generatedDir: string, taskId: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Operator-side: read the active claim file. Returns the taskId or
|
|
12
|
+
* null when the file is absent / unreadable / empty. `harness approve
|
|
13
|
+
* understanding` calls this when --task is absent, then passes the
|
|
14
|
+
* resolved id to writeTaskApprovalMarker.
|
|
15
|
+
*
|
|
16
|
+
* Defense-in-depth: if the on-disk content fails the same
|
|
17
|
+
* path-traversal / newline check that gates writes, the read returns
|
|
18
|
+
* null instead of surfacing a poisoned id. The write side guards
|
|
19
|
+
* against a malformed taskId reaching the file in the first place,
|
|
20
|
+
* but a stale file authored before this guard (or hand-edited)
|
|
21
|
+
* shouldn't escalate into a forged task-marker write downstream.
|
|
22
|
+
*/
|
|
23
|
+
export declare function readActiveClaim(generatedDir: string): string | null;
|
|
24
|
+
/** Hook-side: remove the active claim file. Idempotent. */
|
|
25
|
+
export declare function clearActiveClaim(generatedDir: string): void;
|