@lannguyensi/harness 0.59.1 → 0.60.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 (88) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/README.md +1 -1
  3. package/dist/cli/apply/apply.d.ts +20 -0
  4. package/dist/cli/apply/apply.js +13 -7
  5. package/dist/cli/apply/apply.js.map +1 -1
  6. package/dist/cli/apply/install-codex-config.d.ts +113 -2
  7. package/dist/cli/apply/install-codex-config.js +651 -69
  8. package/dist/cli/apply/install-codex-config.js.map +1 -1
  9. package/dist/cli/approve/understanding.js +34 -28
  10. package/dist/cli/approve/understanding.js.map +1 -1
  11. package/dist/cli/doctor/format.js +22 -0
  12. package/dist/cli/doctor/format.js.map +1 -1
  13. package/dist/cli/doctor/index.js +60 -31
  14. package/dist/cli/doctor/index.js.map +1 -1
  15. package/dist/cli/doctor/types.d.ts +17 -0
  16. package/dist/cli/dry-run.js +7 -0
  17. package/dist/cli/dry-run.js.map +1 -1
  18. package/dist/cli/index.js +46 -144
  19. package/dist/cli/index.js.map +1 -1
  20. package/dist/cli/pack/auto-approve-path.js +25 -11
  21. package/dist/cli/pack/auto-approve-path.js.map +1 -1
  22. package/dist/cli/pack/hook-codex-post-tool-use.js +2 -2
  23. package/dist/cli/pack/hook-codex-post-tool-use.js.map +1 -1
  24. package/dist/cli/pack/hook-codex-pre-tool-use.js +32 -5
  25. package/dist/cli/pack/hook-codex-pre-tool-use.js.map +1 -1
  26. package/dist/cli/pack/hook-post-merge-gate-record.d.ts +7 -0
  27. package/dist/cli/pack/hook-post-merge-gate-record.js +39 -2
  28. package/dist/cli/pack/hook-post-merge-gate-record.js.map +1 -1
  29. package/dist/cli/pack/hook-post-tool-use.js +2 -2
  30. package/dist/cli/pack/hook-post-tool-use.js.map +1 -1
  31. package/dist/cli/pack/hook-pre-tool-use.js +60 -15
  32. package/dist/cli/pack/hook-pre-tool-use.js.map +1 -1
  33. package/dist/cli/policy/intercept.js +5 -1
  34. package/dist/cli/policy/intercept.js.map +1 -1
  35. package/dist/cli/record/index.d.ts +11 -2
  36. package/dist/cli/record/index.js +18 -5
  37. package/dist/cli/record/index.js.map +1 -1
  38. package/dist/cli/session-start/branch-check.d.ts +3 -29
  39. package/dist/cli/session-start/branch-check.js +7 -37
  40. package/dist/cli/session-start/branch-check.js.map +1 -1
  41. package/dist/cli/session-start/index.d.ts +16 -30
  42. package/dist/cli/session-start/index.js +72 -26
  43. package/dist/cli/session-start/index.js.map +1 -1
  44. package/dist/cli/session-start/shared-options.d.ts +92 -0
  45. package/dist/cli/session-start/shared-options.js +109 -0
  46. package/dist/cli/session-start/shared-options.js.map +1 -0
  47. package/dist/cli/session-start/stale-base-check.d.ts +3 -28
  48. package/dist/cli/session-start/stale-base-check.js +7 -37
  49. package/dist/cli/session-start/stale-base-check.js.map +1 -1
  50. package/dist/cli/session-start/toolchain-parity.d.ts +5 -21
  51. package/dist/cli/session-start/toolchain-parity.js +6 -38
  52. package/dist/cli/session-start/toolchain-parity.js.map +1 -1
  53. package/dist/cli/smoke/index.d.ts +1 -1
  54. package/dist/cli/smoke/index.js +8 -11
  55. package/dist/cli/smoke/index.js.map +1 -1
  56. package/dist/policy-packs/builtin/post-merge-gate-runtime.d.ts +11 -0
  57. package/dist/policy-packs/builtin/post-merge-gate-runtime.js +11 -0
  58. package/dist/policy-packs/builtin/post-merge-gate-runtime.js.map +1 -1
  59. package/dist/policy-packs/builtin/solution-acceptance-runtime.js +1 -1
  60. package/dist/policy-packs/builtin/solution-acceptance-runtime.js.map +1 -1
  61. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.d.ts +36 -0
  62. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js +73 -0
  63. package/dist/policy-packs/builtin/understanding-before-execution/expiry-reason.js.map +1 -0
  64. package/dist/policy-packs/builtin/understanding-before-execution/index.d.ts +3 -2
  65. package/dist/policy-packs/builtin/understanding-before-execution/index.js +5 -2
  66. package/dist/policy-packs/builtin/understanding-before-execution/index.js.map +1 -1
  67. package/dist/policy-packs/builtin/understanding-before-execution/markers.js +1 -0
  68. package/dist/policy-packs/builtin/understanding-before-execution/markers.js.map +1 -1
  69. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.d.ts +205 -1
  70. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js +360 -3
  71. package/dist/policy-packs/builtin/understanding-before-execution/persisted-reports.js.map +1 -1
  72. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.d.ts +1 -1
  73. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js +2 -2
  74. package/dist/policy-packs/builtin/understanding-before-execution/post-tool-use-boundary.js.map +1 -1
  75. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.d.ts +36 -0
  76. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js +50 -0
  77. package/dist/policy-packs/builtin/understanding-before-execution/task-markers.js.map +1 -1
  78. package/dist/runtime/bash-prefix-parse.js +319 -126
  79. package/dist/runtime/bash-prefix-parse.js.map +1 -1
  80. package/dist/runtime/intercept.d.ts +38 -0
  81. package/dist/runtime/intercept.js +224 -5
  82. package/dist/runtime/intercept.js.map +1 -1
  83. package/dist/runtime/read-only-bash.js +11 -1
  84. package/dist/runtime/read-only-bash.js.map +1 -1
  85. package/dist/runtime/shell-word.d.ts +16 -1
  86. package/dist/runtime/shell-word.js +82 -1
  87. package/dist/runtime/shell-word.js.map +1 -1
  88. package/package.json +1 -1
@@ -37,7 +37,7 @@
37
37
  // harness gate; `harness approve understanding` is the approval path.
38
38
  export { APPROVED_LEDGER_TAG_PREFIX, approvedLedgerTagFor, isPolicyDecisionRow, matchLedgerEntries, } from "./ledger.js";
39
39
  export { APPROVAL_MARKER_DIRNAME, approvalMarkerPathFor, writeApprovalMarker, checkApprovalMarker, clearApprovalMarker, } from "./markers.js";
40
- export { REPORTS_DIR_ENV, defaultReportsDir, reportsDirForManifest, listPersistedReports, TOLERANT_FALLBACK_MAX_AGE_MS, TOLERANT_FALLBACK_FUTURE_SKEW_MS, selectReportForSession, selectNewestStrictSessionReport, findLatestReportForSession, expirePersistedReport, checkPersistedReport, } from "./persisted-reports.js";
40
+ export { REPORTS_DIR_ENV, defaultReportsDir, reportsDirForManifest, listPersistedReports, TOLERANT_FALLBACK_MAX_AGE_MS, TOLERANT_FALLBACK_FUTURE_SKEW_MS, selectReportForSession, selectNewestStrictSessionReport, findLatestReportForSession, expirePersistedReport, checkPersistedReport, canonicalReportHash, canonicalReportHashOfFile, MAX_HASHED_REPORT_BYTES, readReportFileBounded, hashReportFile, verifyApprovedReportHash, } from "./persisted-reports.js";
41
41
  export { parseApprovalLifecycle } from "./lifecycle.js";
42
42
  export { AUTO_APPROVED_BY_PREFIX, CLAUDE_CODE_HARNESS, autoApprovedByFor, parseAutoApprovedBy, autoApprovedLedgerTagFor, parseAutoApprove, permissionModeAllowed, harnessAllowed, AUTO_APPROVE_HARNESS_VALUES, DEFAULT_AUTO_APPROVE_HARNESSES, DEFAULT_REPORT_SCAN_MAX_WAIT_MS, REPORT_SCAN_MAX_WAIT_CEILING_MS, parseReportScanMaxWait, } from "./auto-approve.js";
43
43
  // D-004 shipped default (task 8f637efd): the one `auto_approve` snippet
@@ -57,7 +57,7 @@ export { defaultAutoApproveConfig, renderAutoApproveSnippet, } from "./auto-appr
57
57
  // missing-`auto_approve` finding (task 8f637efd), see
58
58
  // permission-mode-observations.ts's module header.
59
59
  export { PERMISSION_MODE_OBSERVATION_DIRNAME, listPermissionModeObservations, permissionModeObservationPathFor, recordPermissionModeObservation, sanitizeForDisplay, } from "./permission-mode-observations.js";
60
- export { APPROVAL_MARKER_TASK_PREFIX, taskApprovalMarkerPathFor, writeTaskApprovalMarker, checkActiveClaimApprovalMarker, checkSessionApprovalMarker, checkOperatorApprovalMarkers, clearTaskApprovalMarker, } from "./task-markers.js";
60
+ export { APPROVAL_MARKER_TASK_PREFIX, taskApprovalMarkerPathFor, writeTaskApprovalMarker, checkActiveClaimApprovalMarker, checkSessionApprovalMarker, checkOperatorApprovalMarkers, verifyMatchedMarkerReport, clearTaskApprovalMarker, } from "./task-markers.js";
61
61
  export { DEFAULT_BASH_TOOL_NAMES, toolNameMatchesAny, bashCommandMatchesAny, extractBashCommandFromToolInput, extractTaskIdFromToolInput, extractTasksTransitionStatusFromToolInput, matchPostToolUseBoundary, applyPostToolUseExpiry, describePostToolUseExpiry, } from "./post-tool-use-boundary.js";
62
62
  export { ACTIVE_CLAIM_FILENAME, activeClaimPathFor, writeActiveClaim, readActiveClaim, clearActiveClaim, } from "./active-claim.js";
63
63
  // Slice 3 of docs/decisions/2026-08-27-ug-auto-mode-approval.md: signed
@@ -77,4 +77,7 @@ export { DELEGATION_MARKER_DIRNAME, ADOPTION_LEDGER_DIRNAME, DELEGATION_REPORT_D
77
77
  // the same reason: later consumers (SubagentStart/SubagentStop hooks,
78
78
  // the PreToolUse blocker) import every sibling gate symbol through it.
79
79
  export { INFLIGHT_RECORD_DIRNAME, DEFAULT_INFLIGHT_STALE_AFTER_MS, rejectMalformedAgentId, inflightMarkerIdFor, inflightRecordPathFor, writeInflightRecord, verifyInflightRecord, clearInflightRecord, listInflightRecords, } from "./inflight-records.js";
80
+ // Wording of the approval-expiry reason in the PreToolUse block message and
81
+ // the event a PostToolUse expiry persists (expiry-reason.ts).
82
+ export { approvalExpiryNotice, describeMarkerTtlExpiry, describePostToolUseTrigger, noApprovalMarkerReason, } from "./expiry-reason.js";
80
83
  //# sourceMappingURL=index.js.map
@@ -1 +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,mEAAmE;AACnE,sEAAsE;AACtE,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,uEAAuE;AACvE,oEAAoE;AACpE,qEAAqE;AACrE,yEAAyE;AACzE,uEAAuE;AACvE,oEAAoE;AAC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index.js","sourceRoot":"","sources":["../../../../src/policy-packs/builtin/understanding-before-execution/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,EAAE;AACF,mEAAmE;AACnE,sEAAsE;AACtE,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,uEAAuE;AACvE,oEAAoE;AACpE,qEAAqE;AACrE,yEAAyE;AACzE,uEAAuE;AACvE,oEAAoE;AACpE,qEAAqE;AACrE,sEAAsE;AACtE,uEAAuE;AACvE,sEAAsE;AACtE,oEAAoE;AACpE,yEAAyE;AACzE,gEAAgE;AAChE,0EAA0E;AAC1E,yEAAyE;AACzE,uEAAuE;AACvE,yEAAyE;AACzE,uEAAuE;AACvE,sEAAsE;AACtE,kEAAkE;AAClE,wEAAwE;AACxE,yDAAyD;AACzD,qEAAqE;AACrE,sEAAsE;AACtE,uEAAuE;AACvE,EAAE;AACF,uEAAuE;AACvE,sEAAsE;AACtE,oEAAoE;AACpE,sEAAsE;AAqBtE,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EAErB,mBAAmB,EAGnB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AAEtB,OAAO,EAEL,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,gCAAgC,EAGhC,sBAAsB,EACtB,+BAA+B,EAC/B,0BAA0B,EAE1B,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EAGvB,qBAAqB,EAGrB,cAAc,EAId,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAA0B,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEhF,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,iBAAiB,EAEjB,mBAAmB,EACnB,wBAAwB,EAExB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AqB,EAIrB,gBAAgB,GACjB,MAAM,yBAAyB,CAAC;AAEjC,gEAAgE;AAChE,uEAAuE;AACvE,qEAAqE;AACrE,wDAAwD;AACxD,sEAAsE;AACtE,qEAAqE;AACrE,sEAAsE;AACtE,uEAAuE;AACvE,OAAO,EACL,uBAAuB,EACvB,+BAA+B,EAC/B,sBAAsB,EACtB,mBAAmB,EACnB,qBAAqB,EAIrB,mBAAmB,EAGnB,oBAAoB,EACpB,mBAAmB,EAEnB,mBAAmB,GACpB,MAAM,uBAAuB,CAAC;AAE/B,4EAA4E;AAC5E,8DAA8D;AAC9D,OAAO,EACL,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,oBAAoB,CAAC"}
@@ -214,6 +214,7 @@ export function checkApprovalMarker(generatedDir, sessionId, opts = {}) {
214
214
  if (ageMs > opts.maxAgeMs) {
215
215
  const ageMin = Math.round(ageMs / 60_000);
216
216
  const maxMin = Math.round(opts.maxAgeMs / 60_000);
217
+ // KEEP IN SYNC: describeMarkerTtlExpiry (expiry-reason.ts) parses this detail.
217
218
  return {
218
219
  matched: false,
219
220
  detail: `approval marker ${path.basename(filePath)} expired: age ${ageMin}m > max ${maxMin}m (approved at ${approvedAt})`,
@@ -1 +1 @@
1
- {"version":3,"file":"markers.js","sourceRoot":"","sources":["../../../../src/policy-packs/builtin/understanding-before-execution/markers.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,6EAA6E;AAC7E,sEAAsE;AACtE,iDAAiD;AACjD,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;AAC9D,OAAO,EAAE,+BAA+B,EAAE,MAAM,kCAAkC,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AACzF,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I,CAAC,QAAQ,CAAC,QAAQ,CAAC,iBAAiB,UAAU,OAAO,UAAU,sBAAsB;QACxH,MAAM;QACN,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,mBAAmB,CAAC,YAAoB,EAAE,SAAiB;IACzE,IAAI,CAAC;QACH,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,kBAAkB;IACpB,CAAC;AACH,CAAC"}
@@ -3,6 +3,15 @@ export interface PersistedReport {
3
3
  sessionId: string | null;
4
4
  approvalStatus: string | null;
5
5
  approvedAt: string | null;
6
+ /**
7
+ * Event a PostToolUse boundary expired this report for
8
+ * (`tool:<tool_name>` or `bash:/<regex>/`), stamped by
9
+ * `expirePersistedReport`; null for a report without the field (older
10
+ * reports, package producers, or a TTL-only lapse).
11
+ */
12
+ expiredBy: string | null;
13
+ /** ISO timestamp `expirePersistedReport` stamped; null when absent. */
14
+ expiredAt: string | null;
6
15
  /**
7
16
  * ISO timestamp the producer stamped when it wrote the report; null
8
17
  * for legacy reports without the field.
@@ -165,6 +174,18 @@ export declare function selectNewestStrictSessionReport(reports: PersistedReport
165
174
  * only need the report (the gate read and expiry paths).
166
175
  */
167
176
  export declare function findLatestReportForSession(reports: PersistedReport[], sessionId: string, opts?: FindReportOptions): PersistedReport | null;
177
+ /**
178
+ * `detail` is not an inert log line: both PreToolUse hooks embed it
179
+ * verbatim into their block `reason`, and the Codex hook additionally
180
+ * writes it to stderr, the block-reason surface an operator reads
181
+ * directly. The report file's basename and its `approvedAt` field both
182
+ * come from a JSON file whose content the gated agent controls (it is
183
+ * only unsigned evidence, task 7402301d), so neither is trusted
184
+ * verbatim here: control characters (including newlines, which could
185
+ * forge extra `reason:`-looking lines) are replaced with a space and
186
+ * the result is capped so one field cannot blow out the surface.
187
+ */
188
+ export declare function sanitizeDetailValue(value: string): string;
168
189
  /**
169
190
  * What the gate learns from the persisted report: EVIDENCE, never
170
191
  * authority (task 7402301d). Until that task the report was the second
@@ -209,7 +230,7 @@ export interface PersistedReportEvidence {
209
230
  * best-effort cleanup so a missing report dir or unrelated I/O issue
210
231
  * does not escalate into a session-breaking hook failure.
211
232
  */
212
- export declare function expirePersistedReport(reportsDir: string, sessionId: string, now?: Date): {
233
+ export declare function expirePersistedReport(reportsDir: string, sessionId: string, now?: Date, trigger?: string): {
213
234
  ok: true;
214
235
  filePath: string;
215
236
  previousStatus: string | null;
@@ -235,3 +256,186 @@ export declare function expirePersistedReport(reportsDir: string, sessionId: str
235
256
  * `understanding-gate approve` CLI, which writes no signed marker).
236
257
  */
237
258
  export declare function checkPersistedReport(reportsDir: string, sessionId: string): PersistedReportEvidence;
259
+ /**
260
+ * `approval expired because <event> at <time>` for a report a PostToolUse
261
+ * boundary expired (`expirePersistedReport` stamps `expiredBy` and
262
+ * `expiredAt`), `undefined` for any other report, including an older one or
263
+ * one a package producer wrote that carries no `expiredBy`. Both values come
264
+ * from a JSON file the gated agent can write, so both pass
265
+ * `sanitizeDetailValue`.
266
+ */
267
+ export declare function describeBoundaryExpiry(report: Pick<PersistedReport, "approvalStatus" | "expiredBy" | "expiredAt">): string | undefined;
268
+ /**
269
+ * Largest report file, in bytes, the canonical hash reads from disk (1 MiB).
270
+ * Every `*.json` entry of the reports directory reaches the hash through the
271
+ * gate-read scan, and the agent can write that directory, so without a bound
272
+ * a planted file of a few hundred megabytes made the hook run out of heap or
273
+ * past its time budget instead of deciding (a hook that dies or overruns is a
274
+ * non-blocking error for the runtime). A real report is a few kilobytes, far
275
+ * below the cap. A file over the cap matches nothing at gate read, and both
276
+ * producers refuse to approve such a report.
277
+ */
278
+ export declare const MAX_HASHED_REPORT_BYTES: number;
279
+ /** Result of {@link walkContainerDepth}. */
280
+ export interface ContainerDepthWalk {
281
+ /** True when some array/object nests deeper than the walk's `max` levels. */
282
+ tooDeep: boolean;
283
+ /** Values the walk took off its stack: the root plus every array/object below it. */
284
+ visited: number;
285
+ }
286
+ /**
287
+ * Iterative walk over the arrays and objects of `value` (the value itself is
288
+ * level 1) that stops at the first one nested deeper than `max` levels.
289
+ * Iterative, so the walk itself cannot overflow the stack. Only arrays and
290
+ * objects are pushed: a scalar child (string, number, boolean, null) cannot
291
+ * nest, so a wide array of scalars costs no stack slot per element, and
292
+ * `visited` counts the root plus the containers below it. Exported for tests.
293
+ */
294
+ export declare function walkContainerDepth(value: unknown, max: number): ContainerDepthWalk;
295
+ /**
296
+ * The hash an approval marker signs as its `reportContentHash`, and the one
297
+ * the gate recomputes at read time (task fa423e9b): sha256 over a key-sorted
298
+ * JSON serialisation of the parsed report with the lifecycle fields in
299
+ * `LIFECYCLE_REPORT_FIELDS` removed. A raw-bytes hash cannot do this job: the
300
+ * producers hash before `rewriteReportApproved` re-serialises the file and
301
+ * `expirePersistedReport` rewrites it again, so the raw bytes of an untouched
302
+ * report never match what the marker signed. One function on purpose, shared
303
+ * by both producers (`harness approve understanding`, the auto-approval path)
304
+ * and the verifier.
305
+ *
306
+ * Total: returns null instead of throwing for a report nested deeper than
307
+ * `MAX_CANONICAL_REPORT_DEPTH`. The verifier counts such a file as one that
308
+ * matches nothing; both producers refuse to approve such a report, so no
309
+ * marker is ever signed without a content binding because of it. Report
310
+ * files reach it only after {@link readReportFileBounded} bounded their type
311
+ * and size (the gate-read scan and `harness approve understanding` through
312
+ * {@link hashReportFile}, the auto-approval path directly).
313
+ */
314
+ export declare function canonicalReportHash(report: Record<string, unknown>): string | null;
315
+ /** Why {@link readReportFileBounded} returned no content. */
316
+ export type ReportFileReadFailure = "unreadable" | "not-regular" | "too-large" | "grew";
317
+ export type BoundedReportRead = {
318
+ ok: true;
319
+ raw: string;
320
+ } | {
321
+ ok: false;
322
+ reason: ReportFileReadFailure;
323
+ detail: string;
324
+ };
325
+ /**
326
+ * Read a report file for hashing, bounded by type and size. This is the one
327
+ * read every canonical report hash goes through: the gate-read scan (via
328
+ * {@link hashReportFile}) and both producers. The path is opened once,
329
+ * read-only and non-blocking (`O_NONBLOCK`: opening a FIFO with no writer
330
+ * returns at once instead of waiting for one); its type and size come from
331
+ * `fstat` on that descriptor, and the content is read through the same
332
+ * descriptor, so nothing can be swapped in between (no separate stat of the
333
+ * path, which a symlink flipped to a FIFO used to race). Refused without
334
+ * reading: anything that is not a regular file, and a file larger than
335
+ * `MAX_HASHED_REPORT_BYTES`. The read stops one byte past the fstat size
336
+ * (never more than the cap plus one byte); a file that grows into that byte
337
+ * while being read is refused too. The descriptor is always closed. Never
338
+ * throws.
339
+ */
340
+ export declare function readReportFileBounded(filePath: string): BoundedReportRead;
341
+ /** Why a report file has no canonical hash. */
342
+ export type UnhashableReportReason = ReportFileReadFailure | "not-json-object" | "too-deep";
343
+ export type ReportFileHash = {
344
+ ok: true;
345
+ hash: string;
346
+ } | {
347
+ ok: false;
348
+ reason: UnhashableReportReason;
349
+ detail: string;
350
+ };
351
+ /**
352
+ * Canonical hash of the report file at `filePath`, read through
353
+ * {@link readReportFileBounded}, or why it has none: not a regular file, over
354
+ * `MAX_HASHED_REPORT_BYTES`, unreadable, grown while read, not a JSON object,
355
+ * or nested too deeply. `harness approve understanding` refuses a report on
356
+ * any of these (the `detail` is its message); the gate-read scan counts such
357
+ * a file as one that matches nothing. Never throws.
358
+ */
359
+ export declare function hashReportFile(filePath: string): ReportFileHash;
360
+ /** Canonical hash of the report file at `filePath` ({@link hashReportFile}); null when it has none. */
361
+ export declare function canonicalReportHashOfFile(filePath: string): string | null;
362
+ /** Marker kind whose signed report hash the gate checks. */
363
+ export type ApprovalMarkerKind = "task" | "session";
364
+ /** One matched marker's signed `reportContentHash`, tagged with its kind. */
365
+ export interface MarkerReportBinding {
366
+ kind: ApprovalMarkerKind;
367
+ reportContentHash: string | null;
368
+ }
369
+ export type ApprovedReportHashVerification = {
370
+ ok: true;
371
+ kind: ApprovalMarkerKind;
372
+ } | {
373
+ ok: false;
374
+ detail: string;
375
+ };
376
+ /**
377
+ * Gate-read cross-check of a matched approval marker against the persisted
378
+ * reports (task fa423e9b). Both PreToolUse hooks call it after
379
+ * `checkOperatorApprovalMarkers` matched, through `verifyMatchedMarkerReport`.
380
+ *
381
+ * Rule: a marker with a non-null signed `reportContentHash` is valid iff at
382
+ * least one parseable report file in `reportsDir` (any session, any
383
+ * `approvalStatus`) has a canonical hash equal to it. The hash already
384
+ * leaves the lifecycle fields out, so approving, expiring or re-approving
385
+ * the report never changes it. The signed hash therefore proves one thing:
386
+ * the content the operator approved is still on disk unmodified. Editing
387
+ * that file (in place, by swap, by symlink, by an unparseable rewrite)
388
+ * removes the only match and the marker stops opening the gate. Comparing
389
+ * against the session's newest approved report instead would deny
390
+ * legitimate approvals (a newer report approved for the same claim, two
391
+ * sessions on one claim) and would let a swap pass by moving the swapped
392
+ * report out of the selection.
393
+ *
394
+ * Bounded input: only a regular file of at most `MAX_HASHED_REPORT_BYTES`
395
+ * (1 MiB) that parses as a JSON object nested at most 64 levels deep has a
396
+ * canonical hash, read through {@link readReportFileBounded} (opened
397
+ * non-blocking, typed and sized by `fstat` on the open descriptor, read
398
+ * through it). Every other `*.json` entry (a FIFO, a directory, a device, a
399
+ * symlink to one of them, a file over the cap, an unreadable, unparseable or
400
+ * too deeply nested file) still counts as a report file but matches nothing,
401
+ * so it can neither open the gate nor make the scan block, run out of
402
+ * memory or die instead of deciding.
403
+ *
404
+ * Residuals: (1) the check proves only that some file carries the approved
405
+ * content. Any regular `*.json` file within the size cap whose content
406
+ * equals it keeps a match, whether it was kept before the edit (a copy) or
407
+ * re-created after it (the agent wrote that content, so it can write it
408
+ * again), and the marker still opens the gate. (2) A reports directory that
409
+ * is empty, unreadable or holds no `*.json` entry at all (every report
410
+ * deleted, the directory made unreadable, the reports renamed) falls back to
411
+ * the "no report file" allow, the same as before this check existed. The
412
+ * marker and the operator's approval itself are untouched in both cases;
413
+ * only the audit trail loses its claim to be the approved content. (3) The
414
+ * cap bounds each file, not their number: the scan time grows with the
415
+ * total volume of report files, so an agent that plants hundreds of
416
+ * megabytes of files just under the cap can still push one scan past the
417
+ * hook's time budget, which the runtime treats as a non-blocking error (the
418
+ * same allow as before this check existed).
419
+ *
420
+ * Removing the approved report while other report files remain is a deny:
421
+ * nothing on disk carries the signed content any more. `harness gc --apply`
422
+ * can do that legitimately: it ages approved reports out by their createdAt
423
+ * but markers by their file mtime, so a report written long before its
424
+ * approval can go while the marker stays. Re-approving recovers.
425
+ *
426
+ * `primary` is the marker that satisfied the gate (task-scoped first),
427
+ * `fallback` a session marker that matched behind a task marker. The
428
+ * fallback is consulted only when the primary fails the check, so a task
429
+ * marker signed for another report does not hide a session marker that
430
+ * verifies. Unchanged behaviour: a null hash on the accepted marker (no
431
+ * report resolved, or `--force` over a report the producer could not hash:
432
+ * too deeply nested or over the size cap) and a reports directory with no
433
+ * `*.json` entry at all both allow. A forced approval of a hashable report
434
+ * signs its hash and is checked like any other.
435
+ *
436
+ * The `detail` is the block reason. It names the failing marker kind and the
437
+ * one-command fix, which is also the single migration step for a marker
438
+ * written before the canonical hash existed. It carries no report-derived
439
+ * value, so nothing in it needs sanitising.
440
+ */
441
+ export declare function verifyApprovedReportHash(reportsDir: string, primary: MarkerReportBinding, fallback?: MarkerReportBinding | null): ApprovedReportHashVerification;