@quantiya/codevibe-core 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/dist/__tests__/cp-5-baseline-invariants.test.d.ts +1 -0
  2. package/dist/__tests__/prompt-parser.test.d.ts +1 -0
  3. package/dist/adapter/__tests__/capabilities.test.d.ts +1 -0
  4. package/dist/adapter/__tests__/contract-conformance.test.d.ts +1 -0
  5. package/dist/adapter/__tests__/packets.test.d.ts +1 -0
  6. package/dist/adapter/__tests__/progress.test.d.ts +1 -0
  7. package/dist/adapter/__tests__/registry.test.d.ts +1 -0
  8. package/dist/adapter/__tests__/smoke/claude.smoke.test.d.ts +1 -0
  9. package/dist/adapter/__tests__/smoke/codex.smoke.test.d.ts +1 -0
  10. package/dist/adapter/__tests__/smoke/gemini.smoke.test.d.ts +1 -0
  11. package/dist/adapter/capabilities.d.ts +68 -0
  12. package/dist/adapter/index.d.ts +7 -0
  13. package/dist/adapter/packets.d.ts +129 -0
  14. package/dist/adapter/progress.d.ts +93 -0
  15. package/dist/adapter/registry.d.ts +91 -0
  16. package/dist/adapter/types.d.ts +22 -0
  17. package/dist/appsync/__tests__/appsync-client-apply-user-decision.test.d.ts +1 -0
  18. package/dist/appsync/__tests__/appsync-client-classb.test.d.ts +1 -0
  19. package/dist/appsync/__tests__/appsync-client-event-source-filter.test.d.ts +1 -0
  20. package/dist/appsync/__tests__/appsync-client-planner.test.d.ts +1 -0
  21. package/dist/appsync/__tests__/appsync-client-task-group.test.d.ts +1 -0
  22. package/dist/appsync/__tests__/appsync-client.test.d.ts +1 -0
  23. package/dist/appsync/__tests__/cleanup-subscription.test.d.ts +1 -0
  24. package/dist/appsync/__tests__/coerce-awsjson-and-review-summary.test.d.ts +1 -0
  25. package/dist/appsync/__tests__/cp1f-quorum-sdk.test.d.ts +1 -0
  26. package/dist/appsync/__tests__/event-throttle.test.d.ts +1 -0
  27. package/dist/appsync/appsync-client.d.ts +1025 -2
  28. package/dist/appsync/event-throttle.d.ts +28 -0
  29. package/dist/appsync/index.d.ts +4 -1
  30. package/dist/appsync/queries.d.ts +34 -0
  31. package/dist/audit-keys/index.d.ts +32 -0
  32. package/dist/auth/__tests__/auth-telemetry.test.d.ts +1 -0
  33. package/dist/auth/auth-service.d.ts +32 -2
  34. package/dist/auth/auth-telemetry.d.ts +117 -6
  35. package/dist/auth/index.d.ts +1 -0
  36. package/dist/companion-mode/__tests__/persist-preference.test.d.ts +1 -0
  37. package/dist/companion-mode/__tests__/resolve-agent.test.d.ts +1 -0
  38. package/dist/companion-mode/agent-picker.d.ts +9 -0
  39. package/dist/companion-mode/index.d.ts +55 -0
  40. package/dist/companion-mode/persist-preference.d.ts +24 -0
  41. package/dist/companion-mode/resolve-agent.d.ts +41 -0
  42. package/dist/config/config.d.ts +8 -1
  43. package/dist/continuation/__tests__/dirty-state-collector.test.d.ts +1 -0
  44. package/dist/continuation/__tests__/integration.test.d.ts +1 -0
  45. package/dist/continuation/__tests__/packet-reader.test.d.ts +1 -0
  46. package/dist/continuation/__tests__/packet-writer.test.d.ts +1 -0
  47. package/dist/continuation/__tests__/parity.test.d.ts +1 -0
  48. package/dist/continuation/__tests__/status-cli.test.d.ts +1 -0
  49. package/dist/continuation/dirty-state-collector.d.ts +46 -0
  50. package/dist/continuation/index.d.ts +8 -0
  51. package/dist/continuation/packet-reader.d.ts +33 -0
  52. package/dist/continuation/packet-writer.d.ts +86 -0
  53. package/dist/continuation/types.d.ts +239 -0
  54. package/dist/credential-broker/__tests__/broker.test.d.ts +1 -0
  55. package/dist/credential-broker/__tests__/canonical.test.d.ts +1 -0
  56. package/dist/credential-broker/__tests__/scrubber.test.d.ts +1 -0
  57. package/dist/credential-broker/__tests__/upstream-client.test.d.ts +1 -0
  58. package/dist/credential-broker/__tests__/vendor-key-store.test.d.ts +1 -0
  59. package/dist/credential-broker/audit-sink.d.ts +69 -0
  60. package/dist/credential-broker/broker-config.d.ts +39 -0
  61. package/dist/credential-broker/broker-token.d.ts +123 -0
  62. package/dist/credential-broker/broker.d.ts +165 -0
  63. package/dist/credential-broker/canonical.d.ts +119 -0
  64. package/dist/credential-broker/index.d.ts +15 -0
  65. package/dist/credential-broker/scrubber.d.ts +45 -0
  66. package/dist/credential-broker/types.d.ts +141 -0
  67. package/dist/credential-broker/upstream-client.d.ts +20 -0
  68. package/dist/credential-broker/vendor-key-store.d.ts +54 -0
  69. package/dist/index.d.ts +17 -4
  70. package/dist/index.js +559 -55
  71. package/dist/keychain/__tests__/keychain-backend.test.d.ts +1 -0
  72. package/dist/keychain/keychain-backend.d.ts +82 -0
  73. package/dist/keychain/keychain-manager.d.ts +16 -2
  74. package/dist/local-executor/__tests__/agentic-disposable-repo.test.d.ts +1 -0
  75. package/dist/local-executor/__tests__/agentic-resolve.test.d.ts +1 -0
  76. package/dist/local-executor/__tests__/agentic-resolver-flag.test.d.ts +1 -0
  77. package/dist/local-executor/__tests__/authority-symlink-fixture.d.ts +15 -0
  78. package/dist/local-executor/__tests__/authority.test.d.ts +1 -0
  79. package/dist/local-executor/__tests__/class-a-emit.test.d.ts +1 -0
  80. package/dist/local-executor/__tests__/class-a-sign.test.d.ts +1 -0
  81. package/dist/local-executor/__tests__/class-b-consumer.integration.test.d.ts +1 -0
  82. package/dist/local-executor/__tests__/class-b-consumer.test.d.ts +1 -0
  83. package/dist/local-executor/__tests__/class1-reconcilers.test.d.ts +1 -0
  84. package/dist/local-executor/__tests__/class2-resolver.test.d.ts +1 -0
  85. package/dist/local-executor/__tests__/confined-model-caller.test.d.ts +1 -0
  86. package/dist/local-executor/__tests__/conflict-classifier.test.d.ts +1 -0
  87. package/dist/local-executor/__tests__/conflict-resolution-durable-store.test.d.ts +1 -0
  88. package/dist/local-executor/__tests__/conflict-resolution-store.test.d.ts +1 -0
  89. package/dist/local-executor/__tests__/cp1f-quorum-consumer.test.d.ts +1 -0
  90. package/dist/local-executor/__tests__/cp7-audit-writer.test.d.ts +1 -0
  91. package/dist/local-executor/__tests__/durable-store.test.d.ts +1 -0
  92. package/dist/local-executor/__tests__/git-lock-retry.test.d.ts +1 -0
  93. package/dist/local-executor/__tests__/hook-bridge.test.d.ts +1 -0
  94. package/dist/local-executor/__tests__/implementor-argv.test.d.ts +1 -0
  95. package/dist/local-executor/__tests__/local-executor-teams.test.d.ts +1 -0
  96. package/dist/local-executor/__tests__/local-executor.integration.test.d.ts +1 -0
  97. package/dist/local-executor/__tests__/merge-conflict-extract.test.d.ts +1 -0
  98. package/dist/local-executor/__tests__/merge-conflict-git.integration.test.d.ts +1 -0
  99. package/dist/local-executor/__tests__/merge-conflict-resolve-agentic.integration.test.d.ts +1 -0
  100. package/dist/local-executor/__tests__/merge-conflict-resolve.integration.test.d.ts +1 -0
  101. package/dist/local-executor/__tests__/merge-journal-store.test.d.ts +1 -0
  102. package/dist/local-executor/__tests__/merge-train-agentic-recovery.integration.test.d.ts +1 -0
  103. package/dist/local-executor/__tests__/merge-train-w3.integration.test.d.ts +1 -0
  104. package/dist/local-executor/__tests__/merge-train-waveb.integration.test.d.ts +1 -0
  105. package/dist/local-executor/__tests__/merge-train.test.d.ts +1 -0
  106. package/dist/local-executor/__tests__/promote-wal-store.test.d.ts +1 -0
  107. package/dist/local-executor/__tests__/revert-reconcile.test.d.ts +1 -0
  108. package/dist/local-executor/__tests__/revert-runner.test.d.ts +1 -0
  109. package/dist/local-executor/__tests__/shared-contract-detector.test.d.ts +1 -0
  110. package/dist/local-executor/__tests__/spawn.test.d.ts +1 -0
  111. package/dist/local-executor/__tests__/substrate-engage.test.d.ts +1 -0
  112. package/dist/local-executor/__tests__/team-execution-flag.test.d.ts +1 -0
  113. package/dist/local-executor/__tests__/track-registry.test.d.ts +1 -0
  114. package/dist/local-executor/__tests__/verification-runner.test.d.ts +1 -0
  115. package/dist/local-executor/__tests__/wb2-review-bundle.test.d.ts +1 -0
  116. package/dist/local-executor/__tests__/wb2-substrate-spawn.live.test.d.ts +1 -0
  117. package/dist/local-executor/__tests__/workspace-shadow.test.d.ts +1 -0
  118. package/dist/local-executor/__tests__/worktree-merge.test.d.ts +1 -0
  119. package/dist/local-executor/agentic-disposable-repo.d.ts +52 -0
  120. package/dist/local-executor/agentic-resolve.d.ts +54 -0
  121. package/dist/local-executor/agentic-resolver-flag.d.ts +9 -0
  122. package/dist/local-executor/authority.d.ts +61 -0
  123. package/dist/local-executor/class-a-emit.d.ts +140 -0
  124. package/dist/local-executor/class-a-sign.d.ts +57 -0
  125. package/dist/local-executor/class-b-consumer.d.ts +276 -0
  126. package/dist/local-executor/class-b-verify.d.ts +30 -0
  127. package/dist/local-executor/class1-reconcilers.d.ts +58 -0
  128. package/dist/local-executor/class2-resolver.d.ts +74 -0
  129. package/dist/local-executor/confined-model-caller.d.ts +39 -0
  130. package/dist/local-executor/conflict-classifier.d.ts +21 -0
  131. package/dist/local-executor/conflict-resolution-durable-store.d.ts +61 -0
  132. package/dist/local-executor/conflict-resolution-store.d.ts +210 -0
  133. package/dist/local-executor/conflict-types.d.ts +86 -0
  134. package/dist/local-executor/cp7-audit-writer.d.ts +152 -0
  135. package/dist/local-executor/durable-store.d.ts +334 -0
  136. package/dist/local-executor/git-lock-retry.d.ts +40 -0
  137. package/dist/local-executor/hook-bridge.d.ts +36 -0
  138. package/dist/local-executor/implementor-argv.d.ts +183 -0
  139. package/dist/local-executor/index.d.ts +49 -0
  140. package/dist/local-executor/local-executor-impl.d.ts +724 -0
  141. package/dist/local-executor/merge-conflict-extract.d.ts +34 -0
  142. package/dist/local-executor/merge-conflict-resolve.d.ts +101 -0
  143. package/dist/local-executor/merge-journal-store.d.ts +311 -0
  144. package/dist/local-executor/merge-train.d.ts +713 -0
  145. package/dist/local-executor/promote-wal-store.d.ts +301 -0
  146. package/dist/local-executor/resolution-set-index.d.ts +51 -0
  147. package/dist/local-executor/revert-reconcile.d.ts +89 -0
  148. package/dist/local-executor/revert-runner.d.ts +17 -0
  149. package/dist/local-executor/shared-contract-detector.d.ts +57 -0
  150. package/dist/local-executor/spawn.d.ts +34 -0
  151. package/dist/local-executor/task-group-types.d.ts +346 -0
  152. package/dist/local-executor/team-execution-flag.d.ts +21 -0
  153. package/dist/local-executor/track-registry.d.ts +50 -0
  154. package/dist/local-executor/types.d.ts +417 -0
  155. package/dist/local-executor/verification-gates/build.d.ts +6 -0
  156. package/dist/local-executor/verification-gates/deploy-preflight.d.ts +6 -0
  157. package/dist/local-executor/verification-gates/diff-sanity.d.ts +6 -0
  158. package/dist/local-executor/verification-gates/hostile-grep.d.ts +6 -0
  159. package/dist/local-executor/verification-gates/lint.d.ts +6 -0
  160. package/dist/local-executor/verification-gates/shell-runner.d.ts +40 -0
  161. package/dist/local-executor/verification-gates/source-traceability.d.ts +6 -0
  162. package/dist/local-executor/verification-gates/tests.d.ts +6 -0
  163. package/dist/local-executor/verification-gates/typecheck.d.ts +6 -0
  164. package/dist/local-executor/verification-runner.d.ts +28 -0
  165. package/dist/local-executor/wb2-review-bundle.d.ts +59 -0
  166. package/dist/local-executor/workspace-shadow.d.ts +290 -0
  167. package/dist/local-executor/worktree-merge.d.ts +601 -0
  168. package/dist/local-model/__tests__/installer.test.d.ts +1 -0
  169. package/dist/local-model/__tests__/manager.test.d.ts +1 -0
  170. package/dist/local-model/__tests__/ollama.test.d.ts +1 -0
  171. package/dist/local-model/__tests__/runtime.test.d.ts +1 -0
  172. package/dist/local-model/__tests__/state.test.d.ts +1 -0
  173. package/dist/local-model/manager.d.ts +119 -0
  174. package/dist/local-model/ollama.d.ts +27 -0
  175. package/dist/local-model/runtime.d.ts +27 -0
  176. package/dist/local-model/state.d.ts +32 -0
  177. package/dist/orchestration/__tests__/setup-bootstrap.test.d.ts +1 -0
  178. package/dist/orchestration/__tests__/setup-failure-recourse.test.d.ts +1 -0
  179. package/dist/orchestration/__tests__/setup-save.test.d.ts +1 -0
  180. package/dist/orchestration/__tests__/setup-seat-picker.test.d.ts +1 -0
  181. package/dist/orchestration/__tests__/setup-telemetry.test.d.ts +1 -0
  182. package/dist/orchestration/__tests__/setup-test-agents.test.d.ts +1 -0
  183. package/dist/orchestration/__tests__/setup-types.test.d.ts +1 -0
  184. package/dist/orchestration/__tests__/setup-wizard.test.d.ts +1 -0
  185. package/dist/orchestration/__tests__/v1-options.test.d.ts +1 -0
  186. package/dist/orchestration/detect-agents.d.ts +16 -2
  187. package/dist/orchestration/index.d.ts +1 -0
  188. package/dist/orchestration/orchestration-cli.d.ts +4 -1
  189. package/dist/orchestration/setup-bootstrap.d.ts +146 -0
  190. package/dist/orchestration/setup-failure-recourse.d.ts +23 -0
  191. package/dist/orchestration/setup-save.d.ts +47 -0
  192. package/dist/orchestration/setup-seat-picker.d.ts +72 -0
  193. package/dist/orchestration/setup-telemetry.d.ts +54 -0
  194. package/dist/orchestration/setup-test-agents.d.ts +108 -0
  195. package/dist/orchestration/setup-types.d.ts +141 -0
  196. package/dist/orchestration/setup-wizard.d.ts +57 -0
  197. package/dist/orchestration/v1-options.d.ts +97 -0
  198. package/dist/orchestration-shell/__tests__/attachments.test.d.ts +1 -0
  199. package/dist/orchestration-shell/__tests__/audit-browser.test.d.ts +1 -0
  200. package/dist/orchestration-shell/__tests__/audited-path-fixes.test.d.ts +1 -0
  201. package/dist/orchestration-shell/__tests__/bracketed-paste.test.d.ts +1 -0
  202. package/dist/orchestration-shell/__tests__/cli-authority-bridge.test.d.ts +1 -0
  203. package/dist/orchestration-shell/__tests__/cli-group-halt-wiring.test.d.ts +1 -0
  204. package/dist/orchestration-shell/__tests__/cli-orchestration-session-bootstrap.test.d.ts +1 -0
  205. package/dist/orchestration-shell/__tests__/cli-planner-stack.test.d.ts +1 -0
  206. package/dist/orchestration-shell/__tests__/cli-probe-group-status.test.d.ts +1 -0
  207. package/dist/orchestration-shell/__tests__/cli-quorum-loop-tier.test.d.ts +1 -0
  208. package/dist/orchestration-shell/__tests__/cli-singleton-enforcement.test.d.ts +1 -0
  209. package/dist/orchestration-shell/__tests__/cli-stub-session-adapter.test.d.ts +1 -0
  210. package/dist/orchestration-shell/__tests__/cli-verdict-classifier-wiring.test.d.ts +1 -0
  211. package/dist/orchestration-shell/__tests__/components.test.d.ts +1 -0
  212. package/dist/orchestration-shell/__tests__/context-store.test.d.ts +1 -0
  213. package/dist/orchestration-shell/__tests__/cp10-585-accept-echo-target.test.d.ts +1 -0
  214. package/dist/orchestration-shell/__tests__/cp10-585-loop.test.d.ts +1 -0
  215. package/dist/orchestration-shell/__tests__/cp10-585-prompts.test.d.ts +1 -0
  216. package/dist/orchestration-shell/__tests__/cp12-w2b-team-loop.test.d.ts +1 -0
  217. package/dist/orchestration-shell/__tests__/cp12-w4-team-recovery.test.d.ts +1 -0
  218. package/dist/orchestration-shell/__tests__/cp1f-quorum-loop.test.d.ts +1 -0
  219. package/dist/orchestration-shell/__tests__/cp606-team-track-user-resolved.test.d.ts +1 -0
  220. package/dist/orchestration-shell/__tests__/cp7-reviewer-substrate.test.d.ts +1 -0
  221. package/dist/orchestration-shell/__tests__/declared-test-runner.test.d.ts +1 -0
  222. package/dist/orchestration-shell/__tests__/emit-shell-event.test.d.ts +1 -0
  223. package/dist/orchestration-shell/__tests__/familiarize-routing.test.d.ts +1 -0
  224. package/dist/orchestration-shell/__tests__/gate-decision-submit.test.d.ts +1 -0
  225. package/dist/orchestration-shell/__tests__/gate-details-panel.test.d.ts +1 -0
  226. package/dist/orchestration-shell/__tests__/gate-prompts.test.d.ts +1 -0
  227. package/dist/orchestration-shell/__tests__/gate-verdict-details-dispatch.test.d.ts +1 -0
  228. package/dist/orchestration-shell/__tests__/group-decision-submit.test.d.ts +1 -0
  229. package/dist/orchestration-shell/__tests__/hostile-grep.test.d.ts +1 -0
  230. package/dist/orchestration-shell/__tests__/image-attach-e2e.test.d.ts +1 -0
  231. package/dist/orchestration-shell/__tests__/input-bar-autocomplete.test.d.ts +1 -0
  232. package/dist/orchestration-shell/__tests__/live-region-cap.test.d.ts +1 -0
  233. package/dist/orchestration-shell/__tests__/live-static-order.test.d.ts +1 -0
  234. package/dist/orchestration-shell/__tests__/mode-selection.test.d.ts +1 -0
  235. package/dist/orchestration-shell/__tests__/model-cli.test.d.ts +1 -0
  236. package/dist/orchestration-shell/__tests__/non-gate-prompt-routing.test.d.ts +1 -0
  237. package/dist/orchestration-shell/__tests__/orchestration-app-group-decision-transport.test.d.ts +1 -0
  238. package/dist/orchestration-shell/__tests__/orchestration-app-layout.test.d.ts +1 -0
  239. package/dist/orchestration-shell/__tests__/process-markers.test.d.ts +1 -0
  240. package/dist/orchestration-shell/__tests__/reducer.test.d.ts +1 -0
  241. package/dist/orchestration-shell/__tests__/reissue-team-retained-spec.test.d.ts +1 -0
  242. package/dist/orchestration-shell/__tests__/review-summary-render.test.d.ts +1 -0
  243. package/dist/orchestration-shell/__tests__/reviewer-wizard.test.d.ts +1 -0
  244. package/dist/orchestration-shell/__tests__/reviewers-format.test.d.ts +1 -0
  245. package/dist/orchestration-shell/__tests__/root-discovery.test.d.ts +1 -0
  246. package/dist/orchestration-shell/__tests__/runOrchestrationShell-classify-dispatch.test.d.ts +1 -0
  247. package/dist/orchestration-shell/__tests__/runOrchestrationShell-planner-wiring.test.d.ts +1 -0
  248. package/dist/orchestration-shell/__tests__/runOrchestrationShell-signal.test.d.ts +1 -0
  249. package/dist/orchestration-shell/__tests__/runOrchestrationShell.test.d.ts +1 -0
  250. package/dist/orchestration-shell/__tests__/serialize-submissions.test.d.ts +1 -0
  251. package/dist/orchestration-shell/__tests__/slash-router.test.d.ts +1 -0
  252. package/dist/orchestration-shell/__tests__/slash-suggest.test.d.ts +1 -0
  253. package/dist/orchestration-shell/__tests__/status-format.test.d.ts +1 -0
  254. package/dist/orchestration-shell/__tests__/sticky-preference.test.d.ts +1 -0
  255. package/dist/orchestration-shell/__tests__/task-progress.test.d.ts +1 -0
  256. package/dist/orchestration-shell/__tests__/team-decompose-routing.test.d.ts +1 -0
  257. package/dist/orchestration-shell/__tests__/team-decompose-types.test.d.ts +1 -0
  258. package/dist/orchestration-shell/__tests__/team-decompose.test.d.ts +1 -0
  259. package/dist/orchestration-shell/__tests__/team-e2e-smoke.test.d.ts +1 -0
  260. package/dist/orchestration-shell/__tests__/tier2-reviewer-selection.test.d.ts +1 -0
  261. package/dist/orchestration-shell/__tests__/web-browsing.test.d.ts +1 -0
  262. package/dist/orchestration-shell/attachments.d.ts +152 -0
  263. package/dist/orchestration-shell/audit-browser.d.ts +115 -0
  264. package/dist/orchestration-shell/audit-runner.d.ts +59 -0
  265. package/dist/orchestration-shell/bracketed-paste.d.ts +26 -0
  266. package/dist/orchestration-shell/cli.d.ts +431 -0
  267. package/dist/orchestration-shell/cli.js +44191 -0
  268. package/dist/orchestration-shell/cohort-flag.d.ts +16 -0
  269. package/dist/orchestration-shell/components/AuditLogPanel.d.ts +11 -0
  270. package/dist/orchestration-shell/components/CodeVibeLogo.d.ts +2 -0
  271. package/dist/orchestration-shell/components/ConversationPane.d.ts +13 -0
  272. package/dist/orchestration-shell/components/GateDetailsPanel.d.ts +57 -0
  273. package/dist/orchestration-shell/components/GatePanelEntry.d.ts +9 -0
  274. package/dist/orchestration-shell/components/GatePromptEntry.d.ts +16 -0
  275. package/dist/orchestration-shell/components/InputBar.d.ts +55 -0
  276. package/dist/orchestration-shell/components/LiveProgressLine.d.ts +8 -0
  277. package/dist/orchestration-shell/components/MultiTrackStatusNode.d.ts +8 -0
  278. package/dist/orchestration-shell/components/OrchestrationApp.d.ts +129 -0
  279. package/dist/orchestration-shell/components/ReviewerSetupWizard.d.ts +24 -0
  280. package/dist/orchestration-shell/components/StatusBar.d.ts +20 -0
  281. package/dist/orchestration-shell/components/nodes/AdvisoryEntry.d.ts +8 -0
  282. package/dist/orchestration-shell/components/nodes/GateStatusNode.d.ts +8 -0
  283. package/dist/orchestration-shell/components/nodes/PlannerDecisionEntry.d.ts +8 -0
  284. package/dist/orchestration-shell/components/nodes/ReviewerQuorumStatusNode.d.ts +8 -0
  285. package/dist/orchestration-shell/components/nodes/SlashOutputEntry.d.ts +8 -0
  286. package/dist/orchestration-shell/components/nodes/SubagentEventEntry.d.ts +8 -0
  287. package/dist/orchestration-shell/components/nodes/UserMessageEntry.d.ts +8 -0
  288. package/dist/orchestration-shell/context-store.d.ts +389 -0
  289. package/dist/orchestration-shell/declared-test-runner.d.ts +84 -0
  290. package/dist/orchestration-shell/emit-shell-event.d.ts +64 -0
  291. package/dist/orchestration-shell/gate-decision-submit.d.ts +245 -0
  292. package/dist/orchestration-shell/gate-prompts.d.ts +481 -0
  293. package/dist/orchestration-shell/index.d.ts +712 -0
  294. package/dist/orchestration-shell/ink-runtime.d.ts +84 -0
  295. package/dist/orchestration-shell/live-region-cap.d.ts +70 -0
  296. package/dist/orchestration-shell/live-static-order.d.ts +22 -0
  297. package/dist/orchestration-shell/mode-selection.d.ts +46 -0
  298. package/dist/orchestration-shell/non-tty-fallback.d.ts +67 -0
  299. package/dist/orchestration-shell/process-markers.d.ts +12 -0
  300. package/dist/orchestration-shell/quorum-loop.d.ts +1900 -0
  301. package/dist/orchestration-shell/reducer.d.ts +8 -0
  302. package/dist/orchestration-shell/root-discovery.d.ts +25 -0
  303. package/dist/orchestration-shell/route-browse.d.ts +20 -0
  304. package/dist/orchestration-shell/slash-router.d.ts +64 -0
  305. package/dist/orchestration-shell/slash-routes/continuation.d.ts +71 -0
  306. package/dist/orchestration-shell/slash-routes/reviewers.d.ts +41 -0
  307. package/dist/orchestration-shell/slash-suggest.d.ts +29 -0
  308. package/dist/orchestration-shell/status-format.d.ts +59 -0
  309. package/dist/orchestration-shell/sticky-preference.d.ts +24 -0
  310. package/dist/orchestration-shell/store.d.ts +17 -0
  311. package/dist/orchestration-shell/task-progress.d.ts +122 -0
  312. package/dist/orchestration-shell/team-decompose.d.ts +196 -0
  313. package/dist/orchestration-shell/types.d.ts +777 -0
  314. package/dist/orchestration-shell/vendor/ink-parse-keypress.d.ts +42 -0
  315. package/dist/orchestration-shell/web/extract.d.ts +11 -0
  316. package/dist/orchestration-shell/web/fetch.d.ts +15 -0
  317. package/dist/orchestration-shell/web/ip.d.ts +26 -0
  318. package/dist/orchestration-shell/web/sanitize.d.ts +14 -0
  319. package/dist/orchestration-shell/web/search.d.ts +16 -0
  320. package/dist/planner/__tests__/cache-clarification-bypass.test.d.ts +1 -0
  321. package/dist/planner/__tests__/cache.test.d.ts +1 -0
  322. package/dist/planner/__tests__/client.test.d.ts +1 -0
  323. package/dist/planner/__tests__/health-machine-transitions.test.d.ts +1 -0
  324. package/dist/planner/__tests__/local-gemma.test.d.ts +1 -0
  325. package/dist/planner/__tests__/types-zod.test.d.ts +1 -0
  326. package/dist/planner/adapter.d.ts +16 -0
  327. package/dist/planner/cache.d.ts +35 -0
  328. package/dist/planner/client.d.ts +103 -0
  329. package/dist/planner/health-state.d.ts +24 -0
  330. package/dist/planner/index.d.ts +7 -0
  331. package/dist/planner/local-advisory.d.ts +84 -0
  332. package/dist/planner/local-gemma.d.ts +23 -0
  333. package/dist/planner/types.d.ts +123 -0
  334. package/dist/reviewer/__tests__/antigravity-provider.test.d.ts +1 -0
  335. package/dist/reviewer/__tests__/claude-provider-json.test.d.ts +1 -0
  336. package/dist/reviewer/__tests__/cp7-reviewer-sandbox.test.d.ts +1 -0
  337. package/dist/reviewer/__tests__/output-parser-classifier-helpers.test.d.ts +1 -0
  338. package/dist/reviewer/__tests__/verdict-classifier.test.d.ts +1 -0
  339. package/dist/reviewer/index.d.ts +2 -0
  340. package/dist/reviewer/output-parser.d.ts +48 -12
  341. package/dist/reviewer/provider.d.ts +107 -3
  342. package/dist/reviewer/providers/__tests__/failure-classifier.test.d.ts +1 -0
  343. package/dist/reviewer/providers/antigravity.d.ts +49 -0
  344. package/dist/reviewer/providers/claude.d.ts +19 -4
  345. package/dist/reviewer/providers/codex.d.ts +47 -5
  346. package/dist/reviewer/providers/failure-classifier.d.ts +26 -0
  347. package/dist/reviewer/providers/gemini.d.ts +5 -4
  348. package/dist/reviewer/registry.d.ts +5 -5
  349. package/dist/reviewer/subprocess.d.ts +37 -0
  350. package/dist/reviewer/token-usage.d.ts +32 -0
  351. package/dist/reviewer/types.d.ts +5 -5
  352. package/dist/reviewer/verdict-classifier.d.ts +62 -0
  353. package/dist/session/__tests__/prepare-event-timestamp.test.d.ts +1 -0
  354. package/dist/session/__tests__/session-resume-service-keys.test.d.ts +1 -0
  355. package/dist/session/index.d.ts +1 -0
  356. package/dist/session/prepare-event-timestamp.d.ts +30 -0
  357. package/dist/session/session-rekey.d.ts +40 -0
  358. package/dist/session/session-resume.d.ts +25 -0
  359. package/dist/structural-summary/__tests__/__fixtures__/fixture-helpers.d.ts +11 -0
  360. package/dist/structural-summary/__tests__/assembler.test.d.ts +1 -0
  361. package/dist/structural-summary/__tests__/generator.test.d.ts +1 -0
  362. package/dist/structural-summary/__tests__/language-detect.test.d.ts +1 -0
  363. package/dist/structural-summary/__tests__/manifest-parsers/cargo.test.d.ts +1 -0
  364. package/dist/structural-summary/__tests__/manifest-parsers/gomod.test.d.ts +1 -0
  365. package/dist/structural-summary/__tests__/manifest-parsers/gradle.test.d.ts +1 -0
  366. package/dist/structural-summary/__tests__/manifest-parsers/index.test.d.ts +1 -0
  367. package/dist/structural-summary/__tests__/manifest-parsers/npm.test.d.ts +1 -0
  368. package/dist/structural-summary/__tests__/manifest-parsers/podfile.test.d.ts +1 -0
  369. package/dist/structural-summary/__tests__/manifest-parsers/pyproject.test.d.ts +1 -0
  370. package/dist/structural-summary/__tests__/opt-in-store.test.d.ts +1 -0
  371. package/dist/structural-summary/__tests__/privacy-filter.test.d.ts +1 -0
  372. package/dist/structural-summary/__tests__/safe-file-read.test.d.ts +1 -0
  373. package/dist/structural-summary/__tests__/user-ignore-matcher.test.d.ts +1 -0
  374. package/dist/structural-summary/__tests__/walker.test.d.ts +1 -0
  375. package/dist/structural-summary/generator.d.ts +8 -0
  376. package/dist/structural-summary/index.d.ts +7 -0
  377. package/dist/structural-summary/manifest-parsers/cargo.d.ts +3 -0
  378. package/dist/structural-summary/manifest-parsers/index.d.ts +7 -0
  379. package/dist/structural-summary/manifest-parsers/npm.d.ts +3 -0
  380. package/dist/structural-summary/manifest-parsers/other.d.ts +17 -0
  381. package/dist/structural-summary/opt-in-store.d.ts +24 -0
  382. package/dist/structural-summary/privacy-filter.d.ts +110 -0
  383. package/dist/structural-summary/safe-file-read.d.ts +11 -0
  384. package/dist/structural-summary/types.d.ts +215 -0
  385. package/dist/structural-summary/user-ignore-matcher.d.ts +9 -0
  386. package/dist/structural-summary/walker.d.ts +20 -0
  387. package/dist/substrate/__tests__/docker.test.d.ts +1 -0
  388. package/dist/substrate/__tests__/forwarder.test.d.ts +1 -0
  389. package/dist/substrate/__tests__/git-proxy.test.d.ts +1 -0
  390. package/dist/substrate/__tests__/sandbox-exec.test.d.ts +1 -0
  391. package/dist/substrate/__tests__/substrate-e2e.integration.test.d.ts +1 -0
  392. package/dist/substrate/command-runner.d.ts +19 -0
  393. package/dist/substrate/docker.d.ts +134 -0
  394. package/dist/substrate/errors.d.ts +33 -0
  395. package/dist/substrate/forwarder.d.ts +67 -0
  396. package/dist/substrate/git-proxy.d.ts +35 -0
  397. package/dist/substrate/index.d.ts +12 -0
  398. package/dist/substrate/relay-script.d.ts +27 -0
  399. package/dist/substrate/sandbox-exec.d.ts +116 -0
  400. package/dist/substrate/types.d.ts +218 -0
  401. package/dist/substrate-launch/__tests__/apikey-bootstrap.test.d.ts +1 -0
  402. package/dist/substrate-launch/__tests__/creditless-loop.integration.test.d.ts +1 -0
  403. package/dist/substrate-launch/__tests__/engage-substrate.test.d.ts +1 -0
  404. package/dist/substrate-launch/__tests__/fallback-ladder.test.d.ts +1 -0
  405. package/dist/substrate-launch/__tests__/le-env-scrub.test.d.ts +1 -0
  406. package/dist/substrate-launch/__tests__/sanitized-env.test.d.ts +1 -0
  407. package/dist/substrate-launch/apikey-bootstrap.d.ts +84 -0
  408. package/dist/substrate-launch/engage-substrate.d.ts +102 -0
  409. package/dist/substrate-launch/fallback-ladder.d.ts +49 -0
  410. package/dist/substrate-launch/index.d.ts +12 -0
  411. package/dist/substrate-launch/le-env-scrub.d.ts +77 -0
  412. package/dist/substrate-launch/sanitized-env.d.ts +73 -0
  413. package/dist/types/auth.d.ts +6 -1
  414. package/dist/types/events.d.ts +19 -2
  415. package/dist/types/reviewer.d.ts +6 -6
  416. package/package.json +21 -3
@@ -0,0 +1,389 @@
1
+ import type { StructuralSummary, StructuralSummaryGenerator, RepoSummary } from '../structural-summary/types';
2
+ import type { Tier } from './types';
3
+ /**
4
+ * Legacy §4.2 staleness fingerprint of the last scan — persisted in
5
+ * `metadata.json` by schema v1 builds. v2 keeps the same input-hash/content
6
+ * binding but moves `{HEAD, clean}` to one record per discovered root.
7
+ *
8
+ * - `head` — the git HEAD the cached summary was computed at (conjunct (b)).
9
+ * `null` for a non-git tree (a non-git tree never skips — see the probe).
10
+ * - `clean` — whether the tree was CLEAN when this summary was computed
11
+ * (conjunct (c)). A dirty-tree summary records `clean:false` and is NEVER
12
+ * a skip target (Codex r6 H — the dirty→clean-revert false-fresh hole).
13
+ * - `summaryInputHash` — a hash over the generation inputs (conjunct (d) —
14
+ * tier / body opt-in / user-ignore-file / generator version / caps). A
15
+ * mismatch forces a recompute AND a purge of the stale entry (the
16
+ * body-inclusion/ZK privacy fail-safe, Codex r7 H).
17
+ * - `summarySha256` — the content address of the summary this metadata was
18
+ * written FOR (Codex r2 BLOCKING — the crash-atomicity binding). The three
19
+ * store files are individually atomic but NOT atomic as a SET; binding the
20
+ * metadata to the summary sha lets the loader detect a summary↔metadata
21
+ * MISMATCH (e.g. a crash that renamed a new `summary.json` over an OLD
22
+ * `metadata.json`). Validated against `summary.sha256` on load (defense in
23
+ * depth alongside the `digest.txt` commit-marker ordering).
24
+ * - `schemaVersion` — v1 metadata is still loadable for migration, but it is
25
+ * never reused as fresh by the v2 probe.
26
+ */
27
+ export interface LegacyContextStoreMetadata {
28
+ schemaVersion: 1;
29
+ head: string | null;
30
+ clean: boolean;
31
+ summaryInputHash: string;
32
+ summarySha256: string;
33
+ writtenAt: string;
34
+ }
35
+ export interface RootFreshnessMetadata {
36
+ rootPath: string;
37
+ gitTopLevel?: string;
38
+ isGitRepo: boolean;
39
+ head?: string;
40
+ clean: boolean;
41
+ }
42
+ export interface ContextStoreMetadataV2 {
43
+ schemaVersion: 2;
44
+ workspaceRoot: string;
45
+ rootPaths: string[];
46
+ rootFreshness: RootFreshnessMetadata[];
47
+ summaryInputHash: string;
48
+ summarySha256: string;
49
+ writtenAt: string;
50
+ }
51
+ export type ContextStoreMetadata = LegacyContextStoreMetadata | ContextStoreMetadataV2;
52
+ /**
53
+ * The full context-store entry for a workspace, as loaded from disk. Returned
54
+ * by `loadContextStore`; `null` if the store does not exist / is unparseable.
55
+ */
56
+ export interface ContextStoreEntry {
57
+ workspaceId: string;
58
+ summary: StructuralSummary;
59
+ digest: string;
60
+ metadata: ContextStoreMetadata;
61
+ }
62
+ /**
63
+ * §5.4 — `slice_selector` is FORMALLY TYPED so the writer and the
64
+ * prompt-composer reader never serialize/expect different shapes. One entry
65
+ * per repo the track touches; `paths` are directory subtrees (relative to
66
+ * that repo root). Empty `paths` for a repo = "whole repo".
67
+ */
68
+ export interface SliceSelectorEntry {
69
+ repo_id: string;
70
+ /** Directory subtrees relative to that repo root. Empty = whole repo. */
71
+ paths: string[];
72
+ }
73
+ export type SliceSelector = SliceSelectorEntry[];
74
+ /**
75
+ * §4.2 / §5.4 — a content-addressed handle into the context store. This is a
76
+ * DESKTOP-ONLY object: it is resolved locally when composing an implementor's
77
+ * prompt and is NEVER serialized to the engine wire.
78
+ *
79
+ * - `workspaceId` — the local store key (§5.8).
80
+ * - `summary_sha256` — pins the EXACT summary version the ref was minted
81
+ * against (content-addressing — lets the desktop detect drift at resolve
82
+ * time, §4.2 resolve-time staleness contract).
83
+ * - `slice_selector` — which subtrees of the summary this track gets (§5.4).
84
+ */
85
+ export interface ContextRef {
86
+ workspaceId: string;
87
+ summary_sha256: string;
88
+ slice_selector: SliceSelector;
89
+ }
90
+ /**
91
+ * The resolved slice the prompt-composer feeds an implementor. Carries the
92
+ * repo summaries (optionally trimmed to the selector subtrees). The bytes
93
+ * here NEVER go on the engine wire (ZK).
94
+ */
95
+ export interface ResolvedContextSlice {
96
+ workspaceId: string;
97
+ summary_sha256: string;
98
+ repos: RepoSummary[];
99
+ /**
100
+ * True if the ref was minted against a since-changed summary and the slice
101
+ * was refreshed from the CURRENT summary at resolve time (§4.2 fail-safe-
102
+ * forward). Surfaced so callers can log/announce the refresh.
103
+ */
104
+ refreshedFromDrift: boolean;
105
+ }
106
+ /**
107
+ * §5.8 — `workspaceId = sha256(canonical_absolute_workspace_root_path).slice(0,16)`.
108
+ *
109
+ * Locally unique (distinct projects → distinct stores; closes the `"."`
110
+ * `repo_id` collision). Keyed on the canonical ABSOLUTE root path; the store
111
+ * lives OUTSIDE the repo so this never mutates the working tree. Carries no
112
+ * path bytes off-device (it is a hash). Cross-machine portability is post-v1.
113
+ *
114
+ * `absoluteWorkspaceRoot` is resolved to an absolute path defensively. Callers
115
+ * SHOULD pass an already-canonical (symlink-resolved) absolute root — use
116
+ * `canonicalizeRoot` (Codex r1 L1: a symlinked workspace path would otherwise
117
+ * split the same repo into two stores). `path.resolve` here only normalizes
118
+ * `.`/`..`/separators; it does NOT resolve symlinks, so canonicalization is the
119
+ * caller's job via `canonicalizeRoot`.
120
+ */
121
+ export declare function deriveWorkspaceId(absoluteWorkspaceRoot: string): string;
122
+ /**
123
+ * §5.8 — canonicalize a path to its real (symlink-resolved) absolute form
124
+ * before it feeds `deriveWorkspaceId` or the `rootPaths` half of
125
+ * `summary_input_hash` (Codex r1 L1). Without this, launching the SAME repo via
126
+ * a symlinked path (`/Users/x/proj` → `/Volumes/code/proj`) would derive a
127
+ * DIFFERENT `workspaceId` and split one repo into two stores (a cache miss +
128
+ * duplicate on-disk summaries). `fs.realpath` resolves the symlink chain; if it
129
+ * fails (ENOENT on a not-yet-created path, EACCES, etc.) we FALL BACK to
130
+ * `path.resolve` so the call never throws — a non-canonical key is still
131
+ * deterministic, it just may not coalesce a symlink alias.
132
+ */
133
+ export declare function canonicalizeRoot(p: string): Promise<string>;
134
+ /**
135
+ * §5.8 — `repo_id = sha256(relative_path_from_workspace_root)` (FULL digest),
136
+ * where the relative path is POSIX-normalized: forward slashes, leading `./`,
137
+ * `.\`, `/`, `\` prefixes stripped, no trailing slash, the single root repo
138
+ * canonicalized to `"."` (agy r8 L1 — a consistent leading-separator strip
139
+ * keeps the hash stable across `./repo` vs `repo` vs `/repo`).
140
+ *
141
+ * Uses Node's built-in `crypto.createHash('sha256')` — NOT blake3 (agy r4 M2:
142
+ * blake3 is not a codevibe-core dependency).
143
+ */
144
+ export declare function deriveRepoId(relativePathFromWorkspaceRoot: string): string;
145
+ /**
146
+ * §5.8 POSIX normalization for `repo_id` input. Exported for the §5/§6 REMAP
147
+ * (when it builds `slice_selector` repo entries) so writer + reader agree.
148
+ */
149
+ export declare function normalizeRepoRelativePath(relativePath: string): string;
150
+ /** `~/.codevibe/context/<workspaceId>/` — entirely under the user's home. */
151
+ export declare function contextStoreDir(workspaceId: string): string;
152
+ /**
153
+ * Persist a fresh summary + digest + metadata to the store.
154
+ *
155
+ * CRASH-ATOMICITY (Codex r2 BLOCKING — the dirty→clean false-fresh hole): the
156
+ * three per-file writes are individually atomic (tmp→fsync→rename) but NOT
157
+ * atomic as a SET. A crash BETWEEN renames could leave a NEW `summary.json`
158
+ * beside an OLD `metadata.json` — and if that recompute was over a DIRTY tree
159
+ * while the OLD metadata recorded `clean:true` at the same HEAD, the load would
160
+ * trust the stale `clean` and falsely reuse the dirty summary as fresh.
161
+ *
162
+ * The fix makes `digest.txt` the COMMIT MARKER:
163
+ * 1. write `summary.json` (atomic rename)
164
+ * 2. write `metadata.json` (atomic rename, carrying `summarySha256`)
165
+ * 3. write `digest.txt` (atomic rename — LAST; commits the set)
166
+ * Any crash before step 3 leaves `digest.txt` STALE-OR-MISSING. On load,
167
+ * `loadContextStore` requires `digest === summary.sha256` (and metadata's
168
+ * `summarySha256 === summary.sha256`), so a half-committed set fails validation
169
+ * → treated as not-fresh/corrupt → the caller recomputes. To make the
170
+ * stale-digest signal sound, we UNLINK any old `digest.txt` BEFORE writing the
171
+ * new summary/metadata, so a crash mid-set cannot leave an old digest that
172
+ * happens to equal the new summary's sha (it can't — different content) but
173
+ * also cannot leave a digest matching the OLD summary while the new summary is
174
+ * already in place. The marker is therefore: digest present AND == summary.sha
175
+ * ⇒ the full set committed.
176
+ *
177
+ * On any `summary_input_hash` change the caller passes `purgeFirst: true` so a
178
+ * stale body-including summary cannot linger on disk (§4.2 conjunct (d) — the
179
+ * PRIVACY fail-safe, Codex r7 H).
180
+ */
181
+ export declare function writeContextStore(deps: {
182
+ workspaceId: string;
183
+ summary: StructuralSummary;
184
+ metadata: ContextStoreMetadata;
185
+ purgeFirst?: boolean;
186
+ }): Promise<void>;
187
+ /**
188
+ * Load the store entry for a workspace. Returns `null` if any of the three
189
+ * files is missing / unparseable (the store is then treated as "missing" → a
190
+ * recompute). Defensive: a partially-written / corrupt file never throws.
191
+ */
192
+ export declare function loadContextStore(workspaceId: string): Promise<ContextStoreEntry | null>;
193
+ interface GitProbe {
194
+ isGitRepo: boolean;
195
+ gitTopLevel: string | null;
196
+ head: string | null;
197
+ /** True only when `git status --porcelain --untracked-files=all` is EMPTY. */
198
+ clean: boolean;
199
+ }
200
+ /**
201
+ * Hash the generation inputs (§4.2 conjunct (d)). A `StructuralSummary` is a
202
+ * pure function of `tree content × generation inputs`; this hashes the
203
+ * generation-inputs half so the cache is reusable only when BOTH the tree
204
+ * (conjuncts a–c) AND the inputs are unchanged.
205
+ *
206
+ * Inputs (per §4.2): `{rootPaths, tier, the Max body-inclusion opt-in result
207
+ * readOptIn(tier), the ~/.codevibe/structural-summary.ignore user-ignore file
208
+ * hash, the generator/schema version, the relevant CP-1.d caps}`.
209
+ *
210
+ * A mismatch is load-bearing AND privacy-critical: a Max user who removes a
211
+ * body opt-in path or downgrades tier leaves a clean-at-HEAD cached summary
212
+ * that STILL contains body bytes — reuse would feed those into a `context_ref`
213
+ * slice, violating the §1.3/§5.4 ZK boundary. So a mismatch forces recompute
214
+ * AND purge (Codex r7 H).
215
+ */
216
+ export declare function computeSummaryInputHash(deps: {
217
+ rootPaths: string[];
218
+ tier: Tier;
219
+ }): Promise<string>;
220
+ export interface FreshnessProbeResult {
221
+ /** True ONLY when all four conjuncts hold (provably reusable). */
222
+ fresh: boolean;
223
+ /**
224
+ * Why it was not fresh (for logging / tests). One of the four conjuncts, or
225
+ * `missing` (no cached entry), or `not-git` (sound non-git fallback).
226
+ */
227
+ reason: 'fresh' | 'missing' | 'metadata-schema-mismatch' | 'root-set-mismatch' | 'git-root-mismatch' | 'not-git' | 'dirty-tree' | 'head-moved' | 'cached-was-dirty' | 'input-hash-mismatch';
228
+ /** The live git probe (so the caller can persist `clean`/`head` on recompute). */
229
+ git: GitProbe;
230
+ /** Per-root live freshness facts to persist with the recomputed summary. */
231
+ rootFreshness: RootFreshnessMetadata[];
232
+ /** The freshly-computed input hash (so the caller can persist it on recompute). */
233
+ liveInputHash: string;
234
+ /**
235
+ * True when the input hash specifically changed — the caller MUST purge the
236
+ * stale entry before rewriting (the body-inclusion/ZK fail-safe). Distinct
237
+ * from a plain tree-drift recompute (which can overwrite-in-place).
238
+ */
239
+ inputHashChanged: boolean;
240
+ }
241
+ /**
242
+ * §4.2 — the provably-sound + cheap staleness probe. Returns `fresh:true` ONLY
243
+ * when ALL FOUR conjuncts hold:
244
+ *
245
+ * (a) each current git root worktree is clean (`git status --porcelain
246
+ * --untracked-files=all` EMPTY);
247
+ * (b) each live root's HEAD + git top-level equals the record in metadata;
248
+ * (c) every cached root summary was ITSELF computed over a clean tree
249
+ * (`rootFreshness[].clean === true` — the dirty→clean-revert hole);
250
+ * (d) the generation inputs are unchanged (`summary_input_hash` matches —
251
+ * tier / body opt-in / user-ignore / generator version / caps, Codex r7 H).
252
+ *
253
+ * Any failing conjunct ⇒ NOT provably fresh ⇒ recompute. A non-git tree never
254
+ * skips. The invariant: only a clean tree, at the same HEAD, whose cached
255
+ * summary was also clean-at-that-HEAD AND generated under the same inputs,
256
+ * skips; everything else recomputes (fail-safe toward "never stale" + the
257
+ * body-inclusion/ZK boundary).
258
+ */
259
+ export declare function probeFreshness(deps: {
260
+ workspaceRoot: string;
261
+ rootPaths: string[];
262
+ tier: Tier;
263
+ cached: ContextStoreEntry | null;
264
+ }): Promise<FreshnessProbeResult>;
265
+ export interface EnsureFreshResult {
266
+ /** The current (possibly-refreshed) summary digest — `''` if unavailable. */
267
+ digest: string;
268
+ /** The workspace id keying the store. */
269
+ workspaceId: string;
270
+ /** True if a recompute ran this call; false if the cached entry was reused. */
271
+ recomputed: boolean;
272
+ /** The probe outcome (for logging / surfacing). */
273
+ reason: FreshnessProbeResult['reason'];
274
+ /**
275
+ * The (possibly-refreshed) structural summary — the SAME object that was
276
+ * persisted to / reused from the store, so a caller (session-start /
277
+ * familiarize) can dispatch it to the orchestration store WITHOUT a SECOND
278
+ * generator walk (Codex r1 M1 — the double-walk unify). `null` when the
279
+ * refresh failed (`error` set) — the caller then renders the failure floor.
280
+ */
281
+ summary: StructuralSummary | null;
282
+ /**
283
+ * Set when the refresh FAILED (e.g. unreadable tree). The pre-classify
284
+ * caller surfaces this as the only `ask_user` case (§4.2 — "the only
285
+ * `ask_user` case is a refresh that fails"); a stale digest is NEVER
286
+ * proceeded with. `null` on success.
287
+ */
288
+ error: string | null;
289
+ }
290
+ export interface EnsureFreshDeps {
291
+ workspaceRoot: string;
292
+ rootPaths: string[];
293
+ tier: Tier;
294
+ userId: string;
295
+ generator: StructuralSummaryGenerator;
296
+ /** Test seam — defaults to the real `probeFreshness`. */
297
+ probeFreshnessFn?: typeof probeFreshness;
298
+ /** Test seam — defaults to the real `loadContextStore`. */
299
+ loadContextStoreFn?: typeof loadContextStore;
300
+ /** Test seam — defaults to the real `writeContextStore`. */
301
+ writeContextStoreFn?: typeof writeContextStore;
302
+ /** Test seam for the strict privacy purge path. */
303
+ purgeContextStoreFilesStrictFn?: (dir: string) => Promise<void>;
304
+ }
305
+ /**
306
+ * §4.2 — the DESKTOP PRE-CLASSIFY refresh. Called UNCONDITIONALLY before every
307
+ * `classify` (the planner action is not yet known — it's pre-classify), gated
308
+ * by the cheap-but-SOUND staleness probe. This is what makes auto-refresh
309
+ * reachable given the shipped Lambda digest-gate (Codex r2 H2): the hosted
310
+ * planner overrides `start_task`/`team_decompose` → `ask_user` when the digest
311
+ * is empty, and the desktop sends the digest from current store state — so the
312
+ * desktop MUST populate the digest BEFORE the classify.
313
+ *
314
+ * Sequence (§4.2 (1)→(2)→(3)):
315
+ * (1) load the cached entry + run the 4-conjunct probe.
316
+ * (2) if not provably-fresh, run the bounded structural-summary walk to
317
+ * recompute (cheap, NOT free) + persist {summary, digest, metadata};
318
+ * a `summary_input_hash` mismatch purges the stale entry first.
319
+ * (3) return the (possibly-refreshed) digest so the caller writes it into
320
+ * the classify packet's `sessionContext`.
321
+ *
322
+ * Best-effort but FAIL-CLOSED on the digest: a recompute failure returns
323
+ * `error` set + `digest:''` (NOT a stale digest) so the caller can `ask_user`
324
+ * rather than mint a `context_ref` that resolves to a since-changed summary.
325
+ */
326
+ export declare function ensureFreshContextStore(deps: EnsureFreshDeps): Promise<EnsureFreshResult>;
327
+ /**
328
+ * Mint a `context_ref` for a track. Content-addressed: pins the EXACT
329
+ * `summary_sha256` so drift is detectable at resolve time. DESKTOP-ONLY — the
330
+ * returned object is NEVER serialized to the engine wire.
331
+ *
332
+ * `slice_selector` is supplied by the §5/§6 REMAP (the decomposer that knows
333
+ * each track's `ownership_hint.write_paths` + `shared_contracts`). v1 here
334
+ * provides the substrate; an empty `slice_selector` = whole workspace (the
335
+ * degenerate single-track familiarize-everything case, §5.4).
336
+ *
337
+ * CONTRACT (Stage-1 r1 LOW — the canonicalization invariant): `workspaceId` MUST
338
+ * be the CANONICAL id (`deriveWorkspaceId(await canonicalizeRoot(root))`).
339
+ * `resolveContextRef` loads by `ref.workspaceId`, while `ensureFreshContextStore`
340
+ * writes under the canonical id — a non-canonical (symlink-aliased) `workspaceId`
341
+ * here would resolve to the wrong / missing store. There is no production mint
342
+ * site yet (the §5/§6 REMAP that mints refs is CP-14 territory); when it lands,
343
+ * canonicalize at every mint call site.
344
+ */
345
+ export declare function mintContextRef(deps: {
346
+ /** MUST be canonical — `deriveWorkspaceId(await canonicalizeRoot(root))`. */
347
+ workspaceId: string;
348
+ summary_sha256: string;
349
+ slice_selector?: SliceSelector;
350
+ }): ContextRef;
351
+ /**
352
+ * §4.2 resolve-time staleness contract (the decompose→dispatch window) +
353
+ * §5.4 slicing. Resolve a `context_ref` into the slice the prompt-composer
354
+ * feeds an implementor, locally, on the desktop. The slice bytes NEVER go on
355
+ * the engine wire (ZK).
356
+ *
357
+ * Because `context_ref` pins `summary_sha256`, the desktop detects when the
358
+ * tree changed between mint (decompose) and resolve (prompt-compose). v1
359
+ * contract (FAIL-SAFE-FORWARD): if the live summary has drifted from the
360
+ * pinned `summary_sha256`, refresh the slice from the CURRENT summary before
361
+ * composing — the implementor always gets a slice consistent with the tree it
362
+ * will actually edit (never a slice from a since-changed summary). The refresh
363
+ * is gated by the SAME sound staleness probe (no model call when the sha256 is
364
+ * unchanged).
365
+ */
366
+ export declare function resolveContextRef(deps: {
367
+ ref: ContextRef;
368
+ workspaceRoot: string;
369
+ rootPaths: string[];
370
+ tier: Tier;
371
+ userId: string;
372
+ generator: StructuralSummaryGenerator;
373
+ /** Test seam — defaults to the real `ensureFreshContextStore`. */
374
+ ensureFreshFn?: typeof ensureFreshContextStore;
375
+ /** Test seam — defaults to the real `loadContextStore`. */
376
+ loadContextStoreFn?: typeof loadContextStore;
377
+ }): Promise<ResolvedContextSlice>;
378
+ /**
379
+ * §5.4 — slice a `StructuralSummary` down to the selector's repo+path
380
+ * subtrees. One selector entry per repo (keyed by `repo_id`); `paths` are
381
+ * directory subtrees relative to that repo root; empty `paths` = whole repo.
382
+ *
383
+ * An empty `slice_selector` (no entries at all) = the whole workspace (the
384
+ * degenerate familiarize-everything case). A repo summary's manifest /
385
+ * dependency block is ALWAYS retained (included implicitly by the resolver,
386
+ * §5.4) — only the `directoryTree` is trimmed to the selected subtrees.
387
+ */
388
+ export declare function sliceSummary(summary: StructuralSummary, selector: SliceSelector, workspaceRoot?: string): RepoSummary[];
389
+ export {};
@@ -0,0 +1,84 @@
1
+ import type { Dirent, Stats } from 'node:fs';
2
+ import type { runShellCommand } from '../local-executor/verification-gates/shell-runner';
3
+ import type { ShadowDiffFile } from '../local-executor/workspace-shadow';
4
+ /** Default per-file wall-clock budget for a declared-test `node` run. */
5
+ export declare const DECLARED_TEST_TIMEOUT_MS = 300000;
6
+ /**
7
+ * CLOSED reason set (Codex-r2-4 / LOCK #598-6) — every surfaced reason is one of
8
+ * these FIXED labels; a raw exception message is NEVER surfaced. The `<ext>` /
9
+ * `N` placeholders are filled with the user-owned extension / the integer exit
10
+ * code respectively (both safe — the user owns the workspace), never with
11
+ * arbitrary error text.
12
+ */
13
+ export type DeclaredTestReason = `test failed (exit ${number})` | 'timed out' | `no supported runner for ${string}` | 'path outside workspace' | 'path could not be inspected' | 'test runner failed to start' | 'declared test was deleted' | `test framework ${string} not available`;
14
+ export interface DeclaredTestResult {
15
+ outcome: 'pass' | 'fail' | 'no_tests_run';
16
+ /** On 'fail': first failing/unexecutable file (workspace-relative). */
17
+ failingPath?: string;
18
+ reason?: DeclaredTestReason;
19
+ /** Executed files. */
20
+ ranCount: number;
21
+ /** Never-written declared file / empty-or-JS-less declared dir (§3.D, VISIBLE). */
22
+ skipped: string[];
23
+ }
24
+ export interface RunDeclaredTestSurfacesArgs {
25
+ /** cwd holding the agent's changes (the shadow root). */
26
+ shadowDir: string;
27
+ /** Workspace-relative declared test paths. */
28
+ testSurfaces: string[];
29
+ /** Workspace-rel paths the diff marked `change_kind:'deleted'` (Codex-r2-3). */
30
+ deletedPaths: string[];
31
+ trackIndex: number;
32
+ /** Injected (test seam) — the verification subprocess primitive. */
33
+ runShell: typeof runShellCommand;
34
+ /** Injected — existence + symlink discriminate (no-follow). */
35
+ lstat: (p: string) => Promise<Stats>;
36
+ /** Injected — symlink-following containment. */
37
+ realpath: (p: string) => Promise<string>;
38
+ /** Injected — file/dir discriminate on the resolved target. */
39
+ stat: (p: string) => Promise<Stats>;
40
+ /** Injected — directory expansion. */
41
+ readdir: (p: string) => Promise<Dirent[]>;
42
+ /**
43
+ * Injected (#609) — read a file's UTF-8 contents (nearest-`package.json` framework detection).
44
+ * A throw (ENOENT / EISDIR / unreadable) is TOTAL-handled by `detectFramework` (→ keep walking up,
45
+ * else fall back to the bare-`node` runner); it never propagates a raw error.
46
+ */
47
+ readFile: (p: string) => Promise<string>;
48
+ /** Default `DECLARED_TEST_TIMEOUT_MS`. */
49
+ timeoutMs?: number;
50
+ }
51
+ /**
52
+ * Canonicalize a declared scope / diff path for comparison: collapse backslashes to
53
+ * POSIX `/`, strip a leading `./`, strip trailing `/`. A `''` result matches nothing.
54
+ *
55
+ * SINGLE SOURCE OF TRUTH (Codex impl-r1 HIGH) — `quorum-loop.ts`'s `filesOutsideWriteScope`
56
+ * imports THIS function so the write-scope guard and the declared-test executor's deletion
57
+ * guard + classification cannot drift. A non-canonical declared surface (e.g. `./test/track0/`
58
+ * or `test\track0\`) that the diff guard accepts in-scope MUST normalize identically here, or
59
+ * a captured deletion `test/track0/b.test.js` would slip past the deletion guard.
60
+ */
61
+ export declare function normalizeScopePath(rel: string): string;
62
+ /**
63
+ * REVIEW-INTEGRITY DRIFT (Codex impl-r4 HIGH / LOCK #598-10) — the workspace-relative
64
+ * paths that DIFFER between two captured shadow diffs: a path present in one set but not
65
+ * the other, or present in both with a changed `change_kind` or `content`.
66
+ *
67
+ * LOAD-BEARING. The declared-test executor runs agent-authored `node <file>` with
68
+ * `cwd: shadowDir`, which can MUTATE the shadow (write / delete / modify) AFTER the
69
+ * reviewed diff was captured. Promotion re-captures the LIVE shadow and applies THAT, so a
70
+ * post-test mutation would be promoted though reviewers + the user only ever approved the
71
+ * pre-test diff (and a test-time deletion would dodge the `deletedPaths` guard). The caller
72
+ * re-captures after the test gate and FAILS the round when this returns non-empty — a
73
+ * declared test must be PURE. Content-SAFE: returns PATHS only, never file content (the user
74
+ * owns the workspace, so paths are permitted on the surface; content is NOT). Sorted for a
75
+ * stable, deterministic surface.
76
+ */
77
+ export declare function shadowDiffDrift(before: ShadowDiffFile[], after: ShadowDiffFile[]): string[];
78
+ /**
79
+ * Run a team track's declared `test_surfaces` against the shadow (the agent's
80
+ * uncommitted changes). Pure free function with injected deps (fully mockable —
81
+ * agy-4). First failure / hard-fail WINS (short-circuit). See the module-level
82
+ * invariants.
83
+ */
84
+ export declare function runDeclaredTestSurfaces(args: RunDeclaredTestSurfacesArgs): Promise<DeclaredTestResult>;
@@ -0,0 +1,64 @@
1
+ import { AppSyncClient } from '../appsync';
2
+ /**
3
+ * §3 LOCK lines 173-181. Names + per-type metadata shapes are part of
4
+ * the Stage A contract. CP-1.a ships the union; CP-1.b/c/d add call
5
+ * sites for each emit type.
6
+ */
7
+ export type NewEventTypeKind = 'MODE_SELECTED' | 'PLANNER_DECISION' | 'PLANNER_CACHE_HIT' | 'PLANNER_DEGRADED' | 'PLANNER_OUTAGE' | 'PLANNER_RECOVERED' | 'SLASH_COMMAND_INVOKED' | 'STRUCTURAL_SUMMARY_GENERATED' | 'LOCAL_AUTHORITY_REFUSAL' | 'NOTIFICATION' | 'ASSISTANT_RESPONSE';
8
+ /**
9
+ * §3 LOCK lines 160-170. ShellEventEmit contract.
10
+ *
11
+ * Per Stage 2 r1 Codex HIGH-2: `source` and `isEncrypted` MUST be
12
+ * present on every call. The Stage A LOCK on §3 fixes both: every CP-1
13
+ * shell event is DESKTOP-sourced and E2E-encrypted under the session
14
+ * key. Making them required (vs optional) prevents accidental plaintext
15
+ * fall-through if a caller forgets either field.
16
+ */
17
+ export interface ShellEventEmit {
18
+ /** Current Session.sessionId; orchestration shell tracks this. */
19
+ sessionId: string;
20
+ /** One of the 9 new EventType enums (plus NOTIFICATION reuse). */
21
+ type: NewEventTypeKind;
22
+ /** Shell is desktop-side; mobile uses its own emit path. REQUIRED. */
23
+ source: 'DESKTOP';
24
+ /** Human-readable summary; encrypted under session key. */
25
+ content?: string;
26
+ /** Event-specific structured payload; encrypted; per-type shape per §3. */
27
+ metadata?: Record<string, unknown>;
28
+ /** All CP-1 shell events are E2E encrypted per existing pattern. REQUIRED. */
29
+ isEncrypted: true;
30
+ /** RFC3339; if omitted, server fills in via existing VTL. */
31
+ timestamp?: string;
32
+ }
33
+ /**
34
+ * Test seam — allows the unit tests to swap the AppSync client without
35
+ * mounting the full singleton. Production code calls
36
+ * `emitShellEvent(args)` which uses `getDefaultClient()`.
37
+ */
38
+ export interface EmitShellEventDeps {
39
+ appsyncClient: Pick<AppSyncClient, 'createEvent'>;
40
+ getSessionKey: (sessionId: string) => Promise<string | null>;
41
+ getCohortFlag: (name: string, sessionId: string) => Promise<boolean>;
42
+ }
43
+ /**
44
+ * §3 LOCK lines 184-207. Single chokepoint enforcing the cohort-flag
45
+ * gate + encryption invariants for all 9 new EventTypes.
46
+ *
47
+ * When the cohort flag is off: log at debug and return without
48
+ * touching AppSync. When on: encrypt content + metadata under the
49
+ * session key, call `createEvent` via Pattern B Lambda resolver
50
+ * (existing surface, no schema change).
51
+ *
52
+ * `deps` is the test seam. Production callers omit it and the function
53
+ * resolves the default `keychainManager` + `cryptoService` references.
54
+ * The AppSync client is REQUIRED — there is no global default in
55
+ * codevibe-core (each plugin instantiates its own `AppSyncClient`).
56
+ */
57
+ export declare function emitShellEvent(args: ShellEventEmit, deps: EmitShellEventDeps): Promise<void>;
58
+ /**
59
+ * Convenience helper for production callers — binds default
60
+ * dependencies (`keychainManager` for session-key lookup,
61
+ * `getCohortFlag` for the flag read) and accepts the AppSync client
62
+ * separately because there's no global default in `codevibe-core`.
63
+ */
64
+ export declare function createShellEventEmitter(appsyncClient: Pick<AppSyncClient, 'createEvent'>): (args: ShellEventEmit) => Promise<void>;