clinkx 1.2.0 → 1.3.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 (270) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +4 -2
  3. package/clinkx-workflows/dist/architecture-arena/admission.d.ts +16 -0
  4. package/clinkx-workflows/dist/architecture-arena/admission.js +107 -0
  5. package/clinkx-workflows/dist/architecture-arena/admission.js.map +1 -0
  6. package/clinkx-workflows/dist/architecture-arena/contract.d.ts +1368 -0
  7. package/clinkx-workflows/dist/architecture-arena/contract.js +254 -0
  8. package/clinkx-workflows/dist/architecture-arena/contract.js.map +1 -0
  9. package/clinkx-workflows/dist/architecture-arena/runtime.d.ts +53 -0
  10. package/clinkx-workflows/dist/architecture-arena/runtime.js +511 -0
  11. package/clinkx-workflows/dist/architecture-arena/runtime.js.map +1 -0
  12. package/clinkx-workflows/dist/architecture-comparison/admission.d.ts +17 -1
  13. package/clinkx-workflows/dist/architecture-comparison/admission.js +27 -4
  14. package/clinkx-workflows/dist/architecture-comparison/admission.js.map +1 -1
  15. package/clinkx-workflows/dist/architecture-comparison/contract.d.ts +59 -62
  16. package/clinkx-workflows/dist/architecture-comparison/contract.js +4 -21
  17. package/clinkx-workflows/dist/architecture-comparison/contract.js.map +1 -1
  18. package/clinkx-workflows/dist/architecture-comparison/runtime.d.ts +4 -3
  19. package/clinkx-workflows/dist/architecture-comparison/runtime.js +22 -67
  20. package/clinkx-workflows/dist/architecture-comparison/runtime.js.map +1 -1
  21. package/clinkx-workflows/dist/artifacts.d.ts +19 -4
  22. package/clinkx-workflows/dist/artifacts.js +16 -7
  23. package/clinkx-workflows/dist/artifacts.js.map +1 -1
  24. package/clinkx-workflows/dist/backend.d.ts +30 -0
  25. package/clinkx-workflows/dist/clink-client.d.ts +8 -2
  26. package/clinkx-workflows/dist/clink-client.js +4 -2
  27. package/clinkx-workflows/dist/clink-client.js.map +1 -1
  28. package/clinkx-workflows/dist/context-preflight.d.ts +6 -0
  29. package/clinkx-workflows/dist/context-preflight.js.map +1 -1
  30. package/clinkx-workflows/dist/council-execution-policy.d.ts +3 -1
  31. package/clinkx-workflows/dist/council-execution-policy.js +4 -0
  32. package/clinkx-workflows/dist/council-execution-policy.js.map +1 -1
  33. package/clinkx-workflows/dist/dashboard/contracts.d.ts +586 -586
  34. package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +28 -28
  35. package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +32 -32
  36. package/clinkx-workflows/dist/dashboard-ui/assets/index-DRId2DVA.js +119 -0
  37. package/clinkx-workflows/dist/dashboard-ui/assets/style-CHAw57y5.css +1 -0
  38. package/clinkx-workflows/dist/dashboard-ui/index.html +2 -2
  39. package/clinkx-workflows/dist/delegate-signature.d.ts +4 -3
  40. package/clinkx-workflows/dist/delegate-signature.js +4 -3
  41. package/clinkx-workflows/dist/delegate-signature.js.map +1 -1
  42. package/clinkx-workflows/dist/durable-file.d.ts +69 -0
  43. package/clinkx-workflows/dist/durable-file.js +145 -0
  44. package/clinkx-workflows/dist/durable-file.js.map +1 -0
  45. package/clinkx-workflows/dist/engine.d.ts +42 -7
  46. package/clinkx-workflows/dist/engine.js +196 -24
  47. package/clinkx-workflows/dist/engine.js.map +1 -1
  48. package/clinkx-workflows/dist/ping-pong/admission.d.ts +127 -0
  49. package/clinkx-workflows/dist/ping-pong/admission.js +522 -0
  50. package/clinkx-workflows/dist/ping-pong/admission.js.map +1 -0
  51. package/clinkx-workflows/dist/ping-pong/contract.d.ts +2539 -0
  52. package/clinkx-workflows/dist/ping-pong/contract.js +819 -0
  53. package/clinkx-workflows/dist/ping-pong/contract.js.map +1 -0
  54. package/clinkx-workflows/dist/ping-pong/control.d.ts +67 -0
  55. package/clinkx-workflows/dist/ping-pong/control.js +12 -0
  56. package/clinkx-workflows/dist/ping-pong/control.js.map +1 -0
  57. package/clinkx-workflows/dist/ping-pong/runtime-handle.d.ts +24 -0
  58. package/clinkx-workflows/dist/ping-pong/runtime-handle.js +55 -0
  59. package/clinkx-workflows/dist/ping-pong/runtime-handle.js.map +1 -0
  60. package/clinkx-workflows/dist/ping-pong/runtime.d.ts +235 -0
  61. package/clinkx-workflows/dist/ping-pong/runtime.js +1183 -0
  62. package/clinkx-workflows/dist/ping-pong/runtime.js.map +1 -0
  63. package/clinkx-workflows/dist/ping-pong/settle.d.ts +57 -0
  64. package/clinkx-workflows/dist/ping-pong/settle.js +58 -0
  65. package/clinkx-workflows/dist/ping-pong/settle.js.map +1 -0
  66. package/clinkx-workflows/dist/ping-pong/sidecar.d.ts +65 -0
  67. package/clinkx-workflows/dist/ping-pong/sidecar.js +138 -0
  68. package/clinkx-workflows/dist/ping-pong/sidecar.js.map +1 -0
  69. package/clinkx-workflows/dist/plan-review/publication.d.ts +2 -1
  70. package/clinkx-workflows/dist/plan-review/publication.js +5 -6
  71. package/clinkx-workflows/dist/plan-review/publication.js.map +1 -1
  72. package/clinkx-workflows/dist/plan-review/snapshot.d.ts +3 -2
  73. package/clinkx-workflows/dist/plan-review/snapshot.js +8 -8
  74. package/clinkx-workflows/dist/plan-review/snapshot.js.map +1 -1
  75. package/clinkx-workflows/dist/recipe-host.d.ts +315 -0
  76. package/clinkx-workflows/dist/recipe-host.js +183 -0
  77. package/clinkx-workflows/dist/recipe-host.js.map +1 -0
  78. package/clinkx-workflows/dist/recipe-seats.d.ts +96 -0
  79. package/clinkx-workflows/dist/recipe-seats.js +163 -0
  80. package/clinkx-workflows/dist/recipe-seats.js.map +1 -0
  81. package/clinkx-workflows/dist/recipe-shared/evidence.d.ts +67 -0
  82. package/clinkx-workflows/dist/recipe-shared/evidence.js +111 -0
  83. package/clinkx-workflows/dist/recipe-shared/evidence.js.map +1 -0
  84. package/clinkx-workflows/dist/reducers/index.d.ts +9 -1
  85. package/clinkx-workflows/dist/reducers/index.js +30 -0
  86. package/clinkx-workflows/dist/reducers/index.js.map +1 -1
  87. package/clinkx-workflows/dist/run-lock-reclaim.d.ts +44 -0
  88. package/clinkx-workflows/dist/run-lock-reclaim.js +86 -0
  89. package/clinkx-workflows/dist/run-lock-reclaim.js.map +1 -0
  90. package/clinkx-workflows/dist/state-schema.d.ts +11 -0
  91. package/clinkx-workflows/dist/state-schema.js +4 -1
  92. package/clinkx-workflows/dist/state-schema.js.map +1 -1
  93. package/clinkx-workflows/dist/state.d.ts +178 -3
  94. package/clinkx-workflows/dist/state.js +618 -83
  95. package/clinkx-workflows/dist/state.js.map +1 -1
  96. package/clinkx-workflows/dist/transport.d.ts +2 -1
  97. package/clinkx-workflows/dist/transport.js +5 -0
  98. package/clinkx-workflows/dist/transport.js.map +1 -1
  99. package/clinkx-workflows/dist/validators/architecture-arena.d.ts +6 -0
  100. package/clinkx-workflows/dist/validators/architecture-arena.js +16 -0
  101. package/clinkx-workflows/dist/validators/architecture-arena.js.map +1 -0
  102. package/clinkx-workflows/dist/validators/index.js +4 -0
  103. package/clinkx-workflows/dist/validators/index.js.map +1 -1
  104. package/clinkx-workflows/dist/validators/ping-pong.d.ts +6 -0
  105. package/clinkx-workflows/dist/validators/ping-pong.js +10 -0
  106. package/clinkx-workflows/dist/validators/ping-pong.js.map +1 -0
  107. package/clinkx-workflows/dist/workflow-tools.d.ts +51 -5
  108. package/clinkx-workflows/dist/workflow-tools.js +785 -34
  109. package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
  110. package/clinkx-workflows/dist/workflow-verification-contract.d.ts +4 -4
  111. package/clinkx-workflows/templates/architecture-arena/candidate.txt +39 -0
  112. package/clinkx-workflows/templates/architecture-arena/judge.txt +34 -0
  113. package/clinkx-workflows/templates/ping-pong/implement.txt +14 -0
  114. package/clinkx-workflows/templates/ping-pong/remediate.txt +14 -0
  115. package/clinkx-workflows/templates/ping-pong/review.txt +27 -0
  116. package/clinkx-workflows/workflows/architecture-arena.yaml +127 -0
  117. package/clinkx-workflows/workflows/ping-pong.yaml +158 -0
  118. package/dist/context-builder/bundle.js +4 -3
  119. package/dist/context-builder/bundle.js.map +1 -1
  120. package/dist/context-builder/delegate-packet.d.ts +1 -0
  121. package/dist/context-builder/delegate-packet.js +66 -7
  122. package/dist/context-builder/delegate-packet.js.map +1 -1
  123. package/dist/context-builder/delegate-validation.d.ts +12 -3
  124. package/dist/context-builder/delegate-validation.js +23 -13
  125. package/dist/context-builder/delegate-validation.js.map +1 -1
  126. package/dist/context-builder/external-gaps.d.ts +14 -3
  127. package/dist/context-builder/external-gaps.js +124 -18
  128. package/dist/context-builder/external-gaps.js.map +1 -1
  129. package/dist/context-builder/handler.js +108 -191
  130. package/dist/context-builder/handler.js.map +1 -1
  131. package/dist/context-builder/review-coverage.js +27 -1
  132. package/dist/context-builder/review-coverage.js.map +1 -1
  133. package/dist/context-builder/secrets.js +1 -1
  134. package/dist/context-builder/secrets.js.map +1 -1
  135. package/dist/context-builder/versions.d.ts +10 -4
  136. package/dist/context-builder/versions.js +10 -4
  137. package/dist/context-builder/versions.js.map +1 -1
  138. package/dist/context-builder/workflow-runner.js +33 -24
  139. package/dist/context-builder/workflow-runner.js.map +1 -1
  140. package/dist/dashboard-cli.d.ts +2 -0
  141. package/dist/dashboard-cli.js +147 -57
  142. package/dist/dashboard-cli.js.map +1 -1
  143. package/dist/dashboard-companion/client.d.ts +10 -0
  144. package/dist/dashboard-companion/client.js +43 -1
  145. package/dist/dashboard-companion/client.js.map +1 -1
  146. package/dist/dashboard-companion/config.d.ts +19 -1
  147. package/dist/dashboard-companion/config.js +104 -3
  148. package/dist/dashboard-companion/config.js.map +1 -1
  149. package/dist/dashboard-companion/protocol.d.ts +16 -0
  150. package/dist/dashboard-companion/protocol.js +38 -1
  151. package/dist/dashboard-companion/protocol.js.map +1 -1
  152. package/dist/dashboard-companion/workstation-binding.d.ts +69 -0
  153. package/dist/dashboard-companion/workstation-binding.js +192 -0
  154. package/dist/dashboard-companion/workstation-binding.js.map +1 -0
  155. package/dist/dashboard-gateway/admin-cli.d.ts +10 -0
  156. package/dist/dashboard-gateway/admin-cli.js +266 -0
  157. package/dist/dashboard-gateway/admin-cli.js.map +1 -0
  158. package/dist/dashboard-gateway/config.d.ts +50 -0
  159. package/dist/dashboard-gateway/config.js +235 -1
  160. package/dist/dashboard-gateway/config.js.map +1 -1
  161. package/dist/dashboard-gateway/connection-registry.d.ts +100 -0
  162. package/dist/dashboard-gateway/connection-registry.js +228 -0
  163. package/dist/dashboard-gateway/connection-registry.js.map +1 -0
  164. package/dist/dashboard-gateway/control-plane/account-auth.d.ts +78 -0
  165. package/dist/dashboard-gateway/control-plane/account-auth.js +198 -0
  166. package/dist/dashboard-gateway/control-plane/account-auth.js.map +1 -0
  167. package/dist/dashboard-gateway/control-plane/billing.d.ts +264 -0
  168. package/dist/dashboard-gateway/control-plane/billing.js +787 -0
  169. package/dist/dashboard-gateway/control-plane/billing.js.map +1 -0
  170. package/dist/dashboard-gateway/control-plane/contracts.d.ts +1293 -0
  171. package/dist/dashboard-gateway/control-plane/contracts.js +280 -0
  172. package/dist/dashboard-gateway/control-plane/contracts.js.map +1 -0
  173. package/dist/dashboard-gateway/control-plane/cookies.d.ts +13 -0
  174. package/dist/dashboard-gateway/control-plane/cookies.js +46 -0
  175. package/dist/dashboard-gateway/control-plane/cookies.js.map +1 -0
  176. package/dist/dashboard-gateway/control-plane/credentials.d.ts +63 -0
  177. package/dist/dashboard-gateway/control-plane/credentials.js +66 -0
  178. package/dist/dashboard-gateway/control-plane/credentials.js.map +1 -0
  179. package/dist/dashboard-gateway/control-plane/entitlements.d.ts +118 -0
  180. package/dist/dashboard-gateway/control-plane/entitlements.js +329 -0
  181. package/dist/dashboard-gateway/control-plane/entitlements.js.map +1 -0
  182. package/dist/dashboard-gateway/control-plane/errors.d.ts +17 -0
  183. package/dist/dashboard-gateway/control-plane/errors.js +23 -0
  184. package/dist/dashboard-gateway/control-plane/errors.js.map +1 -0
  185. package/dist/dashboard-gateway/control-plane/hosts.d.ts +6 -0
  186. package/dist/dashboard-gateway/control-plane/hosts.js +16 -0
  187. package/dist/dashboard-gateway/control-plane/hosts.js.map +1 -0
  188. package/dist/dashboard-gateway/control-plane/http.d.ts +34 -0
  189. package/dist/dashboard-gateway/control-plane/http.js +331 -0
  190. package/dist/dashboard-gateway/control-plane/http.js.map +1 -0
  191. package/dist/dashboard-gateway/control-plane/schema.d.ts +9 -0
  192. package/dist/dashboard-gateway/control-plane/schema.js +247 -0
  193. package/dist/dashboard-gateway/control-plane/schema.js.map +1 -0
  194. package/dist/dashboard-gateway/control-plane/secrets.d.ts +20 -0
  195. package/dist/dashboard-gateway/control-plane/secrets.js +39 -0
  196. package/dist/dashboard-gateway/control-plane/secrets.js.map +1 -0
  197. package/dist/dashboard-gateway/control-plane/store.d.ts +579 -0
  198. package/dist/dashboard-gateway/control-plane/store.js +1115 -0
  199. package/dist/dashboard-gateway/control-plane/store.js.map +1 -0
  200. package/dist/dashboard-gateway/cookie-boundary.d.ts +60 -0
  201. package/dist/dashboard-gateway/cookie-boundary.js +205 -0
  202. package/dist/dashboard-gateway/cookie-boundary.js.map +1 -0
  203. package/dist/dashboard-gateway/index.js +271 -494
  204. package/dist/dashboard-gateway/index.js.map +1 -1
  205. package/dist/dashboard-gateway/main.js +7 -2
  206. package/dist/dashboard-gateway/main.js.map +1 -1
  207. package/dist/dashboard-gateway/routing.d.ts +43 -0
  208. package/dist/dashboard-gateway/routing.js +65 -0
  209. package/dist/dashboard-gateway/routing.js.map +1 -0
  210. package/dist/dashboard-gateway/tenant-gateway.d.ts +56 -0
  211. package/dist/dashboard-gateway/tenant-gateway.js +989 -0
  212. package/dist/dashboard-gateway/tenant-gateway.js.map +1 -0
  213. package/dist/dashboard-gateway/tenant-main.d.ts +41 -0
  214. package/dist/dashboard-gateway/tenant-main.js +303 -0
  215. package/dist/dashboard-gateway/tenant-main.js.map +1 -0
  216. package/dist/dashboard-gateway/tunnel-errors.d.ts +16 -0
  217. package/dist/dashboard-gateway/tunnel-errors.js +22 -0
  218. package/dist/dashboard-gateway/tunnel-errors.js.map +1 -0
  219. package/dist/dashboard-gateway/tunnel-http.d.ts +21 -0
  220. package/dist/dashboard-gateway/tunnel-http.js +175 -0
  221. package/dist/dashboard-gateway/tunnel-http.js.map +1 -0
  222. package/dist/handler.d.ts +6 -0
  223. package/dist/handler.js +17 -1
  224. package/dist/handler.js.map +1 -1
  225. package/dist/local-clink-backend.d.ts +2 -1
  226. package/dist/local-clink-backend.js +28 -4
  227. package/dist/local-clink-backend.js.map +1 -1
  228. package/dist/parsers/extract.d.ts +19 -1
  229. package/dist/parsers/extract.js +68 -3
  230. package/dist/parsers/extract.js.map +1 -1
  231. package/dist/pipeline.d.ts +17 -1
  232. package/dist/pipeline.js +34 -6
  233. package/dist/pipeline.js.map +1 -1
  234. package/dist/process-group.d.ts +65 -0
  235. package/dist/process-group.js +153 -0
  236. package/dist/process-group.js.map +1 -0
  237. package/dist/progress-report/schema.d.ts +23 -23
  238. package/dist/project-verification/files.js +1 -1
  239. package/dist/project-verification/files.js.map +1 -1
  240. package/dist/project-verification/process.js +23 -44
  241. package/dist/project-verification/process.js.map +1 -1
  242. package/dist/project-verification/service.js +9 -1
  243. package/dist/project-verification/service.js.map +1 -1
  244. package/dist/prompt.d.ts +7 -0
  245. package/dist/prompt.js +18 -1
  246. package/dist/prompt.js.map +1 -1
  247. package/dist/recipe-host/git-trust.d.ts +43 -0
  248. package/dist/recipe-host/git-trust.js +360 -0
  249. package/dist/recipe-host/git-trust.js.map +1 -0
  250. package/dist/recipe-host/git.d.ts +42 -0
  251. package/dist/recipe-host/git.js +207 -0
  252. package/dist/recipe-host/git.js.map +1 -0
  253. package/dist/recipe-host/native-recipe-host.d.ts +127 -0
  254. package/dist/recipe-host/native-recipe-host.js +880 -0
  255. package/dist/recipe-host/native-recipe-host.js.map +1 -0
  256. package/dist/recipe-host/seat-cwd.d.ts +16 -0
  257. package/dist/recipe-host/seat-cwd.js +170 -0
  258. package/dist/recipe-host/seat-cwd.js.map +1 -0
  259. package/dist/runner.d.ts +43 -1
  260. package/dist/runner.js +234 -35
  261. package/dist/runner.js.map +1 -1
  262. package/dist/server.js +9 -1
  263. package/dist/server.js.map +1 -1
  264. package/docs/configuration.md +24 -3
  265. package/docs/engineering-recipes.md +291 -0
  266. package/docs/security.md +84 -0
  267. package/docs/verification/project-checks.md +24 -2
  268. package/package.json +5 -1
  269. package/clinkx-workflows/dist/dashboard-ui/assets/index-BdpmbPps.js +0 -115
  270. package/clinkx-workflows/dist/dashboard-ui/assets/style-Im5i1iAs.css +0 -1
@@ -0,0 +1,2539 @@
1
+ /**
2
+ * Ping-pong recipe contracts (PLAN 3-3, 3-6; CONTRACTS revision 2: 0-2, 0-4,
3
+ * 0-7, "Reviewer output pp-review-v1").
4
+ *
5
+ * Pure schemas, bounds, and transition rules. No I/O lives here: the sidecar
6
+ * file helpers are in `./sidecar.ts`, the store methods in `../state.ts`, and
7
+ * the tool handlers in `../workflow-tools.ts`. Every byte bound below is the
8
+ * CONTRACTS 0-4 value; change them only with a contract revision.
9
+ */
10
+ import { z } from "zod";
11
+ import { PING_PONG_WORKFLOW } from "../recipe-seats.js";
12
+ export { PING_PONG_WORKFLOW };
13
+ export declare const RECIPE_STATE_SCHEMA = "recipe-state-v1";
14
+ export declare const PP_REVIEW_SCHEMA = "pp-review-v1";
15
+ export declare const RECIPE_DECIDE_TOOL = "workflow_recipe_decide";
16
+ export declare const PP_MIN_ROUNDS = 1;
17
+ export declare const PP_MAX_ROUNDS = 8;
18
+ export declare const PP_DEFAULT_ROUNDS = 3;
19
+ export declare const PP_MIN_REVIEWERS = 1;
20
+ /** CONTRACTS 0-4: k = 1..4 reviewers (members 2..5). */
21
+ export declare const PP_MAX_REVIEWERS = 4;
22
+ export declare const PP_DEFAULT_SIGN_OFF_THRESHOLD = 9;
23
+ export declare const PP_MAX_FINDINGS_PER_ROUND = 24;
24
+ export declare const PP_MAX_FINDING_SUMMARY_CHARS = 240;
25
+ export declare const PP_MAX_FINDING_DETAIL_BYTES: number;
26
+ export declare const PP_MAX_REVIEW_OUTPUT_BYTES: number;
27
+ export declare const PP_MAX_IMPLEMENTER_SUMMARY_BYTES: number;
28
+ export declare const PP_MAX_SEAT_PACKET_BYTES: number;
29
+ export declare const PP_MAX_INLINE_DELTA_BYTES: number;
30
+ export declare const PP_MAX_USER_REQUEST_BYTES: number;
31
+ export declare const PP_MAX_DECISION_RECORDS = 16;
32
+ export declare const PP_MAX_DECISION_RECORD_BYTES: number;
33
+ /** Canonical decision body; the remaining 2 KiB of a record is its envelope. */
34
+ export declare const PP_MAX_DECISION_BYTES: number;
35
+ export declare const PP_MAX_NOTE_CHARS = 300;
36
+ export declare const PP_MAX_STOP_DETAIL_CHARS = 600;
37
+ export declare const PP_MAX_AUDIT_REQUESTS = 3;
38
+ export declare const PP_MAX_RECIPE_STATE_BYTES: number;
39
+ export declare const PP_TERMINAL_RESERVE_BYTES: number;
40
+ /** Largest non-terminal sidecar; the rest is reserved for the terminal write. */
41
+ export declare const PP_MAX_NONTERMINAL_RECIPE_STATE_BYTES: number;
42
+ export declare const PP_DEFAULT_ACTIVE_BUDGET_SECONDS: number;
43
+ export declare const PP_MAX_ACTIVE_BUDGET_SECONDS: number;
44
+ export declare const PP_DEFAULT_DEADLINE_SECONDS: number;
45
+ export declare const PP_MAX_DEADLINE_SECONDS: number;
46
+ /** Upper bound on recorded operations (writer, reviewers, verifications per round + final). */
47
+ export declare const PP_MAX_OPERATIONS = 256;
48
+ export declare const PP_MAX_WORKTREES: number;
49
+ /** Reviewer seats are 1-based in finding ids (`S1`..`S4`); seat 0 is the implementer. */
50
+ export declare const PP_REVIEWER_SEATS: readonly [1, 2, 3, 4];
51
+ export declare const RECIPE_PHASES: readonly ["admitted", "implementing", "verifying", "reviewing", "awaiting_decision", "remediating", "final_verifying", "stopped", "qualified"];
52
+ export declare const RecipePhaseSchema: z.ZodEnum<["admitted", "implementing", "verifying", "reviewing", "awaiting_decision", "remediating", "final_verifying", "stopped", "qualified"]>;
53
+ export type RecipePhase = z.infer<typeof RecipePhaseSchema>;
54
+ export declare const TERMINAL_RECIPE_PHASES: ReadonlySet<RecipePhase>;
55
+ export declare const RECIPE_OUTCOMES: readonly ["qualified", "stopped", "failed", "cancelled"];
56
+ export declare const RecipeOutcomeSchema: z.ZodEnum<["qualified", "stopped", "failed", "cancelled"]>;
57
+ export type RecipeOutcome = z.infer<typeof RecipeOutcomeSchema>;
58
+ /** CONTRACTS 0-2 closed enum. */
59
+ export declare const STOP_REASONS: readonly ["main_agent_stop", "round_budget_exhausted", "no_sign_off", "seat_unavailable", "no_progress", "final_verification_failed", "acceptance_input_changed", "target_changed_during_review", "recovery_required", "permission_failure", "deadline_exceeded", "active_budget_exhausted", "evidence_capacity", "cancelled"];
60
+ export declare const StopReasonSchema: z.ZodEnum<["main_agent_stop", "round_budget_exhausted", "no_sign_off", "seat_unavailable", "no_progress", "final_verification_failed", "acceptance_input_changed", "target_changed_during_review", "recovery_required", "permission_failure", "deadline_exceeded", "active_budget_exhausted", "evidence_capacity", "cancelled"]>;
61
+ export type StopReason = z.infer<typeof StopReasonSchema>;
62
+ export declare const OPERATION_STATUSES: readonly ["intent_recorded", "result_recorded", "uncertain"];
63
+ export declare const OperationStatusSchema: z.ZodEnum<["intent_recorded", "result_recorded", "uncertain"]>;
64
+ export type OperationStatus = z.infer<typeof OperationStatusSchema>;
65
+ export declare const OPERATION_KINDS: readonly ["writer", "reviewer", "verification", "identity", "control"];
66
+ export declare const FINDING_SEVERITIES: readonly ["blocker", "major", "minor", "nit"];
67
+ export declare const FindingSeveritySchema: z.ZodEnum<["blocker", "major", "minor", "nit"]>;
68
+ export declare const REVIEWER_OUTCOMES: readonly ["signed_off", "withheld", "failed"];
69
+ export declare const ReviewerOutcomeSchema: z.ZodEnum<["signed_off", "withheld", "failed"]>;
70
+ export declare function isTerminalRecipePhase(phase: RecipePhase): boolean;
71
+ export declare function isLegalPhaseTransition(from: RecipePhase | undefined, to: RecipePhase): boolean;
72
+ /** Terminal outcome -> `state.json` status (CONTRACTS 0-7). */
73
+ export declare function runStatusForOutcome(outcome: RecipeOutcome): "succeeded" | "failed" | "cancelled";
74
+ /** `R{round}-S{seat}-{n}`: round 1..8, reviewer seat 1..4, n 1..24. */
75
+ export declare const FINDING_ID_PATTERN: RegExp;
76
+ export declare function formatFindingId(round: number, seat: number, n: number): string;
77
+ export declare function parseFindingId(id: string): {
78
+ round: number;
79
+ seat: number;
80
+ n: number;
81
+ } | undefined;
82
+ export declare const FindingIdSchema: z.ZodString;
83
+ export declare const PpReviewFindingSchema: z.ZodObject<{
84
+ severity: z.ZodEnum<["blocker", "major", "minor", "nit"]>;
85
+ path: z.ZodOptional<z.ZodString>;
86
+ line: z.ZodOptional<z.ZodNumber>;
87
+ summary: z.ZodString;
88
+ detail: z.ZodEffects<z.ZodString, string, string>;
89
+ }, "strict", z.ZodTypeAny, {
90
+ detail: string;
91
+ summary: string;
92
+ severity: "blocker" | "major" | "minor" | "nit";
93
+ path?: string | undefined;
94
+ line?: number | undefined;
95
+ }, {
96
+ detail: string;
97
+ summary: string;
98
+ severity: "blocker" | "major" | "minor" | "nit";
99
+ path?: string | undefined;
100
+ line?: number | undefined;
101
+ }>;
102
+ export type PpReviewFinding = z.infer<typeof PpReviewFindingSchema>;
103
+ /**
104
+ * Raw reviewer JSON. Round/seat/echo binding and the 24-per-round budget are
105
+ * checked against the dispatched packet by `validatePpReview`, not here.
106
+ */
107
+ export declare const PpReviewSchema: z.ZodObject<{
108
+ schema: z.ZodLiteral<"pp-review-v1">;
109
+ round: z.ZodNumber;
110
+ seat: z.ZodNumber;
111
+ packet_digest: z.ZodString;
112
+ candidate_identity: z.ZodString;
113
+ sign_off: z.ZodObject<{
114
+ approved: z.ZodBoolean;
115
+ score: z.ZodNumber;
116
+ /** Rejected finding ids (from the packet's `rejected` list) this reviewer still considers blocking. */
117
+ blocking_rejected: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
118
+ }, "strict", z.ZodTypeAny, {
119
+ score: number;
120
+ approved: boolean;
121
+ blocking_rejected?: string[] | undefined;
122
+ }, {
123
+ score: number;
124
+ approved: boolean;
125
+ blocking_rejected?: string[] | undefined;
126
+ }>;
127
+ findings: z.ZodArray<z.ZodObject<{
128
+ severity: z.ZodEnum<["blocker", "major", "minor", "nit"]>;
129
+ path: z.ZodOptional<z.ZodString>;
130
+ line: z.ZodOptional<z.ZodNumber>;
131
+ summary: z.ZodString;
132
+ detail: z.ZodEffects<z.ZodString, string, string>;
133
+ }, "strict", z.ZodTypeAny, {
134
+ detail: string;
135
+ summary: string;
136
+ severity: "blocker" | "major" | "minor" | "nit";
137
+ path?: string | undefined;
138
+ line?: number | undefined;
139
+ }, {
140
+ detail: string;
141
+ summary: string;
142
+ severity: "blocker" | "major" | "minor" | "nit";
143
+ path?: string | undefined;
144
+ line?: number | undefined;
145
+ }>, "many">;
146
+ }, "strict", z.ZodTypeAny, {
147
+ findings: {
148
+ detail: string;
149
+ summary: string;
150
+ severity: "blocker" | "major" | "minor" | "nit";
151
+ path?: string | undefined;
152
+ line?: number | undefined;
153
+ }[];
154
+ seat: number;
155
+ schema: "pp-review-v1";
156
+ round: number;
157
+ packet_digest: string;
158
+ candidate_identity: string;
159
+ sign_off: {
160
+ score: number;
161
+ approved: boolean;
162
+ blocking_rejected?: string[] | undefined;
163
+ };
164
+ }, {
165
+ findings: {
166
+ detail: string;
167
+ summary: string;
168
+ severity: "blocker" | "major" | "minor" | "nit";
169
+ path?: string | undefined;
170
+ line?: number | undefined;
171
+ }[];
172
+ seat: number;
173
+ schema: "pp-review-v1";
174
+ round: number;
175
+ packet_digest: string;
176
+ candidate_identity: string;
177
+ sign_off: {
178
+ score: number;
179
+ approved: boolean;
180
+ blocking_rejected?: string[] | undefined;
181
+ };
182
+ }>;
183
+ export type PpReview = z.infer<typeof PpReviewSchema>;
184
+ export interface PpReviewBinding {
185
+ readonly round: number;
186
+ readonly seat: number;
187
+ readonly packetDigest: string;
188
+ readonly candidateIdentity: string;
189
+ readonly signOffThreshold: number;
190
+ /** Findings validated from earlier seats this round (24 per round overall). */
191
+ readonly findingsFromEarlierSeatsThisRound: number;
192
+ /** Ids in the dispatched packet's `rejected` list; `blocking_rejected` may name only these. */
193
+ readonly rejectedIds: readonly string[];
194
+ }
195
+ /** The packet's `findings_budget_remaining`: what this seat may still report this round. */
196
+ export declare function findingsBudgetRemaining(findingsFromEarlierSeatsThisRound: number): number;
197
+ export type PpReviewValidation = {
198
+ readonly ok: true;
199
+ readonly review: PpReview;
200
+ readonly outcome: "signed_off" | "withheld";
201
+ /** Host-assigned ids `R{round}-S{seat}-{n}`, numbered per seat from 1. */
202
+ readonly findings: readonly RecipeFinding[];
203
+ } | {
204
+ readonly ok: false;
205
+ readonly reason: Exclude<PpReviewerRetryReason, "provider_error">;
206
+ readonly detail: string;
207
+ };
208
+ /**
209
+ * Validate one reviewer's raw output against its dispatched packet. Any
210
+ * failure makes the seat `failed` (never `withheld`), and a failed seat
211
+ * produces no findings.
212
+ */
213
+ export declare function validatePpReview(raw: string, binding: PpReviewBinding): PpReviewValidation;
214
+ export declare const PpDecisionSchema: z.ZodEffects<z.ZodObject<{
215
+ admit: z.ZodDefault<z.ZodArray<z.ZodObject<{
216
+ id: z.ZodString;
217
+ rationale: z.ZodString;
218
+ }, "strict", z.ZodTypeAny, {
219
+ id: string;
220
+ rationale: string;
221
+ }, {
222
+ id: string;
223
+ rationale: string;
224
+ }>, "many">>;
225
+ reject: z.ZodDefault<z.ZodArray<z.ZodObject<{
226
+ id: z.ZodString;
227
+ reason: z.ZodString;
228
+ }, "strict", z.ZodTypeAny, {
229
+ id: string;
230
+ reason: string;
231
+ }, {
232
+ id: string;
233
+ reason: string;
234
+ }>, "many">>;
235
+ audit_requests: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
236
+ stop: z.ZodDefault<z.ZodBoolean>;
237
+ }, "strict", z.ZodTypeAny, {
238
+ reject: {
239
+ id: string;
240
+ reason: string;
241
+ }[];
242
+ admit: {
243
+ id: string;
244
+ rationale: string;
245
+ }[];
246
+ audit_requests: string[];
247
+ stop: boolean;
248
+ }, {
249
+ reject?: {
250
+ id: string;
251
+ reason: string;
252
+ }[] | undefined;
253
+ admit?: {
254
+ id: string;
255
+ rationale: string;
256
+ }[] | undefined;
257
+ audit_requests?: string[] | undefined;
258
+ stop?: boolean | undefined;
259
+ }>, {
260
+ reject: {
261
+ id: string;
262
+ reason: string;
263
+ }[];
264
+ admit: {
265
+ id: string;
266
+ rationale: string;
267
+ }[];
268
+ audit_requests: string[];
269
+ stop: boolean;
270
+ }, {
271
+ reject?: {
272
+ id: string;
273
+ reason: string;
274
+ }[] | undefined;
275
+ admit?: {
276
+ id: string;
277
+ rationale: string;
278
+ }[] | undefined;
279
+ audit_requests?: string[] | undefined;
280
+ stop?: boolean | undefined;
281
+ }>;
282
+ export type PpDecision = z.infer<typeof PpDecisionSchema>;
283
+ export declare const PpDecisionInputSchema: z.ZodObject<{
284
+ run_id: z.ZodString;
285
+ execution_id: z.ZodString;
286
+ revision: z.ZodNumber;
287
+ decision: z.ZodEffects<z.ZodObject<{
288
+ admit: z.ZodDefault<z.ZodArray<z.ZodObject<{
289
+ id: z.ZodString;
290
+ rationale: z.ZodString;
291
+ }, "strict", z.ZodTypeAny, {
292
+ id: string;
293
+ rationale: string;
294
+ }, {
295
+ id: string;
296
+ rationale: string;
297
+ }>, "many">>;
298
+ reject: z.ZodDefault<z.ZodArray<z.ZodObject<{
299
+ id: z.ZodString;
300
+ reason: z.ZodString;
301
+ }, "strict", z.ZodTypeAny, {
302
+ id: string;
303
+ reason: string;
304
+ }, {
305
+ id: string;
306
+ reason: string;
307
+ }>, "many">>;
308
+ audit_requests: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
309
+ stop: z.ZodDefault<z.ZodBoolean>;
310
+ }, "strict", z.ZodTypeAny, {
311
+ reject: {
312
+ id: string;
313
+ reason: string;
314
+ }[];
315
+ admit: {
316
+ id: string;
317
+ rationale: string;
318
+ }[];
319
+ audit_requests: string[];
320
+ stop: boolean;
321
+ }, {
322
+ reject?: {
323
+ id: string;
324
+ reason: string;
325
+ }[] | undefined;
326
+ admit?: {
327
+ id: string;
328
+ rationale: string;
329
+ }[] | undefined;
330
+ audit_requests?: string[] | undefined;
331
+ stop?: boolean | undefined;
332
+ }>, {
333
+ reject: {
334
+ id: string;
335
+ reason: string;
336
+ }[];
337
+ admit: {
338
+ id: string;
339
+ rationale: string;
340
+ }[];
341
+ audit_requests: string[];
342
+ stop: boolean;
343
+ }, {
344
+ reject?: {
345
+ id: string;
346
+ reason: string;
347
+ }[] | undefined;
348
+ admit?: {
349
+ id: string;
350
+ rationale: string;
351
+ }[] | undefined;
352
+ audit_requests?: string[] | undefined;
353
+ stop?: boolean | undefined;
354
+ }>;
355
+ }, "strict", z.ZodTypeAny, {
356
+ revision: number;
357
+ run_id: string;
358
+ decision: {
359
+ reject: {
360
+ id: string;
361
+ reason: string;
362
+ }[];
363
+ admit: {
364
+ id: string;
365
+ rationale: string;
366
+ }[];
367
+ audit_requests: string[];
368
+ stop: boolean;
369
+ };
370
+ execution_id: string;
371
+ }, {
372
+ revision: number;
373
+ run_id: string;
374
+ decision: {
375
+ reject?: {
376
+ id: string;
377
+ reason: string;
378
+ }[] | undefined;
379
+ admit?: {
380
+ id: string;
381
+ rationale: string;
382
+ }[] | undefined;
383
+ audit_requests?: string[] | undefined;
384
+ stop?: boolean | undefined;
385
+ };
386
+ execution_id: string;
387
+ }>;
388
+ export type PpDecisionInput = z.infer<typeof PpDecisionInputSchema>;
389
+ /** sha256 over the canonical JSON of the parsed (defaults applied) decision. */
390
+ export declare function decisionDigest(decision: PpDecision): string;
391
+ export declare const PpDecisionReceiptSchema: z.ZodObject<{
392
+ run_id: z.ZodString;
393
+ execution_id: z.ZodString;
394
+ revision: z.ZodNumber;
395
+ phase: z.ZodEnum<["admitted", "implementing", "verifying", "reviewing", "awaiting_decision", "remediating", "final_verifying", "stopped", "qualified"]>;
396
+ outcome: z.ZodOptional<z.ZodEnum<["qualified", "stopped", "failed", "cancelled"]>>;
397
+ stop_reason: z.ZodOptional<z.ZodEnum<["main_agent_stop", "round_budget_exhausted", "no_sign_off", "seat_unavailable", "no_progress", "final_verification_failed", "acceptance_input_changed", "target_changed_during_review", "recovery_required", "permission_failure", "deadline_exceeded", "active_budget_exhausted", "evidence_capacity", "cancelled"]>>;
398
+ replayed: z.ZodBoolean;
399
+ }, "strict", z.ZodTypeAny, {
400
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
401
+ revision: number;
402
+ run_id: string;
403
+ execution_id: string;
404
+ replayed: boolean;
405
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
406
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
407
+ }, {
408
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
409
+ revision: number;
410
+ run_id: string;
411
+ execution_id: string;
412
+ replayed: boolean;
413
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
414
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
415
+ }>;
416
+ export type PpDecisionReceipt = z.infer<typeof PpDecisionReceiptSchema>;
417
+ export declare const PpDecisionRecordSchema: z.ZodEffects<z.ZodObject<{
418
+ source_execution_id: z.ZodString;
419
+ source_revision: z.ZodNumber;
420
+ decision_digest: z.ZodString;
421
+ decision: z.ZodEffects<z.ZodObject<{
422
+ admit: z.ZodDefault<z.ZodArray<z.ZodObject<{
423
+ id: z.ZodString;
424
+ rationale: z.ZodString;
425
+ }, "strict", z.ZodTypeAny, {
426
+ id: string;
427
+ rationale: string;
428
+ }, {
429
+ id: string;
430
+ rationale: string;
431
+ }>, "many">>;
432
+ reject: z.ZodDefault<z.ZodArray<z.ZodObject<{
433
+ id: z.ZodString;
434
+ reason: z.ZodString;
435
+ }, "strict", z.ZodTypeAny, {
436
+ id: string;
437
+ reason: string;
438
+ }, {
439
+ id: string;
440
+ reason: string;
441
+ }>, "many">>;
442
+ audit_requests: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
443
+ stop: z.ZodDefault<z.ZodBoolean>;
444
+ }, "strict", z.ZodTypeAny, {
445
+ reject: {
446
+ id: string;
447
+ reason: string;
448
+ }[];
449
+ admit: {
450
+ id: string;
451
+ rationale: string;
452
+ }[];
453
+ audit_requests: string[];
454
+ stop: boolean;
455
+ }, {
456
+ reject?: {
457
+ id: string;
458
+ reason: string;
459
+ }[] | undefined;
460
+ admit?: {
461
+ id: string;
462
+ rationale: string;
463
+ }[] | undefined;
464
+ audit_requests?: string[] | undefined;
465
+ stop?: boolean | undefined;
466
+ }>, {
467
+ reject: {
468
+ id: string;
469
+ reason: string;
470
+ }[];
471
+ admit: {
472
+ id: string;
473
+ rationale: string;
474
+ }[];
475
+ audit_requests: string[];
476
+ stop: boolean;
477
+ }, {
478
+ reject?: {
479
+ id: string;
480
+ reason: string;
481
+ }[] | undefined;
482
+ admit?: {
483
+ id: string;
484
+ rationale: string;
485
+ }[] | undefined;
486
+ audit_requests?: string[] | undefined;
487
+ stop?: boolean | undefined;
488
+ }>;
489
+ new_execution_id: z.ZodString;
490
+ new_revision: z.ZodNumber;
491
+ next_phase: z.ZodEnum<["admitted", "implementing", "verifying", "reviewing", "awaiting_decision", "remediating", "final_verifying", "stopped", "qualified"]>;
492
+ stop_reason: z.ZodOptional<z.ZodEnum<["main_agent_stop", "round_budget_exhausted", "no_sign_off", "seat_unavailable", "no_progress", "final_verification_failed", "acceptance_input_changed", "target_changed_during_review", "recovery_required", "permission_failure", "deadline_exceeded", "active_budget_exhausted", "evidence_capacity", "cancelled"]>>;
493
+ recorded_at: z.ZodEffects<z.ZodString, string, string>;
494
+ receipt: z.ZodObject<{
495
+ run_id: z.ZodString;
496
+ execution_id: z.ZodString;
497
+ revision: z.ZodNumber;
498
+ phase: z.ZodEnum<["admitted", "implementing", "verifying", "reviewing", "awaiting_decision", "remediating", "final_verifying", "stopped", "qualified"]>;
499
+ outcome: z.ZodOptional<z.ZodEnum<["qualified", "stopped", "failed", "cancelled"]>>;
500
+ stop_reason: z.ZodOptional<z.ZodEnum<["main_agent_stop", "round_budget_exhausted", "no_sign_off", "seat_unavailable", "no_progress", "final_verification_failed", "acceptance_input_changed", "target_changed_during_review", "recovery_required", "permission_failure", "deadline_exceeded", "active_budget_exhausted", "evidence_capacity", "cancelled"]>>;
501
+ replayed: z.ZodBoolean;
502
+ }, "strict", z.ZodTypeAny, {
503
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
504
+ revision: number;
505
+ run_id: string;
506
+ execution_id: string;
507
+ replayed: boolean;
508
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
509
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
510
+ }, {
511
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
512
+ revision: number;
513
+ run_id: string;
514
+ execution_id: string;
515
+ replayed: boolean;
516
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
517
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
518
+ }>;
519
+ }, "strict", z.ZodTypeAny, {
520
+ decision: {
521
+ reject: {
522
+ id: string;
523
+ reason: string;
524
+ }[];
525
+ admit: {
526
+ id: string;
527
+ rationale: string;
528
+ }[];
529
+ audit_requests: string[];
530
+ stop: boolean;
531
+ };
532
+ source_execution_id: string;
533
+ source_revision: number;
534
+ decision_digest: string;
535
+ new_execution_id: string;
536
+ new_revision: number;
537
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
538
+ recorded_at: string;
539
+ receipt: {
540
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
541
+ revision: number;
542
+ run_id: string;
543
+ execution_id: string;
544
+ replayed: boolean;
545
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
546
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
547
+ };
548
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
549
+ }, {
550
+ decision: {
551
+ reject?: {
552
+ id: string;
553
+ reason: string;
554
+ }[] | undefined;
555
+ admit?: {
556
+ id: string;
557
+ rationale: string;
558
+ }[] | undefined;
559
+ audit_requests?: string[] | undefined;
560
+ stop?: boolean | undefined;
561
+ };
562
+ source_execution_id: string;
563
+ source_revision: number;
564
+ decision_digest: string;
565
+ new_execution_id: string;
566
+ new_revision: number;
567
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
568
+ recorded_at: string;
569
+ receipt: {
570
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
571
+ revision: number;
572
+ run_id: string;
573
+ execution_id: string;
574
+ replayed: boolean;
575
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
576
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
577
+ };
578
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
579
+ }>, {
580
+ decision: {
581
+ reject: {
582
+ id: string;
583
+ reason: string;
584
+ }[];
585
+ admit: {
586
+ id: string;
587
+ rationale: string;
588
+ }[];
589
+ audit_requests: string[];
590
+ stop: boolean;
591
+ };
592
+ source_execution_id: string;
593
+ source_revision: number;
594
+ decision_digest: string;
595
+ new_execution_id: string;
596
+ new_revision: number;
597
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
598
+ recorded_at: string;
599
+ receipt: {
600
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
601
+ revision: number;
602
+ run_id: string;
603
+ execution_id: string;
604
+ replayed: boolean;
605
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
606
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
607
+ };
608
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
609
+ }, {
610
+ decision: {
611
+ reject?: {
612
+ id: string;
613
+ reason: string;
614
+ }[] | undefined;
615
+ admit?: {
616
+ id: string;
617
+ rationale: string;
618
+ }[] | undefined;
619
+ audit_requests?: string[] | undefined;
620
+ stop?: boolean | undefined;
621
+ };
622
+ source_execution_id: string;
623
+ source_revision: number;
624
+ decision_digest: string;
625
+ new_execution_id: string;
626
+ new_revision: number;
627
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
628
+ recorded_at: string;
629
+ receipt: {
630
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
631
+ revision: number;
632
+ run_id: string;
633
+ execution_id: string;
634
+ replayed: boolean;
635
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
636
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
637
+ };
638
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
639
+ }>;
640
+ export type PpDecisionRecord = z.infer<typeof PpDecisionRecordSchema>;
641
+ export declare const RecipeFindingSchema: z.ZodEffects<z.ZodObject<{
642
+ id: z.ZodString;
643
+ round: z.ZodNumber;
644
+ seat: z.ZodNumber;
645
+ severity: z.ZodEnum<["blocker", "major", "minor", "nit"]>;
646
+ path: z.ZodOptional<z.ZodString>;
647
+ line: z.ZodOptional<z.ZodNumber>;
648
+ summary: z.ZodString;
649
+ detail: z.ZodEffects<z.ZodString, string, string>;
650
+ }, "strict", z.ZodTypeAny, {
651
+ id: string;
652
+ detail: string;
653
+ seat: number;
654
+ summary: string;
655
+ severity: "blocker" | "major" | "minor" | "nit";
656
+ round: number;
657
+ path?: string | undefined;
658
+ line?: number | undefined;
659
+ }, {
660
+ id: string;
661
+ detail: string;
662
+ seat: number;
663
+ summary: string;
664
+ severity: "blocker" | "major" | "minor" | "nit";
665
+ round: number;
666
+ path?: string | undefined;
667
+ line?: number | undefined;
668
+ }>, {
669
+ id: string;
670
+ detail: string;
671
+ seat: number;
672
+ summary: string;
673
+ severity: "blocker" | "major" | "minor" | "nit";
674
+ round: number;
675
+ path?: string | undefined;
676
+ line?: number | undefined;
677
+ }, {
678
+ id: string;
679
+ detail: string;
680
+ seat: number;
681
+ summary: string;
682
+ severity: "blocker" | "major" | "minor" | "nit";
683
+ round: number;
684
+ path?: string | undefined;
685
+ line?: number | undefined;
686
+ }>;
687
+ export type RecipeFinding = z.infer<typeof RecipeFindingSchema>;
688
+ export declare const AdmittedFindingSchema: z.ZodObject<{
689
+ finding: z.ZodEffects<z.ZodObject<{
690
+ id: z.ZodString;
691
+ round: z.ZodNumber;
692
+ seat: z.ZodNumber;
693
+ severity: z.ZodEnum<["blocker", "major", "minor", "nit"]>;
694
+ path: z.ZodOptional<z.ZodString>;
695
+ line: z.ZodOptional<z.ZodNumber>;
696
+ summary: z.ZodString;
697
+ detail: z.ZodEffects<z.ZodString, string, string>;
698
+ }, "strict", z.ZodTypeAny, {
699
+ id: string;
700
+ detail: string;
701
+ seat: number;
702
+ summary: string;
703
+ severity: "blocker" | "major" | "minor" | "nit";
704
+ round: number;
705
+ path?: string | undefined;
706
+ line?: number | undefined;
707
+ }, {
708
+ id: string;
709
+ detail: string;
710
+ seat: number;
711
+ summary: string;
712
+ severity: "blocker" | "major" | "minor" | "nit";
713
+ round: number;
714
+ path?: string | undefined;
715
+ line?: number | undefined;
716
+ }>, {
717
+ id: string;
718
+ detail: string;
719
+ seat: number;
720
+ summary: string;
721
+ severity: "blocker" | "major" | "minor" | "nit";
722
+ round: number;
723
+ path?: string | undefined;
724
+ line?: number | undefined;
725
+ }, {
726
+ id: string;
727
+ detail: string;
728
+ seat: number;
729
+ summary: string;
730
+ severity: "blocker" | "major" | "minor" | "nit";
731
+ round: number;
732
+ path?: string | undefined;
733
+ line?: number | undefined;
734
+ }>;
735
+ rationale: z.ZodString;
736
+ decided_revision: z.ZodNumber;
737
+ }, "strict", z.ZodTypeAny, {
738
+ rationale: string;
739
+ finding: {
740
+ id: string;
741
+ detail: string;
742
+ seat: number;
743
+ summary: string;
744
+ severity: "blocker" | "major" | "minor" | "nit";
745
+ round: number;
746
+ path?: string | undefined;
747
+ line?: number | undefined;
748
+ };
749
+ decided_revision: number;
750
+ }, {
751
+ rationale: string;
752
+ finding: {
753
+ id: string;
754
+ detail: string;
755
+ seat: number;
756
+ summary: string;
757
+ severity: "blocker" | "major" | "minor" | "nit";
758
+ round: number;
759
+ path?: string | undefined;
760
+ line?: number | undefined;
761
+ };
762
+ decided_revision: number;
763
+ }>;
764
+ export type AdmittedFinding = z.infer<typeof AdmittedFindingSchema>;
765
+ export declare const RejectedFindingSchema: z.ZodObject<{
766
+ id: z.ZodString;
767
+ reason: z.ZodString;
768
+ decided_revision: z.ZodNumber;
769
+ /** The rejected finding's summary, so later packets can say what was rejected. Absent on older sidecars. */
770
+ summary: z.ZodOptional<z.ZodString>;
771
+ }, "strict", z.ZodTypeAny, {
772
+ id: string;
773
+ reason: string;
774
+ decided_revision: number;
775
+ summary?: string | undefined;
776
+ }, {
777
+ id: string;
778
+ reason: string;
779
+ decided_revision: number;
780
+ summary?: string | undefined;
781
+ }>;
782
+ export type RejectedFinding = z.infer<typeof RejectedFindingSchema>;
783
+ export declare const ReviewerResultSchema: z.ZodObject<{
784
+ seat: z.ZodNumber;
785
+ outcome: z.ZodEnum<["signed_off", "withheld", "failed"]>;
786
+ reason: z.ZodOptional<z.ZodString>;
787
+ score: z.ZodOptional<z.ZodNumber>;
788
+ }, "strict", z.ZodTypeAny, {
789
+ seat: number;
790
+ outcome: "failed" | "signed_off" | "withheld";
791
+ score?: number | undefined;
792
+ reason?: string | undefined;
793
+ }, {
794
+ seat: number;
795
+ outcome: "failed" | "signed_off" | "withheld";
796
+ score?: number | undefined;
797
+ reason?: string | undefined;
798
+ }>;
799
+ export type ReviewerResult = z.infer<typeof ReviewerResultSchema>;
800
+ /** Machine codes a reviewer retry may carry (D-C); never provider text. */
801
+ export declare const PP_REVIEWER_RETRY_REASONS: readonly ["oversize", "invalid_json", "schema", "echo_mismatch", "self_contradictory", "finding_overflow", "unjustified_withhold", "provider_error"];
802
+ export type PpReviewerRetryReason = (typeof PP_REVIEWER_RETRY_REASONS)[number];
803
+ export declare const RecipeOperationSchema: z.ZodEffects<z.ZodObject<{
804
+ id: z.ZodString;
805
+ kind: z.ZodEnum<["writer", "reviewer", "verification", "identity", "control"]>;
806
+ round: z.ZodNumber;
807
+ /** 0 = implementer, 1..4 = reviewer seat; absent for host-only operations. */
808
+ seat: z.ZodOptional<z.ZodNumber>;
809
+ stage_id: z.ZodOptional<z.ZodString>;
810
+ call_id: z.ZodOptional<z.ZodString>;
811
+ execution_id: z.ZodString;
812
+ status: z.ZodEnum<["intent_recorded", "result_recorded", "uncertain"]>;
813
+ intent_at: z.ZodEffects<z.ZodString, string, string>;
814
+ result_at: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
815
+ /** Bounded, non-sensitive note (for example why an operation is uncertain). */
816
+ note: z.ZodOptional<z.ZodString>;
817
+ /**
818
+ * Reviewer dispatches (rev. 3), recorded with the intent before dispatch:
819
+ * the packet's `packet_digest`, the attempt (2 = the D-C retry) and its
820
+ * retry reason, and the dispatched packet bytes as immutable evidence
821
+ * (`packet_file`, relative to the run dir; `packet_sha256` over its bytes).
822
+ */
823
+ attempt: z.ZodOptional<z.ZodNumber>;
824
+ retry_reason: z.ZodOptional<z.ZodEnum<["oversize", "invalid_json", "schema", "echo_mismatch", "self_contradictory", "finding_overflow", "unjustified_withhold", "provider_error"]>>;
825
+ packet_digest: z.ZodOptional<z.ZodString>;
826
+ packet_file: z.ZodOptional<z.ZodString>;
827
+ packet_sha256: z.ZodOptional<z.ZodString>;
828
+ }, "strict", z.ZodTypeAny, {
829
+ status: "intent_recorded" | "result_recorded" | "uncertain";
830
+ id: string;
831
+ round: number;
832
+ execution_id: string;
833
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
834
+ intent_at: string;
835
+ stage_id?: string | undefined;
836
+ call_id?: string | undefined;
837
+ seat?: number | undefined;
838
+ note?: string | undefined;
839
+ packet_digest?: string | undefined;
840
+ result_at?: string | undefined;
841
+ attempt?: number | undefined;
842
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
843
+ packet_file?: string | undefined;
844
+ packet_sha256?: string | undefined;
845
+ }, {
846
+ status: "intent_recorded" | "result_recorded" | "uncertain";
847
+ id: string;
848
+ round: number;
849
+ execution_id: string;
850
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
851
+ intent_at: string;
852
+ stage_id?: string | undefined;
853
+ call_id?: string | undefined;
854
+ seat?: number | undefined;
855
+ note?: string | undefined;
856
+ packet_digest?: string | undefined;
857
+ result_at?: string | undefined;
858
+ attempt?: number | undefined;
859
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
860
+ packet_file?: string | undefined;
861
+ packet_sha256?: string | undefined;
862
+ }>, {
863
+ status: "intent_recorded" | "result_recorded" | "uncertain";
864
+ id: string;
865
+ round: number;
866
+ execution_id: string;
867
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
868
+ intent_at: string;
869
+ stage_id?: string | undefined;
870
+ call_id?: string | undefined;
871
+ seat?: number | undefined;
872
+ note?: string | undefined;
873
+ packet_digest?: string | undefined;
874
+ result_at?: string | undefined;
875
+ attempt?: number | undefined;
876
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
877
+ packet_file?: string | undefined;
878
+ packet_sha256?: string | undefined;
879
+ }, {
880
+ status: "intent_recorded" | "result_recorded" | "uncertain";
881
+ id: string;
882
+ round: number;
883
+ execution_id: string;
884
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
885
+ intent_at: string;
886
+ stage_id?: string | undefined;
887
+ call_id?: string | undefined;
888
+ seat?: number | undefined;
889
+ note?: string | undefined;
890
+ packet_digest?: string | undefined;
891
+ result_at?: string | undefined;
892
+ attempt?: number | undefined;
893
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
894
+ packet_file?: string | undefined;
895
+ packet_sha256?: string | undefined;
896
+ }>;
897
+ export type RecipeOperation = z.infer<typeof RecipeOperationSchema>;
898
+ export declare const RecipeWorktreeSchema: z.ZodObject<{
899
+ /** `implementer` or `author-<i>` (CONTRACTS C5). */
900
+ seat: z.ZodString;
901
+ path: z.ZodEffects<z.ZodString, string, string>;
902
+ }, "strict", z.ZodTypeAny, {
903
+ path: string;
904
+ seat: string;
905
+ }, {
906
+ path: string;
907
+ seat: string;
908
+ }>;
909
+ export declare const RoundHistoryEntrySchema: z.ZodObject<{
910
+ round: z.ZodNumber;
911
+ /** Candidate identity at the writer's confirmed exit (0-3). */
912
+ candidate_identity: z.ZodOptional<z.ZodString>;
913
+ /** Byte witness at the same exit; decides whether the next round left the candidate unchanged. */
914
+ candidate_witness: z.ZodOptional<z.ZodString>;
915
+ /** Normalized digest of the findings (severity, path, summary) the decision on this round admitted, written at decide (no_progress). */
916
+ admitted_findings_digest: z.ZodOptional<z.ZodString>;
917
+ }, "strict", z.ZodTypeAny, {
918
+ round: number;
919
+ candidate_identity?: string | undefined;
920
+ candidate_witness?: string | undefined;
921
+ admitted_findings_digest?: string | undefined;
922
+ }, {
923
+ round: number;
924
+ candidate_identity?: string | undefined;
925
+ candidate_witness?: string | undefined;
926
+ admitted_findings_digest?: string | undefined;
927
+ }>;
928
+ /** Bound on recorded per-key digests per config file (the host omits `keys` above it). */
929
+ export declare const PP_MAX_GIT_METADATA_KEYS = 256;
930
+ /**
931
+ * D4c shared git-metadata snapshot, taken once at worktree creation and
932
+ * passed back to the host on every later call (never re-taken on resume).
933
+ * Digests only; never config values.
934
+ */
935
+ export declare const RecipeGitMetadataSnapshotSchema: z.ZodObject<{
936
+ version: z.ZodLiteral<1>;
937
+ digest: z.ZodString;
938
+ files: z.ZodArray<z.ZodObject<{
939
+ name: z.ZodString;
940
+ path: z.ZodEffects<z.ZodString, string, string>;
941
+ kind: z.ZodEnum<["config", "raw"]>;
942
+ state: z.ZodEnum<["absent", "file", "symlink", "other"]>;
943
+ sha256: z.ZodOptional<z.ZodString>;
944
+ entries_sha256: z.ZodOptional<z.ZodString>;
945
+ keys: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
946
+ }, "strict", z.ZodTypeAny, {
947
+ path: string;
948
+ name: string;
949
+ state: "file" | "absent" | "symlink" | "other";
950
+ kind: "config" | "raw";
951
+ keys?: Record<string, string> | undefined;
952
+ sha256?: string | undefined;
953
+ entries_sha256?: string | undefined;
954
+ }, {
955
+ path: string;
956
+ name: string;
957
+ state: "file" | "absent" | "symlink" | "other";
958
+ kind: "config" | "raw";
959
+ keys?: Record<string, string> | undefined;
960
+ sha256?: string | undefined;
961
+ entries_sha256?: string | undefined;
962
+ }>, "many">;
963
+ }, "strict", z.ZodTypeAny, {
964
+ version: 1;
965
+ digest: string;
966
+ files: {
967
+ path: string;
968
+ name: string;
969
+ state: "file" | "absent" | "symlink" | "other";
970
+ kind: "config" | "raw";
971
+ keys?: Record<string, string> | undefined;
972
+ sha256?: string | undefined;
973
+ entries_sha256?: string | undefined;
974
+ }[];
975
+ }, {
976
+ version: 1;
977
+ digest: string;
978
+ files: {
979
+ path: string;
980
+ name: string;
981
+ state: "file" | "absent" | "symlink" | "other";
982
+ kind: "config" | "raw";
983
+ keys?: Record<string, string> | undefined;
984
+ sha256?: string | undefined;
985
+ entries_sha256?: string | undefined;
986
+ }[];
987
+ }>;
988
+ export declare const AcceptancePinSchema: z.ZodObject<{
989
+ path: z.ZodString;
990
+ sha256: z.ZodString;
991
+ }, "strict", z.ZodTypeAny, {
992
+ path: string;
993
+ sha256: string;
994
+ }, {
995
+ path: string;
996
+ sha256: string;
997
+ }>;
998
+ export declare const RecipeStateV1Schema: z.ZodEffects<z.ZodObject<{
999
+ schema: z.ZodLiteral<"recipe-state-v1">;
1000
+ workflow: z.ZodLiteral<"ping-pong">;
1001
+ run_id: z.ZodString;
1002
+ execution_id: z.ZodString;
1003
+ revision: z.ZodNumber;
1004
+ updated_at: z.ZodEffects<z.ZodString, string, string>;
1005
+ phase: z.ZodEnum<["admitted", "implementing", "verifying", "reviewing", "awaiting_decision", "remediating", "final_verifying", "stopped", "qualified"]>;
1006
+ outcome: z.ZodOptional<z.ZodEnum<["qualified", "stopped", "failed", "cancelled"]>>;
1007
+ stop_reason: z.ZodOptional<z.ZodEnum<["main_agent_stop", "round_budget_exhausted", "no_sign_off", "seat_unavailable", "no_progress", "final_verification_failed", "acceptance_input_changed", "target_changed_during_review", "recovery_required", "permission_failure", "deadline_exceeded", "active_budget_exhausted", "evidence_capacity", "cancelled"]>>;
1008
+ /**
1009
+ * Value-free cause of a stop, e.g. the drifted git metadata file, key
1010
+ * names and a remediation hint. Never config values.
1011
+ */
1012
+ stop_detail: z.ZodOptional<z.ZodString>;
1013
+ rounds_used: z.ZodNumber;
1014
+ round_cap: z.ZodNumber;
1015
+ sign_off_threshold: z.ZodNumber;
1016
+ reviewer_count: z.ZodNumber;
1017
+ active_budget: z.ZodObject<{
1018
+ used_seconds: z.ZodNumber;
1019
+ limit_seconds: z.ZodNumber;
1020
+ }, "strict", z.ZodTypeAny, {
1021
+ used_seconds: number;
1022
+ limit_seconds: number;
1023
+ }, {
1024
+ used_seconds: number;
1025
+ limit_seconds: number;
1026
+ }>;
1027
+ admitted_at: z.ZodEffects<z.ZodString, string, string>;
1028
+ deadline_at: z.ZodEffects<z.ZodString, string, string>;
1029
+ awaiting_since: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1030
+ baseline: z.ZodObject<{
1031
+ repo_root: z.ZodEffects<z.ZodString, string, string>;
1032
+ commit: z.ZodString;
1033
+ uncommitted_changes_excluded: z.ZodOptional<z.ZodBoolean>;
1034
+ }, "strict", z.ZodTypeAny, {
1035
+ repo_root: string;
1036
+ commit: string;
1037
+ uncommitted_changes_excluded?: boolean | undefined;
1038
+ }, {
1039
+ repo_root: string;
1040
+ commit: string;
1041
+ uncommitted_changes_excluded?: boolean | undefined;
1042
+ }>;
1043
+ /** Tree id of the candidate; reviewers echo it and the delta is computed from it. */
1044
+ candidate_identity: z.ZodOptional<z.ZodString>;
1045
+ /**
1046
+ * Raw-byte witness of the same snapshot. Sign-off binds to it: any later
1047
+ * capture with a different witness voids the round even under an
1048
+ * identical tree id. Absent on sidecars written before it existed.
1049
+ */
1050
+ candidate_witness: z.ZodOptional<z.ZodString>;
1051
+ worktrees: z.ZodArray<z.ZodObject<{
1052
+ /** `implementer` or `author-<i>` (CONTRACTS C5). */
1053
+ seat: z.ZodString;
1054
+ path: z.ZodEffects<z.ZodString, string, string>;
1055
+ }, "strict", z.ZodTypeAny, {
1056
+ path: string;
1057
+ seat: string;
1058
+ }, {
1059
+ path: string;
1060
+ seat: string;
1061
+ }>, "many">;
1062
+ /** Absent on sidecars written before the drift check (no recheck then). */
1063
+ git_metadata_snapshot: z.ZodOptional<z.ZodObject<{
1064
+ version: z.ZodLiteral<1>;
1065
+ digest: z.ZodString;
1066
+ files: z.ZodArray<z.ZodObject<{
1067
+ name: z.ZodString;
1068
+ path: z.ZodEffects<z.ZodString, string, string>;
1069
+ kind: z.ZodEnum<["config", "raw"]>;
1070
+ state: z.ZodEnum<["absent", "file", "symlink", "other"]>;
1071
+ sha256: z.ZodOptional<z.ZodString>;
1072
+ entries_sha256: z.ZodOptional<z.ZodString>;
1073
+ keys: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodString>, Record<string, string>, Record<string, string>>>;
1074
+ }, "strict", z.ZodTypeAny, {
1075
+ path: string;
1076
+ name: string;
1077
+ state: "file" | "absent" | "symlink" | "other";
1078
+ kind: "config" | "raw";
1079
+ keys?: Record<string, string> | undefined;
1080
+ sha256?: string | undefined;
1081
+ entries_sha256?: string | undefined;
1082
+ }, {
1083
+ path: string;
1084
+ name: string;
1085
+ state: "file" | "absent" | "symlink" | "other";
1086
+ kind: "config" | "raw";
1087
+ keys?: Record<string, string> | undefined;
1088
+ sha256?: string | undefined;
1089
+ entries_sha256?: string | undefined;
1090
+ }>, "many">;
1091
+ }, "strict", z.ZodTypeAny, {
1092
+ version: 1;
1093
+ digest: string;
1094
+ files: {
1095
+ path: string;
1096
+ name: string;
1097
+ state: "file" | "absent" | "symlink" | "other";
1098
+ kind: "config" | "raw";
1099
+ keys?: Record<string, string> | undefined;
1100
+ sha256?: string | undefined;
1101
+ entries_sha256?: string | undefined;
1102
+ }[];
1103
+ }, {
1104
+ version: 1;
1105
+ digest: string;
1106
+ files: {
1107
+ path: string;
1108
+ name: string;
1109
+ state: "file" | "absent" | "symlink" | "other";
1110
+ kind: "config" | "raw";
1111
+ keys?: Record<string, string> | undefined;
1112
+ sha256?: string | undefined;
1113
+ entries_sha256?: string | undefined;
1114
+ }[];
1115
+ }>>;
1116
+ acceptance_pins: z.ZodDefault<z.ZodArray<z.ZodObject<{
1117
+ path: z.ZodString;
1118
+ sha256: z.ZodString;
1119
+ }, "strict", z.ZodTypeAny, {
1120
+ path: string;
1121
+ sha256: string;
1122
+ }, {
1123
+ path: string;
1124
+ sha256: string;
1125
+ }>, "many">>;
1126
+ operations: z.ZodArray<z.ZodEffects<z.ZodObject<{
1127
+ id: z.ZodString;
1128
+ kind: z.ZodEnum<["writer", "reviewer", "verification", "identity", "control"]>;
1129
+ round: z.ZodNumber;
1130
+ /** 0 = implementer, 1..4 = reviewer seat; absent for host-only operations. */
1131
+ seat: z.ZodOptional<z.ZodNumber>;
1132
+ stage_id: z.ZodOptional<z.ZodString>;
1133
+ call_id: z.ZodOptional<z.ZodString>;
1134
+ execution_id: z.ZodString;
1135
+ status: z.ZodEnum<["intent_recorded", "result_recorded", "uncertain"]>;
1136
+ intent_at: z.ZodEffects<z.ZodString, string, string>;
1137
+ result_at: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
1138
+ /** Bounded, non-sensitive note (for example why an operation is uncertain). */
1139
+ note: z.ZodOptional<z.ZodString>;
1140
+ /**
1141
+ * Reviewer dispatches (rev. 3), recorded with the intent before dispatch:
1142
+ * the packet's `packet_digest`, the attempt (2 = the D-C retry) and its
1143
+ * retry reason, and the dispatched packet bytes as immutable evidence
1144
+ * (`packet_file`, relative to the run dir; `packet_sha256` over its bytes).
1145
+ */
1146
+ attempt: z.ZodOptional<z.ZodNumber>;
1147
+ retry_reason: z.ZodOptional<z.ZodEnum<["oversize", "invalid_json", "schema", "echo_mismatch", "self_contradictory", "finding_overflow", "unjustified_withhold", "provider_error"]>>;
1148
+ packet_digest: z.ZodOptional<z.ZodString>;
1149
+ packet_file: z.ZodOptional<z.ZodString>;
1150
+ packet_sha256: z.ZodOptional<z.ZodString>;
1151
+ }, "strict", z.ZodTypeAny, {
1152
+ status: "intent_recorded" | "result_recorded" | "uncertain";
1153
+ id: string;
1154
+ round: number;
1155
+ execution_id: string;
1156
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
1157
+ intent_at: string;
1158
+ stage_id?: string | undefined;
1159
+ call_id?: string | undefined;
1160
+ seat?: number | undefined;
1161
+ note?: string | undefined;
1162
+ packet_digest?: string | undefined;
1163
+ result_at?: string | undefined;
1164
+ attempt?: number | undefined;
1165
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
1166
+ packet_file?: string | undefined;
1167
+ packet_sha256?: string | undefined;
1168
+ }, {
1169
+ status: "intent_recorded" | "result_recorded" | "uncertain";
1170
+ id: string;
1171
+ round: number;
1172
+ execution_id: string;
1173
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
1174
+ intent_at: string;
1175
+ stage_id?: string | undefined;
1176
+ call_id?: string | undefined;
1177
+ seat?: number | undefined;
1178
+ note?: string | undefined;
1179
+ packet_digest?: string | undefined;
1180
+ result_at?: string | undefined;
1181
+ attempt?: number | undefined;
1182
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
1183
+ packet_file?: string | undefined;
1184
+ packet_sha256?: string | undefined;
1185
+ }>, {
1186
+ status: "intent_recorded" | "result_recorded" | "uncertain";
1187
+ id: string;
1188
+ round: number;
1189
+ execution_id: string;
1190
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
1191
+ intent_at: string;
1192
+ stage_id?: string | undefined;
1193
+ call_id?: string | undefined;
1194
+ seat?: number | undefined;
1195
+ note?: string | undefined;
1196
+ packet_digest?: string | undefined;
1197
+ result_at?: string | undefined;
1198
+ attempt?: number | undefined;
1199
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
1200
+ packet_file?: string | undefined;
1201
+ packet_sha256?: string | undefined;
1202
+ }, {
1203
+ status: "intent_recorded" | "result_recorded" | "uncertain";
1204
+ id: string;
1205
+ round: number;
1206
+ execution_id: string;
1207
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
1208
+ intent_at: string;
1209
+ stage_id?: string | undefined;
1210
+ call_id?: string | undefined;
1211
+ seat?: number | undefined;
1212
+ note?: string | undefined;
1213
+ packet_digest?: string | undefined;
1214
+ result_at?: string | undefined;
1215
+ attempt?: number | undefined;
1216
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
1217
+ packet_file?: string | undefined;
1218
+ packet_sha256?: string | undefined;
1219
+ }>, "many">;
1220
+ /** Findings awaiting the main agent's decision; kept (undecided) by a stop while awaiting. */
1221
+ pending_findings: z.ZodArray<z.ZodEffects<z.ZodObject<{
1222
+ id: z.ZodString;
1223
+ round: z.ZodNumber;
1224
+ seat: z.ZodNumber;
1225
+ severity: z.ZodEnum<["blocker", "major", "minor", "nit"]>;
1226
+ path: z.ZodOptional<z.ZodString>;
1227
+ line: z.ZodOptional<z.ZodNumber>;
1228
+ summary: z.ZodString;
1229
+ detail: z.ZodEffects<z.ZodString, string, string>;
1230
+ }, "strict", z.ZodTypeAny, {
1231
+ id: string;
1232
+ detail: string;
1233
+ seat: number;
1234
+ summary: string;
1235
+ severity: "blocker" | "major" | "minor" | "nit";
1236
+ round: number;
1237
+ path?: string | undefined;
1238
+ line?: number | undefined;
1239
+ }, {
1240
+ id: string;
1241
+ detail: string;
1242
+ seat: number;
1243
+ summary: string;
1244
+ severity: "blocker" | "major" | "minor" | "nit";
1245
+ round: number;
1246
+ path?: string | undefined;
1247
+ line?: number | undefined;
1248
+ }>, {
1249
+ id: string;
1250
+ detail: string;
1251
+ seat: number;
1252
+ summary: string;
1253
+ severity: "blocker" | "major" | "minor" | "nit";
1254
+ round: number;
1255
+ path?: string | undefined;
1256
+ line?: number | undefined;
1257
+ }, {
1258
+ id: string;
1259
+ detail: string;
1260
+ seat: number;
1261
+ summary: string;
1262
+ severity: "blocker" | "major" | "minor" | "nit";
1263
+ round: number;
1264
+ path?: string | undefined;
1265
+ line?: number | undefined;
1266
+ }>, "many">;
1267
+ /** Reviewer outcomes of the most recent review round. */
1268
+ reviewers: z.ZodArray<z.ZodObject<{
1269
+ seat: z.ZodNumber;
1270
+ outcome: z.ZodEnum<["signed_off", "withheld", "failed"]>;
1271
+ reason: z.ZodOptional<z.ZodString>;
1272
+ score: z.ZodOptional<z.ZodNumber>;
1273
+ }, "strict", z.ZodTypeAny, {
1274
+ seat: number;
1275
+ outcome: "failed" | "signed_off" | "withheld";
1276
+ score?: number | undefined;
1277
+ reason?: string | undefined;
1278
+ }, {
1279
+ seat: number;
1280
+ outcome: "failed" | "signed_off" | "withheld";
1281
+ score?: number | undefined;
1282
+ reason?: string | undefined;
1283
+ }>, "many">;
1284
+ admitted_findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
1285
+ finding: z.ZodEffects<z.ZodObject<{
1286
+ id: z.ZodString;
1287
+ round: z.ZodNumber;
1288
+ seat: z.ZodNumber;
1289
+ severity: z.ZodEnum<["blocker", "major", "minor", "nit"]>;
1290
+ path: z.ZodOptional<z.ZodString>;
1291
+ line: z.ZodOptional<z.ZodNumber>;
1292
+ summary: z.ZodString;
1293
+ detail: z.ZodEffects<z.ZodString, string, string>;
1294
+ }, "strict", z.ZodTypeAny, {
1295
+ id: string;
1296
+ detail: string;
1297
+ seat: number;
1298
+ summary: string;
1299
+ severity: "blocker" | "major" | "minor" | "nit";
1300
+ round: number;
1301
+ path?: string | undefined;
1302
+ line?: number | undefined;
1303
+ }, {
1304
+ id: string;
1305
+ detail: string;
1306
+ seat: number;
1307
+ summary: string;
1308
+ severity: "blocker" | "major" | "minor" | "nit";
1309
+ round: number;
1310
+ path?: string | undefined;
1311
+ line?: number | undefined;
1312
+ }>, {
1313
+ id: string;
1314
+ detail: string;
1315
+ seat: number;
1316
+ summary: string;
1317
+ severity: "blocker" | "major" | "minor" | "nit";
1318
+ round: number;
1319
+ path?: string | undefined;
1320
+ line?: number | undefined;
1321
+ }, {
1322
+ id: string;
1323
+ detail: string;
1324
+ seat: number;
1325
+ summary: string;
1326
+ severity: "blocker" | "major" | "minor" | "nit";
1327
+ round: number;
1328
+ path?: string | undefined;
1329
+ line?: number | undefined;
1330
+ }>;
1331
+ rationale: z.ZodString;
1332
+ decided_revision: z.ZodNumber;
1333
+ }, "strict", z.ZodTypeAny, {
1334
+ rationale: string;
1335
+ finding: {
1336
+ id: string;
1337
+ detail: string;
1338
+ seat: number;
1339
+ summary: string;
1340
+ severity: "blocker" | "major" | "minor" | "nit";
1341
+ round: number;
1342
+ path?: string | undefined;
1343
+ line?: number | undefined;
1344
+ };
1345
+ decided_revision: number;
1346
+ }, {
1347
+ rationale: string;
1348
+ finding: {
1349
+ id: string;
1350
+ detail: string;
1351
+ seat: number;
1352
+ summary: string;
1353
+ severity: "blocker" | "major" | "minor" | "nit";
1354
+ round: number;
1355
+ path?: string | undefined;
1356
+ line?: number | undefined;
1357
+ };
1358
+ decided_revision: number;
1359
+ }>, "many">>;
1360
+ rejected_findings: z.ZodDefault<z.ZodArray<z.ZodObject<{
1361
+ id: z.ZodString;
1362
+ reason: z.ZodString;
1363
+ decided_revision: z.ZodNumber;
1364
+ /** The rejected finding's summary, so later packets can say what was rejected. Absent on older sidecars. */
1365
+ summary: z.ZodOptional<z.ZodString>;
1366
+ }, "strict", z.ZodTypeAny, {
1367
+ id: string;
1368
+ reason: string;
1369
+ decided_revision: number;
1370
+ summary?: string | undefined;
1371
+ }, {
1372
+ id: string;
1373
+ reason: string;
1374
+ decided_revision: number;
1375
+ summary?: string | undefined;
1376
+ }>, "many">>;
1377
+ /** Findings left unresolved by a terminal stop (round_budget_exhausted, no_progress). */
1378
+ unresolved_findings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1379
+ /** Carried into the next review packet (D4). */
1380
+ pending_audit_requests: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1381
+ round_history: z.ZodDefault<z.ZodArray<z.ZodObject<{
1382
+ round: z.ZodNumber;
1383
+ /** Candidate identity at the writer's confirmed exit (0-3). */
1384
+ candidate_identity: z.ZodOptional<z.ZodString>;
1385
+ /** Byte witness at the same exit; decides whether the next round left the candidate unchanged. */
1386
+ candidate_witness: z.ZodOptional<z.ZodString>;
1387
+ /** Normalized digest of the findings (severity, path, summary) the decision on this round admitted, written at decide (no_progress). */
1388
+ admitted_findings_digest: z.ZodOptional<z.ZodString>;
1389
+ }, "strict", z.ZodTypeAny, {
1390
+ round: number;
1391
+ candidate_identity?: string | undefined;
1392
+ candidate_witness?: string | undefined;
1393
+ admitted_findings_digest?: string | undefined;
1394
+ }, {
1395
+ round: number;
1396
+ candidate_identity?: string | undefined;
1397
+ candidate_witness?: string | undefined;
1398
+ admitted_findings_digest?: string | undefined;
1399
+ }>, "many">>;
1400
+ decisions: z.ZodArray<z.ZodEffects<z.ZodObject<{
1401
+ source_execution_id: z.ZodString;
1402
+ source_revision: z.ZodNumber;
1403
+ decision_digest: z.ZodString;
1404
+ decision: z.ZodEffects<z.ZodObject<{
1405
+ admit: z.ZodDefault<z.ZodArray<z.ZodObject<{
1406
+ id: z.ZodString;
1407
+ rationale: z.ZodString;
1408
+ }, "strict", z.ZodTypeAny, {
1409
+ id: string;
1410
+ rationale: string;
1411
+ }, {
1412
+ id: string;
1413
+ rationale: string;
1414
+ }>, "many">>;
1415
+ reject: z.ZodDefault<z.ZodArray<z.ZodObject<{
1416
+ id: z.ZodString;
1417
+ reason: z.ZodString;
1418
+ }, "strict", z.ZodTypeAny, {
1419
+ id: string;
1420
+ reason: string;
1421
+ }, {
1422
+ id: string;
1423
+ reason: string;
1424
+ }>, "many">>;
1425
+ audit_requests: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1426
+ stop: z.ZodDefault<z.ZodBoolean>;
1427
+ }, "strict", z.ZodTypeAny, {
1428
+ reject: {
1429
+ id: string;
1430
+ reason: string;
1431
+ }[];
1432
+ admit: {
1433
+ id: string;
1434
+ rationale: string;
1435
+ }[];
1436
+ audit_requests: string[];
1437
+ stop: boolean;
1438
+ }, {
1439
+ reject?: {
1440
+ id: string;
1441
+ reason: string;
1442
+ }[] | undefined;
1443
+ admit?: {
1444
+ id: string;
1445
+ rationale: string;
1446
+ }[] | undefined;
1447
+ audit_requests?: string[] | undefined;
1448
+ stop?: boolean | undefined;
1449
+ }>, {
1450
+ reject: {
1451
+ id: string;
1452
+ reason: string;
1453
+ }[];
1454
+ admit: {
1455
+ id: string;
1456
+ rationale: string;
1457
+ }[];
1458
+ audit_requests: string[];
1459
+ stop: boolean;
1460
+ }, {
1461
+ reject?: {
1462
+ id: string;
1463
+ reason: string;
1464
+ }[] | undefined;
1465
+ admit?: {
1466
+ id: string;
1467
+ rationale: string;
1468
+ }[] | undefined;
1469
+ audit_requests?: string[] | undefined;
1470
+ stop?: boolean | undefined;
1471
+ }>;
1472
+ new_execution_id: z.ZodString;
1473
+ new_revision: z.ZodNumber;
1474
+ next_phase: z.ZodEnum<["admitted", "implementing", "verifying", "reviewing", "awaiting_decision", "remediating", "final_verifying", "stopped", "qualified"]>;
1475
+ stop_reason: z.ZodOptional<z.ZodEnum<["main_agent_stop", "round_budget_exhausted", "no_sign_off", "seat_unavailable", "no_progress", "final_verification_failed", "acceptance_input_changed", "target_changed_during_review", "recovery_required", "permission_failure", "deadline_exceeded", "active_budget_exhausted", "evidence_capacity", "cancelled"]>>;
1476
+ recorded_at: z.ZodEffects<z.ZodString, string, string>;
1477
+ receipt: z.ZodObject<{
1478
+ run_id: z.ZodString;
1479
+ execution_id: z.ZodString;
1480
+ revision: z.ZodNumber;
1481
+ phase: z.ZodEnum<["admitted", "implementing", "verifying", "reviewing", "awaiting_decision", "remediating", "final_verifying", "stopped", "qualified"]>;
1482
+ outcome: z.ZodOptional<z.ZodEnum<["qualified", "stopped", "failed", "cancelled"]>>;
1483
+ stop_reason: z.ZodOptional<z.ZodEnum<["main_agent_stop", "round_budget_exhausted", "no_sign_off", "seat_unavailable", "no_progress", "final_verification_failed", "acceptance_input_changed", "target_changed_during_review", "recovery_required", "permission_failure", "deadline_exceeded", "active_budget_exhausted", "evidence_capacity", "cancelled"]>>;
1484
+ replayed: z.ZodBoolean;
1485
+ }, "strict", z.ZodTypeAny, {
1486
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1487
+ revision: number;
1488
+ run_id: string;
1489
+ execution_id: string;
1490
+ replayed: boolean;
1491
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
1492
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1493
+ }, {
1494
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1495
+ revision: number;
1496
+ run_id: string;
1497
+ execution_id: string;
1498
+ replayed: boolean;
1499
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
1500
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1501
+ }>;
1502
+ }, "strict", z.ZodTypeAny, {
1503
+ decision: {
1504
+ reject: {
1505
+ id: string;
1506
+ reason: string;
1507
+ }[];
1508
+ admit: {
1509
+ id: string;
1510
+ rationale: string;
1511
+ }[];
1512
+ audit_requests: string[];
1513
+ stop: boolean;
1514
+ };
1515
+ source_execution_id: string;
1516
+ source_revision: number;
1517
+ decision_digest: string;
1518
+ new_execution_id: string;
1519
+ new_revision: number;
1520
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1521
+ recorded_at: string;
1522
+ receipt: {
1523
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1524
+ revision: number;
1525
+ run_id: string;
1526
+ execution_id: string;
1527
+ replayed: boolean;
1528
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
1529
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1530
+ };
1531
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1532
+ }, {
1533
+ decision: {
1534
+ reject?: {
1535
+ id: string;
1536
+ reason: string;
1537
+ }[] | undefined;
1538
+ admit?: {
1539
+ id: string;
1540
+ rationale: string;
1541
+ }[] | undefined;
1542
+ audit_requests?: string[] | undefined;
1543
+ stop?: boolean | undefined;
1544
+ };
1545
+ source_execution_id: string;
1546
+ source_revision: number;
1547
+ decision_digest: string;
1548
+ new_execution_id: string;
1549
+ new_revision: number;
1550
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1551
+ recorded_at: string;
1552
+ receipt: {
1553
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1554
+ revision: number;
1555
+ run_id: string;
1556
+ execution_id: string;
1557
+ replayed: boolean;
1558
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
1559
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1560
+ };
1561
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1562
+ }>, {
1563
+ decision: {
1564
+ reject: {
1565
+ id: string;
1566
+ reason: string;
1567
+ }[];
1568
+ admit: {
1569
+ id: string;
1570
+ rationale: string;
1571
+ }[];
1572
+ audit_requests: string[];
1573
+ stop: boolean;
1574
+ };
1575
+ source_execution_id: string;
1576
+ source_revision: number;
1577
+ decision_digest: string;
1578
+ new_execution_id: string;
1579
+ new_revision: number;
1580
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1581
+ recorded_at: string;
1582
+ receipt: {
1583
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1584
+ revision: number;
1585
+ run_id: string;
1586
+ execution_id: string;
1587
+ replayed: boolean;
1588
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
1589
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1590
+ };
1591
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1592
+ }, {
1593
+ decision: {
1594
+ reject?: {
1595
+ id: string;
1596
+ reason: string;
1597
+ }[] | undefined;
1598
+ admit?: {
1599
+ id: string;
1600
+ rationale: string;
1601
+ }[] | undefined;
1602
+ audit_requests?: string[] | undefined;
1603
+ stop?: boolean | undefined;
1604
+ };
1605
+ source_execution_id: string;
1606
+ source_revision: number;
1607
+ decision_digest: string;
1608
+ new_execution_id: string;
1609
+ new_revision: number;
1610
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1611
+ recorded_at: string;
1612
+ receipt: {
1613
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1614
+ revision: number;
1615
+ run_id: string;
1616
+ execution_id: string;
1617
+ replayed: boolean;
1618
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
1619
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1620
+ };
1621
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1622
+ }>, "many">;
1623
+ /** Count of operations without a recorded result; always written. */
1624
+ unresolved_operations: z.ZodNumber;
1625
+ /** True only when every seat exit is confirmed (set by cancel paths). */
1626
+ effects_stopped: z.ZodOptional<z.ZodBoolean>;
1627
+ }, "strict", z.ZodTypeAny, {
1628
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1629
+ updated_at: string;
1630
+ revision: number;
1631
+ run_id: string;
1632
+ reviewers: {
1633
+ seat: number;
1634
+ outcome: "failed" | "signed_off" | "withheld";
1635
+ score?: number | undefined;
1636
+ reason?: string | undefined;
1637
+ }[];
1638
+ workflow: "ping-pong";
1639
+ schema: "recipe-state-v1";
1640
+ execution_id: string;
1641
+ rounds_used: number;
1642
+ round_cap: number;
1643
+ sign_off_threshold: number;
1644
+ reviewer_count: number;
1645
+ active_budget: {
1646
+ used_seconds: number;
1647
+ limit_seconds: number;
1648
+ };
1649
+ admitted_at: string;
1650
+ deadline_at: string;
1651
+ baseline: {
1652
+ repo_root: string;
1653
+ commit: string;
1654
+ uncommitted_changes_excluded?: boolean | undefined;
1655
+ };
1656
+ worktrees: {
1657
+ path: string;
1658
+ seat: string;
1659
+ }[];
1660
+ acceptance_pins: {
1661
+ path: string;
1662
+ sha256: string;
1663
+ }[];
1664
+ operations: {
1665
+ status: "intent_recorded" | "result_recorded" | "uncertain";
1666
+ id: string;
1667
+ round: number;
1668
+ execution_id: string;
1669
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
1670
+ intent_at: string;
1671
+ stage_id?: string | undefined;
1672
+ call_id?: string | undefined;
1673
+ seat?: number | undefined;
1674
+ note?: string | undefined;
1675
+ packet_digest?: string | undefined;
1676
+ result_at?: string | undefined;
1677
+ attempt?: number | undefined;
1678
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
1679
+ packet_file?: string | undefined;
1680
+ packet_sha256?: string | undefined;
1681
+ }[];
1682
+ pending_findings: {
1683
+ id: string;
1684
+ detail: string;
1685
+ seat: number;
1686
+ summary: string;
1687
+ severity: "blocker" | "major" | "minor" | "nit";
1688
+ round: number;
1689
+ path?: string | undefined;
1690
+ line?: number | undefined;
1691
+ }[];
1692
+ admitted_findings: {
1693
+ rationale: string;
1694
+ finding: {
1695
+ id: string;
1696
+ detail: string;
1697
+ seat: number;
1698
+ summary: string;
1699
+ severity: "blocker" | "major" | "minor" | "nit";
1700
+ round: number;
1701
+ path?: string | undefined;
1702
+ line?: number | undefined;
1703
+ };
1704
+ decided_revision: number;
1705
+ }[];
1706
+ rejected_findings: {
1707
+ id: string;
1708
+ reason: string;
1709
+ decided_revision: number;
1710
+ summary?: string | undefined;
1711
+ }[];
1712
+ unresolved_findings: string[];
1713
+ pending_audit_requests: string[];
1714
+ round_history: {
1715
+ round: number;
1716
+ candidate_identity?: string | undefined;
1717
+ candidate_witness?: string | undefined;
1718
+ admitted_findings_digest?: string | undefined;
1719
+ }[];
1720
+ decisions: {
1721
+ decision: {
1722
+ reject: {
1723
+ id: string;
1724
+ reason: string;
1725
+ }[];
1726
+ admit: {
1727
+ id: string;
1728
+ rationale: string;
1729
+ }[];
1730
+ audit_requests: string[];
1731
+ stop: boolean;
1732
+ };
1733
+ source_execution_id: string;
1734
+ source_revision: number;
1735
+ decision_digest: string;
1736
+ new_execution_id: string;
1737
+ new_revision: number;
1738
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1739
+ recorded_at: string;
1740
+ receipt: {
1741
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1742
+ revision: number;
1743
+ run_id: string;
1744
+ execution_id: string;
1745
+ replayed: boolean;
1746
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
1747
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1748
+ };
1749
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1750
+ }[];
1751
+ unresolved_operations: number;
1752
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
1753
+ candidate_identity?: string | undefined;
1754
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1755
+ candidate_witness?: string | undefined;
1756
+ stop_detail?: string | undefined;
1757
+ awaiting_since?: string | undefined;
1758
+ git_metadata_snapshot?: {
1759
+ version: 1;
1760
+ digest: string;
1761
+ files: {
1762
+ path: string;
1763
+ name: string;
1764
+ state: "file" | "absent" | "symlink" | "other";
1765
+ kind: "config" | "raw";
1766
+ keys?: Record<string, string> | undefined;
1767
+ sha256?: string | undefined;
1768
+ entries_sha256?: string | undefined;
1769
+ }[];
1770
+ } | undefined;
1771
+ effects_stopped?: boolean | undefined;
1772
+ }, {
1773
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1774
+ updated_at: string;
1775
+ revision: number;
1776
+ run_id: string;
1777
+ reviewers: {
1778
+ seat: number;
1779
+ outcome: "failed" | "signed_off" | "withheld";
1780
+ score?: number | undefined;
1781
+ reason?: string | undefined;
1782
+ }[];
1783
+ workflow: "ping-pong";
1784
+ schema: "recipe-state-v1";
1785
+ execution_id: string;
1786
+ rounds_used: number;
1787
+ round_cap: number;
1788
+ sign_off_threshold: number;
1789
+ reviewer_count: number;
1790
+ active_budget: {
1791
+ used_seconds: number;
1792
+ limit_seconds: number;
1793
+ };
1794
+ admitted_at: string;
1795
+ deadline_at: string;
1796
+ baseline: {
1797
+ repo_root: string;
1798
+ commit: string;
1799
+ uncommitted_changes_excluded?: boolean | undefined;
1800
+ };
1801
+ worktrees: {
1802
+ path: string;
1803
+ seat: string;
1804
+ }[];
1805
+ operations: {
1806
+ status: "intent_recorded" | "result_recorded" | "uncertain";
1807
+ id: string;
1808
+ round: number;
1809
+ execution_id: string;
1810
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
1811
+ intent_at: string;
1812
+ stage_id?: string | undefined;
1813
+ call_id?: string | undefined;
1814
+ seat?: number | undefined;
1815
+ note?: string | undefined;
1816
+ packet_digest?: string | undefined;
1817
+ result_at?: string | undefined;
1818
+ attempt?: number | undefined;
1819
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
1820
+ packet_file?: string | undefined;
1821
+ packet_sha256?: string | undefined;
1822
+ }[];
1823
+ pending_findings: {
1824
+ id: string;
1825
+ detail: string;
1826
+ seat: number;
1827
+ summary: string;
1828
+ severity: "blocker" | "major" | "minor" | "nit";
1829
+ round: number;
1830
+ path?: string | undefined;
1831
+ line?: number | undefined;
1832
+ }[];
1833
+ decisions: {
1834
+ decision: {
1835
+ reject?: {
1836
+ id: string;
1837
+ reason: string;
1838
+ }[] | undefined;
1839
+ admit?: {
1840
+ id: string;
1841
+ rationale: string;
1842
+ }[] | undefined;
1843
+ audit_requests?: string[] | undefined;
1844
+ stop?: boolean | undefined;
1845
+ };
1846
+ source_execution_id: string;
1847
+ source_revision: number;
1848
+ decision_digest: string;
1849
+ new_execution_id: string;
1850
+ new_revision: number;
1851
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1852
+ recorded_at: string;
1853
+ receipt: {
1854
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1855
+ revision: number;
1856
+ run_id: string;
1857
+ execution_id: string;
1858
+ replayed: boolean;
1859
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
1860
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1861
+ };
1862
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1863
+ }[];
1864
+ unresolved_operations: number;
1865
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
1866
+ candidate_identity?: string | undefined;
1867
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
1868
+ candidate_witness?: string | undefined;
1869
+ stop_detail?: string | undefined;
1870
+ awaiting_since?: string | undefined;
1871
+ git_metadata_snapshot?: {
1872
+ version: 1;
1873
+ digest: string;
1874
+ files: {
1875
+ path: string;
1876
+ name: string;
1877
+ state: "file" | "absent" | "symlink" | "other";
1878
+ kind: "config" | "raw";
1879
+ keys?: Record<string, string> | undefined;
1880
+ sha256?: string | undefined;
1881
+ entries_sha256?: string | undefined;
1882
+ }[];
1883
+ } | undefined;
1884
+ acceptance_pins?: {
1885
+ path: string;
1886
+ sha256: string;
1887
+ }[] | undefined;
1888
+ admitted_findings?: {
1889
+ rationale: string;
1890
+ finding: {
1891
+ id: string;
1892
+ detail: string;
1893
+ seat: number;
1894
+ summary: string;
1895
+ severity: "blocker" | "major" | "minor" | "nit";
1896
+ round: number;
1897
+ path?: string | undefined;
1898
+ line?: number | undefined;
1899
+ };
1900
+ decided_revision: number;
1901
+ }[] | undefined;
1902
+ rejected_findings?: {
1903
+ id: string;
1904
+ reason: string;
1905
+ decided_revision: number;
1906
+ summary?: string | undefined;
1907
+ }[] | undefined;
1908
+ unresolved_findings?: string[] | undefined;
1909
+ pending_audit_requests?: string[] | undefined;
1910
+ round_history?: {
1911
+ round: number;
1912
+ candidate_identity?: string | undefined;
1913
+ candidate_witness?: string | undefined;
1914
+ admitted_findings_digest?: string | undefined;
1915
+ }[] | undefined;
1916
+ effects_stopped?: boolean | undefined;
1917
+ }>, {
1918
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
1919
+ updated_at: string;
1920
+ revision: number;
1921
+ run_id: string;
1922
+ reviewers: {
1923
+ seat: number;
1924
+ outcome: "failed" | "signed_off" | "withheld";
1925
+ score?: number | undefined;
1926
+ reason?: string | undefined;
1927
+ }[];
1928
+ workflow: "ping-pong";
1929
+ schema: "recipe-state-v1";
1930
+ execution_id: string;
1931
+ rounds_used: number;
1932
+ round_cap: number;
1933
+ sign_off_threshold: number;
1934
+ reviewer_count: number;
1935
+ active_budget: {
1936
+ used_seconds: number;
1937
+ limit_seconds: number;
1938
+ };
1939
+ admitted_at: string;
1940
+ deadline_at: string;
1941
+ baseline: {
1942
+ repo_root: string;
1943
+ commit: string;
1944
+ uncommitted_changes_excluded?: boolean | undefined;
1945
+ };
1946
+ worktrees: {
1947
+ path: string;
1948
+ seat: string;
1949
+ }[];
1950
+ acceptance_pins: {
1951
+ path: string;
1952
+ sha256: string;
1953
+ }[];
1954
+ operations: {
1955
+ status: "intent_recorded" | "result_recorded" | "uncertain";
1956
+ id: string;
1957
+ round: number;
1958
+ execution_id: string;
1959
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
1960
+ intent_at: string;
1961
+ stage_id?: string | undefined;
1962
+ call_id?: string | undefined;
1963
+ seat?: number | undefined;
1964
+ note?: string | undefined;
1965
+ packet_digest?: string | undefined;
1966
+ result_at?: string | undefined;
1967
+ attempt?: number | undefined;
1968
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
1969
+ packet_file?: string | undefined;
1970
+ packet_sha256?: string | undefined;
1971
+ }[];
1972
+ pending_findings: {
1973
+ id: string;
1974
+ detail: string;
1975
+ seat: number;
1976
+ summary: string;
1977
+ severity: "blocker" | "major" | "minor" | "nit";
1978
+ round: number;
1979
+ path?: string | undefined;
1980
+ line?: number | undefined;
1981
+ }[];
1982
+ admitted_findings: {
1983
+ rationale: string;
1984
+ finding: {
1985
+ id: string;
1986
+ detail: string;
1987
+ seat: number;
1988
+ summary: string;
1989
+ severity: "blocker" | "major" | "minor" | "nit";
1990
+ round: number;
1991
+ path?: string | undefined;
1992
+ line?: number | undefined;
1993
+ };
1994
+ decided_revision: number;
1995
+ }[];
1996
+ rejected_findings: {
1997
+ id: string;
1998
+ reason: string;
1999
+ decided_revision: number;
2000
+ summary?: string | undefined;
2001
+ }[];
2002
+ unresolved_findings: string[];
2003
+ pending_audit_requests: string[];
2004
+ round_history: {
2005
+ round: number;
2006
+ candidate_identity?: string | undefined;
2007
+ candidate_witness?: string | undefined;
2008
+ admitted_findings_digest?: string | undefined;
2009
+ }[];
2010
+ decisions: {
2011
+ decision: {
2012
+ reject: {
2013
+ id: string;
2014
+ reason: string;
2015
+ }[];
2016
+ admit: {
2017
+ id: string;
2018
+ rationale: string;
2019
+ }[];
2020
+ audit_requests: string[];
2021
+ stop: boolean;
2022
+ };
2023
+ source_execution_id: string;
2024
+ source_revision: number;
2025
+ decision_digest: string;
2026
+ new_execution_id: string;
2027
+ new_revision: number;
2028
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
2029
+ recorded_at: string;
2030
+ receipt: {
2031
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
2032
+ revision: number;
2033
+ run_id: string;
2034
+ execution_id: string;
2035
+ replayed: boolean;
2036
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
2037
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
2038
+ };
2039
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
2040
+ }[];
2041
+ unresolved_operations: number;
2042
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
2043
+ candidate_identity?: string | undefined;
2044
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
2045
+ candidate_witness?: string | undefined;
2046
+ stop_detail?: string | undefined;
2047
+ awaiting_since?: string | undefined;
2048
+ git_metadata_snapshot?: {
2049
+ version: 1;
2050
+ digest: string;
2051
+ files: {
2052
+ path: string;
2053
+ name: string;
2054
+ state: "file" | "absent" | "symlink" | "other";
2055
+ kind: "config" | "raw";
2056
+ keys?: Record<string, string> | undefined;
2057
+ sha256?: string | undefined;
2058
+ entries_sha256?: string | undefined;
2059
+ }[];
2060
+ } | undefined;
2061
+ effects_stopped?: boolean | undefined;
2062
+ }, {
2063
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
2064
+ updated_at: string;
2065
+ revision: number;
2066
+ run_id: string;
2067
+ reviewers: {
2068
+ seat: number;
2069
+ outcome: "failed" | "signed_off" | "withheld";
2070
+ score?: number | undefined;
2071
+ reason?: string | undefined;
2072
+ }[];
2073
+ workflow: "ping-pong";
2074
+ schema: "recipe-state-v1";
2075
+ execution_id: string;
2076
+ rounds_used: number;
2077
+ round_cap: number;
2078
+ sign_off_threshold: number;
2079
+ reviewer_count: number;
2080
+ active_budget: {
2081
+ used_seconds: number;
2082
+ limit_seconds: number;
2083
+ };
2084
+ admitted_at: string;
2085
+ deadline_at: string;
2086
+ baseline: {
2087
+ repo_root: string;
2088
+ commit: string;
2089
+ uncommitted_changes_excluded?: boolean | undefined;
2090
+ };
2091
+ worktrees: {
2092
+ path: string;
2093
+ seat: string;
2094
+ }[];
2095
+ operations: {
2096
+ status: "intent_recorded" | "result_recorded" | "uncertain";
2097
+ id: string;
2098
+ round: number;
2099
+ execution_id: string;
2100
+ kind: "reviewer" | "writer" | "verification" | "identity" | "control";
2101
+ intent_at: string;
2102
+ stage_id?: string | undefined;
2103
+ call_id?: string | undefined;
2104
+ seat?: number | undefined;
2105
+ note?: string | undefined;
2106
+ packet_digest?: string | undefined;
2107
+ result_at?: string | undefined;
2108
+ attempt?: number | undefined;
2109
+ retry_reason?: "schema" | "oversize" | "invalid_json" | "echo_mismatch" | "self_contradictory" | "finding_overflow" | "unjustified_withhold" | "provider_error" | undefined;
2110
+ packet_file?: string | undefined;
2111
+ packet_sha256?: string | undefined;
2112
+ }[];
2113
+ pending_findings: {
2114
+ id: string;
2115
+ detail: string;
2116
+ seat: number;
2117
+ summary: string;
2118
+ severity: "blocker" | "major" | "minor" | "nit";
2119
+ round: number;
2120
+ path?: string | undefined;
2121
+ line?: number | undefined;
2122
+ }[];
2123
+ decisions: {
2124
+ decision: {
2125
+ reject?: {
2126
+ id: string;
2127
+ reason: string;
2128
+ }[] | undefined;
2129
+ admit?: {
2130
+ id: string;
2131
+ rationale: string;
2132
+ }[] | undefined;
2133
+ audit_requests?: string[] | undefined;
2134
+ stop?: boolean | undefined;
2135
+ };
2136
+ source_execution_id: string;
2137
+ source_revision: number;
2138
+ decision_digest: string;
2139
+ new_execution_id: string;
2140
+ new_revision: number;
2141
+ next_phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
2142
+ recorded_at: string;
2143
+ receipt: {
2144
+ phase: "admitted" | "implementing" | "verifying" | "reviewing" | "awaiting_decision" | "remediating" | "final_verifying" | "stopped" | "qualified";
2145
+ revision: number;
2146
+ run_id: string;
2147
+ execution_id: string;
2148
+ replayed: boolean;
2149
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
2150
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
2151
+ };
2152
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
2153
+ }[];
2154
+ unresolved_operations: number;
2155
+ outcome?: "failed" | "cancelled" | "stopped" | "qualified" | undefined;
2156
+ candidate_identity?: string | undefined;
2157
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
2158
+ candidate_witness?: string | undefined;
2159
+ stop_detail?: string | undefined;
2160
+ awaiting_since?: string | undefined;
2161
+ git_metadata_snapshot?: {
2162
+ version: 1;
2163
+ digest: string;
2164
+ files: {
2165
+ path: string;
2166
+ name: string;
2167
+ state: "file" | "absent" | "symlink" | "other";
2168
+ kind: "config" | "raw";
2169
+ keys?: Record<string, string> | undefined;
2170
+ sha256?: string | undefined;
2171
+ entries_sha256?: string | undefined;
2172
+ }[];
2173
+ } | undefined;
2174
+ acceptance_pins?: {
2175
+ path: string;
2176
+ sha256: string;
2177
+ }[] | undefined;
2178
+ admitted_findings?: {
2179
+ rationale: string;
2180
+ finding: {
2181
+ id: string;
2182
+ detail: string;
2183
+ seat: number;
2184
+ summary: string;
2185
+ severity: "blocker" | "major" | "minor" | "nit";
2186
+ round: number;
2187
+ path?: string | undefined;
2188
+ line?: number | undefined;
2189
+ };
2190
+ decided_revision: number;
2191
+ }[] | undefined;
2192
+ rejected_findings?: {
2193
+ id: string;
2194
+ reason: string;
2195
+ decided_revision: number;
2196
+ summary?: string | undefined;
2197
+ }[] | undefined;
2198
+ unresolved_findings?: string[] | undefined;
2199
+ pending_audit_requests?: string[] | undefined;
2200
+ round_history?: {
2201
+ round: number;
2202
+ candidate_identity?: string | undefined;
2203
+ candidate_witness?: string | undefined;
2204
+ admitted_findings_digest?: string | undefined;
2205
+ }[] | undefined;
2206
+ effects_stopped?: boolean | undefined;
2207
+ }>;
2208
+ export type RecipeStateV1 = z.infer<typeof RecipeStateV1Schema>;
2209
+ /** Parse input type: defaulted arrays may be omitted. */
2210
+ export type RecipeStateV1Input = z.input<typeof RecipeStateV1Schema>;
2211
+ /**
2212
+ * Body a caller commits; the store stamps `schema`, `workflow`, `run_id`,
2213
+ * `execution_id`, `revision`, `updated_at`, and `unresolved_operations`.
2214
+ */
2215
+ export type RecipeStateDraft = Omit<RecipeStateV1Input, "schema" | "workflow" | "run_id" | "execution_id" | "revision" | "updated_at" | "unresolved_operations">;
2216
+ export declare function countUnresolvedOperations(operations: readonly {
2217
+ readonly status: OperationStatus;
2218
+ }[]): number;
2219
+ /** The fields of a state the store stamps; strip them to edit a committed state as a draft. */
2220
+ export declare function toRecipeStateDraft(state: RecipeStateV1): RecipeStateDraft;
2221
+ /** Every operation without a recorded result becomes `uncertain` (lost response / dead worker). */
2222
+ export declare function markUnresolvedOperationsUncertain(operations: readonly RecipeOperation[], note?: string): RecipeOperation[];
2223
+ /** A complete `awaiting_decision` checkpoint for this execution with nothing uncertain (reconcile roll-forward). */
2224
+ export declare function isCompleteAwaitingCheckpoint(state: RecipeStateV1, executionId: string | undefined): boolean;
2225
+ export type DecisionCompleteness = {
2226
+ readonly ok: true;
2227
+ } | {
2228
+ readonly ok: false;
2229
+ readonly unknown: string[];
2230
+ readonly duplicate: string[];
2231
+ readonly missing: string[];
2232
+ };
2233
+ /**
2234
+ * Every pending id exactly once across admit/reject; nothing else. A stop
2235
+ * may leave pending ids unlisted (they are recorded unresolved), but unknown
2236
+ * and duplicate ids are still rejected.
2237
+ */
2238
+ export declare function checkDecisionCompleteness(pending: readonly RecipeFinding[], decision: PpDecision): DecisionCompleteness;
2239
+ export type DecisionTransition = {
2240
+ readonly phase: "remediating" | "final_verifying";
2241
+ } | {
2242
+ readonly phase: "stopped";
2243
+ readonly stopReason: StopReason;
2244
+ };
2245
+ /**
2246
+ * Order-free digest of a finding multiset over severity, path (as given) and
2247
+ * the case- and whitespace-normalized summary, so the same summary on another
2248
+ * file or at another severity is a different finding.
2249
+ */
2250
+ export declare function normalizedFindingsDigest(findings: ReadonlyArray<Pick<RecipeFinding, "severity" | "path" | "summary">>): string;
2251
+ /**
2252
+ * The legal next phase from `awaiting_decision` (CONTRACTS 0-2 table). The
2253
+ * caller has already checked completeness, so every admitted id is pending.
2254
+ */
2255
+ export declare function nextPhaseForDecision(state: RecipeStateV1, decision: PpDecision): DecisionTransition;
2256
+ /**
2257
+ * Apply a validated decision to an `awaiting_decision` state: findings move to
2258
+ * admitted/rejected, audit requests are queued, and the phase advances. A stop
2259
+ * produces a terminal draft (outcome `stopped`).
2260
+ */
2261
+ export declare function applyDecisionToDraft(state: RecipeStateV1, decision: PpDecision, transition: DecisionTransition): RecipeStateDraft;
2262
+ /** Terminal stop draft from any non-terminal state (control executions: deadline, cancel, capacity). */
2263
+ export declare function terminalStopDraft(state: RecipeStateV1, stopReason: StopReason, options?: {
2264
+ readonly outcome?: "stopped" | "cancelled" | "failed";
2265
+ readonly effectsStopped?: boolean;
2266
+ }): RecipeStateDraft;
2267
+ export interface RecipeStatusBlock {
2268
+ readonly execution_id: string;
2269
+ readonly revision: number;
2270
+ readonly phase: RecipePhase;
2271
+ readonly outcome?: RecipeOutcome;
2272
+ readonly stop_reason?: StopReason;
2273
+ readonly stop_detail?: string;
2274
+ readonly rounds_used: number;
2275
+ readonly round_cap: number;
2276
+ readonly active_budget_remaining_seconds: number;
2277
+ readonly deadline_at: string;
2278
+ /** Read-time only (never persisted): paused at or past `deadline_at`; a decision now stops deadline_exceeded. */
2279
+ readonly deadline_expired?: true;
2280
+ readonly awaiting_decision: boolean;
2281
+ readonly awaiting_since?: string;
2282
+ /** Only while awaiting; finding text is untrusted data. */
2283
+ readonly pending_findings?: ReadonlyArray<{
2284
+ readonly id: string;
2285
+ readonly seat: number;
2286
+ readonly severity: string;
2287
+ readonly path?: string;
2288
+ readonly line?: number;
2289
+ readonly summary: string;
2290
+ readonly detail: string;
2291
+ }>;
2292
+ /** `score` is the reviewer's own 0-10 score when its output validated. */
2293
+ readonly reviewers: ReadonlyArray<{
2294
+ readonly seat: number;
2295
+ readonly outcome: string;
2296
+ readonly reason?: string;
2297
+ readonly score?: number;
2298
+ }>;
2299
+ readonly sign_off_threshold: number;
2300
+ readonly unresolved_operations: number;
2301
+ readonly effects_stopped?: boolean;
2302
+ readonly candidate_identity?: string;
2303
+ readonly baseline_uncommitted_changes_excluded?: boolean;
2304
+ readonly worktrees: ReadonlyArray<{
2305
+ readonly seat: string;
2306
+ readonly path: string;
2307
+ }>;
2308
+ }
2309
+ export declare function projectRecipeStatusBlock(state: RecipeStateV1, now?: number): RecipeStatusBlock;
2310
+ /** Server-materialized variables; covered by the inputs snapshot hash, never caller-supplied. */
2311
+ export declare const PP_SEAT_PLAN_VARIABLE = "pp_seat_plan";
2312
+ export declare const PP_ADMISSION_VARIABLE = "pp_admission";
2313
+ declare const PpRouteSchema: z.ZodObject<{
2314
+ cli_name: z.ZodString;
2315
+ model: z.ZodOptional<z.ZodString>;
2316
+ effort: z.ZodOptional<z.ZodString>;
2317
+ }, "strict", z.ZodTypeAny, {
2318
+ cli_name: string;
2319
+ model?: string | undefined;
2320
+ effort?: string | undefined;
2321
+ }, {
2322
+ cli_name: string;
2323
+ model?: string | undefined;
2324
+ effort?: string | undefined;
2325
+ }>;
2326
+ export type PpRoute = z.infer<typeof PpRouteSchema>;
2327
+ export declare const PpSeatPlanSchema: z.ZodObject<{
2328
+ schema_version: z.ZodLiteral<"pp-seats-v1">;
2329
+ implementer: z.ZodObject<{
2330
+ cli_name: z.ZodString;
2331
+ model: z.ZodOptional<z.ZodString>;
2332
+ effort: z.ZodOptional<z.ZodString>;
2333
+ }, "strict", z.ZodTypeAny, {
2334
+ cli_name: string;
2335
+ model?: string | undefined;
2336
+ effort?: string | undefined;
2337
+ }, {
2338
+ cli_name: string;
2339
+ model?: string | undefined;
2340
+ effort?: string | undefined;
2341
+ }>;
2342
+ reviewers: z.ZodArray<z.ZodObject<{
2343
+ cli_name: z.ZodString;
2344
+ model: z.ZodOptional<z.ZodString>;
2345
+ effort: z.ZodOptional<z.ZodString>;
2346
+ }, "strict", z.ZodTypeAny, {
2347
+ cli_name: string;
2348
+ model?: string | undefined;
2349
+ effort?: string | undefined;
2350
+ }, {
2351
+ cli_name: string;
2352
+ model?: string | undefined;
2353
+ effort?: string | undefined;
2354
+ }>, "many">;
2355
+ }, "strict", z.ZodTypeAny, {
2356
+ schema_version: "pp-seats-v1";
2357
+ reviewers: {
2358
+ cli_name: string;
2359
+ model?: string | undefined;
2360
+ effort?: string | undefined;
2361
+ }[];
2362
+ implementer: {
2363
+ cli_name: string;
2364
+ model?: string | undefined;
2365
+ effort?: string | undefined;
2366
+ };
2367
+ }, {
2368
+ schema_version: "pp-seats-v1";
2369
+ reviewers: {
2370
+ cli_name: string;
2371
+ model?: string | undefined;
2372
+ effort?: string | undefined;
2373
+ }[];
2374
+ implementer: {
2375
+ cli_name: string;
2376
+ model?: string | undefined;
2377
+ effort?: string | undefined;
2378
+ };
2379
+ }>;
2380
+ export type PpSeatPlan = z.infer<typeof PpSeatPlanSchema>;
2381
+ /** Repository-relative path without traversal (the verifier's RelativeFile rule). */
2382
+ export declare const PpRelativeFileSchema: z.ZodEffects<z.ZodString, string, string>;
2383
+ export declare const PpAdmissionSchema: z.ZodObject<{
2384
+ schema_version: z.ZodLiteral<"pp-admission-v1">;
2385
+ repo_root: z.ZodEffects<z.ZodString, string, string>;
2386
+ baseline_commit: z.ZodString;
2387
+ /** HEAD was pinned; uncommitted changes in the source checkout are not in the candidate. */
2388
+ baseline_uncommitted_changes_excluded: z.ZodBoolean;
2389
+ rounds: z.ZodNumber;
2390
+ sign_off_threshold: z.ZodNumber;
2391
+ active_budget_seconds: z.ZodNumber;
2392
+ admitted_at: z.ZodEffects<z.ZodString, string, string>;
2393
+ deadline_at: z.ZodEffects<z.ZodString, string, string>;
2394
+ acceptance_manifest: z.ZodEffects<z.ZodString, string, string>;
2395
+ copy_preparation_manifest: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
2396
+ acceptance_inputs: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
2397
+ /**
2398
+ * D-B: preflight reads the implementer worktree (the baseline), never the
2399
+ * live checkout. `worktree` is the path `createWorkspace` must produce;
2400
+ * each caller anchor under the repository is recorded with its rebased
2401
+ * path (`original` is absent for the default root).
2402
+ */
2403
+ context_roots: z.ZodOptional<z.ZodObject<{
2404
+ worktree: z.ZodEffects<z.ZodString, string, string>;
2405
+ roots: z.ZodArray<z.ZodObject<{
2406
+ original: z.ZodOptional<z.ZodString>;
2407
+ rebased: z.ZodEffects<z.ZodString, string, string>;
2408
+ }, "strict", z.ZodTypeAny, {
2409
+ rebased: string;
2410
+ original?: string | undefined;
2411
+ }, {
2412
+ rebased: string;
2413
+ original?: string | undefined;
2414
+ }>, "many">;
2415
+ focus_paths: z.ZodArray<z.ZodObject<{
2416
+ original: z.ZodEffects<z.ZodString, string, string>;
2417
+ rebased: z.ZodEffects<z.ZodString, string, string>;
2418
+ }, "strict", z.ZodTypeAny, {
2419
+ original: string;
2420
+ rebased: string;
2421
+ }, {
2422
+ original: string;
2423
+ rebased: string;
2424
+ }>, "many">;
2425
+ }, "strict", z.ZodTypeAny, {
2426
+ worktree: string;
2427
+ roots: {
2428
+ rebased: string;
2429
+ original?: string | undefined;
2430
+ }[];
2431
+ focus_paths: {
2432
+ original: string;
2433
+ rebased: string;
2434
+ }[];
2435
+ }, {
2436
+ worktree: string;
2437
+ roots: {
2438
+ rebased: string;
2439
+ original?: string | undefined;
2440
+ }[];
2441
+ focus_paths: {
2442
+ original: string;
2443
+ rebased: string;
2444
+ }[];
2445
+ }>>;
2446
+ }, "strict", z.ZodTypeAny, {
2447
+ schema_version: "pp-admission-v1";
2448
+ sign_off_threshold: number;
2449
+ admitted_at: string;
2450
+ deadline_at: string;
2451
+ repo_root: string;
2452
+ baseline_uncommitted_changes_excluded: boolean;
2453
+ baseline_commit: string;
2454
+ rounds: number;
2455
+ active_budget_seconds: number;
2456
+ acceptance_manifest: string;
2457
+ acceptance_inputs: string[];
2458
+ copy_preparation_manifest?: string | undefined;
2459
+ context_roots?: {
2460
+ worktree: string;
2461
+ roots: {
2462
+ rebased: string;
2463
+ original?: string | undefined;
2464
+ }[];
2465
+ focus_paths: {
2466
+ original: string;
2467
+ rebased: string;
2468
+ }[];
2469
+ } | undefined;
2470
+ }, {
2471
+ schema_version: "pp-admission-v1";
2472
+ sign_off_threshold: number;
2473
+ admitted_at: string;
2474
+ deadline_at: string;
2475
+ repo_root: string;
2476
+ baseline_uncommitted_changes_excluded: boolean;
2477
+ baseline_commit: string;
2478
+ rounds: number;
2479
+ active_budget_seconds: number;
2480
+ acceptance_manifest: string;
2481
+ acceptance_inputs: string[];
2482
+ copy_preparation_manifest?: string | undefined;
2483
+ context_roots?: {
2484
+ worktree: string;
2485
+ roots: {
2486
+ rebased: string;
2487
+ original?: string | undefined;
2488
+ }[];
2489
+ focus_paths: {
2490
+ original: string;
2491
+ rebased: string;
2492
+ }[];
2493
+ } | undefined;
2494
+ }>;
2495
+ export type PpAdmission = z.infer<typeof PpAdmissionSchema>;
2496
+ export type PpContextRoots = NonNullable<PpAdmission["context_roots"]>;
2497
+ /** Terminal record output (`record` reducer); advisory projection of the sidecar. */
2498
+ export declare const PpRecordSchema: z.ZodObject<{
2499
+ schema: z.ZodLiteral<"pp-record-v1">;
2500
+ run_id: z.ZodString;
2501
+ outcome: z.ZodEnum<["qualified", "stopped", "failed", "cancelled"]>;
2502
+ stop_reason: z.ZodOptional<z.ZodEnum<["main_agent_stop", "round_budget_exhausted", "no_sign_off", "seat_unavailable", "no_progress", "final_verification_failed", "acceptance_input_changed", "target_changed_during_review", "recovery_required", "permission_failure", "deadline_exceeded", "active_budget_exhausted", "evidence_capacity", "cancelled"]>>;
2503
+ rounds_used: z.ZodNumber;
2504
+ round_cap: z.ZodNumber;
2505
+ baseline_commit: z.ZodString;
2506
+ candidate_identity: z.ZodOptional<z.ZodString>;
2507
+ worktree: z.ZodEffects<z.ZodString, string, string>;
2508
+ unresolved_operations: z.ZodNumber;
2509
+ unresolved_findings: z.ZodArray<z.ZodString, "many">;
2510
+ final_verification: z.ZodEnum<["passed", "failed", "not_run"]>;
2511
+ }, "strict", z.ZodTypeAny, {
2512
+ run_id: string;
2513
+ outcome: "failed" | "cancelled" | "stopped" | "qualified";
2514
+ schema: "pp-record-v1";
2515
+ rounds_used: number;
2516
+ round_cap: number;
2517
+ unresolved_findings: string[];
2518
+ unresolved_operations: number;
2519
+ baseline_commit: string;
2520
+ worktree: string;
2521
+ final_verification: "failed" | "passed" | "not_run";
2522
+ candidate_identity?: string | undefined;
2523
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
2524
+ }, {
2525
+ run_id: string;
2526
+ outcome: "failed" | "cancelled" | "stopped" | "qualified";
2527
+ schema: "pp-record-v1";
2528
+ rounds_used: number;
2529
+ round_cap: number;
2530
+ unresolved_findings: string[];
2531
+ unresolved_operations: number;
2532
+ baseline_commit: string;
2533
+ worktree: string;
2534
+ final_verification: "failed" | "passed" | "not_run";
2535
+ candidate_identity?: string | undefined;
2536
+ stop_reason?: "cancelled" | "main_agent_stop" | "round_budget_exhausted" | "no_sign_off" | "seat_unavailable" | "no_progress" | "final_verification_failed" | "acceptance_input_changed" | "target_changed_during_review" | "recovery_required" | "permission_failure" | "deadline_exceeded" | "active_budget_exhausted" | "evidence_capacity" | undefined;
2537
+ }>;
2538
+ export type PpRecord = z.infer<typeof PpRecordSchema>;
2539
+ export declare const PP_MAX_RECORD_BYTES: number;