@quantiya/codevibe-core 2.0.1 → 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 (282) hide show
  1. package/dist/__tests__/prompt-parser.test.d.ts +1 -0
  2. package/dist/adapter/registry.d.ts +69 -2
  3. package/dist/appsync/__tests__/appsync-client-event-source-filter.test.d.ts +1 -0
  4. package/dist/appsync/__tests__/appsync-client-task-group.test.d.ts +1 -0
  5. package/dist/appsync/__tests__/cleanup-subscription.test.d.ts +1 -0
  6. package/dist/appsync/__tests__/coerce-awsjson-and-review-summary.test.d.ts +1 -0
  7. package/dist/appsync/__tests__/cp1f-quorum-sdk.test.d.ts +1 -0
  8. package/dist/appsync/__tests__/event-throttle.test.d.ts +1 -0
  9. package/dist/appsync/appsync-client.d.ts +621 -10
  10. package/dist/appsync/event-throttle.d.ts +28 -0
  11. package/dist/appsync/index.d.ts +3 -0
  12. package/dist/appsync/queries.d.ts +19 -0
  13. package/dist/audit-keys/index.d.ts +32 -0
  14. package/dist/auth/auth-service.d.ts +32 -2
  15. package/dist/auth/auth-telemetry.d.ts +19 -1
  16. package/dist/auth/index.d.ts +1 -0
  17. package/dist/companion-mode/persist-preference.d.ts +1 -1
  18. package/dist/config/config.d.ts +8 -1
  19. package/dist/continuation/__tests__/dirty-state-collector.test.d.ts +1 -0
  20. package/dist/continuation/__tests__/integration.test.d.ts +1 -0
  21. package/dist/continuation/__tests__/packet-reader.test.d.ts +1 -0
  22. package/dist/continuation/__tests__/packet-writer.test.d.ts +1 -0
  23. package/dist/continuation/__tests__/parity.test.d.ts +1 -0
  24. package/dist/continuation/__tests__/status-cli.test.d.ts +1 -0
  25. package/dist/continuation/dirty-state-collector.d.ts +46 -0
  26. package/dist/continuation/index.d.ts +8 -0
  27. package/dist/continuation/packet-reader.d.ts +33 -0
  28. package/dist/continuation/packet-writer.d.ts +86 -0
  29. package/dist/continuation/types.d.ts +239 -0
  30. package/dist/credential-broker/__tests__/broker.test.d.ts +1 -0
  31. package/dist/credential-broker/__tests__/canonical.test.d.ts +1 -0
  32. package/dist/credential-broker/__tests__/scrubber.test.d.ts +1 -0
  33. package/dist/credential-broker/__tests__/upstream-client.test.d.ts +1 -0
  34. package/dist/credential-broker/__tests__/vendor-key-store.test.d.ts +1 -0
  35. package/dist/credential-broker/audit-sink.d.ts +69 -0
  36. package/dist/credential-broker/broker-config.d.ts +39 -0
  37. package/dist/credential-broker/broker-token.d.ts +123 -0
  38. package/dist/credential-broker/broker.d.ts +165 -0
  39. package/dist/credential-broker/canonical.d.ts +119 -0
  40. package/dist/credential-broker/index.d.ts +15 -0
  41. package/dist/credential-broker/scrubber.d.ts +45 -0
  42. package/dist/credential-broker/types.d.ts +141 -0
  43. package/dist/credential-broker/upstream-client.d.ts +20 -0
  44. package/dist/credential-broker/vendor-key-store.d.ts +54 -0
  45. package/dist/index.d.ts +6 -1
  46. package/dist/index.js +427 -124
  47. package/dist/keychain/__tests__/keychain-backend.test.d.ts +1 -0
  48. package/dist/keychain/keychain-backend.d.ts +82 -0
  49. package/dist/local-executor/__tests__/agentic-disposable-repo.test.d.ts +1 -0
  50. package/dist/local-executor/__tests__/agentic-resolve.test.d.ts +1 -0
  51. package/dist/local-executor/__tests__/agentic-resolver-flag.test.d.ts +1 -0
  52. package/dist/local-executor/__tests__/class-a-sign.test.d.ts +1 -0
  53. package/dist/local-executor/__tests__/class1-reconcilers.test.d.ts +1 -0
  54. package/dist/local-executor/__tests__/class2-resolver.test.d.ts +1 -0
  55. package/dist/local-executor/__tests__/confined-model-caller.test.d.ts +1 -0
  56. package/dist/local-executor/__tests__/conflict-classifier.test.d.ts +1 -0
  57. package/dist/local-executor/__tests__/conflict-resolution-durable-store.test.d.ts +1 -0
  58. package/dist/local-executor/__tests__/conflict-resolution-store.test.d.ts +1 -0
  59. package/dist/local-executor/__tests__/cp1f-quorum-consumer.test.d.ts +1 -0
  60. package/dist/local-executor/__tests__/cp7-audit-writer.test.d.ts +1 -0
  61. package/dist/local-executor/__tests__/durable-store.test.d.ts +1 -0
  62. package/dist/local-executor/__tests__/git-lock-retry.test.d.ts +1 -0
  63. package/dist/local-executor/__tests__/implementor-argv.test.d.ts +1 -0
  64. package/dist/local-executor/__tests__/local-executor-teams.test.d.ts +1 -0
  65. package/dist/local-executor/__tests__/merge-conflict-extract.test.d.ts +1 -0
  66. package/dist/local-executor/__tests__/merge-conflict-git.integration.test.d.ts +1 -0
  67. package/dist/local-executor/__tests__/merge-conflict-resolve-agentic.integration.test.d.ts +1 -0
  68. package/dist/local-executor/__tests__/merge-conflict-resolve.integration.test.d.ts +1 -0
  69. package/dist/local-executor/__tests__/merge-journal-store.test.d.ts +1 -0
  70. package/dist/local-executor/__tests__/merge-train-agentic-recovery.integration.test.d.ts +1 -0
  71. package/dist/local-executor/__tests__/merge-train-w3.integration.test.d.ts +1 -0
  72. package/dist/local-executor/__tests__/merge-train-waveb.integration.test.d.ts +1 -0
  73. package/dist/local-executor/__tests__/merge-train.test.d.ts +1 -0
  74. package/dist/local-executor/__tests__/promote-wal-store.test.d.ts +1 -0
  75. package/dist/local-executor/__tests__/revert-reconcile.test.d.ts +1 -0
  76. package/dist/local-executor/__tests__/revert-runner.test.d.ts +1 -0
  77. package/dist/local-executor/__tests__/shared-contract-detector.test.d.ts +1 -0
  78. package/dist/local-executor/__tests__/substrate-engage.test.d.ts +1 -0
  79. package/dist/local-executor/__tests__/team-execution-flag.test.d.ts +1 -0
  80. package/dist/local-executor/__tests__/track-registry.test.d.ts +1 -0
  81. package/dist/local-executor/__tests__/wb2-review-bundle.test.d.ts +1 -0
  82. package/dist/local-executor/__tests__/wb2-substrate-spawn.live.test.d.ts +1 -0
  83. package/dist/local-executor/__tests__/workspace-shadow.test.d.ts +1 -0
  84. package/dist/local-executor/__tests__/worktree-merge.test.d.ts +1 -0
  85. package/dist/local-executor/agentic-disposable-repo.d.ts +52 -0
  86. package/dist/local-executor/agentic-resolve.d.ts +54 -0
  87. package/dist/local-executor/agentic-resolver-flag.d.ts +9 -0
  88. package/dist/local-executor/authority.d.ts +33 -1
  89. package/dist/local-executor/class-a-emit.d.ts +3 -1
  90. package/dist/local-executor/class-a-sign.d.ts +57 -0
  91. package/dist/local-executor/class-b-consumer.d.ts +159 -4
  92. package/dist/local-executor/class-b-verify.d.ts +30 -0
  93. package/dist/local-executor/class1-reconcilers.d.ts +58 -0
  94. package/dist/local-executor/class2-resolver.d.ts +74 -0
  95. package/dist/local-executor/confined-model-caller.d.ts +39 -0
  96. package/dist/local-executor/conflict-classifier.d.ts +21 -0
  97. package/dist/local-executor/conflict-resolution-durable-store.d.ts +61 -0
  98. package/dist/local-executor/conflict-resolution-store.d.ts +210 -0
  99. package/dist/local-executor/conflict-types.d.ts +86 -0
  100. package/dist/local-executor/cp7-audit-writer.d.ts +152 -0
  101. package/dist/local-executor/durable-store.d.ts +334 -0
  102. package/dist/local-executor/git-lock-retry.d.ts +40 -0
  103. package/dist/local-executor/hook-bridge.d.ts +1 -1
  104. package/dist/local-executor/implementor-argv.d.ts +183 -0
  105. package/dist/local-executor/index.d.ts +44 -3
  106. package/dist/local-executor/local-executor-impl.d.ts +645 -4
  107. package/dist/local-executor/merge-conflict-extract.d.ts +34 -0
  108. package/dist/local-executor/merge-conflict-resolve.d.ts +101 -0
  109. package/dist/local-executor/merge-journal-store.d.ts +311 -0
  110. package/dist/local-executor/merge-train.d.ts +713 -0
  111. package/dist/local-executor/promote-wal-store.d.ts +301 -0
  112. package/dist/local-executor/resolution-set-index.d.ts +51 -0
  113. package/dist/local-executor/revert-reconcile.d.ts +89 -0
  114. package/dist/local-executor/revert-runner.d.ts +17 -0
  115. package/dist/local-executor/shared-contract-detector.d.ts +57 -0
  116. package/dist/local-executor/spawn.d.ts +29 -1
  117. package/dist/local-executor/task-group-types.d.ts +346 -0
  118. package/dist/local-executor/team-execution-flag.d.ts +21 -0
  119. package/dist/local-executor/track-registry.d.ts +50 -0
  120. package/dist/local-executor/types.d.ts +238 -4
  121. package/dist/local-executor/wb2-review-bundle.d.ts +59 -0
  122. package/dist/local-executor/workspace-shadow.d.ts +290 -0
  123. package/dist/local-executor/worktree-merge.d.ts +601 -0
  124. package/dist/local-model/__tests__/installer.test.d.ts +1 -0
  125. package/dist/local-model/__tests__/manager.test.d.ts +1 -0
  126. package/dist/local-model/__tests__/ollama.test.d.ts +1 -0
  127. package/dist/local-model/__tests__/runtime.test.d.ts +1 -0
  128. package/dist/local-model/__tests__/state.test.d.ts +1 -0
  129. package/dist/local-model/manager.d.ts +119 -0
  130. package/dist/local-model/ollama.d.ts +27 -0
  131. package/dist/local-model/runtime.d.ts +27 -0
  132. package/dist/local-model/state.d.ts +32 -0
  133. package/dist/orchestration/detect-agents.d.ts +15 -2
  134. package/dist/orchestration/setup-types.d.ts +2 -1
  135. package/dist/orchestration-shell/__tests__/attachments.test.d.ts +1 -0
  136. package/dist/orchestration-shell/__tests__/audit-browser.test.d.ts +1 -0
  137. package/dist/orchestration-shell/__tests__/audited-path-fixes.test.d.ts +1 -0
  138. package/dist/orchestration-shell/__tests__/bracketed-paste.test.d.ts +1 -0
  139. package/dist/orchestration-shell/__tests__/cli-group-halt-wiring.test.d.ts +1 -0
  140. package/dist/orchestration-shell/__tests__/cli-orchestration-session-bootstrap.test.d.ts +1 -0
  141. package/dist/orchestration-shell/__tests__/cli-probe-group-status.test.d.ts +1 -0
  142. package/dist/orchestration-shell/__tests__/cli-quorum-loop-tier.test.d.ts +1 -0
  143. package/dist/orchestration-shell/__tests__/cli-verdict-classifier-wiring.test.d.ts +1 -0
  144. package/dist/orchestration-shell/__tests__/context-store.test.d.ts +1 -0
  145. package/dist/orchestration-shell/__tests__/cp10-585-accept-echo-target.test.d.ts +1 -0
  146. package/dist/orchestration-shell/__tests__/cp10-585-loop.test.d.ts +1 -0
  147. package/dist/orchestration-shell/__tests__/cp10-585-prompts.test.d.ts +1 -0
  148. package/dist/orchestration-shell/__tests__/cp12-w2b-team-loop.test.d.ts +1 -0
  149. package/dist/orchestration-shell/__tests__/cp12-w4-team-recovery.test.d.ts +1 -0
  150. package/dist/orchestration-shell/__tests__/cp1f-quorum-loop.test.d.ts +1 -0
  151. package/dist/orchestration-shell/__tests__/cp606-team-track-user-resolved.test.d.ts +1 -0
  152. package/dist/orchestration-shell/__tests__/cp7-reviewer-substrate.test.d.ts +1 -0
  153. package/dist/orchestration-shell/__tests__/declared-test-runner.test.d.ts +1 -0
  154. package/dist/orchestration-shell/__tests__/familiarize-routing.test.d.ts +1 -0
  155. package/dist/orchestration-shell/__tests__/gate-decision-submit.test.d.ts +1 -0
  156. package/dist/orchestration-shell/__tests__/gate-details-panel.test.d.ts +1 -0
  157. package/dist/orchestration-shell/__tests__/gate-verdict-details-dispatch.test.d.ts +1 -0
  158. package/dist/orchestration-shell/__tests__/group-decision-submit.test.d.ts +1 -0
  159. package/dist/orchestration-shell/__tests__/image-attach-e2e.test.d.ts +1 -0
  160. package/dist/orchestration-shell/__tests__/input-bar-autocomplete.test.d.ts +1 -0
  161. package/dist/orchestration-shell/__tests__/live-region-cap.test.d.ts +1 -0
  162. package/dist/orchestration-shell/__tests__/live-static-order.test.d.ts +1 -0
  163. package/dist/orchestration-shell/__tests__/model-cli.test.d.ts +1 -0
  164. package/dist/orchestration-shell/__tests__/non-gate-prompt-routing.test.d.ts +1 -0
  165. package/dist/orchestration-shell/__tests__/orchestration-app-group-decision-transport.test.d.ts +1 -0
  166. package/dist/orchestration-shell/__tests__/orchestration-app-layout.test.d.ts +1 -0
  167. package/dist/orchestration-shell/__tests__/reissue-team-retained-spec.test.d.ts +1 -0
  168. package/dist/orchestration-shell/__tests__/review-summary-render.test.d.ts +1 -0
  169. package/dist/orchestration-shell/__tests__/reviewer-wizard.test.d.ts +1 -0
  170. package/dist/orchestration-shell/__tests__/reviewers-format.test.d.ts +1 -0
  171. package/dist/orchestration-shell/__tests__/root-discovery.test.d.ts +1 -0
  172. package/dist/orchestration-shell/__tests__/serialize-submissions.test.d.ts +1 -0
  173. package/dist/orchestration-shell/__tests__/slash-suggest.test.d.ts +1 -0
  174. package/dist/orchestration-shell/__tests__/status-format.test.d.ts +1 -0
  175. package/dist/orchestration-shell/__tests__/task-progress.test.d.ts +1 -0
  176. package/dist/orchestration-shell/__tests__/team-decompose-routing.test.d.ts +1 -0
  177. package/dist/orchestration-shell/__tests__/team-decompose-types.test.d.ts +1 -0
  178. package/dist/orchestration-shell/__tests__/team-decompose.test.d.ts +1 -0
  179. package/dist/orchestration-shell/__tests__/team-e2e-smoke.test.d.ts +1 -0
  180. package/dist/orchestration-shell/__tests__/tier2-reviewer-selection.test.d.ts +1 -0
  181. package/dist/orchestration-shell/__tests__/web-browsing.test.d.ts +1 -0
  182. package/dist/orchestration-shell/attachments.d.ts +152 -0
  183. package/dist/orchestration-shell/audit-browser.d.ts +115 -0
  184. package/dist/orchestration-shell/audit-runner.d.ts +59 -0
  185. package/dist/orchestration-shell/bracketed-paste.d.ts +26 -0
  186. package/dist/orchestration-shell/cli.d.ts +336 -1
  187. package/dist/orchestration-shell/cli.js +39318 -3436
  188. package/dist/orchestration-shell/components/AuditLogPanel.d.ts +11 -0
  189. package/dist/orchestration-shell/components/ConversationPane.d.ts +7 -1
  190. package/dist/orchestration-shell/components/GateDetailsPanel.d.ts +57 -0
  191. package/dist/orchestration-shell/components/GatePanelEntry.d.ts +9 -0
  192. package/dist/orchestration-shell/components/GatePromptEntry.d.ts +7 -0
  193. package/dist/orchestration-shell/components/InputBar.d.ts +17 -3
  194. package/dist/orchestration-shell/components/LiveProgressLine.d.ts +8 -0
  195. package/dist/orchestration-shell/components/MultiTrackStatusNode.d.ts +8 -0
  196. package/dist/orchestration-shell/components/OrchestrationApp.d.ts +81 -15
  197. package/dist/orchestration-shell/components/ReviewerSetupWizard.d.ts +24 -0
  198. package/dist/orchestration-shell/components/StatusBar.d.ts +15 -2
  199. package/dist/orchestration-shell/context-store.d.ts +389 -0
  200. package/dist/orchestration-shell/declared-test-runner.d.ts +84 -0
  201. package/dist/orchestration-shell/emit-shell-event.d.ts +1 -1
  202. package/dist/orchestration-shell/gate-decision-submit.d.ts +245 -0
  203. package/dist/orchestration-shell/gate-prompts.d.ts +361 -3
  204. package/dist/orchestration-shell/index.d.ts +613 -1
  205. package/dist/orchestration-shell/ink-runtime.d.ts +21 -1
  206. package/dist/orchestration-shell/live-region-cap.d.ts +70 -0
  207. package/dist/orchestration-shell/live-static-order.d.ts +22 -0
  208. package/dist/orchestration-shell/non-tty-fallback.d.ts +21 -0
  209. package/dist/orchestration-shell/quorum-loop.d.ts +1900 -0
  210. package/dist/orchestration-shell/root-discovery.d.ts +25 -0
  211. package/dist/orchestration-shell/route-browse.d.ts +20 -0
  212. package/dist/orchestration-shell/slash-router.d.ts +20 -1
  213. package/dist/orchestration-shell/slash-routes/continuation.d.ts +71 -0
  214. package/dist/orchestration-shell/slash-routes/reviewers.d.ts +41 -0
  215. package/dist/orchestration-shell/slash-suggest.d.ts +29 -0
  216. package/dist/orchestration-shell/status-format.d.ts +59 -0
  217. package/dist/orchestration-shell/task-progress.d.ts +122 -0
  218. package/dist/orchestration-shell/team-decompose.d.ts +196 -0
  219. package/dist/orchestration-shell/types.d.ts +363 -3
  220. package/dist/orchestration-shell/vendor/ink-parse-keypress.d.ts +42 -0
  221. package/dist/orchestration-shell/web/extract.d.ts +11 -0
  222. package/dist/orchestration-shell/web/fetch.d.ts +15 -0
  223. package/dist/orchestration-shell/web/ip.d.ts +26 -0
  224. package/dist/orchestration-shell/web/sanitize.d.ts +14 -0
  225. package/dist/orchestration-shell/web/search.d.ts +16 -0
  226. package/dist/planner/__tests__/local-gemma.test.d.ts +1 -0
  227. package/dist/planner/index.d.ts +2 -0
  228. package/dist/planner/local-advisory.d.ts +84 -0
  229. package/dist/planner/local-gemma.d.ts +23 -0
  230. package/dist/planner/types.d.ts +16 -6
  231. package/dist/reviewer/__tests__/antigravity-provider.test.d.ts +1 -0
  232. package/dist/reviewer/__tests__/claude-provider-json.test.d.ts +1 -0
  233. package/dist/reviewer/__tests__/cp7-reviewer-sandbox.test.d.ts +1 -0
  234. package/dist/reviewer/__tests__/output-parser-classifier-helpers.test.d.ts +1 -0
  235. package/dist/reviewer/__tests__/verdict-classifier.test.d.ts +1 -0
  236. package/dist/reviewer/index.d.ts +2 -0
  237. package/dist/reviewer/output-parser.d.ts +48 -12
  238. package/dist/reviewer/provider.d.ts +107 -3
  239. package/dist/reviewer/providers/__tests__/failure-classifier.test.d.ts +1 -0
  240. package/dist/reviewer/providers/antigravity.d.ts +49 -0
  241. package/dist/reviewer/providers/claude.d.ts +19 -4
  242. package/dist/reviewer/providers/codex.d.ts +47 -5
  243. package/dist/reviewer/providers/failure-classifier.d.ts +26 -0
  244. package/dist/reviewer/providers/gemini.d.ts +5 -4
  245. package/dist/reviewer/registry.d.ts +5 -5
  246. package/dist/reviewer/subprocess.d.ts +37 -0
  247. package/dist/reviewer/token-usage.d.ts +32 -0
  248. package/dist/reviewer/types.d.ts +5 -5
  249. package/dist/reviewer/verdict-classifier.d.ts +62 -0
  250. package/dist/session/__tests__/prepare-event-timestamp.test.d.ts +1 -0
  251. package/dist/session/index.d.ts +1 -0
  252. package/dist/session/prepare-event-timestamp.d.ts +30 -0
  253. package/dist/substrate/__tests__/docker.test.d.ts +1 -0
  254. package/dist/substrate/__tests__/forwarder.test.d.ts +1 -0
  255. package/dist/substrate/__tests__/git-proxy.test.d.ts +1 -0
  256. package/dist/substrate/__tests__/sandbox-exec.test.d.ts +1 -0
  257. package/dist/substrate/__tests__/substrate-e2e.integration.test.d.ts +1 -0
  258. package/dist/substrate/command-runner.d.ts +19 -0
  259. package/dist/substrate/docker.d.ts +134 -0
  260. package/dist/substrate/errors.d.ts +33 -0
  261. package/dist/substrate/forwarder.d.ts +67 -0
  262. package/dist/substrate/git-proxy.d.ts +35 -0
  263. package/dist/substrate/index.d.ts +12 -0
  264. package/dist/substrate/relay-script.d.ts +27 -0
  265. package/dist/substrate/sandbox-exec.d.ts +116 -0
  266. package/dist/substrate/types.d.ts +218 -0
  267. package/dist/substrate-launch/__tests__/apikey-bootstrap.test.d.ts +1 -0
  268. package/dist/substrate-launch/__tests__/creditless-loop.integration.test.d.ts +1 -0
  269. package/dist/substrate-launch/__tests__/engage-substrate.test.d.ts +1 -0
  270. package/dist/substrate-launch/__tests__/fallback-ladder.test.d.ts +1 -0
  271. package/dist/substrate-launch/__tests__/le-env-scrub.test.d.ts +1 -0
  272. package/dist/substrate-launch/__tests__/sanitized-env.test.d.ts +1 -0
  273. package/dist/substrate-launch/apikey-bootstrap.d.ts +84 -0
  274. package/dist/substrate-launch/engage-substrate.d.ts +102 -0
  275. package/dist/substrate-launch/fallback-ladder.d.ts +49 -0
  276. package/dist/substrate-launch/index.d.ts +12 -0
  277. package/dist/substrate-launch/le-env-scrub.d.ts +77 -0
  278. package/dist/substrate-launch/sanitized-env.d.ts +73 -0
  279. package/dist/types/auth.d.ts +6 -1
  280. package/dist/types/events.d.ts +3 -1
  281. package/dist/types/reviewer.d.ts +6 -6
  282. package/package.json +7 -3
@@ -0,0 +1,34 @@
1
+ import type { ConflictHunk } from './conflict-types';
2
+ /** A parsed segment of a conflicted file: verbatim context, or a conflict region. */
3
+ export type ConflictSegment = {
4
+ kind: 'context';
5
+ lines: string[];
6
+ } | {
7
+ kind: 'conflict';
8
+ hunkOrdinal: number;
9
+ oursLines: string[];
10
+ baseLines: string[];
11
+ theirsLines: string[];
12
+ };
13
+ /**
14
+ * Parse a diff3-style conflicted blob into ordered segments. Conflict regions
15
+ * get a deterministic 0-based `hunkOrdinal` (their order of appearance).
16
+ * Throws on a malformed marker structure (an unterminated/misordered conflict)
17
+ * so the caller FAILS CLOSED (route-to-human) rather than mis-resolve. Requires
18
+ * the diff3 base section (the pinned `merge.conflictStyle=diff3`); a 2-way
19
+ * conflict missing `|||||||` is treated as malformed (fail closed).
20
+ */
21
+ export declare function parseDiff3Conflicts(blob: string): ConflictSegment[];
22
+ /** Extract the conflict hunks (the resolvable units) from parsed segments. */
23
+ export declare function hunksFromSegments(segments: ConflictSegment[]): ConflictHunk[];
24
+ /**
25
+ * Recompose a clean file from the parsed segments + a map of resolved hunk
26
+ * lines keyed by `hunkOrdinal`. Context segments pass through verbatim; each
27
+ * conflict region is replaced by its resolved lines. Throws if a conflict hunk
28
+ * has no resolution (the caller must resolve EVERY hunk before composing — a
29
+ * missing one is a bug, fail closed). Returns the composed file bytes.
30
+ */
31
+ export declare function composeResolvedFile(segments: ConflictSegment[], resolvedByOrdinal: ReadonlyMap<number, string[]>): Buffer;
32
+ /** True if a blob still carries any conflict marker (a safety re-check after
33
+ * composition — a composed file must be marker-free or we FAIL CLOSED). */
34
+ export declare function hasConflictMarkers(blob: string): boolean;
@@ -0,0 +1,101 @@
1
+ import { type ConflictModelCaller } from './class2-resolver';
2
+ import { type AgenticResolutionRecord, type ConflictResolutionRecord, type ConflictResolutionStore } from './conflict-resolution-store';
3
+ import type { AgenticResolveOutcome } from './agentic-resolve';
4
+ import type { AgentKind } from './types';
5
+ import { type ResolutionSetIndex } from './resolution-set-index';
6
+ import type { SharedContractDetectorOptions } from './shared-contract-detector';
7
+ /** Per-task resolver wiring (the merge-train threads this when the model is set). */
8
+ export interface ConflictResolverContext {
9
+ /** The durable ConflictResolution store (§4.5 audit/replay). */
10
+ store: ConflictResolutionStore;
11
+ /**
12
+ * The durable RESOLUTION-SET INDEX (Wave B §2.3) — maps a resolved slot's
13
+ * `resolution_set_hash` to its `{conflictIds, class-by-id, composed-file
14
+ * hashes}` so the promote gate can PROVE the final-tip Tier-2 trigger across a
15
+ * resume (LOCK #C14-W3-TIER2-AUTHORITY) instead of trusting the single-pass
16
+ * boolean. Written audit-before-ref alongside the `ConflictResolution` records.
17
+ */
18
+ resolutionSetIndex: ResolutionSetIndex;
19
+ /** The brokered class-2 model caller (§8 — CP-7 broker; fail-closed). Used only
20
+ * in the LEGACY (non-agentic) mode; ignored when `resolveAgentic` is wired. */
21
+ caller: ConflictModelCaller;
22
+ /**
23
+ * CP-14 WB2 — when wired, the slot's class-2 conflicts are resolved AGENTICALLY
24
+ * (whole-slot: the incoming track's implementor resolves read+write in a
25
+ * disposable repo, fd-safe selective-import), NOT per-hunk prompt→JSON. The LE
26
+ * builds this closure (it owns the implementor spawn + the scan + the workspace
27
+ * dir); `resolveSlotConflicts` passes the conflicted tree + the class-2 paths +
28
+ * the incoming track's identity. Returns the resolved bytes per path, or a
29
+ * fail-closed human-gate. Absent → legacy per-hunk `caller` path.
30
+ */
31
+ resolveAgentic?: (args: {
32
+ conflictedTree: string;
33
+ class2Paths: readonly string[];
34
+ implementorAgent: string;
35
+ implementorTaskId: string;
36
+ }) => Promise<AgenticResolveOutcome>;
37
+ /** Shared-contract detector tuning (always-gate globs + planner shared_contracts). */
38
+ detectorOpts?: SharedContractDetectorOptions;
39
+ /** Max class-2 prompt bytes; over-budget → human gate (§8). */
40
+ maxContextBytes: number;
41
+ /** Touched paths carrying Git-LFS (from the W2 pre-scan) → class-3. */
42
+ lfsPaths?: ReadonlySet<string>;
43
+ /** Touched paths carrying a dangerous `.gitattributes` driver → class-3. */
44
+ dangerousAttrPaths?: ReadonlySet<string>;
45
+ }
46
+ /** A path that could not be auto-resolved and must go to the human gate. */
47
+ export interface HumanGatedConflict {
48
+ path: string;
49
+ trigger: string;
50
+ reason: string;
51
+ }
52
+ /** The outcome of resolving one slot's conflicts. */
53
+ export type SlotResolveResult = {
54
+ status: 'resolved';
55
+ /** The clean resolved tree OID (no conflict markers). */
56
+ resolvedTree: string;
57
+ /** Hash of the sorted conflict_id set — the merge-commit `resolution_set` trailer. */
58
+ resolutionSetHash: string;
59
+ /** The recorded ConflictResolution set (already durable in the store). */
60
+ records: ConflictResolutionRecord[];
61
+ /**
62
+ * CP-14 WB2 — the per-slot agentic record (already durable via `putAgentic`),
63
+ * present iff this slot had ≥1 class-2 conflict resolved agentically. Binds
64
+ * the resolved tree OID + the instance identity for the promote-gate verify.
65
+ */
66
+ agenticRecord?: AgenticResolutionRecord;
67
+ } | {
68
+ /** At least one path needs a human — the WHOLE slot escalates (no partial). */
69
+ status: 'human_gate';
70
+ gated: HumanGatedConflict[];
71
+ };
72
+ /**
73
+ * Resolve every conflicting path for one merge-train slot. See the module header
74
+ * for the per-path flow + the audit-before-ref invariant. Pure of ref/worktree
75
+ * mutation — it only READS (extract) + WRITES OBJECTS (resolved blobs/tree) +
76
+ * PERSISTS audit records; the caller commits + advances the ref afterward.
77
+ */
78
+ export declare function resolveSlotConflicts(args: {
79
+ repoDir: string;
80
+ /** The current integration tip (ours / §4.5 counterpart) — `mergeTreeOffBranch` arg 1. */
81
+ oursCommit: string;
82
+ /** The merging track tip (theirs) — `mergeTreeOffBranch` arg 2. */
83
+ theirsCommit: string;
84
+ /** The conflicted tree OID from `mergeTreeOffBranch` (patched into the resolved tree). */
85
+ conflictedTree: string;
86
+ /** The conflicting paths (sorted, from `mergeTreeOffBranch`). */
87
+ conflictPaths: readonly string[];
88
+ repoId: string;
89
+ mergeImplId: string;
90
+ ctx: ConflictResolverContext;
91
+ /**
92
+ * CP-14 WB2 — the INCOMING track's implementor identity (it is re-dispatched as
93
+ * the agentic resolver). REQUIRED when `ctx.resolveAgentic` is wired; an agentic
94
+ * slot with these absent FAILS CLOSED to the human gate (the resolver can't be
95
+ * dispatched / a pre-B2 journal track lacks the identity).
96
+ */
97
+ incomingImplementorAgent?: AgentKind;
98
+ incomingImplementorTaskId?: string;
99
+ /** CP-14 WB2 — tags durable records PENDING for this resolve attempt (recovery case 3). */
100
+ attemptId?: string;
101
+ }): Promise<SlotResolveResult>;
@@ -0,0 +1,311 @@
1
+ /** The current merge-journal schema version (append-only; bump on a breaking shape change). */
2
+ export declare const MERGE_JOURNAL_VERSION: 1;
3
+ /**
4
+ * The per-(track,repo) coordinate captured ONCE at train start — the worktree path
5
+ * + the persistent track branch the train consumes (§3.2 "worktree path + branch per
6
+ * (track,repo)"). `trackTip` is the resolved track-branch tip at order-resolution time;
7
+ * recovery uses it to replay the EXACT inputs the order was derived from.
8
+ */
9
+ export interface MergeJournalTrack {
10
+ trackIndex: number;
11
+ repoId: string;
12
+ /** The persistent track branch name (`codevibe/track/<group>/<idx>`). */
13
+ trackBranch: string;
14
+ /** The track-branch tip the order was resolved against. */
15
+ trackTip: string;
16
+ /**
17
+ * CP-14 WB2 — the implementor agent + its per-spawn task id that authored this
18
+ * track. The agentic class-2 resolver re-dispatches the INCOMING track's
19
+ * implementor under this identity, and these are folded into the GENERATION
20
+ * IDENTITY ({@link tracksEqual}) so a re-gate / metadata-repair with a different
21
+ * agent or task is a NEW generation (the steps reset). Persisted as plain
22
+ * strings; absent on a pre-B2 record → a mismatch against any current id →
23
+ * re-merge (fail-safe), mirroring the `mergeImplId` FIX-1 migration.
24
+ */
25
+ implementorAgent?: string;
26
+ implementorTaskId?: string;
27
+ /** The implementor's worktree-shadow path, when one is recorded (informational). */
28
+ worktreePath?: string | null;
29
+ }
30
+ /**
31
+ * CP-14 WB2 (#C14-WB2-RESOLVE-WAL) — the `resolution_recorded` WAL marker for an
32
+ * AGENTIC class-2 slot. Written on the started step AFTER the §4.5 ConflictResolution
33
+ * records + the resolution-set index are durable, and BEFORE the merge commit — so a
34
+ * durable marker IMPLIES the load-bearing records exist (preserves audit-before-ref).
35
+ * Recovery reads it: a started slot WITH this marker = case 2 (re-authenticate the
36
+ * records against `resolvedTreeOid`, then commit THAT tree agent-free — never a
37
+ * non-deterministic re-dispatch); a started slot WITHOUT it = case 3 (pending records
38
+ * are non-authoritative → clear + fresh re-dispatch). Carries the agentic INSTANCE
39
+ * identity (`#C14-WB2-AGENTIC-IDENTITY`) so a different surrounding tree is a distinct
40
+ * instance, never a stale replay. Clean / class-1-only slots do NOT write this marker
41
+ * (they re-derive deterministically — §2.5).
42
+ */
43
+ export interface MergeResolutionRecordedMarker {
44
+ /** The agentic resolution INSTANCE id = hash of `(conflict_id, conflictedTree OID, resolver agent/task, conflict-set)`. */
45
+ instanceId: string;
46
+ /** The full committed resolved tree OID this WAL authenticates (recovery commits exactly this). */
47
+ resolvedTreeOid: string;
48
+ /** The durable resolution-set hash (the §4.5 set this marker's records belong to). */
49
+ resolutionSetHash: string;
50
+ /** conflictMeta — the conflicted paths/ids covered (audit + recovery re-authentication scope). */
51
+ conflictIds?: string[];
52
+ }
53
+ /**
54
+ * A single merge-train STEP (one order slot). Written write-ahead: `merge_started`
55
+ * BEFORE the off-branch merge, then `merge_committed` after the integration ref
56
+ * CAS-advances, or `merge_aborted` on a deterministic conflict-halt.
57
+ */
58
+ export interface MergeStepRecord {
59
+ /** The 0-based slot in the resolved merge-train order. */
60
+ orderSlot: number;
61
+ trackIndex: number;
62
+ repoId: string;
63
+ /** The integration tip the step merges ONTO (`ours`) — known before the merge. */
64
+ preTip: string;
65
+ /** The track branch tip the step merges IN (`theirs`) — known before the merge. */
66
+ trackTip: string;
67
+ /** The pinned merge-implementation id (§4.2) folded into the key. */
68
+ mergeImplId: string;
69
+ /**
70
+ * `sha256(pre_tip, track_tip, repoId, trackIndex, merge_impl_id)` (§3.2 r2-H1) —
71
+ * PRE-merge inputs ONLY. The merge commit is stamped with this in its
72
+ * `Codevibe-Merge-Key:` trailer, so recovery's `git log --grep` can find a landed
73
+ * merge whose `merge_committed` write was lost.
74
+ */
75
+ expectedMergeKey: string;
76
+ /**
77
+ * The merge commit SHA — written only on `merge_committed`. `null` while still
78
+ * `merge_started`. The committed integration tip after this slot.
79
+ */
80
+ mergeCommit: string | null;
81
+ state: 'merge_started' | 'merge_committed' | 'merge_aborted';
82
+ /** Why the step aborted (a deterministic conflict-halt) — set only on `merge_aborted`. */
83
+ abortReason?: string | null;
84
+ /** The conflicting paths surfaced on a conflict-halt — set only on `merge_aborted`. */
85
+ conflictPaths?: string[] | null;
86
+ /**
87
+ * CP-14 WB2 (#C14-WB2-RESOLVE-WAL) — the `resolution_recorded` WAL marker, set on a
88
+ * still-`merge_started` AGENTIC slot AFTER its §4.5 records are durable and BEFORE the
89
+ * commit. Its presence on a started step = recovery case 2 (commit the recorded tree
90
+ * agent-free); absent on a started step = case 3 (clear pending records + re-dispatch).
91
+ * `null`/absent for clean / class-1 slots (they re-derive deterministically).
92
+ */
93
+ resolutionRecorded?: MergeResolutionRecordedMarker | null;
94
+ createdAtMs: number;
95
+ updatedAtMs: number;
96
+ }
97
+ /** The durable merge-journal record (§3.2). One per `(group, repo)`. */
98
+ export interface MergeJournalRecord {
99
+ version: typeof MERGE_JOURNAL_VERSION;
100
+ taskGroupId: string;
101
+ repoId: string;
102
+ /** The per-repo base snapshot = user repo HEAD at dispatch. */
103
+ baseSha: string;
104
+ /** The per-repo integration branch the train advances (`codevibe/integration/<group>/<repo>`). */
105
+ integrationBranch: string;
106
+ /**
107
+ * Codex r6 FIX 1 (HIGH) — the GROUP-level pinned merge-implementation id this generation was
108
+ * produced under ({@link resolveMergeImplId} = `git-<version>+<DETERMINISM_CONTRACT_ID>`). It is
109
+ * folded into the GENERATION IDENTITY (see {@link MergeJournalStore.writeGroup}): a re-gate whose
110
+ * current `mergeImplId` DIFFERS from the stored one (host git upgraded, or the determinism
111
+ * contract bumped across a deploy) is a NEW generation → the steps reset → the train re-merges
112
+ * under the new impl, so a crash-recovery never ADOPTS an OLD-impl committed merge commit by its
113
+ * trailer. Stored on every generation write; `null`/absent on a pre-FIX-1 record (treated as a
114
+ * mismatch against any current id → re-merge, fail-safe). Each per-step {@link MergeStepRecord}
115
+ * ALSO carries its own `mergeImplId` — the step-level check (FIX 1 guard b) is the belt to this
116
+ * group-level suspenders.
117
+ */
118
+ mergeImplId?: string | null;
119
+ /** The per-(track,repo) coordinates the order was resolved over (§4.1). */
120
+ tracks: MergeJournalTrack[];
121
+ /**
122
+ * The RESOLVED, canonical merge-train order as a list of `trackIndex` in execution
123
+ * order (§4.1, r2-L + r3 Codex: "persists the canonical resolved order in the journal
124
+ * so recovery never re-derives a different order from a since-mutated input").
125
+ */
126
+ resolvedOrder: number[];
127
+ /**
128
+ * Stage-2 r2 H1 — the DURABLE re-anchor marker. When a CHANGED-input re-gate starts a
129
+ * fresh generation (`writeGroup` reset the steps), the LIVE integration ref still carries
130
+ * the PRIOR generation's advanced tip (e.g. merge(A)). The train must RE-ANCHOR that ref
131
+ * back to `base_sha` BEFORE slot 0, else slot 0 builds on the stale tip and stale bytes
132
+ * promote. The CAS reset is a SEPARATE step after the (durable) generation write, so a
133
+ * crash between them would lose the reset INTENT — on restart recovery would see no started
134
+ * steps (`nothing_to_do`) and the next same-order `writeGroup` (`stepsReset:false`) would
135
+ * build slot 0 on the STALE tip. This field makes the reset intent DURABLE: it is set to
136
+ * the `base_sha` to re-anchor to, ATOMICALLY with the steps-reset generation write (so it
137
+ * survives a crash), and CLEARED only after the CAS reset is confirmed. Recovery HONORS a
138
+ * set marker on restart — it completes the CAS reset to this SHA before proceeding. `null`
139
+ * (or absent on an old record) when there is no pending re-anchor.
140
+ */
141
+ reanchorPending?: string | null;
142
+ /** The per-slot write-ahead step records, indexed by `orderSlot`. */
143
+ steps: MergeStepRecord[];
144
+ createdAtMs: number;
145
+ updatedAtMs: number;
146
+ }
147
+ /** The group-level inputs the engine hands to {@link MergeJournalStore.writeGroup}. */
148
+ export interface MergeGroupInput {
149
+ baseSha: string;
150
+ integrationBranch: string;
151
+ tracks: MergeJournalTrack[];
152
+ resolvedOrder: number[];
153
+ /**
154
+ * Codex r6 FIX 1 (HIGH) — the pinned merge-implementation id the train will run under
155
+ * ({@link resolveMergeImplId}). Folded into the generation identity: a re-gate whose `mergeImplId`
156
+ * differs from a prior record's is a NEW generation (the steps reset → re-merge under the new
157
+ * impl), so a crash-recovery never adopts an old-implementation committed merge. OPTIONAL on the
158
+ * input for backward-compat with callers/tests that do not pass it (then it is NOT part of the
159
+ * identity — same as before FIX 1); the live {@link runMergeTrain} always passes it.
160
+ */
161
+ mergeImplId?: string;
162
+ }
163
+ /**
164
+ * The result of {@link MergeJournalStore.writeGroup} — the durable record PLUS whether
165
+ * this call RESET the per-step entries (Stage-2 r1 H1). `stepsReset` is `true` when the
166
+ * group inputs DIFFERED from a prior record (a genuinely new generation — e.g. a track tip
167
+ * moved to a replacement), so the caller (`runMergeTrain`) knows to RE-ANCHOR the
168
+ * integration ref back to `base_sha` (the prior generation's advanced tip is stale and must
169
+ * NOT be carried into the new train). `false` on a first-ever write (no prior record) and on
170
+ * an idempotent same-order redelivery (the in-flight steps are kept).
171
+ */
172
+ export interface MergeGroupWriteResult extends MergeJournalRecord {
173
+ stepsReset: boolean;
174
+ }
175
+ /** The per-step pre-merge inputs the engine hands to {@link MergeJournalStore.writeStarted}. */
176
+ export interface MergeStepInput {
177
+ orderSlot: number;
178
+ trackIndex: number;
179
+ repoId: string;
180
+ preTip: string;
181
+ trackTip: string;
182
+ mergeImplId: string;
183
+ }
184
+ /**
185
+ * The pre-input-only merge key (§3.2 r2-H1). A `sha256` over the ordered PRE-MERGE
186
+ * inputs (we use sha256 — the codebase's hash primitive — in lieu of blake3; the
187
+ * design's "blake3" is the discipline, not a binding algorithm choice, and the
188
+ * #589/W1 stores hash with sha256 too). It depends ONLY on inputs known BEFORE the
189
+ * merge (not post-resolution hashes, which don't exist at WAL-write time and can't
190
+ * be recomputed after a crash). Identical inputs → identical key → a crash-redelivered
191
+ * merge step dedups + recovery can find the landed commit by its trailer.
192
+ */
193
+ export declare function computeMergeKey(args: {
194
+ preTip: string;
195
+ trackTip: string;
196
+ repoId: string;
197
+ trackIndex: number;
198
+ mergeImplId: string;
199
+ }): string;
200
+ /**
201
+ * The pure durable merge-journal store. ONE instance per desktop; all paths derive
202
+ * from {@link rootDir} (overridable for deterministic tests). Mirrors the #589
203
+ * `RevertManifestStore` / W1 `PromoteWalStore` at-rest guards exactly.
204
+ */
205
+ export declare class MergeJournalStore {
206
+ private readonly rootDir;
207
+ constructor(opts?: {
208
+ rootDir?: string;
209
+ });
210
+ /** The per-`(group, repo)` directory `<root>/<taskGroupId>/<repoId>/`. */
211
+ private repoDir;
212
+ /**
213
+ * Validate `seg` is a safe SINGLE path segment so a malicious id can't escape
214
+ * `<root>/` (defense-in-depth, mirrors #589-G / W1 `PromoteWalStore.safeSegment`).
215
+ */
216
+ private safeSegment;
217
+ private mkdirSecure;
218
+ /**
219
+ * Refuse to operate under a path whose any in-`rootDir` component is a symlink
220
+ * (LOCK #589-G "no symlink following"). lstat each component from `rootDir`
221
+ * down; a symlinked component throws. Missing components are fine.
222
+ */
223
+ private assertNoSymlinkComponents;
224
+ /** Atomic write: `<final>.tmp.<pid>.<rand>` (0600) → fsync → rename → fsync(dir). */
225
+ private atomicWrite;
226
+ private readJson;
227
+ /**
228
+ * Write (or idempotently re-establish) the GROUP-level merge-journal record at
229
+ * train start — `base_sha`, the integration branch, the per-(track,repo)
230
+ * coordinates, and the RESOLVED canonical order (§4.1). Written ONCE, BEFORE any
231
+ * step. Idempotent: a re-call for the SAME `(group, repo)` whose `resolvedOrder`
232
+ * + `baseSha` + `integrationBranch` match an existing record RETURNS it WITHOUT
233
+ * losing any already-written steps (a crash-redelivered train start dedups). A
234
+ * re-call whose group inputs DIFFER (a genuinely new order — e.g. a track tip
235
+ * moved, changing the resolution) overwrites the group fields + RESETS the steps
236
+ * (the old per-step entries keyed against the prior order are no longer valid) and
237
+ * returns `stepsReset: true` (Stage-2 r1 H1) so the train RE-ANCHORS the integration
238
+ * ref back to `base_sha` instead of carrying the prior generation's stale advanced tip.
239
+ */
240
+ writeGroup(taskGroupId: string, repoId: string, input: MergeGroupInput): Promise<MergeGroupWriteResult>;
241
+ /**
242
+ * Write a `merge_started` step record BEFORE the off-branch merge (§3.2). The
243
+ * `expected_merge_key` is computed from the PRE-merge inputs. Idempotent: a re-call
244
+ * for the SAME `(group, repo, orderSlot)` whose key matches an existing step
245
+ * RETURNS it WITHOUT re-writing (a crash-redelivered step dedups). A NON-matching
246
+ * key for the same slot — only possible if the inputs changed — OVERWRITES the
247
+ * slot's step (the prior key is stale). A `merge_committed`/`merge_aborted` step is
248
+ * IMMUTABLE here: it is returned unchanged (a started record's restart writes a
249
+ * fresh started step only over a started/absent slot).
250
+ */
251
+ writeStarted(taskGroupId: string, repoId: string, input: MergeStepInput): Promise<MergeStepRecord>;
252
+ /**
253
+ * RE-ARM a slot's step back to `merge_started` with a fresh PRE-merge key — used
254
+ * ONLY by crash-recovery's re-merge (§3.2 r4: "reset invalidates later slots"). Unlike
255
+ * {@link writeStarted} (which leaves a `merge_committed`/`merge_aborted` step IMMUTABLE,
256
+ * so the normal forward train never re-arms a terminal slot), recovery legitimately
257
+ * RE-MERGES a later slot whose commit was invalidated by an earlier-slot reset — so its
258
+ * journal step MUST honestly transition back to `merge_started` (NOT silently re-use a
259
+ * stale key). The fresh key is computed from the CURRENT pre-inputs (the rewound
260
+ * `preTip` + the track tip), so the re-armed step + its trailer reflect the actual
261
+ * re-merge, never a coincidentally-equal stale value. Throws if there is no group record.
262
+ */
263
+ reArmStarted(taskGroupId: string, repoId: string, input: MergeStepInput): Promise<MergeStepRecord>;
264
+ /**
265
+ * Stage-2 r2 H1 — CLEAR the durable re-anchor marker after the train (or recovery) has
266
+ * CONFIRMED the CAS reset of the integration ref to `base_sha`. Idempotent: a no-op when
267
+ * there is no record or the marker is already clear. NEVER called before the CAS reset is
268
+ * confirmed — so a crash between the reset and this clear simply re-honors the (still-set)
269
+ * marker on the next recovery, which re-does the now-idempotent CAS reset (the ref is
270
+ * already at `base_sha`) and clears it. Read the marker via {@link readRecord}'s
271
+ * `reanchorPending`.
272
+ */
273
+ clearReanchorPending(taskGroupId: string, repoId: string): Promise<void>;
274
+ /**
275
+ * Mark a started step COMMITTED, recording the landed merge commit (§3.2). No-op
276
+ * when there is no group record or no started step at the slot. Idempotent.
277
+ */
278
+ writeCommitted(taskGroupId: string, repoId: string, orderSlot: number, mergeCommit: string): Promise<void>;
279
+ /**
280
+ * CP-14 WB2 (#C14-WB2-RESOLVE-WAL) — write the `resolution_recorded` WAL marker on a
281
+ * still-`merge_started` AGENTIC slot, AFTER its §4.5 records + the resolution-set index
282
+ * are durable and BEFORE the merge commit. A durable marker therefore IMPLIES the
283
+ * load-bearing records exist (audit-before-ref). Idempotent: a re-call with the SAME
284
+ * marker returns without rewriting. NEVER sets the marker on a `merge_committed` /
285
+ * `merge_aborted` step (terminal) or when there is no step (no-op). Recovery reads
286
+ * `step.resolutionRecorded` to distinguish case 2 (present → commit the recorded tree
287
+ * agent-free) from case 3 (absent → clear pending records + re-dispatch).
288
+ */
289
+ writeResolutionRecorded(taskGroupId: string, repoId: string, orderSlot: number, marker: MergeResolutionRecordedMarker): Promise<void>;
290
+ /**
291
+ * Mark a started step TERMINALLY ABORTED — a deterministic conflict-halt at this
292
+ * slot. NOTHING was committed past slot k-1; the integration ref is where slot k-1
293
+ * left it (the train halted BEFORE this commit). `listStartedNotCommitted` EXCLUDES
294
+ * a `merge_aborted` step, so a completed conflict-halt is never mistaken for a
295
+ * crash. NEVER downgrades a `merge_committed` step (immutable-once-committed). No-op
296
+ * when there is no record/step. Idempotent.
297
+ */
298
+ markAborted(taskGroupId: string, repoId: string, orderSlot: number, abortReason: string, conflictPaths?: string[]): Promise<void>;
299
+ /**
300
+ * The started-but-not-committed STEPS for one `(group, repo)` — the recovery
301
+ * work-set (§3.2). A `merge_committed`/`merge_aborted` step is excluded. Returned
302
+ * in ascending `orderSlot` so recovery walks the train forward.
303
+ */
304
+ listStartedNotCommitted(taskGroupId: string, repoId: string): Promise<MergeStepRecord[]>;
305
+ /** Read the journal record for `(group, repo)`, or `null` if none. */
306
+ readRecord(taskGroupId: string, repoId: string): Promise<MergeJournalRecord | null>;
307
+ private upsertStep;
308
+ private writeRecord;
309
+ /** Delete the journal record for `(group, repo)` (terminal cleanup / GC). */
310
+ deleteRecord(taskGroupId: string, repoId: string): Promise<void>;
311
+ }