@quantiya/codevibe-claude-plugin 2.0.7 → 2.0.8

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 (304) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/dist/server.js +11 -11
  3. package/node_modules/@quantiya/codevibe-core/dist/appsync/appsync-client.d.ts +170 -30
  4. package/node_modules/@quantiya/codevibe-core/dist/appsync/queries.d.ts +2 -0
  5. package/node_modules/@quantiya/codevibe-core/dist/auth/__tests__/keychain-cli.test.d.ts +1 -0
  6. package/node_modules/@quantiya/codevibe-core/dist/auth/keychain-cli.d.ts +6 -0
  7. package/node_modules/@quantiya/codevibe-core/dist/companion-mode/index.d.ts +14 -0
  8. package/node_modules/@quantiya/codevibe-core/dist/credential-broker/oauth-account-lock.d.ts +47 -1
  9. package/node_modules/@quantiya/codevibe-core/dist/crypto/__tests__/open-prompt-id.test.d.ts +1 -0
  10. package/node_modules/@quantiya/codevibe-core/dist/crypto/index.d.ts +1 -0
  11. package/node_modules/@quantiya/codevibe-core/dist/crypto/open-prompt-id.d.ts +36 -0
  12. package/node_modules/@quantiya/codevibe-core/dist/e1/__tests__/prompt-raise.test.d.ts +1 -0
  13. package/node_modules/@quantiya/codevibe-core/dist/e1/index.d.ts +2 -0
  14. package/node_modules/@quantiya/codevibe-core/dist/e1/prompt-raise.d.ts +65 -0
  15. package/node_modules/@quantiya/codevibe-core/dist/index.d.ts +4 -1
  16. package/node_modules/@quantiya/codevibe-core/dist/index.js +4480 -252
  17. package/node_modules/@quantiya/codevibe-core/dist/keychain/__tests__/keychain-manager.test.d.ts +1 -0
  18. package/node_modules/@quantiya/codevibe-core/dist/keychain/__tests__/keychain-migrate.test.d.ts +1 -0
  19. package/node_modules/@quantiya/codevibe-core/dist/keychain/keychain-backend.d.ts +105 -0
  20. package/node_modules/@quantiya/codevibe-core/dist/keychain/keychain-manager.d.ts +17 -3
  21. package/node_modules/@quantiya/codevibe-core/dist/keychain/keychain-migrate.d.ts +46 -0
  22. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/anchored-fs.test.d.ts +1 -0
  23. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/bounded-directory.test.d.ts +1 -0
  24. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/bounded-output.test.d.ts +1 -0
  25. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/durable-directory.test.d.ts +1 -0
  26. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/hosted-class-a-sink.test.d.ts +1 -0
  27. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/process-identity.test.d.ts +1 -0
  28. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/process-tree.test.d.ts +1 -0
  29. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/publication-authority-capability.test.d.ts +1 -0
  30. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/snapshot-merge.test.d.ts +1 -0
  31. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/workspace-authority-fixture.d.ts +3 -0
  32. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/workspace-authority.test.d.ts +1 -0
  33. package/node_modules/@quantiya/codevibe-core/dist/local-executor/__tests__/workspace-materializer.test.d.ts +1 -0
  34. package/node_modules/@quantiya/codevibe-core/dist/local-executor/agentic-disposable-repo.d.ts +23 -6
  35. package/node_modules/@quantiya/codevibe-core/dist/local-executor/agentic-resolve.d.ts +16 -0
  36. package/node_modules/@quantiya/codevibe-core/dist/local-executor/anchored-fs.d.ts +243 -0
  37. package/node_modules/@quantiya/codevibe-core/dist/local-executor/bounded-directory.d.ts +64 -0
  38. package/node_modules/@quantiya/codevibe-core/dist/local-executor/bounded-helper.d.ts +22 -0
  39. package/node_modules/@quantiya/codevibe-core/dist/local-executor/bounded-output.d.ts +11 -0
  40. package/node_modules/@quantiya/codevibe-core/dist/local-executor/class-a-emit.d.ts +13 -1
  41. package/node_modules/@quantiya/codevibe-core/dist/local-executor/durable-directory.d.ts +25 -0
  42. package/node_modules/@quantiya/codevibe-core/dist/local-executor/durable-store.d.ts +217 -25
  43. package/node_modules/@quantiya/codevibe-core/dist/local-executor/hosted-class-a-sink.d.ts +27 -0
  44. package/node_modules/@quantiya/codevibe-core/dist/local-executor/index.d.ts +3 -2
  45. package/node_modules/@quantiya/codevibe-core/dist/local-executor/local-executor-impl.d.ts +159 -69
  46. package/node_modules/@quantiya/codevibe-core/dist/local-executor/process-identity.d.ts +16 -0
  47. package/node_modules/@quantiya/codevibe-core/dist/local-executor/process-tree.d.ts +123 -0
  48. package/node_modules/@quantiya/codevibe-core/dist/local-executor/revert-reconcile.d.ts +4 -0
  49. package/node_modules/@quantiya/codevibe-core/dist/local-executor/revert-runner.d.ts +14 -1
  50. package/node_modules/@quantiya/codevibe-core/dist/local-executor/snapshot-merge.d.ts +124 -0
  51. package/node_modules/@quantiya/codevibe-core/dist/local-executor/task-group-types.d.ts +7 -6
  52. package/node_modules/@quantiya/codevibe-core/dist/local-executor/team-execution-flag.d.ts +2 -2
  53. package/node_modules/@quantiya/codevibe-core/dist/local-executor/track-registry.d.ts +2 -0
  54. package/node_modules/@quantiya/codevibe-core/dist/local-executor/types.d.ts +33 -2
  55. package/node_modules/@quantiya/codevibe-core/dist/local-executor/verification-gates/build.d.ts +5 -0
  56. package/node_modules/@quantiya/codevibe-core/dist/local-executor/verification-gates/deploy-preflight.d.ts +2 -0
  57. package/node_modules/@quantiya/codevibe-core/dist/local-executor/verification-gates/diff-sanity.d.ts +12 -0
  58. package/node_modules/@quantiya/codevibe-core/dist/local-executor/verification-gates/hostile-grep.d.ts +2 -0
  59. package/node_modules/@quantiya/codevibe-core/dist/local-executor/verification-gates/lint.d.ts +2 -0
  60. package/node_modules/@quantiya/codevibe-core/dist/local-executor/verification-gates/shell-runner.d.ts +5 -0
  61. package/node_modules/@quantiya/codevibe-core/dist/local-executor/verification-gates/source-traceability.d.ts +2 -0
  62. package/node_modules/@quantiya/codevibe-core/dist/local-executor/verification-gates/tests.d.ts +3 -0
  63. package/node_modules/@quantiya/codevibe-core/dist/local-executor/verification-gates/typecheck.d.ts +3 -0
  64. package/node_modules/@quantiya/codevibe-core/dist/local-executor/verification-runner.d.ts +6 -0
  65. package/node_modules/@quantiya/codevibe-core/dist/local-executor/workspace-authority.d.ts +45 -0
  66. package/node_modules/@quantiya/codevibe-core/dist/local-executor/workspace-materializer.d.ts +27 -0
  67. package/node_modules/@quantiya/codevibe-core/dist/local-executor/workspace-shadow.d.ts +378 -85
  68. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/__tests__/advisory-attachment-journal.test.d.ts +1 -0
  69. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/__tests__/planner-offer-e1.test.d.ts +1 -0
  70. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/__tests__/workspace-shutdown.test.d.ts +1 -0
  71. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/advisory-attachment-journal.d.ts +165 -0
  72. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/attachments.d.ts +47 -58
  73. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/bounded-shutdown.d.ts +6 -0
  74. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/cli.js +36938 -27120
  75. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/declared-test-runner.d.ts +21 -2
  76. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/emit-shell-event.d.ts +7 -0
  77. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/explicit-tty-exit.d.ts +1 -2
  78. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/gate-decision-submit.d.ts +11 -0
  79. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/gate-prompts.d.ts +75 -0
  80. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/index.d.ts +3 -0
  81. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/planner-offer-e1.d.ts +97 -0
  82. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/quorum-loop.d.ts +270 -60
  83. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/reducer.d.ts +9 -0
  84. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/task-progress.d.ts +15 -4
  85. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/team-decompose.d.ts +10 -10
  86. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/types.d.ts +32 -2
  87. package/node_modules/@quantiya/codevibe-core/dist/orchestration-shell/workspace-shutdown.d.ts +27 -0
  88. package/node_modules/@quantiya/codevibe-core/dist/reviewer/output-parser.d.ts +19 -0
  89. package/node_modules/@quantiya/codevibe-core/dist/reviewer/types.d.ts +3 -0
  90. package/node_modules/@quantiya/codevibe-core/dist/reviewer/verdict-classifier.d.ts +1 -0
  91. package/node_modules/@quantiya/codevibe-core/dist/session/session-rekey.d.ts +4 -3
  92. package/node_modules/@quantiya/codevibe-core/dist/substrate/command-runner.d.ts +2 -0
  93. package/node_modules/@quantiya/codevibe-core/dist/substrate/docker.d.ts +7 -32
  94. package/node_modules/@quantiya/codevibe-core/dist/substrate/index.d.ts +0 -1
  95. package/node_modules/@quantiya/codevibe-core/dist/substrate/sandbox-exec.d.ts +0 -13
  96. package/node_modules/@quantiya/codevibe-core/dist/substrate/types.d.ts +7 -2
  97. package/node_modules/@quantiya/codevibe-core/dist/substrate-launch/__tests__/reviewer-credential-preflight.test.d.ts +1 -0
  98. package/node_modules/@quantiya/codevibe-core/dist/substrate-launch/engage-substrate.d.ts +3 -0
  99. package/node_modules/@quantiya/codevibe-core/dist/substrate-launch/index.d.ts +2 -0
  100. package/node_modules/@quantiya/codevibe-core/dist/substrate-launch/reviewer-credential-preflight.d.ts +50 -0
  101. package/node_modules/@quantiya/codevibe-core/dist/test-publication-authority-setup.d.ts +1 -0
  102. package/node_modules/@quantiya/codevibe-core/dist/tool-activity/replay-cursor.d.ts +42 -8
  103. package/node_modules/@quantiya/codevibe-core/dist/types/encryption.d.ts +5 -0
  104. package/node_modules/@quantiya/codevibe-core/dist/types/events.d.ts +5 -0
  105. package/node_modules/@quantiya/codevibe-core/package.json +3 -3
  106. package/node_modules/es-toolkit/CHANGELOG.md +46 -0
  107. package/node_modules/es-toolkit/dist/array/partition.d.mts +5 -4
  108. package/node_modules/es-toolkit/dist/array/partition.d.ts +5 -4
  109. package/node_modules/es-toolkit/dist/array/unzipWith.js +1 -1
  110. package/node_modules/es-toolkit/dist/array/unzipWith.mjs +1 -1
  111. package/node_modules/es-toolkit/dist/browser.global.js +3 -3
  112. package/node_modules/es-toolkit/dist/compat/_internal/ListIterateeCustom.d.mts +3 -2
  113. package/node_modules/es-toolkit/dist/compat/_internal/ListIterateeCustom.d.ts +3 -2
  114. package/node_modules/es-toolkit/dist/compat/_internal/assignValue.js +2 -3
  115. package/node_modules/es-toolkit/dist/compat/_internal/assignValue.mjs +2 -3
  116. package/node_modules/es-toolkit/dist/compat/_internal/createPadding.js +14 -0
  117. package/node_modules/es-toolkit/dist/compat/_internal/createPadding.mjs +13 -0
  118. package/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.js +14 -1
  119. package/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs +14 -1
  120. package/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.js +2 -3
  121. package/node_modules/es-toolkit/dist/compat/_internal/isIterateeCall.mjs +2 -3
  122. package/node_modules/es-toolkit/dist/compat/_internal/regexMultiByte.js +11 -0
  123. package/node_modules/es-toolkit/dist/compat/_internal/regexMultiByte.mjs +11 -0
  124. package/node_modules/es-toolkit/dist/compat/array/every.js +5 -24
  125. package/node_modules/es-toolkit/dist/compat/array/every.mjs +5 -24
  126. package/node_modules/es-toolkit/dist/compat/array/filter.d.mts +7 -3
  127. package/node_modules/es-toolkit/dist/compat/array/filter.d.ts +7 -3
  128. package/node_modules/es-toolkit/dist/compat/array/filter.js +11 -11
  129. package/node_modules/es-toolkit/dist/compat/array/filter.mjs +11 -11
  130. package/node_modules/es-toolkit/dist/compat/array/find.d.mts +10 -6
  131. package/node_modules/es-toolkit/dist/compat/array/find.d.ts +10 -6
  132. package/node_modules/es-toolkit/dist/compat/array/find.js +1 -1
  133. package/node_modules/es-toolkit/dist/compat/array/find.mjs +1 -1
  134. package/node_modules/es-toolkit/dist/compat/array/findIndex.d.mts +0 -1
  135. package/node_modules/es-toolkit/dist/compat/array/findIndex.d.ts +0 -1
  136. package/node_modules/es-toolkit/dist/compat/array/findIndex.js +2 -1
  137. package/node_modules/es-toolkit/dist/compat/array/findIndex.mjs +2 -1
  138. package/node_modules/es-toolkit/dist/compat/array/findLast.d.mts +1 -1
  139. package/node_modules/es-toolkit/dist/compat/array/findLast.d.ts +1 -1
  140. package/node_modules/es-toolkit/dist/compat/array/findLast.js +12 -12
  141. package/node_modules/es-toolkit/dist/compat/array/findLast.mjs +12 -12
  142. package/node_modules/es-toolkit/dist/compat/array/findLastIndex.js +1 -0
  143. package/node_modules/es-toolkit/dist/compat/array/findLastIndex.mjs +1 -0
  144. package/node_modules/es-toolkit/dist/compat/array/flatMap.js +3 -2
  145. package/node_modules/es-toolkit/dist/compat/array/flatMap.mjs +3 -2
  146. package/node_modules/es-toolkit/dist/compat/array/flatMapDepth.js +2 -2
  147. package/node_modules/es-toolkit/dist/compat/array/flatMapDepth.mjs +2 -2
  148. package/node_modules/es-toolkit/dist/compat/array/flatten.d.mts +4 -5
  149. package/node_modules/es-toolkit/dist/compat/array/flatten.d.ts +4 -5
  150. package/node_modules/es-toolkit/dist/compat/array/flatten.js +14 -15
  151. package/node_modules/es-toolkit/dist/compat/array/flatten.mjs +14 -15
  152. package/node_modules/es-toolkit/dist/compat/array/flattenDeep.d.mts +1 -1
  153. package/node_modules/es-toolkit/dist/compat/array/flattenDeep.d.ts +1 -1
  154. package/node_modules/es-toolkit/dist/compat/array/flattenDeep.js +2 -2
  155. package/node_modules/es-toolkit/dist/compat/array/flattenDeep.mjs +2 -2
  156. package/node_modules/es-toolkit/dist/compat/array/flattenDepth.js +18 -2
  157. package/node_modules/es-toolkit/dist/compat/array/flattenDepth.mjs +18 -2
  158. package/node_modules/es-toolkit/dist/compat/array/groupBy.js +5 -4
  159. package/node_modules/es-toolkit/dist/compat/array/groupBy.mjs +4 -3
  160. package/node_modules/es-toolkit/dist/compat/array/includes.js +8 -3
  161. package/node_modules/es-toolkit/dist/compat/array/includes.mjs +8 -3
  162. package/node_modules/es-toolkit/dist/compat/array/intersectionBy.js +12 -5
  163. package/node_modules/es-toolkit/dist/compat/array/intersectionBy.mjs +12 -5
  164. package/node_modules/es-toolkit/dist/compat/array/intersectionWith.js +2 -3
  165. package/node_modules/es-toolkit/dist/compat/array/intersectionWith.mjs +2 -3
  166. package/node_modules/es-toolkit/dist/compat/array/invokeMap.js +3 -7
  167. package/node_modules/es-toolkit/dist/compat/array/invokeMap.mjs +3 -4
  168. package/node_modules/es-toolkit/dist/compat/array/lastIndexOf.js +3 -2
  169. package/node_modules/es-toolkit/dist/compat/array/lastIndexOf.mjs +3 -2
  170. package/node_modules/es-toolkit/dist/compat/array/nth.js +2 -2
  171. package/node_modules/es-toolkit/dist/compat/array/nth.mjs +2 -2
  172. package/node_modules/es-toolkit/dist/compat/array/pullAllWith.js +2 -3
  173. package/node_modules/es-toolkit/dist/compat/array/pullAllWith.mjs +2 -3
  174. package/node_modules/es-toolkit/dist/compat/array/size.js +2 -0
  175. package/node_modules/es-toolkit/dist/compat/array/size.mjs +2 -0
  176. package/node_modules/es-toolkit/dist/compat/array/sortedIndexOf.js +2 -3
  177. package/node_modules/es-toolkit/dist/compat/array/sortedIndexOf.mjs +2 -3
  178. package/node_modules/es-toolkit/dist/compat/array/sortedLastIndexOf.js +2 -3
  179. package/node_modules/es-toolkit/dist/compat/array/sortedLastIndexOf.mjs +2 -3
  180. package/node_modules/es-toolkit/dist/compat/compat.d.mts +4 -3
  181. package/node_modules/es-toolkit/dist/compat/compat.d.ts +4 -3
  182. package/node_modules/es-toolkit/dist/compat/compat.js +10 -11
  183. package/node_modules/es-toolkit/dist/compat/compat.mjs +10 -11
  184. package/node_modules/es-toolkit/dist/compat/index.d.mts +4 -3
  185. package/node_modules/es-toolkit/dist/compat/index.d.ts +4 -3
  186. package/node_modules/es-toolkit/dist/compat/index.js +10 -9
  187. package/node_modules/es-toolkit/dist/compat/index.mjs +10 -9
  188. package/node_modules/es-toolkit/dist/compat/math/inRange.d.mts +5 -2
  189. package/node_modules/es-toolkit/dist/compat/math/inRange.d.ts +5 -2
  190. package/node_modules/es-toolkit/dist/compat/math/inRange.js +14 -11
  191. package/node_modules/es-toolkit/dist/compat/math/inRange.mjs +14 -11
  192. package/node_modules/es-toolkit/dist/compat/math/maxBy.d.mts +1 -1
  193. package/node_modules/es-toolkit/dist/compat/math/maxBy.d.ts +1 -1
  194. package/node_modules/es-toolkit/dist/compat/math/maxBy.js +18 -4
  195. package/node_modules/es-toolkit/dist/compat/math/maxBy.mjs +18 -4
  196. package/node_modules/es-toolkit/dist/compat/math/minBy.d.mts +1 -1
  197. package/node_modules/es-toolkit/dist/compat/math/minBy.d.ts +1 -1
  198. package/node_modules/es-toolkit/dist/compat/math/minBy.js +18 -4
  199. package/node_modules/es-toolkit/dist/compat/math/minBy.mjs +18 -4
  200. package/node_modules/es-toolkit/dist/compat/object/assign.js +2 -3
  201. package/node_modules/es-toolkit/dist/compat/object/assign.mjs +2 -3
  202. package/node_modules/es-toolkit/dist/compat/object/assignIn.js +2 -3
  203. package/node_modules/es-toolkit/dist/compat/object/assignIn.mjs +2 -3
  204. package/node_modules/es-toolkit/dist/compat/object/assignInWith.js +2 -3
  205. package/node_modules/es-toolkit/dist/compat/object/assignInWith.mjs +2 -3
  206. package/node_modules/es-toolkit/dist/compat/object/assignWith.js +2 -3
  207. package/node_modules/es-toolkit/dist/compat/object/assignWith.mjs +2 -3
  208. package/node_modules/es-toolkit/dist/compat/object/create.js +1 -1
  209. package/node_modules/es-toolkit/dist/compat/object/create.mjs +1 -1
  210. package/node_modules/es-toolkit/dist/compat/object/defaults.js +2 -3
  211. package/node_modules/es-toolkit/dist/compat/object/defaults.mjs +2 -3
  212. package/node_modules/es-toolkit/dist/compat/object/has.js +1 -1
  213. package/node_modules/es-toolkit/dist/compat/object/has.mjs +1 -1
  214. package/node_modules/es-toolkit/dist/compat/object/hasIn.js +1 -1
  215. package/node_modules/es-toolkit/dist/compat/object/hasIn.mjs +1 -1
  216. package/node_modules/es-toolkit/dist/compat/object/unset.js +1 -1
  217. package/node_modules/es-toolkit/dist/compat/object/unset.mjs +1 -1
  218. package/node_modules/es-toolkit/dist/compat/object/values.js +5 -1
  219. package/node_modules/es-toolkit/dist/compat/object/values.mjs +5 -1
  220. package/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.js +4 -5
  221. package/node_modules/es-toolkit/dist/compat/predicate/isMatchWith.mjs +4 -5
  222. package/node_modules/es-toolkit/dist/compat/string/camelCase.js +6 -2
  223. package/node_modules/es-toolkit/dist/compat/string/camelCase.mjs +6 -2
  224. package/node_modules/es-toolkit/dist/compat/string/kebabCase.js +2 -2
  225. package/node_modules/es-toolkit/dist/compat/string/kebabCase.mjs +2 -2
  226. package/node_modules/es-toolkit/dist/compat/string/lowerCase.js +2 -2
  227. package/node_modules/es-toolkit/dist/compat/string/lowerCase.mjs +2 -2
  228. package/node_modules/es-toolkit/dist/compat/string/pad.js +10 -3
  229. package/node_modules/es-toolkit/dist/compat/string/pad.mjs +10 -3
  230. package/node_modules/es-toolkit/dist/compat/string/padEnd.js +7 -1
  231. package/node_modules/es-toolkit/dist/compat/string/padEnd.mjs +7 -1
  232. package/node_modules/es-toolkit/dist/compat/string/padStart.js +7 -1
  233. package/node_modules/es-toolkit/dist/compat/string/padStart.mjs +7 -1
  234. package/node_modules/es-toolkit/dist/compat/string/snakeCase.js +2 -2
  235. package/node_modules/es-toolkit/dist/compat/string/snakeCase.mjs +2 -2
  236. package/node_modules/es-toolkit/dist/compat/string/startCase.js +1 -1
  237. package/node_modules/es-toolkit/dist/compat/string/startCase.mjs +1 -1
  238. package/node_modules/es-toolkit/dist/compat/string/template.d.mts +1 -1
  239. package/node_modules/es-toolkit/dist/compat/string/template.d.ts +1 -1
  240. package/node_modules/es-toolkit/dist/compat/string/templateSettings.d.mts +18 -1
  241. package/node_modules/es-toolkit/dist/compat/string/templateSettings.d.ts +18 -1
  242. package/node_modules/es-toolkit/dist/compat/string/templateSettings.js +4 -1
  243. package/node_modules/es-toolkit/dist/compat/string/templateSettings.mjs +5 -1
  244. package/node_modules/es-toolkit/dist/compat/string/truncate.js +2 -9
  245. package/node_modules/es-toolkit/dist/compat/string/truncate.mjs +1 -8
  246. package/node_modules/es-toolkit/dist/compat/string/upperCase.js +2 -2
  247. package/node_modules/es-toolkit/dist/compat/string/upperCase.mjs +2 -2
  248. package/node_modules/es-toolkit/dist/compat/util/eq.d.mts +17 -1
  249. package/node_modules/es-toolkit/dist/compat/util/eq.d.ts +17 -1
  250. package/node_modules/es-toolkit/dist/compat/util/eq.js +19 -1
  251. package/node_modules/es-toolkit/dist/compat/util/eq.mjs +19 -1
  252. package/node_modules/es-toolkit/dist/compat/util/toArray.js +2 -1
  253. package/node_modules/es-toolkit/dist/compat/util/toArray.mjs +2 -1
  254. package/node_modules/es-toolkit/dist/fp/flow.d.mts +213 -0
  255. package/node_modules/es-toolkit/dist/fp/flow.d.ts +213 -0
  256. package/node_modules/es-toolkit/dist/fp/flow.js +50 -0
  257. package/node_modules/es-toolkit/dist/fp/flow.mjs +50 -0
  258. package/node_modules/es-toolkit/dist/fp/index.d.mts +2 -1
  259. package/node_modules/es-toolkit/dist/fp/index.d.ts +2 -1
  260. package/node_modules/es-toolkit/dist/fp/index.js +3 -1
  261. package/node_modules/es-toolkit/dist/fp/index.mjs +3 -2
  262. package/node_modules/es-toolkit/dist/fp/pipe.js +8 -12
  263. package/node_modules/es-toolkit/dist/fp/pipe.mjs +8 -12
  264. package/node_modules/es-toolkit/dist/map/hasValue.js +2 -2
  265. package/node_modules/es-toolkit/dist/map/hasValue.mjs +2 -2
  266. package/node_modules/es-toolkit/dist/predicate/isEqualWith.js +2 -3
  267. package/node_modules/es-toolkit/dist/predicate/isEqualWith.mjs +2 -3
  268. package/node_modules/es-toolkit/dist/string/deburr.js +1 -1
  269. package/node_modules/es-toolkit/dist/string/deburr.mjs +1 -1
  270. package/node_modules/es-toolkit/dist/types/DeepPartial.d.mts +21 -0
  271. package/node_modules/es-toolkit/dist/types/DeepPartial.d.ts +21 -0
  272. package/node_modules/es-toolkit/dist/types/DeepReadonly.d.mts +22 -0
  273. package/node_modules/es-toolkit/dist/types/DeepReadonly.d.ts +22 -0
  274. package/node_modules/es-toolkit/dist/types/NonEmptyArray.d.mts +14 -0
  275. package/node_modules/es-toolkit/dist/types/NonEmptyArray.d.ts +14 -0
  276. package/node_modules/es-toolkit/dist/types/Simplify.d.mts +18 -0
  277. package/node_modules/es-toolkit/dist/types/Simplify.d.ts +18 -0
  278. package/node_modules/es-toolkit/dist/types/ValueOf.d.mts +14 -0
  279. package/node_modules/es-toolkit/dist/types/ValueOf.d.ts +14 -0
  280. package/node_modules/es-toolkit/dist/types/Writable.d.mts +15 -0
  281. package/node_modules/es-toolkit/dist/types/Writable.d.ts +15 -0
  282. package/node_modules/es-toolkit/dist/types/index.d.mts +7 -0
  283. package/node_modules/es-toolkit/dist/types/index.d.ts +7 -0
  284. package/node_modules/es-toolkit/package.json +23 -7
  285. package/node_modules/es-toolkit/types.d.ts +1 -0
  286. package/node_modules/fs-ext/build/Makefile +347 -0
  287. package/node_modules/fs-ext/build/Release/.deps/Release/fs_ext.node.d +1 -0
  288. package/node_modules/fs-ext/build/Release/.deps/Release/obj.target/fs_ext/fs-ext.o.d +165 -0
  289. package/node_modules/fs-ext/build/Release/fs_ext.node +0 -0
  290. package/node_modules/fs-ext/build/Release/obj.target/fs_ext/fs-ext.o +0 -0
  291. package/node_modules/fs-ext/build/binding.Makefile +6 -0
  292. package/node_modules/fs-ext/build/config.gypi +503 -0
  293. package/node_modules/fs-ext/build/fs_ext.target.mk +183 -0
  294. package/node_modules/fs-ext/build/gyp-mac-tool +768 -0
  295. package/node_modules/media-typer/README.md +15 -14
  296. package/node_modules/media-typer/index.js +0 -8
  297. package/node_modules/media-typer/package.json +16 -12
  298. package/package.json +2 -2
  299. package/node_modules/@quantiya/codevibe-core/dist/substrate/git-proxy.d.ts +0 -35
  300. package/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.d.mts +0 -17
  301. package/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.d.ts +0 -17
  302. package/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.js +0 -19
  303. package/node_modules/es-toolkit/dist/_internal/isEqualsSameValueZero.mjs +0 -19
  304. /package/node_modules/@quantiya/codevibe-core/dist/{substrate/__tests__/git-proxy.test.d.ts → appsync/__tests__/refresh-open-prompt-ttl-chunk.test.d.ts} +0 -0
@@ -3,15 +3,18 @@ import { AuthorityScope } from './authority';
3
3
  import { ClassAEmitter, ClassAEmitterContext, ClassASink, VerificationGateKind } from './class-a-emit';
4
4
  import { type DeviceSigningKey } from './class-a-sign';
5
5
  import { EmitShellEventFn } from './hook-bridge';
6
- import { MergeResult, SubmitMergeGateVerdictInput } from './task-group-types';
6
+ import { SubmitMergeGateVerdictInput } from './task-group-types';
7
7
  import { TrackRegistry } from './track-registry';
8
- import { AgentKind, AuthorityAction, ClassBInbound, GateDispatchPayload, HookEvent, ImplementorHandle, LocalExecutor, MergeGateDispatchPayload, ProbeHandle, ProcessRole, ReviewerDispatchPayload, ReviseFeedbackPayload, ReviewerHandle, SpawnArgs, TrackAssignedPayload } from './types';
8
+ import { AgentKind, AuthorityAction, ClassBInbound, GateDispatchPayload, HookEvent, ImplementorHandle, LocalExecutor, MergeGateDispatchPayload, ProbeHandle, ProcessRole, ReviewerDispatchPayload, ReviseFeedbackPayload, ReviewerHandle, SpawnArgs, TrackAssignedPayload, type DurableSessionResourceDisposeOptions, type WorkspaceDisposeOptions } from './types';
9
9
  import { type TeamExecution } from './team-execution-flag';
10
+ import { type SnapshotBundlesView, type SnapshotMergeGateResult } from './snapshot-merge';
11
+ import { type WorkspaceRootAuthority } from './workspace-authority';
10
12
  import type { RenderedConflict, TrackIntentDiff } from './wb2-review-bundle';
11
13
  import type { ConflictModelCaller } from './class2-resolver';
12
14
  import type { ConflictResolverContext } from './merge-conflict-resolve';
13
15
  import { type ContentCipher } from './conflict-resolution-durable-store';
14
- import type { TrackTipsView } from './durable-store';
16
+ import type { PromoteManifestInput, SnapshotPromotionJournalV1, TrackTipsView } from './durable-store';
17
+ import { type ReviewedShadowDiffFile, type ShadowEnv } from './workspace-shadow';
15
18
  /**
16
19
  * CP-7 W2 Stage-2 HIGH (Finding 2) — STRICT delivery sink for the
17
20
  * `tier:'none'` (moat-OFF) reduced-trust badge.
@@ -44,7 +47,9 @@ export type StrictBadgeSink = (badge: {
44
47
  * inject a mock without constructing the full GraphQL client.
45
48
  */
46
49
  export interface MergeGateAppSyncClient {
47
- submitMergeGateVerdict(input: SubmitMergeGateVerdictInput): Promise<{
50
+ submitMergeGateVerdict(input: SubmitMergeGateVerdictInput, opts?: {
51
+ signal?: AbortSignal;
52
+ }): Promise<{
48
53
  outcome: string;
49
54
  }>;
50
55
  }
@@ -94,6 +99,8 @@ export type SubstrateEngager = (input: {
94
99
  taskId: string;
95
100
  agentKind: AgentKind;
96
101
  workdir: string;
102
+ /** Exact task-workspace incarnation selected by the orchestration owner. */
103
+ workdirAuthority?: WorkspaceRootAuthority;
97
104
  role: ProcessRole;
98
105
  /**
99
106
  * A1d (design §8.1) — the spawn demands hard confinement (`SpawnArgs.
@@ -106,12 +113,22 @@ export type SubstrateEngager = (input: {
106
113
  */
107
114
  requireConfined?: boolean;
108
115
  }) => Promise<SubstrateEngageResult>;
116
+ /** Backend lease is 15 minutes; three renewal opportunities fit inside it. */
117
+ export declare const TEAM_TRACK_HEARTBEAT_INTERVAL_MS: number;
109
118
  export interface LocalExecutorImplDeps {
110
119
  sessionId: string;
111
120
  initialScope?: AuthorityScope;
112
121
  baseCtx: Omit<ClassAEmitterContext, 'taskId'>;
113
122
  adapter: AgentKind;
114
123
  sink?: ClassASink;
124
+ /**
125
+ * Hosted Class A sink dedicated to team-child progress/lease renewal.
126
+ * Keeping this explicit prevents pre-task/refusal events from being sent
127
+ * against a placeholder task id while still making team liveness durable.
128
+ */
129
+ teamProgressSink?: ClassASink;
130
+ /** Production team construction refuses admission without the hosted sink. */
131
+ requireHostedTrackHeartbeat?: boolean;
115
132
  emitShellEvent: EmitShellEventFn;
116
133
  logger?: {
117
134
  warn: (msg: string, meta?: Record<string, unknown>) => void;
@@ -142,9 +159,9 @@ export interface LocalExecutorImplDeps {
142
159
  /** E2E content encryptor. Defaults to `cryptoService` if injected by the shell. */
143
160
  contentEncryptor?: MergeGateContentEncryptor;
144
161
  /**
145
- * Repo root (canonicalized absolute) — the parent under which per-track state
146
- * dirs `<repoRoot>/.codevibe/state/<group>/<track>/` live, and the cwd the
147
- * MergeGate integration check runs in. Required for team sessions.
162
+ * Repo root (canonicalized absolute) — anchors validation of the legacy
163
+ * `state_dir` wire field and is the real folder the MergeGate ultimately
164
+ * promotes into. No per-track state directory is materialized.
148
165
  */
149
166
  repoRoot?: string;
150
167
  /**
@@ -162,12 +179,27 @@ export interface LocalExecutorImplDeps {
162
179
  taskId: string;
163
180
  taskGroupId: string;
164
181
  trackIndex: number;
182
+ dispatchGeneration: number;
165
183
  agent: AgentKind;
166
184
  writePaths: string[];
167
185
  autoModifiedFiles: string[];
168
186
  /** #590 — the track's own-module test files; part of the declared write
169
187
  * scope (engine disjointness-validated) so a test write stays in-lane. */
170
188
  testSurfaces: string[];
189
+ }) => Promise<'accepted' | 'refused'>;
190
+ /**
191
+ * Terminal group-lifecycle bridge. The QuorumLoop owns the real per-track
192
+ * implementor handles and task snapshots; LocalExecutor's registry contains
193
+ * membership-only handles. The callback must publish its fence synchronously
194
+ * when called, then drain/abort/clean the exact members before resolving.
195
+ */
196
+ haltTeamTaskGroup?: (info: {
197
+ taskGroupId: string;
198
+ members: readonly {
199
+ taskId: string;
200
+ trackIndex: number;
201
+ dispatchGeneration: number;
202
+ }[];
171
203
  }) => Promise<void>;
172
204
  /**
173
205
  * CP-12 W4 (#593, Stage-2 r1 Codex MED) — corrupt-brief TOMBSTONE predicate
@@ -181,7 +213,7 @@ export interface LocalExecutorImplDeps {
181
213
  * Keyed by `(taskGroupId, trackIndex)` (#593 Stage-2 r2) — B.2 recovery
182
214
  * aggregates across groups, so a tombstone must be scoped to its group.
183
215
  */
184
- isTrackTombstoned?: (taskGroupId: string, trackIndex: number) => boolean;
216
+ isTrackTombstoned?: (taskGroupId: string, trackIndex: number, taskId: string, dispatchGeneration: number) => boolean;
185
217
  /**
186
218
  * #592 PROVENANCE GUARD (live path, wired to `QuorumLoop.isForeignTeamGroup`).
187
219
  * `launchTrack` consults it right after the tombstone gate — BEFORE any registry
@@ -257,41 +289,38 @@ export interface LocalExecutorImplDeps {
257
289
  * MergeGate so it never calls this).
258
290
  */
259
291
  awaitTaskShadowQuiescent?: (taskId: string) => Promise<void>;
260
- /**
261
- * TEST SEAM — override the bounded await for member track tips in the
262
- * `worktree_merge` gate (default {@link TRACK_TIP_AWAIT_MS}). The engine
263
- * dispatches `MergeGateDispatch` as soon as the LAST track flips Passed, but
264
- * the desktop commits each track's tip asynchronously on its OWN
265
- * `TaskAuthorized` receipt — so the dispatch can arrive BEFORE the final
266
- * track's commit has even STARTED (the shadow-ops mutex is not yet held, so
267
- * the quiescence barrier passes straight through). Dogfood-pinned 2026-07-02:
268
- * team-joint-conflict read a missing tip 0.1s before the commit landed →
269
- * FAIL verdict stored → the real train's later PASS hit the #C12-1 replay →
270
- * "Team halted — merge_integration_failure" AFTER a successful promote.
271
- */
292
+ /** Bounded await for every reviewed member bundle (legacy option name). */
272
293
  trackTipAwaitMs?: number;
294
+ /** Overall deadline shared by initial hosted verdict submit + same-key replay. */
295
+ mergeGateSubmitTimeoutMs?: number;
273
296
  /**
274
- * CP-14 — the team execution model. Since the §10 retirement (2026-07-03)
275
- * `worktree_merge` is the ONLY model: the merge gate always runs
276
- * {@link runWorktreeMergeGate} (merge-train the committed track branches +
277
- * promote the integration tip). Retained as a dep for wire/test stability.
297
+ * CP-14 — the team execution wire model. `worktree_merge` is the only label,
298
+ * but the live desktop implementation uses reviewed bundles and filesystem
299
+ * snapshots. Retained as a dep for wire/test stability.
278
300
  */
279
301
  teamExecution?: TeamExecution;
280
- /**
281
- * CP-14 Wave A — read the durable committed track tips (the merge-train inputs)
282
- * for a group. Backed by `RevertManifestStore.readTrackTips`. REQUIRED when
283
- * `teamExecution === 'worktree_merge'` (the gate fails closed without it).
284
- */
302
+ /** Deprecated offline migration reader. The live dispatch path never calls it. */
285
303
  readTrackTips?: (taskGroupId: string) => Promise<TrackTipsView>;
286
- /**
287
- * TEST SEAM (§10 retirement, 2026-07-03) override the worktree merge gate
288
- * body. Defaults to the real {@link runWorktreeMergeBranch} (merge-train +
289
- * promote). Mirrors the `runVerificationGatesFn` precedent: unit tests of the
290
- * classification/signing/submission flow AROUND the gate inject a fixed
291
- * result instead of standing up a real git fixture with track branches (the
292
- * merge-train itself has its own fixture-backed suites).
293
- */
294
- worktreeMergeGateFn?: (payload: MergeGateDispatchPayload, repoRootCanonical: string, gateKinds: VerificationGateKind[]) => Promise<MergeResult>;
304
+ /** Git-independent reviewed track bundles (the default team merge inputs). */
305
+ readTrackBundles?: (taskGroupId: string) => Promise<SnapshotBundlesView>;
306
+ /** Durable all-generation/cross-process fence around gate + hosted submission. */
307
+ withSnapshotMergeGateFence?: <T>(taskGroupId: string, operation: () => Promise<T>, signal?: AbortSignal) => Promise<T>;
308
+ /** Persist merged pre-images before the one group promotion mutates user files. */
309
+ persistSnapshotPreImages?: (taskGroupId: string, ownerTrackIndex: number, entries: PromoteManifestInput[]) => Promise<void>;
310
+ readSnapshotPromotion?: (taskGroupId: string) => Promise<SnapshotPromotionJournalV1 | null>;
311
+ prepareSnapshotPromotion?: (taskGroupId: string, operationHash: string, files: readonly ReviewedShadowDiffFile[], workspaceRootAuthority: WorkspaceRootAuthority) => Promise<void>;
312
+ markSnapshotPromotionApplied?: (taskGroupId: string, operationHash: string) => Promise<void>;
313
+ /** Optional shadow lifecycle hooks shared with implementor workspaces. */
314
+ snapshotShadowEnv?: ShadowEnv;
315
+ /** Mark a successfully accepted group terminal and reclaim its bundle state. */
316
+ completeSnapshotGroup?: (taskGroupId: string) => Promise<void>;
317
+ /** Normal-exit retirement of all ordinary durable resources from this session. */
318
+ disposeSnapshotSessionResources?: () => Promise<void>;
319
+ /**
320
+ * Legacy-named TEST SEAM around the merge-gate body. Production defaults to
321
+ * the reviewed-bundle filesystem snapshot implementation.
322
+ */
323
+ worktreeMergeGateFn?: (payload: MergeGateDispatchPayload, repoRootCanonical: string, gateKinds: VerificationGateKind[]) => Promise<SnapshotMergeGateResult>;
295
324
  /**
296
325
  * Audited-path fix (Fix 1) — surface a hosted-side PolicyRejection to the
297
326
  * DESKTOP. The LE already emits a mobile-bound NOTIFICATION via
@@ -387,6 +416,7 @@ export declare class LocalExecutorImpl implements LocalExecutor {
387
416
  private scope;
388
417
  private taskId;
389
418
  private readonly emitter;
419
+ private readonly trackProgressEmitter?;
390
420
  private readonly bridge;
391
421
  private readonly classBConsumer;
392
422
  private readonly emitShellEvent;
@@ -395,6 +425,11 @@ export declare class LocalExecutorImpl implements LocalExecutor {
395
425
  private readonly sessionId;
396
426
  private readonly trackRegistry;
397
427
  private readonly trackPayloads;
428
+ private readonly trackHeartbeats;
429
+ /** Hosted heartbeat requests admitted before a terminal/session fence. */
430
+ private readonly trackHeartbeatEmits;
431
+ /** Every accepted TrackAssigned launch coroutine, including pre-bridge awaits. */
432
+ private readonly trackLaunchPromises;
398
433
  private readonly resolvedMergeOutcomes;
399
434
  /**
400
435
  * CP-14 concurrent-dispatch dedup — the ONE in-flight merge-gate run per
@@ -403,6 +438,20 @@ export declare class LocalExecutorImpl implements LocalExecutor {
403
438
  * the #TC-7 replay path (re-submit → server replays the stored outcome).
404
439
  */
405
440
  private readonly inFlightMergeGates;
441
+ /** Disposable integration snapshots not owned by the QuorumLoop task map. */
442
+ private readonly integrationShadows;
443
+ /** Sticky exact task ids used by the post-drain durable enumeration. */
444
+ private readonly integrationTaskIdsOwned;
445
+ /** Group-terminal fence, installed before any halt await or registry abort. */
446
+ private readonly haltedTaskGroups;
447
+ private readonly integrationAbort;
448
+ private workspaceShutdown;
449
+ /** Auditless advisory spawns admitted before the session shutdown fence. */
450
+ private readonly advisorySpawnAdmissions;
451
+ /** Process-tree failures discovered after an advisory handle was returned. */
452
+ private readonly advisoryProcessCleanupFailures;
453
+ /** One exact final retirement result, reusable by strict/non-strict callers. */
454
+ private durableSessionResourceFailures;
406
455
  private _lastMergeGateEmitMs;
407
456
  private readonly teamDeps;
408
457
  private readonly logger;
@@ -434,6 +483,20 @@ export declare class LocalExecutorImpl implements LocalExecutor {
434
483
  spawnImplementor(args: SpawnArgs): Promise<ImplementorHandle>;
435
484
  spawnReviewer(_args: SpawnArgs): Promise<ReviewerHandle>;
436
485
  spawnHealthProbe(args: SpawnArgs): Promise<ProbeHandle>;
486
+ /**
487
+ * Publish advisory ownership synchronously before the first spawn await.
488
+ * Caller cancellation and session shutdown converge on one signal.
489
+ */
490
+ private admitAdvisorySpawn;
491
+ private bindAdvisorySpawn;
492
+ private settleAdvisorySpawn;
493
+ /**
494
+ * Abort and drain every auditless implementor admission to a fixed point.
495
+ * `handle.done` includes verified process-tree cleanup and registered exit
496
+ * hooks, so resolving this phase is the safe boundary before a shell turn
497
+ * removes the image the process was reading.
498
+ */
499
+ private drainAdvisorySpawns;
437
500
  /**
438
501
  * CP-7 PART F — engage the trusted-execution substrate for ONE implementor
439
502
  * spawn. Returns the `SpawnArgs` to launch with (substrate-augmented on the
@@ -502,6 +565,12 @@ export declare class LocalExecutorImpl implements LocalExecutor {
502
565
  * discards EXACTLY the rejected task's shadow. Optional for non-WS callers.
503
566
  */
504
567
  consumeClassB(packet: ClassBInbound, envelopeTaskId?: string): Promise<void>;
568
+ private stopExactTrackHeartbeat;
569
+ private stopTaskGroupHeartbeats;
570
+ private stopAllTrackHeartbeats;
571
+ private startTrackHeartbeat;
572
+ private retireTaskGroupMembership;
573
+ private removeExactTrackRegistration;
505
574
  /**
506
575
  * #C12-14 — launch the implementor for one track. IDEMPOTENT by
507
576
  * `(task_group_id, track_index, dispatch_generation)`: a duplicate
@@ -509,13 +578,18 @@ export declare class LocalExecutorImpl implements LocalExecutor {
509
578
  * (#C12-17). A strictly-newer generation (dispute re-dispatch, #C12-19)
510
579
  * supersedes the stale entry.
511
580
  *
512
- * Steps: (1) idempotency check; (2) create + canonicalize the per-track
513
- * `state_dir` via the existing spawn authority guard (NO bypass
514
- * `fs.realpath` exactly as `spawnSubprocess` requires); (3) advance the
515
- * per-track authority scope to `ownership_scope`; (4) spawn the implementor
516
- * in `state_dir` with the track's child `task_id`.
581
+ * Steps: (1) idempotency check; (2) validate the legacy per-track `state_dir`
582
+ * wire value without creating it; (3) register membership; (4) bridge the
583
+ * task into the QuorumLoop, which launches in a disposable WorkspaceShadow.
517
584
  */
518
585
  private launchTrack;
586
+ /**
587
+ * Bind membership changes to the durable group fence shared by reviewed
588
+ * bundle publication and merge-gate execution. A newer track generation can
589
+ * never replace membership while older reviewed bytes are being integrated
590
+ * or their hosted verdict is still in flight.
591
+ */
592
+ private launchTrackFenced;
519
593
  /**
520
594
  * CP-12 W4 (#593) — the public team-dispatch recovery entrypoint. Exposes the
521
595
  * EXACT private `launchTrack` body (register + brief bridge) so the QuorumLoop
@@ -529,13 +603,6 @@ export declare class LocalExecutorImpl implements LocalExecutor {
529
603
  * → recovery skips it (no repair, no gate dispatch).
530
604
  */
531
605
  recoverLaunchTrack(payload: TrackAssignedPayload): Promise<'registered' | 'duplicate' | 'rejected'>;
532
- /**
533
- * FIX-4 — wrap a track's `SpawnArgs` with the Class A process-lifecycle
534
- * audit hooks, mirroring the single-track `spawnWithLifecycle` path but bound
535
- * to the TRACK's own `task_id` as the Class A context (so PROCESS_SPAWNED /
536
- * PROCESS_EXITED envelopes attribute to the right track, not the team task).
537
- */
538
- private withTrackLifecycle;
539
606
  /**
540
607
  * #C12-7/#C12-8 — MergeGate runner. The `owner_track_index` track runs the
541
608
  * shared integration check, derives a PASS/FAIL classification from the gate
@@ -549,14 +616,12 @@ export declare class LocalExecutorImpl implements LocalExecutor {
549
616
  * SharedFileConflict / ScopeViolation / ReviewerDisagreement / BudgetExhausted.
550
617
  */
551
618
  /**
552
- * CP-14 Wave A the `worktree_merge` merge-gate branch: build the merge-train
553
- * inputs from the durable committed tips + the live member set, run
554
- * {@link runWorktreeMergeGate} (merge-train Tier-1 promote the integration
555
- * tip), and map the outcome to a `MergeResult` for the engine verdict. A
556
- * `merged_promoted` ⇒ PASS; ANY halt ⇒ FAIL (the user tree is untouched by
557
- * construction — #C14-AON — so there is no content to revert). FAILS CLOSED if
558
- * `readTrackTips` is unwired (the gate cannot read its inputs).
619
+ * Live Git-independent merge branch: await every reviewed track bundle, merge
620
+ * against exact pre-image hashes, verify in a disposable snapshot, and promote
621
+ * once. Missing inputs, drift, overlap, or a failed gate all fail closed.
559
622
  */
623
+ private runSnapshotMergeBranch;
624
+ /** Legacy reader for pre-migration Git branch-tip records. Not live-selected. */
560
625
  private runWorktreeMergeBranch;
561
626
  /**
562
627
  * [P1b] GUARANTEED LOCAL freeze for the merge-gate timer. Wraps the inner gate
@@ -577,6 +642,26 @@ export declare class LocalExecutorImpl implements LocalExecutor {
577
642
  * still propagates (the `finally` only emits — it never swallows).
578
643
  */
579
644
  private runMergeGate;
645
+ /**
646
+ * Wait for bundle publishers without owning their fence. Each attempt first
647
+ * drains the current task lifecycle mutexes, then briefly enters the durable
648
+ * fence and checks exact task/generation bundle readiness. A ready attempt
649
+ * retains the same fence continuously through integration and hosted submit.
650
+ */
651
+ private runMergeGateFenced;
652
+ /** True only for a missing exact current-generation bundle; malformed input is classified inside the gate. */
653
+ private snapshotInputsMissing;
654
+ /**
655
+ * Normal session teardown for integration snapshots. Abort their verification
656
+ * children, await the full in-flight gate coroutines (which own their snapshot
657
+ * `finally` blocks), then reclaim any remaining directories. Marker TTL cleanup
658
+ * is only the hard-crash fallback.
659
+ */
660
+ private retireIntegrationShadow;
661
+ private cleanupDurableIntegrationSnapshots;
662
+ private getDurableSessionResourceFailures;
663
+ disposeDurableSessionResources(opts?: DurableSessionResourceDisposeOptions): Promise<void>;
664
+ disposeWorkspaces(opts?: WorkspaceDisposeOptions): Promise<void>;
580
665
  /** The single-flight merge-gate run body (P1b freeze wrapper). See {@link runMergeGate}. */
581
666
  private runMergeGateExclusive;
582
667
  /**
@@ -586,6 +671,7 @@ export declare class LocalExecutorImpl implements LocalExecutor {
586
671
  * A thrown exit never returns → the wrapper's boolean stays `false` → freeze.
587
672
  */
588
673
  private runMergeGateInner;
674
+ private submitMergeGateVerdictWithDeadline;
589
675
  /**
590
676
  * PHASE-589+469 W1 (§5.A / §5.C / #TC-2 / #TC-3) — drive the desktop CLI
591
677
  * convergence from the AUTHORITATIVE engine `outcome`. Emits, via the SAME
@@ -602,6 +688,7 @@ export declare class LocalExecutorImpl implements LocalExecutor {
602
688
  * uses). Team-only path — single-impl never reaches runMergeGate (#TC-8).
603
689
  */
604
690
  private emitGroupConvergence;
691
+ private emitGroupConvergenceOwned;
605
692
  /**
606
693
  * PHASE-589/469 W3.2 (D2) — drive the per-track render flip + group-resolved
607
694
  * render for a USER GROUP DECISION (the 5-option escalation COMMIT), through
@@ -640,18 +727,16 @@ export declare class LocalExecutorImpl implements LocalExecutor {
640
727
  * non-negative safe integer. Otherwise a `task_group_id` of
641
728
  * "../../../../tmp/x" makes the DERIVED path itself escape, and the
642
729
  * packet's matching `state_dir` then passes the exact-match check.
643
- * 1. Compute the trusted state root `realpath(realpath(repoRoot)/.codevibe/
644
- * state)` (realpath resolves any symlinked component).
645
- * 2. DERIVE `realpath(stateRoot)/<task_group_id>/<track_index>`, mkdir -p,
646
- * realpath it (canonical workingDir for the spawn guard).
647
- * 3. CONTAINMENT CHECK the realpath'd derived dir MUST stay strictly under
648
- * the realpath'd state root (catches both `..`-segment AND symlinked-
649
- * component escapes).
650
- * 4. Verify the payload's supplied `state_dir` resolves to EXACTLY the
651
- * derived path. A mismatch / escape ⇒ REJECT (return null): no spawn, no
652
- * scope grant. Never feed an attacker-controlled path into the grant.
730
+ * 1. Canonicalize the repo root and derive the virtual legacy state path
731
+ * `<repo>/.codevibe/state/<task_group_id>/<track_index>` lexically.
732
+ * 2. Reject any existing path component that is a symlink/non-directory.
733
+ * Nothing is created: team implementors now run in disposable snapshots,
734
+ * so materializing these obsolete state directories would only leak disk
735
+ * entries on every TrackAssigned.
736
+ * 3. Verify the payload's supplied `state_dir` normalizes to EXACTLY the
737
+ * derived path. A mismatch / escape REJECT (return null).
653
738
  *
654
- * Returns the canonical derived dir on success, or `null` on a confinement
739
+ * Returns the normalized derived path on success, or `null` on a confinement
655
740
  * violation (logged here; the caller drops the packet).
656
741
  */
657
742
  private canonicalizeStateDir;
@@ -686,7 +771,8 @@ export declare class LocalExecutorImpl implements LocalExecutor {
686
771
  * §2.3 — emit a per-track progress event carrying `track_index` + `task_id`
687
772
  * in metadata so mobile/desktop CAN render per-track threads (CP-8 #469
688
773
  * renders; W2.b adds the wire attribution only). Emitting a per-track
689
- * progress event also renews that track's lease (#C12-18). This path is ONLY
774
+ * progress event is the UI/status projection only. The independently signed
775
+ * Class A heartbeat owns backend lease renewal (#C12-18). This path is ONLY
690
776
  * for group tracks — single-track events go through the hook bridge and OMIT
691
777
  * the field (backward-compatible).
692
778
  */
@@ -719,6 +805,10 @@ export declare class LocalExecutorImpl implements LocalExecutor {
719
805
  get emitterForTests(): ClassAEmitter;
720
806
  /** CP-12 W2.b — expose the per-track registry for idempotency introspection. */
721
807
  get trackRegistryForTests(): TrackRegistry;
808
+ /** @internal exact terminal-retirement assertions. */
809
+ get trackPayloadCountForTests(): number;
810
+ /** @internal recurring lease owner count. */
811
+ get trackHeartbeatCountForTests(): number;
722
812
  private contextOrNull;
723
813
  /**
724
814
  * Context resolver for ClassBConsumer emit paths (refusals + PolicyRejection).
@@ -0,0 +1,16 @@
1
+ export interface ProcessIdentity {
2
+ pid: number;
3
+ /** Boot-bound, high-resolution OS creation identity. */
4
+ incarnationId: string;
5
+ }
6
+ export interface ProcessMetadata {
7
+ identity: ProcessIdentity;
8
+ processGroupId: number | null;
9
+ }
10
+ /** Same native identity reader embedded into fd-anchored helper processes. */
11
+ export declare const PROCESS_IDENTITY_SYNC_HELPER_SOURCE: string;
12
+ /** Read exact process metadata from one platform-owned source. */
13
+ export declare function readProcessMetadata(pid: number): Promise<ProcessMetadata | null>;
14
+ export declare function readProcessIdentity(pid: number): Promise<ProcessIdentity | null>;
15
+ export declare function currentProcessIdentity(): Promise<ProcessIdentity>;
16
+ export declare function isProcessIdentityAlive(identity: ProcessIdentity): Promise<boolean>;
@@ -0,0 +1,123 @@
1
+ import { spawn as nodeSpawn, type ChildProcess } from 'node:child_process';
2
+ import { type ProcessIdentity } from './process-identity';
3
+ import { type WorkspaceRootAuthority } from './workspace-authority';
4
+ export type ProcessTreeOwnership = 'none' | 'posix-host' | 'posix-group' | 'windows-job';
5
+ /**
6
+ * Spawn through an original-handle POSIX host. The host owns the target's
7
+ * detached group, drains it on normal completion/cancellation, and exits only
8
+ * after absence proof. No reusable PID/PGID becomes recovery authority.
9
+ */
10
+ export declare function spawnPosixOwnedProcess(command: string, args: readonly string[], options: Parameters<typeof nodeSpawn>[2], seams?: {
11
+ spawnExecutable?: SpawnExecutable;
12
+ cleanupTimeoutMs?: number;
13
+ persistOwner?: (owner: ProcessCleanupOwner) => Promise<void>;
14
+ /** Exact task/verification cwd incarnation held through target launch. */
15
+ workingDirAuthority?: WorkspaceRootAuthority;
16
+ /** @internal deterministic directory-durability failure seam. */
17
+ syncOwnerDirectory?: (dir: string, file: string) => Promise<void>;
18
+ }): ChildProcess;
19
+ /** Original-handle status channel; missing/malformed status fails closed. */
20
+ export declare function processHostCleanupStatus(child: ChildProcess, ownership: ProcessTreeOwnership): Promise<boolean>;
21
+ /** Durable target-group identity emitted before the supervised command settles. */
22
+ export declare function processHostCleanupOwner(child: ChildProcess, ownership: ProcessTreeOwnership): Promise<ProcessCleanupOwner | undefined>;
23
+ /**
24
+ * Prove that a POSIX host's target group is gone. A well-behaved host reports
25
+ * its own proof. If the host crashes before it can report, use the already
26
+ * authenticated target-group identity to recover and prove cleanup. Starting
27
+ * this promise when the child is wired also prevents inherited output pipes
28
+ * from deadlocking the later `close` event after a host crash.
29
+ */
30
+ export declare function ensureProcessHostCleanup(child: ChildProcess, ownership: ProcessTreeOwnership): Promise<boolean>;
31
+ /** Spawn a Windows command inside a kill-on-close Job Object. */
32
+ export declare function spawnWindowsJobProcess(command: string, args: readonly string[], options: Parameters<typeof nodeSpawn>[2], seams?: {
33
+ spawnExecutable?: SpawnExecutable;
34
+ systemRoot?: string;
35
+ desktopIdentity?: ProcessIdentity;
36
+ hostIdentity?: ProcessIdentity;
37
+ /** Exact task/verification cwd incarnation held by the native host. */
38
+ workingDirAuthority?: WorkspaceRootAuthority;
39
+ /** @internal deterministic A→B seam before the trusted bootstrap launch. */
40
+ beforeHostSpawn?: (hostDir: string, authority: WorkspaceRootAuthority) => Promise<void> | void;
41
+ /** @internal deterministic A→B seam before durable owner publication. */
42
+ beforeOwnerPublication?: (hostDir: string, authority: WorkspaceRootAuthority) => Promise<void> | void;
43
+ /** @internal isolated process-host root for deterministic tests. */
44
+ tempRoot?: string;
45
+ }): Promise<ChildProcess>;
46
+ export declare function sweepOrphanWindowsHostDirs(tempRoot: string, seams?: {
47
+ /** @internal deterministic replacement after authority capture, before owner read. */
48
+ beforeOwnerRead?: (dir: string, authority: WorkspaceRootAuthority) => Promise<void> | void;
49
+ /** @internal deterministic replacement after liveness decision, before removal. */
50
+ beforeOwnerRemoval?: (dir: string, authority: WorkspaceRootAuthority) => Promise<void> | void;
51
+ /** @internal deterministic liveness seam. */
52
+ isOwnerAlive?: (owner: ProcessIdentity) => Promise<boolean>;
53
+ /** @internal deterministic wall clock. */
54
+ now?: () => number;
55
+ }): Promise<void>;
56
+ /** Crash-durable identity used to retry a cleanup proof without a live handle. */
57
+ export interface ProcessCleanupOwner {
58
+ pid: number;
59
+ ownership: 'posix-group';
60
+ /** Wall-clock lower-bound captured immediately before spawn. */
61
+ startedAtMs: number;
62
+ /** OS-native process incarnation, not reusable with the numeric PID/PGID. */
63
+ incarnationId: string;
64
+ }
65
+ /** Restart/session-start sweep for owners durably published before user code ran. */
66
+ export declare function reapDurableProcessOwners(opts?: {
67
+ /** @internal isolated registry root for tests. */
68
+ rootDir?: string;
69
+ /** @internal deterministic same-inode growth seam. */
70
+ afterOwnerStat?: (file: string) => Promise<void> | void;
71
+ /** @internal lower deterministic helper deadline for tests. */
72
+ helperTimeoutMs?: number;
73
+ /** @internal deterministic blocked registry enumeration seam. */
74
+ testHangDirectoryStage?: 'open' | 'read' | 'close';
75
+ /** @internal deterministic blocked owner-record seam. */
76
+ testHangOwnerReadStage?: 'open' | 'read' | 'close';
77
+ /** @internal deterministic owner-record replacement before exact retirement. */
78
+ beforeOwnerRetirement?: (file: string) => Promise<void> | void;
79
+ }): Promise<{
80
+ reaped: number;
81
+ retained: number;
82
+ }>;
83
+ export declare class ProcessTreeTerminationError extends Error {
84
+ constructor(message: string);
85
+ }
86
+ type SpawnExecutable = (command: string, args: readonly string[], options: Parameters<typeof nodeSpawn>[2]) => ChildProcess;
87
+ type ProcessKill = (pid: number, signal?: NodeJS.Signals | number) => boolean;
88
+ type ReadProcessIncarnation = (pid: number) => Promise<string | null>;
89
+ /** Windows Job Objects drain with their host handle and never persist PID authority. */
90
+ export declare function captureProcessCleanupOwner(args: {
91
+ pid: number;
92
+ ownership: ProcessTreeOwnership;
93
+ startedAtMs: number;
94
+ /** @internal deterministic native-identity seam. */
95
+ readProcessIncarnation?: ReadProcessIncarnation;
96
+ }): Promise<ProcessCleanupOwner | undefined>;
97
+ export declare function processTreeOwnership(substrateOwned: boolean, platform?: NodeJS.Platform): ProcessTreeOwnership;
98
+ /**
99
+ * Terminate a process tree CodeVibe owns. POSIX uses a detached process group;
100
+ * Windows launches close their original Job Object host handle.
101
+ */
102
+ export declare function terminateOwnedProcessTree(args: {
103
+ pid: number;
104
+ ownership: ProcessTreeOwnership;
105
+ directKill: () => void;
106
+ timeoutMs?: number;
107
+ /** @internal deterministic POSIX signal seam. */
108
+ processKill?: ProcessKill;
109
+ /** @internal deterministic POSIX wait seam. */
110
+ sleep?: (ms: number) => Promise<void>;
111
+ /** Captured immediately after spawn and required before a POSIX group signal. */
112
+ cleanupOwner?: ProcessCleanupOwner;
113
+ /** @internal deterministic OS-incarnation seam. */
114
+ readProcessIncarnation?: ReadProcessIncarnation;
115
+ }): Promise<void>;
116
+ /** Retry a previously unverified owned tree after restart/session teardown. */
117
+ export declare function retryProcessCleanupOwner(owner: ProcessCleanupOwner, seams?: {
118
+ processKill?: ProcessKill;
119
+ readProcessIncarnation?: ReadProcessIncarnation;
120
+ sleep?: (ms: number) => Promise<void>;
121
+ timeoutMs?: number;
122
+ }): Promise<void>;
123
+ export {};
@@ -42,6 +42,10 @@ export interface ReconcileDeps {
42
42
  alreadyReverted: string[];
43
43
  conflicts: string[];
44
44
  }>;
45
+ /** Verify exact stored post-images, transition APPLIED, then ACK before GC. */
46
+ acknowledgeSnapshotPromotion?: (taskGroupId: string) => Promise<void>;
47
+ /** Exact base/post acceptance finalizer shared with the live decision path. */
48
+ finalizeAcceptedGroup?: (taskGroupId: string) => Promise<void>;
45
49
  /**
46
50
  * HIGH-1 / LOCK #589-J — the COMMIT transport for CLAIM-crash recovery. Present
47
51
  * for a TEAM session (the same `claimGroupDecision` SDK the live decision uses).
@@ -1,4 +1,5 @@
1
1
  import { RevertManifestStore } from './durable-store';
2
+ import { type CasHelperCrashStage } from './workspace-shadow';
2
3
  /** The outcome of a group revert (Fork A: clean-where-safe + surface). */
3
4
  export interface RevertResult {
4
5
  /** Paths reverted (created→deleted, modified/deleted→restored) THIS pass. */
@@ -8,10 +9,22 @@ export interface RevertResult {
8
9
  /** Paths the user edited after apply — left as-is, surfaced (NEVER clobbered). */
9
10
  conflicts: string[];
10
11
  }
12
+ /** @internal deterministic filesystem-race seams used by regression tests. */
13
+ export interface RevertRunnerEnv {
14
+ afterDisplacement?: (path: string, recoveryName: string) => Promise<void>;
15
+ /** @internal deterministic race seam immediately before the reverse CAS. */
16
+ beforeMutationCommit?: (path: string) => Promise<void>;
17
+ /** @internal deterministic race seam immediately before final-state proof. */
18
+ beforeFinalVerification?: () => Promise<void>;
19
+ /** @internal deterministic post-COMMIT helper-death seam. */
20
+ testCrashHelperStage?: (path: string) => CasHelperCrashStage | undefined;
21
+ /** @internal swap/race seam before each manifest/journal filesystem proof. */
22
+ beforeJournalFileRead?: (path: string) => Promise<void> | void;
23
+ }
11
24
  /**
12
25
  * Revert the whole group's applied tree off its durable manifest + journal.
13
26
  * Reverse `promoteOrder`; clean-where-safe; idempotent + crash-resumable.
14
27
  *
15
28
  * `workingDir` is the real workspace root the team applied into.
16
29
  */
17
- export declare function revertGroup(store: RevertManifestStore, taskGroupId: string, workingDir: string): Promise<RevertResult>;
30
+ export declare function revertGroup(store: RevertManifestStore, taskGroupId: string, workingDir: string, env?: RevertRunnerEnv): Promise<RevertResult>;