@lannguyensi/harness 0.40.0 → 0.42.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 (189) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +9 -0
  3. package/dist/cli/adopt/derive.d.ts +15 -0
  4. package/dist/cli/adopt/derive.js +34 -7
  5. package/dist/cli/adopt/derive.js.map +1 -1
  6. package/dist/cli/adopt/index.d.ts +30 -0
  7. package/dist/cli/adopt/index.js +23 -3
  8. package/dist/cli/adopt/index.js.map +1 -1
  9. package/dist/cli/apply/generate-settings.d.ts +14 -1
  10. package/dist/cli/apply/generate-settings.js +7 -3
  11. package/dist/cli/apply/generate-settings.js.map +1 -1
  12. package/dist/cli/approve/stdin-report.js +2 -0
  13. package/dist/cli/approve/stdin-report.js.map +1 -1
  14. package/dist/cli/approve/understanding.js +28 -0
  15. package/dist/cli/approve/understanding.js.map +1 -1
  16. package/dist/cli/doctor/claude-mcp.d.ts +50 -0
  17. package/dist/cli/doctor/claude-mcp.js +170 -0
  18. package/dist/cli/doctor/claude-mcp.js.map +1 -0
  19. package/dist/cli/doctor/codex.d.ts +8 -0
  20. package/dist/cli/doctor/codex.js +8 -1
  21. package/dist/cli/doctor/codex.js.map +1 -1
  22. package/dist/cli/doctor/format.js +60 -11
  23. package/dist/cli/doctor/format.js.map +1 -1
  24. package/dist/cli/doctor/index.d.ts +46 -0
  25. package/dist/cli/doctor/index.js +155 -29
  26. package/dist/cli/doctor/index.js.map +1 -1
  27. package/dist/cli/doctor/npm-bin-path.js +42 -0
  28. package/dist/cli/doctor/npm-bin-path.js.map +1 -1
  29. package/dist/cli/doctor/types.d.ts +37 -0
  30. package/dist/cli/doctor/types.js.map +1 -1
  31. package/dist/cli/dry-run.js +5 -0
  32. package/dist/cli/dry-run.js.map +1 -1
  33. package/dist/cli/explain.js +16 -3
  34. package/dist/cli/explain.js.map +1 -1
  35. package/dist/cli/index.js +328 -11
  36. package/dist/cli/index.js.map +1 -1
  37. package/dist/cli/init/agent-tasks-auth.js +32 -0
  38. package/dist/cli/init/agent-tasks-auth.js.map +1 -1
  39. package/dist/cli/init/composer.js +13 -40
  40. package/dist/cli/init/composer.js.map +1 -1
  41. package/dist/cli/init/dependencies.js +21 -0
  42. package/dist/cli/init/dependencies.js.map +1 -1
  43. package/dist/cli/init/detect.d.ts +20 -3
  44. package/dist/cli/init/detect.js +34 -36
  45. package/dist/cli/init/detect.js.map +1 -1
  46. package/dist/cli/init/index.d.ts +18 -0
  47. package/dist/cli/init/index.js +28 -2
  48. package/dist/cli/init/index.js.map +1 -1
  49. package/dist/cli/init/interactive.d.ts +41 -0
  50. package/dist/cli/init/interactive.js +421 -6
  51. package/dist/cli/init/interactive.js.map +1 -1
  52. package/dist/cli/init/profiles.d.ts +2 -2
  53. package/dist/cli/init/profiles.js +10 -1
  54. package/dist/cli/init/profiles.js.map +1 -1
  55. package/dist/cli/init/templates.d.ts +1 -1
  56. package/dist/cli/init/templates.js +217 -8
  57. package/dist/cli/init/templates.js.map +1 -1
  58. package/dist/cli/list.js +3 -1
  59. package/dist/cli/list.js.map +1 -1
  60. package/dist/cli/main.js +10 -0
  61. package/dist/cli/main.js.map +1 -1
  62. package/dist/cli/pack/hook-bootstrap.d.ts +24 -0
  63. package/dist/cli/pack/hook-bootstrap.js +47 -1
  64. package/dist/cli/pack/hook-bootstrap.js.map +1 -1
  65. package/dist/cli/pack/hook-branch-protection.js +9 -1
  66. package/dist/cli/pack/hook-branch-protection.js.map +1 -1
  67. package/dist/cli/pack/hook-codex-post-tool-use.d.ts +25 -0
  68. package/dist/cli/pack/hook-codex-post-tool-use.js +160 -0
  69. package/dist/cli/pack/hook-codex-post-tool-use.js.map +1 -0
  70. package/dist/cli/pack/hook-codex-pre-tool-use.d.ts +1 -0
  71. package/dist/cli/pack/hook-codex-pre-tool-use.js +43 -10
  72. package/dist/cli/pack/hook-codex-pre-tool-use.js.map +1 -1
  73. package/dist/cli/pack/hook-codex-stop.js +1 -8
  74. package/dist/cli/pack/hook-codex-stop.js.map +1 -1
  75. package/dist/cli/pack/hook-post-merge-gate-record.d.ts +30 -0
  76. package/dist/cli/pack/hook-post-merge-gate-record.js +153 -0
  77. package/dist/cli/pack/hook-post-merge-gate-record.js.map +1 -0
  78. package/dist/cli/pack/hook-post-merge-gate.d.ts +28 -0
  79. package/dist/cli/pack/hook-post-merge-gate.js +244 -0
  80. package/dist/cli/pack/hook-post-merge-gate.js.map +1 -0
  81. package/dist/cli/pack/hook-post-tool-use.js +16 -131
  82. package/dist/cli/pack/hook-post-tool-use.js.map +1 -1
  83. package/dist/cli/pack/hook-pre-tool-use.js +54 -2
  84. package/dist/cli/pack/hook-pre-tool-use.js.map +1 -1
  85. package/dist/cli/pack/hook-solution-acceptance-writeguard.js +148 -2
  86. package/dist/cli/pack/hook-solution-acceptance-writeguard.js.map +1 -1
  87. package/dist/cli/pack/hook-stay-in-scope.js +63 -20
  88. package/dist/cli/pack/hook-stay-in-scope.js.map +1 -1
  89. package/dist/cli/pack/hook-track-active-claim.js +33 -9
  90. package/dist/cli/pack/hook-track-active-claim.js.map +1 -1
  91. package/dist/cli/pack/index.d.ts +2 -1
  92. package/dist/cli/pack/index.js +2 -1
  93. package/dist/cli/pack/index.js.map +1 -1
  94. package/dist/cli/pack/mutate.d.ts +19 -0
  95. package/dist/cli/pack/mutate.js +38 -0
  96. package/dist/cli/pack/mutate.js.map +1 -1
  97. package/dist/cli/pack/reseed.d.ts +19 -0
  98. package/dist/cli/pack/reseed.js +118 -0
  99. package/dist/cli/pack/reseed.js.map +1 -0
  100. package/dist/cli/pack/understanding-report-schema-hint.js +1 -1
  101. package/dist/cli/pack/understanding-report-schema-hint.js.map +1 -1
  102. package/dist/cli/pause/index.js +12 -3
  103. package/dist/cli/pause/index.js.map +1 -1
  104. package/dist/cli/record/index.d.ts +64 -0
  105. package/dist/cli/record/index.js +211 -0
  106. package/dist/cli/record/index.js.map +1 -0
  107. package/dist/cli/session-start/index.d.ts +21 -0
  108. package/dist/cli/session-start/index.js +160 -25
  109. package/dist/cli/session-start/index.js.map +1 -1
  110. package/dist/cli/session-start/toolchain-parity.d.ts +149 -0
  111. package/dist/cli/session-start/toolchain-parity.js +618 -0
  112. package/dist/cli/session-start/toolchain-parity.js.map +1 -0
  113. package/dist/cli/uninstall/index.d.ts +73 -1
  114. package/dist/cli/uninstall/index.js +134 -2
  115. package/dist/cli/uninstall/index.js.map +1 -1
  116. package/dist/cli/validate/checks.js +8 -0
  117. package/dist/cli/validate/checks.js.map +1 -1
  118. package/dist/io/claude-mcp.d.ts +258 -0
  119. package/dist/io/claude-mcp.js +544 -0
  120. package/dist/io/claude-mcp.js.map +1 -0
  121. package/dist/policies/ledger-client.d.ts +34 -1
  122. package/dist/policies/ledger-client.js +21 -16
  123. package/dist/policies/ledger-client.js.map +1 -1
  124. package/dist/policy-packs/builtin/branch-protection-runtime.d.ts +4 -2
  125. package/dist/policy-packs/builtin/branch-protection-runtime.js +4 -2
  126. package/dist/policy-packs/builtin/branch-protection-runtime.js.map +1 -1
  127. package/dist/policy-packs/builtin/branch-protection.d.ts +10 -1
  128. package/dist/policy-packs/builtin/branch-protection.js +17 -0
  129. package/dist/policy-packs/builtin/branch-protection.js.map +1 -1
  130. package/dist/policy-packs/builtin/post-merge-gate-runtime.d.ts +195 -0
  131. package/dist/policy-packs/builtin/post-merge-gate-runtime.js +290 -0
  132. package/dist/policy-packs/builtin/post-merge-gate-runtime.js.map +1 -0
  133. package/dist/policy-packs/builtin/post-merge-gate.d.ts +56 -0
  134. package/dist/policy-packs/builtin/post-merge-gate.js +291 -0
  135. package/dist/policy-packs/builtin/post-merge-gate.js.map +1 -0
  136. package/dist/policy-packs/builtin/solution-acceptance-runtime.js +28 -13
  137. package/dist/policy-packs/builtin/solution-acceptance-runtime.js.map +1 -1
  138. package/dist/policy-packs/builtin/understanding-before-execution-runtime.d.ts +197 -24
  139. package/dist/policy-packs/builtin/understanding-before-execution-runtime.js +342 -40
  140. package/dist/policy-packs/builtin/understanding-before-execution-runtime.js.map +1 -1
  141. package/dist/policy-packs/builtin/understanding-before-execution.d.ts +26 -1
  142. package/dist/policy-packs/builtin/understanding-before-execution.js +302 -17
  143. package/dist/policy-packs/builtin/understanding-before-execution.js.map +1 -1
  144. package/dist/policy-packs/registry.d.ts +23 -2
  145. package/dist/policy-packs/registry.js +31 -2
  146. package/dist/policy-packs/registry.js.map +1 -1
  147. package/dist/policy-packs/ux-compare.d.ts +14 -0
  148. package/dist/policy-packs/ux-compare.js +58 -0
  149. package/dist/policy-packs/ux-compare.js.map +1 -0
  150. package/dist/policy-packs/ux-drift-check.d.ts +27 -0
  151. package/dist/policy-packs/ux-drift-check.js +78 -0
  152. package/dist/policy-packs/ux-drift-check.js.map +1 -0
  153. package/dist/probes/mcp.d.ts +13 -0
  154. package/dist/probes/mcp.js +57 -0
  155. package/dist/probes/mcp.js.map +1 -1
  156. package/dist/runtime/approval-signing.d.ts +82 -0
  157. package/dist/runtime/approval-signing.js +275 -0
  158. package/dist/runtime/approval-signing.js.map +1 -0
  159. package/dist/runtime/git-context.d.ts +50 -0
  160. package/dist/runtime/git-context.js +108 -1
  161. package/dist/runtime/git-context.js.map +1 -1
  162. package/dist/runtime/hermetic-spawn-guard.d.ts +25 -0
  163. package/dist/runtime/hermetic-spawn-guard.js +136 -0
  164. package/dist/runtime/hermetic-spawn-guard.js.map +1 -0
  165. package/dist/runtime/intercept.js +62 -5
  166. package/dist/runtime/intercept.js.map +1 -1
  167. package/dist/runtime/ledger-writer.d.ts +27 -0
  168. package/dist/runtime/ledger-writer.js +46 -0
  169. package/dist/runtime/ledger-writer.js.map +1 -0
  170. package/dist/runtime/pause-sentinel.js +14 -3
  171. package/dist/runtime/pause-sentinel.js.map +1 -1
  172. package/dist/runtime/read-only-bash.js +118 -0
  173. package/dist/runtime/read-only-bash.js.map +1 -1
  174. package/dist/runtime/recovery-git-commit.d.ts +22 -0
  175. package/dist/runtime/recovery-git-commit.js +284 -0
  176. package/dist/runtime/recovery-git-commit.js.map +1 -0
  177. package/dist/runtime/tool-name-aliases.d.ts +1 -0
  178. package/dist/runtime/tool-name-aliases.js +7 -1
  179. package/dist/runtime/tool-name-aliases.js.map +1 -1
  180. package/dist/schema/index.d.ts +94 -42
  181. package/dist/schema/index.js +5 -0
  182. package/dist/schema/index.js.map +1 -1
  183. package/dist/schema/policies.d.ts +56 -44
  184. package/dist/schema/policies.js +79 -9
  185. package/dist/schema/policies.js.map +1 -1
  186. package/dist/schema/toolchain-parity.d.ts +18 -0
  187. package/dist/schema/toolchain-parity.js +35 -0
  188. package/dist/schema/toolchain-parity.js.map +1 -0
  189. package/package.json +4 -2
@@ -16,6 +16,7 @@ import { profileToSettingsPermissions } from "../permission-translator.js";
16
16
  import { DEFAULT_RUNTIME } from "../runtime.js";
17
17
  import { isKnownProfileName, resolveProfile, KNOWN_PROFILE_NAMES, } from "./permission-profiles.js";
18
18
  import { REPORTS_DIR_ENV } from "./understanding-before-execution-runtime.js";
19
+ import { SHELL_ALIASES } from "../../runtime/tool-name-aliases.js";
19
20
  export const PACK_NAME = "understanding-before-execution";
20
21
  // Canonical version probe for the pack's package-side bin. Consumed by
21
22
  // `harness doctor` when the operator declares a pack-level `min_version`
@@ -44,6 +45,53 @@ export function understandingApprovalRequirement(mode) {
44
45
  ? "a human-approved Understanding Report for this session"
45
46
  : "an approved Understanding Report for this session";
46
47
  }
48
+ /**
49
+ * Shipped default `config.producers` for this pack (agent-tasks/25bced52).
50
+ * Canonical source for the "golden path" recovery command: both `harness
51
+ * init` generation surfaces (Solo/Team/Full templates, the Custom
52
+ * composer) and `harness pack reseed` (task 68b9ad9c) read from here, so
53
+ * a future wording change to the producer descriptions only has to land
54
+ * in one place to reach every manifest-generating surface plus the
55
+ * reseed path used to backfill already-installed manifests.
56
+ */
57
+ export function defaultProducers() {
58
+ return [
59
+ {
60
+ kind: "ask",
61
+ command: "harness approve understanding",
62
+ description: "Bare command, no pipes or chaining. The hook recognises it via isEscapeCommand and emits permissionDecision:ask; the operator's go on that prompt IS the gate approval. Golden path.",
63
+ },
64
+ {
65
+ kind: "bash",
66
+ command: "harness approve understanding",
67
+ description: "Same command from any un-hooked terminal (operator only, not reachable from inside the gated session). Writes the canonical marker at harness.generated/.approvals/${SESSION_ID}.",
68
+ },
69
+ ];
70
+ }
71
+ /**
72
+ * Shipped default `config.ux` for this pack, parameterised on the
73
+ * resolved mode (only the `required` line varies across modes — see
74
+ * `understandingApprovalRequirement` above). Canonical source consumed
75
+ * by the same generation surfaces as `defaultProducers()`, plus
76
+ * `harness doctor`'s divergence warning and `harness pack reseed` (task
77
+ * 68b9ad9c): the dogfood motivating that task found that a deny-message
78
+ * wording fix (e.g. the heredoc submission form, agent-tasks/e48e3b45)
79
+ * only reached NEW `harness init` manifests, because nothing propagated
80
+ * the improved text into an already-installed operator manifest whose
81
+ * `config.ux` still taught the old wording. Reading from one function
82
+ * here means a future wording fix is available to `pack reseed`
83
+ * automatically, with no separate update needed.
84
+ */
85
+ export function defaultUx(mode) {
86
+ return {
87
+ cannot: "You cannot use write-capable tools yet.",
88
+ required: [understandingApprovalRequirement(mode)],
89
+ run: [
90
+ "Write an Understanding Report covering: Current Understanding, Intended Outcome, Derived Todos, Acceptance Criteria, Assumptions, Open Questions, Out Of Scope, Risks, Verification Plan, Prior Art (state what you searched for an existing solution and what you found, with an explicit adopt-or-build judgment)",
91
+ "Run `harness approve understanding` with the report attached as a quoted heredoc (harness approve understanding <<'UNDERSTANDING_REPORT' ...report... UNDERSTANDING_REPORT) so it is persisted for audit, then approve the prompt; the heredoc is the only extra shell shape the gate allows (no pipes, chaining, or other redirection)",
92
+ ],
93
+ };
94
+ }
47
95
  const HOOK_NAME_PREFIX = `policy-pack:${PACK_NAME}`;
48
96
  // Per-runtime hook surface. Claude Code keys on tool name (Edit|Write|Bash);
49
97
  // Codex's write surface is `apply_patch` plus shell tool aliases used by
@@ -75,6 +123,13 @@ const PRE_TOOL_USE_COMMAND_CLAUDE = "harness pack hook pre-tool-use";
75
123
  // - Stop-equivalent capture into `.understanding-gate/reports/`
76
124
  // (Phase 6 #6 follow-up).
77
125
  // - PreToolUse blocker on apply_patch plus Codex shell aliases (Phase 6 #6).
126
+ // - PostToolUse marker-expiry (task a1348c89): Codex's published hooks
127
+ // reference (developers.openai.com/codex/hooks) documents
128
+ // `PostToolUse` as a first-class event — `[[hooks.PostToolUse]]`
129
+ // with a `matcher` on `tool_name`, same allow/exit-0 or
130
+ // block/exit-2 contract as PreToolUse. Mirrors the Claude
131
+ // `post-tool-use` hook via the shared matching/clearing core in
132
+ // understanding-before-execution-runtime.ts.
78
133
  //
79
134
  // Cross-runtime sessions can still approve from a Claude Code report:
80
135
  // the ledger tag is the canonical source for harnessed sessions,
@@ -85,6 +140,7 @@ const PRE_TOOL_USE_COMMAND_CLAUDE = "harness pack hook pre-tool-use";
85
140
  const COMMAND_USER_PROMPT_SUBMIT_CODEX = "harness pack hook codex-user-prompt-submit";
86
141
  const COMMAND_STOP_CODEX = "harness pack hook codex-stop";
87
142
  const COMMAND_PRE_TOOL_USE_CODEX = "harness pack hook codex-pre-tool-use";
143
+ const COMMAND_POST_TOOL_USE_CODEX = "harness pack hook codex-post-tool-use";
88
144
  export function isMode(value) {
89
145
  return (typeof value === "string" && MODES.includes(value));
90
146
  }
@@ -177,31 +233,133 @@ const DEFAULT_EXPIRE_ON_TOOL_MATCH = [
177
233
  "mcp__agent-tasks__tasks_transition",
178
234
  ];
179
235
  const POST_TOOL_USE_COMMAND_CLAUDE = "harness pack hook post-tool-use";
180
- const TRACK_ACTIVE_CLAIM_COMMAND_CLAUDE = "harness pack hook track-active-claim";
236
+ // Task cf4cdc93 (Codex parity gap #3): unlike stop/pre-tool-use/
237
+ // post-tool-use, the active-claim tracker and stay-in-scope reminder
238
+ // need NO runtime-specific CLI verb — both hook bodies only ever
239
+ // inspect the generic `tool_name` / `tool_input` fields already common
240
+ // to Claude's and Codex's PostToolUse envelope (no session_id, no
241
+ // shell-command extraction, no Codex-only synonym). One shared command
242
+ // constant per hook is therefore reused verbatim on both runtimes below
243
+ // instead of a `codex-track-active-claim` / `codex-stay-in-scope`
244
+ // sibling binary — avoids reintroducing the exact Claude/Codex drift
245
+ // class task e7c2ec3c fixed on the PreToolUse side.
246
+ const TRACK_ACTIVE_CLAIM_COMMAND = "harness pack hook track-active-claim";
181
247
  // Hardcoded matcher for the v2 active-claim tracker (harness/494fd1e5).
182
248
  // Agent-tasks specific; operators on other tasking systems can ignore
183
249
  // this hook (the matcher won't fire for their tools). A config-driven
184
250
  // extension can land later if a second tasking system asks for it.
185
251
  const TRACK_ACTIVE_CLAIM_MATCH = "^(?:mcp__agent-tasks__task_start|mcp__agent-tasks__task_finish|mcp__agent-tasks__task_abandon|mcp__agent-tasks__tasks_transition)$";
252
+ // Codex sibling of TRACK_ACTIVE_CLAIM_MATCH above (task cf4cdc93): a
253
+ // bare, unescaped `|`-joined list, NOT the anchored `^(?:...)$` form —
254
+ // same rationale as `codexPostToolUseMatchPattern`'s own doc comment
255
+ // (task a1348c89 review finding): `expandCodexHookMatchPattern`'s
256
+ // "simple token" guard (`isSimpleToolPatternToken`, generate-codex-config.ts)
257
+ // only alias-expands a match string whose tokens are ALL "simple"; the
258
+ // anchor characters `^`, `(`, `?` trip that guard and the anchored form
259
+ // is passed through UNCHANGED at TOML-emit time, so a Codex session
260
+ // sending a dotted/underscore-server MCP tool-name variant would never
261
+ // even reach the hook. This bare form lets the emitted `config.toml`
262
+ // matcher — and therefore Codex's own dispatcher — recognize those
263
+ // variants, exactly like `PRE_TOOL_USE_MATCH_CODEX` already does.
264
+ const TRACK_ACTIVE_CLAIM_MATCH_CODEX = "mcp__agent-tasks__task_start|mcp__agent-tasks__task_finish|mcp__agent-tasks__task_abandon|mcp__agent-tasks__tasks_transition";
186
265
  // Hardcoded matcher for the stay-in-scope reminder (harness/2ba06030).
187
266
  // Fires on the three task-mutation verbs that can carry labels and
188
267
  // description fields. tasks_update is included so a label added
189
268
  // post-hoc (e.g. `tasks_update { labels: ["from-review"] }`) still
190
269
  // surfaces the reminder.
191
270
  const STAY_IN_SCOPE_MATCH = "^(?:mcp__agent-tasks__task_create|mcp__agent-tasks__tasks_create|mcp__agent-tasks__tasks_update)$";
192
- const STAY_IN_SCOPE_COMMAND_CLAUDE = "harness pack hook stay-in-scope";
271
+ // Codex sibling of STAY_IN_SCOPE_MATCH above (task cf4cdc93), same
272
+ // bare-unanchored-list rationale as TRACK_ACTIVE_CLAIM_MATCH_CODEX.
273
+ const STAY_IN_SCOPE_MATCH_CODEX = "mcp__agent-tasks__task_create|mcp__agent-tasks__tasks_create|mcp__agent-tasks__tasks_update";
274
+ const STAY_IN_SCOPE_COMMAND = "harness pack hook stay-in-scope";
275
+ // Bash tool name used to widen the PostToolUse matcher when
276
+ // `expire_on_bash_match` is configured (task bea04a03). Matches the
277
+ // single entry of `DEFAULT_BASH_TOOL_NAMES` in
278
+ // understanding-before-execution-runtime.ts.
279
+ const BASH_TOOL_NAME_CLAUDE = "Bash";
280
+ // Codex shell-tool aliases used for the same widening on the Codex
281
+ // matcher builder below. Derived from the canonical `SHELL_ALIASES` in
282
+ // `src/runtime/tool-name-aliases.ts` (task bea04a03 review finding) —
283
+ // `policy-packs/` IS allowed to depend on `runtime/` (layering rule,
284
+ // `.dependency-cruiser.cjs`; the sibling understanding-before-execution-runtime.ts
285
+ // already imports from there), so this is a shared source of truth
286
+ // rather than a third hand-maintained copy. `CODEX_SHELL_TOOLS` in
287
+ // `src/cli/pack/hook-codex-pre-tool-use.ts` stays a separate literal:
288
+ // `policy-packs/` may not depend on `cli/` (same layering rule), so that
289
+ // one cannot be unified with this without a boundary violation.
290
+ const BASH_TOOL_NAMES_CODEX = SHELL_ALIASES;
193
291
  /**
194
- * Compose the PostToolUse `match` regex from the configured tool list.
292
+ * Compose the PostToolUse `match` regex from the configured tool list,
293
+ * widened with the Bash tool name when `includeBash` is true (task
294
+ * bea04a03: `approval_lifecycle.expire_on_bash_match` carries at least
295
+ * one pattern). Before this widening, `expire_on_tool_match` alone
296
+ * gated the matcher, so a real `Bash` call never reached the hook at
297
+ * all — `matchPostToolUseBoundary`'s bash-regex check (which DOES
298
+ * correctly evaluate `expire_on_bash_match` once invoked) was
299
+ * unreachable in practice. Adding "Bash" here only ROUTES the call to
300
+ * the hook; it does not add "Bash" to `expire_on_tool_match`'s own
301
+ * semantics — the hook body still classifies a matched Bash call as a
302
+ * bash-regex match (`toolNameMatched: false`), never a tool-name match.
195
303
  * Each tool name is regex-escaped and joined with `|` so settings.json
196
304
  * fires the hook only when the just-completed tool is one we care
197
305
  * about. When the operator declared `approval_lifecycle: { mode: session }`
198
- * (or cleared the list), no PostToolUse hook is emitted at all (caller
306
+ * (or cleared both lists), no PostToolUse hook is emitted at all (caller
199
307
  * filters).
200
308
  */
201
- function postToolUseMatchPattern(tools) {
202
- const escaped = tools.map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
309
+ function postToolUseMatchPattern(tools, includeBash) {
310
+ const widened = includeBash && !tools.includes(BASH_TOOL_NAME_CLAUDE)
311
+ ? [...tools, BASH_TOOL_NAME_CLAUDE]
312
+ : tools;
313
+ const escaped = widened.map((t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
203
314
  return `^(?:${escaped.join("|")})$`;
204
315
  }
316
+ /**
317
+ * Compose the CODEX PostToolUse `match` field — deliberately NOT
318
+ * `postToolUseMatchPattern` above (review finding on task a1348c89,
319
+ * verified via a direct probe of `expandCodexHookMatchPattern`). The
320
+ * Claude builder anchors its output in `^(?:...)$` and regex-escapes
321
+ * every tool name; `expandCodexHookMatchPattern` in
322
+ * `generate-codex-config.ts` only alias-expands a match string whose
323
+ * `|`-split tokens are ALL "simple" (`isSimpleToolPatternToken`,
324
+ * `/^[A-Za-z0-9_.:-]+$/`) — the anchor characters `^`, `(`, `?` on the
325
+ * first/last token trip that guard, so an anchored match is passed
326
+ * through UNCHANGED at emit time. Concretely: a Codex session sending
327
+ * the dotted `mcp__agent-tasks__.task_finish` or an underscore-server
328
+ * `mcp__agent_tasks__task_finish` variant would never even reach the
329
+ * hook — Codex's own dispatcher tests `tool_name` against the emitted
330
+ * `matcher`, and the anchored form only contains the canonical forms.
331
+ * (`matchPostToolUseBoundary`'s alias-aware body-side fix, same task,
332
+ * only helps once the hook is actually invoked — it cannot compensate
333
+ * for a dispatcher that never calls it.)
334
+ *
335
+ * This builder instead emits a BARE, unescaped `|`-joined list — same
336
+ * shape as the existing `PRE_TOOL_USE_MATCH_CODEX` constant above —
337
+ * so every token stays "simple" and `expandCodexHookMatchPattern`
338
+ * expands each MCP tool name into its full alias set (server
339
+ * hyphen/underscore swap, the `mcp__server__.tool` dotted form) at
340
+ * `harness apply --runtime codex` time, exactly like the Codex
341
+ * PreToolUse blocker's own matcher already does. No anchoring is
342
+ * needed here: Codex's own hook dispatch (like the sibling PreToolUse
343
+ * matcher) is unanchored substring-style matching already, and this
344
+ * keeps the Codex and Claude builders independently tunable rather
345
+ * than smuggling a Codex-only branch into the shared Claude helper.
346
+ *
347
+ * Like the Claude builder above, `includeBash` (task bea04a03) widens
348
+ * the emitted list with the Codex shell-tool aliases
349
+ * (`BASH_TOOL_NAMES_CODEX`: Bash/shell/exec_command/functions.exec_command)
350
+ * when `approval_lifecycle.expire_on_bash_match` carries at least one
351
+ * pattern, so a real Codex shell call is actually routed to the hook.
352
+ * The aliases stay simple tokens (no anchors), so they still pass
353
+ * through `expandCodexHookMatchPattern` unchanged — they have no MCP-style
354
+ * variants to expand, but they must not trip the "simple token" guard
355
+ * either.
356
+ */
357
+ function codexPostToolUseMatchPattern(tools, includeBash) {
358
+ const widened = includeBash
359
+ ? [...tools, ...BASH_TOOL_NAMES_CODEX.filter((t) => !tools.includes(t))]
360
+ : tools;
361
+ return widened.join("|");
362
+ }
205
363
  function resolveExpireOnToolMatch(pack) {
206
364
  const raw = pack.config["approval_lifecycle"];
207
365
  // No config block at all: default-on with the agent-tasks tool list.
@@ -225,6 +383,56 @@ function resolveExpireOnToolMatch(pack) {
225
383
  }
226
384
  return { tools: [...DEFAULT_EXPIRE_ON_TOOL_MATCH], emitHook: true };
227
385
  }
386
+ /**
387
+ * Whether `approval_lifecycle.expire_on_bash_match` carries at least one
388
+ * non-empty pattern (task bea04a03). Used ONLY to decide whether the
389
+ * emitted PostToolUse matcher should be widened to route Bash (Claude) /
390
+ * shell-alias (Codex) calls to the hook at all — the actual regex
391
+ * compiling and matching against `tool_input.command` happens downstream
392
+ * in `parseApprovalLifecycle` / `matchPostToolUseBoundary`
393
+ * (understanding-before-execution-runtime.ts). An entry that turns out to
394
+ * be an invalid regex is silently dropped there with a warning; that is
395
+ * harmless here — the matcher merely routes the call to the hook, and a
396
+ * hook invocation that finds no live bash-regex match just no-ops
397
+ * (mirrors the existing `noBoundariesConfigured` / `boundary.matched`
398
+ * no-op paths in hook-post-tool-use.ts / hook-codex-post-tool-use.ts).
399
+ *
400
+ * Mirrors `resolveExpireOnToolMatch`'s traversal of the same config
401
+ * block (undefined/non-object/`mode: session` all resolve to "not
402
+ * configured"), but returns a bare boolean since the matcher builders
403
+ * only need presence, not the pattern strings themselves.
404
+ */
405
+ function resolveExpireOnBashMatchConfigured(pack) {
406
+ const raw = pack.config["approval_lifecycle"];
407
+ if (raw === undefined || raw === null)
408
+ return false;
409
+ if (typeof raw !== "object" || Array.isArray(raw))
410
+ return false;
411
+ const obj = raw;
412
+ if (obj["mode"] === "session")
413
+ return false;
414
+ const list = obj["expire_on_bash_match"];
415
+ if (!Array.isArray(list))
416
+ return false;
417
+ return list.some((v) => typeof v === "string" && v.length > 0);
418
+ }
419
+ /**
420
+ * Shared PostToolUse boundary resolution for BOTH the Claude and Codex
421
+ * `buildHooks` branches (task bea04a03): combines
422
+ * `resolveExpireOnToolMatch` and `resolveExpireOnBashMatchConfigured`
423
+ * into the one decision each branch's IIFE needs. Extracted specifically
424
+ * to avoid re-introducing the exact clone-avoidance problem
425
+ * `understanding-before-execution-runtime.ts`'s `matchPostToolUseBoundary`
426
+ * / `applyPostToolUseExpiry` / `describePostToolUseExpiry` extraction
427
+ * already solved once for the two runtimes' hook CLIs (`check:duplication`
428
+ * flagged the inline duplicate when this task first wired the two nearly-
429
+ * identical IIFEs by hand).
430
+ */
431
+ function resolvePostToolUseBoundaries(pack) {
432
+ const { tools, emitHook: toolsEmitHook } = resolveExpireOnToolMatch(pack);
433
+ const bashConfigured = resolveExpireOnBashMatchConfigured(pack);
434
+ return { tools, bashConfigured, emit: toolsEmitHook || bashConfigured };
435
+ }
228
436
  function buildHooks(runtime, pack, opts = {}) {
229
437
  // Per-mode hook commands are identical (the mode is passed via the
230
438
  // package's UNDERSTANDING_GATE_MODE env var, set elsewhere — out of
@@ -263,6 +471,71 @@ function buildHooks(runtime, pack, opts = {}) {
263
471
  budget_ms: 5000,
264
472
  description: "Codex adapter: block apply_patch and Codex shell tools until an approved Understanding Report exists for the session. Consults both the evidence-ledger tag and the persisted JSON report.",
265
473
  },
474
+ // PostToolUse marker-expiry (task a1348c89, widened by task
475
+ // bea04a03). Same boundary-tool list as the Claude hook below
476
+ // (resolveExpireOnToolMatch) so Codex expires on the identical
477
+ // default set (agent-tasks task_finish / task_abandon /
478
+ // pull_requests_merge / tasks_transition) — but a DIFFERENT
479
+ // `match` builder (`codexPostToolUseMatchPattern`, not
480
+ // `postToolUseMatchPattern`): see that function's own doc comment
481
+ // for why the Claude builder's anchored regex form silently
482
+ // defeats the Codex generator's MCP tool-name alias expansion
483
+ // (review finding on task a1348c89).
484
+ // `match` is ALSO widened with the Codex shell-tool aliases
485
+ // (Bash/shell/exec_command/functions.exec_command) whenever
486
+ // `approval_lifecycle.expire_on_bash_match` carries at least one
487
+ // pattern (task bea04a03): before this, `match` was built ONLY
488
+ // from `expire_on_tool_match`, so a real shell call never reached
489
+ // the hook body at all on EITHER runtime, even though
490
+ // `matchPostToolUseBoundary`'s bash-regex check correctly
491
+ // evaluates `expire_on_bash_match` once invoked. The widened
492
+ // aliases are NEVER added to `expire_on_tool_match` itself — the
493
+ // hook body still classifies a matched shell call as a bash-regex
494
+ // match, not a tool-name match, via `CODEX_SHELL_TOOLS.has(toolName)`
495
+ // in the caller (hook-codex-post-tool-use.ts).
496
+ ...(() => {
497
+ const { tools, bashConfigured, emit } = resolvePostToolUseBoundaries(pack);
498
+ if (!emit)
499
+ return [];
500
+ const hook = {
501
+ name: `${HOOK_NAME_PREFIX}:codex:post-tool-use`,
502
+ event: "PostToolUse",
503
+ match: codexPostToolUseMatchPattern(tools, bashConfigured),
504
+ command: wrap(COMMAND_POST_TOOL_USE_CODEX),
505
+ blocking: false,
506
+ budget_ms: 2000,
507
+ description: "Codex adapter: expire the approval marker AND the persisted report after a task-completion boundary tool or expire_on_bash_match shell command (default tools: agent-tasks task_finish / task_abandon / pull_requests_merge). Forces a fresh Understanding Report on the next task.",
508
+ };
509
+ return [hook];
510
+ })(),
511
+ // Active-claim tracker (harness/494fd1e5), Codex parity task
512
+ // cf4cdc93 (parity-gaps doc gap #3). Always emitted alongside the
513
+ // pack, mirroring the Claude sibling below — the matcher won't
514
+ // fire for operators on non-agent-tasks tasking systems, so the
515
+ // file simply never appears for them. Same command as Claude
516
+ // (see TRACK_ACTIVE_CLAIM_COMMAND's doc comment above): the hook
517
+ // body needs no Codex-specific handling.
518
+ {
519
+ name: `${HOOK_NAME_PREFIX}:codex:track-active-claim`,
520
+ event: "PostToolUse",
521
+ match: TRACK_ACTIVE_CLAIM_MATCH_CODEX,
522
+ command: TRACK_ACTIVE_CLAIM_COMMAND,
523
+ blocking: false,
524
+ budget_ms: 2000,
525
+ description: "Codex adapter: track the active agent-tasks claim by writing/clearing <generatedDir>/active-claim on task_start / task_finish / task_abandon. Lets `harness approve understanding` auto-resolve the task id (harness/494fd1e5, Codex parity task cf4cdc93).",
526
+ },
527
+ // Stay-in-scope reminder (harness/2ba06030), Codex parity task
528
+ // cf4cdc93 (parity-gaps doc gap #3). Same always-on / soft-only
529
+ // semantics as the Claude sibling below.
530
+ {
531
+ name: `${HOOK_NAME_PREFIX}:codex:stay-in-scope`,
532
+ event: "PostToolUse",
533
+ match: STAY_IN_SCOPE_MATCH_CODEX,
534
+ command: STAY_IN_SCOPE_COMMAND,
535
+ blocking: false,
536
+ budget_ms: 2000,
537
+ description: "Codex adapter: emit a soft reminder + audit row when a review-derived follow-up task gets created. Surfaces user-memory feedback_reviewer_findings_stay_in_scope. Disable: STAY_IN_SCOPE_DISABLED=1 (harness/2ba06030, Codex parity task cf4cdc93).",
538
+ },
266
539
  ];
267
540
  }
268
541
  // `min_version` floor on the npm-backed bins: 0.4.0 ships the
@@ -311,21 +584,33 @@ function buildHooks(runtime, pack, opts = {}) {
311
584
  description: "Block Edit/Write/Bash until an approved Understanding Report exists for the session. Consults both the evidence-ledger tag (understanding-approved:${SESSION_ID}) and the persisted JSON report.",
312
585
  },
313
586
  // PostToolUse marker-expiry hook (agent-tasks/d8ee60ca). Fires on the
314
- // configured task-boundary tools and deletes the approval marker so
315
- // the next Edit / Write / Bash forces a fresh Understanding Report.
316
- // Default tool list expires on agent-tasks task_finish / task_abandon /
317
- // pull_requests_merge. Operators on other task systems override the
318
- // list via config.approval_lifecycle.expire_on_tool_match; setting
587
+ // configured task-boundary tools, and (task bea04a03) on a Bash call
588
+ // when `approval_lifecycle.expire_on_bash_match` carries at least one
589
+ // pattern, and deletes the approval marker so the next Edit / Write /
590
+ // Bash forces a fresh Understanding Report. Default tool list expires
591
+ // on agent-tasks task_finish / task_abandon / pull_requests_merge.
592
+ // Operators on other task systems override the list via
593
+ // config.approval_lifecycle.expire_on_tool_match; setting
319
594
  // `approval_lifecycle: { mode: session }` opts out entirely and
320
595
  // suppresses this hook from being emitted at all.
596
+ //
597
+ // Before task bea04a03, `match` was built ONLY from
598
+ // `expire_on_tool_match`, so a real `Bash` call never invoked this
599
+ // hook at all — `matchPostToolUseBoundary`'s bash-regex check (which
600
+ // DOES correctly evaluate `expire_on_bash_match` once invoked)
601
+ // was unreachable. Widening `match` to include "Bash" does not
602
+ // change how the hook body classifies the match: a Bash call that
603
+ // fires the hook is still evaluated as a bash-regex match
604
+ // (`toolNameMatched: false`), never folded into
605
+ // `expire_on_tool_match`'s own tool-name semantics.
321
606
  ...(() => {
322
- const { tools, emitHook } = resolveExpireOnToolMatch(pack);
323
- if (!emitHook)
607
+ const { tools, bashConfigured, emit } = resolvePostToolUseBoundaries(pack);
608
+ if (!emit)
324
609
  return [];
325
610
  const hook = {
326
611
  name: `${HOOK_NAME_PREFIX}:post-tool-use`,
327
612
  event: "PostToolUse",
328
- match: postToolUseMatchPattern(tools),
613
+ match: postToolUseMatchPattern(tools, bashConfigured),
329
614
  // Wrap with UNDERSTANDING_GATE_REPORT_DIR so the post-tool-use
330
615
  // hook resolves the same persisted-reports directory as the
331
616
  // pre-tool-use blocker; otherwise it can't expire the persisted
@@ -333,7 +618,7 @@ function buildHooks(runtime, pack, opts = {}) {
333
618
  command: wrap(POST_TOOL_USE_COMMAND_CLAUDE),
334
619
  blocking: false,
335
620
  budget_ms: 2000,
336
- description: "Expire the approval marker AND the persisted report after a task-completion boundary tool (default: agent-tasks task_finish / task_abandon / pull_requests_merge). Forces a fresh Understanding Report on the next task.",
621
+ description: "Expire the approval marker AND the persisted report after a task-completion boundary tool or expire_on_bash_match Bash command (default tools: agent-tasks task_finish / task_abandon / pull_requests_merge). Forces a fresh Understanding Report on the next task.",
337
622
  };
338
623
  return [hook];
339
624
  })(),
@@ -348,7 +633,7 @@ function buildHooks(runtime, pack, opts = {}) {
348
633
  name: `${HOOK_NAME_PREFIX}:track-active-claim`,
349
634
  event: "PostToolUse",
350
635
  match: TRACK_ACTIVE_CLAIM_MATCH,
351
- command: TRACK_ACTIVE_CLAIM_COMMAND_CLAUDE,
636
+ command: TRACK_ACTIVE_CLAIM_COMMAND,
352
637
  blocking: false,
353
638
  budget_ms: 2000,
354
639
  description: "Track the active agent-tasks claim by writing/clearing <generatedDir>/active-claim on task_start / task_finish / task_abandon. Lets `harness approve understanding` auto-resolve the task id (harness/494fd1e5).",
@@ -367,7 +652,7 @@ function buildHooks(runtime, pack, opts = {}) {
367
652
  name: `${HOOK_NAME_PREFIX}:stay-in-scope`,
368
653
  event: "PostToolUse",
369
654
  match: STAY_IN_SCOPE_MATCH,
370
- command: STAY_IN_SCOPE_COMMAND_CLAUDE,
655
+ command: STAY_IN_SCOPE_COMMAND,
371
656
  blocking: false,
372
657
  budget_ms: 2000,
373
658
  description: "Emit a soft reminder + audit row when a review-derived follow-up task gets created. Surfaces user-memory feedback_reviewer_findings_stay_in_scope. Disable: STAY_IN_SCOPE_DISABLED=1.",
@@ -1 +1 @@
1
- {"version":3,"file":"understanding-before-execution.js","sourceRoot":"","sources":["../../../src/policy-packs/builtin/understanding-before-execution.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,EAAE;AACF,sEAAsE;AACtE,yEAAyE;AACzE,yEAAyE;AACzE,8EAA8E;AAC9E,0EAA0E;AAC1E,yEAAyE;AACzE,yEAAyE;AACzE,sEAAsE;AACtE,oEAAoE;AACpE,wCAAwC;AAExC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAgB,MAAM,eAAe,CAAC;AAM9D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,MAAM,CAAC,MAAM,SAAS,GAAG,gCAAgC,CAAC;AAE1D,uEAAuE;AACvE,yEAAyE;AACzE,uEAAuE;AACvE,uEAAuE;AACvE,sEAAsE;AACtE,kEAAkE;AAClE,MAAM,CAAC,MAAM,eAAe,GAA8B;IACxD,oBAAoB;IACpB,WAAW;CACZ,CAAC;AAIF,MAAM,KAAK,GAAoB,CAAC,cAAc,EAAE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M,mBAAmB,GAAG,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACnE,MAAM,KAAK,GAA2B;QACpC;YACE,YAAY,EAAE,gBAAgB,SAAS,kBAAkB;YACzD,OAAO,EAAE,mBAAmB;SAC7B;KACF,CAAC;IACF,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,OAAO;QAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEpC,MAAM,aAAa,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,aAAa,CAAC,OAAO;QAAE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAChE,MAAM,YAAY,GAAqB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IACxD,IAAI,aAAa,CAAC,WAAW;QAC3B,YAAY,CAAC,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;IAEvD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;AACpC,CAAC"}
1
+ {"version":3,"file":"understanding-before-execution.js","sourceRoot":"","sources":["../../../src/policy-packs/builtin/understanding-before-execution.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,EAAE;AACF,sEAAsE;AACtE,yEAAyE;AACzE,yEAAyE;AACzE,8EAA8E;AAC9E,0EAA0E;AAC1E,yEAAyE;AACzE,yEAAyE;AACzE,sEAAsE;AACtE,oEAAoE;AACpE,wCAAwC;AAExC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1E,OAAO,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAgB,MAAM,eAAe,CAAC;AAM9D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,mBAAmB,GACpB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,e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AmB,GAAG,iBAAiB,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACnE,MAAM,KAAK,GAA2B;QACpC;YACE,YAAY,EAAE,gBAAgB,SAAS,kBAAkB;YACzD,OAAO,EAAE,mBAAmB;SAC7B;KACF,CAAC;IACF,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,OAAO;QAAE,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAEpC,MAAM,aAAa,GAAG,wBAAwB,CAAC,IAAI,CAAC,CAAC;IACrD,IAAI,aAAa,CAAC,OAAO;QAAE,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAChE,MAAM,YAAY,GAAqB,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IACxD,IAAI,aAAa,CAAC,WAAW;QAC3B,YAAY,CAAC,WAAW,GAAG,aAAa,CAAC,WAAW,CAAC;IAEvD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC;AACpC,CAAC"}
@@ -1,9 +1,9 @@
1
1
  import type { z } from "zod";
2
- import type { PolicyPack } from "../schema/index.js";
2
+ import type { PolicyPack, PolicyUx, Producer } from "../schema/index.js";
3
3
  import { type ResolvePackOptions } from "./builtin/understanding-before-execution.js";
4
4
  import { type Runtime } from "./runtime.js";
5
5
  import type { PackContribution } from "./types.js";
6
- export declare const KNOWN_BUILTIN_PACKS: readonly ["understanding-before-execution", "branch-protection", "solution-acceptance"];
6
+ export declare const KNOWN_BUILTIN_PACKS: readonly ["understanding-before-execution", "branch-protection", "solution-acceptance", "post-merge-gate"];
7
7
  export type BuiltinPackName = (typeof KNOWN_BUILTIN_PACKS)[number];
8
8
  export declare function isBuiltinPackName(name: string): name is BuiltinPackName;
9
9
  export interface ResolveBuiltinResult {
@@ -30,3 +30,24 @@ export declare function resolveBuiltinConfigSchema(packName: string): z.ZodTypeA
30
30
  * `min_version` floor.
31
31
  */
32
32
  export declare function resolveBuiltinVersionCommand(packName: string): readonly [string, string] | null;
33
+ /**
34
+ * The shipped-template `config.ux` / `config.producers` for a builtin pack,
35
+ * as the operator's OWN pack entry would resolve them today (e.g. `ux`'s
36
+ * `required:` line is derived from the pack's currently-configured `mode`,
37
+ * not a hardcoded default mode — an operator on `strict` should be
38
+ * compared against, and reseeded with, the `strict` wording, not
39
+ * `grill_me`'s).
40
+ *
41
+ * Returns `null` when the pack name is not a builtin, or when the pack
42
+ * has no canonical shipped default to compare/reseed against (e.g.
43
+ * `solution-acceptance`, which ships `enabled: false` with no `config:`
44
+ * block in any init template). Consumed by `checkPolicyPackUxDrift`
45
+ * (`harness doctor`'s divergence warning) and `harness pack reseed`
46
+ * (task 68b9ad9c) — the single source both read from so the two stay
47
+ * in lockstep by construction.
48
+ */
49
+ export interface BuiltinDefaultConfig {
50
+ ux?: PolicyUx;
51
+ producers?: Producer[];
52
+ }
53
+ export declare function resolveBuiltinDefaultConfig(pack: PolicyPack): BuiltinDefaultConfig | null;
@@ -4,14 +4,16 @@
4
4
  // builtins are added by appending to `KNOWN_BUILTIN_PACKS` and a case
5
5
  // arm in `resolveBuiltin()`. Non-builtin sources (path/npm/git) are
6
6
  // out of scope for v1; their resolution lands in a later sub-task.
7
- import { configSchema as branchProtectionConfigSchema, PACK_NAME as BRANCH_PROTECTION, resolve as resolveBranchProtection, } from "./builtin/branch-protection.js";
8
- import { configSchema as understandingBeforeExecutionConfigSchema, PACK_NAME as UNDERSTANDING_BEFORE_EXECUTION, resolve as resolveUnderstandingBeforeExecution, VERSION_COMMAND as UNDERSTANDING_BEFORE_EXECUTION_VERSION_COMMAND, } from "./builtin/understanding-before-execution.js";
7
+ import { configSchema as branchProtectionConfigSchema, defaultUx as branchProtectionDefaultUx, PACK_NAME as BRANCH_PROTECTION, resolve as resolveBranchProtection, } from "./builtin/branch-protection.js";
8
+ import { configSchema as understandingBeforeExecutionConfigSchema, defaultProducers as understandingBeforeExecutionDefaultProducers, defaultUx as understandingBeforeExecutionDefaultUx, PACK_NAME as UNDERSTANDING_BEFORE_EXECUTION, resolve as resolveUnderstandingBeforeExecution, resolveMode as resolveUnderstandingBeforeExecutionMode, VERSION_COMMAND as UNDERSTANDING_BEFORE_EXECUTION_VERSION_COMMAND, } from "./builtin/understanding-before-execution.js";
9
9
  import { configSchema as solutionAcceptanceConfigSchema, PACK_NAME as SOLUTION_ACCEPTANCE, resolve as resolveSolutionAcceptance, } from "./builtin/solution-acceptance.js";
10
+ import { configSchema as postMergeGateConfigSchema, defaultUx as postMergeGateDefaultUx, PACK_NAME as POST_MERGE_GATE, resolve as resolvePostMergeGate, } from "./builtin/post-merge-gate.js";
10
11
  import { DEFAULT_RUNTIME } from "./runtime.js";
11
12
  export const KNOWN_BUILTIN_PACKS = [
12
13
  UNDERSTANDING_BEFORE_EXECUTION,
13
14
  BRANCH_PROTECTION,
14
15
  SOLUTION_ACCEPTANCE,
16
+ POST_MERGE_GATE,
15
17
  ];
16
18
  export function isBuiltinPackName(name) {
17
19
  return KNOWN_BUILTIN_PACKS.includes(name);
@@ -26,6 +28,8 @@ export function resolveBuiltin(pack, runtime = DEFAULT_RUNTIME, opts = {}) {
26
28
  return resolveBranchProtection(pack, runtime);
27
29
  case SOLUTION_ACCEPTANCE:
28
30
  return resolveSolutionAcceptance(pack, runtime, opts);
31
+ case POST_MERGE_GATE:
32
+ return resolvePostMergeGate(pack, runtime);
29
33
  }
30
34
  }
31
35
  /**
@@ -45,6 +49,8 @@ export function resolveBuiltinConfigSchema(packName) {
45
49
  return branchProtectionConfigSchema;
46
50
  case SOLUTION_ACCEPTANCE:
47
51
  return solutionAcceptanceConfigSchema;
52
+ case POST_MERGE_GATE:
53
+ return postMergeGateConfigSchema;
48
54
  }
49
55
  }
50
56
  /**
@@ -69,6 +75,29 @@ export function resolveBuiltinVersionCommand(packName) {
69
75
  // Blocker is harness itself; the producer (grounding-mcp) is probed
70
76
  // via its tools.mcp min_version, not a pack-side bin.
71
77
  return null;
78
+ case POST_MERGE_GATE:
79
+ // Both the producer and the blocker are harness itself; no
80
+ // separate package-side bin to probe.
81
+ return null;
82
+ }
83
+ }
84
+ export function resolveBuiltinDefaultConfig(pack) {
85
+ if (!isBuiltinPackName(pack.name))
86
+ return null;
87
+ switch (pack.name) {
88
+ case UNDERSTANDING_BEFORE_EXECUTION: {
89
+ const { mode } = resolveUnderstandingBeforeExecutionMode(pack);
90
+ return {
91
+ ux: understandingBeforeExecutionDefaultUx(mode),
92
+ producers: understandingBeforeExecutionDefaultProducers(),
93
+ };
94
+ }
95
+ case BRANCH_PROTECTION:
96
+ return { ux: branchProtectionDefaultUx() };
97
+ case SOLUTION_ACCEPTANCE:
98
+ return null;
99
+ case POST_MERGE_GATE:
100
+ return { ux: postMergeGateDefaultUx() };
72
101
  }
73
102
  }
74
103
  //# sourceMappingURL=registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/policy-packs/registry.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,kEAAkE;AAClE,sEAAsE;AACtE,oEAAoE;AACpE,mEAAmE;AAInE,OAAO,EACL,YAAY,IAAI,4BAA4B,EAC5C,SAAS,IAAI,iBAAiB,EAC9B,OAAO,IAAI,uBAAuB,GACnC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,YAAY,IAAI,wCAAwC,EACxD,SAAS,IAAI,8BAA8B,EAC3C,OAAO,IAAI,mCAAmC,EAC9C,eAAe,IAAI,8CAA8C,GAElE,MAAM,6CAA6C,CAAC;AACrD,OAAO,EACL,YAAY,IAAI,8BAA8B,EAC9C,SAAS,IAAI,mBAAmB,EAChC,OAAO,IAAI,yBAAyB,GACrC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAgB,MAAM,cAAc,CAAC;AAG7D,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,8BAA8B;IAC9B,iBAAiB;IACjB,mBAAmB;CACX,CAAC;AAGX,MAAM,UAAU,iBAA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EhB,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IAC/C,QAAQ,IAAI,CAAC,IAAuB,EAAE,CAAC;QACrC,KAAK,8BAA8B,CAAC,CAAC,CAAC;YACpC,MAAM,EAAE,IAAI,EAAE,GAAG,uCAAuC,CAAC,IAAI,CAAC,CAAC;YAC/D,OAAO;gBACL,EAAE,EAAE,qCAAqC,CAAC,IAAI,CAAC;gBAC/C,SAAS,EAAE,4CAA4C,EAAE;aAC1D,CAAC;QACJ,CAAC;QACD,KAAK,iBAAiB;YACpB,OAAO,EAAE,EAAE,EAAE,yBAAyB,EAAE,EAAE,CAAC;QAC7C,KAAK,mBAAmB;YACtB,OAAO,IAAI,CAAC;QACd,KAAK,eAAe;YAClB,OAAO,EAAE,EAAE,EAAE,sBAAsB,EAAE,EAAE,CAAC;IAC5C,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { PolicyUx, Producer } from "../schema/index.js";
2
+ export declare function uxEqual(a: PolicyUx, b: PolicyUx): boolean;
3
+ /**
4
+ * Structural equality over a `producers:` array. Compares each entry
5
+ * field-by-field per its discriminated `kind` rather than a generic deep
6
+ * equal — the shape is small and fixed (bash/mcp/ask), and this keeps the
7
+ * comparison legible instead of round-tripping through JSON.stringify
8
+ * (which would also be sensitive to incidental key ordering).
9
+ */
10
+ export declare function producersEqual(a: readonly Producer[], b: readonly Producer[]): boolean;
11
+ /** Parses an unknown `config.ux` value; returns null on any schema rejection. */
12
+ export declare function safeParseUx(raw: unknown): PolicyUx | null;
13
+ /** Parses an unknown `config.producers` value; returns null on any schema rejection. */
14
+ export declare function safeParseProducers(raw: unknown): Producer[] | null;