@lannguyensi/harness 0.50.0 → 0.52.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +247 -0
  2. package/dist/cli/approve/understanding.d.ts +97 -0
  3. package/dist/cli/approve/understanding.js +67 -24
  4. package/dist/cli/approve/understanding.js.map +1 -1
  5. package/dist/cli/audit.d.ts +29 -0
  6. package/dist/cli/audit.js +130 -17
  7. package/dist/cli/audit.js.map +1 -1
  8. package/dist/cli/delegate/index.d.ts +63 -0
  9. package/dist/cli/delegate/index.js +313 -0
  10. package/dist/cli/delegate/index.js.map +1 -0
  11. package/dist/cli/doctor/auto-approve-mode.d.ts +37 -0
  12. package/dist/cli/doctor/auto-approve-mode.js +80 -0
  13. package/dist/cli/doctor/auto-approve-mode.js.map +1 -0
  14. package/dist/cli/doctor/claude-mcp.d.ts +14 -0
  15. package/dist/cli/doctor/claude-mcp.js +7 -1
  16. package/dist/cli/doctor/claude-mcp.js.map +1 -1
  17. package/dist/cli/doctor/codex-config-drift.d.ts +28 -0
  18. package/dist/cli/doctor/codex-config-drift.js +240 -0
  19. package/dist/cli/doctor/codex-config-drift.js.map +1 -0
  20. package/dist/cli/doctor/format.js +67 -1
  21. package/dist/cli/doctor/format.js.map +1 -1
  22. package/dist/cli/doctor/index.d.ts +20 -0
  23. package/dist/cli/doctor/index.js +84 -1
  24. package/dist/cli/doctor/index.js.map +1 -1
  25. package/dist/cli/doctor/settings-drift.d.ts +25 -0
  26. package/dist/cli/doctor/settings-drift.js +203 -0
  27. package/dist/cli/doctor/settings-drift.js.map +1 -0
  28. package/dist/cli/doctor/types.d.ts +69 -0
  29. package/dist/cli/doctor/types.js.map +1 -1
  30. package/dist/cli/doctor/ug-auto-approvals.d.ts +40 -0
  31. package/dist/cli/doctor/ug-auto-approvals.js +116 -0
  32. package/dist/cli/doctor/ug-auto-approvals.js.map +1 -0
  33. package/dist/cli/doctor/ug-delegations.d.ts +26 -0
  34. package/dist/cli/doctor/ug-delegations.js +112 -0
  35. package/dist/cli/doctor/ug-delegations.js.map +1 -0
  36. package/dist/cli/doctor/understanding-mode-env.d.ts +12 -0
  37. package/dist/cli/doctor/understanding-mode-env.js +16 -1
  38. package/dist/cli/doctor/understanding-mode-env.js.map +1 -1
  39. package/dist/cli/index.js +100 -1
  40. package/dist/cli/index.js.map +1 -1
  41. package/dist/cli/pack/approve-escape.js +16 -7
  42. package/dist/cli/pack/approve-escape.js.map +1 -1
  43. package/dist/cli/pack/auto-approve-path.d.ts +135 -0
  44. package/dist/cli/pack/auto-approve-path.js +400 -0
  45. package/dist/cli/pack/auto-approve-path.js.map +1 -0
  46. package/dist/cli/pack/hook-codex-pre-tool-use.d.ts +9 -0
  47. package/dist/cli/pack/hook-codex-pre-tool-use.js +118 -4
  48. package/dist/cli/pack/hook-codex-pre-tool-use.js.map +1 -1
  49. package/dist/cli/pack/hook-pre-tool-use.d.ts +36 -0
  50. package/dist/cli/pack/hook-pre-tool-use.js +402 -3
  51. package/dist/cli/pack/hook-pre-tool-use.js.map +1 -1
  52. package/dist/cli/pack/transcript-report-scan.d.ts +71 -0
  53. package/dist/cli/pack/transcript-report-scan.js +359 -0
  54. package/dist/cli/pack/transcript-report-scan.js.map +1 -0
  55. package/dist/cli/smoke/index.d.ts +18 -1
  56. package/dist/cli/smoke/index.js +54 -0
  57. package/dist/cli/smoke/index.js.map +1 -1
  58. package/dist/cli/validate/checks.js +81 -0
  59. package/dist/cli/validate/checks.js.map +1 -1
  60. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.d.ts +210 -0
  61. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js +361 -0
  62. package/dist/policy-packs/builtin/understanding-before-execution/auto-approve.js.map +1 -0
  63. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.d.ts +223 -0
  64. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js +633 -0
  65. package/dist/policy-packs/builtin/understanding-before-execution/delegation-markers.js.map +1 -0
  66. package/dist/policy-packs/builtin/understanding-before-execution/index.d.ts +3 -1
  67. package/dist/policy-packs/builtin/understanding-before-execution/index.js +10 -1
  68. package/dist/policy-packs/builtin/understanding-before-execution/index.js.map +1 -1
  69. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.d.ts +29 -0
  70. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js +82 -0
  71. package/dist/policy-packs/builtin/understanding-before-execution/measured-permission-modes.js.map +1 -0
  72. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.d.ts +23 -0
  73. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js +29 -0
  74. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js.map +1 -1
  75. package/dist/policy-packs/builtin/understanding-before-execution.d.ts +42 -0
  76. package/dist/policy-packs/builtin/understanding-before-execution.js +56 -1
  77. package/dist/policy-packs/builtin/understanding-before-execution.js.map +1 -1
  78. package/dist/runtime/approval-signing.d.ts +22 -0
  79. package/dist/runtime/approval-signing.js +83 -1
  80. package/dist/runtime/approval-signing.js.map +1 -1
  81. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,253 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.52.0] - 2026-08-28
11
+
12
+ ### Added
13
+
14
+ - **Understanding gate: `harness delegate`, a signed pre-authorization for headless `claude -p` children, slice 3 of the auto-mode-approval ADR**
15
+ (agent-tasks `37ad0b05`, `docs/decisions/2026-08-27-ug-auto-mode-approval.md`,
16
+ "`claude -p` delegation"). `harness delegate --child-session <uuid>
17
+ (--cwd <path> | --task <id>) [--ttl <duration>] [--report <path>]
18
+ [--session-id <parent>]` issues a signed delegation for a `-p` child,
19
+ bound to an already-approved PARENT session, refusing when the parent
20
+ carries no valid marker or when the delegation binds neither a cwd nor
21
+ a task. The delegation is written to its own directory,
22
+ `harness.generated/.delegations/<child-sid>`, never `.approvals/`,
23
+ signed under markerId `delegation-<child-sid>` with every binding
24
+ (parent session, hashed cwd, task, expiry, and, in the fallback shape,
25
+ the launcher-supplied report's path and content hash) packed into the
26
+ signed `approvedBy` string; a dedicated verifier checks the signature,
27
+ the parsed bindings, expiry, and cwd/task match before the child's own
28
+ PreToolUse hook will mint anything, and every refusal is a distinct
29
+ diagnostic, never a fall-through to allow. The audit-only ledger fact
30
+ `understanding-delegated:<child-sid>:<parent-sid>` is written
31
+ alongside it.
32
+ - **Child report capture under `-p`.** A report the child emits before
33
+ its first tool call is not yet in the session transcript at the
34
+ instant the hook fires; the new `auto_approve.report_scan.max_wait`
35
+ config key bounds a fail-closed poll for it (default `2s`, a
36
+ measured value derived from the observed `-p` latency distribution;
37
+ see `docs/okf/understanding-gate-auto-mode-signals.md` for the
38
+ derivation), with block-and-retry as the behaviour past the bound
39
+ rather than an alternative to it. The default was retuned from an
40
+ initial 500ms after end-to-end dogfood runs against a real
41
+ full-length report (see the evidence doc's "Chosen
42
+ `report_scan.max_wait` default" section for why). The child's own
43
+ PreToolUse hook,
44
+ on a valid delegation, runs this scan, persists the report bound to
45
+ the child's session id, and only then mints the child's own
46
+ auto-marker with `approvedBy` carrying the parent linkage.
47
+ - **Once-per-session report adoption.** The scan accepts the report
48
+ under any heading level (`#` through `######`), matching the schema
49
+ hint the child is given rather than pinning one, and each transcript
50
+ entry a report is captured from is spent at most once per session:
51
+ its id is recorded, one per line, in its own directory
52
+ `harness.generated/.delegation-adoptions/<child-sid>`, a sibling of
53
+ `.delegations/` rather than nested inside it, so `harness doctor`'s
54
+ delegations-on-disk metric (which counts every regular file directly
55
+ under `.delegations/`) never miscounts it. Without this rule an
56
+ expired auto-marker would re-mint itself from the same transcript
57
+ entry, silently handing the delegation's longer TTL to the approval.
58
+ The minted marker's `approvedBy` on this path always carries the
59
+ neutral `delegated` mode literal, never the payload's raw
60
+ `permission_mode`, so a doctor listing never buckets it under a mode
61
+ that played no part in the decision.
62
+ - **The harness smoke runner is the first consumer.** `harness smoke`
63
+ now issues a delegation for the session id it already chooses,
64
+ bound to the cwd the child actually spawns into, before every run;
65
+ a refusal prints one line and the run proceeds exactly as before
66
+ slice 3, and `--no-delegate` opts a launcher back into the
67
+ pre-slice-3 shape entirely.
68
+ - **`harness doctor`** gains a `delegations on disk: <count> (<count>
69
+ expired, <count> unreadable)` line in the understanding-gate
70
+ section, counted from `.delegations/` only (never `.approvals/`),
71
+ informational unless it finds an unreadable file.
72
+ - **The `--report` fallback shape is issued and signature-verifiable
73
+ but not yet consumed by the child hook**: a delegation that binds a
74
+ launcher-supplied report is refused (`report_path_mismatch`) rather
75
+ than checked against it, since the hook never passes
76
+ `launcherReportPath` to the verifier; wiring it in is a named
77
+ follow-up, and the transcript-scan channel above is what this
78
+ release actually acts on.
79
+ - **`harness doctor`: warn when `auto_approve` is configured without
80
+ `mode: grill_me`** (agent-tasks `abfad738`, follow-up of the ADR
81
+ `docs/decisions/2026-08-27-ug-auto-mode-approval.md` slice 1). The
82
+ auto-approval path's report precondition reuses
83
+ `validatePersistedReport`, which only enforces the report's `mode`
84
+ field when it is `grill_me`. Outside that mode, report validation is
85
+ structural only. `harness doctor` now prints one advisory `⚠` line,
86
+ in `harness doctor`'s `Environment` section, when the
87
+ `understanding-before-execution` pack is declared and enabled, its
88
+ `config.auto_approve` parses as a valid opt-in block, and the
89
+ RESOLVED effective mode (`resolveModeFromConfig`, same GENERATION-path
90
+ resolver `checkUnderstandingModeEnvDivergence` uses) is not
91
+ `grill_me`. A missing or unrecognised `config.mode` resolves to the
92
+ `grill_me` default and never fires this warning, since that is the
93
+ mode the generated Stop-hook command actually passes at runtime. A
94
+ session-level `UNDERSTANDING_GATE_MODE` env override is a separate gap
95
+ covered by the existing mode/env divergence advisory, not by this
96
+ check. Always advisory (rolls into `warningCount`, never
97
+ `errorCount`); surfaced in `--json` as `ugAutoApproveMode`. New module
98
+ `src/cli/doctor/auto-approve-mode.ts`.
99
+ - **`harness audit` now shows understanding-gate approval facts** (agent-tasks
100
+ `5ad63b01`, follow-up of slice 1 of the ADR
101
+ `docs/decisions/2026-08-27-ug-auto-mode-approval.md`, "Audit and doctor").
102
+ A new `approvals` section, alongside the unchanged `policy_decision` table,
103
+ lists the raw ledger facts `understanding-approved:<sid>` (plain or
104
+ `:forced:<field>`-suffixed) and `understanding-auto-approved:<sid>` within
105
+ the audited `--since` window, each with timestamp, tag and source (tag
106
+ and source are flattened and length-capped before rendering, so an
107
+ embedded newline in untrusted ledger content can't split one row into
108
+ two). A second server-side ledger fetch narrows by `contentPrefix:
109
+ "understanding-"` when the connected grounding-mcp supports it; matching
110
+ is by exact tag (built from the same `approvedLedgerTagFor` /
111
+ `autoApprovedLedgerTagFor` helpers the two writers use), so an unrelated
112
+ ledger row that merely contains one of these strings (for example a
113
+ `review:<n>:approved` fact) cannot slip in. Filtered by `--since` and
114
+ `--session` only; `--policy` / `--outcome` stay policy-decision-only.
115
+ Empty section is omitted in text output; `--json` always carries an
116
+ `approvals` array plus the resolved `sessionId`. A degraded approvals-only
117
+ fetch degrades softly rather than discarding the already-fetched decisions
118
+ table: text gets one `approvals unavailable: <reason>` line, `--json` gets
119
+ `approvalsUnavailable` (with `approvals: []`), and the audit-only posture
120
+ gets one stderr line; exit code stays tied to the policy-decision fetch.
121
+ `src/cli/audit.ts`, `src/cli/index.ts`, `tests/cli/audit.test.ts`.
122
+ - **`harness doctor` warns on a live Codex `approval_policy = "never"` or
123
+ full-access `default_permissions` selection** (agent-tasks `f59ea0eb`,
124
+ follow-up of slice 2 of the ADR
125
+ `docs/decisions/2026-08-27-ug-auto-mode-approval.md`). Either config
126
+ key in `$CODEX_HOME/config.toml` or `<repo>/.codex/config.toml`
127
+ pre-sets the trusted `permission_mode` signal the Codex `auto_approve`
128
+ path consumes. `approval_policy = "never"` is the measured signal
129
+ (`dogfood/ug-auto-mode-signals/README.md`, section (l)); the
130
+ full-access `default_permissions` check is a threat-model heuristic on
131
+ a key the operator can set, not a measured signal (section (k) shows
132
+ it does not move `permission_mode` under `codex exec`). Codex
133
+ counterpart of the existing `permissions.defaultMode` settings-drift
134
+ warning for Claude Code. Gated on `auto_approve.harnesses` listing
135
+ `codex`, so a repo that never opted Codex into the auto path sees no
136
+ line. Warning only, never an enforcement; new module
137
+ `src/cli/doctor/codex-config-drift.ts`.
138
+
139
+ ### Security
140
+
141
+ - **The honest trust model in `src/runtime/approval-signing.ts` names the delegation as a third signed artifact kind and `harness delegate` as a second CLI writer**
142
+ (agent-tasks `37ad0b05`), beside the approval / branch-protection
143
+ markers and the `harness approve` verbs: same key, same HMAC
144
+ primitive, its own markerId namespace (`delegation-<child-sid>`), and
145
+ a different meaning for `reportContentHash` on that artifact kind (the
146
+ launcher-supplied report file, not a persisted one) that a reader must
147
+ branch on.
148
+
149
+ ## [0.51.0] - 2026-08-27
150
+
151
+ ### Added
152
+
153
+ - **Understanding gate: operator opt-in auto-approval for allowlisted
154
+ permission modes** (agent-tasks `74b4b17d`, slice 1 of the ADR
155
+ `docs/decisions/2026-08-27-ug-auto-mode-approval.md`). A new strict
156
+ pack-config block `auto_approve: { when: [...], require_report: true }`
157
+ (`require_report: false`, unknown keys and an empty `when` are
158
+ `harness validate` errors) lets the `understanding-before-execution`
159
+ PreToolUse hook write the signed SESSION approval marker itself, with
160
+ `approvedBy: auto-mode:claude-code:<mode>`, as the last step of its
161
+ decision order: only after the ordinary marker check, the read-only
162
+ Bash exemption, the recovery commit and the escape `ask` have each
163
+ declined, and only when the payload's `permission_mode` is in `when`,
164
+ the payload `session_id` equals the hook's `$CLAUDE_CODE_SESSION_ID`,
165
+ the signing key already exists (the hook never creates one), no forged
166
+ marker was seen, and the newest report bound to the session is exactly
167
+ `pending` and passes the approve CLI's own validation. The report is
168
+ consumed (flipped to `approved`, so one report mints at most once), the
169
+ audit-only ledger fact `understanding-auto-approved:<sid>` is recorded,
170
+ the `.pending-approval` staging entry is cleared, and the verdict comes
171
+ from re-running the same marker check. Every missing input fails
172
+ closed to today's block; the hook's fail-open infrastructure contract
173
+ is unchanged. New module `src/cli/pack/auto-approve-path.ts`,
174
+ `signingKeyExists` (non-creating) in `src/runtime/approval-signing.ts`,
175
+ `selectNewestStrictSessionReport` (no tolerant fallback, newest strict
176
+ match only) in `persisted-reports.ts`; `validatePersistedReport` and
177
+ `rewriteReportApproved` are exported from the approve CLI and reused,
178
+ not copied. Pinned by the ADR's negative controls and mutation probes
179
+ in `tests/cli/pack-hook-pre-tool-use-auto-approve.test.ts`.
180
+ - **Understanding gate: the opt-in auto-approval path now runs on Codex
181
+ too, closing parity gap 13** (agent-tasks `57058364`, slice 2 of the
182
+ ADR `docs/decisions/2026-08-27-ug-auto-mode-approval.md`; commits
183
+ `cd6a37e`, `9e4ef7b`, `2635ce1`, `3c71b05`, `ab58d84`). `attemptAutoApproval`
184
+ (`src/cli/pack/auto-approve-path.ts`) becomes runtime-agnostic: the
185
+ caller names the harness for the minted marker's
186
+ `approvedBy: auto-mode:<harness>:<mode>` and supplies which
187
+ session-consistency evidence its runtime actually offers: an env
188
+ variable for Claude Code (unchanged) or, for Codex, the payload
189
+ `transcript_path` (Codex exports no session-id environment variable to
190
+ hook processes, measured live), and that check passes only when the
191
+ transcript file's own name carries the session id and the file exists
192
+ on disk. `harness pack hook codex-pre-tool-use` now runs this same
193
+ attempt at the same point in its decision order as the Claude hook,
194
+ after the read-only Bash and recovery-commit exemptions, before
195
+ `.pending-approval` staging (allow only via the marker recheck); it reads
196
+ `permission_mode` and `transcript_path` from the payload and resolves
197
+ tool arguments through the shared `tool_input`/`raw_input` precedence
198
+ (`tool_input` preferred) so the real Codex payload reaches the
199
+ read-only and recovery-commit exemptions too. The block gains an
200
+ explicit `harnesses` list (`claude-code`, `codex`; default Claude Code
201
+ only), so an existing Claude-only opt-in never extends to Codex without
202
+ naming it, and the Codex exemption call site fails closed on a
203
+ `tool_input`/`raw_input` pair that disagrees. A registry of measured
204
+ `(harness, permission_mode, fixture)` triples
205
+ (`src/policy-packs/builtin/understanding-before-execution/measured-permission-modes.ts`)
206
+ ships inside the package; a new `harness validate` check
207
+ (`checkUnderstandingBeforeExecutionAutoApproveMeasured` in
208
+ `src/cli/validate/checks.ts`) errors on any `auto_approve.when` literal
209
+ that no harness was measured emitting, and a sync test binds the
210
+ registry to the checked-in dogfood fixtures in both directions. New
211
+ dogfood capture scripts (`codex-capture.sh`,
212
+ `codex-interactive-capture.sh`) and fixtures under
213
+ `dogfood/ug-auto-mode-signals/payloads/` back the registry; see
214
+ `docs/okf/understanding-gate-auto-mode-signals.md` for the measured
215
+ Codex `permission_mode` vocabulary. A separate opencode probe
216
+ (`dogfood/ug-auto-mode-signals/opencode/`) found no hook-level
217
+ observability of its `--auto` flag in the probed version, so opencode
218
+ stays out of scope for auto-approval; see the same okf doc. 33 new
219
+ Codex hook tests in
220
+ `tests/cli/pack-hook-codex-pre-tool-use-auto-approve.test.ts`.
221
+ - **Dogfood: interactive `bypassPermissions` and subagent hook-payload
222
+ captures** (agent-tasks `74b4b17d`): `dogfood/ug-auto-mode-signals/`
223
+ gains `interactive-capture.sh`, `interactive-ask-probe.sh` and
224
+ `subagent-capture.sh` with redacted fixtures; results and the closed
225
+ "unverified" items are recorded in
226
+ `docs/okf/understanding-gate-auto-mode-signals.md`. A hook
227
+ `permissionDecision: "ask"` in an interactive `bypassPermissions`
228
+ session surfaces a real operator prompt (no auto-allow), so the ADR's
229
+ conditional escape-path `deny` branch is not needed for that mode.
230
+ - **`harness doctor`: auto-approval visibility and settings-drift warnings**
231
+ (agent-tasks `74b4b17d`, the ADR's Option B visibility half). The
232
+ understanding-gate section lists the auto approvals found in
233
+ `harness.generated/.approvals/` by `approvedBy` prefix with the metric
234
+ "auto approvals in the last N sessions" (N default 20, `--recent-sessions
235
+ <n>`), and warns about a `permissions.defaultMode` or a hook entry in
236
+ `.claude/settings.json`, `.claude/settings.local.json` or the user
237
+ settings file that was absent at the last `harness apply` (compared
238
+ against the `.last-apply` snapshot; a file that was never an apply
239
+ target uses an empty baseline). Warnings only, no enforcement. The
240
+ listing runs when the `understanding-before-execution` pack is declared
241
+ and enabled; the drift check additionally requires that `harness apply`
242
+ has run at least once (`harness.generated/` exists).
243
+
244
+ ### Security
245
+
246
+ - **The honest trust model in `src/runtime/approval-signing.ts` names the
247
+ hook as a second marker-minting route** (agent-tasks `74b4b17d`): with
248
+ `auto_approve` opted in, the forgery residual is a disjunction (read
249
+ the key, or make the hook sign for you) rather than the previous
250
+ conjunction. Reach is post-approval only (invoking the hook is a gated
251
+ Bash call before approval), so this is not an escalation over the
252
+ existing post-approval write class; it is named rather than argued
253
+ away. The Codex hook did not run the auto path in this slice; slice 2
254
+ (`57058364`, entry above) wires it and closes
255
+ `docs/okf/codex-adapter-parity-gaps.md` gap 13.
256
+
10
257
  ## [0.50.0] - 2026-08-27
11
258
 
12
259
  ### Security
@@ -1,3 +1,4 @@
1
+ import { type ModeConfigSource } from "../../policy-packs/builtin/understanding-before-execution.js";
1
2
  import type { Manifest } from "../../schema/index.js";
2
3
  import { type LoaderOptions } from "../loader.js";
3
4
  import { type StdinReportOutcome } from "./stdin-report.js";
@@ -203,6 +204,51 @@ export interface ApproveUnderstandingResult {
203
204
  skipped: true;
204
205
  };
205
206
  }
207
+ /** Best-effort manifest load plus the resolved `understanding-before-execution` pack config entry it feeds. */
208
+ export interface DeclaredUnderstandingPack {
209
+ /** `null` when the manifest could not be loaded; the caller degrades gracefully rather than treating this as fatal. */
210
+ manifest: Manifest | null;
211
+ /** The load failure's message, when `manifest` is `null`. `null` on a clean load. */
212
+ manifestLoadError: string | null;
213
+ /**
214
+ * The pack's own declared entry when present and not explicitly
215
+ * `enabled: false`; otherwise a synthesized empty entry (`config: {}`)
216
+ * so a caller's `resolveMode` / `approval_lifecycle` read still resolves
217
+ * via Env > default instead of needing a null check.
218
+ */
219
+ declaredPack: ModeConfigSource;
220
+ }
221
+ /**
222
+ * Load the manifest (best-effort, never throws) and resolve the
223
+ * `understanding-before-execution` pack's declared config entry from it.
224
+ * Extracted (agent-tasks 37ad0b05) so
225
+ * `approveUnderstanding` and `issueDelegation` (`src/cli/delegate/index.ts`)
226
+ * share one copy of this manifest-load-plus-pack-lookup shape instead of
227
+ * each carrying its own byte-identical block
228
+ * (`npm run check:duplication` was flagging the pair as a clone). Pure
229
+ * extraction: the try/catch and the `declaredPack` fallback are unchanged
230
+ * from what each call site did inline before this change.
231
+ */
232
+ export declare function loadDeclaredUnderstandingPack(opts: LoaderOptions & {
233
+ manifest?: Manifest;
234
+ }): DeclaredUnderstandingPack;
235
+ /**
236
+ * Exported (agent-tasks 37ad0b05, Slice 3 of the auto-mode-approval ADR)
237
+ * with an additive `source` parameter so `harness delegate` can reuse
238
+ * this writer verbatim instead of re-implementing the same
239
+ * findGroundingMcp + addLedgerFact shape a third time in this codebase
240
+ * (branch-protection.ts already carries its own independent copy for
241
+ * its own `harness-approve-branch-protection` source). `source` defaults
242
+ * to this file's own literal, so `approveUnderstanding`'s own call below
243
+ * (which does not pass it) is byte-identical to before this change: pure
244
+ * additive parameterization, not a behaviour change for that caller.
245
+ */
246
+ export declare function writeLedgerTag(manifest: Manifest, sessionId: string, content: string, opts: ApproveUnderstandingOptions, source?: string): Promise<{
247
+ ok: true;
248
+ } | {
249
+ ok: false;
250
+ reason: string;
251
+ }>;
206
252
  export interface ParseErrorSummary {
207
253
  filePath: string;
208
254
  /** One-line human-readable summary suitable for inlining in the CLI reason. */
@@ -269,6 +315,57 @@ export declare function findLatestParseError(dir: string, sessionId: string): Pa
269
315
  * operator-facing and matches the parse-error log verbatim.
270
316
  */
271
317
  export declare function renderMalformedSectionsNotice(sections: string[]): string | null;
318
+ /**
319
+ * Approve-time content validation. v1 enforces the one rule the dogfood
320
+ * loop discovered today (2026-05-24): a `grill_me` Report must declare a
321
+ * non-empty `priorArt` list with no literal `- None`. The structural
322
+ * parser in `@lannguyensi/understanding-gate` intentionally stays loose
323
+ * here (`CHANGELOG.md:18` documents the design: the prompt is the
324
+ * contract, the parser is structural). The approve CLI is the right
325
+ * boundary to flip that loose acceptance into hard refusal, so an agent
326
+ * cannot ship a hollow Understanding Report and still get the gate open.
327
+ *
328
+ * Modes that skip validation:
329
+ * - `fast_confirm`: schema-relaxed variant (`UNDERSTANDING_REPORT_SCHEMA_FAST_CONFIRM`)
330
+ * drops priorArt from `required`, on purpose: fast_confirm is for
331
+ * low-stakes prompts where the gate barely fires.
332
+ * - missing/unknown mode: legacy reports pre-date the mode field;
333
+ * enforcing on them would retroactively invalidate every historical
334
+ * report.
335
+ *
336
+ * v1 limits the enforced list to `priorArt` because that is the
337
+ * concrete failure observed in dogfood. Broader schema enforcement
338
+ * (e.g. empty `derivedTodos`) is a follow-up if the same class of
339
+ * "agent skipped a required section" failure recurs.
340
+ */
341
+ export type ValidationResult = {
342
+ ok: true;
343
+ mode: string | null;
344
+ } | {
345
+ ok: false;
346
+ field: string;
347
+ reason: string;
348
+ };
349
+ /**
350
+ * Exported (agent-tasks/74b4b17d) so the PreToolUse hook's auto-approval
351
+ * path applies the SAME approve-time content validation this CLI does,
352
+ * rather than a second, drifting copy: the ADR
353
+ * (docs/decisions/2026-08-27-ug-auto-mode-approval.md, Option A
354
+ * condition 3) requires the auto path's report precondition to be the
355
+ * approve CLI's own check. Export only; the logic is unchanged.
356
+ */
357
+ export declare function validatePersistedReport(parsed: Record<string, unknown>): ValidationResult;
358
+ /**
359
+ * Exported (agent-tasks/74b4b17d) so the PreToolUse hook's auto-approval
360
+ * path CONSUMES the report it used through the identical rewrite this
361
+ * CLI performs (ADR Option A condition 5: consumption plus the
362
+ * `pending`-only eligibility rule is what makes one report mintable at
363
+ * most once). Export only; the logic is unchanged.
364
+ */
365
+ export declare function rewriteReportApproved(filePath: string, approvedAt: string, approvedBy: string, sessionId: string): {
366
+ previousStatus: string | null;
367
+ sessionIdStamped: boolean;
368
+ };
272
369
  /**
273
370
  * Normalise a list of task ids supplied via `opts.tasks` (or the CLI's
274
371
  * variadic `--task`). Each entry is comma-split (so `--task a,b` and
@@ -52,7 +52,41 @@ function expandHomePath(p) {
52
52
  return path.join(process.env.HOME ?? os.homedir(), p.slice(2));
53
53
  return p;
54
54
  }
55
- async function writeLedgerTag(manifest, sessionId, content, opts) {
55
+ /**
56
+ * Load the manifest (best-effort, never throws) and resolve the
57
+ * `understanding-before-execution` pack's declared config entry from it.
58
+ * Extracted (agent-tasks 37ad0b05) so
59
+ * `approveUnderstanding` and `issueDelegation` (`src/cli/delegate/index.ts`)
60
+ * share one copy of this manifest-load-plus-pack-lookup shape instead of
61
+ * each carrying its own byte-identical block
62
+ * (`npm run check:duplication` was flagging the pair as a clone). Pure
63
+ * extraction: the try/catch and the `declaredPack` fallback are unchanged
64
+ * from what each call site did inline before this change.
65
+ */
66
+ export function loadDeclaredUnderstandingPack(opts) {
67
+ let manifest = null;
68
+ let manifestLoadError = null;
69
+ try {
70
+ manifest = opts.manifest ?? loadManifest(opts).manifest;
71
+ }
72
+ catch (err) {
73
+ manifestLoadError = err instanceof Error ? err.message : String(err);
74
+ }
75
+ const declaredPack = manifest?.policy_packs.find((p) => p.name === UNDERSTANDING_PACK_NAME && p.enabled !== false) ?? { name: UNDERSTANDING_PACK_NAME, config: {} };
76
+ return { manifest, manifestLoadError, declaredPack };
77
+ }
78
+ /**
79
+ * Exported (agent-tasks 37ad0b05, Slice 3 of the auto-mode-approval ADR)
80
+ * with an additive `source` parameter so `harness delegate` can reuse
81
+ * this writer verbatim instead of re-implementing the same
82
+ * findGroundingMcp + addLedgerFact shape a third time in this codebase
83
+ * (branch-protection.ts already carries its own independent copy for
84
+ * its own `harness-approve-branch-protection` source). `source` defaults
85
+ * to this file's own literal, so `approveUnderstanding`'s own call below
86
+ * (which does not pass it) is byte-identical to before this change: pure
87
+ * additive parameterization, not a behaviour change for that caller.
88
+ */
89
+ export async function writeLedgerTag(manifest, sessionId, content, opts, source = "harness-approve-understanding") {
56
90
  if (opts.ledgerAdd)
57
91
  return opts.ledgerAdd(sessionId, content);
58
92
  const server = findGroundingMcp(manifest);
@@ -68,7 +102,7 @@ async function writeLedgerTag(manifest, sessionId, content, opts) {
68
102
  timeoutMs: server.health?.timeout_ms ?? 5_000,
69
103
  sessionId,
70
104
  content,
71
- source: "harness-approve-understanding",
105
+ source,
72
106
  });
73
107
  }
74
108
  /**
@@ -207,7 +241,15 @@ export function renderMalformedSectionsNotice(sections) {
207
241
  return (`Your previous Understanding Report attempt had malformed sections ` +
208
242
  `(present but not a markdown list): ${named}.`);
209
243
  }
210
- function validatePersistedReport(parsed) {
244
+ /**
245
+ * Exported (agent-tasks/74b4b17d) so the PreToolUse hook's auto-approval
246
+ * path applies the SAME approve-time content validation this CLI does,
247
+ * rather than a second, drifting copy: the ADR
248
+ * (docs/decisions/2026-08-27-ug-auto-mode-approval.md, Option A
249
+ * condition 3) requires the auto path's report precondition to be the
250
+ * approve CLI's own check. Export only; the logic is unchanged.
251
+ */
252
+ export function validatePersistedReport(parsed) {
211
253
  const mode = typeof parsed["mode"] === "string" ? parsed["mode"] : null;
212
254
  if (mode !== "grill_me")
213
255
  return { ok: true, mode };
@@ -249,7 +291,14 @@ function validatePersistedReport(parsed) {
249
291
  }
250
292
  return { ok: true, mode };
251
293
  }
252
- function rewriteReportApproved(filePath, approvedAt, approvedBy, sessionId) {
294
+ /**
295
+ * Exported (agent-tasks/74b4b17d) so the PreToolUse hook's auto-approval
296
+ * path CONSUMES the report it used through the identical rewrite this
297
+ * CLI performs (ADR Option A condition 5: consumption plus the
298
+ * `pending`-only eligibility rule is what makes one report mintable at
299
+ * most once). Export only; the logic is unchanged.
300
+ */
301
+ export function rewriteReportApproved(filePath, approvedAt, approvedBy, sessionId) {
253
302
  const raw = fs.readFileSync(filePath, "utf8");
254
303
  const parsed = JSON.parse(raw);
255
304
  const previousStatus = typeof parsed["approvalStatus"] === "string" ? parsed["approvalStatus"] : null;
@@ -414,29 +463,23 @@ export async function approveUnderstanding(opts = {}) {
414
463
  }
415
464
  // Manifest is required for the ledger write path; if it can't load,
416
465
  // we still try to flip the persisted report so a solo user benefits.
417
- let manifest = null;
418
- let manifestLoadError = null;
419
- try {
420
- manifest = opts.manifest ?? loadManifest(opts).manifest;
421
- }
422
- catch (err) {
423
- // Not blocking: a solo user still benefits from the report flip below
424
- // even with no manifest. But capture the cause so the degraded-ok
425
- // ledger result names WHY the write was skipped instead of leaving the
426
- // operator with a bare `ledger: ok false` (no-silent-errors, M8).
427
- manifestLoadError = err instanceof Error ? err.message : String(err);
428
- }
466
+ // Not blocking: a solo user still benefits from the report flip below
467
+ // even with no manifest. `manifestLoadError` captures the cause so the
468
+ // degraded-ok ledger result names WHY the write was skipped instead of
469
+ // leaving the operator with a bare `ledger: ok false` (no-silent-errors,
470
+ // M8).
429
471
  // Gap-fill mode for a stdin report that declares none of its own
430
472
  // (harness task 5d73d78d): resolve via `resolveMode` (Env >
431
473
  // config.mode > DEFAULT_MODE — this IS a live runtime consumer, unlike
432
474
  // `resolve()`/`buildHooks`'s generation path; see `MODE_ENV`'s doc
433
475
  // comment in understanding-before-execution.ts for why the two differ),
434
- // from whatever manifest is available, so a report captured via this
435
- // path is validated against the operator's actually-configured mode
436
- // instead of a hardcoded "fast_confirm" regardless of harness.yaml. A
437
- // missing manifest, or a manifest without the pack declared, resolves
438
- // the same as an empty `config:` block — resolveMode still applies
439
- // Env > DEFAULT_MODE in that case.
476
+ // from whatever manifest is available (`loadDeclaredUnderstandingPack`
477
+ // above), so a report captured via this path is validated against the
478
+ // operator's actually-configured mode instead of a hardcoded
479
+ // "fast_confirm" regardless of harness.yaml. A missing manifest, or a
480
+ // manifest without the pack declared, resolves the same as an empty
481
+ // `config:` block, resolveMode still applies Env > DEFAULT_MODE in
482
+ // that case.
440
483
  //
441
484
  // A pack entry that IS declared but `enabled: false` is treated the
442
485
  // SAME as undeclared (task 5d73d78d review LOW-10): a disabled pack's
@@ -445,8 +488,8 @@ export async function approveUnderstanding(opts = {}) {
445
488
  // fallback only needs `name` + `config` (resolveMode's minimal
446
489
  // `ModeConfigSource` shape) — `source`/`enabled` would otherwise have
447
490
  // to be invented for a pack entry that, by construction, was never
448
- // matched.
449
- const declaredPack = manifest?.policy_packs.find((p) => p.name === UNDERSTANDING_PACK_NAME && p.enabled !== false) ?? { name: UNDERSTANDING_PACK_NAME, config: {} };
491
+ // matched. `loadDeclaredUnderstandingPack` applies that same rule.
492
+ const { manifest, manifestLoadError, declaredPack } = loadDeclaredUnderstandingPack(opts);
450
493
  // Task 5d73d78d review LOW (fix-round-3): `resolveMode`'s own warning
451
494
  // (an invalid `config.mode` or `UNDERSTANDING_GATE_MODE` value) used to
452
495
  // be dropped on the floor here — only `.mode` was read. The Codex
@@ -1 +1 @@
1
- {"version":3,"file":"understanding.js","sourceRoot":"","sources":["../../../src/cli/approve/understanding.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,4CAA4C;AAC5C,yCAAyC;AACzC,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,mDAAmD;AACnD,uEAAuE;AACvE,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,qEAAqE;AACrE,oEAAoE;AAEpE,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,4BAA4B,EAC5B,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,sEAAsE,CAAC;AAC9E,OAAO,EAEL,SAAS,IAAI,uBAAuB,EACpC,WAAW,EACX,aAAa,GACd,MAAM,8DAA8D,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EACL,oBAAoB,EACpB,mBAAm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;IACtE,uEAAuE;IACvE,sEAAsE;IACtE,IAAI,aAAa,KAAK,kBAAkB,IAAI,YAAY,CAAC,EAAE,EAAE,CAAC;QAC5D,oBAAoB,CAAC,YAAY,CAAC,CAAC;IACrC,CAAC;IAED,OAAO;QACL,SAAS;QACT,aAAa;QACb,GAAG,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,GAAG,CAAC,cAAc,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnF,MAAM,EAAE,YAAY;QACpB,WAAW;QACX,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM,EAAE,YAAY,CAAC,EAAE;YACrB,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;YACnB,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE;QACnD,eAAe;QACf,UAAU;KACX,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"understanding.js","sourceRoot":"","sources":["../../../src/cli/approve/understanding.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,EAAE;AACF,4CAA4C;AAC5C,yCAAyC;AACzC,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,mDAAmD;AACnD,uEAAuE;AACvE,oEAAoE;AACpE,EAAE;AACF,uEAAuE;AACvE,uEAAuE;AACvE,qEAAqE;AACrE,oEAAoE;AAEpE,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO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AW;QACX,GAAG,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,MAAM,EAAE,YAAY,CAAC,EAAE;YACrB,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE;YACnB,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE;QACnD,eAAe;QACf,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -27,6 +27,14 @@ export interface AuditOptions extends LoaderOptions {
27
27
  }) => Promise<LedgerQueryResult>;
28
28
  /** Override "now" (tests). */
29
29
  now?: Date;
30
+ /**
31
+ * Sink for the audit-only "approvals unavailable" notice (M4: a degraded
32
+ * second fetch degrades softly rather than discarding the already-fetched
33
+ * decisions table). Defaults to `process.stderr.write`, matching the
34
+ * one-stderr-line posture `src/cli/pack/auto-approve-path.ts` uses for its
35
+ * own audit-only ledger writes.
36
+ */
37
+ stderr?: (s: string) => void;
30
38
  }
31
39
  export interface AuditDecisionRow {
32
40
  timestamp: string;
@@ -44,8 +52,29 @@ export interface AuditDecisionRow {
44
52
  */
45
53
  whenUnclassifiedFallback?: boolean;
46
54
  }
55
+ /**
56
+ * One raw understanding-gate ledger fact in the audit window: a
57
+ * `understanding-approved:<sid>` (human approval, plain or
58
+ * `:forced:<field>`-suffixed) or `understanding-auto-approved:<sid>`
59
+ * (auto-mode) row, exactly as the two writers stamp it
60
+ * (`src/cli/approve/understanding.ts`, `src/cli/pack/auto-approve-path.ts`).
61
+ * Read-only reporting: this section carries no gate authority, mirroring
62
+ * the ledger's audit-only status for both tag families.
63
+ */
64
+ export interface AuditApprovalRow {
65
+ timestamp: string;
66
+ tag: string;
67
+ source: string;
68
+ }
47
69
  export interface AuditResult {
48
70
  output: string;
49
71
  decisions: AuditDecisionRow[];
72
+ approvals: AuditApprovalRow[];
73
+ /**
74
+ * M4: set when the approvals fetch (only) came back degraded. The
75
+ * decisions table still renders; this carries the reason so `--json`
76
+ * consumers can tell "no approval facts" apart from "couldn't check".
77
+ */
78
+ approvalsUnavailable?: string;
50
79
  }
51
80
  export declare function audit(opts?: AuditOptions): Promise<AuditResult>;