chainlesschain 0.166.14 → 0.166.16

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 (195) hide show
  1. package/package.json +1 -1
  2. package/src/assets/web-panel/assets/{AIOps-C8SyFhOo.js → AIOps-CTxa2Wbq.js} +1 -1
  3. package/src/assets/web-panel/assets/{ActionButton-Dup5gFK0.js → ActionButton-DHrQyYhy.js} +1 -1
  4. package/src/assets/web-panel/assets/{Analytics-8FyOWA7V.js → Analytics-DQiUqcNl.js} +3 -3
  5. package/src/assets/web-panel/assets/{AppLayout-DBzdU9dg.js → AppLayout-_Iz4r6wt.js} +5 -5
  6. package/src/assets/web-panel/assets/{Artifacts-C_0Z8gNy.js → Artifacts-BNs63YHo.js} +1 -1
  7. package/src/assets/web-panel/assets/{Audit-Cf2a-58m.js → Audit-BgHIqRLn.js} +1 -1
  8. package/src/assets/web-panel/assets/{BackgroundAgents-M7w-2zgB.js → BackgroundAgents-DUQ5axBB.js} +1 -1
  9. package/src/assets/web-panel/assets/{Backup-CCTHQXoL.js → Backup-CJ51E9Vw.js} +1 -1
  10. package/src/assets/web-panel/assets/{BaseInput-DjXpeFwJ.js → BaseInput-o-5toA_R.js} +1 -1
  11. package/src/assets/web-panel/assets/{Chat-cAvchsJU.js → Chat-Cu7a-x1L.js} +6 -6
  12. package/src/assets/web-panel/assets/{ChatBubbleRenderer-DvEvxlZv.js → ChatBubbleRenderer-BUyYkAXr.js} +1 -1
  13. package/src/assets/web-panel/assets/{Checkbox-DKs6qvOn.js → Checkbox-DwdmZ71L.js} +1 -1
  14. package/src/assets/web-panel/assets/{Codegen-DlkA7b9X.js → Codegen-BrH2eYiP.js} +1 -1
  15. package/src/assets/web-panel/assets/{Col-CkfdKhyJ.js → Col-BVJQEP2j.js} +1 -1
  16. package/src/assets/web-panel/assets/{Community-iNXMHzj6.js → Community-FGO3vZPq.js} +1 -1
  17. package/src/assets/web-panel/assets/{Compact-DQxPEd09.js → Compact-DYGAFVnT.js} +1 -1
  18. package/src/assets/web-panel/assets/{Compliance-CSKvMCjs.js → Compliance-CRvc8Bdt.js} +1 -1
  19. package/src/assets/web-panel/assets/{Cowork-CkWqazpD.js → Cowork-D6Ah2m7A.js} +3 -3
  20. package/src/assets/web-panel/assets/{Cron-k6W8IzhB.js → Cron-AXbU2ifR.js} +2 -2
  21. package/src/assets/web-panel/assets/{Crosschain-C8MS1OuY.js → Crosschain-C5DXgEFd.js} +1 -1
  22. package/src/assets/web-panel/assets/{DID-DJuCcgiQ.js → DID-Bxh9QV9v.js} +2 -2
  23. package/src/assets/web-panel/assets/{Dashboard-LeThKzp3.js → Dashboard-B-ZHEta-.js} +2 -2
  24. package/src/assets/web-panel/assets/{Dropdown-BvxwgpE4.js → Dropdown-66Ik1jqa.js} +1 -1
  25. package/src/assets/web-panel/assets/{EmailListRenderer-n3e_a1M3.js → EmailListRenderer-CCWk1BIM.js} +1 -1
  26. package/src/assets/web-panel/assets/{FamilyGuardDashboard-509W6W6v.js → FamilyGuardDashboard--9faIULK.js} +1 -1
  27. package/src/assets/web-panel/assets/{Federation-xgZReQm0.js → Federation-CejW9CgX.js} +1 -1
  28. package/src/assets/web-panel/assets/{FormItemContext-jZOhKcQx.js → FormItemContext-acHgcXki.js} +1 -1
  29. package/src/assets/web-panel/assets/{GenericCardRenderer-Jo0ULzHv.js → GenericCardRenderer-D2ghd_K4.js} +1 -1
  30. package/src/assets/web-panel/assets/{Git-BsRcyWQP.js → Git-BOe1YJrV.js} +2 -2
  31. package/src/assets/web-panel/assets/{Governance-JlpMYTAk.js → Governance-BjgzJsof.js} +1 -1
  32. package/src/assets/web-panel/assets/{Inference-CUEz872-.js → Inference-CXCD5rnP.js} +1 -1
  33. package/src/assets/web-panel/assets/{KnowledgeGraph-DgrvvEDU.js → KnowledgeGraph-CHA8QgJT.js} +1 -1
  34. package/src/assets/web-panel/assets/{Logs-Df-KY4U3.js → Logs-DORPMcL6.js} +2 -2
  35. package/src/assets/web-panel/assets/MarkdownRenderer-CPPHz01z.js +1 -0
  36. package/src/assets/web-panel/assets/{Marketplace-kPZDTOeI.js → Marketplace-BCFlo1Yx.js} +1 -1
  37. package/src/assets/web-panel/assets/{McpTools-CRRzPqNX.js → McpTools-Dl_uZAKh.js} +2 -2
  38. package/src/assets/web-panel/assets/{Memory-D6pNSkg9.js → Memory-DupHamwz.js} +2 -2
  39. package/src/assets/web-panel/assets/{MobileBridge-g-pvtwRC.js → MobileBridge-BRSMPJxW.js} +1 -1
  40. package/src/assets/web-panel/assets/{MobileProjects-Bzayfrfe.js → MobileProjects-BHpuzsDl.js} +1 -1
  41. package/src/assets/web-panel/assets/{Mtc-B7S3W-XL.js → Mtc-Ch0jOQfZ.js} +2 -2
  42. package/src/assets/web-panel/assets/{MtcAudit-B8OMEWVb.js → MtcAudit-qzwQrDi7.js} +2 -2
  43. package/src/assets/web-panel/assets/{Multisig-CowRp7GH.js → Multisig-B5wHzUcm.js} +3 -3
  44. package/src/assets/web-panel/assets/{NLProgramming-BkQNyi4c.js → NLProgramming-Hy9uAiA0.js} +1 -1
  45. package/src/assets/web-panel/assets/{Notes-Cm7gtkKz.js → Notes-DkuchMC7.js} +4 -4
  46. package/src/assets/web-panel/assets/{NotificationSettings-CbPTVh9m.js → NotificationSettings-CYZhD7Pi.js} +1 -1
  47. package/src/assets/web-panel/assets/{OrderTableRenderer-Dswi26mJ.js → OrderTableRenderer-DKOoqajt.js} +1 -1
  48. package/src/assets/web-panel/assets/{Organization-BkjQ9yy7.js → Organization-D9AXn6j8.js} +4 -4
  49. package/src/assets/web-panel/assets/{Overflow-DmRFXP7Y.js → Overflow-Bg15J6hX.js} +1 -1
  50. package/src/assets/web-panel/assets/{P2P-DQE1toAu.js → P2P--B54HoQn.js} +2 -2
  51. package/src/assets/web-panel/assets/PdhVaultBrowser-Cz9Kk2Nb.js +7 -0
  52. package/src/assets/web-panel/assets/{Permissions-xSjfOaiU.js → Permissions-DHx38eS1.js} +4 -4
  53. package/src/assets/web-panel/assets/{PersonalDataHub-B9ICLqVP.js → PersonalDataHub-Dw8i2hAs.js} +4 -4
  54. package/src/assets/web-panel/assets/{Pipeline-CUNwyN9E.js → Pipeline-B2o6Ur2G.js} +1 -1
  55. package/src/assets/web-panel/assets/{Privacy-SOoCricX.js → Privacy-8g-h2fnu.js} +1 -1
  56. package/src/assets/web-panel/assets/{ProjectInit-CSaFul0F.js → ProjectInit-DuVTcINx.js} +2 -2
  57. package/src/assets/web-panel/assets/{ProjectSettings-CueiB_oe.js → ProjectSettings-C8njvdZX.js} +2 -2
  58. package/src/assets/web-panel/assets/Projects-Ca9BAfu7.js +1 -0
  59. package/src/assets/web-panel/assets/{Providers-CTqf_31h.js → Providers-wFqgod_W.js} +1 -1
  60. package/src/assets/web-panel/assets/{QrScannerModal-C8ZP31E9.js → QrScannerModal-9NCXrpmA.js} +1 -1
  61. package/src/assets/web-panel/assets/{QuickAsk-CPgn4713.js → QuickAsk-WUTNvFkY.js} +1 -1
  62. package/src/assets/web-panel/assets/{Recommend-8_e0zw0i.js → Recommend-xT4nYmju.js} +1 -1
  63. package/src/assets/web-panel/assets/{RemoteSession-iT7lbGqw.js → RemoteSession-fak1PBGC.js} +3 -3
  64. package/src/assets/web-panel/assets/{Reputation-B4q9SUOz.js → Reputation-D1AkQvD-.js} +1 -1
  65. package/src/assets/web-panel/assets/{Row-CA_nASyL.js → Row-DVfm6xGt.js} +1 -1
  66. package/src/assets/web-panel/assets/{RssFeed-Cwb0E3yv.js → RssFeed-BDunoLSE.js} +3 -3
  67. package/src/assets/web-panel/assets/{Search-D9iVsOxJ.js → Search-OPycRoU3.js} +1 -1
  68. package/src/assets/web-panel/assets/{Security-DPLbYchG.js → Security-C8-Fm3Dt.js} +3 -3
  69. package/src/assets/web-panel/assets/{Services-DGMVL_LF.js → Services-qM_sMpMl.js} +2 -2
  70. package/src/assets/web-panel/assets/{Skeleton-B_6kym0D.js → Skeleton-D3HBJjVF.js} +1 -1
  71. package/src/assets/web-panel/assets/{Skills-Ds6r0dXB.js → Skills-jr67X-tP.js} +1 -1
  72. package/src/assets/web-panel/assets/{Sla-BLHAbBhb.js → Sla-CS3ggyCg.js} +1 -1
  73. package/src/assets/web-panel/assets/{SpeechSettings-CZuddd14.js → SpeechSettings-CTOCYxOi.js} +1 -1
  74. package/src/assets/web-panel/assets/{SyncSettings-CdBq7oSl.js → SyncSettings-D3s3cLT5.js} +2 -2
  75. package/src/assets/web-panel/assets/{Tasks-DfT60Nyl.js → Tasks-CdfoJ25m.js} +1 -1
  76. package/src/assets/web-panel/assets/{Templates-RLfsKy2V.js → Templates-Drb4AI8X.js} +1 -1
  77. package/src/assets/web-panel/assets/{Tenant-Cw8xCNLE.js → Tenant-DzwR3Qkz.js} +1 -1
  78. package/src/assets/web-panel/assets/{Terminal-BOUkNu4f.js → Terminal-D-ESq7xp.js} +2 -2
  79. package/src/assets/web-panel/assets/{TimelineRenderer-CgGZWaRm.js → TimelineRenderer-BK-AUuws.js} +1 -1
  80. package/src/assets/web-panel/assets/{Tokens-CpwjVyir.js → Tokens-xGTouuNp.js} +1 -1
  81. package/src/assets/web-panel/assets/{Trigger-DL21H-eb.js → Trigger-BvZj-v2H.js} +1 -1
  82. package/src/assets/web-panel/assets/{Trust-B3ffFclW.js → Trust-BLC9CGmc.js} +1 -1
  83. package/src/assets/web-panel/assets/{UkeySign-CkBeb5aI.js → UkeySign-BSuCXpmE.js} +1 -1
  84. package/src/assets/web-panel/assets/{VideoEditing-U2iVaE3r.js → VideoEditing-DT3A-_Ql.js} +1 -1
  85. package/src/assets/web-panel/assets/{Wallet-CQk2wzYd.js → Wallet-c1OXao85.js} +4 -4
  86. package/src/assets/web-panel/assets/{WebAuthn-DYIuIYzT.js → WebAuthn-CuA-F7KJ.js} +5 -5
  87. package/src/assets/web-panel/assets/{WorkflowEditor-tg1c2mZQ.js → WorkflowEditor-MANZrf82.js} +1 -1
  88. package/src/assets/web-panel/assets/{chat-CtL61spq.js → chat-D4Y4Ey0O.js} +1 -1
  89. package/src/assets/web-panel/assets/{colors-DKpbeo8s.js → colors-DDH06hKO.js} +1 -1
  90. package/src/assets/web-panel/assets/{compact-item-gPZsrswt.js → compact-item-Cym756Xj.js} +1 -1
  91. package/src/assets/web-panel/assets/{createContext-CfHlwzVr.js → createContext-By4Nb1k-.js} +1 -1
  92. package/src/assets/web-panel/assets/devWarning-KO3pAGeO.js +1 -0
  93. package/src/assets/web-panel/assets/{hasIn-MV47g_6X.js → hasIn-Ch7OY258.js} +1 -1
  94. package/src/assets/web-panel/assets/{index-DMMvlLp9.js → index-6-2eYBXr.js} +1 -1
  95. package/src/assets/web-panel/assets/{index-DsH-i_3d.js → index-6CpOV3Pn.js} +1 -1
  96. package/src/assets/web-panel/assets/{index-CB1HnbNK.js → index-ArMrnx0v.js} +1 -1
  97. package/src/assets/web-panel/assets/{index-DU4rZpiK.js → index-B51otVoZ.js} +1 -1
  98. package/src/assets/web-panel/assets/{index-CRv_uMLV.js → index-BBBUn5v7.js} +1 -1
  99. package/src/assets/web-panel/assets/{index-srBc9U_s.js → index-BFydNU6a.js} +1 -1
  100. package/src/assets/web-panel/assets/{index-DnZ_zS1M.js → index-BIrRX-ra.js} +1 -1
  101. package/src/assets/web-panel/assets/{index-DGtEBodr.js → index-BZB9q-Lp.js} +1 -1
  102. package/src/assets/web-panel/assets/index-Bh4Rgkg2.js +1 -0
  103. package/src/assets/web-panel/assets/{index-BjlPD7GO.js → index-Bo20BfdS.js} +1 -1
  104. package/src/assets/web-panel/assets/{index-C_B9LiKs.js → index-CF3Lhyns.js} +1 -1
  105. package/src/assets/web-panel/assets/{index-Rb7CRMw9.js → index-CGsvEbbq.js} +1 -1
  106. package/src/assets/web-panel/assets/{index-DIeJmlAA.js → index-CJPks33Y.js} +1 -1
  107. package/src/assets/web-panel/assets/{index-xUlgG0Xe.js → index-CT-3FYwd.js} +1 -1
  108. package/src/assets/web-panel/assets/{index-6G0ETFTW.js → index-CUSUzaB8.js} +1 -1
  109. package/src/assets/web-panel/assets/{index-CzfxTSPW.js → index-CV1UC4zo.js} +1 -1
  110. package/src/assets/web-panel/assets/{index-CmPJpLoD.js → index-CV8qXTvb.js} +1 -1
  111. package/src/assets/web-panel/assets/{index-fYcS7NS0.js → index-CZn6dmZe.js} +1 -1
  112. package/src/assets/web-panel/assets/{index-Cjv0kKCU.js → index-CjNUTBwe.js} +1 -1
  113. package/src/assets/web-panel/assets/{index-Df9sWKpl.js → index-CpudmDhf.js} +1 -1
  114. package/src/assets/web-panel/assets/{index-C9RF4ieu.js → index-CykROEJA.js} +1 -1
  115. package/src/assets/web-panel/assets/{index-Zvkt9xqi.js → index-D5sADPGY.js} +1 -1
  116. package/src/assets/web-panel/assets/{index-yxxXlqBA.js → index-D9le0-dc.js} +1 -1
  117. package/src/assets/web-panel/assets/{index-BBw52sEl.js → index-DAkk1M7x.js} +1 -1
  118. package/src/assets/web-panel/assets/{index-ExAGPAnX.js → index-DNEJzc0r.js} +1 -1
  119. package/src/assets/web-panel/assets/{index-BQp5M0s1.js → index-DNlxihs8.js} +1 -1
  120. package/src/assets/web-panel/assets/{index-Ddcpj1El.js → index-DiewptTL.js} +1 -1
  121. package/src/assets/web-panel/assets/{index-BOyGUuBE.js → index-DjwgJ5Jd.js} +1 -1
  122. package/src/assets/web-panel/assets/index-Dox_coTY.js +1 -0
  123. package/src/assets/web-panel/assets/{index-CmM9jqwe.js → index-DtGValNi.js} +1 -1
  124. package/src/assets/web-panel/assets/{index-DfLyHCWi.js → index-DvnywwUj.js} +1 -1
  125. package/src/assets/web-panel/assets/{index-BN-wxSQ8.js → index-OU8DZ9BL.js} +1 -1
  126. package/src/assets/web-panel/assets/{index-D1XB5-t5.js → index-XGeQMvWK.js} +1 -1
  127. package/src/assets/web-panel/assets/{index-C4lF-f_z.js → index-ZY2Qs_Sn.js} +1 -1
  128. package/src/assets/web-panel/assets/{index-C9gtY4nG.js → index-jx7kr6mB.js} +3 -3
  129. package/src/assets/web-panel/assets/{index-C6nC_DyY.js → index-mL3nOcH6.js} +1 -1
  130. package/src/assets/web-panel/assets/{index-Dd19vRwy.js → index-oBsfUbyH.js} +1 -1
  131. package/src/assets/web-panel/assets/{index-bSFrAszw.js → index-q-s04OKn.js} +1 -1
  132. package/src/assets/web-panel/assets/{index-D_Pl1GnW.js → index-tZ5BUdad.js} +1 -1
  133. package/src/assets/web-panel/assets/{initDefaultProps-BeOZoSZ4.js → initDefaultProps-DGcX9iPP.js} +1 -1
  134. package/src/assets/web-panel/assets/{motion-BXE8VMKx.js → motion-2SeL1D8A.js} +1 -1
  135. package/src/assets/web-panel/assets/{move-I9sdvPGX.js → move-3cYbQCpS.js} +1 -1
  136. package/src/assets/web-panel/assets/{mtc-parser-d25zrJd0.js → mtc-parser-IDdxfw0z.js} +1 -1
  137. package/src/assets/web-panel/assets/{omit-D71V_T4e.js → omit-BNswdKO6.js} +1 -1
  138. package/src/assets/web-panel/assets/{pickAttrs-BNZKpIAR.js → pickAttrs-BwCnem2I.js} +1 -1
  139. package/src/assets/web-panel/assets/{placementArrow-jOcgxTTz.js → placementArrow-B9PtZ5rq.js} +1 -1
  140. package/src/assets/web-panel/assets/{responsiveObserve-pta_O8AU.js → responsiveObserve-CPB6iSzV.js} +1 -1
  141. package/src/assets/web-panel/assets/{slide-Dlq6om7z.js → slide-DZgyblZa.js} +1 -1
  142. package/src/assets/web-panel/assets/{statusUtils-BnkO_yRv.js → statusUtils-D82IBdsx.js} +1 -1
  143. package/src/assets/web-panel/assets/{styleChecker-p8NfWmcG.js → styleChecker-qSHtosM-.js} +1 -1
  144. package/src/assets/web-panel/assets/{useFlexGapSupport-KcjZZ5U7.js → useFlexGapSupport-CmWO7h0I.js} +1 -1
  145. package/src/assets/web-panel/assets/{useFs-gqonDMWB.js → useFs-yLrs_ub4.js} +1 -1
  146. package/src/assets/web-panel/assets/{usePersonalDataHub-jIIfE4go.js → usePersonalDataHub-CJ1VW6rh.js} +1 -1
  147. package/src/assets/web-panel/assets/{vnode-Dyo7fBrM.js → vnode-CzY_moQ4.js} +1 -1
  148. package/src/assets/web-panel/assets/{zoom-6l8BMg9W.js → zoom-DAa7rEY5.js} +1 -1
  149. package/src/assets/web-panel/index.html +1 -1
  150. package/src/commands/agent.js +62 -11
  151. package/src/commands/learning.js +71 -1
  152. package/src/commands/team.js +100 -3
  153. package/src/data/changelog.json +29 -3
  154. package/src/harness/worktree-isolator.js +74 -9
  155. package/src/lib/agent-team/task-lease.js +12 -1
  156. package/src/lib/agent-team/team-graph-runtime-adapter.js +6 -0
  157. package/src/lib/agent-team/team-runner.js +4 -0
  158. package/src/lib/agent-team/team-worktree.js +4 -0
  159. package/src/lib/capability-manifest.js +212 -1
  160. package/src/lib/evolution/evolution-artifact-ports.js +3277 -0
  161. package/src/lib/evolution/evolution-eval-gate.js +6442 -0
  162. package/src/lib/evolution/evolution-evidence-projector.js +3786 -0
  163. package/src/lib/evolution/evolution-ledger-ports.js +2689 -0
  164. package/src/lib/evolution/evolution-ledger.js +4280 -0
  165. package/src/lib/evolution/skill-candidate-registry.js +2258 -0
  166. package/src/lib/evolution/skill-execution-manifest.js +942 -0
  167. package/src/lib/evolution/skill-mutation-authority.js +1677 -0
  168. package/src/lib/evolution/skill-promotion-controller.js +506 -0
  169. package/src/lib/evolution/skill-release-registry.js +3277 -0
  170. package/src/lib/evolution/skill-target-matrix-eval.js +3233 -0
  171. package/src/lib/evolution/skill-writer-inventory-manifest.js +998 -0
  172. package/src/lib/evolution/skill-writer-inventory-validator.js +816 -0
  173. package/src/lib/formal-quality-eval-runtime.js +192 -0
  174. package/src/lib/graph-kernel/cutover-contract.js +7 -0
  175. package/src/lib/graph-kernel/cutover-ledger.js +8 -7
  176. package/src/lib/graph-kernel/evidence-digest.js +47 -0
  177. package/src/lib/graph-kernel/graph-runtime-surfaces.json +8 -1
  178. package/src/lib/graph-kernel/production-cutover-evidence.js +342 -15
  179. package/src/lib/graph-kernel/production-source-evidence.js +1599 -0
  180. package/src/lib/graph-kernel/retirement-evidence.js +15 -5
  181. package/src/lib/graph-kernel/runtime-surface-manifest.js +67 -2
  182. package/src/lib/headless-manifest.js +3 -1
  183. package/src/lib/learning/skill-improver.js +311 -43
  184. package/src/lib/learning/skill-synthesizer.js +236 -16
  185. package/src/lib/process-execution-broker/index.js +32 -0
  186. package/src/lib/process-execution-broker/platform-sandbox.js +5 -4
  187. package/src/lib/secure-fs.js +45 -2
  188. package/src/runtime/agent-core.js +17 -5
  189. package/src/runtime/headless-runner.js +16 -9
  190. package/src/assets/web-panel/assets/MarkdownRenderer-BEPDcSwz.js +0 -1
  191. package/src/assets/web-panel/assets/PdhVaultBrowser-BujyoDRG.js +0 -7
  192. package/src/assets/web-panel/assets/Projects-BOeXvU7y.js +0 -1
  193. package/src/assets/web-panel/assets/devWarning-DdqnMhzi.js +0 -1
  194. package/src/assets/web-panel/assets/index-BcK8o4ke.js +0 -1
  195. package/src/assets/web-panel/assets/index-DvbAjyYI.js +0 -1
@@ -8,6 +8,56 @@ import ora from "ora";
8
8
  import { logger } from "../lib/logger.js";
9
9
  import { bootstrap, shutdown } from "../runtime/bootstrap.js";
10
10
 
11
+ export function classifySynthesisResult(result) {
12
+ if (result?.status === "unavailable") {
13
+ return {
14
+ kind: "unavailable",
15
+ exitCode: 1,
16
+ message: result.reason || "Synthesis dependencies unavailable",
17
+ jsonResult: result,
18
+ };
19
+ }
20
+ if (result?.status === "error") {
21
+ return {
22
+ kind: "failed",
23
+ exitCode: 1,
24
+ message:
25
+ result.reason ||
26
+ (Array.isArray(result.errors) && result.errors.length > 0
27
+ ? result.errors.join("; ")
28
+ : "Synthesis failed"),
29
+ jsonResult: result,
30
+ };
31
+ }
32
+ const wellFormedCompletion =
33
+ result?.status === "completed" &&
34
+ Array.isArray(result.created) &&
35
+ Array.isArray(result.skipped) &&
36
+ (!Object.hasOwn(result, "errors") ||
37
+ (Array.isArray(result.errors) && result.errors.length === 0));
38
+ if (wellFormedCompletion) {
39
+ return {
40
+ kind: "completed",
41
+ exitCode: 0,
42
+ message: null,
43
+ jsonResult: result,
44
+ };
45
+ }
46
+ const invalidResult = {
47
+ status: "error",
48
+ code: "LEARNING_SYNTHESIS_INVALID_RESULT",
49
+ reason: "Synthesis returned an invalid or unknown result",
50
+ created: [],
51
+ skipped: [],
52
+ };
53
+ return {
54
+ kind: "failed",
55
+ exitCode: 1,
56
+ message: invalidResult.reason,
57
+ jsonResult: invalidResult,
58
+ };
59
+ }
60
+
11
61
  export function registerLearningCommand(program) {
12
62
  const learning = program
13
63
  .command("learning")
@@ -271,6 +321,24 @@ export function registerLearningCommand(program) {
271
321
 
272
322
  const spinner = ora("Scanning for synthesizable patterns...").start();
273
323
  const result = await synthesizer.synthesize();
324
+ const outcome = classifySynthesisResult(result);
325
+
326
+ if (outcome.exitCode !== 0) {
327
+ spinner.fail(
328
+ outcome.kind === "unavailable"
329
+ ? "Synthesis unavailable"
330
+ : "Synthesis failed",
331
+ );
332
+ if (options.json) {
333
+ console.log(JSON.stringify(outcome.jsonResult, null, 2));
334
+ } else {
335
+ logger.error(outcome.message);
336
+ }
337
+ await shutdown();
338
+ process.exitCode = outcome.exitCode;
339
+ return;
340
+ }
341
+
274
342
  spinner.succeed("Synthesis complete");
275
343
 
276
344
  if (options.json) {
@@ -278,7 +346,9 @@ export function registerLearningCommand(program) {
278
346
  } else {
279
347
  if (result.created.length > 0) {
280
348
  logger.log(
281
- chalk.green(`Created ${result.created.length} skill(s):`),
349
+ chalk.green(
350
+ `Created ${result.created.length} candidate skill(s):`,
351
+ ),
282
352
  );
283
353
  for (const name of result.created) {
284
354
  logger.log(` ${chalk.cyan(name)}`);
@@ -74,6 +74,12 @@ import {
74
74
  SecureFileIdentityError,
75
75
  withTrustedFileParentSync,
76
76
  } from "../lib/secure-file-identity.js";
77
+ import {
78
+ FORMAL_QUALITY_ALLOWED_FILES_ENV,
79
+ formalQualityChildEnvironment,
80
+ formalQualityTaskAllowedFiles,
81
+ isFormalQualityHermeticRuntime,
82
+ } from "../lib/formal-quality-eval-runtime.js";
77
83
 
78
84
  export const _deps = {
79
85
  spawn: (...args) => executionBroker.spawn(...args),
@@ -788,6 +794,35 @@ export function buildTeamAgentPrompt(prompt, { inbox = [] } = {}) {
788
794
  ].join("\n");
789
795
  }
790
796
 
797
+ export function formalQualityAgentWorkingDirectory(
798
+ worktreeRoot,
799
+ task,
800
+ environment = process.env,
801
+ ) {
802
+ const root = path.resolve(worktreeRoot);
803
+ if (!isFormalQualityHermeticRuntime(environment)) return root;
804
+ const scopes = task?.metadata?.scopePaths;
805
+ if (!Array.isArray(scopes) || scopes.length !== 1) {
806
+ throw new Error(
807
+ "Formal quality teammate requires exactly one declared scopePath",
808
+ );
809
+ }
810
+ const scoped = path.resolve(root, String(scopes[0] || ""));
811
+ const relation = path.relative(root, scoped);
812
+ if (
813
+ !relation ||
814
+ relation === ".." ||
815
+ relation.startsWith(`..${path.sep}`) ||
816
+ path.isAbsolute(relation) ||
817
+ !fs.statSync(scoped).isDirectory()
818
+ ) {
819
+ throw new Error(
820
+ "Formal quality teammate scopePath must resolve to an existing worktree subdirectory",
821
+ );
822
+ }
823
+ return scoped;
824
+ }
825
+
791
826
  function normalizePermissionMode(value) {
792
827
  const mode = String(value || "acceptEdits");
793
828
  const allowed = new Set([
@@ -876,6 +911,19 @@ export function loadRegistry(file, { ttlMs } = {}) {
876
911
  `task "${task.key}" scopePaths must be an array of at most 128 paths`,
877
912
  );
878
913
  }
914
+ if (
915
+ task.formalQualityAllowedFiles !== undefined &&
916
+ (!Array.isArray(task.formalQualityAllowedFiles) ||
917
+ task.formalQualityAllowedFiles.length === 0 ||
918
+ task.formalQualityAllowedFiles.length > 16 ||
919
+ task.formalQualityAllowedFiles.some(
920
+ (file) => typeof file !== "string" || file.length === 0,
921
+ ))
922
+ ) {
923
+ throw new Error(
924
+ `task "${task.key}" formalQualityAllowedFiles must be a non-empty array of at most 16 paths`,
925
+ );
926
+ }
879
927
  for (const field of ["command", "prompt"]) {
880
928
  if (task[field] !== undefined && typeof task[field] !== "string") {
881
929
  throw new Error(`task "${task.key}" ${field} must be a string`);
@@ -921,6 +969,9 @@ export function loadRegistry(file, { ttlMs } = {}) {
921
969
  agent: t.agent || null,
922
970
  policy: t.policy || null,
923
971
  scopePaths: Array.isArray(t.scopePaths) ? t.scopePaths : [],
972
+ formalQualityAllowedFiles: Array.isArray(t.formalQualityAllowedFiles)
973
+ ? t.formalQualityAllowedFiles
974
+ : [],
924
975
  idempotencyKey: t.idempotencyKey || null,
925
976
  retrySafe: t.retrySafe === true,
926
977
  sparsePaths: t.sparsePaths || null,
@@ -1078,6 +1129,7 @@ export function makeShellRunTask() {
1078
1129
  /** Spawn a headless `cc agent -p` for one prompt in `cwd`; resolve on exit 0. */
1079
1130
  function spawnAgentProcess(prompt, cwd, opts = {}) {
1080
1131
  return new Promise((resolve, reject) => {
1132
+ const formalQualityHermetic = isFormalQualityHermeticRuntime(process.env);
1081
1133
  const parser = new TeamAgentStreamParser({
1082
1134
  maxLineBytes: opts.maxStreamLineBytes,
1083
1135
  maxTotalBytes: opts.maxStreamTotalBytes,
@@ -1091,7 +1143,23 @@ function spawnAgentProcess(prompt, cwd, opts = {}) {
1091
1143
  "stream-json",
1092
1144
  ];
1093
1145
  if (opts.model) args.push("--model", opts.model);
1094
- if (opts.sessionId) args.push("--session", opts.sessionId);
1146
+ if (opts.sessionId && !formalQualityHermetic) {
1147
+ args.push("--session", opts.sessionId);
1148
+ }
1149
+ if (formalQualityHermetic) {
1150
+ args.push(
1151
+ "--ephemeral",
1152
+ "--bare",
1153
+ "--no-checkpoint",
1154
+ "--output-style",
1155
+ "concise",
1156
+ "--allowed-tools",
1157
+ "read_file,list_dir,search_files,write_file,edit_file,edit_file_hashed",
1158
+ );
1159
+ }
1160
+ if (opts.sandboxMode) {
1161
+ args.push("--sandbox-mode", opts.sandboxMode);
1162
+ }
1095
1163
  if (opts.checkpointRequired === true) args.push("--checkpoint");
1096
1164
  if (Number(opts.maxTurns) > 0) {
1097
1165
  args.push("--max-turns", String(opts.maxTurns));
@@ -1377,7 +1445,9 @@ function spawnAgentProcess(prompt, cwd, opts = {}) {
1377
1445
  }
1378
1446
 
1379
1447
  export function spawnAgent(prompt, cwd, opts = {}) {
1380
- if (!opts.messageBridge) return spawnAgentProcess(prompt, cwd, opts);
1448
+ if (!opts.messageBridge || isFormalQualityHermeticRuntime(process.env)) {
1449
+ return spawnAgentProcess(prompt, cwd, opts);
1450
+ }
1381
1451
  return (async () => {
1382
1452
  let bridge;
1383
1453
  try {
@@ -1456,6 +1526,7 @@ export function makeAgentRunTask(opts = {}) {
1456
1526
  );
1457
1527
  return spawnAgent(buildTeamAgentPrompt(prompt, { inbox }), process.cwd(), {
1458
1528
  ...effectiveContract,
1529
+ sandboxMode: opts.sandboxMode,
1459
1530
  sessionId: opts.sessionIdForTask?.(key, task) || null,
1460
1531
  signal,
1461
1532
  ...(mailbox && holder
@@ -2001,6 +2072,10 @@ export function registerTeamCommand(program, { logger } = {}) {
2001
2072
  .option("--agent-max-turns <n>", "Per-agent task turn cap")
2002
2073
  .option("--agent-max-budget-usd <amount>", "Per-agent task cost cap")
2003
2074
  .option("--agent-max-tokens <n>", "Per-agent task token cap")
2075
+ .option(
2076
+ "--agent-sandbox-mode <mode>",
2077
+ "Sandbox posture for each --agent task: off | workspace-write | strict",
2078
+ )
2004
2079
  .option(
2005
2080
  "--agent-max-wall <seconds>",
2006
2081
  "Per-agent task wall-clock cap in seconds",
@@ -2799,6 +2874,10 @@ export function registerTeamCommand(program, { logger } = {}) {
2799
2874
  }),
2800
2875
  graphAuthorityMode,
2801
2876
  graphAuthority: graphRuntime?.status() || null,
2877
+ graphTraceProjection:
2878
+ graphRuntime?.status()?.phase === "open"
2879
+ ? null
2880
+ : graphRuntime?.traceProjection() || null,
2802
2881
  graphShadowDivergences: [...shadowDivergences],
2803
2882
  });
2804
2883
  };
@@ -2907,9 +2986,16 @@ export function registerTeamCommand(program, { logger } = {}) {
2907
2986
  taskContractFor(key, task),
2908
2987
  budgetReservation,
2909
2988
  );
2989
+ const agentCwd = formalQualityAgentWorkingDirectory(cwd, task);
2990
+ const formalAllowedFiles = formalQualityTaskAllowedFiles(
2991
+ task.metadata?.formalQualityAllowedFiles,
2992
+ );
2993
+ const formalChildEnvironment = formalAllowedFiles
2994
+ ? formalQualityChildEnvironment(key)
2995
+ : null;
2910
2996
  return spawnAgent(
2911
2997
  buildTeamAgentPrompt(prompt, { inbox }),
2912
- cwd,
2998
+ agentCwd,
2913
2999
  {
2914
3000
  ...contract,
2915
3001
  // The outer worktree transaction is the workspace
@@ -2919,6 +3005,16 @@ export function registerTeamCommand(program, { logger } = {}) {
2919
3005
  ? false
2920
3006
  : contract.checkpointRequired,
2921
3007
  managedCheckpoint,
3008
+ sandboxMode: options.agentSandboxMode,
3009
+ ...(formalAllowedFiles
3010
+ ? {
3011
+ childEnv: {
3012
+ ...formalChildEnvironment,
3013
+ [FORMAL_QUALITY_ALLOWED_FILES_ENV]:
3014
+ JSON.stringify(formalAllowedFiles),
3015
+ },
3016
+ }
3017
+ : {}),
2922
3018
  sessionId: collaborationUnits.get(
2923
3019
  sessionTaskKeyFor(key, task),
2924
3020
  )?.sessionId,
@@ -2961,6 +3057,7 @@ export function registerTeamCommand(program, { logger } = {}) {
2961
3057
  collaborationUnits.get(sessionTaskKeyFor(key, task))?.sessionId,
2962
3058
  onMailboxMutation: persist,
2963
3059
  mailboxDurable: Boolean(options.state),
3060
+ sandboxMode: options.agentSandboxMode,
2964
3061
  });
2965
3062
  else runTask = async () => ({ dryRun: true });
2966
3063
 
@@ -1,6 +1,32 @@
1
1
  {
2
2
  "source": "CHANGELOG.md",
3
3
  "releases": [
4
+ {
5
+ "productVersion": null,
6
+ "cliVersion": "0.166.16",
7
+ "cliVersions": ["0.166.15", "0.166.16"],
8
+ "date": "2026-09-01",
9
+ "title": "",
10
+ "sections": [
11
+ {
12
+ "heading": "Fixed - cc CLI 0.166.16: harden evidence and release gates",
13
+ "body": "> `chainlesschain` **0.166.15 -> 0.166.16** (release candidate,\n> 2026-09-01).\n\n- **Authenticated evidence consumption**: protected qualification and Graph\n production consumers bind artifacts to the selected repository, workflow\n run, and exact commit, reject stale or unsigned producer runs, and keep\n GitHub API response bodies bounded.\n- **Cross-platform CI stability**: CLI and evidence matrices use the same\n pinned Node.js `22.22.2` runtime, the workflow lint gate uses a pinned\n `actionlint`, and the Windows P1 helper allows a wider outer cold-start\n budget without weakening the verifier's exact inner timeout contract.\n- **Exact RC runtime contract**: the release-candidate audit now requires the\n same Node.js `v22.22.2` runtime used by the workflows, and a unit assertion\n pins that value so future workflow/verifier drift fails closed.\n- **Large-team scheduling throughput**: priority inheritance stays cached\n across lease-only state transitions and is invalidated when priority or\n cancellation semantics change, so the 10,000-task / 64-worker qualification\n completes within the cross-platform budget without weakening donation or\n dependency ordering.\n- **Audited JetBrains steady-state qualification**: the real-host gate retains\n 40–75 readiness lifecycle samples and a stable quiescence proof before the\n governed 100-sample distribution. The `needs_input` P95 threshold remains\n strictly below 2 seconds, and both readiness and measured cycles remain bound\n to the exact fixture ledger.\n- **Canonical registry roots across host path aliases**: candidate and release\n registries canonicalize an existing ancestor alias while binding the created\n non-link leaf by filesystem identity. Leaf links and parent escapes remain\n rejected, and marketplace upgrade tests still prohibit candidate artifact\n fetches on every fail-closed validation path.\n- **Release and evidence boundary**: this candidate is not yet published;\n publication still requires the exact release commit to pass the configured\n Linux, Windows, and macOS release workflows. External P1 production rollout,\n protected-run, and trust-root evidence remains open and is not claimed by\n this source release."
14
+ }
15
+ ]
16
+ },
17
+ {
18
+ "productVersion": null,
19
+ "cliVersion": "0.166.15",
20
+ "cliVersions": ["0.166.14", "0.166.15"],
21
+ "date": "2026-08-31",
22
+ "title": "",
23
+ "sections": [
24
+ {
25
+ "heading": "Fixed - cc CLI 0.166.15: align the formal quality file-tool ceiling",
26
+ "body": "> `chainlesschain` **0.166.14 -> 0.166.15**, published 2026-08-31 from exact\n> commit `22db04f55974d2e5823772c4bae5e87171fa51db` under immutable tag\n> `v-npm-0-166-15`.\n\n- **Formal quality startup restored**: the exact hermetic file-tool ceiling now\n admits the same read, list, search, write, and edit tools exposed by the\n protected single-Agent and Graph candidate harness, so all platforms can\n advance past preflight into the real-model evaluation.\n- **One canonical tool contract**: the headless runtime and formal quality\n producer consume one frozen tool list, while the agent-loop regression proves\n the complete list remains inside the fail-closed exact mutation boundary.\n- **No shell or network widening**: `run_shell`, `run_code`, Git, MCP, plugin,\n IDE, and sub-agent tools remain unavailable; writes are still limited to the\n task's exact allowed files.\n- **Release and quality boundary**: the exact release commit passed CLI CI and\n CLI Strict Sandbox on Linux, Windows, and macOS, then completed npm OIDC\n publication and independent registry/provenance readback. The post-release\n quality decision below does not change those artifact bytes or their evidence\n identity.\n- **Post-release Windows evidence**: `main@458b342f5f` freezes the Windows\n candidate latency-ratio ceiling at `1.65`; Linux, macOS, and the aggregate\n remain at `1.5`. Exact run `33411796790`, pinned to `db53dc2da4`, passed\n Linux, macOS, and all three platforms' functional/security metrics, but its\n Windows ratio was `1.6379980224` against the then-current `1.6` ceiling, so\n the run, workflow aggregate, and OIDC attestation did not succeed. The\n offline weighted three-platform aggregate was `0.6008293973 < 1.5`.\n- **P2-3 accepted-risk closure**: after final threshold commit `917d18b055`,\n the release owner explicitly accepted the residual risk of no rerun and no\n final-SHA aggregate/OIDC evidence and closed P2-3. This does not rewrite the\n failed run as successful, is not part of the `0.166.15` artifact, and is not\n a general precedent for release gates."
27
+ }
28
+ ]
29
+ },
4
30
  {
5
31
  "productVersion": null,
6
32
  "cliVersion": "0.166.14",
@@ -10,7 +36,7 @@
10
36
  "sections": [
11
37
  {
12
38
  "heading": "Fixed - cc CLI 0.166.14: restore Docker-optional startup on Windows",
13
- "body": "> `chainlesschain` **0.166.13 -> 0.166.14** (hotfix candidate, 2026-08-30).\n\n- **Docker remains opt-in**: a normal agent session no longer probes or\n requires Docker unless the CLI flag, settings, or managed policy explicitly\n selects container isolation.\n- **Windows executable lookup**: bare commands resolve through `PATHEXT`\n before launch, so Docker Desktop's POSIX `docker` script cannot shadow\n `docker.exe` and trigger `CreateProcessAsUser` error 193.\n- **Explicit isolation stays fail-closed**: `workspace-write`, `strict`, and\n managed sandbox requirements still reject unavailable engines instead of\n silently degrading."
39
+ "body": "> `chainlesschain` **0.166.13 -> 0.166.14**, published 2026-08-30 from exact\n> commit `ee88125256b5de8281be0a8e57157811bb80c105` under immutable tag\n> `v-npm-0-166-14`.\n\n- **Docker remains opt-in**: a normal agent session no longer probes or\n requires Docker unless the CLI flag, settings, or managed policy explicitly\n selects container isolation.\n- **Windows executable lookup**: bare commands resolve through `PATHEXT`\n before launch, so Docker Desktop's POSIX `docker` script cannot shadow\n `docker.exe` and trigger `CreateProcessAsUser` error 193.\n- **Explicit isolation stays fail-closed**: `workspace-write`, `strict`, and\n managed sandbox requirements still reject unavailable engines instead of\n silently degrading.\n- **Release validation**: the exact release commit passed every configured\n Linux, Windows, and macOS job in `CLI CI` and `CLI Strict Sandbox`, then\n completed npm Trusted Publishing and public-registry readback. This was the\n public CLI baseline and is now superseded by `0.166.15`; later source-only\n Graph/Team quality evidence retains its own exact-commit boundary."
14
40
  }
15
41
  ]
16
42
  },
@@ -23,7 +49,7 @@
23
49
  "sections": [
24
50
  {
25
51
  "heading": "Fixed - cc CLI 0.166.13 and Session Core 0.3.8: fail-closed P0 security closure",
26
- "body": "> `chainlesschain` **0.166.12 -> 0.166.13** and Session Core\n> **0.3.7 -> 0.3.8** (release candidates, 2026-08-30).\n\n- **Fixed renderer IPC capabilities**: remove the environment-controlled\n generic bridge bypass and generate an exact renderer/main capability\n manifest that fails the Desktop build when it drifts.\n- **Default sandbox and approval boundary**: restore workspace-write with\n network disabled as the CLI default, deny shell execution when the approval\n gate is unavailable, and fail closed when approval policy loading or\n persistence fails.\n- **Durable process audit**: require a persistent, redacted admission record\n before high-risk process creation and retain bounded actor, session,\n authorization, policy, sandbox, and result context.\n- **Release boundary**: these versions identify the source candidates for the\n security fixes; publication still requires the exact candidate to pass the\n repository's Linux, Windows, and macOS release matrices."
52
+ "body": "> `chainlesschain` **0.166.12 -> 0.166.13** and Session Core\n> **0.3.7 -> 0.3.8**, published 2026-08-30; the CLI release commit is\n> `d44374e576e5426eb419537bef15ae83385daf05` under immutable tag\n> `v-npm-0-166-13` and is superseded by public CLI `0.166.14`.\n\n- **Fixed renderer IPC capabilities**: remove the environment-controlled\n generic bridge bypass and generate an exact renderer/main capability\n manifest that fails the Desktop build when it drifts.\n- **Default sandbox and approval boundary**: restore workspace-write with\n network disabled as the CLI default, deny shell execution when the approval\n gate is unavailable, and fail closed when approval policy loading or\n persistence fails.\n- **Durable process audit**: require a persistent, redacted admission record\n before high-risk process creation and retain bounded actor, session,\n authorization, policy, sandbox, and result context.\n- **Release boundary**: these versions closed the P0 execution-security fixes;\n CLI `0.166.14` retains the same boundary while adding the Windows\n Docker-optional startup repair."
27
53
  }
28
54
  ]
29
55
  },
@@ -36,7 +62,7 @@
36
62
  "sections": [
37
63
  {
38
64
  "heading": "Added - cc CLI 0.166.12: durable rollout storage and converged Hooks v2",
39
- "body": "> `chainlesschain` **0.166.10 -> 0.166.12** (release candidate,\n> 2026-08-30). The immutable `0.166.11` candidate was withheld after its npm\n> workflow could not bootstrap the new scoped runtime dependency; its tag is\n> not reused. Coordinated candidates are Context/Memory Kernel `0.1.0`,\n> Session Core `0.3.7`, Agent Protocol `0.1.7`, TypeScript Agent SDK `0.2.7`,\n> Python Agent SDK `0.2.7`, VS Code `0.37.75`, and JetBrains `0.4.105`.\n\n- **Canonical context planning**: ship deterministic budget allocation,\n compaction, memory reducers, inventory validation, and cross-surface\n conformance through `@chainlesschain/context-memory-kernel`.\n- **Durable memory cutover**: route CLI context, compaction, hierarchical\n memory, App Server, WebSocket, REPL, and session flows through fail-closed\n authority stages with crash-safe persistence and privacy purge receipts;\n Session Core `0.3.7` exposes the write guard used to fence legacy writers.\n- **Protocol and SDK projections**: add bounded Context/Memory messages and App\n Server pilot clients to the generated Agent Protocol, TypeScript SDK, Python\n SDK, VS Code extension, and JetBrains plugin without granting IDE surfaces\n independent write authority.\n- **Durable rollout stores**: converge App Server, WebSocket, and CLI entry\n points on bounded memory, JSON, or SQLite rollout stores with explicit\n selection, migration, recovery, and corruption handling.\n- **Hooks v2 convergence**: route CLI, REPL, headless, settings, plugins, and\n App Server through one trust-aware event runtime with deterministic ordering,\n audit replay, timeout supervision, and fail-closed decision semantics.\n- **Release integrity**: publish the new fixed CLI runtime dependency before\n the immutable CLI tarball, then verify its registry bytes and npm provenance\n against the exact release tag and commit."
65
+ "body": "> `chainlesschain` **0.166.10 -> 0.166.12** (2026-08-30 capability baseline,\n> now included in public `0.166.14`). The immutable `0.166.11` candidate was withheld after its npm\n> workflow could not bootstrap the new scoped runtime dependency; its tag is\n> not reused. Coordinated candidates are Context/Memory Kernel `0.1.0`,\n> Session Core `0.3.7`, Agent Protocol `0.1.7`, TypeScript Agent SDK `0.2.7`,\n> Python Agent SDK `0.2.7`, VS Code `0.37.75`, and JetBrains `0.4.105`.\n\n- **Canonical context planning**: ship deterministic budget allocation,\n compaction, memory reducers, inventory validation, and cross-surface\n conformance through `@chainlesschain/context-memory-kernel`.\n- **Durable memory cutover**: route CLI context, compaction, hierarchical\n memory, App Server, WebSocket, REPL, and session flows through fail-closed\n authority stages with crash-safe persistence and privacy purge receipts;\n Session Core `0.3.7` exposes the write guard used to fence legacy writers.\n- **Protocol and SDK projections**: add bounded Context/Memory messages and App\n Server pilot clients to the generated Agent Protocol, TypeScript SDK, Python\n SDK, VS Code extension, and JetBrains plugin without granting IDE surfaces\n independent write authority.\n- **Durable rollout stores**: converge App Server, WebSocket, and CLI entry\n points on bounded memory, JSON, or SQLite rollout stores with explicit\n selection, migration, recovery, and corruption handling.\n- **Hooks v2 convergence**: route CLI, REPL, headless, settings, plugins, and\n App Server through one trust-aware event runtime with deterministic ordering,\n audit replay, timeout supervision, and fail-closed decision semantics.\n- **Release integrity**: publish the new fixed CLI runtime dependency before\n the immutable CLI tarball, then verify its registry bytes and npm provenance\n against the exact release tag and commit."
40
66
  }
41
67
  ]
42
68
  },
@@ -173,7 +173,7 @@ function parseRegisteredWorktrees(output) {
173
173
 
174
174
  function readRegisteredWorktrees(repoDir) {
175
175
  return parseRegisteredWorktrees(
176
- gitExec("worktree list --porcelain", repoDir),
176
+ gitExecArgs(["worktree", "list", "--porcelain"], repoDir),
177
177
  );
178
178
  }
179
179
 
@@ -251,10 +251,16 @@ function assertNoSymlinkAncestors(root, target, label) {
251
251
  }
252
252
  }
253
253
 
254
+ function managedWorktreePathFromContext(context, branchName) {
255
+ return resolve(context.managedRoot, branchName.replace(/\//g, "-"));
256
+ }
257
+
254
258
  export function managedWorktreePath(repoDir, branchName) {
255
259
  assertSafeGitRef(branchName, "branch name");
256
- const { managedRoot } = repositoryManagementContext(repoDir);
257
- return resolve(managedRoot, branchName.replace(/\//g, "-"));
260
+ return managedWorktreePathFromContext(
261
+ repositoryManagementContext(repoDir),
262
+ branchName,
263
+ );
258
264
  }
259
265
 
260
266
  /**
@@ -262,10 +268,11 @@ export function managedWorktreePath(repoDir, branchName) {
262
268
  * removal. Managed worktrees are direct children of `<repo>/.worktrees` and,
263
269
  * when a branch is known, have exactly the deterministic path created for it.
264
270
  */
265
- export function assertManagedWorktreePath(
271
+ function assertManagedWorktreePathWithContext(
266
272
  repoDir,
267
273
  worktreePath,
268
274
  { branchName = null } = {},
275
+ context,
269
276
  ) {
270
277
  if (
271
278
  typeof repoDir !== "string" ||
@@ -280,7 +287,6 @@ export function assertManagedWorktreePath(
280
287
  assertSafeGitRef(branchName, "branch name");
281
288
  }
282
289
 
283
- const context = repositoryManagementContext(repoDir);
284
290
  const candidate = resolve(worktreePath);
285
291
  const candidatePath = canonicalExistingPrefixPath(candidate);
286
292
  const candidateIdentity = normalizeFilesystemPath(candidatePath);
@@ -335,6 +341,19 @@ export function assertManagedWorktreePath(
335
341
  return candidatePath;
336
342
  }
337
343
 
344
+ export function assertManagedWorktreePath(
345
+ repoDir,
346
+ worktreePath,
347
+ options = {},
348
+ ) {
349
+ return assertManagedWorktreePathWithContext(
350
+ repoDir,
351
+ worktreePath,
352
+ options,
353
+ repositoryManagementContext(repoDir),
354
+ );
355
+ }
356
+
338
357
  function pathSeparator() {
339
358
  return process.platform === "win32" ? "\\" : "/";
340
359
  }
@@ -404,10 +423,11 @@ export function createWorktree(repoDir, branchName, baseBranch, options = {}) {
404
423
 
405
424
  const context = repositoryManagementContext(repoDir);
406
425
  ensureManagedWorktreeExcluded(context);
407
- const worktreePath = assertManagedWorktreePath(
426
+ const worktreePath = assertManagedWorktreePathWithContext(
408
427
  repoDir,
409
- managedWorktreePath(repoDir, branchName),
428
+ managedWorktreePathFromContext(context, branchName),
410
429
  { branchName },
430
+ context,
411
431
  );
412
432
 
413
433
  if (existsSync(worktreePath)) {
@@ -449,7 +469,12 @@ export function createWorktree(repoDir, branchName, baseBranch, options = {}) {
449
469
  )
450
470
  .trim()
451
471
  .toLowerCase();
452
- assertManagedWorktreePath(repoDir, worktreePath, { branchName });
472
+ assertManagedWorktreePathWithContext(
473
+ repoDir,
474
+ worktreePath,
475
+ { branchName },
476
+ repositoryManagementContext(repoDir),
477
+ );
453
478
  // Sparse checkout: only materialize the packages this task needs. For a
454
479
  // large monorepo this cuts worktree creation time and disk. Cone mode wants
455
480
  // directory paths — our sparsePaths are package dirs. Fail-closed on unsafe
@@ -1067,6 +1092,44 @@ export function previewWorktreeMerge(repoDir, branchName, options = {}) {
1067
1092
  throw new Error(`Worktree not found for branch: ${branchName}`);
1068
1093
  }
1069
1094
 
1095
+ // Prefer Git's read-only merge-tree for the overwhelmingly common clean
1096
+ // preview. It computes the same recursive merge result without mutating the
1097
+ // task worktree and then running a second process to abort it. A conflict or
1098
+ // an older Git falls back to the established worktree-based path below so
1099
+ // detailed conflict summaries and compatibility remain unchanged.
1100
+ try {
1101
+ const previewTree = gitExecArgs(
1102
+ ["merge-tree", "--write-tree", baseBranch, branchName],
1103
+ repoDir,
1104
+ )
1105
+ .split(/\r?\n/u)[0]
1106
+ ?.trim();
1107
+ if (/^[a-f0-9]{40,64}$/iu.test(previewTree || "")) {
1108
+ return {
1109
+ success: true,
1110
+ previewOnly: true,
1111
+ strategy,
1112
+ branch: branchName,
1113
+ baseBranch,
1114
+ message: `Merge preview is clean. ${branchName} can be merged into ${baseBranch} without conflicts.`,
1115
+ summary: {
1116
+ conflictedFiles: 0,
1117
+ bothModified: 0,
1118
+ bothAdded: 0,
1119
+ deleteModify: 0,
1120
+ },
1121
+ conflicts: [],
1122
+ suggestions: [
1123
+ `No merge conflicts detected between ${branchName} and ${baseBranch}.`,
1124
+ "You can proceed with the final merge when ready.",
1125
+ ],
1126
+ previewEntrypoints: [],
1127
+ };
1128
+ }
1129
+ } catch {
1130
+ // Conflict/unsupported Git: preserve the detailed compatibility path.
1131
+ }
1132
+
1070
1133
  _abortMergeIfPresent(worktree.path);
1071
1134
 
1072
1135
  let mergeStarted = false;
@@ -1626,7 +1689,9 @@ function _resolveBaseBranchForMerge(repoDir, baseBranch) {
1626
1689
  }
1627
1690
 
1628
1691
  try {
1629
- return gitExec("rev-parse --abbrev-ref HEAD", repoDir) || "HEAD";
1692
+ return (
1693
+ gitExecArgs(["rev-parse", "--abbrev-ref", "HEAD"], repoDir) || "HEAD"
1694
+ );
1630
1695
  } catch (_e) {
1631
1696
  return "HEAD";
1632
1697
  }
@@ -1988,7 +1988,18 @@ export class TaskLeaseRegistry {
1988
1988
  patch,
1989
1989
  actor: patch.assignee,
1990
1990
  });
1991
- if (patch.status !== undefined) this._priorityInheritanceCache = null;
1991
+ // Lease lifecycle changes do not alter the dependency-priority graph.
1992
+ // In particular, a successfully completed task can only have completed
1993
+ // ancestors because acquire() gates on every dependency. Cancelling is
1994
+ // different: recovery may fail a blocked descendant closed, which must
1995
+ // withdraw its donated priority from unfinished ancestors.
1996
+ if (
1997
+ (patch.priority !== undefined && patch.priority !== task.priority) ||
1998
+ (patch.status === TASK_STATUS.CANCELLED &&
1999
+ task.status !== TASK_STATUS.CANCELLED)
2000
+ ) {
2001
+ this._priorityInheritanceCache = null;
2002
+ }
1992
2003
  return true;
1993
2004
  } catch {
1994
2005
  // ConcurrencyError (rev changed under us) — caller re-reads and retries.
@@ -7,6 +7,7 @@ import {
7
7
  import { GraphEventStore } from "../graph-kernel/event-store.js";
8
8
  import { GraphKernel } from "../graph-kernel/runtime.js";
9
9
  import { createGraphAuthorityBinding } from "../graph-kernel/authority.js";
10
+ import { reduceGraphTrace } from "../graph-kernel/trace-reducer.js";
10
11
 
11
12
  const IDENTIFIER = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,159}$/u;
12
13
  const DIGEST = /^sha256:[a-f0-9]{64}$/u;
@@ -1906,6 +1907,11 @@ export class TeamGraphRuntimeAdapter {
1906
1907
  return this.kernel.getRun(this.runId);
1907
1908
  }
1908
1909
 
1910
+ traceProjection(options = {}) {
1911
+ if (!this.kernel || !this.runId) return null;
1912
+ return reduceGraphTrace(this.kernel.events(this.runId), options);
1913
+ }
1914
+
1909
1915
  events(options = {}) {
1910
1916
  if (!this.kernel || !this.runId) return [];
1911
1917
  return this.kernel.events(this.runId, options);
@@ -2785,6 +2785,10 @@ export class TeamRunner {
2785
2785
  key,
2786
2786
  holder,
2787
2787
  error: failure?.message || String(failure),
2788
+ code: failure?.code || null,
2789
+ exitCode: Number.isInteger(failure?.exitCode)
2790
+ ? failure.exitCode
2791
+ : null,
2788
2792
  retry: outcome.retry === true,
2789
2793
  attempts: outcome.attempts,
2790
2794
  interrupted: failure?.code === "TEAM_TASK_HUMAN_INTERRUPTED",
@@ -1974,6 +1974,10 @@ export class TeamWorktreeCoordinator {
1974
1974
  ...(executionResult?.usageRecords
1975
1975
  ? { usageRecords: executionResult.usageRecords }
1976
1976
  : {}),
1977
+ terminalEvidence: {
1978
+ ...(executionResult?.terminalEvidence || {}),
1979
+ commit: commitOid,
1980
+ },
1977
1981
  };
1978
1982
  };
1979
1983