create-principles-disciple 1.154.5 → 1.155.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (428) hide show
  1. package/_release/product-identity.json +2 -2
  2. package/codex-adapter/dist/codec/input-decoder.d.ts +17 -0
  3. package/codex-adapter/dist/codec/input-decoder.js +39 -0
  4. package/codex-adapter/dist/ingestion/explicit-owner-statement.js +125 -1
  5. package/codex-adapter/dist/ingestion/pain-receipt-fallback.d.ts +46 -0
  6. package/codex-adapter/dist/ingestion/pain-receipt-fallback.js +193 -0
  7. package/codex-adapter/dist/ingestion/turn-context.d.ts +10 -15
  8. package/codex-adapter/dist/ingestion/turn-context.js +35 -9
  9. package/codex-adapter/dist/pd-hook.js +57 -1
  10. package/codex-adapter/dist/worker/workspace-worker.d.ts +15 -0
  11. package/codex-adapter/dist/worker/workspace-worker.js +91 -12
  12. package/codex-adapter/package.json +1 -1
  13. package/console/dist/server/index.js +11 -0
  14. package/console/dist/server/models/EvidenceChainConsoleModel.js +31 -0
  15. package/console/dist/server/routes/health.d.ts +1 -0
  16. package/console/dist/server/routes/health.js +12 -0
  17. package/console/dist/server/routes/service-host.d.ts +19 -0
  18. package/console/dist/server/routes/service-host.js +129 -0
  19. package/console/dist/web/assets/app.js +39 -39
  20. package/console/package.json +1 -1
  21. package/core/dist/runtime/adapter/pi-ai-http-transport.d.ts.map +1 -1
  22. package/core/dist/runtime/adapter/pi-ai-http-transport.js.map +1 -1
  23. package/core/dist/runtime/context-payload.d.ts +48 -0
  24. package/core/dist/runtime/context-payload.d.ts.map +1 -1
  25. package/core/dist/runtime/context-payload.js +12 -0
  26. package/core/dist/runtime/context-payload.js.map +1 -1
  27. package/core/dist/runtime/diagnostician/rootcause-prompt-builder.d.ts.map +1 -1
  28. package/core/dist/runtime/diagnostician/rootcause-prompt-builder.js +18 -0
  29. package/core/dist/runtime/diagnostician/rootcause-prompt-builder.js.map +1 -1
  30. package/core/dist/runtime/diagnostician-candidate.d.ts.map +1 -1
  31. package/core/dist/runtime/diagnostician-candidate.js +18 -2
  32. package/core/dist/runtime/diagnostician-candidate.js.map +1 -1
  33. package/core/dist/runtime/evidence-guards.d.ts +7 -3
  34. package/core/dist/runtime/evidence-guards.d.ts.map +1 -1
  35. package/core/dist/runtime/evidence-guards.js +9 -7
  36. package/core/dist/runtime/evidence-guards.js.map +1 -1
  37. package/core/dist/runtime/feature-flags/feature-flag-contract.d.ts.map +1 -1
  38. package/core/dist/runtime/feature-flags/feature-flag-contract.js +14 -0
  39. package/core/dist/runtime/feature-flags/feature-flag-contract.js.map +1 -1
  40. package/core/dist/runtime/feature-flags/feature-flag-lifecycle.d.ts.map +1 -1
  41. package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js +8 -0
  42. package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js.map +1 -1
  43. package/core/dist/runtime/host-submission-context.d.ts +83 -0
  44. package/core/dist/runtime/host-submission-context.d.ts.map +1 -0
  45. package/core/dist/runtime/host-submission-context.js +183 -0
  46. package/core/dist/runtime/host-submission-context.js.map +1 -0
  47. package/core/dist/runtime/index.d.ts +9 -2
  48. package/core/dist/runtime/index.d.ts.map +1 -1
  49. package/core/dist/runtime/index.js +29 -2
  50. package/core/dist/runtime/index.js.map +1 -1
  51. package/core/dist/runtime/intent/intent-doc.d.ts.map +1 -1
  52. package/core/dist/runtime/intent/intent-doc.js +29 -5
  53. package/core/dist/runtime/intent/intent-doc.js.map +1 -1
  54. package/core/dist/runtime/internalization/diag-distiller-runner.d.ts +9 -0
  55. package/core/dist/runtime/internalization/diag-distiller-runner.d.ts.map +1 -1
  56. package/core/dist/runtime/internalization/diag-distiller-runner.js +13 -0
  57. package/core/dist/runtime/internalization/diag-distiller-runner.js.map +1 -1
  58. package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts +11 -0
  59. package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
  60. package/core/dist/runtime/internalization/diag-rootcause-runner.js +10 -0
  61. package/core/dist/runtime/internalization/diag-rootcause-runner.js.map +1 -1
  62. package/core/dist/runtime/internalization/diag-router-runner.d.ts +9 -0
  63. package/core/dist/runtime/internalization/diag-router-runner.d.ts.map +1 -1
  64. package/core/dist/runtime/internalization/diag-router-runner.js +13 -0
  65. package/core/dist/runtime/internalization/diag-router-runner.js.map +1 -1
  66. package/core/dist/runtime/internalization/index.d.ts +1 -1
  67. package/core/dist/runtime/internalization/index.d.ts.map +1 -1
  68. package/core/dist/runtime/internalization/index.js +1 -1
  69. package/core/dist/runtime/internalization/index.js.map +1 -1
  70. package/core/dist/runtime/internalization/intake-to-internalization-bridge.d.ts +19 -0
  71. package/core/dist/runtime/internalization/intake-to-internalization-bridge.d.ts.map +1 -1
  72. package/core/dist/runtime/internalization/intake-to-internalization-bridge.js +24 -0
  73. package/core/dist/runtime/internalization/intake-to-internalization-bridge.js.map +1 -1
  74. package/core/dist/runtime/internalization/internalization-orchestrator.d.ts +8 -0
  75. package/core/dist/runtime/internalization/internalization-orchestrator.d.ts.map +1 -1
  76. package/core/dist/runtime/internalization/internalization-orchestrator.js +36 -4
  77. package/core/dist/runtime/internalization/internalization-orchestrator.js.map +1 -1
  78. package/core/dist/runtime/internalization/source-authorization-boundary.d.ts +39 -0
  79. package/core/dist/runtime/internalization/source-authorization-boundary.d.ts.map +1 -0
  80. package/core/dist/runtime/internalization/source-authorization-boundary.js +57 -0
  81. package/core/dist/runtime/internalization/source-authorization-boundary.js.map +1 -0
  82. package/core/dist/runtime/internalization/split-diagnostician-runner.d.ts.map +1 -1
  83. package/core/dist/runtime/internalization/split-diagnostician-runner.js +72 -5
  84. package/core/dist/runtime/internalization/split-diagnostician-runner.js.map +1 -1
  85. package/core/dist/runtime/pain-admission-disposition.d.ts +60 -0
  86. package/core/dist/runtime/pain-admission-disposition.d.ts.map +1 -0
  87. package/core/dist/runtime/pain-admission-disposition.js +37 -0
  88. package/core/dist/runtime/pain-admission-disposition.js.map +1 -0
  89. package/core/dist/runtime/pain-ingress-payload.d.ts +36 -2
  90. package/core/dist/runtime/pain-ingress-payload.d.ts.map +1 -1
  91. package/core/dist/runtime/pain-ingress-payload.js +63 -6
  92. package/core/dist/runtime/pain-ingress-payload.js.map +1 -1
  93. package/core/dist/runtime/pain-ingress.d.ts.map +1 -1
  94. package/core/dist/runtime/pain-ingress.js +28 -0
  95. package/core/dist/runtime/pain-ingress.js.map +1 -1
  96. package/core/dist/runtime/pain-recall-read-model.d.ts +13 -1
  97. package/core/dist/runtime/pain-recall-read-model.d.ts.map +1 -1
  98. package/core/dist/runtime/pain-recall-read-model.js +50 -7
  99. package/core/dist/runtime/pain-recall-read-model.js.map +1 -1
  100. package/core/dist/runtime/pain-receipt-recovery.d.ts +147 -0
  101. package/core/dist/runtime/pain-receipt-recovery.d.ts.map +1 -0
  102. package/core/dist/runtime/pain-receipt-recovery.js +475 -0
  103. package/core/dist/runtime/pain-receipt-recovery.js.map +1 -0
  104. package/core/dist/runtime/pain-signal-bridge.d.ts +13 -1
  105. package/core/dist/runtime/pain-signal-bridge.d.ts.map +1 -1
  106. package/core/dist/runtime/pain-signal-bridge.js +174 -0
  107. package/core/dist/runtime/pain-signal-bridge.js.map +1 -1
  108. package/core/dist/runtime/pain-signal-runtime-factory.d.ts +9 -0
  109. package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
  110. package/core/dist/runtime/pain-signal-runtime-factory.js +8 -3
  111. package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
  112. package/core/dist/runtime/pain-submit-capability.d.ts +11 -0
  113. package/core/dist/runtime/pain-submit-capability.d.ts.map +1 -1
  114. package/core/dist/runtime/pain-submit-capability.js +77 -3
  115. package/core/dist/runtime/pain-submit-capability.js.map +1 -1
  116. package/core/dist/runtime/pain-target-evidence-reconcile.d.ts +55 -0
  117. package/core/dist/runtime/pain-target-evidence-reconcile.d.ts.map +1 -0
  118. package/core/dist/runtime/pain-target-evidence-reconcile.js +164 -0
  119. package/core/dist/runtime/pain-target-evidence-reconcile.js.map +1 -0
  120. package/core/dist/runtime/pain-to-principle-service.d.ts +8 -0
  121. package/core/dist/runtime/pain-to-principle-service.d.ts.map +1 -1
  122. package/core/dist/runtime/pain-to-principle-service.js +1 -0
  123. package/core/dist/runtime/pain-to-principle-service.js.map +1 -1
  124. package/core/dist/runtime/source-material-authorization.d.ts +166 -0
  125. package/core/dist/runtime/source-material-authorization.d.ts.map +1 -0
  126. package/core/dist/runtime/source-material-authorization.js +250 -0
  127. package/core/dist/runtime/source-material-authorization.js.map +1 -0
  128. package/core/dist/runtime/store/context/index.d.ts +1 -0
  129. package/core/dist/runtime/store/context/index.d.ts.map +1 -1
  130. package/core/dist/runtime/store/context/index.js +1 -0
  131. package/core/dist/runtime/store/context/index.js.map +1 -1
  132. package/core/dist/runtime/store/context/promoted-evidence-reader.d.ts +8 -0
  133. package/core/dist/runtime/store/context/promoted-evidence-reader.d.ts.map +1 -1
  134. package/core/dist/runtime/store/context/promoted-evidence-reader.js +15 -1
  135. package/core/dist/runtime/store/context/promoted-evidence-reader.js.map +1 -1
  136. package/core/dist/runtime/store/context/sqlite-context-assembler.d.ts +22 -0
  137. package/core/dist/runtime/store/context/sqlite-context-assembler.d.ts.map +1 -1
  138. package/core/dist/runtime/store/context/sqlite-context-assembler.js +153 -3
  139. package/core/dist/runtime/store/context/sqlite-context-assembler.js.map +1 -1
  140. package/core/dist/runtime/store/context/trajectory-turn-reader.d.ts +13 -0
  141. package/core/dist/runtime/store/context/trajectory-turn-reader.d.ts.map +1 -1
  142. package/core/dist/runtime/store/lifecycle/lease-manager.d.ts +15 -0
  143. package/core/dist/runtime/store/lifecycle/lease-manager.d.ts.map +1 -1
  144. package/core/dist/runtime/store/lifecycle/lease-manager.js +16 -1
  145. package/core/dist/runtime/store/lifecycle/lease-manager.js.map +1 -1
  146. package/core/dist/runtime/store/runtime-state-manager.d.ts +2 -0
  147. package/core/dist/runtime/store/runtime-state-manager.d.ts.map +1 -1
  148. package/core/dist/runtime/store/runtime-state-manager.js.map +1 -1
  149. package/core/dist/runtime/store/task/memory-task-store.d.ts +1 -0
  150. package/core/dist/runtime/store/task/memory-task-store.d.ts.map +1 -1
  151. package/core/dist/runtime/store/task/memory-task-store.js +37 -0
  152. package/core/dist/runtime/store/task/memory-task-store.js.map +1 -1
  153. package/core/dist/runtime/store/task/sqlite-task-store.d.ts +10 -0
  154. package/core/dist/runtime/store/task/sqlite-task-store.d.ts.map +1 -1
  155. package/core/dist/runtime/store/task/sqlite-task-store.js +20 -0
  156. package/core/dist/runtime/store/task/sqlite-task-store.js.map +1 -1
  157. package/core/dist/runtime/store/task/task-store.d.ts +16 -0
  158. package/core/dist/runtime/store/task/task-store.d.ts.map +1 -1
  159. package/core/dist/runtime/task-status.d.ts +13 -0
  160. package/core/dist/runtime/task-status.d.ts.map +1 -1
  161. package/core/dist/runtime/task-status.js +9 -0
  162. package/core/dist/runtime/task-status.js.map +1 -1
  163. package/core/dist/runtime/types/evidence-chain-contract.d.ts +10 -0
  164. package/core/dist/runtime/types/evidence-chain-contract.d.ts.map +1 -1
  165. package/core/dist/runtime/types/evidence-chain-contract.js +7 -0
  166. package/core/dist/runtime/types/evidence-chain-contract.js.map +1 -1
  167. package/core/package.json +2 -2
  168. package/dist/index.d.ts.map +1 -1
  169. package/dist/index.js +11 -0
  170. package/dist/index.js.map +1 -1
  171. package/dist/installer.d.ts.map +1 -1
  172. package/dist/installer.js +77 -30
  173. package/dist/installer.js.map +1 -1
  174. package/dist/installers/mcp-registration-conflict.d.ts +8 -0
  175. package/dist/installers/mcp-registration-conflict.d.ts.map +1 -1
  176. package/dist/installers/mcp-registration-conflict.js +34 -1
  177. package/dist/installers/mcp-registration-conflict.js.map +1 -1
  178. package/dist/installers/workbuddy-host-installer.d.ts +45 -13
  179. package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
  180. package/dist/installers/workbuddy-host-installer.js +284 -21
  181. package/dist/installers/workbuddy-host-installer.js.map +1 -1
  182. package/dist/prompts.d.ts +11 -0
  183. package/dist/prompts.d.ts.map +1 -1
  184. package/dist/prompts.js +4 -0
  185. package/dist/prompts.js.map +1 -1
  186. package/dist/service-host-bridge.d.ts +67 -0
  187. package/dist/service-host-bridge.d.ts.map +1 -0
  188. package/dist/service-host-bridge.js +292 -0
  189. package/dist/service-host-bridge.js.map +1 -0
  190. package/dist/uninstaller.d.ts.map +1 -1
  191. package/dist/uninstaller.js +26 -0
  192. package/dist/uninstaller.js.map +1 -1
  193. package/dist/update/install-layout.d.ts +0 -12
  194. package/dist/update/install-layout.d.ts.map +1 -1
  195. package/dist/update/install-layout.js +42 -15
  196. package/dist/update/install-layout.js.map +1 -1
  197. package/host-runtime/dist/diagnostician-auto-run.js +4 -1
  198. package/host-runtime/dist/governance-observation-store.d.ts +7 -0
  199. package/host-runtime/dist/governance-observation-store.js +15 -4
  200. package/host-runtime/dist/governance-signal-admission.d.ts +49 -0
  201. package/host-runtime/dist/governance-signal-admission.js +355 -94
  202. package/host-runtime/dist/governance-trajectory-turn-reader.d.ts +20 -4
  203. package/host-runtime/dist/governance-trajectory-turn-reader.js +77 -5
  204. package/host-runtime/dist/index.d.ts +2 -0
  205. package/host-runtime/dist/index.js +5 -0
  206. package/host-runtime/dist/internalization-consumer-cycle.js +4 -1
  207. package/host-runtime/dist/pd-config.d.ts +10 -0
  208. package/host-runtime/dist/pd-config.js +37 -0
  209. package/host-runtime/dist/signal-stage2-cycle.js +28 -1
  210. package/host-runtime/dist/source-material-authorization.d.ts +53 -0
  211. package/host-runtime/dist/source-material-authorization.js +67 -0
  212. package/host-runtime/dist/source-revocation-sweep.d.ts +172 -0
  213. package/host-runtime/dist/source-revocation-sweep.js +928 -0
  214. package/host-runtime/package.json +5 -1
  215. package/install-layout/dist/background-execution-transition.d.ts +258 -0
  216. package/install-layout/dist/background-execution-transition.js +836 -0
  217. package/install-layout/dist/index.d.ts +8 -0
  218. package/install-layout/dist/index.js +8 -0
  219. package/install-layout/package.json +6 -2
  220. package/package.json +7 -6
  221. package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
  222. package/pd-cli/dist/commands/candidate.js +16 -5
  223. package/pd-cli/dist/commands/candidate.js.map +1 -1
  224. package/pd-cli/dist/commands/codex-setup.d.ts.map +1 -1
  225. package/pd-cli/dist/commands/codex-setup.js +17 -1
  226. package/pd-cli/dist/commands/codex-setup.js.map +1 -1
  227. package/pd-cli/dist/commands/codex-worker.d.ts.map +1 -1
  228. package/pd-cli/dist/commands/codex-worker.js +8 -4
  229. package/pd-cli/dist/commands/codex-worker.js.map +1 -1
  230. package/pd-cli/dist/commands/consent-sweep-revoked.d.ts +20 -0
  231. package/pd-cli/dist/commands/consent-sweep-revoked.d.ts.map +1 -0
  232. package/pd-cli/dist/commands/consent-sweep-revoked.js +85 -0
  233. package/pd-cli/dist/commands/consent-sweep-revoked.js.map +1 -0
  234. package/pd-cli/dist/commands/console.d.ts.map +1 -1
  235. package/pd-cli/dist/commands/console.js +9 -0
  236. package/pd-cli/dist/commands/console.js.map +1 -1
  237. package/pd-cli/dist/commands/context.d.ts.map +1 -1
  238. package/pd-cli/dist/commands/context.js +9 -1
  239. package/pd-cli/dist/commands/context.js.map +1 -1
  240. package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
  241. package/pd-cli/dist/commands/diagnose.js +12 -6
  242. package/pd-cli/dist/commands/diagnose.js.map +1 -1
  243. package/pd-cli/dist/commands/health-console.d.ts +1 -1
  244. package/pd-cli/dist/commands/health-console.d.ts.map +1 -1
  245. package/pd-cli/dist/commands/health-console.js +15 -1
  246. package/pd-cli/dist/commands/health-console.js.map +1 -1
  247. package/pd-cli/dist/commands/health.d.ts.map +1 -1
  248. package/pd-cli/dist/commands/health.js +7 -1
  249. package/pd-cli/dist/commands/health.js.map +1 -1
  250. package/pd-cli/dist/commands/openclaw-worker.d.ts +11 -0
  251. package/pd-cli/dist/commands/openclaw-worker.d.ts.map +1 -0
  252. package/pd-cli/dist/commands/openclaw-worker.js +199 -0
  253. package/pd-cli/dist/commands/openclaw-worker.js.map +1 -0
  254. package/pd-cli/dist/commands/pain-explicit.d.ts.map +1 -1
  255. package/pd-cli/dist/commands/pain-explicit.js +1 -0
  256. package/pd-cli/dist/commands/pain-explicit.js.map +1 -1
  257. package/pd-cli/dist/commands/pain-recall.d.ts +2 -2
  258. package/pd-cli/dist/commands/pain-recall.d.ts.map +1 -1
  259. package/pd-cli/dist/commands/pain-recall.js +7 -1
  260. package/pd-cli/dist/commands/pain-recall.js.map +1 -1
  261. package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
  262. package/pd-cli/dist/commands/pain-retry.js +12 -6
  263. package/pd-cli/dist/commands/pain-retry.js.map +1 -1
  264. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts.map +1 -1
  265. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js +2 -1
  266. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js.map +1 -1
  267. package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts +1 -0
  268. package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
  269. package/pd-cli/dist/commands/runtime-internalization-run-once.js +32 -8
  270. package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
  271. package/pd-cli/dist/commands/runtime-internalization-wake-once.d.ts.map +1 -1
  272. package/pd-cli/dist/commands/runtime-internalization-wake-once.js +2 -1
  273. package/pd-cli/dist/commands/runtime-internalization-wake-once.js.map +1 -1
  274. package/pd-cli/dist/commands/service-handover.d.ts +12 -0
  275. package/pd-cli/dist/commands/service-handover.d.ts.map +1 -0
  276. package/pd-cli/dist/commands/service-handover.js +117 -0
  277. package/pd-cli/dist/commands/service-handover.js.map +1 -0
  278. package/pd-cli/dist/commands/service-lifecycle.d.ts +31 -0
  279. package/pd-cli/dist/commands/service-lifecycle.d.ts.map +1 -0
  280. package/pd-cli/dist/commands/service-lifecycle.js +207 -0
  281. package/pd-cli/dist/commands/service-lifecycle.js.map +1 -0
  282. package/pd-cli/dist/commands/service-run-once.d.ts +96 -0
  283. package/pd-cli/dist/commands/service-run-once.d.ts.map +1 -1
  284. package/pd-cli/dist/commands/service-run-once.js +432 -13
  285. package/pd-cli/dist/commands/service-run-once.js.map +1 -1
  286. package/pd-cli/dist/commands/workbuddy-setup.d.ts.map +1 -1
  287. package/pd-cli/dist/commands/workbuddy-setup.js +22 -2
  288. package/pd-cli/dist/commands/workbuddy-setup.js.map +1 -1
  289. package/pd-cli/dist/program.d.ts.map +1 -1
  290. package/pd-cli/dist/program.js +167 -9
  291. package/pd-cli/dist/program.js.map +1 -1
  292. package/pd-cli/dist/services/admission-write-gate.d.ts +3 -1
  293. package/pd-cli/dist/services/admission-write-gate.d.ts.map +1 -1
  294. package/pd-cli/dist/services/admission-write-gate.js +1 -0
  295. package/pd-cli/dist/services/admission-write-gate.js.map +1 -1
  296. package/pd-cli/dist/services/console-launcher.d.ts +93 -1
  297. package/pd-cli/dist/services/console-launcher.d.ts.map +1 -1
  298. package/pd-cli/dist/services/console-launcher.js +375 -10
  299. package/pd-cli/dist/services/console-launcher.js.map +1 -1
  300. package/pd-cli/dist/services/service-host/coordinator-common.d.ts +49 -0
  301. package/pd-cli/dist/services/service-host/coordinator-common.d.ts.map +1 -0
  302. package/pd-cli/dist/services/service-host/coordinator-common.js +158 -0
  303. package/pd-cli/dist/services/service-host/coordinator-common.js.map +1 -0
  304. package/pd-cli/dist/services/service-host/handover-claims.d.ts +14 -0
  305. package/pd-cli/dist/services/service-host/handover-claims.d.ts.map +1 -0
  306. package/pd-cli/dist/services/service-host/handover-claims.js +50 -0
  307. package/pd-cli/dist/services/service-host/handover-claims.js.map +1 -0
  308. package/pd-cli/dist/services/service-host/index.d.ts +19 -3
  309. package/pd-cli/dist/services/service-host/index.d.ts.map +1 -1
  310. package/pd-cli/dist/services/service-host/index.js +21 -3
  311. package/pd-cli/dist/services/service-host/index.js.map +1 -1
  312. package/pd-cli/dist/services/service-host/install-identity.d.ts +23 -3
  313. package/pd-cli/dist/services/service-host/install-identity.d.ts.map +1 -1
  314. package/pd-cli/dist/services/service-host/install-identity.js +15 -5
  315. package/pd-cli/dist/services/service-host/install-identity.js.map +1 -1
  316. package/pd-cli/dist/services/service-host/locking/service-run-lock.d.ts +130 -9
  317. package/pd-cli/dist/services/service-host/locking/service-run-lock.d.ts.map +1 -1
  318. package/pd-cli/dist/services/service-host/locking/service-run-lock.js +99 -19
  319. package/pd-cli/dist/services/service-host/locking/service-run-lock.js.map +1 -1
  320. package/pd-cli/dist/services/service-host/managed-run.d.ts +75 -0
  321. package/pd-cli/dist/services/service-host/managed-run.d.ts.map +1 -0
  322. package/pd-cli/dist/services/service-host/managed-run.js +550 -0
  323. package/pd-cli/dist/services/service-host/managed-run.js.map +1 -0
  324. package/pd-cli/dist/services/service-host/progress-evidence.d.ts +38 -0
  325. package/pd-cli/dist/services/service-host/progress-evidence.d.ts.map +1 -0
  326. package/pd-cli/dist/services/service-host/progress-evidence.js +155 -0
  327. package/pd-cli/dist/services/service-host/progress-evidence.js.map +1 -0
  328. package/pd-cli/dist/services/service-host/run-once.d.ts.map +1 -1
  329. package/pd-cli/dist/services/service-host/run-once.js +4 -136
  330. package/pd-cli/dist/services/service-host/run-once.js.map +1 -1
  331. package/pd-cli/dist/services/service-host/scheduler/contract.d.ts +184 -0
  332. package/pd-cli/dist/services/service-host/scheduler/contract.d.ts.map +1 -0
  333. package/pd-cli/dist/services/service-host/scheduler/contract.js +86 -0
  334. package/pd-cli/dist/services/service-host/scheduler/contract.js.map +1 -0
  335. package/pd-cli/dist/services/service-host/scheduler/index.d.ts +76 -0
  336. package/pd-cli/dist/services/service-host/scheduler/index.d.ts.map +1 -0
  337. package/pd-cli/dist/services/service-host/scheduler/index.js +128 -0
  338. package/pd-cli/dist/services/service-host/scheduler/index.js.map +1 -0
  339. package/pd-cli/dist/services/service-host/scheduler/linux.d.ts +27 -0
  340. package/pd-cli/dist/services/service-host/scheduler/linux.d.ts.map +1 -0
  341. package/pd-cli/dist/services/service-host/scheduler/linux.js +1010 -0
  342. package/pd-cli/dist/services/service-host/scheduler/linux.js.map +1 -0
  343. package/pd-cli/dist/services/service-host/scheduler/macos.d.ts +13 -0
  344. package/pd-cli/dist/services/service-host/scheduler/macos.d.ts.map +1 -0
  345. package/pd-cli/dist/services/service-host/scheduler/macos.js +819 -0
  346. package/pd-cli/dist/services/service-host/scheduler/macos.js.map +1 -0
  347. package/pd-cli/dist/services/service-host/scheduler/runtime-io.d.ts +13 -0
  348. package/pd-cli/dist/services/service-host/scheduler/runtime-io.d.ts.map +1 -0
  349. package/pd-cli/dist/services/service-host/scheduler/runtime-io.js +141 -0
  350. package/pd-cli/dist/services/service-host/scheduler/runtime-io.js.map +1 -0
  351. package/pd-cli/dist/services/service-host/scheduler/service-status.d.ts +99 -0
  352. package/pd-cli/dist/services/service-host/scheduler/service-status.d.ts.map +1 -0
  353. package/pd-cli/dist/services/service-host/scheduler/service-status.js +202 -0
  354. package/pd-cli/dist/services/service-host/scheduler/service-status.js.map +1 -0
  355. package/pd-cli/dist/services/service-host/scheduler/windows.d.ts +40 -0
  356. package/pd-cli/dist/services/service-host/scheduler/windows.d.ts.map +1 -0
  357. package/pd-cli/dist/services/service-host/scheduler/windows.js +688 -0
  358. package/pd-cli/dist/services/service-host/scheduler/windows.js.map +1 -0
  359. package/pd-cli/dist/services/service-host/shadow-progress-store.d.ts +43 -0
  360. package/pd-cli/dist/services/service-host/shadow-progress-store.d.ts.map +1 -0
  361. package/pd-cli/dist/services/service-host/shadow-progress-store.js +156 -0
  362. package/pd-cli/dist/services/service-host/shadow-progress-store.js.map +1 -0
  363. package/pd-cli/dist/services/service-host/shadow-run.d.ts +87 -0
  364. package/pd-cli/dist/services/service-host/shadow-run.d.ts.map +1 -0
  365. package/pd-cli/dist/services/service-host/shadow-run.js +549 -0
  366. package/pd-cli/dist/services/service-host/shadow-run.js.map +1 -0
  367. package/pd-cli/dist/services/service-host/status/service-run-status.d.ts +114 -4
  368. package/pd-cli/dist/services/service-host/status/service-run-status.d.ts.map +1 -1
  369. package/pd-cli/dist/services/service-host/status/service-run-status.js +37 -0
  370. package/pd-cli/dist/services/service-host/status/service-run-status.js.map +1 -1
  371. package/pd-cli/dist/services/service-host/worker-adapter-codex.d.ts +2 -0
  372. package/pd-cli/dist/services/service-host/worker-adapter-codex.d.ts.map +1 -0
  373. package/pd-cli/dist/services/service-host/worker-adapter-codex.js +76 -0
  374. package/pd-cli/dist/services/service-host/worker-adapter-codex.js.map +1 -0
  375. package/pd-cli/dist/services/service-host/worker-adapter-openclaw.d.ts +2 -0
  376. package/pd-cli/dist/services/service-host/worker-adapter-openclaw.d.ts.map +1 -0
  377. package/pd-cli/dist/services/service-host/worker-adapter-openclaw.js +49 -0
  378. package/pd-cli/dist/services/service-host/worker-adapter-openclaw.js.map +1 -0
  379. package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.d.ts +2 -0
  380. package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.d.ts.map +1 -0
  381. package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.js +36 -0
  382. package/pd-cli/dist/services/service-host/worker-adapter-workbuddy.js.map +1 -0
  383. package/pd-cli/dist/services/service-host/worker-adapter.d.ts +187 -0
  384. package/pd-cli/dist/services/service-host/worker-adapter.d.ts.map +1 -0
  385. package/pd-cli/dist/services/service-host/worker-adapter.js +609 -0
  386. package/pd-cli/dist/services/service-host/worker-adapter.js.map +1 -0
  387. package/pd-cli/dist/services/service-host/worker-env.d.ts +84 -0
  388. package/pd-cli/dist/services/service-host/worker-env.d.ts.map +1 -0
  389. package/pd-cli/dist/services/service-host/worker-env.js +195 -0
  390. package/pd-cli/dist/services/service-host/worker-env.js.map +1 -0
  391. package/pd-cli/dist/services/service-host/worker-process.d.ts +75 -0
  392. package/pd-cli/dist/services/service-host/worker-process.d.ts.map +1 -0
  393. package/pd-cli/dist/services/service-host/worker-process.js +225 -0
  394. package/pd-cli/dist/services/service-host/worker-process.js.map +1 -0
  395. package/pd-cli/dist/services/service-host/workspace-dispatch.d.ts +61 -0
  396. package/pd-cli/dist/services/service-host/workspace-dispatch.d.ts.map +1 -0
  397. package/pd-cli/dist/services/service-host/workspace-dispatch.js +105 -0
  398. package/pd-cli/dist/services/service-host/workspace-dispatch.js.map +1 -0
  399. package/pd-cli/dist/services/service-host/workspace-handover.d.ts +190 -0
  400. package/pd-cli/dist/services/service-host/workspace-handover.d.ts.map +1 -0
  401. package/pd-cli/dist/services/service-host/workspace-handover.js +1393 -0
  402. package/pd-cli/dist/services/service-host/workspace-handover.js.map +1 -0
  403. package/pd-cli/package.json +6 -5
  404. package/pd-mcp-server/dist/submit-assembly.js +159 -42
  405. package/pd-mcp-server/dist/version.d.ts +1 -1
  406. package/pd-mcp-server/dist/version.js +1 -1
  407. package/pd-mcp-server/package.json +1 -1
  408. package/plugin/dist/bundle.js +662 -637
  409. package/plugin/dist/openclaw-worker.d.ts +92 -0
  410. package/plugin/dist/openclaw-worker.js +2446 -0
  411. package/plugin/dist/openclaw.plugin.json +1 -1
  412. package/plugin/dist/service/gateway-consumer-lease.d.ts +142 -0
  413. package/plugin/dist/service/gateway-quiesce-ack.d.ts +40 -0
  414. package/plugin/dist/service/internalization-auto-consumer-service.d.ts +68 -1
  415. package/plugin/openclaw.plugin.json +1 -1
  416. package/plugin/package.json +5 -1
  417. package/release-manager/dist/installer.js +77 -30
  418. package/release-manager/dist/installers/mcp-registration-conflict.js +34 -1
  419. package/release-manager/dist/installers/workbuddy-host-installer.js +284 -21
  420. package/release-manager/dist/service-host-bridge.js +292 -0
  421. package/release-manager/dist/update/install-layout.js +42 -15
  422. package/release-manager/package.json +5 -4
  423. package/workbuddy-adapter/dist/index.d.ts +1 -1
  424. package/workbuddy-adapter/dist/index.js +1 -1
  425. package/workbuddy-adapter/dist/worker/workspace-worker.d.ts +7 -0
  426. package/workbuddy-adapter/dist/worker/workspace-worker.js +179 -10
  427. package/workbuddy-adapter/package.json +1 -1
  428. package/workbuddy-adapter/plugin/.codebuddy-plugin/plugin.json +2 -2
@@ -0,0 +1,49 @@
1
+ import { type BindingReadDiagnostic, type HostClaimReaders, type HostClaimOptions, type InstallManifest } from '@principles/install-layout';
2
+ import type { InstallIdentity } from './install-identity.js';
3
+ import type { HostRootReport, ServiceRunStatus } from './status/service-run-status.js';
4
+ import type { WorkspaceDiscoveryResult } from './workspace-discovery.js';
5
+ /** Read + parse the manifest with the five task-required verdicts. */
6
+ export declare function readManifest(identity: InstallIdentity): {
7
+ manifest: InstallManifest | undefined;
8
+ verdict: ServiceRunStatus['manifest']['verdict'];
9
+ reason?: string;
10
+ };
11
+ /** Empty discovery counts for refusal statuses. */
12
+ export declare function zeroCounts(): WorkspaceDiscoveryResult['counts'];
13
+ /** Build the empty discovery result used by refusal statuses. */
14
+ export declare function buildEmptyDiscovery(): WorkspaceDiscoveryResult;
15
+ /**
16
+ * The default host-root listability probe (P2-1). `statSync` succeeding is
17
+ * not enough — a directory the OS reports but `readdir` refuses (EACCES /
18
+ * EPERM) or fails on (EIO, transient FS errors) is NOT listable, and the
19
+ * claims collector could not have seen the workspaces under it. The four
20
+ * verdicts are distinct and none is ever faked:
21
+ * - `missing` — ENOENT/ENOTDIR at stat, or the dir vanished before readdir;
22
+ * - `not_directory` — the path exists but is not a directory;
23
+ * - `unreadable` — exists, is a directory, readdir failed for any reason;
24
+ * - `readable` — readdir actually succeeded.
25
+ */
26
+ export declare function defaultListDir(dir: string): 'readable' | 'missing' | 'not_directory' | 'unreadable';
27
+ /**
28
+ * Per-host root report (P1-2/P2-1): for every host, which root the claims
29
+ * collector consulted, whether an env override STEERED it, and whether the
30
+ * directory was actually LISTABLE. "Steered" = the variable was inherited
31
+ * AND honored: in the default mode the inherited host-root overrides steer
32
+ * discovery (P1-2); in `canonicalHostRootsOnly` mode (shadow) they were
33
+ * ignored (`identity.environment.ignoredHostRootEnvVars`) and the root is
34
+ * the trusted-home default. An unreadable root — whichever way it was
35
+ * selected — is surfaced as incomplete discovery, never silently folded
36
+ * into "no workspaces".
37
+ */
38
+ export declare function hostRootReports(identity: InstallIdentity, listDir: (dir: string) => 'readable' | 'missing' | 'not_directory' | 'unreadable'): HostRootReport[];
39
+ /** True when at least one consulted host root exists but could not be listed. */
40
+ export declare function discoveryIncompleteRoots(hostRoots: readonly HostRootReport[]): HostRootReport[];
41
+ /** Project a manifest read into the persisted status section. */
42
+ export declare function manifestSection(read: ReturnType<typeof readManifest>): ServiceRunStatus['manifest'];
43
+ /**
44
+ * Claim-collection options for the shared prefix (P1-2): custom host roots
45
+ * (env overrides) reach the collector so workspaces under them stay
46
+ * discoverable; they can never steer pdHome itself.
47
+ */
48
+ export declare function claimOptionsFor(identity: InstallIdentity, readDiagnostics: BindingReadDiagnostic[], claimReaders?: HostClaimReaders): HostClaimOptions;
49
+ //# sourceMappingURL=coordinator-common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-common.d.ts","sourceRoot":"","sources":["../../../src/services/service-host/coordinator-common.ts"],"names":[],"mappings":"AAUA,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACrB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEzE,sEAAsE;AACtE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,eAAe,GAAG;IACvD,QAAQ,EAAE,eAAe,GAAG,SAAS,CAAC;IACtC,OAAO,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;IACjD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAkCA;AAED,mDAAmD;AACnD,wBAAgB,UAAU,IAAI,wBAAwB,CAAC,QAAQ,CAAC,CAE/D;AAED,iEAAiE;AACjE,wBAAgB,mBAAmB,IAAI,wBAAwB,CAE9D;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,eAAe,GAAG,YAAY,CAoBnG;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,GAAG,eAAe,GAAG,YAAY,GAChF,cAAc,EAAE,CAiBlB;AAED,iFAAiF;AACjF,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,SAAS,cAAc,EAAE,GAAG,cAAc,EAAE,CAE/F;AAED,iEAAiE;AACjE,wBAAgB,eAAe,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAenG;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,eAAe,EACzB,eAAe,EAAE,qBAAqB,EAAE,EACxC,YAAY,CAAC,EAAE,gBAAgB,GAC9B,gBAAgB,CAUlB"}
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Shared coordinator steps (SPEC-PD-SERVICE-HOST-001 §8.2 steps 3–5, TD §5).
3
+ *
4
+ * The dry-run coordinator (run-once.ts, Phase 1) and the shadow coordinator
5
+ * (shadow-run.ts, Phase 2) execute the SAME prefix pipeline: manifest read
6
+ * with the five fail-closed verdicts, per-host root reporting, and manifest
7
+ * section projection. Those steps live here once so the two flows can never
8
+ * drift apart; each flow keeps its own execution phase.
9
+ */
10
+ import * as fs from 'node:fs';
11
+ import { parseInstallManifest, } from '@principles/install-layout';
12
+ /** Read + parse the manifest with the five task-required verdicts. */
13
+ export function readManifest(identity) {
14
+ let raw;
15
+ try {
16
+ raw = fs.readFileSync(identity.manifestPath, 'utf8');
17
+ }
18
+ catch (error) {
19
+ const code = typeof error === 'object' && error !== null && Object.hasOwn(error, 'code')
20
+ ? String(Reflect.get(error, 'code'))
21
+ : '';
22
+ if (code === 'ENOENT') {
23
+ return { manifest: undefined, verdict: 'missing', reason: 'install_manifest_missing' };
24
+ }
25
+ return {
26
+ manifest: undefined,
27
+ verdict: 'read_failed',
28
+ reason: code !== '' ? `install_manifest_read_failed:${code}` : 'install_manifest_read_failed',
29
+ };
30
+ }
31
+ let parsed;
32
+ try {
33
+ parsed = JSON.parse(raw);
34
+ }
35
+ catch (error) {
36
+ const message = error instanceof Error ? error.message : String(error);
37
+ return { manifest: undefined, verdict: 'unparsable', reason: `install_manifest_unparsable:${message.slice(0, 120)}` };
38
+ }
39
+ const result = parseInstallManifest(parsed);
40
+ if (result.manifest === undefined) {
41
+ const error = result.error ?? 'install_manifest_malformed';
42
+ return {
43
+ manifest: undefined,
44
+ verdict: error.startsWith('install_manifest_unsupported_version') ? 'version_mismatch' : 'invalid',
45
+ reason: error,
46
+ };
47
+ }
48
+ return { manifest: result.manifest, verdict: 'ok' };
49
+ }
50
+ /** Empty discovery counts for refusal statuses. */
51
+ export function zeroCounts() {
52
+ return { authorized: 0, degraded: 0, unavailable: 0, conflicting: 0, invalid: 0, discovered: 0 };
53
+ }
54
+ /** Build the empty discovery result used by refusal statuses. */
55
+ export function buildEmptyDiscovery() {
56
+ return { workspaces: [], discoveredTotal: 0, counts: zeroCounts() };
57
+ }
58
+ /**
59
+ * The default host-root listability probe (P2-1). `statSync` succeeding is
60
+ * not enough — a directory the OS reports but `readdir` refuses (EACCES /
61
+ * EPERM) or fails on (EIO, transient FS errors) is NOT listable, and the
62
+ * claims collector could not have seen the workspaces under it. The four
63
+ * verdicts are distinct and none is ever faked:
64
+ * - `missing` — ENOENT/ENOTDIR at stat, or the dir vanished before readdir;
65
+ * - `not_directory` — the path exists but is not a directory;
66
+ * - `unreadable` — exists, is a directory, readdir failed for any reason;
67
+ * - `readable` — readdir actually succeeded.
68
+ */
69
+ export function defaultListDir(dir) {
70
+ try {
71
+ if (!fs.statSync(dir).isDirectory())
72
+ return 'not_directory';
73
+ }
74
+ catch (error) {
75
+ const code = typeof error === 'object' && error !== null && Object.hasOwn(error, 'code')
76
+ ? String(Reflect.get(error, 'code'))
77
+ : '';
78
+ return code === 'ENOENT' || code === 'ENOTDIR' ? 'missing' : 'unreadable';
79
+ }
80
+ try {
81
+ fs.readdirSync(dir);
82
+ return 'readable';
83
+ }
84
+ catch (error) {
85
+ const code = typeof error === 'object' && error !== null && Object.hasOwn(error, 'code')
86
+ ? String(Reflect.get(error, 'code'))
87
+ : '';
88
+ return code === 'ENOENT' || code === 'ENOTDIR' ? 'missing' : 'unreadable';
89
+ }
90
+ }
91
+ /**
92
+ * Per-host root report (P1-2/P2-1): for every host, which root the claims
93
+ * collector consulted, whether an env override STEERED it, and whether the
94
+ * directory was actually LISTABLE. "Steered" = the variable was inherited
95
+ * AND honored: in the default mode the inherited host-root overrides steer
96
+ * discovery (P1-2); in `canonicalHostRootsOnly` mode (shadow) they were
97
+ * ignored (`identity.environment.ignoredHostRootEnvVars`) and the root is
98
+ * the trusted-home default. An unreadable root — whichever way it was
99
+ * selected — is surfaced as incomplete discovery, never silently folded
100
+ * into "no workspaces".
101
+ */
102
+ export function hostRootReports(identity, listDir) {
103
+ const honored = new Set(identity.environment.inheritedHostRootEnvVars);
104
+ for (const ignored of identity.environment.ignoredHostRootEnvVars)
105
+ honored.delete(ignored);
106
+ const roots = [
107
+ {
108
+ host: 'openclaw',
109
+ root: identity.hostRoots.openclawHome,
110
+ source: honored.has('OPENCLAW_STATE_DIR') || honored.has('OPENCLAW_HOME') ? 'env' : 'default',
111
+ },
112
+ { host: 'codex', root: identity.hostRoots.codexHome, source: honored.has('CODEX_HOME') ? 'env' : 'default' },
113
+ {
114
+ host: 'workbuddy',
115
+ root: identity.hostRoots.workbuddyConfigDir,
116
+ source: honored.has('WORKBUDDY_CONFIG_DIR') ? 'env' : 'default',
117
+ },
118
+ ];
119
+ return roots.map((entry) => ({ ...entry, status: listDir(entry.root) }));
120
+ }
121
+ /** True when at least one consulted host root exists but could not be listed. */
122
+ export function discoveryIncompleteRoots(hostRoots) {
123
+ return hostRoots.filter((r) => r.status === 'unreadable' || r.status === 'not_directory');
124
+ }
125
+ /** Project a manifest read into the persisted status section. */
126
+ export function manifestSection(read) {
127
+ return read.manifest === undefined
128
+ ? {
129
+ verdict: read.verdict,
130
+ ...(read.reason !== undefined ? { reason: read.reason } : {}),
131
+ hosts: [],
132
+ unknownHosts: [],
133
+ workspacesCount: 0,
134
+ }
135
+ : {
136
+ verdict: 'ok',
137
+ hosts: [...read.manifest.hosts, ...(read.manifest.unknownHosts ?? [])],
138
+ unknownHosts: [...(read.manifest.unknownHosts ?? [])],
139
+ workspacesCount: (read.manifest.workspaces ?? []).length,
140
+ };
141
+ }
142
+ /**
143
+ * Claim-collection options for the shared prefix (P1-2): custom host roots
144
+ * (env overrides) reach the collector so workspaces under them stay
145
+ * discoverable; they can never steer pdHome itself.
146
+ */
147
+ export function claimOptionsFor(identity, readDiagnostics, claimReaders) {
148
+ return {
149
+ homeDir: identity.homeDir,
150
+ codexHome: identity.hostRoots.codexHome,
151
+ openclawHome: identity.hostRoots.openclawHome,
152
+ workbuddyConfigDir: identity.hostRoots.workbuddyConfigDir,
153
+ platform: process.platform,
154
+ readDiagnostics,
155
+ ...(claimReaders !== undefined ? { readers: claimReaders } : {}),
156
+ };
157
+ }
158
+ //# sourceMappingURL=coordinator-common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator-common.js","sourceRoot":"","sources":["../../../src/services/service-host/coordinator-common.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EACL,oBAAoB,GAKrB,MAAM,4BAA4B,CAAC;AAKpC,sEAAsE;AACtE,MAAM,UAAU,YAAY,CAAC,QAAyB;IAKpD,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,EAAE,CAAC,YA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,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;YACrD,eAAe,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,MAAM;SACzD,CAAC;AACR,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAC7B,QAAyB,EACzB,eAAwC,EACxC,YAA+B;IAE/B,OAAO;QACL,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,SAAS;QACvC,YAAY,EAAE,QAAQ,CAAC,SAAS,CAAC,YAAY;QAC7C,kBAAkB,EAAE,QAAQ,CAAC,SAAS,CAAC,kBAAkB;QACzD,QAAQ,EAAE,OAAO,CAAC,QAAQ;QAC1B,eAAe;QACf,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACjE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface HandoverBindingResult {
2
+ /** An OpenClaw claim (any of the three validated sources) names this workspace. */
3
+ readonly openclawClaimed: boolean;
4
+ /** Cross-host conflict owner(s); `null` when unambiguous. */
5
+ readonly foreignOwner: string | null;
6
+ /**
7
+ * PRI-1282 review (P1-4): a binding file that could not be read or parsed
8
+ * is NOT "no claim" — it means foreign ownership cannot be proven either
9
+ * way, and the handover must fail closed. Lists the offending files.
10
+ */
11
+ readonly bindingUnverifiable: string | null;
12
+ }
13
+ export declare function collectHostWorkspaceClaimsFor(workspaceDir: string, homeDir: string, env?: Readonly<Record<string, string | undefined>>): HandoverBindingResult;
14
+ //# sourceMappingURL=handover-claims.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handover-claims.d.ts","sourceRoot":"","sources":["../../../src/services/service-host/handover-claims.ts"],"names":[],"mappings":"AAgBA,MAAM,WAAW,qBAAqB;IACpC,mFAAmF;IACnF,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,6DAA6D;IAC7D,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7C;AAED,wBAAgB,6BAA6B,CAC3C,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,MAAM,EACf,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GACjD,qBAAqB,CAgCvB"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Host-binding verification for the §8.4 handover (PRI-1282 Phase 4).
3
+ *
4
+ * Thin wrapper over the EXISTING authorized-discovery authorities
5
+ * (`collectHostWorkspaceClaims` + `findForeignWorkspaceOwner`) — the handover
6
+ * never invents a second binding source. A workspace is handover-eligible
7
+ * when OpenClaw holds a VALIDATED claim (default dir / host declaration /
8
+ * payload binding) and no OTHER host claims it.
9
+ */
10
+ import * as fs from 'node:fs';
11
+ import * as path from 'node:path';
12
+ import { findForeignWorkspaceOwner, collectHostWorkspaceClaims } from '@principles/install-layout';
13
+ import { resolveCoordinatorInstallIdentity } from './install-identity.js';
14
+ import { claimOptionsFor } from './coordinator-common.js';
15
+ export function collectHostWorkspaceClaimsFor(workspaceDir, homeDir, env) {
16
+ const identity = resolveCoordinatorInstallIdentity(env ?? process.env, { trustedHomeDir: homeDir });
17
+ if (!identity.ok)
18
+ return { openclawClaimed: false, foreignOwner: 'install_identity_unresolved', bindingUnverifiable: null };
19
+ const diagnostics = [];
20
+ const options = claimOptionsFor(identity.identity, diagnostics);
21
+ const claims = collectHostWorkspaceClaims(options);
22
+ const canonical = path.resolve(workspaceDir);
23
+ // Claims are matched by REAL-directory identity, not lexical spelling —
24
+ // the manifest may hold an alias of the same directory (PRI-1282 review),
25
+ // which is exactly the shape `findForeignWorkspaceOwner` resolves too.
26
+ const identityOf = (candidate) => {
27
+ const lexical = path.resolve(candidate);
28
+ let resolved = lexical;
29
+ try {
30
+ resolved = fs.realpathSync.native(lexical);
31
+ }
32
+ catch {
33
+ // Best effort: a missing path compares lexically.
34
+ }
35
+ return process.platform === 'win32' ? resolved.toLowerCase() : resolved;
36
+ };
37
+ const canonicalIdentity = identityOf(canonical);
38
+ const samePath = (candidate) => identityOf(candidate) === canonicalIdentity;
39
+ const openclawClaimed = claims.some((claim) => claim.host === 'openclaw' && samePath(claim.workspaceDir));
40
+ const foreign = findForeignWorkspaceOwner('openclaw', canonical, options);
41
+ const foreignOwner = foreign.owners.length > 0 ? foreign.owners.join('+') : null;
42
+ // PRI-1282 review (P1-4): an unreadable/malformed binding file was skipped
43
+ // during claim collection — treat "cannot verify foreign ownership" as a
44
+ // blocking fact, not as silence. The caller fails closed on this.
45
+ const bindingUnverifiable = diagnostics.length > 0
46
+ ? diagnostics.map((d) => `${d.file}(${d.status})`).join(', ')
47
+ : null;
48
+ return { openclawClaimed, foreignOwner, bindingUnverifiable };
49
+ }
50
+ //# sourceMappingURL=handover-claims.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handover-claims.js","sourceRoot":"","sources":["../../../src/services/service-host/handover-claims.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AACnG,OAAO,EAAE,iCAAiC,EAAE,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAgB1D,MAAM,UAAU,6BAA6B,CAC3C,YAAoB,EACpB,OAAe,EACf,GAAkD;IAElD,MAAM,QAAQ,GAAG,iCAAiC,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CAAC;IACpG,IAAI,CA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,OAAO,CAAC,CAAC;IAC1E,MAAM,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACjF,2EAA2E;IAC3E,yEAAyE;IACzE,kEAAkE;IAClE,MAAM,mBAAmB,GAAG,WAAW,CAAC,MAAM,GAAG,CAAC;QAChD,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QAC7D,CAAC,CAAC,IAAI,CAAC;IACT,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAChE,CAAC"}
@@ -3,13 +3,29 @@
3
3
  * (SPEC-PD-SERVICE-HOST-001 / ADR-0020 §11.6 narrow scope).
4
4
  *
5
5
  * Phase 1 public surface: the read-only run-once coordinator and its
6
- * building blocks. No Worker Adapter, no OS scheduler, no handover —
7
- * Phase 2+ extends this package within the same boundary (TD §11).
6
+ * building blocks. Phase 2 adds the unified Worker Adapter contract and the
7
+ * explicit, bounded shadow coordinator (PRI-1280). Phase 3 adds the managed
8
+ * run (the OS scheduler entry), the Scheduler Adapter Contract with the
9
+ * three user-level platform adapters, and the unified read-only status
10
+ * contract (PRI-1281). No owner-marker writes, no handover — later phases
11
+ * extend this package within the same boundary (TD §11).
8
12
  */
9
13
  export { resolveCoordinatorInstallIdentity, stripExperimentRoot, type CoordinatorEnvView, type InstallIdentity, } from './install-identity.js';
10
14
  export { WORKSPACE_DISCOVERY_VERDICTS, discoverWorkspaces, type DiscoverWorkspacesInput, type DiscoveryProbes, type WorkspaceDiscoveryEntry, type WorkspaceDiscoveryResult, type WorkspaceDiscoveryVerdict, type WorkspaceSourceRef, } from './workspace-discovery.js';
11
15
  export { projectWorkspaceOwner, type OwnerProjection } from './owner-projection.js';
16
+ export { buildEmptyDiscovery, claimOptionsFor, defaultListDir, discoveryIncompleteRoots, hostRootReports, manifestSection, readManifest, } from './coordinator-common.js';
12
17
  export { SERVICE_RUN_LOCK_STALE_MS, acquireServiceRunLock, holdsServiceRunLock, releaseServiceRunLock, serviceRunLockPath, type AcquireServiceRunLockResult, type LockBodyRead, type ReleaseServiceRunLockResult, type ServiceRunLockHandle, } from './locking/service-run-lock.js';
13
- export { SERVICE_RUN_STATUS_SCHEMA_VERSION, readActiveReleaseFacts, serviceRunStatusPath, writeServiceRunStatus, type ActiveReleaseFacts, type ServiceRunStatus, } from './status/service-run-status.js';
18
+ export { SERVICE_RUN_STATUS_SCHEMA_VERSION, readActiveReleaseFacts, readServiceRunStatus, serviceRunStatusPath, writeServiceRunStatus, type ActiveReleaseFacts, type ManagedExecutionRecord, type ManagedRunStatusSection, type ServiceRunStatus, type ServiceRunStatusRead, type ServiceRunTriggerSource, type ShadowExecutionRecord, type ShadowRunStatusSection, } from './status/service-run-status.js';
14
19
  export { runServiceRunOnce, type RunOnceOptions, type RunOnceResult, } from './run-once.js';
20
+ export { WORKER_ADAPTER_CONTRACT_VERSION, WORKER_HOST_KINDS, resolveActiveReleaseCliEntry, type AdapterCycleHealth, type AdapterCycleOutcome, type AdapterCycleResult, type AdapterSupport, type BusinessProgressEvidence, type CliWorkerHostConfig, type WorkerAdapter, type WorkerAdapterExecuteInput, type WorkerAdapterProbes, type WorkerHostKind, type WorkspaceDescriptor, } from './worker-adapter.js';
21
+ export { createCodexWorkerAdapter } from './worker-adapter-codex.js';
22
+ export { createWorkbuddyWorkerAdapter } from './worker-adapter-workbuddy.js';
23
+ export { buildWorkerEnvironment, type WorkerEnvironment, type WorkerEnvironmentReport, } from './worker-env.js';
24
+ export { runWorkerProcess, type WorkerProcessOptions, type WorkerProcessResult, } from './worker-process.js';
25
+ export { diffTaskProgress, readTaskProgressSnapshot, type TaskProgressEvidence, type TaskProgressRead, type TaskProgressSnapshot, } from './progress-evidence.js';
26
+ export { DEFAULT_SHADOW_WORKSPACE_TIMEOUT_MS, runServiceShadowOnce, type ShadowRunOptions, type ShadowRunProbes, type ShadowRunResult, } from './shadow-run.js';
27
+ export { carriedProgress, dispatchWorkspaceAdapters, workspaceStateFor, type AdapterDispatchEntry, type AdapterDispatchOutcome, type DispatchWorkspaceAdaptersArgs, type WorkspaceDispatchResult, } from './workspace-dispatch.js';
28
+ export { DEFAULT_MANAGED_WORKSPACE_TIMEOUT_MS, runServiceManagedOnce, type ManagedRunOptions, type ManagedRunProbes, type ManagedRunResult, } from './managed-run.js';
29
+ export { DEFAULT_SCHEDULER_INTERVAL_MS, buildWindowsTaskXml, buildMacosLaunchAgentPlist, buildLinuxServiceUnit, buildLinuxTimerUnit, createLinuxSchedulerAdapter, createMacosSchedulerAdapter, createSpawnSchedulerRunner, createWindowsSchedulerAdapter, nodeSchedulerFileIo, runSchedulerLifecycle, schedulerIdentityFor, schedulerInvocationArgs, validateSchedulerIntervalMs, parseWindowsIntervalMs, parseMacosStartIntervalMs, parseLinuxTimerIntervalMs, type MacosSchedulerDeps, type LinuxSchedulerDeps, type SchedulerAdapter, type SchedulerAdapterResolution, type SchedulerCommandResult, type SchedulerCommandRunner, type SchedulerFileIo, type SchedulerFacts, type SchedulerIdentity, type SchedulerLifecycleOperation, type SchedulerLifecycleOptions, type SchedulerLifecycleResult, type SchedulerOperationResult, type SchedulerPlatform, type SchedulerRegistration, type WindowsSchedulerDeps, } from './scheduler/index.js';
30
+ export { SERVICE_HOST_STATUS_SCHEMA_VERSION, composeServiceHostStatus, type ServiceHostStatusDocument, type ServiceHostStatusOptions, type ServiceHostStatusResult, type ServiceHostStatusWorkspace, } from './scheduler/service-status.js';
15
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/service-host/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,iCAAiC,EACjC,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACpF,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,KAAK,2BAA2B,EAChC,KAAK,YAAY,EACjB,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,GAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,iCAAiC,EACjC,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/service-host/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,iCAAiC,EACjC,mBAAmB,EACnB,KAAK,kBAAkB,EACvB,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,EAClB,KAAK,uBAAuB,EAC5B,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,kBAAkB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM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OAAO,EACL,kCAAkC,EAClC,wBAAwB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,GAChC,MAAM,+BAA+B,CAAC"}
@@ -3,13 +3,31 @@
3
3
  * (SPEC-PD-SERVICE-HOST-001 / ADR-0020 §11.6 narrow scope).
4
4
  *
5
5
  * Phase 1 public surface: the read-only run-once coordinator and its
6
- * building blocks. No Worker Adapter, no OS scheduler, no handover —
7
- * Phase 2+ extends this package within the same boundary (TD §11).
6
+ * building blocks. Phase 2 adds the unified Worker Adapter contract and the
7
+ * explicit, bounded shadow coordinator (PRI-1280). Phase 3 adds the managed
8
+ * run (the OS scheduler entry), the Scheduler Adapter Contract with the
9
+ * three user-level platform adapters, and the unified read-only status
10
+ * contract (PRI-1281). No owner-marker writes, no handover — later phases
11
+ * extend this package within the same boundary (TD §11).
8
12
  */
9
13
  export { resolveCoordinatorInstallIdentity, stripExperimentRoot, } from './install-identity.js';
10
14
  export { WORKSPACE_DISCOVERY_VERDICTS, discoverWorkspaces, } from './workspace-discovery.js';
11
15
  export { projectWorkspaceOwner } from './owner-projection.js';
16
+ export { buildEmptyDiscovery, claimOptionsFor, defaultListDir, discoveryIncompleteRoots, hostRootReports, manifestSection, readManifest, } from './coordinator-common.js';
12
17
  export { SERVICE_RUN_LOCK_STALE_MS, acquireServiceRunLock, holdsServiceRunLock, releaseServiceRunLock, serviceRunLockPath, } from './locking/service-run-lock.js';
13
- export { SERVICE_RUN_STATUS_SCHEMA_VERSION, readActiveReleaseFacts, serviceRunStatusPath, writeServiceRunStatus, } from './status/service-run-status.js';
18
+ export { SERVICE_RUN_STATUS_SCHEMA_VERSION, readActiveReleaseFacts, readServiceRunStatus, serviceRunStatusPath, writeServiceRunStatus, } from './status/service-run-status.js';
14
19
  export { runServiceRunOnce, } from './run-once.js';
20
+ // ── Phase 2 (PRI-1280): Worker Adapter contract + shadow coordinator ──
21
+ export { WORKER_ADAPTER_CONTRACT_VERSION, WORKER_HOST_KINDS, resolveActiveReleaseCliEntry, } from './worker-adapter.js';
22
+ export { createCodexWorkerAdapter } from './worker-adapter-codex.js';
23
+ export { createWorkbuddyWorkerAdapter } from './worker-adapter-workbuddy.js';
24
+ export { buildWorkerEnvironment, } from './worker-env.js';
25
+ export { runWorkerProcess, } from './worker-process.js';
26
+ export { diffTaskProgress, readTaskProgressSnapshot, } from './progress-evidence.js';
27
+ export { DEFAULT_SHADOW_WORKSPACE_TIMEOUT_MS, runServiceShadowOnce, } from './shadow-run.js';
28
+ // ── Phase 3 (PRI-1281): shared dispatch core + managed run + OS scheduler ──
29
+ export { carriedProgress, dispatchWorkspaceAdapters, workspaceStateFor, } from './workspace-dispatch.js';
30
+ export { DEFAULT_MANAGED_WORKSPACE_TIMEOUT_MS, runServiceManagedOnce, } from './managed-run.js';
31
+ export { DEFAULT_SCHEDULER_INTERVAL_MS, buildWindowsTaskXml, buildMacosLaunchAgentPlist, buildLinuxServiceUnit, buildLinuxTimerUnit, createLinuxSchedulerAdapter, createMacosSchedulerAdapter, createSpawnSchedulerRunner, createWindowsSchedulerAdapter, nodeSchedulerFileIo, runSchedulerLifecycle, schedulerIdentityFor, schedulerInvocationArgs, validateSchedulerIntervalMs, parseWindowsIntervalMs, parseMacosStartIntervalMs, parseLinuxTimerIntervalMs, } from './scheduler/index.js';
32
+ export { SERVICE_HOST_STATUS_SCHEMA_VERSION, composeServiceHostStatus, } from './scheduler/service-status.js';
15
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/service-host/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,iCAAiC,EACjC,mBAAmB,GAGpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,GAOnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAwB,MAAM,uBAAuB,CAAC;AACpF,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GAKnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,iCAAiC,EACjC,sBAAsB,EACtB,oBAAoB,EACpB,qBAAqB,GAGtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iBAAiB,GAGlB,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/service-host/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EACL,iCAAiC,EACjC,mBAAmB,GAGpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,4BAA4B,EAC5B,kBAAkB,GAOnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAwB,MAAM,uBAAuB,CAAC;AACpF,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,wBAAwB,EACxB,eAAe,EACf,eAAe,EACf,YAAY,GACb,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GAKnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,iCAAiC,EACjC,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,GAStB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,iBAAiB,GAGlB,MAAM,eAAe,CAAC;AACvB,yEAAyE;AACzE,OAAO,EACL,+BAA+B,EAC/B,iBAAiB,EACjB,4BAA4B,GAY7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,EACL,sBAAsB,GAGvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,gBAAgB,GAGjB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,wBAAwB,GAIzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,mCAAmC,EACnC,oBAAoB,GAIrB,MAAM,iBAAiB,CAAC;AACzB,8EAA8E;AAC9E,OAAO,EACL,eAAe,EACf,yBAAyB,EACzB,iBAAiB,GAKlB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,oCAAoC,EACpC,qBAAqB,GAItB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,EACtB,yBAAyB,EACzB,yBAAyB,GAiB1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,kCAAkC,EAClC,wBAAwB,GAKzB,MAAM,+BAA+B,CAAC"}
@@ -12,11 +12,19 @@ export interface CoordinatorEnvView {
12
12
  */
13
13
  readonly ignoredIdentityEnvVars: readonly string[];
14
14
  /**
15
- * Host-root overrides present in the inherited env. These DID steer
16
- * workspace discovery (P1-2) but cannot move pdHome — listed here so an
17
- * operator can tell a custom-root run apart from a default-root run.
15
+ * Host-root overrides present in the inherited env. In the default (Phase 1
16
+ * dry-run) mode these DID steer workspace discovery (P1-2) but cannot move
17
+ * pdHome. In `canonicalHostRootsOnly` mode they did NOT steer anything —
18
+ * see `ignoredHostRootEnvVars`.
18
19
  */
19
20
  readonly inheritedHostRootEnvVars: readonly string[];
21
+ /**
22
+ * Host-root overrides that were present in the inherited env but did NOT
23
+ * steer host-root resolution (always empty in the default mode; the present
24
+ * list in `canonicalHostRootsOnly` mode). Recorded so a polluted run is
25
+ * observable, never silent (rc-9).
26
+ */
27
+ readonly ignoredHostRootEnvVars: readonly string[];
20
28
  }
21
29
  export interface InstallIdentity {
22
30
  /** `<home>/.pd` — the install root this coordinator owns. */
@@ -53,6 +61,18 @@ export interface ResolveInstallIdentityOptions {
53
61
  * When omitted the OS account record is consulted.
54
62
  */
55
63
  readonly trustedHomeDir?: string;
64
+ /**
65
+ * Resolve host roots from the trusted home ONLY (canonical
66
+ * `<home>/.openclaw` / `<home>/.codex` / `<home>/.workbuddy` defaults),
67
+ * ignoring inherited `OPENCLAW_STATE_DIR` / `OPENCLAW_HOME` /
68
+ * `CODEX_HOME` / `WORKBUDDY_CONFIG_DIR` overrides (recorded as
69
+ * `ignoredHostRootEnvVars`). The Phase 2 shadow coordinator sets this: a
70
+ * real cycle must never be discovered from — nor pinned to — an
71
+ * experiment/custom root an inherited env happened to name (TD §5.2). The
72
+ * Phase 1 dry-run keeps the shared production precedence (env honored for
73
+ * discovery, P1-2) because it starts nothing.
74
+ */
75
+ readonly canonicalHostRootsOnly?: boolean;
56
76
  }
57
77
  /** Strip the experiment-root switch, keeping every other variable intact. */
58
78
  export declare function stripExperimentRoot(env: Readonly<Record<string, string | undefined>>): {
@@ -1 +1 @@
1
- {"version":3,"file":"install-identity.d.ts","sourceRoot":"","sources":["../../../src/services/service-host/install-identity.ts"],"names":[],"mappings":"AAkDA,MAAM,WAAW,kBAAkB;IACjC,wEAAwE;IACxE,QAAQ,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAC1C,8EAA8E;IAC9E,QAAQ,CAAC,sBAAsB,EAAE,OAAO,CAAC;IACzC,sFAAsF;IACtF,QAAQ,CAAC,4BAA4B,CAAC,EAAE,MAAM,CAAC;IAC/C;;;;OAIG;IACH,QAAQ,CAAC,sBAAsB,EAAE,SAAS,MAAM,EAAE,CAAC;IACnD;;;;OAIG;IACH,QAAQ,CAAC,wBAAwB,EAAE,SAAS,MAAM,EAAE,CAAC;CACtD;AAED,MAAM,WAAW,eAAe;IAC9B,6DAA6D;IAC7D,QAAQ,CAAC,MAAM,EAAE,MA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CAAC;IACjC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAC3C;AAED,6EAA6E;AAC7E,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAChD;IAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAmCvE;AAoBD;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAC/C,GAAG,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAe,EAC/D,OAAO,GAAE,6BAAkC,GAC1C;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,eAAe,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAgE7F"}
@@ -56,6 +56,9 @@ export function stripExperimentRoot(env) {
56
56
  const base = {
57
57
  ignoredIdentityEnvVars,
58
58
  inheritedHostRootEnvVars,
59
+ // Overridden by resolveCoordinatorInstallIdentity when host-root
60
+ // resolution ignores the inherited overrides (canonicalHostRootsOnly).
61
+ ignoredHostRootEnvVars: [],
59
62
  };
60
63
  const raw = env[PD_EXPERIMENT_ROOT];
61
64
  if (raw === undefined) {
@@ -134,10 +137,17 @@ export function resolveCoordinatorInstallIdentity(env = process.env, options = {
134
137
  'Fix the OS account home directory, or reinstall PD with `npx create-principles-disciple`.',
135
138
  };
136
139
  }
137
- // HOME/USERPROFILE are deliberately NOT removed from `stripped`: the env is
138
- // also consulted for host-root overrides (P1-2), and the trusted home is
139
- // passed explicitly so the vars can never steer identity.
140
- const resolution = resolvePdHome({ env: stripped, homeDir });
140
+ // canonicalHostRootsOnly: host-root resolution sees an EMPTY env — the
141
+ // overrides resolve to the trusted-home defaults — while the inherited
142
+ // presence is recorded as ignored (rc-9). HOME/USERPROFILE stay in
143
+ // `stripped` (they are never consulted for host roots anyway).
144
+ const ignoredHostRootEnvVars = options.canonicalHostRootsOnly === true
145
+ ? view.inheritedHostRootEnvVars
146
+ : [];
147
+ const resolution = resolvePdHome({
148
+ env: options.canonicalHostRootsOnly === true ? {} : stripped,
149
+ homeDir,
150
+ });
141
151
  if (!resolution.ok) {
142
152
  return {
143
153
  ok: false,
@@ -159,7 +169,7 @@ export function resolveCoordinatorInstallIdentity(env = process.env, options = {
159
169
  workbuddyConfigDir: resolution.workbuddyConfigDir,
160
170
  },
161
171
  mode: 'production',
162
- environment: view,
172
+ environment: { ...view, ignoredHostRootEnvVars },
163
173
  },
164
174
  };
165
175
  }
@@ -1 +1 @@
1
- {"version":3,"file":"install-identity.js","sourceRoot":"","sources":["../../../src/services/service-host/install-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,mEAAmE;AACnE,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEhD;;;;GAIG;AACH,MAAM,yBAAyB,GAAG,CAAC,MAAM,EAAE,aAAa,CAAU,CAAC;AACnE,MAAM,kBAAkB,GAAG;IACzB,oBAAoB;IACpB,eAAe;IACf,YAAY;IACZ,sBAAsB;CACd,CAAC;AA6DX,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CACjC,GAAiD;IAEjD,MAAM,KAAK,GAAG,CAAC,IAAY,EAAW,EAAE;QACtC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;QACxB,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,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UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9B,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,4CAA4C;YACpD,UAAU,EACR,8FAA8F;gBAC9F,2FAA2F;SAC9F,CAAC;IACJ,CAAC;IACD,4EAA4E;IAC5E,yEAAyE;IACzE,0DAA0D;IAC1D,MAAM,UAAU,GAAG,aAAa,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;IAC7D,IAAI,CAAC,UAAU,CAAC,EAAE,EAAE,CAAC;QACnB,OAAO;YACL,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,4BAA4B,UAAU,CAAC,MAAM,EAAE;YACvD,UAAU,EAAE,UAAU,CAAC,UAAU;SAClC,CAAC;IACJ,CAAC;IACD,OAAO;QACL,EAAE,EAAE,IAAI;QACR,QAAQ,EAAE;YACR,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,OAAO,EAAE,UAAU,CAAC,OAAO;YAC3B,UAAU;YACV,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,cAAc,CAAC;YAC1D,gBAAgB,EAAE,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,aAAa,CAAC;YAC7D,SAAS,EAAE;gBACT,YAAY,EAAE,UAAU,CAAC,YAAY;gBACrC,SAAS,EAAE,UAAU,CAAC,SAAS;gBAC/B,kBAAkB,EAAE,UAAU,CAAC,kBAAkB;aAClD;YACD,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,IAAI;SAClB;KACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"install-identity.js","sourceRoot":"","sources":["../../../src/services/service-host/install-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,E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