create-principles-disciple 1.156.2 → 1.157.3

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 (242) hide show
  1. package/_release/product-identity.json +2 -2
  2. package/codex-adapter/dist/worker/workspace-worker.d.ts +11 -3
  3. package/codex-adapter/dist/worker/workspace-worker.js +30 -16
  4. package/codex-adapter/package.json +1 -1
  5. package/console/dist/server/models/OwnerDecisionConsoleModel.js +33 -1
  6. package/console/dist/web/assets/app.js +3 -3
  7. package/core/dist/runtime/adversarial-loop.d.ts +8 -0
  8. package/core/dist/runtime/adversarial-loop.d.ts.map +1 -1
  9. package/core/dist/runtime/adversarial-loop.js +420 -45
  10. package/core/dist/runtime/adversarial-loop.js.map +1 -1
  11. package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js +3 -3
  12. package/core/dist/runtime/feature-flags/feature-flag-lifecycle.js.map +1 -1
  13. package/core/dist/runtime/feature-flags/plugin-surface-registry.d.ts.map +1 -1
  14. package/core/dist/runtime/feature-flags/plugin-surface-registry.js +0 -16
  15. package/core/dist/runtime/feature-flags/plugin-surface-registry.js.map +1 -1
  16. package/core/dist/runtime/index.d.ts +4 -0
  17. package/core/dist/runtime/index.d.ts.map +1 -1
  18. package/core/dist/runtime/index.js +10 -0
  19. package/core/dist/runtime/index.js.map +1 -1
  20. package/core/dist/runtime/internalization/artificer-runner.d.ts +9 -0
  21. package/core/dist/runtime/internalization/artificer-runner.d.ts.map +1 -1
  22. package/core/dist/runtime/internalization/artificer-runner.js +52 -0
  23. package/core/dist/runtime/internalization/artificer-runner.js.map +1 -1
  24. package/core/dist/runtime/internalization/correlation-lineage.d.ts +16 -3
  25. package/core/dist/runtime/internalization/correlation-lineage.d.ts.map +1 -1
  26. package/core/dist/runtime/internalization/correlation-lineage.js +4 -4
  27. package/core/dist/runtime/internalization/correlation-lineage.js.map +1 -1
  28. package/core/dist/runtime/internalization/evaluator-runner.d.ts +35 -0
  29. package/core/dist/runtime/internalization/evaluator-runner.d.ts.map +1 -1
  30. package/core/dist/runtime/internalization/evaluator-runner.js +390 -91
  31. package/core/dist/runtime/internalization/evaluator-runner.js.map +1 -1
  32. package/core/dist/runtime/internalization/internalization-orchestrator.d.ts +40 -13
  33. package/core/dist/runtime/internalization/internalization-orchestrator.d.ts.map +1 -1
  34. package/core/dist/runtime/internalization/internalization-orchestrator.js +520 -199
  35. package/core/dist/runtime/internalization/internalization-orchestrator.js.map +1 -1
  36. package/core/dist/runtime/internalization/internalization-transition-decision.js +1 -1
  37. package/core/dist/runtime/internalization/internalization-transition-decision.js.map +1 -1
  38. package/core/dist/runtime/internalization/owner-resolution-service.d.ts.map +1 -1
  39. package/core/dist/runtime/internalization/owner-resolution-service.js +10 -8
  40. package/core/dist/runtime/internalization/owner-resolution-service.js.map +1 -1
  41. package/core/dist/runtime/internalization/owner-review.d.ts +2 -0
  42. package/core/dist/runtime/internalization/owner-review.d.ts.map +1 -1
  43. package/core/dist/runtime/internalization/owner-review.js +17 -11
  44. package/core/dist/runtime/internalization/owner-review.js.map +1 -1
  45. package/core/dist/runtime/internalization/peer-runner-contracts.d.ts +2 -0
  46. package/core/dist/runtime/internalization/peer-runner-contracts.d.ts.map +1 -1
  47. package/core/dist/runtime/internalization/peer-runner-contracts.js.map +1 -1
  48. package/core/dist/runtime/internalization/pitask-metadata.d.ts +36 -1
  49. package/core/dist/runtime/internalization/pitask-metadata.d.ts.map +1 -1
  50. package/core/dist/runtime/internalization/pitask-metadata.js +23 -2
  51. package/core/dist/runtime/internalization/pitask-metadata.js.map +1 -1
  52. package/core/dist/runtime/internalization/repair-create.d.ts +73 -0
  53. package/core/dist/runtime/internalization/repair-create.d.ts.map +1 -0
  54. package/core/dist/runtime/internalization/repair-create.js +200 -0
  55. package/core/dist/runtime/internalization/repair-create.js.map +1 -0
  56. package/core/dist/runtime/internalization/repair-lineage-backfill.d.ts +94 -0
  57. package/core/dist/runtime/internalization/repair-lineage-backfill.d.ts.map +1 -0
  58. package/core/dist/runtime/internalization/repair-lineage-backfill.js +123 -0
  59. package/core/dist/runtime/internalization/repair-lineage-backfill.js.map +1 -0
  60. package/core/dist/runtime/internalization/repair-task-identity.d.ts +99 -4
  61. package/core/dist/runtime/internalization/repair-task-identity.d.ts.map +1 -1
  62. package/core/dist/runtime/internalization/repair-task-identity.js +225 -7
  63. package/core/dist/runtime/internalization/repair-task-identity.js.map +1 -1
  64. package/core/dist/runtime/internalization/revision-reopen.d.ts +56 -1
  65. package/core/dist/runtime/internalization/revision-reopen.d.ts.map +1 -1
  66. package/core/dist/runtime/internalization/revision-reopen.js +82 -39
  67. package/core/dist/runtime/internalization/revision-reopen.js.map +1 -1
  68. package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts +0 -7
  69. package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts.map +1 -1
  70. package/core/dist/runtime/internalization/rollout-reviewer-runner.js +13 -68
  71. package/core/dist/runtime/internalization/rollout-reviewer-runner.js.map +1 -1
  72. package/core/dist/runtime/internalization/successor-create.d.ts +69 -0
  73. package/core/dist/runtime/internalization/successor-create.d.ts.map +1 -0
  74. package/core/dist/runtime/internalization/successor-create.js +173 -0
  75. package/core/dist/runtime/internalization/successor-create.js.map +1 -0
  76. package/core/dist/runtime/internalization/successor-lookup.d.ts +50 -0
  77. package/core/dist/runtime/internalization/successor-lookup.d.ts.map +1 -0
  78. package/core/dist/runtime/internalization/successor-lookup.js +213 -0
  79. package/core/dist/runtime/internalization/successor-lookup.js.map +1 -0
  80. package/core/dist/runtime/runner/succeeded-result-recovery.d.ts +58 -0
  81. package/core/dist/runtime/runner/succeeded-result-recovery.d.ts.map +1 -0
  82. package/core/dist/runtime/runner/succeeded-result-recovery.js +117 -0
  83. package/core/dist/runtime/runner/succeeded-result-recovery.js.map +1 -0
  84. package/core/dist/runtime/store/runtime-state-manager.d.ts +1 -0
  85. package/core/dist/runtime/store/runtime-state-manager.d.ts.map +1 -1
  86. package/core/dist/runtime/store/runtime-state-manager.js +4 -0
  87. package/core/dist/runtime/store/runtime-state-manager.js.map +1 -1
  88. package/core/dist/runtime/store/task/memory-task-store.d.ts +3 -3
  89. package/core/dist/runtime/store/task/memory-task-store.d.ts.map +1 -1
  90. package/core/dist/runtime/store/task/memory-task-store.js +52 -0
  91. package/core/dist/runtime/store/task/memory-task-store.js.map +1 -1
  92. package/core/dist/runtime/store/task/sqlite-task-store.d.ts +3 -0
  93. package/core/dist/runtime/store/task/sqlite-task-store.d.ts.map +1 -1
  94. package/core/dist/runtime/store/task/sqlite-task-store.js +204 -135
  95. package/core/dist/runtime/store/task/sqlite-task-store.js.map +1 -1
  96. package/core/dist/runtime/store/task/task-store.d.ts +17 -0
  97. package/core/dist/runtime/store/task/task-store.d.ts.map +1 -1
  98. package/core/dist/telemetry-event.d.ts +2 -2
  99. package/core/dist/telemetry-event.d.ts.map +1 -1
  100. package/core/dist/telemetry-event.js +4 -0
  101. package/core/dist/telemetry-event.js.map +1 -1
  102. package/core/package.json +1 -1
  103. package/dist/index.js +1 -1
  104. package/dist/index.js.map +1 -1
  105. package/dist/installer.d.ts +69 -11
  106. package/dist/installer.d.ts.map +1 -1
  107. package/dist/installer.js +432 -120
  108. package/dist/installer.js.map +1 -1
  109. package/dist/service-host-bridge.d.ts +0 -5
  110. package/dist/service-host-bridge.d.ts.map +1 -1
  111. package/dist/service-host-bridge.js.map +1 -1
  112. package/dist/service-host-provisioning.d.ts +123 -18
  113. package/dist/service-host-provisioning.d.ts.map +1 -1
  114. package/dist/service-host-provisioning.js +645 -77
  115. package/dist/service-host-provisioning.js.map +1 -1
  116. package/dist/utils/env.d.ts +9 -0
  117. package/dist/utils/env.d.ts.map +1 -1
  118. package/dist/utils/env.js +269 -49
  119. package/dist/utils/env.js.map +1 -1
  120. package/host-runtime/dist/codex-worker-status.d.ts +6 -4
  121. package/host-runtime/dist/codex-worker-status.js +7 -5
  122. package/host-runtime/dist/diagnostician-auto-run.js +2 -2
  123. package/host-runtime/dist/governance-signal-admission.d.ts +2 -1
  124. package/host-runtime/dist/governance-signal-admission.js +2 -1
  125. package/host-runtime/dist/index.d.ts +4 -2
  126. package/host-runtime/dist/index.js +6 -2
  127. package/host-runtime/dist/internalization-consumer-cycle.d.ts +13 -106
  128. package/host-runtime/dist/internalization-consumer-cycle.js +21 -99
  129. package/host-runtime/dist/internalization-consumer-governance.d.ts +3 -3
  130. package/host-runtime/dist/internalization-consumer-governance.js +17 -96
  131. package/host-runtime/dist/internalization-task-executor.d.ts +127 -0
  132. package/host-runtime/dist/internalization-task-executor.js +121 -0
  133. package/host-runtime/dist/workbuddy-worker-status.d.ts +6 -3
  134. package/host-runtime/dist/workbuddy-worker-status.js +7 -4
  135. package/host-runtime/dist/workspace-telemetry-emitter.js +1 -1
  136. package/host-runtime/package.json +1 -1
  137. package/install-layout/dist/background-execution-transition.d.ts +25 -29
  138. package/install-layout/dist/background-execution-transition.js +90 -138
  139. package/install-layout/dist/index.d.ts +45 -33
  140. package/install-layout/dist/index.js +24 -18
  141. package/install-layout/package.json +1 -1
  142. package/package.json +5 -4
  143. package/pd-cli/dist/commands/codex-worker.d.ts +7 -3
  144. package/pd-cli/dist/commands/codex-worker.d.ts.map +1 -1
  145. package/pd-cli/dist/commands/codex-worker.js +125 -101
  146. package/pd-cli/dist/commands/codex-worker.js.map +1 -1
  147. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts.map +1 -1
  148. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js +148 -130
  149. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js.map +1 -1
  150. package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
  151. package/pd-cli/dist/commands/runtime-internalization-run-once.js +4 -0
  152. package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
  153. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.js +1 -1
  154. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.js.map +1 -1
  155. package/pd-cli/dist/commands/service-run-once.d.ts +12 -27
  156. package/pd-cli/dist/commands/service-run-once.d.ts.map +1 -1
  157. package/pd-cli/dist/commands/service-run-once.js +15 -206
  158. package/pd-cli/dist/commands/service-run-once.js.map +1 -1
  159. package/pd-cli/dist/commands/workbuddy-worker.d.ts +7 -2
  160. package/pd-cli/dist/commands/workbuddy-worker.d.ts.map +1 -1
  161. package/pd-cli/dist/commands/workbuddy-worker.js +133 -99
  162. package/pd-cli/dist/commands/workbuddy-worker.js.map +1 -1
  163. package/pd-cli/dist/commands/worker-service-host-gate.d.ts +38 -0
  164. package/pd-cli/dist/commands/worker-service-host-gate.d.ts.map +1 -0
  165. package/pd-cli/dist/commands/worker-service-host-gate.js +110 -0
  166. package/pd-cli/dist/commands/worker-service-host-gate.js.map +1 -0
  167. package/pd-cli/dist/program.d.ts.map +1 -1
  168. package/pd-cli/dist/program.js +20 -84
  169. package/pd-cli/dist/program.js.map +1 -1
  170. package/pd-cli/dist/services/rulehost-pipeline-runner.d.ts.map +1 -1
  171. package/pd-cli/dist/services/rulehost-pipeline-runner.js +198 -142
  172. package/pd-cli/dist/services/rulehost-pipeline-runner.js.map +1 -1
  173. package/pd-cli/dist/services/service-host/coordinator-common.d.ts.map +1 -1
  174. package/pd-cli/dist/services/service-host/coordinator-common.js +4 -5
  175. package/pd-cli/dist/services/service-host/coordinator-common.js.map +1 -1
  176. package/pd-cli/dist/services/service-host/index.d.ts +7 -10
  177. package/pd-cli/dist/services/service-host/index.d.ts.map +1 -1
  178. package/pd-cli/dist/services/service-host/index.js +8 -11
  179. package/pd-cli/dist/services/service-host/index.js.map +1 -1
  180. package/pd-cli/dist/services/service-host/install-identity.d.ts +5 -5
  181. package/pd-cli/dist/services/service-host/managed-run.d.ts.map +1 -1
  182. package/pd-cli/dist/services/service-host/managed-run.js +19 -22
  183. package/pd-cli/dist/services/service-host/managed-run.js.map +1 -1
  184. package/pd-cli/dist/services/service-host/scheduler/linux.d.ts.map +1 -1
  185. package/pd-cli/dist/services/service-host/scheduler/linux.js +21 -2
  186. package/pd-cli/dist/services/service-host/scheduler/linux.js.map +1 -1
  187. package/pd-cli/dist/services/service-host/scheduler/service-status.d.ts +1 -1
  188. package/pd-cli/dist/services/service-host/scheduler/service-status.d.ts.map +1 -1
  189. package/pd-cli/dist/services/service-host/scheduler/service-status.js +0 -2
  190. package/pd-cli/dist/services/service-host/scheduler/service-status.js.map +1 -1
  191. package/pd-cli/dist/services/service-host/status/service-run-status.d.ts +7 -51
  192. package/pd-cli/dist/services/service-host/status/service-run-status.d.ts.map +1 -1
  193. package/pd-cli/dist/services/service-host/status/service-run-status.js.map +1 -1
  194. package/pd-cli/dist/services/service-host/worker-adapter-openclaw.js +3 -3
  195. package/pd-cli/dist/services/service-host/worker-adapter.d.ts +0 -10
  196. package/pd-cli/dist/services/service-host/worker-adapter.d.ts.map +1 -1
  197. package/pd-cli/dist/services/service-host/worker-adapter.js +4 -12
  198. package/pd-cli/dist/services/service-host/worker-adapter.js.map +1 -1
  199. package/pd-cli/dist/services/service-host/worker-env.d.ts +1 -1
  200. package/pd-cli/dist/services/service-host/workspace-dispatch.d.ts +5 -7
  201. package/pd-cli/dist/services/service-host/workspace-dispatch.d.ts.map +1 -1
  202. package/pd-cli/dist/services/service-host/workspace-dispatch.js +1 -3
  203. package/pd-cli/dist/services/service-host/workspace-dispatch.js.map +1 -1
  204. package/pd-cli/package.json +1 -1
  205. package/plugin/dist/bundle.js +616 -1319
  206. package/plugin/dist/core/openclaw-tool-declaration.d.ts +13 -0
  207. package/plugin/dist/index.d.ts +0 -9
  208. package/plugin/dist/openclaw-worker.d.ts +21 -8
  209. package/plugin/dist/openclaw-worker.js +267 -267
  210. package/plugin/dist/openclaw.plugin.json +1 -1
  211. package/plugin/openclaw.plugin.json +1 -1
  212. package/plugin/package.json +1 -1
  213. package/release-manager/dist/installer.js +432 -120
  214. package/release-manager/dist/service-host-provisioning.js +645 -77
  215. package/release-manager/dist/utils/env.js +269 -49
  216. package/release-manager/package.json +3 -2
  217. package/workbuddy-adapter/dist/worker/workspace-worker.d.ts +9 -1
  218. package/workbuddy-adapter/dist/worker/workspace-worker.js +21 -9
  219. package/workbuddy-adapter/package.json +1 -1
  220. package/pd-cli/dist/commands/service-handover.d.ts +0 -12
  221. package/pd-cli/dist/commands/service-handover.d.ts.map +0 -1
  222. package/pd-cli/dist/commands/service-handover.js +0 -117
  223. package/pd-cli/dist/commands/service-handover.js.map +0 -1
  224. package/pd-cli/dist/commands/worker-drain.d.ts +0 -7
  225. package/pd-cli/dist/commands/worker-drain.d.ts.map +0 -1
  226. package/pd-cli/dist/commands/worker-drain.js +0 -51
  227. package/pd-cli/dist/commands/worker-drain.js.map +0 -1
  228. package/pd-cli/dist/services/service-host/handover-claims.d.ts +0 -14
  229. package/pd-cli/dist/services/service-host/handover-claims.d.ts.map +0 -1
  230. package/pd-cli/dist/services/service-host/handover-claims.js +0 -50
  231. package/pd-cli/dist/services/service-host/handover-claims.js.map +0 -1
  232. package/pd-cli/dist/services/service-host/shadow-run.d.ts +0 -87
  233. package/pd-cli/dist/services/service-host/shadow-run.d.ts.map +0 -1
  234. package/pd-cli/dist/services/service-host/shadow-run.js +0 -549
  235. package/pd-cli/dist/services/service-host/shadow-run.js.map +0 -1
  236. package/pd-cli/dist/services/service-host/workspace-handover.d.ts +0 -190
  237. package/pd-cli/dist/services/service-host/workspace-handover.d.ts.map +0 -1
  238. package/pd-cli/dist/services/service-host/workspace-handover.js +0 -1393
  239. package/pd-cli/dist/services/service-host/workspace-handover.js.map +0 -1
  240. package/plugin/dist/service/gateway-consumer-lease.d.ts +0 -142
  241. package/plugin/dist/service/gateway-quiesce-ack.d.ts +0 -40
  242. package/plugin/dist/service/internalization-auto-consumer-service.d.ts +0 -100
@@ -1,51 +0,0 @@
1
- /** Private Companion IPC. Stops between cycles; never interrupts an active cycle. */
2
- export function createWorkerDrain() {
3
- let stopped = false;
4
- let wake;
5
- const stop = () => { stopped = true; wake?.(); };
6
- const onMessage = (value) => {
7
- if (value !== null && typeof value === 'object'
8
- && Object.hasOwn(value, 'type') && Reflect.get(value, 'type') === 'pd.worker.drain.v1')
9
- stop();
10
- };
11
- process.on('SIGINT', stop);
12
- process.on('SIGTERM', stop);
13
- // Other hosts (including test runners) also use Node IPC; they do not opt
14
- // into Companion's private lifecycle protocol.
15
- const managedIpc = process.env.PD_COMPANION_WORKER_IPC === '1';
16
- if (managedIpc && process.send !== undefined) {
17
- process.on('message', onMessage);
18
- const reportUnavailable = () => { console.error('[PD:Worker] drain IPC unavailable; safely restart Companion after the current cycle.'); };
19
- try {
20
- process.send({ type: 'pd.worker.drain-ready.v1' }, (error) => { if (error !== null)
21
- reportUnavailable(); });
22
- }
23
- catch {
24
- reportUnavailable();
25
- }
26
- }
27
- return {
28
- get stopped() { return stopped; },
29
- async wait(interval) {
30
- if (stopped)
31
- return;
32
- await new Promise((resolve) => {
33
- let timer;
34
- const done = () => { clearTimeout(timer); wake = undefined; resolve(); };
35
- timer = setTimeout(done, interval);
36
- wake = done;
37
- if (stopped)
38
- done();
39
- });
40
- },
41
- dispose() {
42
- process.off('SIGINT', stop);
43
- process.off('SIGTERM', stop);
44
- process.off('message', onMessage);
45
- // An open IPC channel must not keep a drained CLI alive.
46
- if (managedIpc && process.send !== undefined && process.connected)
47
- process.disconnect?.();
48
- },
49
- };
50
- }
51
- //# sourceMappingURL=worker-drain.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker-drain.js","sourceRoot":"","sources":["../../src/commands/worker-drain.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,MAAM,UAAU,iBAAiB;IAC/B,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,IAA8B,CAAC;IACnC,MAAM,IAAI,GAAG,GAAS,EAAE,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,CAAC,KAAc,EAAQ,EAAE;QACzC,IAAI,KAAK,KAAK,IAAI,IAAI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AAG,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;gBAC/E,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;gBACnC,IAAI,GAAG,IAAI,CAAC;gBACZ,IAAI,OAAO;oBAAE,IAAI,EAAE,CAAC;YACtB,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO;YACL,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC5B,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;YAC7B,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YAClC,yDAAyD;YACzD,IAAI,UAAU,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,CAAC,SAAS;gBAAE,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;QAC5F,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,50 +0,0 @@
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
@@ -1 +0,0 @@
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,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,YAAY,EAAE,6BAA6B,EAAE,mBAA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C,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"}
@@ -1,87 +0,0 @@
1
- import { type HostClaimReaders } from '@principles/install-layout';
2
- import { type InstallIdentity } from './install-identity.js';
3
- import { type WorkspaceDiscoveryResult } from './workspace-discovery.js';
4
- import { type HolderLiveness, type ReleaseServiceRunLockResult, type ServiceRunLockHandle } from './locking/service-run-lock.js';
5
- import { type ActiveReleaseFacts, type ServiceRunStatus, type ShadowExecutionRecord } from './status/service-run-status.js';
6
- import type { resolveActiveReleaseCliEntry } from './worker-adapter.js';
7
- import { type ShadowHostKind, type WorkerHostKind, type WorkerAdapter } from './worker-adapter.js';
8
- import type { WorkerProcessOptions, WorkerProcessResult } from './worker-process.js';
9
- /**
10
- * Default per-workspace bound. The Codex worker's own stage deadlines sum to
11
- * ~40 minutes (catch-up 5 + reconcile 5 + diagnosis 15 + post-processing 5 +
12
- * downstream 10 + stage-2), so 45 minutes bounds one full cycle with margin
13
- * without letting a hung child outlive the coordinator.
14
- */
15
- export declare const DEFAULT_SHADOW_WORKSPACE_TIMEOUT_MS: number;
16
- export interface ShadowRunProbes {
17
- readonly processAlive?: (pid: number) => HolderLiveness;
18
- readonly holdsLock?: (handle: ServiceRunLockHandle) => boolean;
19
- readonly releaseLock?: (handle: ServiceRunLockHandle) => ReleaseServiceRunLockResult;
20
- readonly listDir?: (dir: string) => 'readable' | 'missing' | 'not_directory' | 'unreadable';
21
- readonly claimReaders?: HostClaimReaders;
22
- /** Subprocess boundary injection forwarded to every adapter execution. */
23
- readonly spawnWorkerProcess?: (options: WorkerProcessOptions) => Promise<WorkerProcessResult>;
24
- /** CLI-entry resolution injection (integration tests; prod = active release). */
25
- readonly resolveCliEntry?: typeof resolveActiveReleaseCliEntry;
26
- readonly now?: () => Date;
27
- /** Adapter overrides (unit tests). */
28
- readonly adapters?: Readonly<Partial<Record<WorkerHostKind, WorkerAdapter>>>;
29
- }
30
- export interface ShadowRunOptions {
31
- readonly env?: Readonly<Record<string, string | undefined>>;
32
- readonly trustedHomeDir?: string;
33
- /** Explicit workspace selections — REQUIRED, never defaulted to "all discovered". */
34
- readonly workspaces: readonly string[];
35
- /** Restrict to one host adapter (default: every bound adapter runs). Shadow hosts only — openclaw is managed-mode only. */
36
- readonly hostFilter?: ShadowHostKind;
37
- readonly timeoutMs?: number;
38
- readonly signal?: AbortSignal;
39
- readonly probes?: ShadowRunProbes;
40
- }
41
- export type ShadowRunResult = {
42
- readonly ok: true;
43
- readonly outcome: 'completed';
44
- readonly runId: string;
45
- readonly identity: InstallIdentity;
46
- readonly activeRelease: ActiveReleaseFacts;
47
- readonly manifest: ServiceRunStatus['manifest'];
48
- readonly discovery: WorkspaceDiscoveryResult;
49
- readonly executions: readonly ShadowExecutionRecord[];
50
- readonly statusWrite: {
51
- readonly ok: true;
52
- readonly path: string;
53
- } | {
54
- readonly ok: false;
55
- readonly reason: string;
56
- readonly nextAction: string;
57
- };
58
- readonly status: ServiceRunStatus;
59
- } | {
60
- readonly ok: true;
61
- readonly outcome: 'already_running';
62
- readonly runId: string;
63
- readonly identity: InstallIdentity;
64
- readonly holderBodyHash: string;
65
- readonly reason: string;
66
- readonly nextAction: string;
67
- } | {
68
- readonly ok: false;
69
- readonly outcome: 'refused';
70
- readonly runId: string;
71
- readonly reason: string;
72
- readonly nextAction: string;
73
- readonly statusWrite?: {
74
- readonly ok: true;
75
- readonly path: string;
76
- } | {
77
- readonly ok: false;
78
- readonly reason: string;
79
- readonly nextAction: string;
80
- };
81
- };
82
- /**
83
- * Execute one bounded shadow run. Never throws for expected refusals —
84
- * everything expected is a structured result (rc-9).
85
- */
86
- export declare function runServiceShadowOnce(options: ShadowRunOptions): Promise<ShadowRunResult>;
87
- //# sourceMappingURL=shadow-run.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shadow-run.d.ts","sourceRoot":"","sources":["../../../src/services/service-host/shadow-run.ts"],"names":[],"mappings":"AA8BA,OAAO,EAA0D,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE3H,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAoD,KAAK,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAiB3H,OAAO,EAKL,KAAK,cAAc,EACnB,KAAK,2BAA2B,EAChC,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAGL,KAAK,kBAAkB,EAEvB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAEV,4BAA4B,EAC7B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAqB,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAMtH,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAIrF;;;;;GAKG;AACH,eAAO,MAAM,mCAAmC,QAAc,CAAC;AAG/D,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,cAAc,CAAC;IACxD,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,KAAK,OAAO,CAAC;IAC/D,QAAQ,C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