@lannguyensi/harness 0.43.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 +1248 -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 +34 -13
- 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 +62 -7
- 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 +136 -24
- 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 +44 -26
- 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 +538 -79
- 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-runtime.d.ts +90 -10
- package/dist/policy-packs/builtin/post-merge-gate-runtime.js +112 -16
- package/dist/policy-packs/builtin/post-merge-gate-runtime.js.map +1 -1
- package/dist/policy-packs/builtin/post-merge-gate.js +84 -31
- package/dist/policy-packs/builtin/post-merge-gate.js.map +1 -1
- package/dist/policy-packs/builtin/solution-acceptance-runtime.d.ts +152 -8
- package/dist/policy-packs/builtin/solution-acceptance-runtime.js +260 -13
- 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 +429 -4
- package/dist/runtime/command-normalize.js +1146 -67
- 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 +247 -4
- package/dist/runtime/intercept.js +553 -61
- 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 +356 -26
- package/dist/runtime/read-only-bash.js.map +1 -1
- package/dist/runtime/shell-word.d.ts +21 -0
- package/dist/runtime/shell-word.js +242 -0
- package/dist/runtime/shell-word.js.map +1 -0
- 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 +5 -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
|
@@ -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
|
|
@@ -65,8 +95,21 @@ export const DEFAULT_PROTECTED_COMPLETION_TOOLS = [
|
|
|
65
95
|
* load-bearing choke points; hardening this is follow-up `7207d8f9`.
|
|
66
96
|
* Tolerates a leading `cd … &&`, inline `VAR=val` assignments, and `git -C
|
|
67
97
|
* <path> push`.
|
|
98
|
+
*
|
|
99
|
+
* Task 76671e5a: bare `&` added to the boundary alternation (`&&` kept to
|
|
100
|
+
* its left only to mirror `src/runtime/command-normalize.ts`'s alternation
|
|
101
|
+
* order for readability — NOT because order is load-bearing here, unlike
|
|
102
|
+
* that module). Same fix as `d834a065` applied to every policy trigger —
|
|
103
|
+
* bash starts a new command after a single `&`, so `A=x&git push` used to
|
|
104
|
+
* slip past this DENY matcher entirely. Broadening is the stricter direction
|
|
105
|
+
* here (this gates completion actions, it is not an allow-list). Measured:
|
|
106
|
+
* swapping to `&|&&` produces a byte-identical match set for this matcher
|
|
107
|
+
* (a `RegExp.test` existential check over every start offset, not a
|
|
108
|
+
* segmenter — the reasoning that makes order matter in
|
|
109
|
+
* `command-normalize.ts`'s `BOUNDARY_RE`/`AMP_BOUNDARY_RE` does not transfer
|
|
110
|
+
* to a plain `.test()` matcher like this one).
|
|
68
111
|
*/
|
|
69
|
-
export const DEFAULT_PUSH_BASH_RE = /(?:^|\n
|
|
112
|
+
export const DEFAULT_PUSH_BASH_RE = /(?:^|\n|;|\||&&|&|\()\s*(?:\w+=\S+\s+)*(?:git(?:\s+-C\s+\S+)?\s+push|gh\s+pr\s+merge)\b/;
|
|
70
113
|
/**
|
|
71
114
|
* Resolve the completion verbs the gate fires on: the pack's
|
|
72
115
|
* `config.protected_completion_tools` override, else the default set.
|
|
@@ -83,6 +126,99 @@ export function resolveProtectedCompletionTools(pack) {
|
|
|
83
126
|
}
|
|
84
127
|
return [...DEFAULT_PROTECTED_COMPLETION_TOOLS];
|
|
85
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
|
+
}
|
|
86
222
|
/** Env knob that overrides the verdict directory (mirrors the producer). */
|
|
87
223
|
export const VERDICT_DIR_ENV = "SOLUTION_VERDICT_DIR";
|
|
88
224
|
/**
|
|
@@ -194,26 +330,133 @@ export function readVerdict(dir, id) {
|
|
|
194
330
|
blockers: Array.isArray(parsed.blockers) ? parsed.blockers : [],
|
|
195
331
|
timestamp: typeof parsed.timestamp === "string" ? parsed.timestamp : "",
|
|
196
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,
|
|
197
339
|
};
|
|
198
340
|
}
|
|
199
341
|
catch {
|
|
200
342
|
return null;
|
|
201
343
|
}
|
|
202
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";
|
|
203
365
|
/**
|
|
204
|
-
* Evaluate the gate for `id` at `currentHead`.
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
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.
|
|
210
399
|
*/
|
|
211
|
-
export function evaluateGate(verdict, currentHead, id) {
|
|
400
|
+
export function evaluateGate(verdict, currentHead, id, generatedDir) {
|
|
212
401
|
if (!verdict) {
|
|
213
402
|
return {
|
|
214
403
|
allowed: false,
|
|
215
404
|
reason: `no solution-acceptance verdict recorded for "${id}" (run mcp__grounding-mcp__solution_evaluate first)`,
|
|
216
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,
|
|
217
460
|
};
|
|
218
461
|
}
|
|
219
462
|
if (!verdict.ready) {
|
|
@@ -222,6 +465,7 @@ export function evaluateGate(verdict, currentHead, id) {
|
|
|
222
465
|
allowed: false,
|
|
223
466
|
reason: `solution-acceptance verdict for "${id}" is not ready${why} (fix, then re-run solution_evaluate)`,
|
|
224
467
|
verdict,
|
|
468
|
+
forged: false,
|
|
225
469
|
};
|
|
226
470
|
}
|
|
227
471
|
if (!currentHead) {
|
|
@@ -229,6 +473,7 @@ export function evaluateGate(verdict, currentHead, id) {
|
|
|
229
473
|
allowed: false,
|
|
230
474
|
reason: `cannot resolve the current git HEAD to confirm the verdict for "${id}" is at HEAD`,
|
|
231
475
|
verdict,
|
|
476
|
+
forged: false,
|
|
232
477
|
};
|
|
233
478
|
}
|
|
234
479
|
if (verdict.head !== currentHead) {
|
|
@@ -236,12 +481,14 @@ export function evaluateGate(verdict, currentHead, id) {
|
|
|
236
481
|
allowed: false,
|
|
237
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)`,
|
|
238
483
|
verdict,
|
|
484
|
+
forged: false,
|
|
239
485
|
};
|
|
240
486
|
}
|
|
241
487
|
return {
|
|
242
488
|
allowed: true,
|
|
243
489
|
reason: `solution-acceptance verdict for "${id}" is ready at HEAD ${currentHead.slice(0, 7)} (confidence ${Math.round(verdict.confidence * 100)}%)`,
|
|
244
490
|
verdict,
|
|
491
|
+
forged: false,
|
|
245
492
|
};
|
|
246
493
|
}
|
|
247
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;A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Ae,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,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,gCAAgC;AAChC,EAAE;AACF,2EAA2E;AAC3E,qEAAqE;AACrE,8DAA8D;AAC9D,2EAA2E;AAC3E,4EAA4E;AAC5E,wEAAwE;AACxE,yEAAyE;AACzE,0EAA0E;AAC1E,EAAE;AACF,4EAA4E;AAC5E,sEAAsE;AACtE,yEAAyE;AACzE,yEAAyE;AACzE,qEAAqE;AACrE,sEAAsE;AACtE,sEAAsE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AE,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,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,SAAS,EACT,+B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AC;IACjE,OAAO,QAAQ,GAAG,EAAE,CAAC;AACvB,CAAC;AAED,SAAS,UAAU,CACjB,OAAgB,EAChB,KAAwB,EACxB,OAA2B,EAAE;IAE7B,MAAM,eAAe,GACnB,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,uBAAuB,CAAC;IACzE,0EAA0E;IAC1E,yEAAyE;IACzE,6EAA6E;IAC7E,oCAAoC;IACpC,MAAM,IAAI,GAAG,CAAC,GAAW,EAAU,EAAE,CACnC,2BAA2B,CAAC,GAAG,EAAE,IAAI,CAAC,kBAAkB,CAAC,CAAC;IAC5D,OAAO;QACL;YACE,IAAI,EAAE,GAAG,gBAAgB,kBAAkB;YAC3C,KAAK,EAAE,YAAY;YACnB,KAAK,EAAE,eAAe,CAAC,OAAO,EAAE,KAAK,CAAC;YACtC,OAAO,EAAE,IAAI,CAAC,0BAA0B,CAAC;YACzC,QAAQ,EAAE,MAAM;YAChB,SAAS,EAAE,IAAI;YACf,WAAW,EACT,4LAA4L;SAC/L;QACD;YACE,IAAI,EAAE,GAAG,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,yEAAy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AAC,CAAC,CAAC,EAAE;;YAEtD,SAAS;eACN,OAAO;CACrB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,OAAO,CACrB,IAAgB,EAChB,UAAmB,eAAe,EAClC,OAA2B,EAAE;IAE7B,MAAM,KAAK,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC/C,MAAM,KAAK,GAA2B;QACpC;YACE,YAAY,EAAE,gBAAgB,SAAS,kBAAkB;YACzD,OAAO,EAAE,iBAAiB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC;SACjD;KACF,CAAC;IACF,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const ACTIVE_CLAIM_FILENAME = "active-claim";
|
|
2
|
+
export declare function activeClaimPathFor(generatedDir: string): string;
|
|
3
|
+
/**
|
|
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;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Active-claim tracking (harness/494fd1e5), split out of the former
|
|
2
|
+
// monolithic understanding-before-execution-runtime.ts (structural
|
|
3
|
+
// concentration slice 2, agent-tasks 348a4d42). Pure move: see
|
|
4
|
+
// src/policy-packs/builtin/understanding-before-execution/index.ts for
|
|
5
|
+
// the re-exported public surface.
|
|
6
|
+
import * as fs from "node:fs";
|
|
7
|
+
import * as path from "node:path";
|
|
8
|
+
import { atomicWriteFile } from "../../../io/atomic-write.js";
|
|
9
|
+
// Active-claim tracking (harness/494fd1e5). When the agent calls
|
|
10
|
+
// `mcp__agent-tasks__task_start`, a PostToolUse hook writes the claimed
|
|
11
|
+
// task id to a stable file. `harness approve understanding` reads it
|
|
12
|
+
// when --task is absent and auto-supplies it as the task-scoped marker
|
|
13
|
+
// target. This closes the v1 ergonomics gap from PR #184 where the
|
|
14
|
+
// operator had to type the taskId by hand.
|
|
15
|
+
//
|
|
16
|
+
// File contract: a single line containing just the taskId. No JSON,
|
|
17
|
+
// no metadata. Operators can `cat` it to debug. The post-tool-use
|
|
18
|
+
// hook on task_finish / task_abandon removes the file.
|
|
19
|
+
export const ACTIVE_CLAIM_FILENAME = "active-claim";
|
|
20
|
+
export function activeClaimPathFor(generatedDir) {
|
|
21
|
+
return path.join(generatedDir, ACTIVE_CLAIM_FILENAME);
|
|
22
|
+
}
|
|
23
|
+
function rejectMalformedClaimId(taskId) {
|
|
24
|
+
if (taskId.length === 0) {
|
|
25
|
+
throw new Error("taskId is empty");
|
|
26
|
+
}
|
|
27
|
+
if (taskId.includes("\n") ||
|
|
28
|
+
taskId.includes("\r") ||
|
|
29
|
+
taskId.includes("/") ||
|
|
30
|
+
taskId.includes("\\") ||
|
|
31
|
+
taskId.includes("..")) {
|
|
32
|
+
throw new Error(`taskId contains forbidden characters (newline / path-separator / traversal): ${JSON.stringify(taskId)}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Hook-side: write the active claim file. Atomic. Called from the
|
|
37
|
+
* track-active-claim PostToolUse hook on `task_start`. The body is
|
|
38
|
+
* just the taskId (no JSON) so an operator running
|
|
39
|
+
* `cat ~/.claude/harness.generated/active-claim` sees the id directly.
|
|
40
|
+
*/
|
|
41
|
+
export function writeActiveClaim(generatedDir, taskId) {
|
|
42
|
+
rejectMalformedClaimId(taskId);
|
|
43
|
+
const filePath = activeClaimPathFor(generatedDir);
|
|
44
|
+
atomicWriteFile(filePath, `${taskId}\n`);
|
|
45
|
+
return filePath;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Operator-side: read the active claim file. Returns the taskId or
|
|
49
|
+
* null when the file is absent / unreadable / empty. `harness approve
|
|
50
|
+
* understanding` calls this when --task is absent, then passes the
|
|
51
|
+
* resolved id to writeTaskApprovalMarker.
|
|
52
|
+
*
|
|
53
|
+
* Defense-in-depth: if the on-disk content fails the same
|
|
54
|
+
* path-traversal / newline check that gates writes, the read returns
|
|
55
|
+
* null instead of surfacing a poisoned id. The write side guards
|
|
56
|
+
* against a malformed taskId reaching the file in the first place,
|
|
57
|
+
* but a stale file authored before this guard (or hand-edited)
|
|
58
|
+
* shouldn't escalate into a forged task-marker write downstream.
|
|
59
|
+
*/
|
|
60
|
+
export function readActiveClaim(generatedDir) {
|
|
61
|
+
const filePath = activeClaimPathFor(generatedDir);
|
|
62
|
+
let raw;
|
|
63
|
+
try {
|
|
64
|
+
raw = fs.readFileSync(filePath, "utf8");
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
const trimmed = raw.trim();
|
|
70
|
+
if (trimmed.length === 0)
|
|
71
|
+
return null;
|
|
72
|
+
try {
|
|
73
|
+
rejectMalformedClaimId(trimmed);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
return trimmed;
|
|
79
|
+
}
|
|
80
|
+
/** Hook-side: remove the active claim file. Idempotent. */
|
|
81
|
+
export function clearActiveClaim(generatedDir) {
|
|
82
|
+
try {
|
|
83
|
+
fs.rmSync(activeClaimPathFor(generatedDir));
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
/* already gone */
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=active-claim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active-claim.js","sourceRoot":"","sources":["../../../../src/policy-packs/builtin/understanding-before-execution/active-claim.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,mEAAmE;AACnE,+DAA+D;AAC/D,uEAAuE;AACvE,kCAAkC;AAElC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,iEAAiE;AACjE,wEAAwE;AACxE,qEAAqE;AACrE,uEAAuE;AACvE,mEAAmE;AACnE,2CAA2C;AAC3C,EAAE;AACF,oEAAoE;AACpE,kEAAkE;AAClE,uDAAuD;AAEvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,cAAc,CAAC;AAEpD,MAAM,UAAU,kBAAkB,CAAC,YAAoB;IACrD,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,qBAAqB,CAAC,CAAC;AACxD,CAAC;AAED,SAAS,sBAAsB,CAAC,MAAc;IAC5C,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC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BAAgB,CAAC,YAAoB;IACnD,IAAI,CAAC;QACH,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,CAAC;IAC9C,CAAC;IAAC,MAAM,CAAC;QACP,kBAAkB;IACpB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type ApprovalSource = "marker" | "ledger" | "persisted-report" | "none" | "recovery-commit";
|
|
2
|
+
export interface ApprovalCheckResult {
|
|
3
|
+
approved: boolean;
|
|
4
|
+
source: ApprovalSource;
|
|
5
|
+
detail: string;
|
|
6
|
+
}
|
|
7
|
+
export { APPROVED_LEDGER_TAG_PREFIX, approvedLedgerTagFor, isPolicyDecisionRow, matchLedgerEntries, } from "./ledger.js";
|
|
8
|
+
export { APPROVAL_MARKER_DIRNAME, approvalMarkerPathFor, type ApprovalMarker, writeApprovalMarker, type MarkerCheck, type CheckApprovalMarkerOptions, checkApprovalMarker, clearApprovalMarker, } from "./markers.js";
|
|
9
|
+
export { type PersistedReport, REPORTS_DIR_ENV, defaultReportsDir, reportsDirForManifest, listPersistedReports, TOLERANT_FALLBACK_MAX_AGE_MS, TOLERANT_FALLBACK_FUTURE_SKEW_MS, type FindReportOptions, type FindReportSelection, selectReportForSession, findLatestReportForSession, type PersistedReportApprovalCheck, expirePersistedReport, checkPersistedReport, } from "./persisted-reports.js";
|
|
10
|
+
export { type ApprovalLifecycle, parseApprovalLifecycle } from "./lifecycle.js";
|
|
11
|
+
export { APPROVAL_MARKER_TASK_PREFIX, taskApprovalMarkerPathFor, writeTaskApprovalMarker, checkActiveClaimApprovalMarker, type OperatorMarkerApproval, checkOperatorApprovalMarkers, clearTaskApprovalMarker, } from "./task-markers.js";
|
|
12
|
+
export { DEFAULT_BASH_TOOL_NAMES, toolNameMatchesAny, bashCommandMatchesAny, extractBashCommandFromToolInput, extractTaskIdFromToolInput, extractTasksTransitionStatusFromToolInput, type PostToolUseBoundaryMatch, matchPostToolUseBoundary, type ApplyPostToolUseExpiryResult, applyPostToolUseExpiry, describePostToolUseExpiry, } from "./post-tool-use-boundary.js";
|
|
13
|
+
export { ACTIVE_CLAIM_FILENAME, activeClaimPathFor, writeActiveClaim, readActiveClaim, clearActiveClaim, } from "./active-claim.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// Phase 6 #4 — runtime helpers for the understanding-before-execution pack.
|
|
2
|
+
//
|
|
3
|
+
// Two-source approval check that the harness-side PreToolUse blocker
|
|
4
|
+
// consults:
|
|
5
|
+
//
|
|
6
|
+
// 1. Filesystem marker `<generatedDir>/.approvals/<sessionId>` written
|
|
7
|
+
// by `harness approve understanding` from the operator's shell.
|
|
8
|
+
// Canonical for harnessed sessions. Replaces the ledger-substring
|
|
9
|
+
// check that shipped through v0.13.0 (agent-tasks/88ca4bb3): the
|
|
10
|
+
// agent has direct MCP access to the same ledger that gate path
|
|
11
|
+
// consulted, so any agent could write `understanding-approved:<sid>`
|
|
12
|
+
// itself and self-approve. Edit / Write / Bash are all gated by
|
|
13
|
+
// this same PreToolUse hook, and the configured MCP servers do not
|
|
14
|
+
// expose filesystem writes, so the marker file is reachable only
|
|
15
|
+
// from a process the operator launched (their `!`-shell or any
|
|
16
|
+
// other un-hooked terminal). Operator-side: writeApprovalMarker
|
|
17
|
+
// below. Forensics: the ledger row is still written by
|
|
18
|
+
// `harness approve understanding`, for audit only.
|
|
19
|
+
// 2. Persisted JSON report under `.understanding-gate/reports/`
|
|
20
|
+
// (canonical for solo `@lannguyensi/understanding-gate` users).
|
|
21
|
+
// The package writes one file per session; the latest with
|
|
22
|
+
// `approvalStatus: "approved"` matching the session_id wins. The
|
|
23
|
+
// report is flipped to "approved" by `harness approve`; the
|
|
24
|
+
// agent's Stop hook only writes `pending` reports and cannot flip
|
|
25
|
+
// them (Edit/Write/Bash gated), so this source is also operator-
|
|
26
|
+
// authored.
|
|
27
|
+
//
|
|
28
|
+
// Either source approves. The persisted-report fallback is what makes a
|
|
29
|
+
// solo user without grounding-mcp wired still able to approve via the
|
|
30
|
+
// package's CLI; the marker path is what makes a harnessed session see
|
|
31
|
+
// the approval immediately on the next tool call.
|
|
32
|
+
export { APPROVED_LEDGER_TAG_PREFIX, approvedLedgerTagFor, isPolicyDecisionRow, matchLedgerEntries, } from "./ledger.js";
|
|
33
|
+
export { APPROVAL_MARKER_DIRNAME, approvalMarkerPathFor, writeApprovalMarker, checkApprovalMarker, clearApprovalMarker, } from "./markers.js";
|
|
34
|
+
export { REPORTS_DIR_ENV, defaultReportsDir, reportsDirForManifest, listPersistedReports, TOLERANT_FALLBACK_MAX_AGE_MS, TOLERANT_FALLBACK_FUTURE_SKEW_MS, selectReportForSession, findLatestReportForSession, expirePersistedReport, checkPersistedReport, } from "./persisted-reports.js";
|
|
35
|
+
export { parseApprovalLifecycle } from "./lifecycle.js";
|
|
36
|
+
export { APPROVAL_MARKER_TASK_PREFIX, taskApprovalMarkerPathFor, writeTaskApprovalMarker, checkActiveClaimApprovalMarker, checkOperatorApprovalMarkers, clearTaskApprovalMarker, } from "./task-markers.js";
|
|
37
|
+
export { DEFAULT_BASH_TOOL_NAMES, toolNameMatchesAny, bashCommandMatchesAny, extractBashCommandFromToolInput, extractTaskIdFromToolInput, extractTasksTransitionStatusFromToolInput, matchPostToolUseBoundary, applyPostToolUseExpiry, describePostToolUseExpiry, } from "./post-tool-use-boundary.js";
|
|
38
|
+
export { ACTIVE_CLAIM_FILENAME, activeClaimPathFor, writeActiveClaim, readActiveClaim, clearActiveClaim, } from "./active-claim.js";
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/policy-packs/builtin/understanding-before-execution/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,qEAAqE;AACrE,YAAY;AACZ,EAAE;AACF,yEAAyE;AACzE,qEAAqE;AACrE,uEAAuE;AACvE,sEAAsE;AACtE,qEAAqE;AACrE,0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