@quantiya/codevibe-core 2.0.0 → 2.0.2

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 (416) hide show
  1. package/dist/__tests__/cp-5-baseline-invariants.test.d.ts +1 -0
  2. package/dist/__tests__/prompt-parser.test.d.ts +1 -0
  3. package/dist/adapter/__tests__/capabilities.test.d.ts +1 -0
  4. package/dist/adapter/__tests__/contract-conformance.test.d.ts +1 -0
  5. package/dist/adapter/__tests__/packets.test.d.ts +1 -0
  6. package/dist/adapter/__tests__/progress.test.d.ts +1 -0
  7. package/dist/adapter/__tests__/registry.test.d.ts +1 -0
  8. package/dist/adapter/__tests__/smoke/claude.smoke.test.d.ts +1 -0
  9. package/dist/adapter/__tests__/smoke/codex.smoke.test.d.ts +1 -0
  10. package/dist/adapter/__tests__/smoke/gemini.smoke.test.d.ts +1 -0
  11. package/dist/adapter/capabilities.d.ts +68 -0
  12. package/dist/adapter/index.d.ts +7 -0
  13. package/dist/adapter/packets.d.ts +129 -0
  14. package/dist/adapter/progress.d.ts +93 -0
  15. package/dist/adapter/registry.d.ts +91 -0
  16. package/dist/adapter/types.d.ts +22 -0
  17. package/dist/appsync/__tests__/appsync-client-apply-user-decision.test.d.ts +1 -0
  18. package/dist/appsync/__tests__/appsync-client-classb.test.d.ts +1 -0
  19. package/dist/appsync/__tests__/appsync-client-event-source-filter.test.d.ts +1 -0
  20. package/dist/appsync/__tests__/appsync-client-planner.test.d.ts +1 -0
  21. package/dist/appsync/__tests__/appsync-client-task-group.test.d.ts +1 -0
  22. package/dist/appsync/__tests__/appsync-client.test.d.ts +1 -0
  23. package/dist/appsync/__tests__/cleanup-subscription.test.d.ts +1 -0
  24. package/dist/appsync/__tests__/coerce-awsjson-and-review-summary.test.d.ts +1 -0
  25. package/dist/appsync/__tests__/cp1f-quorum-sdk.test.d.ts +1 -0
  26. package/dist/appsync/__tests__/event-throttle.test.d.ts +1 -0
  27. package/dist/appsync/appsync-client.d.ts +1025 -2
  28. package/dist/appsync/event-throttle.d.ts +28 -0
  29. package/dist/appsync/index.d.ts +4 -1
  30. package/dist/appsync/queries.d.ts +34 -0
  31. package/dist/audit-keys/index.d.ts +32 -0
  32. package/dist/auth/__tests__/auth-telemetry.test.d.ts +1 -0
  33. package/dist/auth/auth-service.d.ts +32 -2
  34. package/dist/auth/auth-telemetry.d.ts +117 -6
  35. package/dist/auth/index.d.ts +1 -0
  36. package/dist/companion-mode/__tests__/persist-preference.test.d.ts +1 -0
  37. package/dist/companion-mode/__tests__/resolve-agent.test.d.ts +1 -0
  38. package/dist/companion-mode/agent-picker.d.ts +9 -0
  39. package/dist/companion-mode/index.d.ts +55 -0
  40. package/dist/companion-mode/persist-preference.d.ts +24 -0
  41. package/dist/companion-mode/resolve-agent.d.ts +41 -0
  42. package/dist/config/config.d.ts +8 -1
  43. package/dist/continuation/__tests__/dirty-state-collector.test.d.ts +1 -0
  44. package/dist/continuation/__tests__/integration.test.d.ts +1 -0
  45. package/dist/continuation/__tests__/packet-reader.test.d.ts +1 -0
  46. package/dist/continuation/__tests__/packet-writer.test.d.ts +1 -0
  47. package/dist/continuation/__tests__/parity.test.d.ts +1 -0
  48. package/dist/continuation/__tests__/status-cli.test.d.ts +1 -0
  49. package/dist/continuation/dirty-state-collector.d.ts +46 -0
  50. package/dist/continuation/index.d.ts +8 -0
  51. package/dist/continuation/packet-reader.d.ts +33 -0
  52. package/dist/continuation/packet-writer.d.ts +86 -0
  53. package/dist/continuation/types.d.ts +239 -0
  54. package/dist/credential-broker/__tests__/broker.test.d.ts +1 -0
  55. package/dist/credential-broker/__tests__/canonical.test.d.ts +1 -0
  56. package/dist/credential-broker/__tests__/scrubber.test.d.ts +1 -0
  57. package/dist/credential-broker/__tests__/upstream-client.test.d.ts +1 -0
  58. package/dist/credential-broker/__tests__/vendor-key-store.test.d.ts +1 -0
  59. package/dist/credential-broker/audit-sink.d.ts +69 -0
  60. package/dist/credential-broker/broker-config.d.ts +39 -0
  61. package/dist/credential-broker/broker-token.d.ts +123 -0
  62. package/dist/credential-broker/broker.d.ts +165 -0
  63. package/dist/credential-broker/canonical.d.ts +119 -0
  64. package/dist/credential-broker/index.d.ts +15 -0
  65. package/dist/credential-broker/scrubber.d.ts +45 -0
  66. package/dist/credential-broker/types.d.ts +141 -0
  67. package/dist/credential-broker/upstream-client.d.ts +20 -0
  68. package/dist/credential-broker/vendor-key-store.d.ts +54 -0
  69. package/dist/index.d.ts +17 -4
  70. package/dist/index.js +559 -55
  71. package/dist/keychain/__tests__/keychain-backend.test.d.ts +1 -0
  72. package/dist/keychain/keychain-backend.d.ts +82 -0
  73. package/dist/keychain/keychain-manager.d.ts +16 -2
  74. package/dist/local-executor/__tests__/agentic-disposable-repo.test.d.ts +1 -0
  75. package/dist/local-executor/__tests__/agentic-resolve.test.d.ts +1 -0
  76. package/dist/local-executor/__tests__/agentic-resolver-flag.test.d.ts +1 -0
  77. package/dist/local-executor/__tests__/authority-symlink-fixture.d.ts +15 -0
  78. package/dist/local-executor/__tests__/authority.test.d.ts +1 -0
  79. package/dist/local-executor/__tests__/class-a-emit.test.d.ts +1 -0
  80. package/dist/local-executor/__tests__/class-a-sign.test.d.ts +1 -0
  81. package/dist/local-executor/__tests__/class-b-consumer.integration.test.d.ts +1 -0
  82. package/dist/local-executor/__tests__/class-b-consumer.test.d.ts +1 -0
  83. package/dist/local-executor/__tests__/class1-reconcilers.test.d.ts +1 -0
  84. package/dist/local-executor/__tests__/class2-resolver.test.d.ts +1 -0
  85. package/dist/local-executor/__tests__/confined-model-caller.test.d.ts +1 -0
  86. package/dist/local-executor/__tests__/conflict-classifier.test.d.ts +1 -0
  87. package/dist/local-executor/__tests__/conflict-resolution-durable-store.test.d.ts +1 -0
  88. package/dist/local-executor/__tests__/conflict-resolution-store.test.d.ts +1 -0
  89. package/dist/local-executor/__tests__/cp1f-quorum-consumer.test.d.ts +1 -0
  90. package/dist/local-executor/__tests__/cp7-audit-writer.test.d.ts +1 -0
  91. package/dist/local-executor/__tests__/durable-store.test.d.ts +1 -0
  92. package/dist/local-executor/__tests__/git-lock-retry.test.d.ts +1 -0
  93. package/dist/local-executor/__tests__/hook-bridge.test.d.ts +1 -0
  94. package/dist/local-executor/__tests__/implementor-argv.test.d.ts +1 -0
  95. package/dist/local-executor/__tests__/local-executor-teams.test.d.ts +1 -0
  96. package/dist/local-executor/__tests__/local-executor.integration.test.d.ts +1 -0
  97. package/dist/local-executor/__tests__/merge-conflict-extract.test.d.ts +1 -0
  98. package/dist/local-executor/__tests__/merge-conflict-git.integration.test.d.ts +1 -0
  99. package/dist/local-executor/__tests__/merge-conflict-resolve-agentic.integration.test.d.ts +1 -0
  100. package/dist/local-executor/__tests__/merge-conflict-resolve.integration.test.d.ts +1 -0
  101. package/dist/local-executor/__tests__/merge-journal-store.test.d.ts +1 -0
  102. package/dist/local-executor/__tests__/merge-train-agentic-recovery.integration.test.d.ts +1 -0
  103. package/dist/local-executor/__tests__/merge-train-w3.integration.test.d.ts +1 -0
  104. package/dist/local-executor/__tests__/merge-train-waveb.integration.test.d.ts +1 -0
  105. package/dist/local-executor/__tests__/merge-train.test.d.ts +1 -0
  106. package/dist/local-executor/__tests__/promote-wal-store.test.d.ts +1 -0
  107. package/dist/local-executor/__tests__/revert-reconcile.test.d.ts +1 -0
  108. package/dist/local-executor/__tests__/revert-runner.test.d.ts +1 -0
  109. package/dist/local-executor/__tests__/shared-contract-detector.test.d.ts +1 -0
  110. package/dist/local-executor/__tests__/spawn.test.d.ts +1 -0
  111. package/dist/local-executor/__tests__/substrate-engage.test.d.ts +1 -0
  112. package/dist/local-executor/__tests__/team-execution-flag.test.d.ts +1 -0
  113. package/dist/local-executor/__tests__/track-registry.test.d.ts +1 -0
  114. package/dist/local-executor/__tests__/verification-runner.test.d.ts +1 -0
  115. package/dist/local-executor/__tests__/wb2-review-bundle.test.d.ts +1 -0
  116. package/dist/local-executor/__tests__/wb2-substrate-spawn.live.test.d.ts +1 -0
  117. package/dist/local-executor/__tests__/workspace-shadow.test.d.ts +1 -0
  118. package/dist/local-executor/__tests__/worktree-merge.test.d.ts +1 -0
  119. package/dist/local-executor/agentic-disposable-repo.d.ts +52 -0
  120. package/dist/local-executor/agentic-resolve.d.ts +54 -0
  121. package/dist/local-executor/agentic-resolver-flag.d.ts +9 -0
  122. package/dist/local-executor/authority.d.ts +61 -0
  123. package/dist/local-executor/class-a-emit.d.ts +140 -0
  124. package/dist/local-executor/class-a-sign.d.ts +57 -0
  125. package/dist/local-executor/class-b-consumer.d.ts +276 -0
  126. package/dist/local-executor/class-b-verify.d.ts +30 -0
  127. package/dist/local-executor/class1-reconcilers.d.ts +58 -0
  128. package/dist/local-executor/class2-resolver.d.ts +74 -0
  129. package/dist/local-executor/confined-model-caller.d.ts +39 -0
  130. package/dist/local-executor/conflict-classifier.d.ts +21 -0
  131. package/dist/local-executor/conflict-resolution-durable-store.d.ts +61 -0
  132. package/dist/local-executor/conflict-resolution-store.d.ts +210 -0
  133. package/dist/local-executor/conflict-types.d.ts +86 -0
  134. package/dist/local-executor/cp7-audit-writer.d.ts +152 -0
  135. package/dist/local-executor/durable-store.d.ts +334 -0
  136. package/dist/local-executor/git-lock-retry.d.ts +40 -0
  137. package/dist/local-executor/hook-bridge.d.ts +36 -0
  138. package/dist/local-executor/implementor-argv.d.ts +183 -0
  139. package/dist/local-executor/index.d.ts +49 -0
  140. package/dist/local-executor/local-executor-impl.d.ts +724 -0
  141. package/dist/local-executor/merge-conflict-extract.d.ts +34 -0
  142. package/dist/local-executor/merge-conflict-resolve.d.ts +101 -0
  143. package/dist/local-executor/merge-journal-store.d.ts +311 -0
  144. package/dist/local-executor/merge-train.d.ts +713 -0
  145. package/dist/local-executor/promote-wal-store.d.ts +301 -0
  146. package/dist/local-executor/resolution-set-index.d.ts +51 -0
  147. package/dist/local-executor/revert-reconcile.d.ts +89 -0
  148. package/dist/local-executor/revert-runner.d.ts +17 -0
  149. package/dist/local-executor/shared-contract-detector.d.ts +57 -0
  150. package/dist/local-executor/spawn.d.ts +34 -0
  151. package/dist/local-executor/task-group-types.d.ts +346 -0
  152. package/dist/local-executor/team-execution-flag.d.ts +21 -0
  153. package/dist/local-executor/track-registry.d.ts +50 -0
  154. package/dist/local-executor/types.d.ts +417 -0
  155. package/dist/local-executor/verification-gates/build.d.ts +6 -0
  156. package/dist/local-executor/verification-gates/deploy-preflight.d.ts +6 -0
  157. package/dist/local-executor/verification-gates/diff-sanity.d.ts +6 -0
  158. package/dist/local-executor/verification-gates/hostile-grep.d.ts +6 -0
  159. package/dist/local-executor/verification-gates/lint.d.ts +6 -0
  160. package/dist/local-executor/verification-gates/shell-runner.d.ts +40 -0
  161. package/dist/local-executor/verification-gates/source-traceability.d.ts +6 -0
  162. package/dist/local-executor/verification-gates/tests.d.ts +6 -0
  163. package/dist/local-executor/verification-gates/typecheck.d.ts +6 -0
  164. package/dist/local-executor/verification-runner.d.ts +28 -0
  165. package/dist/local-executor/wb2-review-bundle.d.ts +59 -0
  166. package/dist/local-executor/workspace-shadow.d.ts +290 -0
  167. package/dist/local-executor/worktree-merge.d.ts +601 -0
  168. package/dist/local-model/__tests__/installer.test.d.ts +1 -0
  169. package/dist/local-model/__tests__/manager.test.d.ts +1 -0
  170. package/dist/local-model/__tests__/ollama.test.d.ts +1 -0
  171. package/dist/local-model/__tests__/runtime.test.d.ts +1 -0
  172. package/dist/local-model/__tests__/state.test.d.ts +1 -0
  173. package/dist/local-model/manager.d.ts +119 -0
  174. package/dist/local-model/ollama.d.ts +27 -0
  175. package/dist/local-model/runtime.d.ts +27 -0
  176. package/dist/local-model/state.d.ts +32 -0
  177. package/dist/orchestration/__tests__/setup-bootstrap.test.d.ts +1 -0
  178. package/dist/orchestration/__tests__/setup-failure-recourse.test.d.ts +1 -0
  179. package/dist/orchestration/__tests__/setup-save.test.d.ts +1 -0
  180. package/dist/orchestration/__tests__/setup-seat-picker.test.d.ts +1 -0
  181. package/dist/orchestration/__tests__/setup-telemetry.test.d.ts +1 -0
  182. package/dist/orchestration/__tests__/setup-test-agents.test.d.ts +1 -0
  183. package/dist/orchestration/__tests__/setup-types.test.d.ts +1 -0
  184. package/dist/orchestration/__tests__/setup-wizard.test.d.ts +1 -0
  185. package/dist/orchestration/__tests__/v1-options.test.d.ts +1 -0
  186. package/dist/orchestration/detect-agents.d.ts +16 -2
  187. package/dist/orchestration/index.d.ts +1 -0
  188. package/dist/orchestration/orchestration-cli.d.ts +4 -1
  189. package/dist/orchestration/setup-bootstrap.d.ts +146 -0
  190. package/dist/orchestration/setup-failure-recourse.d.ts +23 -0
  191. package/dist/orchestration/setup-save.d.ts +47 -0
  192. package/dist/orchestration/setup-seat-picker.d.ts +72 -0
  193. package/dist/orchestration/setup-telemetry.d.ts +54 -0
  194. package/dist/orchestration/setup-test-agents.d.ts +108 -0
  195. package/dist/orchestration/setup-types.d.ts +141 -0
  196. package/dist/orchestration/setup-wizard.d.ts +57 -0
  197. package/dist/orchestration/v1-options.d.ts +97 -0
  198. package/dist/orchestration-shell/__tests__/attachments.test.d.ts +1 -0
  199. package/dist/orchestration-shell/__tests__/audit-browser.test.d.ts +1 -0
  200. package/dist/orchestration-shell/__tests__/audited-path-fixes.test.d.ts +1 -0
  201. package/dist/orchestration-shell/__tests__/bracketed-paste.test.d.ts +1 -0
  202. package/dist/orchestration-shell/__tests__/cli-authority-bridge.test.d.ts +1 -0
  203. package/dist/orchestration-shell/__tests__/cli-group-halt-wiring.test.d.ts +1 -0
  204. package/dist/orchestration-shell/__tests__/cli-orchestration-session-bootstrap.test.d.ts +1 -0
  205. package/dist/orchestration-shell/__tests__/cli-planner-stack.test.d.ts +1 -0
  206. package/dist/orchestration-shell/__tests__/cli-probe-group-status.test.d.ts +1 -0
  207. package/dist/orchestration-shell/__tests__/cli-quorum-loop-tier.test.d.ts +1 -0
  208. package/dist/orchestration-shell/__tests__/cli-singleton-enforcement.test.d.ts +1 -0
  209. package/dist/orchestration-shell/__tests__/cli-stub-session-adapter.test.d.ts +1 -0
  210. package/dist/orchestration-shell/__tests__/cli-verdict-classifier-wiring.test.d.ts +1 -0
  211. package/dist/orchestration-shell/__tests__/components.test.d.ts +1 -0
  212. package/dist/orchestration-shell/__tests__/context-store.test.d.ts +1 -0
  213. package/dist/orchestration-shell/__tests__/cp10-585-accept-echo-target.test.d.ts +1 -0
  214. package/dist/orchestration-shell/__tests__/cp10-585-loop.test.d.ts +1 -0
  215. package/dist/orchestration-shell/__tests__/cp10-585-prompts.test.d.ts +1 -0
  216. package/dist/orchestration-shell/__tests__/cp12-w2b-team-loop.test.d.ts +1 -0
  217. package/dist/orchestration-shell/__tests__/cp12-w4-team-recovery.test.d.ts +1 -0
  218. package/dist/orchestration-shell/__tests__/cp1f-quorum-loop.test.d.ts +1 -0
  219. package/dist/orchestration-shell/__tests__/cp606-team-track-user-resolved.test.d.ts +1 -0
  220. package/dist/orchestration-shell/__tests__/cp7-reviewer-substrate.test.d.ts +1 -0
  221. package/dist/orchestration-shell/__tests__/declared-test-runner.test.d.ts +1 -0
  222. package/dist/orchestration-shell/__tests__/emit-shell-event.test.d.ts +1 -0
  223. package/dist/orchestration-shell/__tests__/familiarize-routing.test.d.ts +1 -0
  224. package/dist/orchestration-shell/__tests__/gate-decision-submit.test.d.ts +1 -0
  225. package/dist/orchestration-shell/__tests__/gate-details-panel.test.d.ts +1 -0
  226. package/dist/orchestration-shell/__tests__/gate-prompts.test.d.ts +1 -0
  227. package/dist/orchestration-shell/__tests__/gate-verdict-details-dispatch.test.d.ts +1 -0
  228. package/dist/orchestration-shell/__tests__/group-decision-submit.test.d.ts +1 -0
  229. package/dist/orchestration-shell/__tests__/hostile-grep.test.d.ts +1 -0
  230. package/dist/orchestration-shell/__tests__/image-attach-e2e.test.d.ts +1 -0
  231. package/dist/orchestration-shell/__tests__/input-bar-autocomplete.test.d.ts +1 -0
  232. package/dist/orchestration-shell/__tests__/live-region-cap.test.d.ts +1 -0
  233. package/dist/orchestration-shell/__tests__/live-static-order.test.d.ts +1 -0
  234. package/dist/orchestration-shell/__tests__/mode-selection.test.d.ts +1 -0
  235. package/dist/orchestration-shell/__tests__/model-cli.test.d.ts +1 -0
  236. package/dist/orchestration-shell/__tests__/non-gate-prompt-routing.test.d.ts +1 -0
  237. package/dist/orchestration-shell/__tests__/orchestration-app-group-decision-transport.test.d.ts +1 -0
  238. package/dist/orchestration-shell/__tests__/orchestration-app-layout.test.d.ts +1 -0
  239. package/dist/orchestration-shell/__tests__/process-markers.test.d.ts +1 -0
  240. package/dist/orchestration-shell/__tests__/reducer.test.d.ts +1 -0
  241. package/dist/orchestration-shell/__tests__/reissue-team-retained-spec.test.d.ts +1 -0
  242. package/dist/orchestration-shell/__tests__/review-summary-render.test.d.ts +1 -0
  243. package/dist/orchestration-shell/__tests__/reviewer-wizard.test.d.ts +1 -0
  244. package/dist/orchestration-shell/__tests__/reviewers-format.test.d.ts +1 -0
  245. package/dist/orchestration-shell/__tests__/root-discovery.test.d.ts +1 -0
  246. package/dist/orchestration-shell/__tests__/runOrchestrationShell-classify-dispatch.test.d.ts +1 -0
  247. package/dist/orchestration-shell/__tests__/runOrchestrationShell-planner-wiring.test.d.ts +1 -0
  248. package/dist/orchestration-shell/__tests__/runOrchestrationShell-signal.test.d.ts +1 -0
  249. package/dist/orchestration-shell/__tests__/runOrchestrationShell.test.d.ts +1 -0
  250. package/dist/orchestration-shell/__tests__/serialize-submissions.test.d.ts +1 -0
  251. package/dist/orchestration-shell/__tests__/slash-router.test.d.ts +1 -0
  252. package/dist/orchestration-shell/__tests__/slash-suggest.test.d.ts +1 -0
  253. package/dist/orchestration-shell/__tests__/status-format.test.d.ts +1 -0
  254. package/dist/orchestration-shell/__tests__/sticky-preference.test.d.ts +1 -0
  255. package/dist/orchestration-shell/__tests__/task-progress.test.d.ts +1 -0
  256. package/dist/orchestration-shell/__tests__/team-decompose-routing.test.d.ts +1 -0
  257. package/dist/orchestration-shell/__tests__/team-decompose-types.test.d.ts +1 -0
  258. package/dist/orchestration-shell/__tests__/team-decompose.test.d.ts +1 -0
  259. package/dist/orchestration-shell/__tests__/team-e2e-smoke.test.d.ts +1 -0
  260. package/dist/orchestration-shell/__tests__/tier2-reviewer-selection.test.d.ts +1 -0
  261. package/dist/orchestration-shell/__tests__/web-browsing.test.d.ts +1 -0
  262. package/dist/orchestration-shell/attachments.d.ts +152 -0
  263. package/dist/orchestration-shell/audit-browser.d.ts +115 -0
  264. package/dist/orchestration-shell/audit-runner.d.ts +59 -0
  265. package/dist/orchestration-shell/bracketed-paste.d.ts +26 -0
  266. package/dist/orchestration-shell/cli.d.ts +431 -0
  267. package/dist/orchestration-shell/cli.js +44191 -0
  268. package/dist/orchestration-shell/cohort-flag.d.ts +16 -0
  269. package/dist/orchestration-shell/components/AuditLogPanel.d.ts +11 -0
  270. package/dist/orchestration-shell/components/CodeVibeLogo.d.ts +2 -0
  271. package/dist/orchestration-shell/components/ConversationPane.d.ts +13 -0
  272. package/dist/orchestration-shell/components/GateDetailsPanel.d.ts +57 -0
  273. package/dist/orchestration-shell/components/GatePanelEntry.d.ts +9 -0
  274. package/dist/orchestration-shell/components/GatePromptEntry.d.ts +16 -0
  275. package/dist/orchestration-shell/components/InputBar.d.ts +55 -0
  276. package/dist/orchestration-shell/components/LiveProgressLine.d.ts +8 -0
  277. package/dist/orchestration-shell/components/MultiTrackStatusNode.d.ts +8 -0
  278. package/dist/orchestration-shell/components/OrchestrationApp.d.ts +129 -0
  279. package/dist/orchestration-shell/components/ReviewerSetupWizard.d.ts +24 -0
  280. package/dist/orchestration-shell/components/StatusBar.d.ts +20 -0
  281. package/dist/orchestration-shell/components/nodes/AdvisoryEntry.d.ts +8 -0
  282. package/dist/orchestration-shell/components/nodes/GateStatusNode.d.ts +8 -0
  283. package/dist/orchestration-shell/components/nodes/PlannerDecisionEntry.d.ts +8 -0
  284. package/dist/orchestration-shell/components/nodes/ReviewerQuorumStatusNode.d.ts +8 -0
  285. package/dist/orchestration-shell/components/nodes/SlashOutputEntry.d.ts +8 -0
  286. package/dist/orchestration-shell/components/nodes/SubagentEventEntry.d.ts +8 -0
  287. package/dist/orchestration-shell/components/nodes/UserMessageEntry.d.ts +8 -0
  288. package/dist/orchestration-shell/context-store.d.ts +389 -0
  289. package/dist/orchestration-shell/declared-test-runner.d.ts +84 -0
  290. package/dist/orchestration-shell/emit-shell-event.d.ts +64 -0
  291. package/dist/orchestration-shell/gate-decision-submit.d.ts +245 -0
  292. package/dist/orchestration-shell/gate-prompts.d.ts +481 -0
  293. package/dist/orchestration-shell/index.d.ts +712 -0
  294. package/dist/orchestration-shell/ink-runtime.d.ts +84 -0
  295. package/dist/orchestration-shell/live-region-cap.d.ts +70 -0
  296. package/dist/orchestration-shell/live-static-order.d.ts +22 -0
  297. package/dist/orchestration-shell/mode-selection.d.ts +46 -0
  298. package/dist/orchestration-shell/non-tty-fallback.d.ts +67 -0
  299. package/dist/orchestration-shell/process-markers.d.ts +12 -0
  300. package/dist/orchestration-shell/quorum-loop.d.ts +1900 -0
  301. package/dist/orchestration-shell/reducer.d.ts +8 -0
  302. package/dist/orchestration-shell/root-discovery.d.ts +25 -0
  303. package/dist/orchestration-shell/route-browse.d.ts +20 -0
  304. package/dist/orchestration-shell/slash-router.d.ts +64 -0
  305. package/dist/orchestration-shell/slash-routes/continuation.d.ts +71 -0
  306. package/dist/orchestration-shell/slash-routes/reviewers.d.ts +41 -0
  307. package/dist/orchestration-shell/slash-suggest.d.ts +29 -0
  308. package/dist/orchestration-shell/status-format.d.ts +59 -0
  309. package/dist/orchestration-shell/sticky-preference.d.ts +24 -0
  310. package/dist/orchestration-shell/store.d.ts +17 -0
  311. package/dist/orchestration-shell/task-progress.d.ts +122 -0
  312. package/dist/orchestration-shell/team-decompose.d.ts +196 -0
  313. package/dist/orchestration-shell/types.d.ts +777 -0
  314. package/dist/orchestration-shell/vendor/ink-parse-keypress.d.ts +42 -0
  315. package/dist/orchestration-shell/web/extract.d.ts +11 -0
  316. package/dist/orchestration-shell/web/fetch.d.ts +15 -0
  317. package/dist/orchestration-shell/web/ip.d.ts +26 -0
  318. package/dist/orchestration-shell/web/sanitize.d.ts +14 -0
  319. package/dist/orchestration-shell/web/search.d.ts +16 -0
  320. package/dist/planner/__tests__/cache-clarification-bypass.test.d.ts +1 -0
  321. package/dist/planner/__tests__/cache.test.d.ts +1 -0
  322. package/dist/planner/__tests__/client.test.d.ts +1 -0
  323. package/dist/planner/__tests__/health-machine-transitions.test.d.ts +1 -0
  324. package/dist/planner/__tests__/local-gemma.test.d.ts +1 -0
  325. package/dist/planner/__tests__/types-zod.test.d.ts +1 -0
  326. package/dist/planner/adapter.d.ts +16 -0
  327. package/dist/planner/cache.d.ts +35 -0
  328. package/dist/planner/client.d.ts +103 -0
  329. package/dist/planner/health-state.d.ts +24 -0
  330. package/dist/planner/index.d.ts +7 -0
  331. package/dist/planner/local-advisory.d.ts +84 -0
  332. package/dist/planner/local-gemma.d.ts +23 -0
  333. package/dist/planner/types.d.ts +123 -0
  334. package/dist/reviewer/__tests__/antigravity-provider.test.d.ts +1 -0
  335. package/dist/reviewer/__tests__/claude-provider-json.test.d.ts +1 -0
  336. package/dist/reviewer/__tests__/cp7-reviewer-sandbox.test.d.ts +1 -0
  337. package/dist/reviewer/__tests__/output-parser-classifier-helpers.test.d.ts +1 -0
  338. package/dist/reviewer/__tests__/verdict-classifier.test.d.ts +1 -0
  339. package/dist/reviewer/index.d.ts +2 -0
  340. package/dist/reviewer/output-parser.d.ts +48 -12
  341. package/dist/reviewer/provider.d.ts +107 -3
  342. package/dist/reviewer/providers/__tests__/failure-classifier.test.d.ts +1 -0
  343. package/dist/reviewer/providers/antigravity.d.ts +49 -0
  344. package/dist/reviewer/providers/claude.d.ts +19 -4
  345. package/dist/reviewer/providers/codex.d.ts +47 -5
  346. package/dist/reviewer/providers/failure-classifier.d.ts +26 -0
  347. package/dist/reviewer/providers/gemini.d.ts +5 -4
  348. package/dist/reviewer/registry.d.ts +5 -5
  349. package/dist/reviewer/subprocess.d.ts +37 -0
  350. package/dist/reviewer/token-usage.d.ts +32 -0
  351. package/dist/reviewer/types.d.ts +5 -5
  352. package/dist/reviewer/verdict-classifier.d.ts +62 -0
  353. package/dist/session/__tests__/prepare-event-timestamp.test.d.ts +1 -0
  354. package/dist/session/__tests__/session-resume-service-keys.test.d.ts +1 -0
  355. package/dist/session/index.d.ts +1 -0
  356. package/dist/session/prepare-event-timestamp.d.ts +30 -0
  357. package/dist/session/session-rekey.d.ts +40 -0
  358. package/dist/session/session-resume.d.ts +25 -0
  359. package/dist/structural-summary/__tests__/__fixtures__/fixture-helpers.d.ts +11 -0
  360. package/dist/structural-summary/__tests__/assembler.test.d.ts +1 -0
  361. package/dist/structural-summary/__tests__/generator.test.d.ts +1 -0
  362. package/dist/structural-summary/__tests__/language-detect.test.d.ts +1 -0
  363. package/dist/structural-summary/__tests__/manifest-parsers/cargo.test.d.ts +1 -0
  364. package/dist/structural-summary/__tests__/manifest-parsers/gomod.test.d.ts +1 -0
  365. package/dist/structural-summary/__tests__/manifest-parsers/gradle.test.d.ts +1 -0
  366. package/dist/structural-summary/__tests__/manifest-parsers/index.test.d.ts +1 -0
  367. package/dist/structural-summary/__tests__/manifest-parsers/npm.test.d.ts +1 -0
  368. package/dist/structural-summary/__tests__/manifest-parsers/podfile.test.d.ts +1 -0
  369. package/dist/structural-summary/__tests__/manifest-parsers/pyproject.test.d.ts +1 -0
  370. package/dist/structural-summary/__tests__/opt-in-store.test.d.ts +1 -0
  371. package/dist/structural-summary/__tests__/privacy-filter.test.d.ts +1 -0
  372. package/dist/structural-summary/__tests__/safe-file-read.test.d.ts +1 -0
  373. package/dist/structural-summary/__tests__/user-ignore-matcher.test.d.ts +1 -0
  374. package/dist/structural-summary/__tests__/walker.test.d.ts +1 -0
  375. package/dist/structural-summary/generator.d.ts +8 -0
  376. package/dist/structural-summary/index.d.ts +7 -0
  377. package/dist/structural-summary/manifest-parsers/cargo.d.ts +3 -0
  378. package/dist/structural-summary/manifest-parsers/index.d.ts +7 -0
  379. package/dist/structural-summary/manifest-parsers/npm.d.ts +3 -0
  380. package/dist/structural-summary/manifest-parsers/other.d.ts +17 -0
  381. package/dist/structural-summary/opt-in-store.d.ts +24 -0
  382. package/dist/structural-summary/privacy-filter.d.ts +110 -0
  383. package/dist/structural-summary/safe-file-read.d.ts +11 -0
  384. package/dist/structural-summary/types.d.ts +215 -0
  385. package/dist/structural-summary/user-ignore-matcher.d.ts +9 -0
  386. package/dist/structural-summary/walker.d.ts +20 -0
  387. package/dist/substrate/__tests__/docker.test.d.ts +1 -0
  388. package/dist/substrate/__tests__/forwarder.test.d.ts +1 -0
  389. package/dist/substrate/__tests__/git-proxy.test.d.ts +1 -0
  390. package/dist/substrate/__tests__/sandbox-exec.test.d.ts +1 -0
  391. package/dist/substrate/__tests__/substrate-e2e.integration.test.d.ts +1 -0
  392. package/dist/substrate/command-runner.d.ts +19 -0
  393. package/dist/substrate/docker.d.ts +134 -0
  394. package/dist/substrate/errors.d.ts +33 -0
  395. package/dist/substrate/forwarder.d.ts +67 -0
  396. package/dist/substrate/git-proxy.d.ts +35 -0
  397. package/dist/substrate/index.d.ts +12 -0
  398. package/dist/substrate/relay-script.d.ts +27 -0
  399. package/dist/substrate/sandbox-exec.d.ts +116 -0
  400. package/dist/substrate/types.d.ts +218 -0
  401. package/dist/substrate-launch/__tests__/apikey-bootstrap.test.d.ts +1 -0
  402. package/dist/substrate-launch/__tests__/creditless-loop.integration.test.d.ts +1 -0
  403. package/dist/substrate-launch/__tests__/engage-substrate.test.d.ts +1 -0
  404. package/dist/substrate-launch/__tests__/fallback-ladder.test.d.ts +1 -0
  405. package/dist/substrate-launch/__tests__/le-env-scrub.test.d.ts +1 -0
  406. package/dist/substrate-launch/__tests__/sanitized-env.test.d.ts +1 -0
  407. package/dist/substrate-launch/apikey-bootstrap.d.ts +84 -0
  408. package/dist/substrate-launch/engage-substrate.d.ts +102 -0
  409. package/dist/substrate-launch/fallback-ladder.d.ts +49 -0
  410. package/dist/substrate-launch/index.d.ts +12 -0
  411. package/dist/substrate-launch/le-env-scrub.d.ts +77 -0
  412. package/dist/substrate-launch/sanitized-env.d.ts +73 -0
  413. package/dist/types/auth.d.ts +6 -1
  414. package/dist/types/events.d.ts +19 -2
  415. package/dist/types/reviewer.d.ts +6 -6
  416. package/package.json +21 -3
@@ -0,0 +1,301 @@
1
+ /** The current promote-WAL schema version (append-only; bump on a breaking shape change). */
2
+ export declare const PROMOTE_WAL_VERSION: 1;
3
+ /**
4
+ * The three promote modes (§3.1). They differ ONLY in the adopt target a crash
5
+ * recovery must reconstruct:
6
+ * - `clean` — FF the user ref+index+worktree to `integration_tip`.
7
+ * - `dirty_committed` — `git merge integration_tip` into the user branch →
8
+ * a MERGE commit with parents [pre_promote_user_ref,
9
+ * integration_tip] (NOT a FF to integration_tip).
10
+ * - `dirty_uncommitted` — advance the ref to integration_tip + apply the tree
11
+ * preserving the non-overlapping uncommitted edits.
12
+ */
13
+ export type PromoteMode = 'clean' | 'dirty_committed' | 'dirty_uncommitted';
14
+ /** The durable promote-WAL record (§3.1). */
15
+ export interface PromoteWalRecord {
16
+ version: typeof PROMOTE_WAL_VERSION;
17
+ taskGroupId: string;
18
+ repoId: string;
19
+ /** The per-repo base snapshot = user repo HEAD at dispatch. */
20
+ baseSha: string;
21
+ /** The integration branch tip we are promoting onto the user tree. */
22
+ integrationTip: string;
23
+ /** The user's branch ref NAME (e.g. `refs/heads/main`) being advanced. */
24
+ userRefName: string;
25
+ /** Which of the three promote modes this WAL is for (drives mode-aware adopt). */
26
+ promoteMode: PromoteMode;
27
+ /**
28
+ * The user's ref value BEFORE the promote (the EXACT restore target for revert/
29
+ * recovery — NEVER `base_sha`; the user may have committed `U` before dispatch).
30
+ */
31
+ prePromoteUserRef: string;
32
+ /**
33
+ * The durable stash-commit SHA capturing the user's TRACKED working-tree +
34
+ * index at promote time (= `codevibe/stash/<group>/<repo>`). Restored on revert/
35
+ * recovery. `null` only when the tracked tree was clean with nothing to stash.
36
+ *
37
+ * NOTE (W1 HIGH-1 fix): `git stash create` does NOT durably capture UNTRACKED
38
+ * files (proven against real git 2.50.x — the `create`-produced commit has no
39
+ * untracked `^3` parent, and `git stash apply <raw-sha>` never restores `-u`
40
+ * content). So untracked files are captured SEPARATELY in
41
+ * {@link preImageUntrackedTree}; this ref covers tracked+index only.
42
+ */
43
+ preImageManifestRef: string | null;
44
+ /**
45
+ * The durable TREE sha capturing the user's UNTRACKED (non-ignored) files at
46
+ * promote time (= `codevibe/untracked/<group>/<repo>`), built via a temp-index
47
+ * `write-tree` over the exact `git ls-files --others --exclude-standard` set.
48
+ * Restored on revert/recovery so a dirty-uncommitted promote's untracked edits
49
+ * survive the `clean -fd` that pairs with the restore reset (LOCK #C14-REVERT,
50
+ * "never auto-discard user work"). `null` / the empty tree when none existed.
51
+ * Absent on records written by an older W1 build (treated as "no untracked").
52
+ */
53
+ preImageUntrackedTree?: string | null;
54
+ /**
55
+ * The expected post-promote TREE sha (§3.1 r4 Codex). For `dirty_committed`
56
+ * this is the tree of the user-merge commit; for clean/dirty_uncommitted it is
57
+ * the integration tip's tree (clean) or the merged-preserving tree (uncommitted).
58
+ * Recovery matches the adopt target by parents AND tree.
59
+ */
60
+ expectedPostPromoteTree: string;
61
+ /**
62
+ * The expected post-promote WORKTREE snapshot tree (W1 Stage-2 H1/H2/H3). A
63
+ * git tree of the user's COMPLETE post-promote worktree — every TRACKED file
64
+ * (with its live, possibly-unstaged content + mode) AND every UNTRACKED
65
+ * (non-ignored) file, built by an `add -A` over a temp index seeded from HEAD.
66
+ *
67
+ * Unlike {@link expectedPostPromoteTree} (the INDEX tree — which for
68
+ * `dirty_uncommitted` matches the integration tree and so does NOT capture the
69
+ * preserved unstaged tracked edit, nor any untracked file), this captures the
70
+ * EXACT on-disk state the promote leaves behind. Revert/recovery recompute the
71
+ * live snapshot and `diff-tree` it against this; ANY difference (a tracked edit,
72
+ * an untracked add/delete, a mode/exec-bit or file↔symlink type change) is the
73
+ * user's post-promote work → rescue, never auto-clobber (LOCK #C14-REVERT). It
74
+ * is symlink-correct natively (git stores a symlink as a 120000 blob of its
75
+ * target-path string), closing the `hash-object`-follows-symlink false-rescue.
76
+ *
77
+ * Absent on records written by an older W1 build (treated as "no worktree
78
+ * manifest" → the legacy index-tree CAS still applies, fail-safe).
79
+ */
80
+ expectedPostPromoteWorktreeTree?: string | null;
81
+ /**
82
+ * The user's PRE-promote WORKTREE snapshot tree (W1 Stage-2 H6) — the complete
83
+ * on-disk state (tracked-with-unstaged + untracked, mode/type/symlink-aware)
84
+ * captured BEFORE any mutation. Crash recovery uses it as the SECOND known-good
85
+ * anchor: a partial mid-mutation worktree's content is, path-by-path, drawn from
86
+ * EITHER this pre-promote snapshot OR the {@link expectedPostPromoteWorktreeTree}.
87
+ * Any live path whose content matches NEITHER is the user's POST-CRASH work → the
88
+ * recovery rescue-refs + surfaces instead of clobbering it (never auto-discard).
89
+ * Absent on older W1 records (H6 guard then no-ops → legacy partial restore).
90
+ */
91
+ prePromoteWorktreeTree?: string | null;
92
+ /**
93
+ * W1 Stage-2 (Codex r12 H1 / M1) — the RAW-BYTE digest over the NORMALIZING-attribute
94
+ * paths ({@link filteredSurfacePaths}: `text`/`eol`/`filter`/encoding/`ident`) of the
95
+ * PRE-promote worktree, captured from the live on-disk bytes BEFORE any mutation (when
96
+ * the worktree is provably the pre-promote state).
97
+ *
98
+ * Why persist it: the worktree-snapshot trees ({@link prePromoteWorktreeTree},
99
+ * {@link expectedPostPromoteWorktreeTree}) are built by `git add -A`, which NORMALIZES
100
+ * a path carrying such an attribute — so two DIFFERENT raw byte states (e.g. CRLF vs LF)
101
+ * map to the SAME snapshot blob. The transient op-site `PreOpAnchor` carried a live raw
102
+ * digest, but the durable WAL did not — so (a) the op-site guard could not use a
103
+ * KNOWN-tree anchor without losing raw-byte protection (Codex r12 H1), and (b)
104
+ * `detectWorktreeDrift` / `unexplainedRecoveryPaths` FAILED CLOSED on the mere PRESENCE
105
+ * of a normalizing path (Codex r12 M1: a false RESCUE on an unchanged `.gitattributes
106
+ * *.txt text` repo). Persisting the digest lets both compare RAW bytes: an unchanged
107
+ * normalizing surface yields the SAME digest → clean restore/recover; a real raw-byte
108
+ * change yields a DIFFERENT digest → rescue. Absent on older W1 records (the consumers
109
+ * fall back to the conservative fail-closed-on-presence stance, fail-safe-as-before).
110
+ */
111
+ prePromoteNormalizingRawDigest?: string | null;
112
+ /**
113
+ * W1 Stage-2 (Codex r12 H1 / M1) — the RAW-BYTE digest over the normalizing-attribute
114
+ * paths of the POST-promote worktree, captured from the live on-disk bytes right after
115
+ * the promote landed (when the worktree is provably the post-promote state). The
116
+ * post-promote analog of {@link prePromoteNormalizingRawDigest}. Absent on older W1
117
+ * records (consumers fall back to fail-closed-on-presence).
118
+ */
119
+ expectedPostPromoteNormalizingRawDigest?: string | null;
120
+ /**
121
+ * `blake3`-class key over the PRE-promote inputs (§3.1):
122
+ * hash(repoId, base_sha, integration_tip, merge_impl_id, promote_mode,
123
+ * pre_promote_user_ref).
124
+ * Includes `promote_mode` + `pre_promote_user_ref` because the dirty-committed
125
+ * mode lands a user-MERGE commit (not a FF), so its adopt target differs by mode.
126
+ */
127
+ expectedPromoteKey: string;
128
+ /**
129
+ * The actually-promoted tip — written only on `promote_committed` (the adopt
130
+ * target HEAD that landed). `null` while still `promote_started`.
131
+ */
132
+ promotedTip: string | null;
133
+ /**
134
+ * The promote-WAL state (§3.1 + round-5 Codex #3):
135
+ * - `promote_started` — written BEFORE any mutation; the recovery work-set.
136
+ * - `promote_committed` — the promote fully landed; recovery is a no-op.
137
+ * - `promote_aborted` — a TERMINAL no-crash abort (a preflight conflict / overlap,
138
+ * or a rolled-back read-tree refusal): NOTHING was left mutated (the user tree is
139
+ * byte-identical to pre-promote), so this is NOT recovery work.
140
+ * {@link PromoteWalStore.listStartedNotCommitted} EXCLUDES it — otherwise a
141
+ * completed non-crash abort would be mistaken for a crashed-mid-promote record
142
+ * and drive a stale-anchor partial-restore/rescue loop. The record is retained
143
+ * (not deleted) as an audit trail; a retry overwrites it via `writeStarted`.
144
+ */
145
+ state: 'promote_started' | 'promote_committed' | 'promote_aborted';
146
+ /** Why the promote terminally aborted (round-5 Codex #3) — set only on `promote_aborted`. */
147
+ abortReason?: string | null;
148
+ createdAtMs: number;
149
+ updatedAtMs: number;
150
+ }
151
+ /** The inputs the engine hands to {@link PromoteWalStore.writeStarted}. */
152
+ export interface PromoteStartedInput {
153
+ baseSha: string;
154
+ integrationTip: string;
155
+ userRefName: string;
156
+ promoteMode: PromoteMode;
157
+ prePromoteUserRef: string;
158
+ preImageManifestRef: string | null;
159
+ /** The durable untracked-files tree (HIGH-1) — `null`/empty-tree when none. */
160
+ preImageUntrackedTree?: string | null;
161
+ expectedPostPromoteTree: string;
162
+ /**
163
+ * The expected post-promote WORKTREE snapshot tree (W1 Stage-2 H1/H2/H3) — the
164
+ * complete on-disk state (tracked-with-unstaged-content + untracked, mode/type/
165
+ * symlink-aware) the promote leaves behind. `null`/absent → no manifest.
166
+ */
167
+ expectedPostPromoteWorktreeTree?: string | null;
168
+ /**
169
+ * The user's PRE-promote WORKTREE snapshot tree (W1 Stage-2 H6) — the second
170
+ * known-good anchor for crash-recovery's divergence guard. `null`/absent → none.
171
+ */
172
+ prePromoteWorktreeTree?: string | null;
173
+ /**
174
+ * W1 Stage-2 (Codex r12 H1 / M1) — the raw-byte digest over the pre-promote
175
+ * normalizing-attribute paths (live on-disk bytes, captured BEFORE any mutation).
176
+ * `null`/absent → none (consumers fall back to fail-closed-on-presence).
177
+ */
178
+ prePromoteNormalizingRawDigest?: string | null;
179
+ /** The pinned merge implementation id (§4.2) folded into the key. */
180
+ mergeImplId: string;
181
+ }
182
+ /**
183
+ * The pre-input-only promote key (§3.1). A `sha256` over the ordered pre-promote
184
+ * inputs (we use sha256 — the codebase's hash primitive — in lieu of blake3; the
185
+ * design's "blake3" is the discipline, not a binding algorithm choice, and the
186
+ * #589 store hashes with sha256 too). Determinism is what matters: identical
187
+ * inputs → identical key → a crash-redelivered promote dedups.
188
+ */
189
+ export declare function computePromoteKey(args: {
190
+ repoId: string;
191
+ baseSha: string;
192
+ integrationTip: string;
193
+ mergeImplId: string;
194
+ promoteMode: PromoteMode;
195
+ prePromoteUserRef: string;
196
+ }): string;
197
+ /**
198
+ * The pure durable promote-WAL store. ONE instance per desktop; all paths derive
199
+ * from {@link rootDir} (overridable for deterministic tests). Mirrors the #589
200
+ * `RevertManifestStore` at-rest guards exactly.
201
+ */
202
+ export declare class PromoteWalStore {
203
+ private readonly rootDir;
204
+ constructor(opts?: {
205
+ rootDir?: string;
206
+ });
207
+ /** The per-`(group, repo)` directory `<root>/<taskGroupId>/<repoId>/`. */
208
+ private repoDir;
209
+ /**
210
+ * Validate `seg` is a safe SINGLE path segment so a malicious id can't escape
211
+ * `<root>/` (defense-in-depth, mirrors #589-G `RevertManifestStore.safeSegment`).
212
+ */
213
+ private safeSegment;
214
+ private mkdirSecure;
215
+ /**
216
+ * Refuse to operate under a path whose any in-`rootDir` component is a symlink
217
+ * (LOCK #589-G "no symlink following"). lstat each component from `rootDir`
218
+ * down; a symlinked component throws. Missing components are fine.
219
+ */
220
+ private assertNoSymlinkComponents;
221
+ /** Atomic write: `<final>.tmp.<pid>.<rand>` (0600) → fsync → rename → fsync(dir). */
222
+ private atomicWrite;
223
+ private readJson;
224
+ /**
225
+ * Write the `promote_started` WAL record BEFORE any tree mutation (§3.1). The
226
+ * `expected_promote_key` is computed from the pre-promote inputs + `repoId`.
227
+ * Idempotent: a re-call for the SAME `(group, repo)` whose key matches an
228
+ * existing record returns it WITHOUT re-writing (a crash-redelivered promote
229
+ * dedups). A re-call whose key DIFFERS (the user moved the ref between prepare
230
+ * and promote → a recapture) overwrites the fresh record — but ONLY while the
231
+ * existing record is still `promote_started` (see W1 Stage-2 H1 below).
232
+ *
233
+ * W1 Stage-2 H1 — NEVER overwrite a `promote_committed` record (regardless of
234
+ * key). Once a promote has committed, its `pre_promote_user_ref` +
235
+ * `pre_image_manifest_ref` ARE the durable restore target a future revert/recovery
236
+ * depends on (LOCK #C14-REVERT). A redelivered promote that arrives AFTER success —
237
+ * with a DIFFERENT key because the user moved the ref since (so the pre-input dedup
238
+ * at the matching-key branch below does not catch it) — must NOT replace that
239
+ * committed restore target with a fresh `promote_started` whose
240
+ * `pre_image_manifest_ref` captures the POST-promote state. Doing so would make a
241
+ * later revert restore the wrong tree. So a `promote_committed` record is
242
+ * IMMUTABLE here: we return it unchanged. A genuine recapture (`expected_promote_key`
243
+ * change because the user moved the ref) is only honored BEFORE any mutation, i.e.
244
+ * while the record is still `promote_started`; the engine recovers an existing
245
+ * started record before a retry writes a new one.
246
+ */
247
+ writeStarted(taskGroupId: string, repoId: string, input: PromoteStartedInput): Promise<PromoteWalRecord>;
248
+ /**
249
+ * Atomically UPDATE the now-known expected-tree fields of an in-flight
250
+ * `promote_started` record IN PLACE (W1 Stage-2 M1). Some expected-state values
251
+ * are only known AFTER the user-tree mutation lands (the `dirty_committed`
252
+ * merge-commit tree; the post-promote worktree snapshot tree for every mode), so
253
+ * the engine records a preliminary record up front, mutates, then calls this to
254
+ * pin the real values.
255
+ *
256
+ * CRITICAL (M1 — the delete-then-rewrite crash window): this re-uses the SAME
257
+ * atomic write→fsync→rename of {@link atomicWrite} on the SAME record path, so
258
+ * the WAL file is NEVER absent at any instant — a crash leaves either the old or
259
+ * the new `promote_started` record, both recoverable by
260
+ * {@link listStartedNotCommitted}. (The previous delete-then-`writeStarted`
261
+ * left a no-WAL window in which an advanced user ref had NO record to recover.)
262
+ *
263
+ * No-op (returns the record unchanged) when there is no record, the record is
264
+ * not `promote_started`, or nothing actually changed. NEVER changes the
265
+ * `expectedPromoteKey` (the pre-input identity) — only the post-mutation fields.
266
+ */
267
+ updateStarted(taskGroupId: string, repoId: string, fields: {
268
+ expectedPostPromoteTree?: string;
269
+ expectedPostPromoteWorktreeTree?: string | null;
270
+ expectedPostPromoteNormalizingRawDigest?: string | null;
271
+ }): Promise<PromoteWalRecord | null>;
272
+ /**
273
+ * Mark a started promote COMMITTED, recording the actually-promoted tip (§3.1).
274
+ * No-op when there is no record (nothing started). Idempotent.
275
+ */
276
+ writeCommitted(taskGroupId: string, repoId: string, promotedTip: string): Promise<void>;
277
+ /**
278
+ * Round-5 (Codex #3) — mark a started promote TERMINALLY ABORTED. Called after a
279
+ * no-mutation preflight/overlap abort OR a successfully ROLLED-BACK read-tree
280
+ * refusal: the user tree is byte-identical to pre-promote, so this record is NOT
281
+ * recovery work and {@link listStartedNotCommitted} must exclude it. We write a
282
+ * terminal `promote_aborted` state (retained as an audit trail; a retry overwrites
283
+ * it via {@link writeStarted}).
284
+ *
285
+ * NEVER downgrades a `promote_committed` record (idempotent + immutable-once-committed
286
+ * — a committed restore target is durable, LOCK #C14-REVERT). No-op when there is no
287
+ * record. Idempotent on an already-`promote_aborted` record.
288
+ */
289
+ markAborted(taskGroupId: string, repoId: string, abortReason?: string): Promise<void>;
290
+ /** Read the WAL record for `(group, repo)`, or `null` if none. */
291
+ readRecord(taskGroupId: string, repoId: string): Promise<PromoteWalRecord | null>;
292
+ private writeRecord;
293
+ /** Delete the WAL record for `(group, repo)` (terminal cleanup / GC). */
294
+ deleteRecord(taskGroupId: string, repoId: string): Promise<void>;
295
+ /**
296
+ * List every `(group, repo)` that has a started-but-not-committed WAL record —
297
+ * the recovery work-set (§3.2). A `promote_committed` record is NOT returned
298
+ * (the promote fully landed; recovery is a no-op there).
299
+ */
300
+ listStartedNotCommitted(): Promise<PromoteWalRecord[]>;
301
+ }
@@ -0,0 +1,51 @@
1
+ import type { ConflictClass } from './conflict-types';
2
+ /**
3
+ * The canonical, durable description of one resolved slot's resolution set.
4
+ * Keyed in the index by its `resolution_set_hash` (== {@link computeResolutionSetHash}
5
+ * of this entry). Carries everything the verify walk needs to PROVE the trigger
6
+ * without re-running the resolver: which conflicts, their classes, and the
7
+ * composed-file integrity hashes (the §4.5 file-level `resolved_blob_hash`).
8
+ */
9
+ export interface ResolutionSetEntry {
10
+ /** The conflict_ids resolved in this slot (any order; canonicalized in the hash). */
11
+ conflictIds: string[];
12
+ /** conflict_id → its resolution class (1 deterministic reconcile / 2 LLM). */
13
+ classByConflictId: Record<string, ConflictClass>;
14
+ /**
15
+ * Resolved path → SHA-256 of the COMPOSED file bytes (the §4.5 file-integrity
16
+ * hash; SEPARATE from the per-hunk `resolved_blob_hash` so hunk-replay is
17
+ * unaffected — Stage-2 r2 agy HIGH / r1 codex MED). The verify walk re-hashes
18
+ * the committed tree's blob at this path and requires equality.
19
+ */
20
+ composedFileHashByPath: Record<string, string>;
21
+ }
22
+ /**
23
+ * The CANONICAL `resolution_set_hash` over an entry (Stage-2 r3 codex HIGH).
24
+ * Deterministic + reproducible at BOTH the live-resolve site (the trailer it
25
+ * stamps) and the verify/replay sites (so a resumed re-resolve reproduces the
26
+ * IDENTICAL trailer → the byte-identical merge-commit SHA the §3.2 recovery
27
+ * relies on). Folds in the class of every conflict + the composed-file hash of
28
+ * every path, length-prefixed + NUL-separated so no two distinct sets collide
29
+ * via field-boundary ambiguity (mirrors `computeConflictId`).
30
+ */
31
+ export declare function computeResolutionSetHash(entry: ResolutionSetEntry): string;
32
+ /**
33
+ * The durable resolution-set index (§2.3). Keyed by `resolution_set_hash`. Written
34
+ * AUDIT-BEFORE-REF (before the resolved merge commits + the integration ref
35
+ * advances) alongside the `ConflictResolution` records, so the ref never advances
36
+ * past a resolution set whose class summary + composed-file hashes are not durable.
37
+ * Idempotent on the set-hash key (the entry for a given hash is immutable — a
38
+ * second put with the same hash is a no-op / keeps the original).
39
+ */
40
+ export interface ResolutionSetIndex {
41
+ get(setHash: string): Promise<ResolutionSetEntry | null>;
42
+ put(setHash: string, entry: ResolutionSetEntry): Promise<void>;
43
+ }
44
+ /** In-memory {@link ResolutionSetIndex} (tests + same-process cache). */
45
+ export declare class InMemoryResolutionSetIndex implements ResolutionSetIndex {
46
+ private readonly bySetHash;
47
+ get(setHash: string): Promise<ResolutionSetEntry | null>;
48
+ put(setHash: string, entry: ResolutionSetEntry): Promise<void>;
49
+ /** Test helper: number of distinct durable resolution sets. */
50
+ get size(): number;
51
+ }
@@ -0,0 +1,89 @@
1
+ import { RevertManifestStore } from './durable-store';
2
+ /** The engine's terminal view of a group, for the reconcile decision. */
3
+ export type EngineGroupState = 'in_flight' | 'terminal_kept' | 'terminal_rejected' | 'unknown';
4
+ /**
5
+ * Minimal COMMIT-only contract for the two-phase `claimGroupDecision` wire, used
6
+ * by the CLAIM-crash recovery (HIGH-1) to drive the persisted claim terminal. A
7
+ * structural subset of the desktop `ClaimGroupDecisionClient` (gate-decision-submit.ts)
8
+ * so the reconcile stays decoupled from the heavier AppSync surface. The reconcile
9
+ * only ever issues the `commit` phase (the CLAIM already landed pre-crash); on an
10
+ * already-terminal group the engine echoes `already_committed` (idempotent).
11
+ */
12
+ export interface ReconcileCommitClient {
13
+ claimGroupDecision(input: {
14
+ taskGroupId: string;
15
+ sessionId: string;
16
+ phase: 'commit';
17
+ decision: string;
18
+ verdictIdempotencyKey: string;
19
+ claimToken: string;
20
+ notes?: string;
21
+ }, sessionKeyBase64?: string): Promise<{
22
+ phase: string;
23
+ decision: string;
24
+ claimToken: string;
25
+ groupStatus?: string;
26
+ }>;
27
+ }
28
+ export interface ReconcileDeps {
29
+ store: RevertManifestStore;
30
+ /**
31
+ * Probe the engine's terminal view of a group. ABSENT for a group the engine
32
+ * no longer knows about → `'unknown'` (an orphan; the TTL fallback GC's it).
33
+ */
34
+ probeEngineState: (taskGroupId: string) => Promise<EngineGroupState>;
35
+ /**
36
+ * Run the (idempotent, crash-resumable) revert for a reject-terminal group.
37
+ * Drives the journal-backed reverse-apply to completion-or-conflict-stop and
38
+ * marks the lifecycle `reject_revert_complete`.
39
+ */
40
+ revertGroup: (taskGroupId: string) => Promise<{
41
+ reverted: string[];
42
+ alreadyReverted: string[];
43
+ conflicts: string[];
44
+ }>;
45
+ /**
46
+ * HIGH-1 / LOCK #589-J — the COMMIT transport for CLAIM-crash recovery. Present
47
+ * for a TEAM session (the same `claimGroupDecision` SDK the live decision uses).
48
+ * ABSENT → CLAIM-crash recovery is skipped (the marker survives for the next
49
+ * startup; tests that don't exercise crash recovery omit it). The COMMIT echoes
50
+ * the PERSISTED `claimToken`; an already-terminal group returns `already_committed`.
51
+ */
52
+ commitClient?: ReconcileCommitClient;
53
+ /**
54
+ * HIGH-1 — the session id the COMMIT is scoped to (the desktop's live session).
55
+ * Required alongside `commitClient`. ABSENT → CLAIM-crash recovery is skipped.
56
+ */
57
+ sessionId?: string;
58
+ /**
59
+ * HIGH-1 — the session-key resolver, consulted ONLY when the persisted
60
+ * `pendingDecision.notes` is present (a `*_WITH_NOTES` decision re-encrypts its
61
+ * notes on the resumed COMMIT, exactly as the live path does). ABSENT or
62
+ * resolving `null` for a notes-bearing pending decision → the COMMIT is deferred
63
+ * to a later start (the marker survives; never block on a missing key).
64
+ */
65
+ getSessionKey?: (sessionId: string) => Promise<string | null>;
66
+ /** Optional clock injection for deterministic GC tests. */
67
+ now?: () => number;
68
+ }
69
+ export interface ReconcileResult {
70
+ /** Groups whose revert was (re)driven this startup. */
71
+ reverted: string[];
72
+ /** Groups marked accepted (engine kept; manifest flips GC-eligible). */
73
+ accepted: string[];
74
+ /**
75
+ * HIGH-1 — groups whose CLAIMED-but-not-COMMITted decision was resumed +
76
+ * driven terminal this startup (the persisted `claimToken` re-COMMITted).
77
+ */
78
+ recoveredCommits: string[];
79
+ /** Group ids GC'd after reconcile. */
80
+ gced: string[];
81
+ }
82
+ /**
83
+ * PHASE-589/469 W3.1 (C4) — reconcile every durable revert manifest against the
84
+ * engine's terminal view, THEN GC. Reconcile MUST run before GC so a
85
+ * terminal-but-not-yet-reverted group is reverted before its manifest could be
86
+ * collected. NEVER throws — a per-group error is logged + skipped (the manifest
87
+ * survives for the next startup).
88
+ */
89
+ export declare function reconcileRevertManifestsThenGc(deps: ReconcileDeps): Promise<ReconcileResult>;
@@ -0,0 +1,17 @@
1
+ import { RevertManifestStore } from './durable-store';
2
+ /** The outcome of a group revert (Fork A: clean-where-safe + surface). */
3
+ export interface RevertResult {
4
+ /** Paths reverted (created→deleted, modified/deleted→restored) THIS pass. */
5
+ reverted: string[];
6
+ /** Paths already at their pre-image (idempotent no-op; NOT a conflict). */
7
+ alreadyReverted: string[];
8
+ /** Paths the user edited after apply — left as-is, surfaced (NEVER clobbered). */
9
+ conflicts: string[];
10
+ }
11
+ /**
12
+ * Revert the whole group's applied tree off its durable manifest + journal.
13
+ * Reverse `promoteOrder`; clean-where-safe; idempotent + crash-resumable.
14
+ *
15
+ * `workingDir` is the real workspace root the team applied into.
16
+ */
17
+ export declare function revertGroup(store: RevertManifestStore, taskGroupId: string, workingDir: string): Promise<RevertResult>;
@@ -0,0 +1,57 @@
1
+ /**
2
+ * The structural category a path matched. `lockfile` is special — it is a
3
+ * shared-contract surface, but the classifier routes it to the class-1
4
+ * deterministic reconciler FIRST (§4.3); every other category is a hard
5
+ * route-to-human (class-3) surface.
6
+ */
7
+ export type SharedContractCategory = 'proto' | 'graphql' | 'thrift' | 'avro' | 'flatbuffers' | 'capnp' | 'xsd' | 'wsdl' | 'openapi' | 'lockfile' | 'always_gate_glob' | 'planner';
8
+ /** A positive shared-contract match for a path. `null` = not a shared contract. */
9
+ export interface SharedContractMatch {
10
+ /** The structural category that matched. */
11
+ category: SharedContractCategory;
12
+ /** Whether this is a HARD route-to-human (class-3) surface. `false` ONLY for
13
+ * `lockfile` (a deterministic class-1 reconciler is tried first, §4.3). */
14
+ hardGate: boolean;
15
+ /** Human-readable reason (for audit + the human-gate surface). */
16
+ reason: string;
17
+ /** The matching rule (extension / glob / basename / planner pattern). */
18
+ rule: string;
19
+ }
20
+ /** Tuning inputs (injected for tests; production wires the team config). */
21
+ export interface SharedContractDetectorOptions {
22
+ /** Operator/config "always gate" globs (additive class-3). Default: none. */
23
+ alwaysGateGlobs?: readonly string[];
24
+ /** The planner's `shared_contracts` paths/globs (§7) — ADDITIVE class-3. */
25
+ plannerSharedContracts?: readonly string[];
26
+ }
27
+ /**
28
+ * Compile a path glob to a RegExp. Supports `**` (any path segments incl. `/`),
29
+ * `*` (any chars except `/`), `?` (one char except `/`), and literal segments.
30
+ * Anchored full-match. Path separators are normalized to `/`. Deterministic and
31
+ * dependency-free (we deliberately avoid adding minimatch). Matching is
32
+ * case-SENSITIVE for globs (paths are case-sensitive on the platforms we target
33
+ * for the merge worktree); extension/basename surfaces above are the
34
+ * case-insensitive ones.
35
+ */
36
+ export declare function globToRegExp(glob: string): RegExp;
37
+ /**
38
+ * Does `path` match `glob`? A glob with NO `/` is matched against the BASENAME
39
+ * (so `*.proto` matches `a/b/x.proto`); a glob WITH `/` is matched against the
40
+ * full normalized path. Mirrors common .gitignore/CODEOWNERS glob intuition.
41
+ */
42
+ export declare function pathMatchesGlob(path: string, glob: string): boolean;
43
+ /**
44
+ * Classify a single repo-relative `path` as a shared-contract surface, or
45
+ * `null` if the path/glob tier does not flag it. Order (first match wins, most
46
+ * specific first): hard-gate extensions → OpenAPI basename → lockfile basename
47
+ * → always-gate globs → planner shared_contracts. The planner set is checked
48
+ * LAST and is purely ADDITIVE — it never suppresses a structural match.
49
+ */
50
+ export declare function detectSharedContract(path: string, opts?: SharedContractDetectorOptions): SharedContractMatch | null;
51
+ /**
52
+ * True iff `path` is a HARD route-to-human (class-3) shared-contract surface —
53
+ * i.e. a structural/glob/planner match that is NOT the deferred lockfile case.
54
+ * Convenience for the classifier; lockfiles return `false` here (they go to the
55
+ * class-1 reconciler first).
56
+ */
57
+ export declare function isHardSharedContract(path: string, opts?: SharedContractDetectorOptions): boolean;
@@ -0,0 +1,34 @@
1
+ import { AuthorityScope } from './authority';
2
+ import { ImplementorHandle, ProbeHandle, ProcessRole, ReviewerHandle, SpawnArgs, SpawnHandleBase } from './types';
3
+ /**
4
+ * CP-7 §3.6 — build the COMPLETE env a substrate-confined implementor sees.
5
+ * The LE calls this when constructing the `SubstrateSpec` (the env is baked into
6
+ * the sandbox at `launch()`, so `exec()` injects nothing further).
7
+ *
8
+ * It folds the three marker keys (`CHILD`/`ROLE`/`QUORUM`) INTO the wiped base
9
+ * env — it does **NOT** merge `process.env` (that ambient passthrough is exactly
10
+ * the I1 path the substrate exists to close). The collision guard runs first:
11
+ * the wiped base MUST NOT itself carry a marker key (the LE owns those).
12
+ *
13
+ * `sanitizedBase` is the already-wiped env the LE assembled (no ambient creds);
14
+ * the role is always `'implementor'` for the substrate path, but taken as a
15
+ * parameter so the marker value is explicit + testable.
16
+ */
17
+ export declare function buildSubstrateImplementorEnv(role: ProcessRole, sanitizedBase: Readonly<Record<string, string>>): Record<string, string>;
18
+ export declare function spawnImplementor(scope: AuthorityScope, args: SpawnArgs): Promise<ImplementorHandle>;
19
+ /**
20
+ * CP-7 §8 (Stage-1-resolved) — LOW-LEVEL legacy reviewer spawn primitive.
21
+ *
22
+ * **DEAD for quorum reviewers.** The LIVE reviewer path is
23
+ * `QuorumLoop.spawnOneSeat` → `ReviewerRegistry.evaluate` → provider
24
+ * `.evaluate` → `runReviewer` (`reviewer/subprocess.ts`), which runs the
25
+ * reviewer UNDER the CP-7 substrate + broker. This primitive (and its only
26
+ * production-shaped caller, `LocalExecutor.spawnReviewer`, which now THROWS)
27
+ * runs UNSANDBOXED with the merged `process.env` — it must NEVER be used to
28
+ * spawn a quorum reviewer (it would leak ambient vendor creds, the moat hole
29
+ * CP-7 closes). Kept exported only for the low-level `spawn.test.ts` unit test
30
+ * of the marker/lifecycle plumbing. Do NOT wire it into a reviewer dispatch.
31
+ */
32
+ export declare function spawnReviewer(scope: AuthorityScope, args: SpawnArgs): Promise<ReviewerHandle>;
33
+ export declare function spawnHealthProbe(scope: AuthorityScope, args: SpawnArgs): Promise<ProbeHandle>;
34
+ export declare function spawnSubprocess(scope: AuthorityScope, args: SpawnArgs): Promise<SpawnHandleBase>;