@productbrain/cli 0.1.0-beta.83 → 0.1.0-beta.8304

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 (1460) hide show
  1. package/README.md +11 -2
  2. package/dist/__tests__/adapters.test.js +76 -23
  3. package/dist/__tests__/adapters.test.js.map +1 -1
  4. package/dist/__tests__/adminConfig.test.d.ts +18 -0
  5. package/dist/__tests__/adminConfig.test.d.ts.map +1 -0
  6. package/dist/__tests__/adminConfig.test.js +221 -0
  7. package/dist/__tests__/adminConfig.test.js.map +1 -0
  8. package/dist/__tests__/audit.test.js +86 -28
  9. package/dist/__tests__/audit.test.js.map +1 -1
  10. package/dist/__tests__/batch-transformations.test.js +2 -26
  11. package/dist/__tests__/batch-transformations.test.js.map +1 -1
  12. package/dist/__tests__/canonicalRefs.vocab.test.d.ts +2 -0
  13. package/dist/__tests__/canonicalRefs.vocab.test.d.ts.map +1 -0
  14. package/dist/__tests__/canonicalRefs.vocab.test.js +251 -0
  15. package/dist/__tests__/canonicalRefs.vocab.test.js.map +1 -0
  16. package/dist/__tests__/capture-receipt-coaching.test.d.ts +2 -0
  17. package/dist/__tests__/capture-receipt-coaching.test.d.ts.map +1 -0
  18. package/dist/__tests__/capture-receipt-coaching.test.js +89 -0
  19. package/dist/__tests__/capture-receipt-coaching.test.js.map +1 -0
  20. package/dist/__tests__/capture-receipt-spine-floor.test.d.ts +2 -0
  21. package/dist/__tests__/capture-receipt-spine-floor.test.d.ts.map +1 -0
  22. package/dist/__tests__/capture-receipt-spine-floor.test.js +45 -0
  23. package/dist/__tests__/capture-receipt-spine-floor.test.js.map +1 -0
  24. package/dist/__tests__/capture.test.js +1292 -73
  25. package/dist/__tests__/capture.test.js.map +1 -1
  26. package/dist/__tests__/client-binding-guard.test.d.ts +2 -0
  27. package/dist/__tests__/client-binding-guard.test.d.ts.map +1 -0
  28. package/dist/__tests__/client-binding-guard.test.js +84 -0
  29. package/dist/__tests__/client-binding-guard.test.js.map +1 -0
  30. package/dist/__tests__/coaching-mirror-drift.test.d.ts +2 -0
  31. package/dist/__tests__/coaching-mirror-drift.test.d.ts.map +1 -0
  32. package/dist/__tests__/coaching-mirror-drift.test.js +47 -0
  33. package/dist/__tests__/coaching-mirror-drift.test.js.map +1 -0
  34. package/dist/__tests__/codex-prep-parity.test.d.ts +2 -0
  35. package/dist/__tests__/codex-prep-parity.test.d.ts.map +1 -0
  36. package/dist/__tests__/codex-prep-parity.test.js +100 -0
  37. package/dist/__tests__/codex-prep-parity.test.js.map +1 -0
  38. package/dist/__tests__/collection-registry-seed-drift.test.d.ts +2 -0
  39. package/dist/__tests__/collection-registry-seed-drift.test.d.ts.map +1 -0
  40. package/dist/__tests__/collection-registry-seed-drift.test.js +107 -0
  41. package/dist/__tests__/collection-registry-seed-drift.test.js.map +1 -0
  42. package/dist/__tests__/config-prod-fallthrough.test.d.ts +2 -0
  43. package/dist/__tests__/config-prod-fallthrough.test.d.ts.map +1 -0
  44. package/dist/__tests__/config-prod-fallthrough.test.js +93 -0
  45. package/dist/__tests__/config-prod-fallthrough.test.js.map +1 -0
  46. package/dist/__tests__/config.test.d.ts +1 -1
  47. package/dist/__tests__/config.test.js +845 -18
  48. package/dist/__tests__/config.test.js.map +1 -1
  49. package/dist/__tests__/constants.test.js +6 -1
  50. package/dist/__tests__/constants.test.js.map +1 -1
  51. package/dist/__tests__/constellation.test.js +26 -14
  52. package/dist/__tests__/constellation.test.js.map +1 -1
  53. package/dist/__tests__/conversation.test.d.ts +2 -0
  54. package/dist/__tests__/conversation.test.d.ts.map +1 -0
  55. package/dist/__tests__/conversation.test.js +113 -0
  56. package/dist/__tests__/conversation.test.js.map +1 -0
  57. package/dist/__tests__/entry-formatter.test.d.ts +2 -0
  58. package/dist/__tests__/entry-formatter.test.d.ts.map +1 -0
  59. package/dist/__tests__/entry-formatter.test.js +129 -0
  60. package/dist/__tests__/entry-formatter.test.js.map +1 -0
  61. package/dist/__tests__/entry-preflight.test.d.ts +2 -0
  62. package/dist/__tests__/entry-preflight.test.d.ts.map +1 -0
  63. package/dist/__tests__/entry-preflight.test.js +58 -0
  64. package/dist/__tests__/entry-preflight.test.js.map +1 -0
  65. package/dist/__tests__/entryAccept-batch.test.d.ts +2 -0
  66. package/dist/__tests__/entryAccept-batch.test.d.ts.map +1 -0
  67. package/dist/__tests__/entryAccept-batch.test.js +305 -0
  68. package/dist/__tests__/entryAccept-batch.test.js.map +1 -0
  69. package/dist/__tests__/entryAccept.test.d.ts +2 -0
  70. package/dist/__tests__/entryAccept.test.d.ts.map +1 -0
  71. package/dist/__tests__/entryAccept.test.js +464 -0
  72. package/dist/__tests__/entryAccept.test.js.map +1 -0
  73. package/dist/__tests__/entryDiscardResolve.test.d.ts +2 -0
  74. package/dist/__tests__/entryDiscardResolve.test.d.ts.map +1 -0
  75. package/dist/__tests__/entryDiscardResolve.test.js +28 -0
  76. package/dist/__tests__/entryDiscardResolve.test.js.map +1 -0
  77. package/dist/__tests__/entryOwn.test.d.ts +2 -0
  78. package/dist/__tests__/entryOwn.test.d.ts.map +1 -0
  79. package/dist/__tests__/entryOwn.test.js +50 -0
  80. package/dist/__tests__/entryOwn.test.js.map +1 -0
  81. package/dist/__tests__/entryTick.test.d.ts +2 -0
  82. package/dist/__tests__/entryTick.test.d.ts.map +1 -0
  83. package/dist/__tests__/entryTick.test.js +40 -0
  84. package/dist/__tests__/entryTick.test.js.map +1 -0
  85. package/dist/__tests__/envelope-contract.test.d.ts +15 -0
  86. package/dist/__tests__/envelope-contract.test.d.ts.map +1 -0
  87. package/dist/__tests__/envelope-contract.test.js +154 -0
  88. package/dist/__tests__/envelope-contract.test.js.map +1 -0
  89. package/dist/__tests__/errors.test.js +46 -0
  90. package/dist/__tests__/errors.test.js.map +1 -1
  91. package/dist/__tests__/fields.test.js +14 -3
  92. package/dist/__tests__/fields.test.js.map +1 -1
  93. package/dist/__tests__/gateway-dry-run-timeout.test.d.ts +2 -0
  94. package/dist/__tests__/gateway-dry-run-timeout.test.d.ts.map +1 -0
  95. package/dist/__tests__/gateway-dry-run-timeout.test.js +70 -0
  96. package/dist/__tests__/gateway-dry-run-timeout.test.js.map +1 -0
  97. package/dist/__tests__/gateway-timeout-body-phase.test.d.ts +2 -0
  98. package/dist/__tests__/gateway-timeout-body-phase.test.d.ts.map +1 -0
  99. package/dist/__tests__/gateway-timeout-body-phase.test.js +121 -0
  100. package/dist/__tests__/gateway-timeout-body-phase.test.js.map +1 -0
  101. package/dist/__tests__/handshake-augment.test.d.ts +2 -0
  102. package/dist/__tests__/handshake-augment.test.d.ts.map +1 -0
  103. package/dist/__tests__/handshake-augment.test.js +406 -0
  104. package/dist/__tests__/handshake-augment.test.js.map +1 -0
  105. package/dist/__tests__/handshake-dormancy.test.d.ts +2 -0
  106. package/dist/__tests__/handshake-dormancy.test.d.ts.map +1 -0
  107. package/dist/__tests__/handshake-dormancy.test.js +24 -0
  108. package/dist/__tests__/handshake-dormancy.test.js.map +1 -0
  109. package/dist/__tests__/handshake-formatter.test.d.ts +2 -0
  110. package/dist/__tests__/handshake-formatter.test.d.ts.map +1 -0
  111. package/dist/__tests__/handshake-formatter.test.js +111 -0
  112. package/dist/__tests__/handshake-formatter.test.js.map +1 -0
  113. package/dist/__tests__/handshake-preview.test.d.ts +2 -0
  114. package/dist/__tests__/handshake-preview.test.d.ts.map +1 -0
  115. package/dist/__tests__/handshake-preview.test.js +473 -0
  116. package/dist/__tests__/handshake-preview.test.js.map +1 -0
  117. package/dist/__tests__/handshake-session-threading.test.d.ts +2 -0
  118. package/dist/__tests__/handshake-session-threading.test.d.ts.map +1 -0
  119. package/dist/__tests__/handshake-session-threading.test.js +184 -0
  120. package/dist/__tests__/handshake-session-threading.test.js.map +1 -0
  121. package/dist/__tests__/handshake.e2e.test.d.ts +2 -0
  122. package/dist/__tests__/handshake.e2e.test.d.ts.map +1 -0
  123. package/dist/__tests__/handshake.e2e.test.js +226 -0
  124. package/dist/__tests__/handshake.e2e.test.js.map +1 -0
  125. package/dist/__tests__/handshake.test.js +828 -4
  126. package/dist/__tests__/handshake.test.js.map +1 -1
  127. package/dist/__tests__/health-gap-kinds-drift.test.d.ts +2 -0
  128. package/dist/__tests__/health-gap-kinds-drift.test.d.ts.map +1 -0
  129. package/dist/__tests__/health-gap-kinds-drift.test.js +43 -0
  130. package/dist/__tests__/health-gap-kinds-drift.test.js.map +1 -0
  131. package/dist/__tests__/hook-intents.test.d.ts +2 -0
  132. package/dist/__tests__/hook-intents.test.d.ts.map +1 -0
  133. package/dist/__tests__/hook-intents.test.js +184 -0
  134. package/dist/__tests__/hook-intents.test.js.map +1 -0
  135. package/dist/__tests__/ingest.test.js +9 -0
  136. package/dist/__tests__/ingest.test.js.map +1 -1
  137. package/dist/__tests__/init.test.js +51 -14
  138. package/dist/__tests__/init.test.js.map +1 -1
  139. package/dist/__tests__/kernel-value-sets-drift.test.d.ts +2 -0
  140. package/dist/__tests__/kernel-value-sets-drift.test.d.ts.map +1 -0
  141. package/dist/__tests__/kernel-value-sets-drift.test.js +46 -0
  142. package/dist/__tests__/kernel-value-sets-drift.test.js.map +1 -0
  143. package/dist/__tests__/kernel-value-sets-generator.test.d.ts +2 -0
  144. package/dist/__tests__/kernel-value-sets-generator.test.d.ts.map +1 -0
  145. package/dist/__tests__/kernel-value-sets-generator.test.js +108 -0
  146. package/dist/__tests__/kernel-value-sets-generator.test.js.map +1 -0
  147. package/dist/__tests__/manifest.test.d.ts +6 -0
  148. package/dist/__tests__/manifest.test.d.ts.map +1 -0
  149. package/dist/__tests__/manifest.test.js +255 -0
  150. package/dist/__tests__/manifest.test.js.map +1 -0
  151. package/dist/__tests__/method-publish-coherency.test.d.ts +9 -0
  152. package/dist/__tests__/method-publish-coherency.test.d.ts.map +1 -0
  153. package/dist/__tests__/method-publish-coherency.test.js +71 -0
  154. package/dist/__tests__/method-publish-coherency.test.js.map +1 -0
  155. package/dist/__tests__/method-registry.integration.test.d.ts +6 -0
  156. package/dist/__tests__/method-registry.integration.test.d.ts.map +1 -0
  157. package/dist/__tests__/method-registry.integration.test.js +17 -0
  158. package/dist/__tests__/method-registry.integration.test.js.map +1 -0
  159. package/dist/__tests__/method-registry.test.d.ts +12 -0
  160. package/dist/__tests__/method-registry.test.d.ts.map +1 -0
  161. package/dist/__tests__/method-registry.test.js +86 -0
  162. package/dist/__tests__/method-registry.test.js.map +1 -0
  163. package/dist/__tests__/missingPin.test.d.ts +11 -0
  164. package/dist/__tests__/missingPin.test.d.ts.map +1 -0
  165. package/dist/__tests__/missingPin.test.js +233 -0
  166. package/dist/__tests__/missingPin.test.js.map +1 -0
  167. package/dist/__tests__/notice-marker.test.d.ts +2 -0
  168. package/dist/__tests__/notice-marker.test.d.ts.map +1 -0
  169. package/dist/__tests__/notice-marker.test.js +176 -0
  170. package/dist/__tests__/notice-marker.test.js.map +1 -0
  171. package/dist/__tests__/onboarding-path-b.test.js +4 -4
  172. package/dist/__tests__/onboarding-path-b.test.js.map +1 -1
  173. package/dist/__tests__/onboarding.test.js +29 -5
  174. package/dist/__tests__/onboarding.test.js.map +1 -1
  175. package/dist/__tests__/onboardingFallback.test.d.ts +2 -0
  176. package/dist/__tests__/onboardingFallback.test.d.ts.map +1 -0
  177. package/dist/__tests__/onboardingFallback.test.js +74 -0
  178. package/dist/__tests__/onboardingFallback.test.js.map +1 -0
  179. package/dist/__tests__/orient.test.js +493 -17
  180. package/dist/__tests__/orient.test.js.map +1 -1
  181. package/dist/__tests__/perimeter.test.d.ts +2 -0
  182. package/dist/__tests__/perimeter.test.d.ts.map +1 -0
  183. package/dist/__tests__/perimeter.test.js +165 -0
  184. package/dist/__tests__/perimeter.test.js.map +1 -0
  185. package/dist/__tests__/personal-layer.test.d.ts +11 -0
  186. package/dist/__tests__/personal-layer.test.d.ts.map +1 -0
  187. package/dist/__tests__/personal-layer.test.js +268 -0
  188. package/dist/__tests__/personal-layer.test.js.map +1 -0
  189. package/dist/__tests__/preview-key-refresh.test.d.ts +2 -0
  190. package/dist/__tests__/preview-key-refresh.test.d.ts.map +1 -0
  191. package/dist/__tests__/preview-key-refresh.test.js +126 -0
  192. package/dist/__tests__/preview-key-refresh.test.js.map +1 -0
  193. package/dist/__tests__/profiles.test.js +613 -5
  194. package/dist/__tests__/profiles.test.js.map +1 -1
  195. package/dist/__tests__/proof-run.test.d.ts +2 -0
  196. package/dist/__tests__/proof-run.test.d.ts.map +1 -0
  197. package/dist/__tests__/proof-run.test.js +255 -0
  198. package/dist/__tests__/proof-run.test.js.map +1 -0
  199. package/dist/__tests__/rate-limit-resilience.test.d.ts +7 -0
  200. package/dist/__tests__/rate-limit-resilience.test.d.ts.map +1 -0
  201. package/dist/__tests__/rate-limit-resilience.test.js +209 -0
  202. package/dist/__tests__/rate-limit-resilience.test.js.map +1 -0
  203. package/dist/__tests__/read-target-notice.test.d.ts +2 -0
  204. package/dist/__tests__/read-target-notice.test.d.ts.map +1 -0
  205. package/dist/__tests__/read-target-notice.test.js +129 -0
  206. package/dist/__tests__/read-target-notice.test.js.map +1 -0
  207. package/dist/__tests__/relate.test.js +246 -14
  208. package/dist/__tests__/relate.test.js.map +1 -1
  209. package/dist/__tests__/repo-detect.test.js +18 -38
  210. package/dist/__tests__/repo-detect.test.js.map +1 -1
  211. package/dist/__tests__/reportedProfile.test.d.ts +2 -0
  212. package/dist/__tests__/reportedProfile.test.d.ts.map +1 -0
  213. package/dist/__tests__/reportedProfile.test.js +328 -0
  214. package/dist/__tests__/reportedProfile.test.js.map +1 -0
  215. package/dist/__tests__/restore.test.d.ts +2 -0
  216. package/dist/__tests__/restore.test.d.ts.map +1 -0
  217. package/dist/__tests__/restore.test.js +85 -0
  218. package/dist/__tests__/restore.test.js.map +1 -0
  219. package/dist/__tests__/route-latency-budget.test.d.ts +2 -0
  220. package/dist/__tests__/route-latency-budget.test.d.ts.map +1 -0
  221. package/dist/__tests__/route-latency-budget.test.js +105 -0
  222. package/dist/__tests__/route-latency-budget.test.js.map +1 -0
  223. package/dist/__tests__/runner.test.js +59 -44
  224. package/dist/__tests__/runner.test.js.map +1 -1
  225. package/dist/__tests__/session-binding-refusal-tenant.test.d.ts +2 -0
  226. package/dist/__tests__/session-binding-refusal-tenant.test.d.ts.map +1 -0
  227. package/dist/__tests__/session-binding-refusal-tenant.test.js +112 -0
  228. package/dist/__tests__/session-binding-refusal-tenant.test.js.map +1 -0
  229. package/dist/__tests__/session-close-loop.test.d.ts +2 -0
  230. package/dist/__tests__/session-close-loop.test.d.ts.map +1 -0
  231. package/dist/__tests__/session-close-loop.test.js +213 -0
  232. package/dist/__tests__/session-close-loop.test.js.map +1 -0
  233. package/dist/__tests__/session-label.test.d.ts +2 -0
  234. package/dist/__tests__/session-label.test.d.ts.map +1 -0
  235. package/dist/__tests__/session-label.test.js +46 -0
  236. package/dist/__tests__/session-label.test.js.map +1 -0
  237. package/dist/__tests__/session-list-show.test.d.ts +2 -0
  238. package/dist/__tests__/session-list-show.test.d.ts.map +1 -0
  239. package/dist/__tests__/session-list-show.test.js +174 -0
  240. package/dist/__tests__/session-list-show.test.js.map +1 -0
  241. package/dist/__tests__/session-reset.test.d.ts +2 -0
  242. package/dist/__tests__/session-reset.test.d.ts.map +1 -0
  243. package/dist/__tests__/session-reset.test.js +138 -0
  244. package/dist/__tests__/session-reset.test.js.map +1 -0
  245. package/dist/__tests__/session-resume-backstop.test.d.ts +2 -0
  246. package/dist/__tests__/session-resume-backstop.test.d.ts.map +1 -0
  247. package/dist/__tests__/session-resume-backstop.test.js +139 -0
  248. package/dist/__tests__/session-resume-backstop.test.js.map +1 -0
  249. package/dist/__tests__/session-role-name-sanitize.test.d.ts +2 -0
  250. package/dist/__tests__/session-role-name-sanitize.test.d.ts.map +1 -0
  251. package/dist/__tests__/session-role-name-sanitize.test.js +120 -0
  252. package/dist/__tests__/session-role-name-sanitize.test.js.map +1 -0
  253. package/dist/__tests__/session-start-key-refresh.test.d.ts +2 -0
  254. package/dist/__tests__/session-start-key-refresh.test.d.ts.map +1 -0
  255. package/dist/__tests__/session-start-key-refresh.test.js +191 -0
  256. package/dist/__tests__/session-start-key-refresh.test.js.map +1 -0
  257. package/dist/__tests__/session-state-machine.test.js +235 -10
  258. package/dist/__tests__/session-state-machine.test.js.map +1 -1
  259. package/dist/__tests__/session-switch.test.d.ts +2 -0
  260. package/dist/__tests__/session-switch.test.d.ts.map +1 -0
  261. package/dist/__tests__/session-switch.test.js +267 -0
  262. package/dist/__tests__/session-switch.test.js.map +1 -0
  263. package/dist/__tests__/session-touch.test.js +6 -1
  264. package/dist/__tests__/session-touch.test.js.map +1 -1
  265. package/dist/__tests__/sessionBinding.test.d.ts +2 -0
  266. package/dist/__tests__/sessionBinding.test.d.ts.map +1 -0
  267. package/dist/__tests__/sessionBinding.test.js +118 -0
  268. package/dist/__tests__/sessionBinding.test.js.map +1 -0
  269. package/dist/__tests__/sessionByIdLookup.test.d.ts +2 -0
  270. package/dist/__tests__/sessionByIdLookup.test.d.ts.map +1 -0
  271. package/dist/__tests__/sessionByIdLookup.test.js +63 -0
  272. package/dist/__tests__/sessionByIdLookup.test.js.map +1 -0
  273. package/dist/__tests__/skill-vocabulary.test.d.ts +21 -0
  274. package/dist/__tests__/skill-vocabulary.test.d.ts.map +1 -0
  275. package/dist/__tests__/skill-vocabulary.test.js +192 -0
  276. package/dist/__tests__/skill-vocabulary.test.js.map +1 -0
  277. package/dist/__tests__/state.test.js +21 -1
  278. package/dist/__tests__/state.test.js.map +1 -1
  279. package/dist/__tests__/stillTrue.test.d.ts +2 -0
  280. package/dist/__tests__/stillTrue.test.d.ts.map +1 -0
  281. package/dist/__tests__/stillTrue.test.js +52 -0
  282. package/dist/__tests__/stillTrue.test.js.map +1 -0
  283. package/dist/__tests__/strip.test.js +57 -3
  284. package/dist/__tests__/strip.test.js.map +1 -1
  285. package/dist/__tests__/surfaces.test.d.ts +2 -0
  286. package/dist/__tests__/surfaces.test.d.ts.map +1 -0
  287. package/dist/__tests__/surfaces.test.js +46 -0
  288. package/dist/__tests__/surfaces.test.js.map +1 -0
  289. package/dist/__tests__/tenant-notice-write-path.test.d.ts +2 -0
  290. package/dist/__tests__/tenant-notice-write-path.test.d.ts.map +1 -0
  291. package/dist/__tests__/tenant-notice-write-path.test.js +169 -0
  292. package/dist/__tests__/tenant-notice-write-path.test.js.map +1 -0
  293. package/dist/__tests__/update-check.test.d.ts +2 -0
  294. package/dist/__tests__/update-check.test.d.ts.map +1 -0
  295. package/dist/__tests__/update-check.test.js +215 -0
  296. package/dist/__tests__/update-check.test.js.map +1 -0
  297. package/dist/__tests__/update.test.js +434 -7
  298. package/dist/__tests__/update.test.js.map +1 -1
  299. package/dist/__tests__/upgrade-runner.test.d.ts +2 -0
  300. package/dist/__tests__/upgrade-runner.test.d.ts.map +1 -0
  301. package/dist/__tests__/upgrade-runner.test.js +54 -0
  302. package/dist/__tests__/upgrade-runner.test.js.map +1 -0
  303. package/dist/__tests__/upgrade.test.d.ts +2 -0
  304. package/dist/__tests__/upgrade.test.d.ts.map +1 -0
  305. package/dist/__tests__/upgrade.test.js +56 -0
  306. package/dist/__tests__/upgrade.test.js.map +1 -0
  307. package/dist/__tests__/verify-formatter.test.d.ts +2 -0
  308. package/dist/__tests__/verify-formatter.test.d.ts.map +1 -0
  309. package/dist/__tests__/verify-formatter.test.js +85 -0
  310. package/dist/__tests__/verify-formatter.test.js.map +1 -0
  311. package/dist/__tests__/vocabulary-leak.test.d.ts +39 -0
  312. package/dist/__tests__/vocabulary-leak.test.d.ts.map +1 -0
  313. package/dist/__tests__/vocabulary-leak.test.js +533 -0
  314. package/dist/__tests__/vocabulary-leak.test.js.map +1 -0
  315. package/dist/__tests__/workspace.test.js +32 -12
  316. package/dist/__tests__/workspace.test.js.map +1 -1
  317. package/dist/__tests__/workspaceNotice.test.d.ts +2 -0
  318. package/dist/__tests__/workspaceNotice.test.d.ts.map +1 -0
  319. package/dist/__tests__/workspaceNotice.test.js +571 -0
  320. package/dist/__tests__/workspaceNotice.test.js.map +1 -0
  321. package/dist/commands/__tests__/connect-handoff.test.d.ts +11 -0
  322. package/dist/commands/__tests__/connect-handoff.test.d.ts.map +1 -0
  323. package/dist/commands/__tests__/connect-handoff.test.js +111 -0
  324. package/dist/commands/__tests__/connect-handoff.test.js.map +1 -0
  325. package/dist/commands/__tests__/quality.test.d.ts +2 -0
  326. package/dist/commands/__tests__/quality.test.d.ts.map +1 -0
  327. package/dist/commands/__tests__/quality.test.js +156 -0
  328. package/dist/commands/__tests__/quality.test.js.map +1 -0
  329. package/dist/commands/__tests__/rework.test.d.ts +2 -0
  330. package/dist/commands/__tests__/rework.test.d.ts.map +1 -0
  331. package/dist/commands/__tests__/rework.test.js +149 -0
  332. package/dist/commands/__tests__/rework.test.js.map +1 -0
  333. package/dist/commands/__tests__/tensionsList.test.d.ts +2 -0
  334. package/dist/commands/__tests__/tensionsList.test.d.ts.map +1 -0
  335. package/dist/commands/__tests__/tensionsList.test.js +63 -0
  336. package/dist/commands/__tests__/tensionsList.test.js.map +1 -0
  337. package/dist/commands/accept-policy.d.ts +10 -0
  338. package/dist/commands/accept-policy.d.ts.map +1 -0
  339. package/dist/commands/accept-policy.js +107 -0
  340. package/dist/commands/accept-policy.js.map +1 -0
  341. package/dist/commands/admin/cockpit.d.ts +2 -13
  342. package/dist/commands/admin/cockpit.d.ts.map +1 -1
  343. package/dist/commands/admin/cockpit.js +5 -5
  344. package/dist/commands/admin/cockpit.js.map +1 -1
  345. package/dist/commands/admin/index.d.ts +49 -0
  346. package/dist/commands/admin/index.d.ts.map +1 -1
  347. package/dist/commands/admin/index.js +148 -29
  348. package/dist/commands/admin/index.js.map +1 -1
  349. package/dist/commands/admin/index.test.d.ts +2 -0
  350. package/dist/commands/admin/index.test.d.ts.map +1 -0
  351. package/dist/commands/admin/index.test.js +94 -0
  352. package/dist/commands/admin/index.test.js.map +1 -0
  353. package/dist/commands/admin/inspect.js +1 -1
  354. package/dist/commands/admin/inspect.js.map +1 -1
  355. package/dist/commands/admin/probe.d.ts +75 -0
  356. package/dist/commands/admin/probe.d.ts.map +1 -0
  357. package/dist/commands/admin/probe.js +224 -0
  358. package/dist/commands/admin/probe.js.map +1 -0
  359. package/dist/commands/admin/probe.test.d.ts +2 -0
  360. package/dist/commands/admin/probe.test.d.ts.map +1 -0
  361. package/dist/commands/admin/probe.test.js +193 -0
  362. package/dist/commands/admin/probe.test.js.map +1 -0
  363. package/dist/commands/admin/run.d.ts +43 -0
  364. package/dist/commands/admin/run.d.ts.map +1 -0
  365. package/dist/commands/admin/run.js +78 -0
  366. package/dist/commands/admin/run.js.map +1 -0
  367. package/dist/commands/admin/run.test.d.ts +18 -0
  368. package/dist/commands/admin/run.test.d.ts.map +1 -0
  369. package/dist/commands/admin/run.test.js +168 -0
  370. package/dist/commands/admin/run.test.js.map +1 -0
  371. package/dist/commands/admin/seed.d.ts +32 -3
  372. package/dist/commands/admin/seed.d.ts.map +1 -1
  373. package/dist/commands/admin/seed.js +310 -101
  374. package/dist/commands/admin/seed.js.map +1 -1
  375. package/dist/commands/admin/seed.test.d.ts +4 -0
  376. package/dist/commands/admin/seed.test.d.ts.map +1 -1
  377. package/dist/commands/admin/seed.test.js +28 -7
  378. package/dist/commands/admin/seed.test.js.map +1 -1
  379. package/dist/commands/admin/seedRegistryEntries.generated.d.ts +14 -0
  380. package/dist/commands/admin/seedRegistryEntries.generated.d.ts.map +1 -0
  381. package/dist/commands/admin/seedRegistryEntries.generated.js +81 -0
  382. package/dist/commands/admin/seedRegistryEntries.generated.js.map +1 -0
  383. package/dist/commands/admin/seedRegistryEntries.test.d.ts +13 -0
  384. package/dist/commands/admin/seedRegistryEntries.test.d.ts.map +1 -0
  385. package/dist/commands/admin/seedRegistryEntries.test.js +96 -0
  386. package/dist/commands/admin/seedRegistryEntries.test.js.map +1 -0
  387. package/dist/commands/admin/seedRowType.d.ts +22 -0
  388. package/dist/commands/admin/seedRowType.d.ts.map +1 -0
  389. package/dist/commands/admin/seedRowType.js +2 -0
  390. package/dist/commands/admin/seedRowType.js.map +1 -0
  391. package/dist/commands/admin/seedStatusColor.d.ts +9 -0
  392. package/dist/commands/admin/seedStatusColor.d.ts.map +1 -0
  393. package/dist/commands/admin/seedStatusColor.js +19 -0
  394. package/dist/commands/admin/seedStatusColor.js.map +1 -0
  395. package/dist/commands/admin/seedStatusColor.test.d.ts +2 -0
  396. package/dist/commands/admin/seedStatusColor.test.d.ts.map +1 -0
  397. package/dist/commands/admin/seedStatusColor.test.js +31 -0
  398. package/dist/commands/admin/seedStatusColor.test.js.map +1 -0
  399. package/dist/commands/audit.d.ts +2 -2
  400. package/dist/commands/audit.d.ts.map +1 -1
  401. package/dist/commands/audit.js +52 -6
  402. package/dist/commands/audit.js.map +1 -1
  403. package/dist/commands/brief.d.ts.map +1 -1
  404. package/dist/commands/brief.js +24 -2
  405. package/dist/commands/brief.js.map +1 -1
  406. package/dist/commands/capture.d.ts +15 -8
  407. package/dist/commands/capture.d.ts.map +1 -1
  408. package/dist/commands/capture.js +246 -198
  409. package/dist/commands/capture.js.map +1 -1
  410. package/dist/commands/chain-walk.d.ts.map +1 -1
  411. package/dist/commands/chain-walk.js.map +1 -1
  412. package/dist/commands/changes.d.ts.map +1 -1
  413. package/dist/commands/changes.js.map +1 -1
  414. package/dist/commands/codex-prep.d.ts +12 -1
  415. package/dist/commands/codex-prep.d.ts.map +1 -1
  416. package/dist/commands/codex-prep.js +18 -84
  417. package/dist/commands/codex-prep.js.map +1 -1
  418. package/dist/commands/collections.d.ts.map +1 -1
  419. package/dist/commands/collections.js.map +1 -1
  420. package/dist/commands/conflicts.d.ts +40 -0
  421. package/dist/commands/conflicts.d.ts.map +1 -0
  422. package/dist/commands/conflicts.js +267 -0
  423. package/dist/commands/conflicts.js.map +1 -0
  424. package/dist/commands/conflicts.test.d.ts +2 -0
  425. package/dist/commands/conflicts.test.d.ts.map +1 -0
  426. package/dist/commands/conflicts.test.js +219 -0
  427. package/dist/commands/conflicts.test.js.map +1 -0
  428. package/dist/commands/connect-config.test.d.ts +2 -0
  429. package/dist/commands/connect-config.test.d.ts.map +1 -0
  430. package/dist/commands/connect-config.test.js +44 -0
  431. package/dist/commands/connect-config.test.js.map +1 -0
  432. package/dist/commands/connect-context.d.ts +55 -0
  433. package/dist/commands/connect-context.d.ts.map +1 -0
  434. package/dist/commands/connect-context.js +78 -0
  435. package/dist/commands/connect-context.js.map +1 -0
  436. package/dist/commands/connect-context.test.d.ts +2 -0
  437. package/dist/commands/connect-context.test.d.ts.map +1 -0
  438. package/dist/commands/connect-context.test.js +148 -0
  439. package/dist/commands/connect-context.test.js.map +1 -0
  440. package/dist/commands/connect-handoff.d.ts +51 -0
  441. package/dist/commands/connect-handoff.d.ts.map +1 -0
  442. package/dist/commands/connect-handoff.js +70 -0
  443. package/dist/commands/connect-handoff.js.map +1 -0
  444. package/dist/commands/connect-integration.test.js +44 -16
  445. package/dist/commands/connect-integration.test.js.map +1 -1
  446. package/dist/commands/connect-legacy-migration.test.d.ts +2 -0
  447. package/dist/commands/connect-legacy-migration.test.d.ts.map +1 -0
  448. package/dist/commands/connect-legacy-migration.test.js +109 -0
  449. package/dist/commands/connect-legacy-migration.test.js.map +1 -0
  450. package/dist/commands/connect-screens.d.ts +17 -4
  451. package/dist/commands/connect-screens.d.ts.map +1 -1
  452. package/dist/commands/connect-screens.js +83 -19
  453. package/dist/commands/connect-screens.js.map +1 -1
  454. package/dist/commands/connect.d.ts +27 -6
  455. package/dist/commands/connect.d.ts.map +1 -1
  456. package/dist/commands/connect.js +254 -75
  457. package/dist/commands/connect.js.map +1 -1
  458. package/dist/commands/connect.test.js +344 -7
  459. package/dist/commands/connect.test.js.map +1 -1
  460. package/dist/commands/constellation.d.ts.map +1 -1
  461. package/dist/commands/constellation.js.map +1 -1
  462. package/dist/commands/context.d.ts.map +1 -1
  463. package/dist/commands/context.js.map +1 -1
  464. package/dist/commands/cross-cut.d.ts.map +1 -1
  465. package/dist/commands/cross-cut.js.map +1 -1
  466. package/dist/commands/digest.d.ts +17 -0
  467. package/dist/commands/digest.d.ts.map +1 -0
  468. package/dist/commands/digest.js +58 -0
  469. package/dist/commands/digest.js.map +1 -0
  470. package/dist/commands/digest.test.d.ts +2 -0
  471. package/dist/commands/digest.test.d.ts.map +1 -0
  472. package/dist/commands/digest.test.js +36 -0
  473. package/dist/commands/digest.test.js.map +1 -0
  474. package/dist/commands/direction.d.ts +10 -0
  475. package/dist/commands/direction.d.ts.map +1 -0
  476. package/dist/commands/direction.js +79 -0
  477. package/dist/commands/direction.js.map +1 -0
  478. package/dist/commands/doctor.d.ts.map +1 -1
  479. package/dist/commands/doctor.js +173 -38
  480. package/dist/commands/doctor.js.map +1 -1
  481. package/dist/commands/doctor.test.js +352 -6
  482. package/dist/commands/doctor.test.js.map +1 -1
  483. package/dist/commands/entryAccept.d.ts +24 -0
  484. package/dist/commands/entryAccept.d.ts.map +1 -0
  485. package/dist/commands/entryAccept.js +289 -0
  486. package/dist/commands/entryAccept.js.map +1 -0
  487. package/dist/commands/entryDiscardResolve.d.ts +9 -0
  488. package/dist/commands/entryDiscardResolve.d.ts.map +1 -0
  489. package/dist/commands/entryDiscardResolve.js +27 -0
  490. package/dist/commands/entryDiscardResolve.js.map +1 -0
  491. package/dist/commands/entryOwn.d.ts +5 -0
  492. package/dist/commands/entryOwn.d.ts.map +1 -0
  493. package/dist/commands/entryOwn.js +17 -0
  494. package/dist/commands/entryOwn.js.map +1 -0
  495. package/dist/commands/entryPreflight.d.ts +8 -0
  496. package/dist/commands/entryPreflight.d.ts.map +1 -0
  497. package/dist/commands/entryPreflight.js +48 -0
  498. package/dist/commands/entryPreflight.js.map +1 -0
  499. package/dist/commands/entryTick.d.ts +8 -0
  500. package/dist/commands/entryTick.d.ts.map +1 -0
  501. package/dist/commands/entryTick.js +43 -0
  502. package/dist/commands/entryTick.js.map +1 -0
  503. package/dist/commands/feedback.d.ts +36 -0
  504. package/dist/commands/feedback.d.ts.map +1 -0
  505. package/dist/commands/feedback.js +193 -0
  506. package/dist/commands/feedback.js.map +1 -0
  507. package/dist/commands/feedback.test.d.ts +2 -0
  508. package/dist/commands/feedback.test.d.ts.map +1 -0
  509. package/dist/commands/feedback.test.js +125 -0
  510. package/dist/commands/feedback.test.js.map +1 -0
  511. package/dist/commands/fields.d.ts.map +1 -1
  512. package/dist/commands/fields.js +1 -1
  513. package/dist/commands/fields.js.map +1 -1
  514. package/dist/commands/files.d.ts +26 -0
  515. package/dist/commands/files.d.ts.map +1 -0
  516. package/dist/commands/files.js +160 -0
  517. package/dist/commands/files.js.map +1 -0
  518. package/dist/commands/files.test.d.ts +2 -0
  519. package/dist/commands/files.test.d.ts.map +1 -0
  520. package/dist/commands/files.test.js +278 -0
  521. package/dist/commands/files.test.js.map +1 -0
  522. package/dist/commands/handshake.d.ts +59 -9
  523. package/dist/commands/handshake.d.ts.map +1 -1
  524. package/dist/commands/handshake.js +879 -147
  525. package/dist/commands/handshake.js.map +1 -1
  526. package/dist/commands/handshakeCursorSkillCleanup.d.ts +36 -0
  527. package/dist/commands/handshakeCursorSkillCleanup.d.ts.map +1 -0
  528. package/dist/commands/handshakeCursorSkillCleanup.js +110 -0
  529. package/dist/commands/handshakeCursorSkillCleanup.js.map +1 -0
  530. package/dist/commands/handshakeDriftClassification.d.ts +33 -0
  531. package/dist/commands/handshakeDriftClassification.d.ts.map +1 -0
  532. package/dist/commands/handshakeDriftClassification.js +62 -0
  533. package/dist/commands/handshakeDriftClassification.js.map +1 -0
  534. package/dist/commands/history.d.ts +30 -0
  535. package/dist/commands/history.d.ts.map +1 -0
  536. package/dist/commands/history.js +62 -0
  537. package/dist/commands/history.js.map +1 -0
  538. package/dist/commands/history.test.d.ts +2 -0
  539. package/dist/commands/history.test.d.ts.map +1 -0
  540. package/dist/commands/history.test.js +106 -0
  541. package/dist/commands/history.test.js.map +1 -0
  542. package/dist/commands/ingest.d.ts.map +1 -1
  543. package/dist/commands/ingest.js +9 -0
  544. package/dist/commands/ingest.js.map +1 -1
  545. package/dist/commands/init.d.ts +1 -1
  546. package/dist/commands/init.d.ts.map +1 -1
  547. package/dist/commands/init.js +22 -13
  548. package/dist/commands/init.js.map +1 -1
  549. package/dist/commands/method.d.ts +97 -0
  550. package/dist/commands/method.d.ts.map +1 -0
  551. package/dist/commands/method.js +773 -0
  552. package/dist/commands/method.js.map +1 -0
  553. package/dist/commands/organisation.d.ts +16 -0
  554. package/dist/commands/organisation.d.ts.map +1 -0
  555. package/dist/commands/organisation.js +184 -0
  556. package/dist/commands/organisation.js.map +1 -0
  557. package/dist/commands/organisation.test.d.ts +2 -0
  558. package/dist/commands/organisation.test.d.ts.map +1 -0
  559. package/dist/commands/organisation.test.js +198 -0
  560. package/dist/commands/organisation.test.js.map +1 -0
  561. package/dist/commands/organisationHierarchy.d.ts +8 -0
  562. package/dist/commands/organisationHierarchy.d.ts.map +1 -0
  563. package/dist/commands/organisationHierarchy.js +75 -0
  564. package/dist/commands/organisationHierarchy.js.map +1 -0
  565. package/dist/commands/organisationHierarchy.test.d.ts +2 -0
  566. package/dist/commands/organisationHierarchy.test.d.ts.map +1 -0
  567. package/dist/commands/organisationHierarchy.test.js +72 -0
  568. package/dist/commands/organisationHierarchy.test.js.map +1 -0
  569. package/dist/commands/organisationWrite.d.ts +18 -0
  570. package/dist/commands/organisationWrite.d.ts.map +1 -0
  571. package/dist/commands/organisationWrite.js +71 -0
  572. package/dist/commands/organisationWrite.js.map +1 -0
  573. package/dist/commands/orient.d.ts +106 -44
  574. package/dist/commands/orient.d.ts.map +1 -1
  575. package/dist/commands/orient.js +225 -18
  576. package/dist/commands/orient.js.map +1 -1
  577. package/dist/commands/outcome.d.ts +91 -0
  578. package/dist/commands/outcome.d.ts.map +1 -0
  579. package/dist/commands/outcome.js +204 -0
  580. package/dist/commands/outcome.js.map +1 -0
  581. package/dist/commands/outcome.test.d.ts +2 -0
  582. package/dist/commands/outcome.test.d.ts.map +1 -0
  583. package/dist/commands/outcome.test.js +308 -0
  584. package/dist/commands/outcome.test.js.map +1 -0
  585. package/dist/commands/profile.d.ts +34 -2
  586. package/dist/commands/profile.d.ts.map +1 -1
  587. package/dist/commands/profile.js +294 -41
  588. package/dist/commands/profile.js.map +1 -1
  589. package/dist/commands/proof-run.d.ts +51 -0
  590. package/dist/commands/proof-run.d.ts.map +1 -0
  591. package/dist/commands/proof-run.js +209 -0
  592. package/dist/commands/proof-run.js.map +1 -0
  593. package/dist/commands/quality.d.ts +16 -0
  594. package/dist/commands/quality.d.ts.map +1 -0
  595. package/dist/commands/quality.js +29 -0
  596. package/dist/commands/quality.js.map +1 -0
  597. package/dist/commands/questions.d.ts +23 -0
  598. package/dist/commands/questions.d.ts.map +1 -0
  599. package/dist/commands/questions.js +238 -0
  600. package/dist/commands/questions.js.map +1 -0
  601. package/dist/commands/questions.test.d.ts +2 -0
  602. package/dist/commands/questions.test.d.ts.map +1 -0
  603. package/dist/commands/questions.test.js +159 -0
  604. package/dist/commands/questions.test.js.map +1 -0
  605. package/dist/commands/relate.d.ts +1 -0
  606. package/dist/commands/relate.d.ts.map +1 -1
  607. package/dist/commands/relate.js +94 -7
  608. package/dist/commands/relate.js.map +1 -1
  609. package/dist/commands/restore.d.ts +2 -0
  610. package/dist/commands/restore.d.ts.map +1 -0
  611. package/dist/commands/restore.js +83 -0
  612. package/dist/commands/restore.js.map +1 -0
  613. package/dist/commands/rework.d.ts +24 -0
  614. package/dist/commands/rework.d.ts.map +1 -0
  615. package/dist/commands/rework.js +97 -0
  616. package/dist/commands/rework.js.map +1 -0
  617. package/dist/commands/role.d.ts +49 -0
  618. package/dist/commands/role.d.ts.map +1 -0
  619. package/dist/commands/role.js +126 -0
  620. package/dist/commands/role.js.map +1 -0
  621. package/dist/commands/role.test.d.ts +2 -0
  622. package/dist/commands/role.test.d.ts.map +1 -0
  623. package/dist/commands/role.test.js +195 -0
  624. package/dist/commands/role.test.js.map +1 -0
  625. package/dist/commands/scoreboard.d.ts +26 -0
  626. package/dist/commands/scoreboard.d.ts.map +1 -0
  627. package/dist/commands/scoreboard.js +40 -0
  628. package/dist/commands/scoreboard.js.map +1 -0
  629. package/dist/commands/search.d.ts.map +1 -1
  630. package/dist/commands/search.js.map +1 -1
  631. package/dist/commands/session.d.ts +60 -7
  632. package/dist/commands/session.d.ts.map +1 -1
  633. package/dist/commands/session.js +407 -58
  634. package/dist/commands/session.js.map +1 -1
  635. package/dist/commands/shape.d.ts +16 -0
  636. package/dist/commands/shape.d.ts.map +1 -0
  637. package/dist/commands/shape.js +149 -0
  638. package/dist/commands/shape.js.map +1 -0
  639. package/dist/commands/shape.test.d.ts +2 -0
  640. package/dist/commands/shape.test.d.ts.map +1 -0
  641. package/dist/commands/shape.test.js +148 -0
  642. package/dist/commands/shape.test.js.map +1 -0
  643. package/dist/commands/status.d.ts +7 -0
  644. package/dist/commands/status.d.ts.map +1 -0
  645. package/dist/commands/status.js +102 -0
  646. package/dist/commands/status.js.map +1 -0
  647. package/dist/commands/status.test.d.ts +2 -0
  648. package/dist/commands/status.test.d.ts.map +1 -0
  649. package/dist/commands/status.test.js +75 -0
  650. package/dist/commands/status.test.js.map +1 -0
  651. package/dist/commands/stillTrue.d.ts +14 -0
  652. package/dist/commands/stillTrue.d.ts.map +1 -0
  653. package/dist/commands/stillTrue.js +48 -0
  654. package/dist/commands/stillTrue.js.map +1 -0
  655. package/dist/commands/tensionsList.d.ts +5 -0
  656. package/dist/commands/tensionsList.d.ts.map +1 -0
  657. package/dist/commands/tensionsList.js +27 -0
  658. package/dist/commands/tensionsList.js.map +1 -0
  659. package/dist/commands/update.d.ts +21 -0
  660. package/dist/commands/update.d.ts.map +1 -1
  661. package/dist/commands/update.js +146 -36
  662. package/dist/commands/update.js.map +1 -1
  663. package/dist/commands/upgrade.d.ts +5 -0
  664. package/dist/commands/upgrade.d.ts.map +1 -0
  665. package/dist/commands/upgrade.js +110 -0
  666. package/dist/commands/upgrade.js.map +1 -0
  667. package/dist/commands/usage.d.ts.map +1 -1
  668. package/dist/commands/usage.js +0 -18
  669. package/dist/commands/usage.js.map +1 -1
  670. package/dist/commands/verify.d.ts.map +1 -1
  671. package/dist/commands/verify.js +7 -1
  672. package/dist/commands/verify.js.map +1 -1
  673. package/dist/commands/welcome.d.ts.map +1 -1
  674. package/dist/commands/welcome.js +6 -3
  675. package/dist/commands/welcome.js.map +1 -1
  676. package/dist/commands/whoami.d.ts +20 -0
  677. package/dist/commands/whoami.d.ts.map +1 -0
  678. package/dist/commands/whoami.js +126 -0
  679. package/dist/commands/whoami.js.map +1 -0
  680. package/dist/commands/whoami.test.d.ts +2 -0
  681. package/dist/commands/whoami.test.d.ts.map +1 -0
  682. package/dist/commands/whoami.test.js +130 -0
  683. package/dist/commands/whoami.test.js.map +1 -0
  684. package/dist/commands/workspace.d.ts +18 -2
  685. package/dist/commands/workspace.d.ts.map +1 -1
  686. package/dist/commands/workspace.js +5 -2
  687. package/dist/commands/workspace.js.map +1 -1
  688. package/dist/formatters/__tests__/orient-possibleConflict.test.d.ts +2 -0
  689. package/dist/formatters/__tests__/orient-possibleConflict.test.d.ts.map +1 -0
  690. package/dist/formatters/__tests__/orient-possibleConflict.test.js +68 -0
  691. package/dist/formatters/__tests__/orient-possibleConflict.test.js.map +1 -0
  692. package/dist/formatters/__tests__/orient-provenance.test.d.ts +6 -0
  693. package/dist/formatters/__tests__/orient-provenance.test.d.ts.map +1 -0
  694. package/dist/formatters/__tests__/orient-provenance.test.js +394 -0
  695. package/dist/formatters/__tests__/orient-provenance.test.js.map +1 -0
  696. package/dist/formatters/__tests__/orient-ruleLists.test.d.ts +2 -0
  697. package/dist/formatters/__tests__/orient-ruleLists.test.d.ts.map +1 -0
  698. package/dist/formatters/__tests__/orient-ruleLists.test.js +76 -0
  699. package/dist/formatters/__tests__/orient-ruleLists.test.js.map +1 -0
  700. package/dist/formatters/__tests__/session-list-show.test.d.ts +2 -0
  701. package/dist/formatters/__tests__/session-list-show.test.d.ts.map +1 -0
  702. package/dist/formatters/__tests__/session-list-show.test.js +195 -0
  703. package/dist/formatters/__tests__/session-list-show.test.js.map +1 -0
  704. package/dist/formatters/__tests__/session.test.d.ts +2 -0
  705. package/dist/formatters/__tests__/session.test.d.ts.map +1 -0
  706. package/dist/formatters/__tests__/session.test.js +193 -0
  707. package/dist/formatters/__tests__/session.test.js.map +1 -0
  708. package/dist/formatters/__tests__/tensionsList.test.d.ts +2 -0
  709. package/dist/formatters/__tests__/tensionsList.test.d.ts.map +1 -0
  710. package/dist/formatters/__tests__/tensionsList.test.js +30 -0
  711. package/dist/formatters/__tests__/tensionsList.test.js.map +1 -0
  712. package/dist/formatters/audit.d.ts +7 -1
  713. package/dist/formatters/audit.d.ts.map +1 -1
  714. package/dist/formatters/audit.js +2 -2
  715. package/dist/formatters/audit.js.map +1 -1
  716. package/dist/formatters/brief.d.ts +6 -15
  717. package/dist/formatters/brief.d.ts.map +1 -1
  718. package/dist/formatters/brief.js +16 -14
  719. package/dist/formatters/brief.js.map +1 -1
  720. package/dist/formatters/brief.test.d.ts +2 -0
  721. package/dist/formatters/brief.test.d.ts.map +1 -0
  722. package/dist/formatters/brief.test.js +21 -0
  723. package/dist/formatters/brief.test.js.map +1 -0
  724. package/dist/formatters/capture.d.ts +13 -0
  725. package/dist/formatters/capture.d.ts.map +1 -1
  726. package/dist/formatters/capture.js +20 -1
  727. package/dist/formatters/capture.js.map +1 -1
  728. package/dist/formatters/coaching.d.ts +55 -0
  729. package/dist/formatters/coaching.d.ts.map +1 -0
  730. package/dist/formatters/coaching.js +46 -0
  731. package/dist/formatters/coaching.js.map +1 -0
  732. package/dist/formatters/collections.d.ts.map +1 -1
  733. package/dist/formatters/collections.js +13 -3
  734. package/dist/formatters/collections.js.map +1 -1
  735. package/dist/formatters/conflicts.d.ts +69 -0
  736. package/dist/formatters/conflicts.d.ts.map +1 -0
  737. package/dist/formatters/conflicts.js +87 -0
  738. package/dist/formatters/conflicts.js.map +1 -0
  739. package/dist/formatters/conflicts.test.d.ts +2 -0
  740. package/dist/formatters/conflicts.test.d.ts.map +1 -0
  741. package/dist/formatters/conflicts.test.js +136 -0
  742. package/dist/formatters/conflicts.test.js.map +1 -0
  743. package/dist/formatters/context.d.ts +1 -1
  744. package/dist/formatters/context.d.ts.map +1 -1
  745. package/dist/formatters/context.js.map +1 -1
  746. package/dist/formatters/digest.d.ts +13 -0
  747. package/dist/formatters/digest.d.ts.map +1 -0
  748. package/dist/formatters/digest.js +98 -0
  749. package/dist/formatters/digest.js.map +1 -0
  750. package/dist/formatters/digest.test.d.ts +2 -0
  751. package/dist/formatters/digest.test.d.ts.map +1 -0
  752. package/dist/formatters/digest.test.js +166 -0
  753. package/dist/formatters/digest.test.js.map +1 -0
  754. package/dist/formatters/direction.d.ts +48 -0
  755. package/dist/formatters/direction.d.ts.map +1 -0
  756. package/dist/formatters/direction.js +75 -0
  757. package/dist/formatters/direction.js.map +1 -0
  758. package/dist/formatters/direction.test.d.ts +2 -0
  759. package/dist/formatters/direction.test.d.ts.map +1 -0
  760. package/dist/formatters/direction.test.js +70 -0
  761. package/dist/formatters/direction.test.js.map +1 -0
  762. package/dist/formatters/entry.d.ts +61 -0
  763. package/dist/formatters/entry.d.ts.map +1 -1
  764. package/dist/formatters/entry.js +97 -11
  765. package/dist/formatters/entry.js.map +1 -1
  766. package/dist/formatters/entryAccept.d.ts +73 -0
  767. package/dist/formatters/entryAccept.d.ts.map +1 -0
  768. package/dist/formatters/entryAccept.js +72 -0
  769. package/dist/formatters/entryAccept.js.map +1 -0
  770. package/dist/formatters/feedback.d.ts +56 -0
  771. package/dist/formatters/feedback.d.ts.map +1 -0
  772. package/dist/formatters/feedback.js +89 -0
  773. package/dist/formatters/feedback.js.map +1 -0
  774. package/dist/formatters/feedback.test.d.ts +2 -0
  775. package/dist/formatters/feedback.test.d.ts.map +1 -0
  776. package/dist/formatters/feedback.test.js +112 -0
  777. package/dist/formatters/feedback.test.js.map +1 -0
  778. package/dist/formatters/fields.d.ts +7 -1
  779. package/dist/formatters/fields.d.ts.map +1 -1
  780. package/dist/formatters/fields.js +9 -3
  781. package/dist/formatters/fields.js.map +1 -1
  782. package/dist/formatters/fields.test.d.ts +2 -0
  783. package/dist/formatters/fields.test.d.ts.map +1 -0
  784. package/dist/formatters/fields.test.js +42 -0
  785. package/dist/formatters/fields.test.js.map +1 -0
  786. package/dist/formatters/handshake.d.ts +61 -5
  787. package/dist/formatters/handshake.d.ts.map +1 -1
  788. package/dist/formatters/handshake.js +160 -12
  789. package/dist/formatters/handshake.js.map +1 -1
  790. package/dist/formatters/orient.coherencyCheckTag.test.d.ts +2 -0
  791. package/dist/formatters/orient.coherencyCheckTag.test.d.ts.map +1 -0
  792. package/dist/formatters/orient.coherencyCheckTag.test.js +22 -0
  793. package/dist/formatters/orient.coherencyCheckTag.test.js.map +1 -0
  794. package/dist/formatters/orient.d.ts +199 -49
  795. package/dist/formatters/orient.d.ts.map +1 -1
  796. package/dist/formatters/orient.js +231 -88
  797. package/dist/formatters/orient.js.map +1 -1
  798. package/dist/formatters/orient.rcrtMiss.test.d.ts +2 -0
  799. package/dist/formatters/orient.rcrtMiss.test.d.ts.map +1 -0
  800. package/dist/formatters/orient.rcrtMiss.test.js +76 -0
  801. package/dist/formatters/orient.rcrtMiss.test.js.map +1 -0
  802. package/dist/formatters/orient.rituals.test.d.ts +2 -0
  803. package/dist/formatters/orient.rituals.test.d.ts.map +1 -0
  804. package/dist/formatters/orient.rituals.test.js +76 -0
  805. package/dist/formatters/orient.rituals.test.js.map +1 -0
  806. package/dist/formatters/orient.shapeAdvisorySummary.test.d.ts +2 -0
  807. package/dist/formatters/orient.shapeAdvisorySummary.test.d.ts.map +1 -0
  808. package/dist/formatters/orient.shapeAdvisorySummary.test.js +60 -0
  809. package/dist/formatters/orient.shapeAdvisorySummary.test.js.map +1 -0
  810. package/dist/formatters/orientDegradation.d.ts +38 -0
  811. package/dist/formatters/orientDegradation.d.ts.map +1 -0
  812. package/dist/formatters/orientDegradation.js +50 -0
  813. package/dist/formatters/orientDegradation.js.map +1 -0
  814. package/dist/formatters/orientDegradation.test.d.ts +2 -0
  815. package/dist/formatters/orientDegradation.test.d.ts.map +1 -0
  816. package/dist/formatters/orientDegradation.test.js +28 -0
  817. package/dist/formatters/orientDegradation.test.js.map +1 -0
  818. package/dist/formatters/orientDirection.d.ts +107 -0
  819. package/dist/formatters/orientDirection.d.ts.map +1 -0
  820. package/dist/formatters/orientDirection.js +177 -0
  821. package/dist/formatters/orientDirection.js.map +1 -0
  822. package/dist/formatters/orientDirection.test.d.ts +2 -0
  823. package/dist/formatters/orientDirection.test.d.ts.map +1 -0
  824. package/dist/formatters/orientDirection.test.js +304 -0
  825. package/dist/formatters/orientDirection.test.js.map +1 -0
  826. package/dist/formatters/orientRetrievalMiss.d.ts +22 -0
  827. package/dist/formatters/orientRetrievalMiss.d.ts.map +1 -0
  828. package/dist/formatters/orientRetrievalMiss.js +17 -0
  829. package/dist/formatters/orientRetrievalMiss.js.map +1 -0
  830. package/dist/formatters/questions.d.ts +71 -0
  831. package/dist/formatters/questions.d.ts.map +1 -0
  832. package/dist/formatters/questions.js +117 -0
  833. package/dist/formatters/questions.js.map +1 -0
  834. package/dist/formatters/questions.test.d.ts +2 -0
  835. package/dist/formatters/questions.test.d.ts.map +1 -0
  836. package/dist/formatters/questions.test.js +147 -0
  837. package/dist/formatters/questions.test.js.map +1 -0
  838. package/dist/formatters/relate.d.ts +13 -2
  839. package/dist/formatters/relate.d.ts.map +1 -1
  840. package/dist/formatters/relate.js +10 -5
  841. package/dist/formatters/relate.js.map +1 -1
  842. package/dist/formatters/relate.test.d.ts +2 -0
  843. package/dist/formatters/relate.test.d.ts.map +1 -0
  844. package/dist/formatters/relate.test.js +79 -0
  845. package/dist/formatters/relate.test.js.map +1 -0
  846. package/dist/formatters/scoreboard.d.ts +11 -0
  847. package/dist/formatters/scoreboard.d.ts.map +1 -0
  848. package/dist/formatters/scoreboard.js +162 -0
  849. package/dist/formatters/scoreboard.js.map +1 -0
  850. package/dist/formatters/scoreboard.test.d.ts +2 -0
  851. package/dist/formatters/scoreboard.test.d.ts.map +1 -0
  852. package/dist/formatters/scoreboard.test.js +301 -0
  853. package/dist/formatters/scoreboard.test.js.map +1 -0
  854. package/dist/formatters/search.d.ts.map +1 -1
  855. package/dist/formatters/search.js +11 -1
  856. package/dist/formatters/search.js.map +1 -1
  857. package/dist/formatters/search.test.d.ts +2 -0
  858. package/dist/formatters/search.test.d.ts.map +1 -0
  859. package/dist/formatters/search.test.js +57 -0
  860. package/dist/formatters/search.test.js.map +1 -0
  861. package/dist/formatters/session-feedback.test.d.ts +2 -0
  862. package/dist/formatters/session-feedback.test.d.ts.map +1 -0
  863. package/dist/formatters/session-feedback.test.js +83 -0
  864. package/dist/formatters/session-feedback.test.js.map +1 -0
  865. package/dist/formatters/session.d.ts +127 -5
  866. package/dist/formatters/session.d.ts.map +1 -1
  867. package/dist/formatters/session.js +313 -12
  868. package/dist/formatters/session.js.map +1 -1
  869. package/dist/formatters/shape.d.ts +54 -0
  870. package/dist/formatters/shape.d.ts.map +1 -0
  871. package/dist/formatters/shape.js +97 -0
  872. package/dist/formatters/shape.js.map +1 -0
  873. package/dist/formatters/shape.test.d.ts +2 -0
  874. package/dist/formatters/shape.test.d.ts.map +1 -0
  875. package/dist/formatters/shape.test.js +80 -0
  876. package/dist/formatters/shape.test.js.map +1 -0
  877. package/dist/formatters/spineCheck.d.ts +14 -0
  878. package/dist/formatters/spineCheck.d.ts.map +1 -0
  879. package/dist/formatters/spineCheck.js +113 -0
  880. package/dist/formatters/spineCheck.js.map +1 -0
  881. package/dist/formatters/spineCheck.test.d.ts +2 -0
  882. package/dist/formatters/spineCheck.test.d.ts.map +1 -0
  883. package/dist/formatters/spineCheck.test.js +76 -0
  884. package/dist/formatters/spineCheck.test.js.map +1 -0
  885. package/dist/formatters/tensionsList.d.ts +17 -0
  886. package/dist/formatters/tensionsList.d.ts.map +1 -0
  887. package/dist/formatters/tensionsList.js +33 -0
  888. package/dist/formatters/tensionsList.js.map +1 -0
  889. package/dist/formatters/update.d.ts +20 -0
  890. package/dist/formatters/update.d.ts.map +1 -1
  891. package/dist/formatters/update.js +35 -6
  892. package/dist/formatters/update.js.map +1 -1
  893. package/dist/formatters/update.test.d.ts +2 -0
  894. package/dist/formatters/update.test.d.ts.map +1 -0
  895. package/dist/formatters/update.test.js +59 -0
  896. package/dist/formatters/update.test.js.map +1 -0
  897. package/dist/formatters/verify.d.ts +12 -4
  898. package/dist/formatters/verify.d.ts.map +1 -1
  899. package/dist/formatters/verify.js +20 -2
  900. package/dist/formatters/verify.js.map +1 -1
  901. package/dist/generated/healthGapKinds.generated.d.ts +12 -0
  902. package/dist/generated/healthGapKinds.generated.d.ts.map +1 -0
  903. package/dist/generated/healthGapKinds.generated.js +21 -0
  904. package/dist/generated/healthGapKinds.generated.js.map +1 -0
  905. package/dist/generated/organisationalAuthorityRefusalCodes.generated.d.ts +12 -0
  906. package/dist/generated/organisationalAuthorityRefusalCodes.generated.d.ts.map +1 -0
  907. package/dist/generated/organisationalAuthorityRefusalCodes.generated.js +11 -0
  908. package/dist/generated/organisationalAuthorityRefusalCodes.generated.js.map +1 -0
  909. package/dist/generated/relationTypes.generated.d.ts +12 -0
  910. package/dist/generated/relationTypes.generated.d.ts.map +1 -0
  911. package/dist/generated/relationTypes.generated.js +11 -0
  912. package/dist/generated/relationTypes.generated.js.map +1 -0
  913. package/dist/generated/routeLatencyBudget.generated.d.ts +56 -0
  914. package/dist/generated/routeLatencyBudget.generated.d.ts.map +1 -0
  915. package/dist/generated/routeLatencyBudget.generated.js +291 -0
  916. package/dist/generated/routeLatencyBudget.generated.js.map +1 -0
  917. package/dist/generated/sourceSurfaces.generated.d.ts +12 -0
  918. package/dist/generated/sourceSurfaces.generated.d.ts.map +1 -0
  919. package/dist/generated/sourceSurfaces.generated.js +11 -0
  920. package/dist/generated/sourceSurfaces.generated.js.map +1 -0
  921. package/dist/generators/adapters.d.ts +34 -5
  922. package/dist/generators/adapters.d.ts.map +1 -1
  923. package/dist/generators/adapters.js +81 -29
  924. package/dist/generators/adapters.js.map +1 -1
  925. package/dist/generators/adapters.test.js +0 -2
  926. package/dist/generators/adapters.test.js.map +1 -1
  927. package/dist/generators/boundary-manifest.d.ts +29 -0
  928. package/dist/generators/boundary-manifest.d.ts.map +1 -0
  929. package/dist/generators/boundary-manifest.js +183 -0
  930. package/dist/generators/boundary-manifest.js.map +1 -0
  931. package/dist/generators/boundary-manifest.real-file.test.d.ts +2 -0
  932. package/dist/generators/boundary-manifest.real-file.test.d.ts.map +1 -0
  933. package/dist/generators/boundary-manifest.real-file.test.js +70 -0
  934. package/dist/generators/boundary-manifest.real-file.test.js.map +1 -0
  935. package/dist/generators/boundary-manifest.test.d.ts +2 -0
  936. package/dist/generators/boundary-manifest.test.d.ts.map +1 -0
  937. package/dist/generators/boundary-manifest.test.js +91 -0
  938. package/dist/generators/boundary-manifest.test.js.map +1 -0
  939. package/dist/generators/context-md.d.ts +1 -1
  940. package/dist/generators/context-md.d.ts.map +1 -1
  941. package/dist/generators/context-md.js +17 -46
  942. package/dist/generators/context-md.js.map +1 -1
  943. package/dist/generators/context-md.test.d.ts +2 -0
  944. package/dist/generators/context-md.test.d.ts.map +1 -0
  945. package/dist/generators/context-md.test.js +82 -0
  946. package/dist/generators/context-md.test.js.map +1 -0
  947. package/dist/generators/everyone-rules-md.d.ts +10 -0
  948. package/dist/generators/everyone-rules-md.d.ts.map +1 -0
  949. package/dist/generators/everyone-rules-md.js +27 -0
  950. package/dist/generators/everyone-rules-md.js.map +1 -0
  951. package/dist/generators/manifest.d.ts +115 -0
  952. package/dist/generators/manifest.d.ts.map +1 -0
  953. package/dist/generators/manifest.js +277 -0
  954. package/dist/generators/manifest.js.map +1 -0
  955. package/dist/generators/noProjectionAssets.d.ts +15 -0
  956. package/dist/generators/noProjectionAssets.d.ts.map +1 -0
  957. package/dist/generators/noProjectionAssets.js +6 -0
  958. package/dist/generators/noProjectionAssets.js.map +1 -0
  959. package/dist/generators/portable-knowledge.d.ts +27 -28
  960. package/dist/generators/portable-knowledge.d.ts.map +1 -1
  961. package/dist/generators/portable-knowledge.js +97 -119
  962. package/dist/generators/portable-knowledge.js.map +1 -1
  963. package/dist/generators/portable-knowledge.test.js +82 -267
  964. package/dist/generators/portable-knowledge.test.js.map +1 -1
  965. package/dist/generators/region-projections.d.ts +17 -0
  966. package/dist/generators/region-projections.d.ts.map +1 -0
  967. package/dist/generators/region-projections.js +48 -0
  968. package/dist/generators/region-projections.js.map +1 -0
  969. package/dist/generators/region-projections.test.d.ts +2 -0
  970. package/dist/generators/region-projections.test.d.ts.map +1 -0
  971. package/dist/generators/region-projections.test.js +63 -0
  972. package/dist/generators/region-projections.test.js.map +1 -0
  973. package/dist/generators/region.d.ts +24 -0
  974. package/dist/generators/region.d.ts.map +1 -0
  975. package/dist/generators/region.js +87 -0
  976. package/dist/generators/region.js.map +1 -0
  977. package/dist/generators/region.test.d.ts +2 -0
  978. package/dist/generators/region.test.d.ts.map +1 -0
  979. package/dist/generators/region.test.js +126 -0
  980. package/dist/generators/region.test.js.map +1 -0
  981. package/dist/generators/retired-projections.d.ts +14 -0
  982. package/dist/generators/retired-projections.d.ts.map +1 -0
  983. package/dist/generators/retired-projections.js +79 -0
  984. package/dist/generators/retired-projections.js.map +1 -0
  985. package/dist/generators/retired-projections.test.d.ts +2 -0
  986. package/dist/generators/retired-projections.test.d.ts.map +1 -0
  987. package/dist/generators/retired-projections.test.js +62 -0
  988. package/dist/generators/retired-projections.test.js.map +1 -0
  989. package/dist/generators/surface-profiles.d.ts +1 -2
  990. package/dist/generators/surface-profiles.d.ts.map +1 -1
  991. package/dist/generators/surface-profiles.js.map +1 -1
  992. package/dist/handleCliError.d.ts +2 -0
  993. package/dist/handleCliError.d.ts.map +1 -0
  994. package/dist/handleCliError.js +56 -0
  995. package/dist/handleCliError.js.map +1 -0
  996. package/dist/index.d.ts +0 -5
  997. package/dist/index.d.ts.map +1 -1
  998. package/dist/index.js +262 -292
  999. package/dist/index.js.map +1 -1
  1000. package/dist/lib/__tests__/legalRelationTypes.test.d.ts +2 -0
  1001. package/dist/lib/__tests__/legalRelationTypes.test.d.ts.map +1 -0
  1002. package/dist/lib/__tests__/legalRelationTypes.test.js +98 -0
  1003. package/dist/lib/__tests__/legalRelationTypes.test.js.map +1 -0
  1004. package/dist/lib/__tests__/parseFields.test.d.ts +2 -0
  1005. package/dist/lib/__tests__/parseFields.test.d.ts.map +1 -0
  1006. package/dist/lib/__tests__/parseFields.test.js +40 -0
  1007. package/dist/lib/__tests__/parseFields.test.js.map +1 -0
  1008. package/dist/lib/activation.d.ts.map +1 -1
  1009. package/dist/lib/activation.js +7 -3
  1010. package/dist/lib/activation.js.map +1 -1
  1011. package/dist/lib/activation.test.js +3 -3
  1012. package/dist/lib/activation.test.js.map +1 -1
  1013. package/dist/lib/adminConfig.d.ts +48 -0
  1014. package/dist/lib/adminConfig.d.ts.map +1 -0
  1015. package/dist/lib/adminConfig.js +130 -0
  1016. package/dist/lib/adminConfig.js.map +1 -0
  1017. package/dist/lib/canonicalRefs.d.ts +160 -0
  1018. package/dist/lib/canonicalRefs.d.ts.map +1 -0
  1019. package/dist/lib/canonicalRefs.js +169 -0
  1020. package/dist/lib/canonicalRefs.js.map +1 -0
  1021. package/dist/lib/captureGrounding.d.ts +43 -0
  1022. package/dist/lib/captureGrounding.d.ts.map +1 -0
  1023. package/dist/lib/captureGrounding.js +99 -0
  1024. package/dist/lib/captureGrounding.js.map +1 -0
  1025. package/dist/lib/captureGrounding.test.d.ts +2 -0
  1026. package/dist/lib/captureGrounding.test.d.ts.map +1 -0
  1027. package/dist/lib/captureGrounding.test.js +116 -0
  1028. package/dist/lib/captureGrounding.test.js.map +1 -0
  1029. package/dist/lib/captureLink.d.ts +26 -0
  1030. package/dist/lib/captureLink.d.ts.map +1 -0
  1031. package/dist/lib/captureLink.js +110 -0
  1032. package/dist/lib/captureLink.js.map +1 -0
  1033. package/dist/lib/captureVersion.d.ts +38 -0
  1034. package/dist/lib/captureVersion.d.ts.map +1 -0
  1035. package/dist/lib/captureVersion.js +81 -0
  1036. package/dist/lib/captureVersion.js.map +1 -0
  1037. package/dist/lib/client.d.ts +46 -19
  1038. package/dist/lib/client.d.ts.map +1 -1
  1039. package/dist/lib/client.js +231 -66
  1040. package/dist/lib/client.js.map +1 -1
  1041. package/dist/lib/collectionRegistry.d.ts +42 -0
  1042. package/dist/lib/collectionRegistry.d.ts.map +1 -1
  1043. package/dist/lib/collectionRegistry.js +75 -15
  1044. package/dist/lib/collectionRegistry.js.map +1 -1
  1045. package/dist/lib/commanderOptions.d.ts +8 -0
  1046. package/dist/lib/commanderOptions.d.ts.map +1 -0
  1047. package/dist/lib/commanderOptions.js +10 -0
  1048. package/dist/lib/commanderOptions.js.map +1 -0
  1049. package/dist/lib/compose-wrapup-view.d.ts +48 -0
  1050. package/dist/lib/compose-wrapup-view.d.ts.map +1 -0
  1051. package/dist/lib/compose-wrapup-view.js +37 -0
  1052. package/dist/lib/compose-wrapup-view.js.map +1 -0
  1053. package/dist/lib/config.d.ts +102 -54
  1054. package/dist/lib/config.d.ts.map +1 -1
  1055. package/dist/lib/config.js +252 -156
  1056. package/dist/lib/config.js.map +1 -1
  1057. package/dist/lib/configResult.d.ts +103 -0
  1058. package/dist/lib/configResult.d.ts.map +1 -0
  1059. package/dist/lib/configResult.js +180 -0
  1060. package/dist/lib/configResult.js.map +1 -0
  1061. package/dist/lib/connectKeyLabel.d.ts +9 -0
  1062. package/dist/lib/connectKeyLabel.d.ts.map +1 -0
  1063. package/dist/lib/connectKeyLabel.js +12 -0
  1064. package/dist/lib/connectKeyLabel.js.map +1 -0
  1065. package/dist/lib/constants.d.ts +5 -1
  1066. package/dist/lib/constants.d.ts.map +1 -1
  1067. package/dist/lib/constants.js +8 -1
  1068. package/dist/lib/constants.js.map +1 -1
  1069. package/dist/lib/conversation.d.ts +36 -0
  1070. package/dist/lib/conversation.d.ts.map +1 -0
  1071. package/dist/lib/conversation.js +66 -0
  1072. package/dist/lib/conversation.js.map +1 -0
  1073. package/dist/lib/createEntryResult.d.ts +34 -0
  1074. package/dist/lib/createEntryResult.d.ts.map +1 -0
  1075. package/dist/lib/createEntryResult.js +12 -0
  1076. package/dist/lib/createEntryResult.js.map +1 -0
  1077. package/dist/lib/deployment.test.js +19 -0
  1078. package/dist/lib/deployment.test.js.map +1 -1
  1079. package/dist/lib/envKeySnapshot.d.ts +10 -0
  1080. package/dist/lib/envKeySnapshot.d.ts.map +1 -0
  1081. package/dist/lib/envKeySnapshot.js +30 -0
  1082. package/dist/lib/envKeySnapshot.js.map +1 -0
  1083. package/dist/lib/errors.d.ts +92 -0
  1084. package/dist/lib/errors.d.ts.map +1 -1
  1085. package/dist/lib/errors.js +83 -0
  1086. package/dist/lib/errors.js.map +1 -1
  1087. package/dist/lib/frontmatter.d.ts +55 -0
  1088. package/dist/lib/frontmatter.d.ts.map +1 -0
  1089. package/dist/lib/frontmatter.js +92 -0
  1090. package/dist/lib/frontmatter.js.map +1 -0
  1091. package/dist/lib/frontmatter.test.d.ts +15 -0
  1092. package/dist/lib/frontmatter.test.d.ts.map +1 -0
  1093. package/dist/lib/frontmatter.test.js +98 -0
  1094. package/dist/lib/frontmatter.test.js.map +1 -0
  1095. package/dist/lib/gatewayTimeout.d.ts +88 -0
  1096. package/dist/lib/gatewayTimeout.d.ts.map +1 -0
  1097. package/dist/lib/gatewayTimeout.js +118 -0
  1098. package/dist/lib/gatewayTimeout.js.map +1 -0
  1099. package/dist/lib/gitEnvLeakKeysParity.test.d.ts +2 -0
  1100. package/dist/lib/gitEnvLeakKeysParity.test.d.ts.map +1 -0
  1101. package/dist/lib/gitEnvLeakKeysParity.test.js +73 -0
  1102. package/dist/lib/gitEnvLeakKeysParity.test.js.map +1 -0
  1103. package/dist/lib/glossary.js +1 -1
  1104. package/dist/lib/glossary.js.map +1 -1
  1105. package/dist/lib/hook-intents.d.ts +51 -0
  1106. package/dist/lib/hook-intents.d.ts.map +1 -0
  1107. package/dist/lib/hook-intents.js +84 -0
  1108. package/dist/lib/hook-intents.js.map +1 -0
  1109. package/dist/lib/inferSourceDate.d.ts +2 -2
  1110. package/dist/lib/inferSourceDate.js +2 -2
  1111. package/dist/lib/kernelEnvelope.d.ts +42 -0
  1112. package/dist/lib/kernelEnvelope.d.ts.map +1 -0
  1113. package/dist/lib/kernelEnvelope.js +67 -0
  1114. package/dist/lib/kernelEnvelope.js.map +1 -0
  1115. package/dist/lib/legalRelationTypes.d.ts +26 -0
  1116. package/dist/lib/legalRelationTypes.d.ts.map +1 -0
  1117. package/dist/lib/legalRelationTypes.js +95 -0
  1118. package/dist/lib/legalRelationTypes.js.map +1 -0
  1119. package/dist/lib/localBinding.d.ts +86 -0
  1120. package/dist/lib/localBinding.d.ts.map +1 -0
  1121. package/dist/lib/localBinding.js +173 -0
  1122. package/dist/lib/localBinding.js.map +1 -0
  1123. package/dist/lib/method-registry.d.ts +37 -0
  1124. package/dist/lib/method-registry.d.ts.map +1 -0
  1125. package/dist/lib/method-registry.js +41 -0
  1126. package/dist/lib/method-registry.js.map +1 -0
  1127. package/dist/lib/normalizeMaterializedFilename.d.ts +28 -0
  1128. package/dist/lib/normalizeMaterializedFilename.d.ts.map +1 -0
  1129. package/dist/lib/normalizeMaterializedFilename.js +56 -0
  1130. package/dist/lib/normalizeMaterializedFilename.js.map +1 -0
  1131. package/dist/lib/normalizeMaterializedFilename.test.d.ts +16 -0
  1132. package/dist/lib/normalizeMaterializedFilename.test.d.ts.map +1 -0
  1133. package/dist/lib/normalizeMaterializedFilename.test.js +90 -0
  1134. package/dist/lib/normalizeMaterializedFilename.test.js.map +1 -0
  1135. package/dist/lib/notice-marker.d.ts +3 -0
  1136. package/dist/lib/notice-marker.d.ts.map +1 -0
  1137. package/dist/lib/notice-marker.js +223 -0
  1138. package/dist/lib/notice-marker.js.map +1 -0
  1139. package/dist/lib/onboarding-path-b.d.ts.map +1 -1
  1140. package/dist/lib/onboarding-path-b.js +35 -6
  1141. package/dist/lib/onboarding-path-b.js.map +1 -1
  1142. package/dist/lib/onboarding-shared.d.ts +27 -5
  1143. package/dist/lib/onboarding-shared.d.ts.map +1 -1
  1144. package/dist/lib/onboarding-shared.js +55 -37
  1145. package/dist/lib/onboarding-shared.js.map +1 -1
  1146. package/dist/lib/onboarding-shared.test.d.ts +2 -0
  1147. package/dist/lib/onboarding-shared.test.d.ts.map +1 -0
  1148. package/dist/lib/onboarding-shared.test.js +131 -0
  1149. package/dist/lib/onboarding-shared.test.js.map +1 -0
  1150. package/dist/lib/onboarding-topics.js +1 -1
  1151. package/dist/lib/onboarding.d.ts +5 -1
  1152. package/dist/lib/onboarding.d.ts.map +1 -1
  1153. package/dist/lib/onboarding.js +62 -25
  1154. package/dist/lib/onboarding.js.map +1 -1
  1155. package/dist/lib/ownerLine.d.ts +58 -0
  1156. package/dist/lib/ownerLine.d.ts.map +1 -0
  1157. package/dist/lib/ownerLine.js +46 -0
  1158. package/dist/lib/ownerLine.js.map +1 -0
  1159. package/dist/lib/parseFields.d.ts +19 -0
  1160. package/dist/lib/parseFields.d.ts.map +1 -0
  1161. package/dist/lib/parseFields.js +49 -0
  1162. package/dist/lib/parseFields.js.map +1 -0
  1163. package/dist/lib/previewBanner.d.ts +9 -0
  1164. package/dist/lib/previewBanner.d.ts.map +1 -0
  1165. package/dist/lib/previewBanner.js +37 -0
  1166. package/dist/lib/previewBanner.js.map +1 -0
  1167. package/dist/lib/productbrain-files.d.ts +94 -0
  1168. package/dist/lib/productbrain-files.d.ts.map +1 -0
  1169. package/dist/lib/productbrain-files.js +214 -0
  1170. package/dist/lib/productbrain-files.js.map +1 -0
  1171. package/dist/lib/productbrain-files.test.d.ts +2 -0
  1172. package/dist/lib/productbrain-files.test.d.ts.map +1 -0
  1173. package/dist/lib/productbrain-files.test.js +293 -0
  1174. package/dist/lib/productbrain-files.test.js.map +1 -0
  1175. package/dist/lib/profiles.d.ts +53 -5
  1176. package/dist/lib/profiles.d.ts.map +1 -1
  1177. package/dist/lib/profiles.js +77 -23
  1178. package/dist/lib/profiles.js.map +1 -1
  1179. package/dist/lib/projectConfig.d.ts +81 -0
  1180. package/dist/lib/projectConfig.d.ts.map +1 -0
  1181. package/dist/lib/projectConfig.js +157 -0
  1182. package/dist/lib/projectConfig.js.map +1 -0
  1183. package/dist/lib/proseBody.d.ts +14 -0
  1184. package/dist/lib/proseBody.d.ts.map +1 -0
  1185. package/dist/lib/proseBody.js +25 -0
  1186. package/dist/lib/proseBody.js.map +1 -0
  1187. package/dist/lib/rate-limit.d.ts +38 -0
  1188. package/dist/lib/rate-limit.d.ts.map +1 -0
  1189. package/dist/lib/rate-limit.js +83 -0
  1190. package/dist/lib/rate-limit.js.map +1 -0
  1191. package/dist/lib/readinessNotices.d.ts +12 -0
  1192. package/dist/lib/readinessNotices.d.ts.map +1 -0
  1193. package/dist/lib/readinessNotices.js +15 -0
  1194. package/dist/lib/readinessNotices.js.map +1 -0
  1195. package/dist/lib/repo-detect.d.ts +8 -2
  1196. package/dist/lib/repo-detect.d.ts.map +1 -1
  1197. package/dist/lib/repo-detect.js +11 -6
  1198. package/dist/lib/repo-detect.js.map +1 -1
  1199. package/dist/lib/reportedProfile.d.ts +18 -0
  1200. package/dist/lib/reportedProfile.d.ts.map +1 -0
  1201. package/dist/lib/reportedProfile.js +144 -0
  1202. package/dist/lib/reportedProfile.js.map +1 -0
  1203. package/dist/lib/ruleListRender.d.ts +63 -0
  1204. package/dist/lib/ruleListRender.d.ts.map +1 -0
  1205. package/dist/lib/ruleListRender.js +79 -0
  1206. package/dist/lib/ruleListRender.js.map +1 -0
  1207. package/dist/lib/runner.d.ts +9 -1
  1208. package/dist/lib/runner.d.ts.map +1 -1
  1209. package/dist/lib/runner.js +30 -4
  1210. package/dist/lib/runner.js.map +1 -1
  1211. package/dist/lib/session.d.ts +90 -6
  1212. package/dist/lib/session.d.ts.map +1 -1
  1213. package/dist/lib/session.js +261 -17
  1214. package/dist/lib/session.js.map +1 -1
  1215. package/dist/lib/sessionBinding.d.ts +61 -0
  1216. package/dist/lib/sessionBinding.d.ts.map +1 -0
  1217. package/dist/lib/sessionBinding.js +125 -0
  1218. package/dist/lib/sessionBinding.js.map +1 -0
  1219. package/dist/lib/sessionNotices.d.ts +53 -0
  1220. package/dist/lib/sessionNotices.d.ts.map +1 -0
  1221. package/dist/lib/sessionNotices.js +122 -0
  1222. package/dist/lib/sessionNotices.js.map +1 -0
  1223. package/dist/lib/sessionNotices.test.d.ts +2 -0
  1224. package/dist/lib/sessionNotices.test.d.ts.map +1 -0
  1225. package/dist/lib/sessionNotices.test.js +48 -0
  1226. package/dist/lib/sessionNotices.test.js.map +1 -0
  1227. package/dist/lib/spineVerdictRead.d.ts +70 -0
  1228. package/dist/lib/spineVerdictRead.d.ts.map +1 -0
  1229. package/dist/lib/spineVerdictRead.js +73 -0
  1230. package/dist/lib/spineVerdictRead.js.map +1 -0
  1231. package/dist/lib/spinner.js +2 -2
  1232. package/dist/lib/spinner.js.map +1 -1
  1233. package/dist/lib/startup-resolution-signals.d.ts +34 -0
  1234. package/dist/lib/startup-resolution-signals.d.ts.map +1 -0
  1235. package/dist/lib/startup-resolution-signals.js +116 -0
  1236. package/dist/lib/startup-resolution-signals.js.map +1 -0
  1237. package/dist/lib/startup-resolution-signals.test.d.ts +2 -0
  1238. package/dist/lib/startup-resolution-signals.test.d.ts.map +1 -0
  1239. package/dist/lib/startup-resolution-signals.test.js +113 -0
  1240. package/dist/lib/startup-resolution-signals.test.js.map +1 -0
  1241. package/dist/lib/startup-signals.d.ts +12 -0
  1242. package/dist/lib/startup-signals.d.ts.map +1 -0
  1243. package/dist/lib/startup-signals.js +179 -0
  1244. package/dist/lib/startup-signals.js.map +1 -0
  1245. package/dist/lib/startup-signals.test.d.ts +2 -0
  1246. package/dist/lib/startup-signals.test.d.ts.map +1 -0
  1247. package/dist/lib/startup-signals.test.js +165 -0
  1248. package/dist/lib/startup-signals.test.js.map +1 -0
  1249. package/dist/lib/state.d.ts +11 -2
  1250. package/dist/lib/state.d.ts.map +1 -1
  1251. package/dist/lib/state.js +11 -4
  1252. package/dist/lib/state.js.map +1 -1
  1253. package/dist/lib/statusCategories.d.ts +159 -0
  1254. package/dist/lib/statusCategories.d.ts.map +1 -0
  1255. package/dist/lib/statusCategories.js +284 -0
  1256. package/dist/lib/statusCategories.js.map +1 -0
  1257. package/dist/lib/strip.d.ts +17 -0
  1258. package/dist/lib/strip.d.ts.map +1 -1
  1259. package/dist/lib/strip.js +48 -1
  1260. package/dist/lib/strip.js.map +1 -1
  1261. package/dist/lib/style.d.ts +8 -2
  1262. package/dist/lib/style.d.ts.map +1 -1
  1263. package/dist/lib/style.js +24 -17
  1264. package/dist/lib/style.js.map +1 -1
  1265. package/dist/lib/tokenConstants.d.ts +2 -0
  1266. package/dist/lib/tokenConstants.d.ts.map +1 -1
  1267. package/dist/lib/tokenConstants.js +2 -0
  1268. package/dist/lib/tokenConstants.js.map +1 -1
  1269. package/dist/lib/update-check.d.ts +42 -7
  1270. package/dist/lib/update-check.d.ts.map +1 -1
  1271. package/dist/lib/update-check.js +213 -62
  1272. package/dist/lib/update-check.js.map +1 -1
  1273. package/dist/lib/upgrade-runner.d.ts +22 -0
  1274. package/dist/lib/upgrade-runner.d.ts.map +1 -0
  1275. package/dist/lib/upgrade-runner.js +110 -0
  1276. package/dist/lib/upgrade-runner.js.map +1 -0
  1277. package/dist/lib/versionWrite.d.ts +65 -0
  1278. package/dist/lib/versionWrite.d.ts.map +1 -0
  1279. package/dist/lib/versionWrite.js +32 -0
  1280. package/dist/lib/versionWrite.js.map +1 -0
  1281. package/dist/lib/workspaceNotice.d.ts +202 -0
  1282. package/dist/lib/workspaceNotice.d.ts.map +1 -0
  1283. package/dist/lib/workspaceNotice.js +345 -0
  1284. package/dist/lib/workspaceNotice.js.map +1 -0
  1285. package/dist/lib/workspaceVocabCache.d.ts +60 -0
  1286. package/dist/lib/workspaceVocabCache.d.ts.map +1 -0
  1287. package/dist/lib/workspaceVocabCache.js +98 -0
  1288. package/dist/lib/workspaceVocabCache.js.map +1 -0
  1289. package/dist/lib/writePerimeter.d.ts +72 -0
  1290. package/dist/lib/writePerimeter.d.ts.map +1 -0
  1291. package/dist/lib/writePerimeter.js +128 -0
  1292. package/dist/lib/writePerimeter.js.map +1 -0
  1293. package/dist/registerEntryCommands.d.ts +18 -0
  1294. package/dist/registerEntryCommands.d.ts.map +1 -0
  1295. package/dist/registerEntryCommands.js +123 -0
  1296. package/dist/registerEntryCommands.js.map +1 -0
  1297. package/dist/registerHistoryCommand.d.ts +8 -0
  1298. package/dist/registerHistoryCommand.d.ts.map +1 -0
  1299. package/dist/registerHistoryCommand.js +14 -0
  1300. package/dist/registerHistoryCommand.js.map +1 -0
  1301. package/dist/registerOutcomeCommands.d.ts +27 -0
  1302. package/dist/registerOutcomeCommands.d.ts.map +1 -0
  1303. package/dist/registerOutcomeCommands.js +27 -0
  1304. package/dist/registerOutcomeCommands.js.map +1 -0
  1305. package/dist/registerRoleCommands.d.ts +10 -0
  1306. package/dist/registerRoleCommands.d.ts.map +1 -0
  1307. package/dist/registerRoleCommands.js +14 -0
  1308. package/dist/registerRoleCommands.js.map +1 -0
  1309. package/dist/registerTensionsCommands.d.ts +10 -0
  1310. package/dist/registerTensionsCommands.d.ts.map +1 -0
  1311. package/dist/registerTensionsCommands.js +15 -0
  1312. package/dist/registerTensionsCommands.js.map +1 -0
  1313. package/dist/scoreboard/diagnose.d.ts +190 -0
  1314. package/dist/scoreboard/diagnose.d.ts.map +1 -0
  1315. package/dist/scoreboard/diagnose.js +282 -0
  1316. package/dist/scoreboard/diagnose.js.map +1 -0
  1317. package/dist/scoreboard/diagnose.test.d.ts +15 -0
  1318. package/dist/scoreboard/diagnose.test.d.ts.map +1 -0
  1319. package/dist/scoreboard/diagnose.test.js +288 -0
  1320. package/dist/scoreboard/diagnose.test.js.map +1 -0
  1321. package/dist/scoreboard/floors.d.ts +47 -0
  1322. package/dist/scoreboard/floors.d.ts.map +1 -0
  1323. package/dist/scoreboard/floors.js +33 -0
  1324. package/dist/scoreboard/floors.js.map +1 -0
  1325. package/dist/scoreboard/localDrift.d.ts +23 -0
  1326. package/dist/scoreboard/localDrift.d.ts.map +1 -0
  1327. package/dist/scoreboard/localDrift.js +111 -0
  1328. package/dist/scoreboard/localDrift.js.map +1 -0
  1329. package/dist/scoreboard/localDrift.test.d.ts +9 -0
  1330. package/dist/scoreboard/localDrift.test.d.ts.map +1 -0
  1331. package/dist/scoreboard/localDrift.test.js +82 -0
  1332. package/dist/scoreboard/localDrift.test.js.map +1 -0
  1333. package/dist/surfaces/__tests__/adapter.test.d.ts +2 -0
  1334. package/dist/surfaces/__tests__/adapter.test.d.ts.map +1 -0
  1335. package/dist/surfaces/__tests__/adapter.test.js +86 -0
  1336. package/dist/surfaces/__tests__/adapter.test.js.map +1 -0
  1337. package/dist/surfaces/__tests__/claude-skill-pointer-drift.test.d.ts +2 -0
  1338. package/dist/surfaces/__tests__/claude-skill-pointer-drift.test.d.ts.map +1 -0
  1339. package/dist/surfaces/__tests__/claude-skill-pointer-drift.test.js +179 -0
  1340. package/dist/surfaces/__tests__/claude-skill-pointer-drift.test.js.map +1 -0
  1341. package/dist/surfaces/__tests__/telemetry.test.d.ts +2 -0
  1342. package/dist/surfaces/__tests__/telemetry.test.d.ts.map +1 -0
  1343. package/dist/surfaces/__tests__/telemetry.test.js +55 -0
  1344. package/dist/surfaces/__tests__/telemetry.test.js.map +1 -0
  1345. package/dist/surfaces/adapter.d.ts +70 -0
  1346. package/dist/surfaces/adapter.d.ts.map +1 -0
  1347. package/dist/surfaces/adapter.js +2 -0
  1348. package/dist/surfaces/adapter.js.map +1 -0
  1349. package/dist/surfaces/adapters/claude.d.ts +3 -0
  1350. package/dist/surfaces/adapters/claude.d.ts.map +1 -0
  1351. package/dist/surfaces/adapters/claude.js +72 -0
  1352. package/dist/surfaces/adapters/claude.js.map +1 -0
  1353. package/dist/surfaces/adapters/codex.d.ts +3 -0
  1354. package/dist/surfaces/adapters/codex.d.ts.map +1 -0
  1355. package/dist/surfaces/adapters/codex.js +61 -0
  1356. package/dist/surfaces/adapters/codex.js.map +1 -0
  1357. package/dist/surfaces/adapters/copilot.d.ts +3 -0
  1358. package/dist/surfaces/adapters/copilot.d.ts.map +1 -0
  1359. package/dist/surfaces/adapters/copilot.js +59 -0
  1360. package/dist/surfaces/adapters/copilot.js.map +1 -0
  1361. package/dist/surfaces/adapters/cursor.d.ts +3 -0
  1362. package/dist/surfaces/adapters/cursor.d.ts.map +1 -0
  1363. package/dist/surfaces/adapters/cursor.js +78 -0
  1364. package/dist/surfaces/adapters/cursor.js.map +1 -0
  1365. package/dist/surfaces/registry.d.ts +76 -0
  1366. package/dist/surfaces/registry.d.ts.map +1 -0
  1367. package/dist/surfaces/registry.js +117 -0
  1368. package/dist/surfaces/registry.js.map +1 -0
  1369. package/dist/surfaces/telemetry.d.ts +17 -0
  1370. package/dist/surfaces/telemetry.d.ts.map +1 -0
  1371. package/dist/surfaces/telemetry.js +31 -0
  1372. package/dist/surfaces/telemetry.js.map +1 -0
  1373. package/package.json +9 -5
  1374. package/templates/method-registry.json +16 -0
  1375. package/dist/__tests__/promote.test.d.ts +0 -2
  1376. package/dist/__tests__/promote.test.d.ts.map +0 -1
  1377. package/dist/__tests__/promote.test.js +0 -161
  1378. package/dist/__tests__/promote.test.js.map +0 -1
  1379. package/dist/__tests__/proposals.test.d.ts +0 -2
  1380. package/dist/__tests__/proposals.test.d.ts.map +0 -1
  1381. package/dist/__tests__/proposals.test.js +0 -167
  1382. package/dist/__tests__/proposals.test.js.map +0 -1
  1383. package/dist/__tests__/setup.test.d.ts +0 -2
  1384. package/dist/__tests__/setup.test.d.ts.map +0 -1
  1385. package/dist/__tests__/setup.test.js +0 -141
  1386. package/dist/__tests__/setup.test.js.map +0 -1
  1387. package/dist/commands/accept.d.ts +0 -18
  1388. package/dist/commands/accept.d.ts.map +0 -1
  1389. package/dist/commands/accept.js +0 -76
  1390. package/dist/commands/accept.js.map +0 -1
  1391. package/dist/commands/promote.d.ts +0 -12
  1392. package/dist/commands/promote.d.ts.map +0 -1
  1393. package/dist/commands/promote.js +0 -90
  1394. package/dist/commands/promote.js.map +0 -1
  1395. package/dist/commands/proposals.d.ts +0 -9
  1396. package/dist/commands/proposals.d.ts.map +0 -1
  1397. package/dist/commands/proposals.js +0 -24
  1398. package/dist/commands/proposals.js.map +0 -1
  1399. package/dist/commands/reject.d.ts +0 -14
  1400. package/dist/commands/reject.d.ts.map +0 -1
  1401. package/dist/commands/reject.js +0 -43
  1402. package/dist/commands/reject.js.map +0 -1
  1403. package/dist/commands/setup.d.ts +0 -15
  1404. package/dist/commands/setup.d.ts.map +0 -1
  1405. package/dist/commands/setup.js +0 -148
  1406. package/dist/commands/setup.js.map +0 -1
  1407. package/dist/formatters/promote.d.ts +0 -30
  1408. package/dist/formatters/promote.d.ts.map +0 -1
  1409. package/dist/formatters/promote.js +0 -39
  1410. package/dist/formatters/promote.js.map +0 -1
  1411. package/dist/formatters/proposals.d.ts +0 -45
  1412. package/dist/formatters/proposals.d.ts.map +0 -1
  1413. package/dist/formatters/proposals.js +0 -62
  1414. package/dist/formatters/proposals.js.map +0 -1
  1415. package/dist/generators/__tests__/surface-profiles.test.d.ts +0 -2
  1416. package/dist/generators/__tests__/surface-profiles.test.d.ts.map +0 -1
  1417. package/dist/generators/__tests__/surface-profiles.test.js +0 -89
  1418. package/dist/generators/__tests__/surface-profiles.test.js.map +0 -1
  1419. package/dist/generators/archetypes.d.ts +0 -52
  1420. package/dist/generators/archetypes.d.ts.map +0 -1
  1421. package/dist/generators/archetypes.js +0 -153
  1422. package/dist/generators/archetypes.js.map +0 -1
  1423. package/dist/generators/archetypes.test.d.ts +0 -2
  1424. package/dist/generators/archetypes.test.d.ts.map +0 -1
  1425. package/dist/generators/archetypes.test.js +0 -237
  1426. package/dist/generators/archetypes.test.js.map +0 -1
  1427. package/dist/generators/chain-classifier.d.ts +0 -49
  1428. package/dist/generators/chain-classifier.d.ts.map +0 -1
  1429. package/dist/generators/chain-classifier.js +0 -180
  1430. package/dist/generators/chain-classifier.js.map +0 -1
  1431. package/dist/generators/chain-classifier.test.d.ts +0 -2
  1432. package/dist/generators/chain-classifier.test.d.ts.map +0 -1
  1433. package/dist/generators/chain-classifier.test.js +0 -257
  1434. package/dist/generators/chain-classifier.test.js.map +0 -1
  1435. package/dist/generators/chain-rules.d.ts +0 -42
  1436. package/dist/generators/chain-rules.d.ts.map +0 -1
  1437. package/dist/generators/chain-rules.js +0 -144
  1438. package/dist/generators/chain-rules.js.map +0 -1
  1439. package/dist/generators/chain-rules.test.d.ts +0 -2
  1440. package/dist/generators/chain-rules.test.d.ts.map +0 -1
  1441. package/dist/generators/chain-rules.test.js +0 -179
  1442. package/dist/generators/chain-rules.test.js.map +0 -1
  1443. package/dist/generators/handshake-diff.d.ts +0 -67
  1444. package/dist/generators/handshake-diff.d.ts.map +0 -1
  1445. package/dist/generators/handshake-diff.js +0 -183
  1446. package/dist/generators/handshake-diff.js.map +0 -1
  1447. package/dist/generators/handshake-diff.test.d.ts +0 -2
  1448. package/dist/generators/handshake-diff.test.d.ts.map +0 -1
  1449. package/dist/generators/handshake-diff.test.js +0 -264
  1450. package/dist/generators/handshake-diff.test.js.map +0 -1
  1451. package/dist/lib/onboarding-phases.d.ts +0 -9
  1452. package/dist/lib/onboarding-phases.d.ts.map +0 -1
  1453. package/dist/lib/onboarding-phases.js +0 -120
  1454. package/dist/lib/onboarding-phases.js.map +0 -1
  1455. package/templates/archetypes/boundary.md +0 -23
  1456. package/templates/archetypes/constraint.md +0 -23
  1457. package/templates/archetypes/convention.md +0 -23
  1458. package/templates/archetypes/policy.md +0 -23
  1459. package/templates/archetypes/quality-gate.md +0 -23
  1460. package/templates/archetypes/workflow.md +0 -23
@@ -1,24 +1,45 @@
1
1
  /**
2
2
  * pb handshake — generate context files for AI developer tools.
3
- * The fourth delivery surface: context export (GLO-63, DEC-161).
3
+ * Context export wiring (read-only filesystem bridge; GLO-63, DEC-161) — not a product surface.
4
4
  */
5
- import { mkdirSync, writeFileSync, existsSync, readFileSync, readdirSync, copyFileSync } from 'fs';
6
- import { join, dirname, resolve } from 'path';
5
+ import { mkdirSync, writeFileSync, existsSync, readFileSync, readdirSync, copyFileSync, realpathSync } from 'fs';
6
+ import { join, dirname, resolve, basename, relative, sep } from 'path';
7
7
  import { homedir } from 'os';
8
8
  import { fileURLToPath } from 'url';
9
+ import { execSync } from 'child_process';
9
10
  import { getConfigOrGuide } from '../lib/config.js';
10
- import { select as promptSelect } from '../lib/prompts.js';
11
+ import { select as promptSelect, confirm as promptConfirm } from '../lib/prompts.js';
12
+ import { composeHooksFromIntents, getHookStatusForSurface } from '../lib/hook-intents.js';
11
13
  import { kernelCall } from '../lib/client.js';
14
+ import { readSession } from '../lib/session.js';
12
15
  import { detectRepo, extractWorkspaceProfile } from '../lib/repo-detect.js';
13
16
  import { generateContextMd } from '../generators/context-md.js';
14
17
  import { generateBriefingMd } from '../generators/briefing-md.js';
15
- import { MARKER, generateAgentsMd, generateClaudeMd, generateCursorMdc, generateCopilotMd } from '../generators/adapters.js';
16
- import { readCanonicalSkills, readCanonicalRules, generateCursorSkill, generateCursorRule, generateCodexSkill, generateCodexSkillIndex, generateClaudeRule, generateClaudeSkillRouter, shouldEmitToTarget, filterByLevel, validateCodexSkills, evaluateConditions, STAGE_TO_MAX_LEVEL, LEVEL_ORDER, } from '../generators/portable-knowledge.js';
17
- import { generateChainRules } from '../generators/chain-rules.js';
18
- import { saveHandshakeState, loadPreviousState, diffHandshakeState, formatDiff, buildCurrentState, } from '../generators/handshake-diff.js';
18
+ import { MARKER, generateAgentsMd, generateClaudeMd, generateCursorMdc, generateCopilotMd, generateCopilotInstructionFiles } from '../generators/adapters.js';
19
+ import { readCanonicalSkills, readCanonicalRules, readPersonalLayer, readPersonalSkillsLayer, generateCursorSkill, generateCursorRule, generateCodexSkill, generateCodexSkillIndex, shouldEmitToTarget, filterByLevel, validateCodexSkills, evaluateConditions, } from '../generators/portable-knowledge.js';
20
+ import { findNoProjectionAssets } from '../generators/noProjectionAssets.js'; // WP-660 S2 combine
19
21
  import { resolveSurfaceProfile } from '../generators/surface-profiles.js';
22
+ import { generateEveryoneRulesMd } from '../generators/everyone-rules-md.js';
23
+ import { retireGeneratedProjections } from '../generators/retired-projections.js';
24
+ import { formatWorkspaceWideRuleLines } from '../lib/ruleListRender.js';
20
25
  import { formatHandshakeReport } from '../formatters/handshake.js';
26
+ import { classifyAdapterFile, detectEol, spliceAppend, spliceReplace } from '../generators/region.js';
27
+ import { REGION_PROJECTIONS } from '../generators/region-projections.js';
28
+ import { readManifest, readManifestStatus, filterByAdoptionState } from '../generators/manifest.js';
29
+ import { generateBoundaryManifest, getBoundaryEnforcementMode } from '../generators/boundary-manifest.js';
30
+ import { loadMethodRegistry } from '../lib/method-registry.js';
21
31
  import { CLIError, ErrorCode } from '../lib/errors.js';
32
+ import { isJsonMode } from '../lib/runner.js';
33
+ import { stripConvexInternals } from '../lib/strip.js';
34
+ import { replaceVocabTokens } from '../lib/canonicalRefs.js';
35
+ // WP-436 S3: vocab projector — resolves {{vocab:...}} tokens before writing to disk.
36
+ import { getOrFetchVocabCtx } from '../lib/workspaceVocabCache.js';
37
+ import { normalizeMaterializedFilename } from '../lib/normalizeMaterializedFilename.js';
38
+ import { findLeftoverCursorSkills, LEFTOVER_FILES_MAX } from './handshakeCursorSkillCleanup.js';
39
+ import { classifyDriftBucket } from './handshakeDriftClassification.js';
40
+ import { sanitizeStartupResolutionSignals } from '../lib/startup-resolution-signals.js';
41
+ import { assertSetupWritePath } from '../lib/writePerimeter.js';
42
+ import { SURFACE_GOVERN_NO_SURFACES, SURFACE_REGISTRY, validateSurfacesForMode, } from '../surfaces/registry.js';
22
43
  const LEVELS = {
23
44
  guide: {
24
45
  label: 'Guide me',
@@ -47,12 +68,8 @@ const LEVELS = {
47
68
  };
48
69
  // Explicit ordering — determines menu numbering in promptLevel(). Do not reorder.
49
70
  const LEVEL_KEYS = ['guide', 'work', 'silent', 'full-trust'];
50
- // Hook failure contract (TEN-712): all hook commands MUST end with '2>/dev/null || true'
51
- // so Claude Code always starts even if pb is unavailable. Never remove this suffix.
71
+ // Hook failure contract (TEN-712): every hook command MUST end with '|| true' so Claude Code always starts even if pb is unavailable.
52
72
  const INIT_PERMISSION = 'Bash(pb:*)';
53
- const INIT_SESSION_START_CMD = 'pb session start 2>/dev/null || true';
54
- const INIT_SESSION_CLOSE_CMD = 'pb session close 2>/dev/null || true';
55
- const INIT_PRECOMPACT_CMD = 'pb session id > /dev/null 2>&1 && echo \'{"systemMessage": "pb session active — capture decisions/tensions before compacting: pb capture \\"DEC: ...\\""}\' || true';
56
73
  function readSettings(filePath) {
57
74
  if (!existsSync(filePath))
58
75
  return {};
@@ -64,9 +81,6 @@ function readSettings(filePath) {
64
81
  return {};
65
82
  }
66
83
  }
67
- function hasCommand(groups, cmd) {
68
- return (groups ?? []).some((g) => g.hooks?.some((h) => h.command === cmd));
69
- }
70
84
  // Team write: hooks + Bash(pb:*) → .claude/settings.json (safe to commit)
71
85
  function writeTeamSettings(cwd, dryRun) {
72
86
  const claudeDir = join(cwd, '.claude');
@@ -82,26 +96,10 @@ function writeTeamSettings(cwd, dryRun) {
82
96
  }
83
97
  settings.permissions = permissions;
84
98
  const hooks = (settings.hooks ?? {});
85
- if (!hasCommand(hooks.SessionStart, INIT_SESSION_START_CMD)) {
86
- hooks.SessionStart = [
87
- ...(hooks.SessionStart ?? []),
88
- { hooks: [{ type: 'command', command: INIT_SESSION_START_CMD, statusMessage: 'Opening pb session...' }] },
89
- ];
90
- added.push('SessionStart → pb session start');
91
- }
92
- if (!hasCommand(hooks.Stop, INIT_SESSION_CLOSE_CMD)) {
93
- hooks.Stop = [
94
- ...(hooks.Stop ?? []),
95
- { hooks: [{ type: 'command', command: INIT_SESSION_CLOSE_CMD, statusMessage: 'Closing pb session...' }] },
96
- ];
97
- added.push('Stop → pb session close');
98
- }
99
- if (!hasCommand(hooks.PreCompact, INIT_PRECOMPACT_CMD)) {
100
- hooks.PreCompact = [
101
- ...(hooks.PreCompact ?? []),
102
- { hooks: [{ type: 'command', command: INIT_PRECOMPACT_CMD }] },
103
- ];
104
- added.push('PreCompact → decision capture reminder');
99
+ const hookAdditions = composeHooksFromIntents(['session-start', 'session-close', 'pre-compact'], hooks);
100
+ for (const addition of hookAdditions) {
101
+ hooks[addition.event] = [...(hooks[addition.event] ?? []), addition.entry];
102
+ added.push(addition.label);
105
103
  }
106
104
  settings.hooks = hooks;
107
105
  if (!dryRun) {
@@ -171,8 +169,7 @@ export async function runHandshakeInit(options = {}) {
171
169
  for (const item of teamAdded)
172
170
  console.log(` + ${item}`);
173
171
  }
174
- // Step 2: Personal config — wizard or --level flag
175
- // Cast is safe: LEVEL_KEYS.includes() validated above; invalid level already threw CLIError.
172
+ // Step 2: Personal config — wizard or --level flag. Cast is safe: LEVEL_KEYS.includes() validated above.
176
173
  const levelKey = options.level ? options.level : await promptLevel();
177
174
  const level = LEVELS[levelKey];
178
175
  const personalAdded = writePersonalSettings(levelKey, dryRun);
@@ -194,6 +191,27 @@ export async function runHandshakeInit(options = {}) {
194
191
  if (!dryRun)
195
192
  console.log('Reload /hooks in Claude Code (or restart) to activate.');
196
193
  console.log('Run `pb handshake --init --level <guide|work|silent|full-trust>` to change level.');
194
+ // Step 2b: Report multi-surface hook opt-in status (WP-310 E3b) — manifest.hooks.{cursor,copilot}, silence = no manifest/flags (DEC-536).
195
+ const pbDirForManifest = join(cwd, '.productbrain');
196
+ const initManifest = readManifest(pbDirForManifest);
197
+ const multiSurfaceOptIns = [];
198
+ if (initManifest?.hooks?.cursor)
199
+ multiSurfaceOptIns.push('cursor');
200
+ if (initManifest?.hooks?.copilot)
201
+ multiSurfaceOptIns.push('copilot');
202
+ if (multiSurfaceOptIns.length > 0) {
203
+ console.log('');
204
+ for (const surface of multiSurfaceOptIns) {
205
+ const status = getHookStatusForSurface(surface);
206
+ if (status.writable) {
207
+ // Future-proofing path: surface has hook events, would write files.
208
+ console.log(`ℹ ${surface} hooks: opted in — hooks will be written`);
209
+ }
210
+ else {
211
+ console.log(`ℹ ${surface} hooks: opted in — no auto-hooks (${surface} has no session events; run \`pb session start\` manually)`);
212
+ }
213
+ }
214
+ }
197
215
  // Step 3: Scaffold starter templates if .productbrain/rules/ is empty
198
216
  const rulesDir = join(cwd, '.productbrain', 'rules');
199
217
  const hasExistingRules = existsSync(rulesDir) && readdirSync(rulesDir).filter((f) => f.endsWith('.md')).length > 0;
@@ -242,24 +260,239 @@ export async function runHandshakeInit(options = {}) {
242
260
  }
243
261
  }
244
262
  }
245
- /**
246
- * Normalize volatile handshake-only timestamps before comparing generated files.
247
- * This keeps the visible timestamps in generated artifacts while avoiding
248
- * meaningless rewrites when semantic content is unchanged.
249
- */
263
+ const LOCAL_REF_REGEX = /\b(?:WP|TEN|DEC|BET|FEAT|INS|STD|PRI|ARCH)[-\s#]*\d+\b|\bPR\s*#?\s*\d+\b/gi;
264
+ const STARTUP_RESOLUTION_RESOLVER_VERSION = 'startup-resolution-v1';
265
+ // Global cap on collected refs (spec "Contract: StartupResolutionSignals" — arrays are capped).
266
+ const LOCAL_REF_GLOBAL_CAP = 25;
267
+ // Per-source cap so a broad source (context.md) can't starve briefing.md's task-specific refs (Codex@677).
268
+ const LOCAL_REF_PER_SOURCE_CAP = 18;
269
+ // Time-boxed so an unauthed/slow `gh` can't stall session-start (F4).
270
+ const PR_DIFF_TIMEOUT_MS = 4_000;
271
+ // Bounds worst-case `gh` subprocess invocations per handshake.
272
+ const PR_DIFF_MAX_REFS = 5;
273
+ function runGitText(cwd, command) {
274
+ try {
275
+ const value = execSync(command, {
276
+ cwd,
277
+ encoding: 'utf8',
278
+ stdio: ['ignore', 'pipe', 'ignore'],
279
+ }).trim();
280
+ return value.length > 0 ? value : undefined;
281
+ }
282
+ catch {
283
+ return undefined;
284
+ }
285
+ }
286
+ /** Dereference a "PR #N" ref to its changed paths via `gh pr diff <N> --name-only` (F4: server
287
+ * resolver has no git/gh access). Guarded/time-boxed; `run` is injectable for tests. */
288
+ export function dereferencePrRefToPaths(cwd, prNumber, run = runGitTextTimeboxed) {
289
+ if (!Number.isInteger(prNumber) || prNumber <= 0)
290
+ return [];
291
+ const raw = run(cwd, `gh pr diff ${prNumber} --name-only`, PR_DIFF_TIMEOUT_MS);
292
+ if (!raw)
293
+ return [];
294
+ return raw.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
295
+ }
296
+ /** Time-boxed variant of runGitText for the PR-diff dereference (F4). */
297
+ function runGitTextTimeboxed(cwd, command, timeoutMs) {
298
+ try {
299
+ const value = execSync(command, {
300
+ cwd,
301
+ encoding: 'utf8',
302
+ stdio: ['ignore', 'pipe', 'ignore'],
303
+ timeout: timeoutMs,
304
+ }).trim();
305
+ return value.length > 0 ? value : undefined;
306
+ }
307
+ catch {
308
+ return undefined;
309
+ }
310
+ }
311
+ function readOptionalLocalText(cwd, path) {
312
+ const fullPath = join(cwd, path);
313
+ if (!existsSync(fullPath))
314
+ return undefined;
315
+ try {
316
+ return readFileSync(fullPath, 'utf8');
317
+ }
318
+ catch {
319
+ return undefined;
320
+ }
321
+ }
322
+ function normalizeLocalRef(ref) {
323
+ const trimmed = ref.trim().replace(/\s+/g, ' ');
324
+ const pr = trimmed.match(/^PR\s*#?\s*(\d+)$/i);
325
+ if (pr)
326
+ return `PR #${pr[1]}`;
327
+ const entry = trimmed.match(/^([A-Z]+)[-\s#]*(\d+)$/i);
328
+ if (entry)
329
+ return `${entry[1].toUpperCase()}-${entry[2]}`;
330
+ return trimmed;
331
+ }
332
+ /** Collect normalized local refs across several text sources, deduped. Codex@677: a per-source
333
+ * cap alongside the global one, so a broad source (context.md) can't starve a later,
334
+ * task-specific source (briefing.md); already-collected refs dedupe without spending later quota. */
335
+ function collectLocalRefs(texts) {
336
+ const refs = [];
337
+ const seen = new Set();
338
+ for (const text of texts) {
339
+ if (!text)
340
+ continue;
341
+ let fromThisSource = 0;
342
+ for (const match of text.matchAll(LOCAL_REF_REGEX)) {
343
+ const ref = normalizeLocalRef(match[0]);
344
+ const key = ref.toLowerCase();
345
+ if (seen.has(key))
346
+ continue;
347
+ if (fromThisSource >= LOCAL_REF_PER_SOURCE_CAP)
348
+ break;
349
+ seen.add(key);
350
+ refs.push(ref);
351
+ fromThisSource++;
352
+ if (refs.length >= LOCAL_REF_GLOBAL_CAP)
353
+ return refs;
354
+ }
355
+ }
356
+ return refs;
357
+ }
358
+ function deriveHandshakeStartupTask(refs, changedPaths, callerTask) {
359
+ if (callerTask && callerTask.trim())
360
+ return callerTask.trim();
361
+ const parts = [];
362
+ if (refs.length > 0)
363
+ parts.push(refs.join(' '));
364
+ if (changedPaths.length > 0)
365
+ parts.push(`changed paths ${changedPaths.slice(0, 5).join(' ')}`);
366
+ return parts.length > 0 ? parts.join(' ') : undefined;
367
+ }
368
+ const DEFAULT_HANDSHAKE_SIGNAL_DEPS = {
369
+ runGit: runGitText,
370
+ prDiff: (cwd, prNumber) => dereferencePrRefToPaths(cwd, prNumber),
371
+ };
372
+ /** Extract the PR number from a normalized "PR #N" ref, else null. */
373
+ function prNumberFromRef(ref) {
374
+ const m = ref.match(/^PR\s*#?\s*(\d+)$/i);
375
+ if (!m)
376
+ return null;
377
+ const n = Number(m[1]);
378
+ return Number.isInteger(n) && n > 0 ? n : null;
379
+ }
380
+ export function deriveHandshakeStartupSignals(cwd, callerSignals = {}, deps = DEFAULT_HANDSHAKE_SIGNAL_DEPS) {
381
+ const { runGit, prDiff } = deps;
382
+ const branchName = runGit(cwd, 'git branch --show-current');
383
+ const commitSha = runGit(cwd, 'git rev-parse --short HEAD');
384
+ // Changed paths, unioned + deduped: (1) dirty worktree; (2) committed branch delta vs origin/main's
385
+ // merge-base (Codex@665, invisible once the tree is clean); (3) PR-ref dereference (F4), appended later.
386
+ const dirtyChangedPaths = runGit(cwd, 'git diff --name-only HEAD')?.split(/\r?\n/).filter(Boolean) ?? [];
387
+ const mergeBase = runGit(cwd, 'git merge-base HEAD origin/main');
388
+ const branchChangedPaths = mergeBase
389
+ ? (runGit(cwd, `git diff --name-only ${mergeBase} HEAD`)?.split(/\r?\n/).filter(Boolean) ?? [])
390
+ : [];
391
+ const worktreeName = basename(cwd);
392
+ const contextText = readOptionalLocalText(cwd, '.productbrain/context.md');
393
+ const briefingText = readOptionalLocalText(cwd, '.productbrain/briefing.md');
394
+ const callerRefs = Array.isArray(callerSignals.reviewedArtifactRefs) ? callerSignals.reviewedArtifactRefs.join('\n') : undefined;
395
+ // Codex@677: briefing.md (task-specific) reads BEFORE context.md (broad) so its refs collect first — with the per-source cap, context.md can't starve briefing.
396
+ const refs = collectLocalRefs([
397
+ callerSignals.taskText ?? undefined,
398
+ callerSignals.explicitScope ?? undefined,
399
+ callerRefs,
400
+ branchName,
401
+ worktreeName,
402
+ briefingText,
403
+ contextText,
404
+ ]);
405
+ // F4: dereference "PR #N" refs to diff paths, folded into changedPaths — the only place this can happen (server records dereferenced:false, no git access). Time-boxed; absent/unauthed gh no-ops.
406
+ const prDiffPaths = [];
407
+ if (callerSignals.changedPaths === undefined) {
408
+ let derefed = 0;
409
+ for (const ref of refs) {
410
+ const prNumber = prNumberFromRef(ref);
411
+ if (prNumber === null)
412
+ continue;
413
+ if (derefed >= PR_DIFF_MAX_REFS)
414
+ break;
415
+ derefed++;
416
+ try {
417
+ for (const p of prDiff(cwd, prNumber))
418
+ prDiffPaths.push(p);
419
+ }
420
+ catch {
421
+ // gh absent / unauthed / PR missing — skip gracefully, leave existing behavior.
422
+ }
423
+ }
424
+ }
425
+ // Caller-supplied changedPaths win (backward compat); otherwise union the
426
+ // three local sources, deduped, order-stable.
427
+ const unionedChangedPaths = callerSignals.changedPaths ??
428
+ Array.from(new Set([...dirtyChangedPaths, ...branchChangedPaths, ...prDiffPaths]));
429
+ const baseSignals = sanitizeStartupResolutionSignals({
430
+ ...callerSignals,
431
+ sourceSurface: callerSignals.sourceSurface ?? 'cli',
432
+ resolverVersion: callerSignals.resolverVersion ?? STARTUP_RESOLUTION_RESOLVER_VERSION,
433
+ branchName: callerSignals.branchName ?? branchName,
434
+ worktreeName: callerSignals.worktreeName ?? worktreeName,
435
+ changedPaths: unionedChangedPaths,
436
+ reviewedArtifactRefs: callerSignals.reviewedArtifactRefs ?? refs,
437
+ commitSha: callerSignals.commitSha ?? commitSha,
438
+ });
439
+ const taskText = deriveHandshakeStartupTask(baseSignals.reviewedArtifactRefs ?? [], baseSignals.changedPaths ?? [], baseSignals.taskText);
440
+ const sanitized = sanitizeStartupResolutionSignals({
441
+ ...baseSignals,
442
+ taskText,
443
+ });
444
+ const hasMeaningfulEvidence = Boolean(sanitized.taskText) ||
445
+ (sanitized.changedPaths?.length ?? 0) > 0 ||
446
+ (sanitized.reviewedArtifactRefs?.length ?? 0) > 0 ||
447
+ Boolean(sanitized.explicitScope);
448
+ if (hasMeaningfulEvidence)
449
+ return sanitized;
450
+ // Codex@704: even with no evidence, emit a minimal envelope carrying attribution — {} would
451
+ // drop the whole startup block, losing the loud domain-unresolved signal (spec "Loud Unresolved State", AC #4).
452
+ return sanitizeStartupResolutionSignals({
453
+ sourceSurface: sanitized.sourceSurface ?? 'cli',
454
+ resolverVersion: sanitized.resolverVersion ?? STARTUP_RESOLUTION_RESOLVER_VERSION,
455
+ branchName: sanitized.branchName,
456
+ worktreeName: sanitized.worktreeName,
457
+ commitSha: sanitized.commitSha,
458
+ changeId: sanitized.changeId,
459
+ });
460
+ }
461
+ /** Normalize volatile handshake-only timestamps before comparing generated files — keeps visible
462
+ * timestamps in artifacts while avoiding meaningless rewrites when content is unchanged. */
250
463
  export function normalizeHandshakeContentForComparison(content) {
251
464
  return content
252
465
  .replace(/<!-- auto-generated by pb handshake — [0-9]{4}-[0-9]{2}-[0-9]{2}T[^>]+ -->/g, '<!-- auto-generated by pb handshake — <TIMESTAMP> -->')
253
466
  .replace(/^_Generated: [0-9]{4}-[0-9]{2}-[0-9]{2}T.*_$/gm, '_Generated: <TIMESTAMP>_');
254
467
  }
255
468
  function shouldWriteAdapter(filePath, force) {
256
- if (force)
257
- return true;
469
+ // An absent file at an adapter path is a projection target → materialize it.
258
470
  if (!existsSync(filePath))
259
471
  return true;
260
472
  const content = readFileSync(filePath, 'utf8');
473
+ // No MARKER → user-owned/committed-static (CLAUDE.md, AGENTS.md, Copilot instructions) — never overwritten, not even under --force.
474
+ void force;
261
475
  return content.includes(MARKER);
262
476
  }
477
+ function normalizeSurfaceName(surface) {
478
+ const stripped = surface.startsWith('.') ? surface.slice(1) : surface;
479
+ const normalized = stripped === 'github' ? 'copilot' : stripped;
480
+ return normalized in SURFACE_REGISTRY ? normalized : null;
481
+ }
482
+ function surfacePerimeterRoots(surface) {
483
+ if (surface === 'codex')
484
+ return ['.codex', SURFACE_REGISTRY.codex.hookFilePath];
485
+ if (surface === 'copilot')
486
+ return ['.github', SURFACE_REGISTRY.copilot.hookFilePath];
487
+ if (surface === 'claude')
488
+ return ['.claude', 'CLAUDE.md'];
489
+ return [`.${surface}`];
490
+ }
491
+ // WP-776 S3f: modeRank deleted — its only caller compared authority-mode transitions for the
492
+ // now-deleted setup.recordTransition receipt.
493
+ // ── WP-421 S3: Three-bucket drift classification (doneWhen #17) — now its own module (STD-2/DEC-1504
494
+ // shrink-only offset). Re-exported so existing imports `from '../commands/handshake.js'` keep working.
495
+ export { classifyDriftBucket };
263
496
  function deduplicateEntries(entries) {
264
497
  const seen = new Set();
265
498
  const result = [];
@@ -272,19 +505,127 @@ function deduplicateEntries(entries) {
272
505
  }
273
506
  return result;
274
507
  }
508
+ /**
509
+ * findLeftoverProjections — WP-379 S5b
510
+ *
511
+ * Lists marker-bearing files under .cursor/rules/, .claude/rules/, .claude/skills/, .codex/skills/
512
+ * (plus the nested .cursor/skills/<name>/SKILL.md layout) that look stale: orphan (no canonical
513
+ * asset), stale case/punctuation variant, or a leftover `.dormant` copy. User-owned (no MARKER)
514
+ * files and unselected `allowedTargets` are never reported.
515
+ *
516
+ * Round 12: stops once `LEFTOVER_FILES_MAX + 1` matches are found across the flat + merged
517
+ * nested-Cursor scan combined — bounds read/enumerate I/O, not just the reported list.
518
+ * `truncated` says more exist beyond the capped, returned `files`.
519
+ *
520
+ * @param cursorSkillNames Cursor-specific, SKILL-kind-only canon (falls back to `assetNames`).
521
+ * @param exactRelativePaths Round 11: exact write-plan paths (forward-slash), exempted from both
522
+ * checks — covers asset-less generated files and a canonical raw name not already normalized.
523
+ */
524
+ export function findLeftoverProjections(cwd, assetNames, allowedTargets, cursorSkillNames, exactRelativePaths) {
525
+ const TARGET_DIRS_BY_EXT = [
526
+ { dir: join(cwd, '.cursor', 'rules'), ext: '.mdc', surface: 'cursor' },
527
+ { dir: join(cwd, '.claude', 'rules'), ext: '.md', surface: 'claude' },
528
+ { dir: join(cwd, '.claude', 'skills'), ext: '.md', surface: 'claude' },
529
+ { dir: join(cwd, '.codex', 'skills'), ext: '.md', surface: 'codex' },
530
+ ];
531
+ const canonicalNormalizedStems = new Set(assetNames.map((n) => normalizeMaterializedFilename(n)));
532
+ const exactPaths = exactRelativePaths ?? new Set();
533
+ const leftovers = [];
534
+ let truncated = false;
535
+ scanLoop: for (const { dir, ext, surface } of TARGET_DIRS_BY_EXT) {
536
+ if (!allowedTargets.has(surface))
537
+ continue;
538
+ if (!existsSync(dir))
539
+ continue;
540
+ let files;
541
+ try {
542
+ files = readdirSync(dir);
543
+ }
544
+ catch {
545
+ continue; // unreadable dir — skip
546
+ }
547
+ for (const filename of files) {
548
+ if (!filename.endsWith(ext) && !filename.endsWith(`${ext}.dormant`))
549
+ continue;
550
+ const fullPath = join(dir, filename);
551
+ let content;
552
+ try {
553
+ content = readFileSync(fullPath, 'utf8');
554
+ }
555
+ catch {
556
+ continue; // unreadable file — skip
557
+ }
558
+ if (!content.includes(MARKER))
559
+ continue; // user-owned — never reported
560
+ const isDormant = filename.endsWith('.dormant');
561
+ // A live file the write plan targets by this exact path is canonical by construction.
562
+ if (!isDormant) {
563
+ const relativePath = relative(cwd, fullPath).split(sep).join('/');
564
+ if (exactPaths.has(relativePath))
565
+ continue;
566
+ }
567
+ const stem = basename(isDormant ? filename.slice(0, -'.dormant'.length) : filename, ext);
568
+ const normalizedStem = normalizeMaterializedFilename(stem);
569
+ let entry = null;
570
+ if (!canonicalNormalizedStems.has(normalizedStem)) {
571
+ entry = { path: fullPath, reason: 'orphan — no canonical asset matches this name' };
572
+ }
573
+ else if (isDormant) {
574
+ entry = { path: fullPath, reason: 'leftover .dormant file from an older binary version' };
575
+ }
576
+ else if (stem !== normalizedStem) {
577
+ entry = { path: fullPath, reason: `stale case/punctuation variant — canonical form is "${normalizedStem}${ext}"` };
578
+ }
579
+ if (!entry)
580
+ continue;
581
+ leftovers.push(entry);
582
+ if (leftovers.length > LEFTOVER_FILES_MAX) {
583
+ truncated = true;
584
+ leftovers.pop();
585
+ break scanLoop;
586
+ }
587
+ }
588
+ }
589
+ // Nested Cursor skills — extracted to its own module (STD-2/DEC-1504 shrink-only offset).
590
+ // Skipped once the flat scan already hit the cap; the remaining budget keeps the combined
591
+ // total across both scans stopping at LEFTOVER_FILES_MAX + 1.
592
+ if (!truncated && allowedTargets.has('cursor')) {
593
+ const nested = findLeftoverCursorSkills(cwd, cursorSkillNames ?? assetNames, LEFTOVER_FILES_MAX - leftovers.length);
594
+ leftovers.push(...nested.files);
595
+ truncated = nested.truncated;
596
+ }
597
+ return { files: leftovers, truncated };
598
+ }
599
+ /** Round 13 (Codex P1, security): strips a `user:token@` userinfo segment from an https remote
600
+ * so a credential never reaches JSON output. SSH remotes (`git@host:...`) are untouched — that
601
+ * `git@` is a fixed public username, not a secret. */
602
+ function redactGitRemote(remote) {
603
+ return remote ? remote.replace(/^(https?:\/\/)[^@/]+@/i, '$1') : remote;
604
+ }
605
+ /** Round 13 (Codex P1, security): `pb --json handshake` serialized the report directly — leaking
606
+ * an HTTPS git-remote credential and raw Convex `_id`/`_creationTime` on `matchedEntries` (never
607
+ * went through the shared runner's `stripConvexInternals`). One public shape, both JSON paths. */
608
+ function toPublicJsonReport(report) {
609
+ return stripConvexInternals({ ...report, repo: { ...report.repo, gitRemote: redactGitRemote(report.repo.gitRemote) } });
610
+ }
275
611
  export async function runHandshake(options = {}) {
276
- const config = await getConfigOrGuide(() => runHandshake(options));
612
+ const config = await getConfigOrGuide(async () => { await runHandshake(options); });
277
613
  if (!config)
278
- return;
614
+ return undefined;
279
615
  const cwd = process.cwd();
280
616
  const force = options.force ?? false;
281
617
  const dryRun = options.dryRun ?? false;
618
+ // Preview mode: default when neither --apply nor --dry-run is passed (--dry-run is a backward-compat alias).
619
+ const preview = !options.apply && !dryRun;
620
+ const applyMode = options.apply === true && !dryRun;
282
621
  const level = options.level;
622
+ // `quiet` gates the final report write (`--json` alone still prints). `suppressProgress`
623
+ // also silences stdout log() prose in JSON mode. logErr() stays on `quiet` alone (stderr).
283
624
  const quiet = options.quiet ?? false;
284
- const generate = options.generate ?? false;
625
+ const suppressProgress = quiet || isJsonMode();
285
626
  const timestamp = new Date().toISOString();
286
- // Helper: emit progress line only when not quiet (used when handshake is a sub-step)
287
- const log = (msg) => { if (!quiet)
627
+ // Helper: emit progress line only when not suppressed. logErr is gated on `quiet` alone.
628
+ const log = (msg) => { if (!suppressProgress)
288
629
  process.stdout.write(msg + '\n'); };
289
630
  const logErr = (msg) => { if (!quiet)
290
631
  process.stderr.write(msg + '\n'); };
@@ -303,6 +644,21 @@ export async function runHandshake(options = {}) {
303
644
  if (repo.detectedStack.length > 0) {
304
645
  log(`Stack: ${repo.detectedStack.join(', ')}`);
305
646
  }
647
+ const startupSignals = deriveHandshakeStartupSignals(cwd, options.startupSignals ?? {});
648
+ const orientArgs = { tier: 'standard' };
649
+ if (options.invocationPath)
650
+ orientArgs.invocationPath = options.invocationPath;
651
+ if (Object.keys(startupSignals).length > 0) {
652
+ orientArgs.startupSignals = startupSignals;
653
+ if (startupSignals.taskText)
654
+ orientArgs.task = startupSignals.taskText;
655
+ }
656
+ // Scopes the role rule lists this orient call returns to THIS session, not a sibling's.
657
+ const activeSession = readSession();
658
+ if (activeSession?.sessionId)
659
+ orientArgs.sessionId = activeSession.sessionId;
660
+ if (activeSession?.conversationId)
661
+ orientArgs.conversationId = activeSession.conversationId;
306
662
  // 2. Fetch orient view + workspace readiness in parallel (budget max +200ms added latency)
307
663
  log('Fetching workspace context...');
308
664
  let orientView = null;
@@ -310,7 +666,7 @@ export async function runHandshake(options = {}) {
310
666
  try {
311
667
  const workspaceReadinessPromise = kernelCall('chain.workspaceReadiness', {}).catch(() => null);
312
668
  const [orientResult, readinessRaw] = await Promise.all([
313
- kernelCall('chain.getOrientView', {}).catch((err) => {
669
+ kernelCall('chain.getOrientView', orientArgs).catch((err) => {
314
670
  logErr(`Warning: could not fetch workspace context — ${err instanceof Error ? err.message : err}`);
315
671
  logErr('Continuing with limited context (Chain search + portable knowledge only).');
316
672
  return null;
@@ -325,7 +681,7 @@ export async function runHandshake(options = {}) {
325
681
  logErr('Continuing with limited context (Chain search + portable knowledge only).');
326
682
  }
327
683
  if (workspaceProfile) {
328
- log(`Workspace profile: stage=${workspaceProfile.stage}, entries=${workspaceProfile.totalEntries}, governance=${workspaceProfile.governanceMode}`);
684
+ log(`Workspace profile: entries=${workspaceProfile.totalEntries}`);
329
685
  }
330
686
  // 3. Build search queries from repo context
331
687
  const searchQueries = [];
@@ -347,59 +703,99 @@ export async function runHandshake(options = {}) {
347
703
  const searchResults = await Promise.all(uniqueQueries.map((q) => kernelCall('chain.searchEntries', { query: q }).catch(() => [])));
348
704
  matchedEntries = deduplicateEntries(searchResults.flat());
349
705
  }
350
- // 5. Read canonical skills & rules from .productbrain/
706
+ // 5. Read canonical skills & rules — DB-first (WP-345 S0c, TEN-1459): query setup.listAssetsForUser, FS fallback.
351
707
  const pbDir = join(cwd, '.productbrain');
708
+ const manifestStatus = readManifestStatus(pbDir);
709
+ const manifest = manifestStatus.manifest;
710
+ const surfaceValidation = validateSurfacesForMode(manifestStatus.mode, manifestStatus.surfaces);
711
+ if (applyMode && surfaceValidation.error === SURFACE_GOVERN_NO_SURFACES) {
712
+ throw new CLIError('materialize: govern requires at least one registered manifest surface.', {
713
+ code: ErrorCode.VALIDATION_FAILED,
714
+ category: 'validation',
715
+ guidance: 'Add surfaces such as `.cursor` or `.claude` to .productbrain/manifest.yaml.',
716
+ });
717
+ }
718
+ for (const surface of surfaceValidation.unregisteredSurfaces) {
719
+ logErr(`Warning: manifest surface "${surface}" is not registered; skipping it.`);
720
+ }
721
+ const manifestTargets = new Set(surfaceValidation.registeredSurfaces);
722
+ const cliTargets = new Set();
723
+ const ignoredCliSurfaces = [];
724
+ for (const surface of options.surfaces ?? []) {
725
+ const normalized = normalizeSurfaceName(surface);
726
+ if (normalized && manifestTargets.has(normalized)) {
727
+ cliTargets.add(normalized);
728
+ }
729
+ else {
730
+ ignoredCliSurfaces.push(surface);
731
+ }
732
+ }
733
+ if (ignoredCliSurfaces.length > 0) {
734
+ logErr(`Warning: --surfaces ignored outside manifest.surfaces: ${ignoredCliSurfaces.join(', ')}`);
735
+ }
736
+ const allowedTargets = options.surfaces && options.surfaces.length > 0
737
+ ? cliTargets
738
+ : manifestTargets;
739
+ const perimeterManifest = {
740
+ surfaces: [...manifestTargets].flatMap(surfacePerimeterRoots),
741
+ };
742
+ const authorityCanWrite = manifestStatus.mode === 'project' || manifestStatus.mode === 'govern';
743
+ const authorityPreviewOnly = applyMode && !authorityCanWrite;
744
+ const writeMode = applyMode && authorityCanWrite;
745
+ // WP-776 S3f: the DB-first setup-asset sourcing pipeline (setup.listAssetsForUser +
746
+ // setup.fetchAssetBody + setup.resolveSemanticRefs + setup.ingestSetupAssetWithBody, plus the
747
+ // personal-asset dormancy sync and per-asset projection-hash/drift-detection bookkeeping around
748
+ // it) is deleted along with the rest of the setup-assets system — DEC-1771 (delete, never hide).
749
+ // The filesystem read path below (readCanonicalSkills/readCanonicalRules) was always the
750
+ // fallback when the DB source was unavailable; it is now the only source.
352
751
  const allSkills = readCanonicalSkills(pbDir);
353
752
  const manualRules = readCanonicalRules(pbDir);
354
- // 5a. Optionally fetch and merge Chain-derived rules (--generate flag)
355
- let chainRulesStats = null;
356
- let chainGaps = [];
753
+ // The --generate flag and its chain-rules generator are gone: the everyone/team/role rule lists
754
+ // (DEC-1774) are the rule-delivery path (context.md, chain.mdc, everyone-rules.md).
357
755
  let allRules = manualRules;
358
- if (generate) {
359
- log('Generating Chain-derived rules...');
360
- const chainResult = await generateChainRules(kernelCall, manualRules);
361
- if (chainResult.sentinel) {
362
- // MCP unavailable — inject sentinel rule and warn
363
- allRules = [...manualRules, chainResult.sentinel];
364
- logErr('Warning: Chain MCP unavailable — generated rules are disabled. Sentinel rule injected.');
365
- }
366
- else {
367
- // Merge generated rules after manual rules (manual takes precedence on dedup)
368
- allRules = [...manualRules, ...chainResult.rules];
369
- chainRulesStats = chainResult.stats;
370
- chainGaps = chainResult.gaps;
371
- const { generatedRules, suppressedByManual, suppressedByZeroEntries } = chainResult.stats;
372
- log(`Chain-derived rules: ${generatedRules} generated, ${suppressedByManual} suppressed by manual, ${suppressedByZeroEntries} gaps`);
373
- if (chainGaps.length > 0) {
374
- log(`Gaps (no matching governance entries): ${chainGaps.join(', ')}`);
756
+ // 5b. Read personal layer (WP-310 E2) — machine-local rules/skills from .productbrain/.local/, [] if absent, all persist: 'local'.
757
+ const personalRules = readPersonalLayer(pbDir);
758
+ if (personalRules.length > 0) {
759
+ // Name collision detection — warn when a personal rule overrides a team rule
760
+ const teamRuleNames = new Set(allRules.map((r) => r.name));
761
+ for (const pr of personalRules) {
762
+ if (teamRuleNames.has(pr.name)) {
763
+ logErr(`Personal rule "${pr.name}" overrides team rule (local takes precedence).`);
375
764
  }
376
- // Diff: compare current state against previous run
377
- const previousState = loadPreviousState(pbDir);
378
- const currentState = buildCurrentState(chainResult.rules, chainResult.classified);
379
- saveHandshakeState(pbDir, chainResult.rules, chainResult.classified);
380
- const diff = diffHandshakeState(currentState, previousState);
381
- const diffText = formatDiff(diff);
382
- log(diffText);
383
- }
384
- }
385
- // Apply level filtering with stage-gating (after read, before target filtering in write loop)
386
- // Stage caps the effective level: blank→beginner, seed→intermediate, grounded+→expert.
387
- // If stage caps below the requested level, log it so the user knows why items were dropped.
388
- const profileStage = workspaceProfile?.stage;
389
- const levelFilteredSkills = filterByLevel(allSkills, level, profileStage);
390
- const levelFilteredRules = filterByLevel(allRules, level, profileStage);
391
- // Log when stage gating changes the effective level
392
- if (profileStage) {
393
- const stageCap = STAGE_TO_MAX_LEVEL[profileStage];
394
- if (stageCap) {
395
- const requestedIdx = level ? LEVEL_ORDER.indexOf(level) : LEVEL_ORDER.length - 1;
396
- const capIdx = LEVEL_ORDER.indexOf(stageCap);
397
- if (capIdx < requestedIdx) {
398
- log(`Stage "${profileStage}" caps level from ${level || 'expert'} to ${stageCap}`);
765
+ }
766
+ // Merge: team rules first, personal rules appended (personal takes precedence via name collision above)
767
+ allRules = [...allRules, ...personalRules];
768
+ }
769
+ const personalSkills = readPersonalSkillsLayer(pbDir);
770
+ if (personalSkills.length > 0) {
771
+ const teamSkillNames = new Set(allSkills.map((s) => s.name));
772
+ for (const ps of personalSkills) {
773
+ if (teamSkillNames.has(ps.name)) {
774
+ logErr(`Personal skill "${ps.name}" overrides team skill (local takes precedence).`);
399
775
  }
400
776
  }
777
+ allSkills.push(...personalSkills);
778
+ }
779
+ // 5d. Load method registry (WP-310 E4) — only when manifest is present. Unrelated to the
780
+ // setup-assets system (WP-329's own "methods" Chain collection, no setup.* coupling) — kept.
781
+ let registrySource;
782
+ let registryStale;
783
+ if (manifest) {
784
+ const registryResult = await loadMethodRegistry().catch(() => null);
785
+ if (registryResult) {
786
+ registrySource = registryResult.source;
787
+ registryStale = registryResult.stale;
788
+ }
401
789
  }
402
- // Apply when-condition filtering (stage-aware, workspace profile + repo context)
790
+ const adoptionFilteredSkills = filterByAdoptionState(allSkills, manifest);
791
+ const adoptionFilteredRules = filterByAdoptionState(allRules, manifest);
792
+ // Compute adoption counts for report (only meaningful when manifest is present)
793
+ const adoptedRulesCount = manifest ? adoptionFilteredRules.length : undefined;
794
+ const rejectedRulesCount = manifest ? allRules.length - adoptionFilteredRules.length : undefined;
795
+ // Level filtering: requested level only (WP-762 C4e-2, DEC-1800 — no more stage cap).
796
+ const levelFilteredSkills = filterByLevel(adoptionFilteredSkills, level);
797
+ const levelFilteredRules = filterByLevel(adoptionFilteredRules, level);
798
+ // Apply when-condition filtering (workspace profile + repo context)
403
799
  const canonicalSkills = levelFilteredSkills.filter((skill) => {
404
800
  const result = evaluateConditions(skill.conditions ?? {}, workspaceProfile, repo);
405
801
  if (dryRun && !result.included) {
@@ -420,25 +816,23 @@ export async function runHandshake(options = {}) {
420
816
  if (dryRun && canonicalRules.length > 0) {
421
817
  log(` INCLUDED rules: ${canonicalRules.map((r) => r.name).join(', ')}`);
422
818
  }
819
+ const noProjectionAssets = findNoProjectionAssets(canonicalSkills, canonicalRules);
423
820
  if (canonicalSkills.length > 0 || canonicalRules.length > 0) {
424
821
  const levelSuffix = level ? ` (level: ${level})` : '';
425
- const stageSuffix = profileStage ? `, stage: ${profileStage}` : '';
426
822
  const stackSuffix = repo.detectedStack.length > 0 ? `, stack: [${repo.detectedStack.join(', ')}]` : '';
427
823
  const totalSkills = allSkills.length;
428
824
  const totalRules = allRules.length;
429
- log(`Portable knowledge: ${canonicalSkills.length}/${totalSkills} skills, ${canonicalRules.length}/${totalRules} rules${levelSuffix}${stageSuffix}${stackSuffix}`);
825
+ log(`Portable knowledge: ${canonicalSkills.length}/${totalSkills} skills, ${canonicalRules.length}/${totalRules} rules${levelSuffix}${stackSuffix}`);
430
826
  }
431
827
  // 6. Generate file contents
432
- // Build workspace context for AGENTS.md enrichment (stage, focus, governance, entry count)
828
+ // Build workspace context for AGENTS.md enrichment (focus, entry count) — TASK-435 (C4c) deleted `stage` from it.
433
829
  const agentsWorkspaceContext = workspaceProfile
434
830
  ? {
435
- stage: workspaceProfile.stage,
436
- focus: orientView?.strategicContext?.currentBet ?? undefined,
437
- governanceMode: workspaceProfile.governanceMode,
831
+ focus: orientView?.strategicContext?.currentWorkPackage ?? undefined,
438
832
  totalEntries: workspaceProfile.totalEntries,
439
833
  }
440
834
  : undefined;
441
- // Collect codex-targeted skills for AGENTS.md skill directory
835
+ // Collect codex-targeted skills for AGENTS.md skill directory — persist: 'local' entries included (all projections are local-only now).
442
836
  const agentsCodexSkills = canonicalSkills
443
837
  .filter((s) => shouldEmitToTarget(s, 'codex'))
444
838
  .map((s) => ({
@@ -468,35 +862,75 @@ export async function runHandshake(options = {}) {
468
862
  skills: copilotSkills.length > 0 ? copilotSkills : undefined,
469
863
  rules: copilotRules.length > 0 ? copilotRules : undefined,
470
864
  };
471
- const contextContent = orientView ? generateContextMd(orientView, repo, timestamp, workspaceProfile?.stage) : null;
865
+ const contextContent = orientView ? generateContextMd(orientView, repo, timestamp) : null;
866
+ // TASK-341 (WP-777): the SAME Everyone-bucket lines context.md's own "## Rules" section
867
+ // renders (formatWorkspaceWideRuleLines) — one reader, two projections, never a second
868
+ // re-derivation of "the everyone list".
869
+ const everyoneRuleLines = orientView ? formatWorkspaceWideRuleLines(orientView.ruleLists) : [];
870
+ const everyoneRulesContent = orientView ? generateEveryoneRulesMd(everyoneRuleLines, timestamp) : null;
472
871
  const briefingContent = generateBriefingMd(matchedEntries, repo, uniqueQueries, timestamp);
473
872
  const agentsContent = generateAgentsMd(timestamp, {
474
873
  workspaceContext: agentsWorkspaceContext,
475
874
  skills: agentsCodexSkills.length > 0 ? agentsCodexSkills : undefined,
476
875
  });
477
876
  const claudeContent = generateClaudeMd(timestamp);
478
- const cursorContent = generateCursorMdc(timestamp);
877
+ const cursorContent = generateCursorMdc(timestamp, undefined, everyoneRuleLines);
479
878
  const copilotContent = generateCopilotMd(timestamp, copilotOptions);
879
+ // DEC-1343: one committed .github/instructions/<slug>.instructions.md per copilot rule with applyTo; repo-wide rules stay above.
880
+ const copilotInstructionFiles = generateCopilotInstructionFiles(canonicalRules
881
+ .filter((r) => shouldEmitToTarget(r, 'copilot'))
882
+ // `.github/instructions/` is COMMITTED — never project a machine-local (persist: 'local') rule into it.
883
+ .filter((r) => r.persist !== 'local')
884
+ .map((r) => ({ name: r.name, body: r.body, applyTo: r.applyTo, sourcePath: r.sourcePath })), timestamp);
885
+ const boundaryEnforcementMode = getBoundaryEnforcementMode(manifest);
886
+ const boundaryManifestContent = boundaryEnforcementMode === 'advisory'
887
+ ? null
888
+ : generateBoundaryManifest(pbDir);
480
889
  // 7. Write files
481
890
  const filesWritten = [];
482
891
  const filesSkipped = [];
483
- // Surface filtering: skip adapter writes for targets not in the allowed set
484
- const allowedTargets = options.surfaces && options.surfaces.length > 0
485
- ? new Set(options.surfaces)
486
- : null; // null = write all
892
+ const previewPlan = [];
893
+ // WP-776 S3f: the personal-setup-asset authoring sync block (setup.markPersonalSetupAssetDormantFromSync
894
+ // + setup.updateLastProjectedHash) is deleted along with the DB-asset sourcing pipeline above —
895
+ // there is no DB-sourced personal asset any more to reconcile against .productbrain authoring files.
487
896
  const writes = [
488
897
  ...(contextContent ? [{ path: join(cwd, '.productbrain', 'context.md'), relative: '.productbrain/context.md', content: contextContent, dirs: join(cwd, '.productbrain'), isAdapter: false }] : []),
898
+ ...(everyoneRulesContent
899
+ ? [{
900
+ path: join(cwd, '.productbrain', 'generated', 'everyone-rules.md'),
901
+ relative: '.productbrain/generated/everyone-rules.md',
902
+ content: everyoneRulesContent,
903
+ dirs: join(cwd, '.productbrain', 'generated'),
904
+ isAdapter: false,
905
+ }]
906
+ : []),
489
907
  { path: join(cwd, '.productbrain', 'briefing.md'), relative: '.productbrain/briefing.md', content: briefingContent, isAdapter: false },
490
- { path: join(cwd, 'AGENTS.md'), relative: 'AGENTS.md', content: agentsContent, isAdapter: true, target: 'codex' },
491
- { path: join(cwd, 'CLAUDE.md'), relative: 'CLAUDE.md', content: claudeContent, isAdapter: true, target: 'claude' },
908
+ { path: join(cwd, 'AGENTS.md'), relative: 'AGENTS.md', content: agentsContent, isAdapter: true, target: 'codex', augmentTarget: true },
909
+ { path: join(cwd, 'CLAUDE.md'), relative: 'CLAUDE.md', content: claudeContent, isAdapter: true, target: 'claude', augmentTarget: true },
492
910
  { path: join(cwd, '.cursor', 'rules', 'chain.mdc'), relative: '.cursor/rules/chain.mdc', content: cursorContent, dirs: join(cwd, '.cursor', 'rules'), isAdapter: true, target: 'cursor' },
493
911
  { path: join(cwd, '.github', 'copilot-instructions.md'), relative: '.github/copilot-instructions.md', content: copilotContent, dirs: join(cwd, '.github'), isAdapter: true, target: 'copilot' },
912
+ ...copilotInstructionFiles.map((f) => ({
913
+ path: join(cwd, f.relativePath),
914
+ relative: f.relativePath,
915
+ content: f.content,
916
+ dirs: join(cwd, '.github', 'instructions'),
917
+ isAdapter: true,
918
+ target: 'copilot',
919
+ })),
920
+ ...(boundaryManifestContent ? [{
921
+ path: join(cwd, '.productbrain', 'generated', 'boundaries.json'),
922
+ relative: '.productbrain/generated/boundaries.json',
923
+ content: boundaryManifestContent,
924
+ dirs: join(cwd, '.productbrain', 'generated'),
925
+ isAdapter: false,
926
+ }] : []),
494
927
  ];
495
928
  // Add Cursor skill copies (filtered by target)
496
929
  const cursorProfile = resolveSurfaceProfile('cursor');
497
930
  for (const skill of canonicalSkills) {
498
931
  if (!shouldEmitToTarget(skill, 'cursor'))
499
932
  continue;
933
+ const dbAssetEntryId = skill.sourcePath.startsWith('db:') ? skill.sourcePath.slice(3) : undefined;
500
934
  const skillDir = join(cwd, '.cursor', 'skills', skill.name);
501
935
  writes.push({
502
936
  path: join(skillDir, 'SKILL.md'),
@@ -505,12 +939,14 @@ export async function runHandshake(options = {}) {
505
939
  dirs: skillDir,
506
940
  isAdapter: true,
507
941
  target: 'cursor',
942
+ dbAssetEntryId,
508
943
  });
509
944
  }
510
945
  // Add Codex skill copies (projected markdown + index)
511
946
  const codexProfile = resolveSurfaceProfile('codex');
512
947
  const codexSkills = canonicalSkills.filter((s) => shouldEmitToTarget(s, 'codex'));
513
948
  for (const skill of codexSkills) {
949
+ const dbAssetEntryId = skill.sourcePath.startsWith('db:') ? skill.sourcePath.slice(3) : undefined;
514
950
  writes.push({
515
951
  path: join(cwd, '.codex', 'skills', `${skill.name}.md`),
516
952
  relative: `.codex/skills/${skill.name}.md`,
@@ -518,6 +954,7 @@ export async function runHandshake(options = {}) {
518
954
  dirs: join(cwd, '.codex', 'skills'),
519
955
  isAdapter: true,
520
956
  target: 'codex',
957
+ dbAssetEntryId,
521
958
  });
522
959
  }
523
960
  writes.push({
@@ -534,6 +971,7 @@ export async function runHandshake(options = {}) {
534
971
  for (const rule of canonicalRules) {
535
972
  if (!shouldEmitToTarget(rule, 'cursor'))
536
973
  continue;
974
+ const dbAssetEntryId = rule.sourcePath.startsWith('db:') ? rule.sourcePath.slice(3) : undefined;
537
975
  writes.push({
538
976
  path: join(cwd, '.cursor', 'rules', `${rule.name}.mdc`),
539
977
  relative: `.cursor/rules/${rule.name}.mdc`,
@@ -541,64 +979,335 @@ export async function runHandshake(options = {}) {
541
979
  dirs: join(cwd, '.cursor', 'rules'),
542
980
  isAdapter: true,
543
981
  target: 'cursor',
982
+ dbAssetEntryId,
544
983
  });
545
984
  }
546
- // Add Claude Code rule copies (filtered by target)
547
- const claudeProfile = resolveSurfaceProfile('claude');
548
- for (const rule of canonicalRules) {
549
- if (!shouldEmitToTarget(rule, 'claude'))
550
- continue;
551
- writes.push({
552
- path: join(cwd, '.claude', 'rules', `${rule.name}.md`),
553
- relative: `.claude/rules/${rule.name}.md`,
554
- content: generateClaudeRule(rule, claudeProfile),
555
- dirs: join(cwd, '.claude', 'rules'),
556
- isAdapter: true,
557
- target: 'claude',
558
- });
985
+ // 7a. WP-379 S5b: find leftover projections (apply mode) — REPORT-ONLY (coordinator ruling, PR
986
+ // #912 round 10), see findLeftoverProjections's own header. WP-776 S3f: gated on writeMode
987
+ // alone now — the DB source (dbQuerySucceeded) is gone, so activeAssetNames comes from the
988
+ // filesystem-sourced allSkills/allRules (which already include the personal layer, merged in
989
+ // above) instead of dbAssetRows.
990
+ let leftoverFiles = [];
991
+ let leftoverFilesTruncated = false;
992
+ if (writeMode) {
993
+ retireGeneratedProjections(cwd, orientView !== null, log, logErr);
994
+ const activeAssetNames = [
995
+ ...allSkills.map((s) => s.name),
996
+ ...allRules.map((r) => r.name),
997
+ ];
998
+ // Nested .cursor/skills scan gets its OWN canon: canonicalSkills is SKILL-kind only and
999
+ // shouldEmitToTarget(_, 'cursor') respects per-skill target routing.
1000
+ const cursorSkillNames = canonicalSkills.filter((s) => shouldEmitToTarget(s, 'cursor')).map((s) => s.name);
1001
+ // Round 11: exempt exact write-plan paths from the leftover scan (see findLeftoverProjections's own doc).
1002
+ const exactRelativePaths = new Set(writes.map((w) => w.relative));
1003
+ const scanResult = findLeftoverProjections(cwd, activeAssetNames, allowedTargets, cursorSkillNames, exactRelativePaths);
1004
+ leftoverFiles = scanResult.files;
1005
+ leftoverFilesTruncated = scanResult.truncated;
559
1006
  }
560
- // Add Claude Code skill router (filtered by target)
561
- const claudeSkills = canonicalSkills.filter((s) => shouldEmitToTarget(s, 'claude'));
562
- const skillRouterContent = generateClaudeSkillRouter(claudeSkills, claudeProfile);
563
- if (skillRouterContent) {
564
- writes.push({
565
- path: join(cwd, '.claude', 'rules', 'skill-router.md'),
566
- relative: '.claude/rules/skill-router.md',
567
- content: skillRouterContent,
568
- dirs: join(cwd, '.claude', 'rules'),
569
- isAdapter: true,
570
- target: 'claude',
571
- });
1007
+ // ── WP-436 S3: Vocab projector — fetch workspace vocab context once per handshake. Source-side
1008
+ // stays tokenized; resolves {{vocab:...}} before writing. Fail-open: a failed fetch writes the raw token.
1009
+ const handshakeVocabCtx = await getOrFetchVocabCtx(config.apiKey, async () => {
1010
+ try {
1011
+ const vocab = await kernelCall('chain.getVocabulary', {});
1012
+ if (vocab?.collectionLabels || vocab?.collectionDefaults) {
1013
+ return {
1014
+ ...(vocab.collectionLabels ? { collectionLabels: vocab.collectionLabels } : {}),
1015
+ ...(vocab.collectionDefaults ? { collectionDefaults: vocab.collectionDefaults } : {}),
1016
+ };
1017
+ }
1018
+ return null;
1019
+ }
1020
+ catch {
1021
+ return null; // fail-open
1022
+ }
1023
+ });
1024
+ const userOwnedSkipped = [];
1025
+ const cleanBucketPaths = [];
1026
+ const tamperedBucket = [];
1027
+ // TEN-2155: region augmentation context + symlink dedupe — codexActive gates the AGENTS.md skills-index pointer.
1028
+ const regionCtx = { codexActive: allowedTargets.has('codex') };
1029
+ const malformedRegionPaths = [];
1030
+ // Same inode for two augment targets (e.g. CLAUDE.md symlinked to AGENTS.md): augment only first-seen.
1031
+ const seenAugmentRealpaths = new Set();
1032
+ const augmentTargetSkip = new Set();
1033
+ for (const w of writes) {
1034
+ if (!w.augmentTarget || !w.target || !allowedTargets.has(w.target) || !existsSync(w.path))
1035
+ continue;
1036
+ let real;
1037
+ try {
1038
+ real = realpathSync(w.path);
1039
+ }
1040
+ catch {
1041
+ real = w.path;
1042
+ }
1043
+ if (seenAugmentRealpaths.has(real))
1044
+ augmentTargetSkip.add(w.path);
1045
+ else
1046
+ seenAugmentRealpaths.add(real);
572
1047
  }
573
1048
  for (const w of writes) {
574
1049
  // Surface filtering: skip adapter writes for targets not in the allowed set
575
- if (allowedTargets && w.target && !allowedTargets.has(w.target)) {
1050
+ if (w.target && !allowedTargets.has(w.target)) {
576
1051
  filesSkipped.push({ path: w.relative, reason: `filtered (surface: ${w.target})` });
1052
+ if (preview)
1053
+ previewPlan.push({ path: w.relative, status: 'filtered' });
577
1054
  continue;
578
1055
  }
1056
+ // ── TEN-2155: augment user-owned CLAUDE.md / AGENTS.md with a marked PB region — runs ahead
1057
+ // of the legacy MARKER gates; absent/legacy-pb-managed fall through to the legacy path.
1058
+ if (w.augmentTarget) {
1059
+ const projection = REGION_PROJECTIONS[w.target];
1060
+ if (projection && existsSync(w.path)) {
1061
+ if (augmentTargetSkip.has(w.path)) {
1062
+ filesSkipped.push({ path: w.relative, reason: 'symlinked to another augment target — augmented once' });
1063
+ continue;
1064
+ }
1065
+ const disk = readFileSync(w.path, 'utf8');
1066
+ const cls = classifyAdapterFile(disk);
1067
+ if (cls === 'augmentable' || cls === 'region-present') {
1068
+ const eol = detectEol(disk);
1069
+ const region = replaceVocabTokens(projection.build(regionCtx, eol), handshakeVocabCtx);
1070
+ // Defense-in-depth: the composed region (post vocab-token resolution) must itself be a
1071
+ // single well-formed region. v1 content has no vocab tokens so this is a no-op, but it
1072
+ // guards the documented future override/vocab seam from injecting a stray sentinel/MARKER.
1073
+ if (classifyAdapterFile(region) !== 'region-present') {
1074
+ filesSkipped.push({ path: w.relative, reason: 'internal: composed PB region malformed — skipped to protect your file' });
1075
+ if (preview)
1076
+ previewPlan.push({ path: w.relative, status: 'needs-attention' });
1077
+ continue;
1078
+ }
1079
+ const candidate = cls === 'augmentable' ? spliceAppend(disk, region, eol) : spliceReplace(disk, region);
1080
+ if (candidate === disk) {
1081
+ filesSkipped.push({ path: w.relative, reason: 'unchanged' });
1082
+ if (preview)
1083
+ previewPlan.push({ path: w.relative, status: 'unchanged' });
1084
+ continue;
1085
+ }
1086
+ if (preview || dryRun) {
1087
+ filesWritten.push(w.relative + (dryRun ? ' (dry run)' : ''));
1088
+ if (preview)
1089
+ previewPlan.push({ path: w.relative, status: 'would-augment' });
1090
+ continue;
1091
+ }
1092
+ if (authorityPreviewOnly) {
1093
+ // apply + materialize observe/off: honor authority — do NOT write; mirror the legacy
1094
+ // preview-only skip so the report does not falsely list it as written.
1095
+ filesSkipped.push({ path: w.relative, reason: `preview-only (materialize: ${manifestStatus.mode})` });
1096
+ continue;
1097
+ }
1098
+ assertSetupWritePath(w.path, perimeterManifest);
1099
+ writeFileSync(w.path, candidate);
1100
+ filesWritten.push(w.relative);
1101
+ continue;
1102
+ }
1103
+ if (cls === 'malformed') {
1104
+ filesSkipped.push({ path: w.relative, reason: 'malformed PB region — left untouched; fix the pb:region sentinels' });
1105
+ if (preview)
1106
+ previewPlan.push({ path: w.relative, status: 'needs-attention' });
1107
+ malformedRegionPaths.push(w.relative);
1108
+ continue;
1109
+ }
1110
+ // cls 'pb-managed' falls through to legacy re-projection; 'opt-out' (pb:no-augment) falls through to the user-owned skip.
1111
+ }
1112
+ // absent file → fall through to legacy whole-file CREATE.
1113
+ }
579
1114
  if (w.isAdapter && !shouldWriteAdapter(w.path, force)) {
580
- filesSkipped.push({ path: w.relative, reason: 'exists without auto-generated marker (use --force to overwrite)' });
1115
+ // User-owned: a file at an adapter path without our auto-gen MARKER is the
1116
+ // user's own file. Leave it untouched — never overwrite, never treat as drift
1117
+ // or log a TEN (TEN-2150). Relayed to the connect screen via userOwnedSkipped.
1118
+ filesSkipped.push({ path: w.relative, reason: 'user-owned — left untouched (pb won\'t overwrite your file)' });
1119
+ if (preview) {
1120
+ previewPlan.push({ path: w.relative, status: 'user-owned' });
1121
+ }
1122
+ else {
1123
+ userOwnedSkipped.push(w.relative);
1124
+ }
581
1125
  continue;
582
1126
  }
583
- if (dryRun) {
584
- filesWritten.push(w.relative + ' (dry run)');
1127
+ if (authorityPreviewOnly) {
1128
+ filesSkipped.push({
1129
+ path: w.relative,
1130
+ reason: `preview-only (materialize: ${manifestStatus.mode})`,
1131
+ });
585
1132
  continue;
586
1133
  }
1134
+ if (preview || dryRun) {
1135
+ // In preview/dry-run mode: check content to distinguish new/update/unchanged
1136
+ if (existsSync(w.path)) {
1137
+ const current = readFileSync(w.path, 'utf8');
1138
+ const nextNormalized = normalizeHandshakeContentForComparison(w.content);
1139
+ const currentNormalized = normalizeHandshakeContentForComparison(current);
1140
+ if (nextNormalized === currentNormalized) {
1141
+ filesSkipped.push({ path: w.relative, reason: 'unchanged' });
1142
+ if (preview)
1143
+ previewPlan.push({ path: w.relative, status: 'unchanged' });
1144
+ }
1145
+ else {
1146
+ filesWritten.push(w.relative + (dryRun ? ' (dry run)' : ''));
1147
+ if (preview)
1148
+ previewPlan.push({ path: w.relative, status: 'would-update' });
1149
+ }
1150
+ }
1151
+ else {
1152
+ filesWritten.push(w.relative + (dryRun ? ' (dry run)' : ''));
1153
+ if (preview)
1154
+ previewPlan.push({ path: w.relative, status: 'would-write' });
1155
+ }
1156
+ continue;
1157
+ }
1158
+ // ── WP-421 S3: defer tampered adapter writes (doneWhen #17) — classify pb-managed-clean vs
1159
+ // pb-managed-tampered, deferred not overwritten; post-loop resolves. --force bypasses the defer.
1160
+ if (w.isAdapter && !force) {
1161
+ const drift = classifyDriftBucket(w.path);
1162
+ if (drift && drift.bucket === 'pb-managed-tampered') {
1163
+ tamperedBucket.push({
1164
+ path: w.path,
1165
+ relative: w.relative,
1166
+ content: w.content,
1167
+ expectedHash: drift.expectedHash,
1168
+ actualHash: drift.actualHash,
1169
+ dirs: w.dirs,
1170
+ });
1171
+ // Do NOT write — defer until prompt/refusal resolves the file.
1172
+ continue;
1173
+ }
1174
+ if (drift && drift.bucket === 'pb-managed-clean') {
1175
+ cleanBucketPaths.push(w.relative);
1176
+ }
1177
+ }
1178
+ assertSetupWritePath(w.path, perimeterManifest);
587
1179
  if (w.dirs)
588
1180
  mkdirSync(w.dirs, { recursive: true });
1181
+ // WP-436 S3: resolve {{vocab:...}} tokens before writing projected adapter files only
1182
+ // (source-side stays tokenized). Fail-open: undefined vocabCtx falls back to canonicalKey literals.
1183
+ const resolvedContent = w.isAdapter
1184
+ ? replaceVocabTokens(w.content, handshakeVocabCtx)
1185
+ : w.content;
589
1186
  if (existsSync(w.path)) {
590
1187
  const current = readFileSync(w.path, 'utf8');
591
- const nextNormalized = normalizeHandshakeContentForComparison(w.content);
1188
+ const nextNormalized = normalizeHandshakeContentForComparison(resolvedContent);
592
1189
  const currentNormalized = normalizeHandshakeContentForComparison(current);
593
1190
  if (nextNormalized === currentNormalized) {
594
1191
  filesSkipped.push({ path: w.relative, reason: 'unchanged' });
595
1192
  continue;
596
1193
  }
597
1194
  }
598
- writeFileSync(w.path, w.content);
1195
+ writeFileSync(w.path, resolvedContent);
599
1196
  filesWritten.push(w.relative);
600
1197
  }
601
- // 8. Report
1198
+ // WP-776 S3f: the projected-hash flush back to the DB (setup.updateLastProjectedHash) is
1199
+ // deleted along with the rest of the setup-assets gateway routes — there is no DB-sourced
1200
+ // asset any more whose lastProjectedHash needs updating (dbAssetEntryId is always undefined
1201
+ // now that allSkills/allRules are filesystem-sourced).
1202
+ // Runs AFTER the hash flush (malformed files were never written, nothing to record). TEN-2155:
1203
+ // non-interactive apply refuses on a malformed region — gated on applyMode per STD-263 vi.
1204
+ if (applyMode && malformedRegionPaths.length > 0 && (options.noPrompt || !process.stdout.isTTY)) {
1205
+ throw new CLIError(`Malformed PB region in: ${malformedRegionPaths.join(', ')}`, {
1206
+ code: ErrorCode.VALIDATION_FAILED,
1207
+ category: 'validation',
1208
+ guidance: 'Fix the `<!-- pb:region:start -->` / `<!-- pb:region:end -->` sentinels (one balanced pair), then re-run `pb handshake`.',
1209
+ });
1210
+ }
1211
+ // ── WP-421 S3: tampered-bucket resolution (doneWhen #17), apply mode only — headless (--no-prompt
1212
+ // / non-TTY) refuses, exit non-zero. WP-776 S3d/S3f: the setup-assets system this resolution used
1213
+ // to offer as an "adopt" alternative (capture tampered edits as a personal-scoped draft via
1214
+ // setup.ingestSetupAsset) is deleted, and with it the only OTHER option besides overwriting —
1215
+ // per DEC-1771 (delete, never hide) there is no shim standing in for that capability. Revert
1216
+ // (re-project canonical content) is the only resolution left; this is a real capability loss
1217
+ // for anyone who was relying on "adopt" to preserve hand-edits, named here rather than silently
1218
+ // dropped. The refusal receipt (`setup.recordTamperRefusal`) is deleted along with the rest of
1219
+ // the setup-assets gateway routes — headless mode still refuses and reports, it just no longer
1220
+ // writes an audit row for the refusal.
1221
+ const revertedTamperedPaths = [];
1222
+ if (writeMode && tamperedBucket.length > 0) {
1223
+ const headless = options.noPrompt === true || !process.stdout.isTTY;
1224
+ if (headless) {
1225
+ // ── Headless refusal path (doneWhen #17) ────────────────────────────────
1226
+ logErr('');
1227
+ logErr(`pb handshake: ${tamperedBucket.length} PB-managed projection file(s) were edited downstream of the auto-gen marker.`);
1228
+ logErr('Headless mode (--no-prompt or no TTY) cannot confirm an overwrite — refusing.');
1229
+ logErr('');
1230
+ const refusedTamperedFiles = tamperedBucket.map((t) => ({
1231
+ path: t.relative,
1232
+ expectedHash: t.expectedHash,
1233
+ actualHash: t.actualHash,
1234
+ }));
1235
+ for (const refused of refusedTamperedFiles) {
1236
+ // Per #17: stderr enumerates each tampered file as
1237
+ // {path, expectedHash, actualHash, bucket}.
1238
+ logErr(` ${JSON.stringify({ ...refused, bucket: 'pb-managed-tampered' })}`);
1239
+ }
1240
+ logErr('');
1241
+ logErr('Re-run interactively to resolve, or use --force to overwrite (data loss).');
1242
+ // Surface the report counts before exit (visibility for CI logs).
1243
+ if (!quiet) {
1244
+ const refusalReport = {
1245
+ filesWritten,
1246
+ filesSkipped,
1247
+ matchedEntries,
1248
+ searchQueries: uniqueQueries,
1249
+ repo,
1250
+ codexWarnings: codexWarnings.length > 0 ? codexWarnings : undefined,
1251
+ adoptedCount: adoptedRulesCount,
1252
+ rejectedCount: rejectedRulesCount,
1253
+ personalRuleCount: personalRules.length > 0 ? personalRules.length : undefined,
1254
+ personalSkillCount: personalSkills.length > 0 ? personalSkills.length : undefined,
1255
+ registrySource,
1256
+ registryStale,
1257
+ userOwnedSkipped: userOwnedSkipped.length > 0 ? userOwnedSkipped : undefined,
1258
+ managedCleanCount: cleanBucketPaths.length || undefined,
1259
+ tamperedFiles: refusedTamperedFiles,
1260
+ leftoverFiles: leftoverFiles.length > 0 ? leftoverFiles : undefined,
1261
+ leftoverFilesTruncated: leftoverFilesTruncated || undefined, noProjectionAssets: noProjectionAssets.length > 0 ? noProjectionAssets : undefined, // same-line combine, shrink-only budget
1262
+ };
1263
+ process.stdout.write('\n');
1264
+ process.stdout.write(isJsonMode() ? JSON.stringify(toPublicJsonReport(refusalReport)) + '\n' : formatHandshakeReport(refusalReport) + '\n');
1265
+ }
1266
+ // Exit non-zero per #17.
1267
+ process.exit(1);
1268
+ }
1269
+ // ── Interactive path: confirm, then revert every tampered file ─────────────
1270
+ log('');
1271
+ log(`pb handshake: ${tamperedBucket.length} PB-managed projection file(s) were edited downstream of the auto-gen marker.`);
1272
+ log('These will be REVERTED (overwritten with canonical content) — there is no adopt/draft path any more.');
1273
+ const proceed = await promptConfirm({
1274
+ message: `Overwrite ${tamperedBucket.length} tampered file(s) with canonical content?`,
1275
+ initialValue: false,
1276
+ });
1277
+ if (proceed) {
1278
+ for (const tamper of tamperedBucket) {
1279
+ log('');
1280
+ log(`Reverting: ${tamper.relative}`);
1281
+ log(` expected: ${tamper.expectedHash}`);
1282
+ log(` actual: ${tamper.actualHash}`);
1283
+ // Re-project canonical content over the tampered file.
1284
+ // WP-436 S3: resolve vocab tokens before writing (all tampered files are adapters).
1285
+ if (tamper.dirs)
1286
+ mkdirSync(tamper.dirs, { recursive: true });
1287
+ assertSetupWritePath(tamper.path, perimeterManifest);
1288
+ writeFileSync(tamper.path, replaceVocabTokens(tamper.content, handshakeVocabCtx));
1289
+ revertedTamperedPaths.push(tamper.relative);
1290
+ }
1291
+ }
1292
+ else {
1293
+ logErr('Skipped — tampered files left as-is; re-run to resolve.');
1294
+ process.exit(1); // doneWhen #17: never exit 0 with a tampered file unresolved (codex review round 3)
1295
+ }
1296
+ }
1297
+ // DEC-1690: a dormant (gate-failed) asset is simply not projected — dbAssets already comes
1298
+ // from the server's activeAssets list. The WP-379 S4 / WP-426 E4 on-disk marker/rename/restore
1299
+ // machinery (and its .authoring-sync.json registries) is retired: nothing to reconcile.
1300
+ // 8. User-owned files left untouched are NOT drift (TEN-2150) — a marker-less adapter-path
1301
+ // file is the user's own; handshake never wrote it, so no "sync", no draft TEN, just a benign
1302
+ // "Skipped:" surfaced via report.userOwnedSkipped.
1303
+ // 8. Case-collision and dormant-drift TENs are gone (coordinator ruling, PR #912 round 10) —
1304
+ // they existed only to audit automated deletions that no longer happen; `report.leftoverFiles`
1305
+ // below is the single reporting surface now.
1306
+ // WP-776 S3f: the setup-transition receipt (setup.getCurrentSetupState / setup.recordTransition)
1307
+ // and the setup materialization receipt (setup.materializeSetup) are deleted along with the
1308
+ // rest of the setup-assets gateway routes — both were fail-open advisory writes recording
1309
+ // authority-mode transitions and materialized-asset counts for a system that no longer exists.
1310
+ // 9. Report
602
1311
  const report = {
603
1312
  filesWritten,
604
1313
  filesSkipped,
@@ -606,12 +1315,35 @@ export async function runHandshake(options = {}) {
606
1315
  searchQueries: uniqueQueries,
607
1316
  repo,
608
1317
  codexWarnings: codexWarnings.length > 0 ? codexWarnings : undefined,
609
- chainRulesStats: chainRulesStats ?? undefined,
610
- chainGaps: chainGaps.length > 0 ? chainGaps : undefined,
1318
+ adoptedCount: adoptedRulesCount,
1319
+ rejectedCount: rejectedRulesCount,
1320
+ personalRuleCount: personalRules.length > 0 ? personalRules.length : undefined,
1321
+ personalSkillCount: personalSkills.length > 0 ? personalSkills.length : undefined,
1322
+ registrySource,
1323
+ registryStale,
1324
+ preview: preview ? true : undefined,
1325
+ previewPlan: preview && previewPlan.length > 0 ? previewPlan : undefined,
1326
+ userOwnedSkipped: userOwnedSkipped.length > 0 ? userOwnedSkipped : undefined,
1327
+ // WP-421 S3: three-bucket drift report (doneWhen #17). PB-managed-clean is
1328
+ // the count of files whose marker + hash matched. Tampered files were
1329
+ // resolved (reverted) above and are reported separately. WP-776 S3d/S3f:
1330
+ // adoptedTamperedPaths is gone — "adopt" is no longer an option (see the
1331
+ // tampered-bucket resolution comment above).
1332
+ managedCleanCount: cleanBucketPaths.length > 0 ? cleanBucketPaths.length : undefined,
1333
+ revertedTamperedPaths: revertedTamperedPaths.length > 0 ? revertedTamperedPaths : undefined,
1334
+ // REPORT-ONLY leftover-file listing (coordinator ruling, PR #912 round 10) — the human removes these.
1335
+ leftoverFiles: leftoverFiles.length > 0 ? leftoverFiles : undefined,
1336
+ leftoverFilesTruncated: leftoverFilesTruncated || undefined, noProjectionAssets: noProjectionAssets.length > 0 ? noProjectionAssets : undefined, // WP-660 S2 combine
611
1337
  };
612
1338
  if (!quiet) {
613
1339
  process.stdout.write('\n');
614
- process.stdout.write(formatHandshakeReport(report) + '\n');
1340
+ process.stdout.write(isJsonMode() ? JSON.stringify(toPublicJsonReport(report)) + '\n' : formatHandshakeReport(report) + '\n');
615
1341
  }
1342
+ // Return the report so non-UI callers (e.g. prepareConnectContext) can surface
1343
+ // skipped/user-owned files without re-deriving the skip logic (TEN-2107).
1344
+ return report;
616
1345
  }
1346
+ // WP-426 E3/E4: exported test-only surface (not part of the public CLI API). setupAuthoringPath
1347
+ // and loadAuthoringSyncState are gone with the setup-authoring sync machinery (WP-776 S3d/S3f).
1348
+ export const __test = { MARKER };
617
1349
  //# sourceMappingURL=handshake.js.map