@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
@@ -33,14 +33,14 @@ export type VerdictParseError = {
33
33
  kind: 'empty_output';
34
34
  } | {
35
35
  /**
36
- * The first non-blank line did not start with one of the four
37
- * verdict keywords (case-insensitive). Includes any leading markdown
38
- * formatting, quotation, or `VERDICT:` prefix that makes the line
39
- * diverge from the locked contract.
36
+ * The first non-blank line could not be reduced to one of the four
37
+ * verdict keywords (case-insensitive). Harmless wrappers/labels such as
38
+ * `**APPROVE**` and `VERDICT: APPROVE` are accepted; prose prefaces are
39
+ * still rejected.
40
40
  *
41
- * Also fired when a non-blank, non-indented line of prose appears
42
- * after the bullet section starts (the format reserves post-bullet
43
- * lines for blank lines or indented continuations only).
41
+ * Under the relaxed contract this fires ONLY on the FIRST non-blank
42
+ * line — trailing/interleaved prose AFTER a bulleted list no longer
43
+ * errors (it is folded into `reasoning`; see the module header).
44
44
  */
45
45
  kind: 'invalid_verdict';
46
46
  /** The offending line, trimmed but otherwise verbatim. */
@@ -52,8 +52,11 @@ export type VerdictParseError = {
52
52
  * line is a parse failure. */
53
53
  kind: 'reasoning_missing';
54
54
  } | {
55
- /** Verdict was REVISE but no bulleted suggested-changes list followed.
56
- * Design-locked: REVISE requires at least one concrete change. */
55
+ /** Verdict was REVISE but no concrete change could be found — neither a
56
+ * bulleted suggested-changes list NOR fallback prose (#581). REVISE
57
+ * requires at least one concrete change; in practice this is
58
+ * unreachable because `reasoning_missing` already rejects a REVISE with
59
+ * no prose, but the variant is kept as a fail-closed guard. */
57
60
  kind: 'revise_missing_changes';
58
61
  } | {
59
62
  /** A non-REVISE verdict was followed by a bulleted list, which the
@@ -87,9 +90,42 @@ export type ParseResult = {
87
90
  /**
88
91
  * Parse a reviewer reply. Strict: any deviation from the locked format
89
92
  * returns `{ ok: false, error: ... }` which the subprocess layer routes to
90
- * a parse-failure `ReviewerError`.
93
+ * a parse-failure `ReviewerError`. The ONE deliberate relaxation is the #581
94
+ * REVISE-prose leniency documented in the module header.
91
95
  *
92
- * Mirrors Rust's `parse_verdict_output` byte-for-byte. Test coverage
93
- * matches the Rust unit-test set verbatim.
96
+ * Was a byte-for-byte port of Rust's `parse_verdict_output`; the #581
97
+ * leniency is a TS-only divergence (this is the live path — the Rust parser
98
+ * is legacy/off-path). The shared-with-Rust test set is preserved verbatim;
99
+ * the #581 leniency tests are TS-additive.
94
100
  */
95
101
  export declare function parseVerdictOutput(raw: string): ParseResult;
102
+ /**
103
+ * [Gemma classifier · D5] Extract `suggested_changes` from a REVISE reviewer's
104
+ * (verdict-STRIPPED) reasoning, mirroring `parseVerdictOutput`'s BULLETS-FIRST-
105
+ * ELSE-PROSE behavior (a bare `deriveChangesFromProse` would fold `- `/`* `
106
+ * bullet lists into one paragraph, LOSING structure). Collect `- `/`* ` bullets
107
+ * (dropping empties, folding indented continuations, treating trailing non-indented
108
+ * prose as commentary NOT a change); if any bullet was found, return them; else
109
+ * fall back to `deriveChangesFromProse` (numbered-list / paragraph derivation).
110
+ * Empty result ⇒ the caller downgrades REVISE → ESCALATE (fail-closed).
111
+ */
112
+ export declare function extractSuggestedChanges(reasoning: string): string[];
113
+ /**
114
+ * [Gemma classifier · D2a] The verdict KIND of a line iff it is a STANDALONE
115
+ * verdict line — `parseVerdictToken` (which strips the `VERDICT:`/`DECISION:`
116
+ * label, markdown wrappers, and trailing punctuation) parses it AND it carries NO
117
+ * inline reasoning. So `APPROVE`, `**APPROVE**`, `VERDICT: APPROVE`, `APPROVE.`
118
+ * → their kind; `APPROVE because the tests pass` → `null` (inline reasoning). Used
119
+ * by the classifier's deterministic conflicting-verdict guard + `postVerdictReasoning`.
120
+ */
121
+ export declare function standaloneVerdictKind(line: string): VerdictKind | null;
122
+ /**
123
+ * [Gemma classifier · D5/HIGH-A] The reviewer's post-verdict reasoning for change
124
+ * derivation: the text AFTER the FIRST standalone verdict line (dropping the
125
+ * pre-verdict preamble + the verdict line), with any REMAINING standalone verdict
126
+ * lines removed; if there is NO standalone verdict line (Gemma inferred the verdict
127
+ * from non-standalone text), the whole `rawText`. Mirrors the shipped parser, which
128
+ * only ever sees verdict-stripped `reasoning` — feeding raw text to change
129
+ * derivation would promote the preamble + the verdict token to bogus changes.
130
+ */
131
+ export declare function postVerdictReasoning(rawText: string): string;
@@ -1,4 +1,68 @@
1
+ import type { SubstrateHandle } from '../substrate/types.js';
2
+ import type { VerdictClassifier } from './verdict-classifier.js';
1
3
  import type { AgentKind, ReviewerRole, ReviewerVerdict } from './types.js';
4
+ /**
5
+ * CP-7 §8 (Stage-1-resolved) — per-evaluate options threaded from the live
6
+ * caller (`QuorumLoop.spawnOneSeat`) down through the registry into the
7
+ * provider. Today it carries ONLY the optional CP-7 substrate handle; it is an
8
+ * options object (not a positional arg) so future per-evaluate knobs do not
9
+ * churn every provider signature.
10
+ *
11
+ * # Why this is NOT on `ReviewerSpec`
12
+ *
13
+ * `ReviewerSpec` is a wire-format DATA struct (snake_case, echoed into the
14
+ * audit log + FFI). A live `SubstrateHandle` is a runtime resource (broker +
15
+ * sandbox lifecycle) that must NEVER be serialized — keeping it on a separate
16
+ * non-wire options object preserves the spec's data-only contract.
17
+ */
18
+ export interface ReviewerEvaluateOptions {
19
+ /**
20
+ * CP-7 §8 — when present, the reviewer runs INSIDE the CP-7 trusted-execution
21
+ * sandbox + broker (no ambient vendor creds; model call via the loopback
22
+ * broker), exactly like a substrate-confined implementor. The provider
23
+ * forwards it to `runReviewer({ …, substrate })` AND drops the
24
+ * `{...process.env}` env spread in its `buildCommand` (the env is pre-baked
25
+ * sanitized at `substrate.launch()`). ABSENT → the legacy unsandboxed path
26
+ * (byte-identical to pre-CP-7-reviewer-sandbox behavior).
27
+ */
28
+ substrate?: SubstrateHandle;
29
+ /**
30
+ * CP-7 reviewer-sandbox fix — the HOST path of the substrate workdir (the
31
+ * sandboxed child's cwd). REQUIRED in practice whenever {@link substrate} is
32
+ * present for the Codex provider, which writes its verdict via `codex exec
33
+ * --output-last-message <path>`: on the sandbox path that file MUST live in
34
+ * the sandbox-writable + host-readable workdir, NOT `os.tmpdir()` (which the
35
+ * A1 container does not mount and the A5 Seatbelt profile does not grant for
36
+ * writes). The provider passes a RELATIVE filename to codex (codex's cwd ==
37
+ * the workdir on BOTH backends — A5 `cwd: workdir`; Docker `docker exec -w
38
+ * /workspace`) and reads it back from `<workdir>/<name>` on the host (the same
39
+ * inode, even when A5 canonicalizes the workdir — the host read follows the
40
+ * symlink). The Claude / Gemini providers do not use a file output, so they
41
+ * ignore this field. ABSENT (legacy path / non-substrate) → the provider uses
42
+ * its byte-identical legacy `os.tmpdir()` location.
43
+ *
44
+ * # Why this is NOT derivable from `substrate`
45
+ *
46
+ * `SubstrateHandle` (a runtime resource) deliberately does NOT expose the
47
+ * workdir — it is a launch-time input the caller already holds. Threading the
48
+ * host workdir here (the loop's `workingDir`, the very value it engages the
49
+ * substrate with) keeps the handle's surface minimal.
50
+ */
51
+ workdir?: string;
52
+ /**
53
+ * REVIEWER-VERDICT-GEMMA-CLASSIFIER-DESIGN.md (D1) — when present, the provider's
54
+ * `buildVerdict` calls `await classifyVerdict(rawText, ctx)` (local-Gemma verdict
55
+ * classification, fail-closed) INSTEAD of the regex `parseVerdictOutput`. Under
56
+ * the default `gemma` mode this is ALWAYS present (the real Gemma classifier, or
57
+ * a dummy always-ESCALATE classifier when the runner is null at boot) — so a
58
+ * silent regex fallback is impossible. ABSENT ⇒ the provider uses the regex
59
+ * `parseVerdictOutput`, reachable ONLY via `CODEVIBE_REVIEWER_VERDICT_CLASSIFIER=regex`
60
+ * (a deliberate `undefined`, never an accidental missing-classifier fallback).
61
+ * The non-zero-exit → `spawn_failed` guard still runs FIRST (a crashed reviewer
62
+ * is a spawn failure, never sent to the classifier).
63
+ */
64
+ classifyVerdict?: VerdictClassifier;
65
+ }
2
66
  /**
3
67
  * Spec for spawning one reviewer at one gate. Constructed by the engine
4
68
  * from `ReviewerAgentSpec` (from `PolicySnapshot`) + the context bundle for
@@ -67,6 +131,28 @@ export interface ReviewerSpec {
67
131
  */
68
132
  model_hint: string | null;
69
133
  }
134
+ /**
135
+ * CP-1.f escalation per-seat surfacing — SAFE, CLOSED failure-classification
136
+ * label. The cross-repo contract (`/tmp/cp1f-escalation-impl-contract.md` §1)
137
+ * pins this taxonomy byte-for-byte with the Rust side
138
+ * (`reason_code: Option<ReviewerFailureReason>` on `ReviewerError::SpawnFailed`,
139
+ * `#[serde(rename_all = "snake_case")]`).
140
+ *
141
+ * # Safety invariant (LOAD-BEARING)
142
+ *
143
+ * This is a LABEL ONLY. It MUST NEVER carry raw stderr / stdout / paths /
144
+ * credentials. It is **distinct from and never derived into** the raw
145
+ * `spawn_failed.reason` (which DOES carry stderr). `QuorumLoop.synthesizeEscalate`
146
+ * reads ONLY this label and maps it through a fixed `label → human template`
147
+ * table — the raw `.reason` never reaches the wire `reasoning`.
148
+ *
149
+ * - `usage_limit` — provider hit a usage / capacity / rate limit.
150
+ * - `auth_failed` — provider could not authenticate (401 / not-logged-in).
151
+ * - `timeout` — the wrapper's own wall-clock timeout fired.
152
+ * - `parse_failure` — the stream parsed but yielded no usable final reply.
153
+ * - `spawn_failed` — generic fallback (non-zero exit, no structured error).
154
+ */
155
+ export type ReviewerFailureReason = 'usage_limit' | 'auth_failed' | 'timeout' | 'parse_failure' | 'spawn_failed';
70
156
  /**
71
157
  * Typed error thrown by `ReviewerProvider.evaluate`. Discriminated union
72
158
  * matching Rust's `#[serde(tag = "kind", rename_all = "snake_case")]` enum.
@@ -86,11 +172,26 @@ export type ReviewerError = {
86
172
  elapsed_ms: number;
87
173
  } | {
88
174
  /** Reviewer process could not be launched (CLI missing, spawn syscall
89
- * failed, etc.). */
175
+ * failed, etc.) OR exited non-zero. */
90
176
  kind: 'spawn_failed';
91
177
  agent: AgentKind;
92
- /** Human-readable cause. */
178
+ /**
179
+ * Human-readable cause. **MAY carry raw stderr** — must stay in logs /
180
+ * audit only. NEVER promote this into the synthesized verdict wire
181
+ * `reasoning` (CP-1.f sanitization invariant). Use `failureReason` for
182
+ * the user-facing one-liner instead.
183
+ */
93
184
  reason: string;
185
+ /**
186
+ * CP-1.f — SAFE, CLOSED classification of WHY the reviewer could not
187
+ * complete, derived from the provider's `--json` STDOUT error stream
188
+ * (NOT from `reason`/stderr). `QuorumLoop.synthesizeEscalate` reads this
189
+ * — never `reason` — and maps it through a fixed human template.
190
+ * Optional: absent on the legacy path (older serialized errors) →
191
+ * `synthesizeEscalate` falls back to the clean `spawn_failed` template,
192
+ * never raw output.
193
+ */
194
+ failureReason?: ReviewerFailureReason;
94
195
  } | {
95
196
  /** Reviewer returned but its output couldn't be parsed into a valid
96
197
  * verdict. Raw output is preserved for the audit log. */
@@ -144,10 +245,13 @@ export interface ReviewerProvider {
144
245
  * @param spec - the reviewer to spawn (seat_id + role + agent + prompt + timeout)
145
246
  * @param gateId - the `ReviewGate` UUID this verdict attaches to. Stored
146
247
  * on the returned `ReviewerVerdict.gate_id`.
248
+ * @param opts - CP-7 §8 (Stage-1-resolved) OPTIONAL per-evaluate options;
249
+ * carries the substrate handle when the reviewer is sandboxed.
250
+ * ABSENT/`{}` → the legacy unsandboxed path (byte-identical).
147
251
  * @returns the parsed `ReviewerVerdict` on success.
148
252
  * @throws `ReviewerErrorClass` on timeout, spawn failure, parse failure,
149
253
  * cancellation, or internal join failure. Use `e.detail.kind` to
150
254
  * narrow.
151
255
  */
152
- evaluate(spec: ReviewerSpec, gateId: string): Promise<ReviewerVerdict>;
256
+ evaluate(spec: ReviewerSpec, gateId: string, opts?: ReviewerEvaluateOptions): Promise<ReviewerVerdict>;
153
257
  }
@@ -0,0 +1,49 @@
1
+ import { type ReviewerEvaluateOptions, type ReviewerProvider, type ReviewerSpec } from '../provider.js';
2
+ import { type SubprocessOutcome } from '../subprocess.js';
3
+ import type { ReviewerVerdict } from '../types.js';
4
+ import { type VerdictClassifier } from '../verdict-classifier.js';
5
+ /** Built command shape — split out so tests can inspect args/env without spawning. */
6
+ export interface BuiltCommand {
7
+ command: string;
8
+ args: string[];
9
+ env: NodeJS.ProcessEnv;
10
+ }
11
+ /** Construction options. */
12
+ export interface AntigravityReviewerProviderOptions {
13
+ /** Override the `agy` executable path (tests point at a fixture CLI). */
14
+ executable?: string;
15
+ }
16
+ /**
17
+ * Real Antigravity reviewer provider. Wraps the `agy` CLI (the bare
18
+ * Google-distributed binary — NOT the `codevibe-agy` 1.x wrapper).
19
+ */
20
+ export declare class AntigravityReviewerProvider implements ReviewerProvider {
21
+ private readonly executable;
22
+ constructor(opts?: AntigravityReviewerProviderOptions);
23
+ evaluate(spec: ReviewerSpec, gateId: string, opts?: ReviewerEvaluateOptions): Promise<ReviewerVerdict>;
24
+ }
25
+ /**
26
+ * Construct the agy CLI invocation (design D4):
27
+ *
28
+ * - `--print ''` — non-interactive one-shot; the EMPTY value selects the
29
+ * STDIN prompt (fed by `runReviewer`), keeping multi-line markdown out of
30
+ * argv (same posture as gemini's `-p ''`).
31
+ * - `--model <hint>` — optional; omitted when `spec.model_hint` is `null`
32
+ * (agy default model).
33
+ * - `--print-timeout <s>s` — agy's INTERNAL print-mode poll ceiling, derived
34
+ * from the spec timeout so agy gives up (with its own clean teardown)
35
+ * BEFORE `runReviewer`'s external `timeout_ms` kill fires.
36
+ * - `--add-dir <workdir>` — grants agy's tools the repo (workspace-centric).
37
+ *
38
+ * No `--output-format json` exists in agy print mode — stdout is the raw
39
+ * reply text and there is no usage/token envelope (D10: tokens_used null).
40
+ */
41
+ export declare function buildCommand(executable: string, spec: ReviewerSpec, workdir: string): BuiltCommand;
42
+ /**
43
+ * Map the raw subprocess outcome into a `ReviewerVerdict` or throw a
44
+ * structured `ReviewerErrorClass`. Exit code first (a crashed CLI's stdout is
45
+ * unreliable); then the verdict text is `outcome.stdout` VERBATIM (no json
46
+ * unwrap — agy print mode is plain text) fed to the injected classifier
47
+ * (default) or the legacy regex parser (`CODEVIBE_REVIEWER_VERDICT_CLASSIFIER=regex`).
48
+ */
49
+ export declare function buildVerdict(spec: ReviewerSpec, gateId: string, outcome: SubprocessOutcome, classifyVerdict?: VerdictClassifier): Promise<ReviewerVerdict>;
@@ -1,6 +1,7 @@
1
- import { type ReviewerProvider, type ReviewerSpec } from '../provider.js';
1
+ import { type ReviewerEvaluateOptions, type ReviewerProvider, type ReviewerSpec } from '../provider.js';
2
2
  import { type SubprocessOutcome } from '../subprocess.js';
3
3
  import type { ReviewerVerdict } from '../types.js';
4
+ import { type VerdictClassifier } from '../verdict-classifier.js';
4
5
  /**
5
6
  * Built command shape — split out so tests can inspect args / env without
6
7
  * spawning a process. `runReviewer` consumes this shape directly.
@@ -27,7 +28,7 @@ export interface ClaudeReviewerProviderOptions {
27
28
  export declare class ClaudeReviewerProvider implements ReviewerProvider {
28
29
  private readonly executable;
29
30
  constructor(opts?: ClaudeReviewerProviderOptions);
30
- evaluate(spec: ReviewerSpec, gateId: string): Promise<ReviewerVerdict>;
31
+ evaluate(spec: ReviewerSpec, gateId: string, opts?: ReviewerEvaluateOptions): Promise<ReviewerVerdict>;
31
32
  }
32
33
  /**
33
34
  * Construct the Claude CLI invocation. Split out from `evaluate` so unit
@@ -48,12 +49,26 @@ export declare class ClaudeReviewerProvider implements ReviewerProvider {
48
49
  *
49
50
  * Set unconditionally to `'1'` in the child's environment. See module docs
50
51
  * for the rationale and why `--bare` was rejected as the primary defense.
52
+ *
53
+ * # CP-7 §8 (Stage-1-resolved) — `sandboxed` drops the `process.env` spread
54
+ *
55
+ * On the SUBSTRATE path (`sandboxed === true`) the returned `env` is EMPTY:
56
+ * the reviewer's real env is pre-baked at `substrate.launch()` (the I1
57
+ * allow-list `sanitizedEnv` — broker base-URL + config dir, NO vendor key),
58
+ * and `runReviewer` ignores `BuiltCommand.env` when a substrate handle is
59
+ * present. We deliberately do NOT spread `{...process.env}` here in that
60
+ * case: the spread re-introduces `ANTHROPIC_API_KEY` / OAuth env + the host
61
+ * `ANTHROPIC_BASE_URL` / `CLAUDE_CONFIG_DIR` that would DEFEAT the broker
62
+ * redirect (THE moat hole). The `QUORUM_REVIEWER_SUBPROCESS` marker is folded
63
+ * into the substrate's sanitizedEnv at launch (the engager's marker step),
64
+ * not via this field. On the LEGACY path (`sandboxed === false`, the default)
65
+ * the env is built exactly as before — byte-identical non-regression.
51
66
  */
52
- export declare function buildCommand(executable: string, spec: ReviewerSpec): BuiltCommand;
67
+ export declare function buildCommand(executable: string, spec: ReviewerSpec, sandboxed?: boolean): BuiltCommand;
53
68
  /**
54
69
  * Map the raw subprocess outcome into a `ReviewerVerdict` or throw a
55
70
  * structured `ReviewerErrorClass`. Exit code is checked first — a crashed
56
71
  * CLI that happened to print something valid on stdout should still be
57
72
  * treated as a spawn failure, not a silently-accepted verdict.
58
73
  */
59
- export declare function buildVerdict(spec: ReviewerSpec, gateId: string, outcome: SubprocessOutcome): ReviewerVerdict;
74
+ export declare function buildVerdict(spec: ReviewerSpec, gateId: string, outcome: SubprocessOutcome, classifyVerdict?: VerdictClassifier): Promise<ReviewerVerdict>;
@@ -1,6 +1,7 @@
1
- import { type ReviewerProvider, type ReviewerSpec } from '../provider.js';
1
+ import { type ReviewerEvaluateOptions, type ReviewerProvider, type ReviewerSpec } from '../provider.js';
2
2
  import { type SubprocessOutcome } from '../subprocess.js';
3
3
  import type { ReviewerVerdict } from '../types.js';
4
+ import { type VerdictClassifier } from '../verdict-classifier.js';
4
5
  import type { BuiltCommand } from './claude.js';
5
6
  /** Construction options. */
6
7
  export interface CodexReviewerProviderOptions {
@@ -15,7 +16,7 @@ export interface CodexReviewerProviderOptions {
15
16
  export declare class CodexReviewerProvider implements ReviewerProvider {
16
17
  private readonly executable;
17
18
  constructor(opts?: CodexReviewerProviderOptions);
18
- evaluate(spec: ReviewerSpec, gateId: string): Promise<ReviewerVerdict>;
19
+ evaluate(spec: ReviewerSpec, gateId: string, opts?: ReviewerEvaluateOptions): Promise<ReviewerVerdict>;
19
20
  }
20
21
  /**
21
22
  * Construct the Codex CLI invocation. Split out from `evaluate` so unit
@@ -35,18 +36,26 @@ export declare class CodexReviewerProvider implements ReviewerProvider {
35
36
  * - `--ephemeral` — do NOT write a session JSONL under
36
37
  * `~/.codex/sessions/`.
37
38
  * - `--output-last-message <path>` — write the model's final agent
38
- * message verbatim to `path`.
39
+ * message verbatim to `path`. On the LEGACY path `path` is an ABSOLUTE
40
+ * `os.tmpdir()` file; on the SUBSTRATE path it is a RELATIVE filename so
41
+ * codex writes it into its cwd (the workdir) — the only sandbox-writable +
42
+ * host-readable location (see `evaluate` / `resolveLastMessagePaths`).
39
43
  * - `--model <hint>` — optional; omitted when `spec.model_hint` is `null`.
40
44
  * - `-` (final arg) — read prompt from stdin.
45
+ *
46
+ * `lastMessagePath` is the value passed to `--output-last-message` AS CODEX
47
+ * SEES IT (the in-sandbox arg): an absolute tmp path on the legacy path, a
48
+ * relative-to-cwd filename on the substrate path. The CALLER (`evaluate`) owns
49
+ * the corresponding HOST read/unlink path.
41
50
  */
42
- export declare function buildCommand(executable: string, spec: ReviewerSpec, lastMessagePath: string): BuiltCommand;
51
+ export declare function buildCommand(executable: string, spec: ReviewerSpec, lastMessagePath: string, sandboxed?: boolean): BuiltCommand;
43
52
  /**
44
53
  * Map the raw subprocess outcome + the file Codex wrote into a
45
54
  * `ReviewerVerdict` or throw a structured `ReviewerErrorClass`. See
46
55
  * `claude.ts::buildVerdict` for the shared safety rule (non-zero exit
47
56
  * overrides any parseable stdout / file).
48
57
  */
49
- export declare function buildVerdict(spec: ReviewerSpec, gateId: string, outcome: SubprocessOutcome, lastMessage: string): ReviewerVerdict;
58
+ export declare function buildVerdict(spec: ReviewerSpec, gateId: string, outcome: SubprocessOutcome, lastMessage: string, classifyVerdict?: VerdictClassifier): Promise<ReviewerVerdict>;
50
59
  /**
51
60
  * Sum `usage.input_tokens + usage.output_tokens` across every
52
61
  * `turn.completed` JSONL event in `stdout`. Returns `null` when no
@@ -63,5 +72,38 @@ export declare function sumCodexTokens(stdout: string): number | null;
63
72
  * the OS temp dir; we own its lifecycle (create on codex's side, read +
64
73
  * delete on ours). Per-process pid + UUID is enough — no race risk across
65
74
  * concurrent reviewers in the same engine run.
75
+ *
76
+ * Used for the LEGACY (unsandboxed) path; the sandbox path routes the file
77
+ * THROUGH the workdir instead — see {@link resolveLastMessagePaths}.
66
78
  */
67
79
  export declare function makeLastMessagePath(): string;
80
+ /**
81
+ * CP-7 reviewer-sandbox fix — resolve the TWO paths for the codex
82
+ * `--output-last-message` file:
83
+ * - `argPath` — what codex SEES (the value passed to the CLI flag).
84
+ * - `hostPath` — what the HOST reads/unlinks the file at.
85
+ *
86
+ * LEGACY (`sandboxed === false`): both are the SAME absolute `os.tmpdir()`
87
+ * path (byte-identical to pre-CP-7-reviewer-sandbox behavior). codex writes
88
+ * the host tmp file directly.
89
+ *
90
+ * SUBSTRATE (`sandboxed === true`): codex cannot write the host `os.tmpdir()`
91
+ * (A1 never mounts host `/tmp`; A5's Seatbelt profile grants writes to the
92
+ * WORKDIR only). So `argPath` is a RELATIVE filename: codex's cwd IS the
93
+ * workdir on both backends (A5 spawns `cwd: workdir`; Docker `docker exec -w
94
+ * /workspace`), so codex writes `<sandboxCwd>/<name>`. The host reads it at
95
+ * `hostPath = <workdir>/<name>` — the SAME inode (A5 shares the host fs even
96
+ * after the substrate canonicalizes the workdir, because the host read follows
97
+ * the symlink; A1 bind-mounts the workdir, so `<workdir>` on the host IS
98
+ * `/workspace` in the container). A relative `argPath` is deliberately
99
+ * cwd-agnostic, so it is correct for BOTH backends without per-backend mapping.
100
+ *
101
+ * FAIL-CLOSED: the substrate path REQUIRES the host `workdir`. Without it we
102
+ * cannot read codex's verdict back, so we THROW (the caller turns a provider
103
+ * throw into a clean synthesized ESCALATE) rather than silently writing to a
104
+ * relative file the host cannot locate.
105
+ */
106
+ export declare function resolveLastMessagePaths(sandboxed: boolean, workdir: string | undefined): {
107
+ argPath: string;
108
+ hostPath: string;
109
+ };
@@ -0,0 +1,26 @@
1
+ import type { ReviewerFailureReason } from '../provider.js';
2
+ /**
3
+ * Classify a single provider error MESSAGE into a `ReviewerFailureReason`, or
4
+ * `null` if it matches no known structured-failure signal.
5
+ *
6
+ * SAFE: returns only the closed label — never the message. Pure string match;
7
+ * no I/O, never throws.
8
+ */
9
+ export declare function classifyFailureMessage(message: string): ReviewerFailureReason | null;
10
+ /**
11
+ * Scan a provider's `--json` STDOUT event stream for a structured failure
12
+ * event (`{"type":"error"}` / `{"type":"turn.failed"}`) and classify the FIRST
13
+ * one found into a `ReviewerFailureReason`. Returns `null` when the stream
14
+ * carries no classifiable structured error (caller falls back to the generic
15
+ * `spawn_failed` label).
16
+ *
17
+ * # Truncation tolerance (LOAD-BEARING)
18
+ *
19
+ * Each line is JSON; per-line `JSON.parse` is wrapped in try/catch. A truncated
20
+ * final line — which a timeout / abort can leave behind mid-flush — is SKIPPED,
21
+ * never thrown. The whole scan degrades gracefully to `null` rather than
22
+ * propagating a parse error up through the escalation-synthesis path.
23
+ *
24
+ * SAFE: returns only the closed label — never any raw stream content.
25
+ */
26
+ export declare function classifyFailureFromStdout(stdout: string): ReviewerFailureReason | null;
@@ -1,6 +1,7 @@
1
- import { type ReviewerProvider, type ReviewerSpec } from '../provider.js';
1
+ import { type ReviewerEvaluateOptions, type ReviewerProvider, type ReviewerSpec } from '../provider.js';
2
2
  import { type SubprocessOutcome } from '../subprocess.js';
3
3
  import type { ReviewerVerdict } from '../types.js';
4
+ import { type VerdictClassifier } from '../verdict-classifier.js';
4
5
  import type { BuiltCommand } from './claude.js';
5
6
  /** Construction options. */
6
7
  export interface GeminiReviewerProviderOptions {
@@ -42,7 +43,7 @@ export interface GeminiModelStats {
42
43
  export declare class GeminiReviewerProvider implements ReviewerProvider {
43
44
  private readonly executable;
44
45
  constructor(opts?: GeminiReviewerProviderOptions);
45
- evaluate(spec: ReviewerSpec, gateId: string): Promise<ReviewerVerdict>;
46
+ evaluate(spec: ReviewerSpec, gateId: string, opts?: ReviewerEvaluateOptions): Promise<ReviewerVerdict>;
46
47
  }
47
48
  /**
48
49
  * Construct the Gemini CLI invocation. Split out from `evaluate` so unit
@@ -71,13 +72,13 @@ export declare class GeminiReviewerProvider implements ReviewerProvider {
71
72
  * session INACTIVE (empirically observed 2026-04-21 during Phase 2c.2
72
73
  * local testing).
73
74
  */
74
- export declare function buildCommand(executable: string, spec: ReviewerSpec): BuiltCommand;
75
+ export declare function buildCommand(executable: string, spec: ReviewerSpec, sandboxed?: boolean): BuiltCommand;
75
76
  /**
76
77
  * Map the raw subprocess outcome into a `ReviewerVerdict` or throw a
77
78
  * structured `ReviewerErrorClass`. See `claude.ts::buildVerdict` for the
78
79
  * shared safety rule (non-zero exit overrides any parseable stdout).
79
80
  */
80
- export declare function buildVerdict(spec: ReviewerSpec, gateId: string, outcome: SubprocessOutcome): ReviewerVerdict;
81
+ export declare function buildVerdict(spec: ReviewerSpec, gateId: string, outcome: SubprocessOutcome, classifyVerdict?: VerdictClassifier): Promise<ReviewerVerdict>;
81
82
  /**
82
83
  * Parse the FIRST complete JSON object in `stdout`, discarding any trailing
83
84
  * bytes. User-level hooks (e.g., CodeVibe's own Gemini plugin hooks
@@ -1,4 +1,4 @@
1
- import { type ReviewerProvider, type ReviewerSpec } from './provider.js';
1
+ import { type ReviewerEvaluateOptions, type ReviewerProvider, type ReviewerSpec } from './provider.js';
2
2
  import type { AgentKind, ReviewerVerdict } from './types.js';
3
3
  /**
4
4
  * Per-agent reviewer dispatch.
@@ -62,12 +62,12 @@ export declare class ReviewerRegistry implements ReviewerProvider {
62
62
  * existing escalation path handles it. The `reason` field includes
63
63
  * the agent name so audit can identify the misconfiguration.
64
64
  */
65
- evaluate(spec: ReviewerSpec, gateId: string): Promise<ReviewerVerdict>;
65
+ evaluate(spec: ReviewerSpec, gateId: string, opts?: ReviewerEvaluateOptions): Promise<ReviewerVerdict>;
66
66
  }
67
67
  /**
68
- * Production factory: build a registry pre-populated with all three
69
- * subprocess providers (Claude, Gemini, Codex) using the standard
70
- * binaries from PATH. Equivalent of Rust's
68
+ * Production factory: build a registry pre-populated with all four
69
+ * subprocess providers (Claude, Gemini, Codex, Antigravity) using the
70
+ * standard binaries from PATH. Equivalent of Rust's
71
71
  * `withSubprocessProviders()` napi factory.
72
72
  *
73
73
  * Plugins call this once at startup and hand the registry to the
@@ -1,3 +1,4 @@
1
+ import type { SubstrateHandle } from '../substrate/types.js';
1
2
  /**
2
3
  * Successful subprocess run. Exit status may still be failure (non-zero
3
4
  * code); the caller decides whether to treat that as a reviewer spawn error
@@ -72,8 +73,44 @@ export interface RunReviewerOptions {
72
73
  * primary plugin session. Each provider is responsible for setting it;
73
74
  * this module does NOT inject it automatically because providers may
74
75
  * also need to forward `process.env` selectively.
76
+ *
77
+ * # CP-7 §8 (Stage-1-resolved) — IGNORED on the substrate path
78
+ *
79
+ * `env` applies ONLY to the LEGACY (no-`substrate`) path, where it is
80
+ * passed verbatim to `child_process.spawn`. When `substrate` is supplied
81
+ * the child is obtained via `SubstrateHandle.exec(argv, …)`, whose env is
82
+ * PRE-BAKED at `substrate.launch()` time (the I1 allow-list `sanitizedEnv`
83
+ * with the broker base-URL redirect, NO vendor key) — `exec()` takes no
84
+ * env parameter by contract (`substrate/types.ts:138`). So this field is
85
+ * deliberately UNUSED on the substrate path: that is the moat invariant —
86
+ * a sandboxed reviewer MUST NOT inherit ANY ambient credential, and the
87
+ * provider's `{...process.env}` spread (the historic moat hole) never
88
+ * reaches the child because we do not honor `env` here. See the per-agent
89
+ * providers' `buildCommand` which drops the `process.env` spread for the
90
+ * substrate path. The `QUORUM_REVIEWER_SUBPROCESS` marker is folded into
91
+ * the substrate's sanitizedEnv at launch (the same way the implementor's
92
+ * §3.6 markers are), not via this field.
75
93
  */
76
94
  env: NodeJS.ProcessEnv;
95
+ /**
96
+ * CP-7 §8 (Stage-1-resolved) — OPTIONAL substrate handle. When supplied,
97
+ * the reviewer runs INSIDE the CP-7 trusted-execution sandbox + broker
98
+ * (exactly like a substrate-confined implementor): the child is obtained
99
+ * via `substrate.exec(argv, { stdinTty: true, … })` instead of
100
+ * `child_process.spawn`, so it sees ONLY the pre-baked I1 allow-list env
101
+ * (broker base-URL + bootstrap config dir; NO ambient vendor creds), and
102
+ * its model API call routes through the loopback broker (which injects the
103
+ * vendor key host-side). ABSENT → the LEGACY path (`child_process.spawn`
104
+ * with `env`) runs byte-identical to pre-CP-7-reviewer-sandbox behavior.
105
+ *
106
+ * The §3.1 lifecycle (prompt-write-to-stdin, stdout/stderr capture, the
107
+ * timeout race, abort/signal handling, teardown/kill, the SubprocessOutcome
108
+ * shape) is PRESERVED EXACTLY on both paths — `SubstrateProc` exposes the
109
+ * same `stdin`/`stdout`/`stderr`/`kill`/`on('close'|'error')` surface, so
110
+ * the lifecycle code below is shared; only the child-acquisition step
111
+ * differs.
112
+ */
113
+ substrate?: SubstrateHandle;
77
114
  /** Working directory; falls back to `process.cwd()`. */
78
115
  cwd?: string;
79
116
  /**
@@ -0,0 +1,32 @@
1
+ /**
2
+ * [P2-0] Clamp an UNTYPED token field (from agent CLI JSON) to a finite,
3
+ * non-negative INTEGER. Token fields come from untyped agent JSON — a string /
4
+ * object / `NaN` / negative / fractional value would poison the per-task
5
+ * accumulator (→ `NaN` render, or a reopened window showing a LOWER total),
6
+ * violating the "token count is a number" invariant. Every numeric ingress
7
+ * (`unwrapClaudeJson` usage reads, Codex `sumCodexTokens` per-event sum, the
8
+ * QuorumLoop `addTaskTokens`) gates on this, so a malformed field contributes 0,
9
+ * never corrupts the accumulator.
10
+ */
11
+ export declare function finiteToken(n: unknown): number;
12
+ /**
13
+ * [P2-6] Unwrap a Claude Code `--output-format json` NON-interactive envelope into
14
+ * `{ text, tokens }`. The ENTIRE body is `try/catch`-guarded — ANY throw (parse
15
+ * error, unexpected shape, field-access `TypeError`) degrades to the backward-compat
16
+ * raw-stdout fallback `{ text: stdout, tokens: undefined }`, so adding this unwrap
17
+ * can NEVER break a caller (it reduces to today's raw-stdout behavior).
18
+ *
19
+ * • No `type:'result'` object located / non-JSON → raw fallback (byte-identical
20
+ * to today — the downstream parser sees the raw stdout).
21
+ * • `is_error === true` OR `result` not a non-empty string → `{ text:'', tokens:
22
+ * undefined }`. The CALLER treats an empty/failed result as an agent FAILURE
23
+ * (reviewer ESCALATE / resolver human-gate — same as today), NOT a silent pass.
24
+ * • else → `{ text: result, tokens: (finiteToken(usage.input_tokens) +
25
+ * finiteToken(usage.output_tokens)) || undefined }`. `finiteToken` clamps
26
+ * absent/malformed usage to 0 (no `TypeError`, no `NaN`); cache tokens are
27
+ * excluded in v1 (input+output only — see design "Known v1 limitation").
28
+ */
29
+ export declare function unwrapClaudeJson(stdout: string): {
30
+ text: string;
31
+ tokens?: number;
32
+ };
@@ -1,13 +1,13 @@
1
1
  /**
2
- * Three agent kinds the reviewer subprocess layer can spawn.
2
+ * Agent kinds the reviewer subprocess layer can spawn.
3
3
  *
4
4
  * Lowercase wire format matches `codevibe_policy::AgentKind`'s
5
5
  * `#[serde(rename_all = "lowercase")]` attribute. **Append-only after launch**
6
- * — adding a fourth agent (e.g. a hypothetical fourth CLI) is fine; renaming
7
- * `claude` → `Claude` would break every audit chain entry that has serialised
8
- * it.
6
+ * — `antigravity` appended per AGY-2.0-SUPPORT-DESIGN.md (Phase A, 2026-07-03);
7
+ * renaming `claude` → `Claude` would break every audit chain entry that has
8
+ * serialised it.
9
9
  */
10
- export type AgentKind = 'claude' | 'gemini' | 'codex';
10
+ export type AgentKind = 'claude' | 'gemini' | 'codex' | 'antigravity';
11
11
  /**
12
12
  * Review lens a reviewer seat evaluates through.
13
13
  *