create-principles-disciple 1.155.3 → 1.156.0

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 (247) hide show
  1. package/_release/product-identity.json +2 -2
  2. package/codex-adapter/dist/ingestion/pain-receipt-fallback.d.ts +28 -1
  3. package/codex-adapter/dist/ingestion/pain-receipt-fallback.js +53 -17
  4. package/codex-adapter/dist/worker/workspace-worker.js +86 -66
  5. package/codex-adapter/package.json +1 -1
  6. package/console/dist/server/index.d.ts +11 -1
  7. package/console/dist/server/index.js +84 -19
  8. package/console/dist/server/release-handover.d.ts +256 -0
  9. package/console/dist/server/release-handover.js +402 -0
  10. package/console/dist/server/routes/onboarding.js +1 -0
  11. package/console/dist/server/routes/update-transaction.js +37 -3
  12. package/console/dist/server/routes/update.js +21 -1
  13. package/console/dist/server/successor.d.ts +46 -0
  14. package/console/dist/server/successor.js +128 -0
  15. package/console/dist/web/assets/app.css +18 -0
  16. package/console/dist/web/assets/app.js +32 -31
  17. package/console/package.json +1 -1
  18. package/core/dist/runtime/candidate-intake-service.d.ts +1 -1
  19. package/core/dist/runtime/candidate-intake-service.d.ts.map +1 -1
  20. package/core/dist/runtime/candidate-intake-service.js +89 -12
  21. package/core/dist/runtime/candidate-intake-service.js.map +1 -1
  22. package/core/dist/runtime/context-payload.d.ts +11 -0
  23. package/core/dist/runtime/context-payload.d.ts.map +1 -1
  24. package/core/dist/runtime/context-payload.js +27 -0
  25. package/core/dist/runtime/context-payload.js.map +1 -1
  26. package/core/dist/runtime/host-submission-context.d.ts +13 -6
  27. package/core/dist/runtime/host-submission-context.d.ts.map +1 -1
  28. package/core/dist/runtime/host-submission-context.js +77 -8
  29. package/core/dist/runtime/host-submission-context.js.map +1 -1
  30. package/core/dist/runtime/index.d.ts +2 -1
  31. package/core/dist/runtime/index.d.ts.map +1 -1
  32. package/core/dist/runtime/index.js +8 -0
  33. package/core/dist/runtime/index.js.map +1 -1
  34. package/core/dist/runtime/pain-ingress.d.ts +8 -0
  35. package/core/dist/runtime/pain-ingress.d.ts.map +1 -1
  36. package/core/dist/runtime/pain-ingress.js +8 -1
  37. package/core/dist/runtime/pain-ingress.js.map +1 -1
  38. package/core/dist/runtime/pain-recall-read-model.d.ts +72 -0
  39. package/core/dist/runtime/pain-recall-read-model.d.ts.map +1 -1
  40. package/core/dist/runtime/pain-recall-read-model.js +46 -21
  41. package/core/dist/runtime/pain-recall-read-model.js.map +1 -1
  42. package/core/dist/runtime/pain-receipt-recovery.d.ts +4 -1
  43. package/core/dist/runtime/pain-receipt-recovery.d.ts.map +1 -1
  44. package/core/dist/runtime/pain-receipt-recovery.js +28 -10
  45. package/core/dist/runtime/pain-receipt-recovery.js.map +1 -1
  46. package/core/dist/runtime/pain-signal-bridge.d.ts +38 -23
  47. package/core/dist/runtime/pain-signal-bridge.d.ts.map +1 -1
  48. package/core/dist/runtime/pain-signal-bridge.js +533 -182
  49. package/core/dist/runtime/pain-signal-bridge.js.map +1 -1
  50. package/core/dist/runtime/pain-signal-runtime-factory.d.ts +8 -1
  51. package/core/dist/runtime/pain-signal-runtime-factory.d.ts.map +1 -1
  52. package/core/dist/runtime/pain-signal-runtime-factory.js +196 -25
  53. package/core/dist/runtime/pain-signal-runtime-factory.js.map +1 -1
  54. package/core/dist/runtime/pain-target-evidence-reconcile.d.ts +78 -4
  55. package/core/dist/runtime/pain-target-evidence-reconcile.d.ts.map +1 -1
  56. package/core/dist/runtime/pain-target-evidence-reconcile.js +229 -18
  57. package/core/dist/runtime/pain-target-evidence-reconcile.js.map +1 -1
  58. package/core/dist/runtime/pain-to-principle-service.d.ts +26 -5
  59. package/core/dist/runtime/pain-to-principle-service.d.ts.map +1 -1
  60. package/core/dist/runtime/pain-to-principle-service.js +63 -52
  61. package/core/dist/runtime/pain-to-principle-service.js.map +1 -1
  62. package/core/dist/runtime/store/candidate/admission-document.d.ts +43 -0
  63. package/core/dist/runtime/store/candidate/admission-document.d.ts.map +1 -1
  64. package/core/dist/runtime/store/candidate/admission-document.js +130 -0
  65. package/core/dist/runtime/store/candidate/admission-document.js.map +1 -1
  66. package/core/dist/runtime/store/candidate/candidate-store.d.ts +3 -1
  67. package/core/dist/runtime/store/candidate/candidate-store.d.ts.map +1 -1
  68. package/core/dist/runtime/store/candidate/memory-candidate-store.d.ts +2 -1
  69. package/core/dist/runtime/store/candidate/memory-candidate-store.d.ts.map +1 -1
  70. package/core/dist/runtime/store/candidate/memory-candidate-store.js +27 -1
  71. package/core/dist/runtime/store/candidate/memory-candidate-store.js.map +1 -1
  72. package/core/dist/runtime/store/candidate/sqlite-candidate-store.d.ts +2 -1
  73. package/core/dist/runtime/store/candidate/sqlite-candidate-store.d.ts.map +1 -1
  74. package/core/dist/runtime/store/candidate/sqlite-candidate-store.js +59 -2
  75. package/core/dist/runtime/store/candidate/sqlite-candidate-store.js.map +1 -1
  76. package/core/dist/runtime/store/context/sqlite-context-assembler.d.ts.map +1 -1
  77. package/core/dist/runtime/store/context/sqlite-context-assembler.js +18 -3
  78. package/core/dist/runtime/store/context/sqlite-context-assembler.js.map +1 -1
  79. package/core/dist/runtime/store/runtime-state-manager.d.ts +2 -1
  80. package/core/dist/runtime/store/runtime-state-manager.d.ts.map +1 -1
  81. package/core/dist/runtime/store/runtime-state-manager.js +4 -0
  82. package/core/dist/runtime/store/runtime-state-manager.js.map +1 -1
  83. package/core/dist/telemetry-event.d.ts +2 -2
  84. package/core/dist/telemetry-event.d.ts.map +1 -1
  85. package/core/dist/telemetry-event.js +5 -0
  86. package/core/dist/telemetry-event.js.map +1 -1
  87. package/core/package.json +1 -1
  88. package/dist/i18n.d.ts.map +1 -1
  89. package/dist/i18n.js +72 -0
  90. package/dist/i18n.js.map +1 -1
  91. package/dist/index.d.ts +15 -0
  92. package/dist/index.d.ts.map +1 -1
  93. package/dist/index.js +145 -35
  94. package/dist/index.js.map +1 -1
  95. package/dist/installer.d.ts +149 -9
  96. package/dist/installer.d.ts.map +1 -1
  97. package/dist/installer.js +542 -31
  98. package/dist/installer.js.map +1 -1
  99. package/dist/installers/codex-host-installer.js +1 -1
  100. package/dist/installers/codex-host-installer.js.map +1 -1
  101. package/dist/installers/index.d.ts +10 -0
  102. package/dist/installers/index.d.ts.map +1 -1
  103. package/dist/installers/index.js +4 -0
  104. package/dist/installers/index.js.map +1 -1
  105. package/dist/mvp-config.js +1 -1
  106. package/dist/mvp-config.js.map +1 -1
  107. package/dist/prompts.d.ts +36 -12
  108. package/dist/prompts.d.ts.map +1 -1
  109. package/dist/prompts.js +102 -30
  110. package/dist/prompts.js.map +1 -1
  111. package/dist/service-host-bridge.d.ts +71 -12
  112. package/dist/service-host-bridge.d.ts.map +1 -1
  113. package/dist/service-host-bridge.js +228 -48
  114. package/dist/service-host-bridge.js.map +1 -1
  115. package/dist/service-host-provisioning.d.ts +102 -0
  116. package/dist/service-host-provisioning.d.ts.map +1 -0
  117. package/dist/service-host-provisioning.js +595 -0
  118. package/dist/service-host-provisioning.js.map +1 -0
  119. package/dist/uninstaller.js +1 -1
  120. package/dist/uninstaller.js.map +1 -1
  121. package/dist/update/apply-payload.d.ts +9 -0
  122. package/dist/update/apply-payload.d.ts.map +1 -1
  123. package/dist/update/apply-payload.js +44 -2
  124. package/dist/update/apply-payload.js.map +1 -1
  125. package/dist/update/console-surface.d.ts +2 -1
  126. package/dist/update/console-surface.d.ts.map +1 -1
  127. package/dist/update/console-surface.js +6 -1
  128. package/dist/update/console-surface.js.map +1 -1
  129. package/dist/update/install-layout.d.ts +12 -0
  130. package/dist/update/install-layout.d.ts.map +1 -1
  131. package/dist/update/install-layout.js +49 -7
  132. package/dist/update/install-layout.js.map +1 -1
  133. package/dist/update/release-manager-authority.d.ts +16 -0
  134. package/dist/update/release-manager-authority.d.ts.map +1 -1
  135. package/dist/update/release-manager-authority.js +45 -3
  136. package/dist/update/release-manager-authority.js.map +1 -1
  137. package/dist/update/release-manager.d.ts +8 -3
  138. package/dist/update/release-manager.d.ts.map +1 -1
  139. package/dist/update/release-manager.js +29 -1
  140. package/dist/update/release-manager.js.map +1 -1
  141. package/dist/update/transaction-progress.d.ts +63 -0
  142. package/dist/update/transaction-progress.d.ts.map +1 -0
  143. package/dist/update/transaction-progress.js +207 -0
  144. package/dist/update/transaction-progress.js.map +1 -0
  145. package/dist/utils/env.d.ts +16 -1
  146. package/dist/utils/env.d.ts.map +1 -1
  147. package/dist/utils/env.js +55 -43
  148. package/dist/utils/env.js.map +1 -1
  149. package/host-runtime/dist/diagnostician-auto-run.js +37 -31
  150. package/host-runtime/dist/governance-observation-store.d.ts +38 -0
  151. package/host-runtime/dist/governance-observation-store.js +41 -0
  152. package/host-runtime/dist/governance-trajectory-turn-reader.js +26 -33
  153. package/host-runtime/package.json +1 -1
  154. package/install-layout/dist/background-execution-transition.d.ts +11 -1
  155. package/install-layout/dist/background-execution-transition.js +45 -1
  156. package/install-layout/dist/index.d.ts +3 -3
  157. package/install-layout/dist/index.js +10 -4
  158. package/install-layout/dist/pd-home.d.ts +12 -0
  159. package/install-layout/dist/pd-home.js +6 -1
  160. package/install-layout/package.json +1 -1
  161. package/package.json +7 -7
  162. package/pd-cli/dist/commands/candidate.d.ts +15 -0
  163. package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
  164. package/pd-cli/dist/commands/candidate.js +449 -93
  165. package/pd-cli/dist/commands/candidate.js.map +1 -1
  166. package/pd-cli/dist/commands/console.d.ts.map +1 -1
  167. package/pd-cli/dist/commands/console.js +10 -0
  168. package/pd-cli/dist/commands/console.js.map +1 -1
  169. package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
  170. package/pd-cli/dist/commands/diagnose.js +254 -160
  171. package/pd-cli/dist/commands/diagnose.js.map +1 -1
  172. package/pd-cli/dist/commands/intake-outcome-guidance.d.ts +57 -0
  173. package/pd-cli/dist/commands/intake-outcome-guidance.d.ts.map +1 -0
  174. package/pd-cli/dist/commands/intake-outcome-guidance.js +206 -0
  175. package/pd-cli/dist/commands/intake-outcome-guidance.js.map +1 -0
  176. package/pd-cli/dist/commands/mcp-probe.d.ts.map +1 -1
  177. package/pd-cli/dist/commands/mcp-probe.js +1 -0
  178. package/pd-cli/dist/commands/mcp-probe.js.map +1 -1
  179. package/pd-cli/dist/commands/pain-record.d.ts.map +1 -1
  180. package/pd-cli/dist/commands/pain-record.js +18 -4
  181. package/pd-cli/dist/commands/pain-record.js.map +1 -1
  182. package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
  183. package/pd-cli/dist/commands/pain-retry.js +91 -21
  184. package/pd-cli/dist/commands/pain-retry.js.map +1 -1
  185. package/pd-cli/dist/commands/runtime-uat.d.ts.map +1 -1
  186. package/pd-cli/dist/commands/runtime-uat.js +1 -0
  187. package/pd-cli/dist/commands/runtime-uat.js.map +1 -1
  188. package/pd-cli/dist/commands/service-lifecycle.js +1 -1
  189. package/pd-cli/dist/commands/service-lifecycle.js.map +1 -1
  190. package/pd-cli/dist/commands/service-run-once.d.ts +1 -1
  191. package/pd-cli/dist/commands/service-run-once.d.ts.map +1 -1
  192. package/pd-cli/dist/commands/service-run-once.js +9 -5
  193. package/pd-cli/dist/commands/service-run-once.js.map +1 -1
  194. package/pd-cli/dist/program.d.ts.map +1 -1
  195. package/pd-cli/dist/program.js +14 -3
  196. package/pd-cli/dist/program.js.map +1 -1
  197. package/pd-cli/dist/services/admission-write-gate.d.ts +4 -0
  198. package/pd-cli/dist/services/admission-write-gate.d.ts.map +1 -1
  199. package/pd-cli/dist/services/admission-write-gate.js +50 -48
  200. package/pd-cli/dist/services/admission-write-gate.js.map +1 -1
  201. package/pd-cli/dist/services/console-launcher.js +3 -3
  202. package/pd-cli/dist/services/console-launcher.js.map +1 -1
  203. package/pd-cli/dist/services/service-host/managed-run.d.ts.map +1 -1
  204. package/pd-cli/dist/services/service-host/managed-run.js +25 -8
  205. package/pd-cli/dist/services/service-host/managed-run.js.map +1 -1
  206. package/pd-cli/dist/services/service-host/scheduler/service-status.d.ts +12 -0
  207. package/pd-cli/dist/services/service-host/scheduler/service-status.d.ts.map +1 -1
  208. package/pd-cli/dist/services/service-host/scheduler/service-status.js +16 -7
  209. package/pd-cli/dist/services/service-host/scheduler/service-status.js.map +1 -1
  210. package/pd-cli/dist/services/service-host/status/service-run-status.d.ts +7 -5
  211. package/pd-cli/dist/services/service-host/status/service-run-status.d.ts.map +1 -1
  212. package/pd-cli/dist/services/service-host/status/service-run-status.js +1 -1
  213. package/pd-cli/dist/services/service-host/status/service-run-status.js.map +1 -1
  214. package/pd-cli/package.json +1 -1
  215. package/pd-mcp-server/dist/submit-assembly.js +61 -18
  216. package/pd-mcp-server/dist/version.d.ts +1 -1
  217. package/pd-mcp-server/dist/version.js +1 -1
  218. package/pd-mcp-server/package.json +1 -1
  219. package/plugin/dist/bundle.js +493 -493
  220. package/plugin/dist/openclaw-worker.js +263 -263
  221. package/plugin/dist/openclaw.plugin.json +1 -1
  222. package/plugin/openclaw.plugin.json +1 -1
  223. package/plugin/package.json +1 -1
  224. package/release-manager/dist/i18n.js +72 -0
  225. package/release-manager/dist/installer.js +542 -31
  226. package/release-manager/dist/installers/codex-host-installer.js +1 -1
  227. package/release-manager/dist/installers/index.js +4 -0
  228. package/release-manager/dist/mvp-config.js +1 -1
  229. package/release-manager/dist/service-host-bridge.js +228 -48
  230. package/release-manager/dist/service-host-provisioning.js +595 -0
  231. package/release-manager/dist/update/apply-payload.js +44 -2
  232. package/release-manager/dist/update/console-surface.js +6 -1
  233. package/release-manager/dist/update/install-layout.js +49 -7
  234. package/release-manager/dist/update/release-manager-authority.js +45 -3
  235. package/release-manager/dist/update/release-manager.js +29 -1
  236. package/release-manager/dist/update/transaction-progress.js +207 -0
  237. package/release-manager/dist/utils/env.js +55 -43
  238. package/release-manager/package.json +5 -5
  239. package/workbuddy-adapter/dist/codec/input-decoder.d.ts +21 -0
  240. package/workbuddy-adapter/dist/codec/input-decoder.js +50 -1
  241. package/workbuddy-adapter/dist/ingestion/pain-receipt-fallback.d.ts +68 -0
  242. package/workbuddy-adapter/dist/ingestion/pain-receipt-fallback.js +225 -0
  243. package/workbuddy-adapter/dist/pd-hook.js +60 -0
  244. package/workbuddy-adapter/dist/worker/workspace-worker.js +46 -44
  245. package/workbuddy-adapter/package.json +1 -1
  246. package/console/dist/server/utils/gateway.d.ts +0 -29
  247. package/console/dist/server/utils/gateway.js +0 -175
@@ -587,6 +587,7 @@ export function readWorkspaceBackgroundOwnership(options) {
587
587
  }
588
588
  // ─── Transitions ────────────────────────────────────────────────────────────
589
589
  export const BACKGROUND_EXECUTION_TRANSITIONS = [
590
+ 'provision_fresh_install',
590
591
  'begin_handover',
591
592
  'abort_handover',
592
593
  'complete_handover',
@@ -595,6 +596,11 @@ export const BACKGROUND_EXECUTION_TRANSITIONS = [
595
596
  'abort_rollback',
596
597
  ];
597
598
  const TRANSITION_SPECS = {
599
+ // Fresh-install provisioning: a brand-new Workspace is born Service-Host
600
+ // owned in ONE atomic write (generation 0 → 1). There is no old consumer
601
+ // to quiesce, so the handover_preparing staging is not used; the caller
602
+ // still has to prove absence of history through the manifest itself.
603
+ provision_fresh_install: { from: ['legacy_owned'], to: 'service_host_owned', needsOperationId: false },
598
604
  // legacy_owned -> handover_preparing; effectiveOwner stays legacy (SPEC §8.4-3:
599
605
  // PREPARING grants no new rights — the old consumer remains the only one).
600
606
  begin_handover: { from: ['legacy_owned', 'handover_preparing'], to: 'handover_preparing', needsOperationId: true },
@@ -608,6 +614,8 @@ function buildTargetRecord(context) {
608
614
  const generation = context.currentGeneration + 1;
609
615
  const { operationId, nowIso } = context;
610
616
  switch (context.kind) {
617
+ case 'provision_fresh_install':
618
+ return { state: 'service_host_owned', effectiveOwner: 'service_host', generation, operationId: null, previousOwner: null, targetOwner: null, updatedAt: nowIso };
611
619
  case 'begin_handover':
612
620
  return { state: 'handover_preparing', effectiveOwner: 'legacy', generation, operationId, previousOwner: 'legacy', targetOwner: 'service_host', updatedAt: nowIso };
613
621
  case 'abort_handover':
@@ -709,7 +717,9 @@ export function transitionWorkspaceBackgroundExecution(input) {
709
717
  // because a marker key outside `workspaces[]` cannot parse back. An alias
710
718
  // registration for the same real directory counts as registered.
711
719
  const registered = identity.registeredAliases.length > 0;
712
- if (!registered && !(input.kind === 'begin_handover' && input.registerWorkspace === true)) {
720
+ const mayRegister = (input.kind === 'begin_handover' || input.kind === 'provision_fresh_install')
721
+ && input.registerWorkspace === true;
722
+ if (!registered && !mayRegister) {
713
723
  return {
714
724
  ok: false,
715
725
  reason: 'workspace_not_registered',
@@ -723,6 +733,40 @@ export function transitionWorkspaceBackgroundExecution(input) {
723
733
  const currentRecord = identity.records[0]?.record;
724
734
  const currentState = currentRecord?.state ?? 'legacy_owned';
725
735
  const currentGeneration = currentRecord?.generation ?? 0;
736
+ // Fresh-install provisioning is the ONE transition that skips the legacy
737
+ // handover staging, so its authorization must be proven here rather than
738
+ // trusted from the caller:
739
+ // - `freshInstall` must be explicitly asserted (a legacy upgrade that
740
+ // forgot it can never flip ownership silently);
741
+ // - the manifest must hold NO ownership record at all for this
742
+ // workspace (a `legacy_owned` RECORD is history — that workspace has
743
+ // been managed before and must go through begin_handover);
744
+ // - an already-provisioned workspace is an idempotent replay.
745
+ if (input.kind === 'provision_fresh_install') {
746
+ if (input.freshInstall !== true) {
747
+ return {
748
+ ok: false,
749
+ reason: 'invalid_input',
750
+ message: 'provision_fresh_install requires freshInstall=true; upgrades must use begin_handover so the legacy consumer is stopped and verified first',
751
+ nextAction: 'Use pd service handover for an existing workspace; fresh-install provisioning is install-time only.',
752
+ };
753
+ }
754
+ const alreadyOwned = currentRecord !== undefined
755
+ && currentState === 'service_host_owned'
756
+ && currentRecord.effectiveOwner === 'service_host';
757
+ if (alreadyOwned) {
758
+ return { ok: true, changed: false, record: currentRecord, previous: currentRecord };
759
+ }
760
+ if (currentRecord !== undefined) {
761
+ return {
762
+ ok: false,
763
+ reason: 'unexpected_state',
764
+ message: `workspace already carries a background-execution record (${currentState}, generation ${currentGeneration}); fresh-install provisioning refuses to overwrite history`,
765
+ nextAction: 'Use pd service handover (with legacy consumer quiesce) to move this workspace to the Service Host.',
766
+ current: projectOwnership(currentState, currentGeneration, currentRecord),
767
+ };
768
+ }
769
+ }
726
770
  if (input.expectedGeneration !== undefined && input.expectedGeneration !== currentGeneration) {
727
771
  return {
728
772
  ok: false,
@@ -46,8 +46,8 @@ export interface InstallManifest {
46
46
  * Host: only the state machine defined in the SPEC may advance an entry,
47
47
  * every transition is a monotonic-generation compare-and-set, and PID /
48
48
  * delays / startup order are NEVER ownership proof — this record is.
49
- * The schema stores the record; the CAS write itself is NOT implemented
50
- * yet (Phase 5 acceptance).
49
+ * The CAS write path and the state machine live in
50
+ * `background-execution-transition.ts` (Phase 4/5).
51
51
  */
52
52
  backgroundExecutions?: Readonly<Record<string, BackgroundExecutionRecord>>;
53
53
  }
@@ -259,7 +259,7 @@ export declare function getPdCliEntry(paths: InstallLayoutPaths, mode: InstallLa
259
259
  * authority for "which PD home does this process own" — components must not
260
260
  * re-derive it locally.
261
261
  */
262
- export { PD_EXPERIMENT_ROOT_ENV, PD_OPENCLAW_HOME_ENV, PD_OPENCLAW_STATE_DIR_ENV, PD_CODEX_HOME_ENV, PD_WORKBUDDY_CONFIG_DIR_ENV, PD_HOST_WORKSPACE_DIR_NAME, PD_HOME_MODES, PD_HOME_FAILURE_REASONS, resolvePdHome, resolveRealUserHome, isPathWithinRoot, type PdHomeMode, type PdHomePaths, type PdHomeFailure, type PdHomeFailureReason, type PdHomeSuccess, type PdHomeResolution, type ResolvePdHomeOptions, } from './pd-home.js';
262
+ export { PD_EXPERIMENT_ROOT_ENV, PD_OPENCLAW_HOME_ENV, PD_OPENCLAW_STATE_DIR_ENV, PD_CODEX_HOME_ENV, PD_WORKBUDDY_CONFIG_DIR_ENV, PD_HOST_WORKSPACE_DIR_NAME, PD_HOME_MODES, PD_HOME_FAILURE_REASONS, resolvePdHome, resolveRealUserHome, isPathWithinRoot, canonicalizeDeepestExisting, type PdHomeMode, type PdHomePaths, type PdHomeFailure, type PdHomeFailureReason, type PdHomeSuccess, type PdHomeResolution, type ResolvePdHomeOptions, } from './pd-home.js';
263
263
  export { ACTIVE_RELEASE_SCHEMA_VERSION, activeReleaseRecordPath, parseActiveReleaseRecord, readActiveReleaseRecord, type ActiveReleaseFailureReason, type ActiveReleaseRecord, type ActiveReleaseVerdict, } from './active-release.js';
264
264
  /**
265
265
  * Codex host-persistent binding location. The versioned payload directory is
@@ -254,9 +254,6 @@ export function parseInstallManifest(value, platform = process.platform) {
254
254
  }
255
255
  carriedUnknownHosts = value.unknownHosts.filter((host) => !isHost(host));
256
256
  }
257
- if (value.hosts.length === 0 && carriedUnknownHosts.length === 0) {
258
- return { error: 'install_manifest_malformed: hosts must contain at least one host' };
259
- }
260
257
  const hosts = [];
261
258
  const unknownHosts = [];
262
259
  const warnings = [];
@@ -277,6 +274,15 @@ export function parseInstallManifest(value, platform = process.platform) {
277
274
  const workspaces = parseWorkspaceList(value.workspaces, platform);
278
275
  if (workspaces.error)
279
276
  return { error: workspaces.error };
277
+ // A Service-Host-only install has NO host adapter (PRI-1278 Phase 5): the
278
+ // manifest legitimately carries `hosts: []` while declaring the workspaces
279
+ // the Service Host owns. An empty manifest with neither hosts nor
280
+ // workspaces is still structural damage — "no host AND no workspace" is
281
+ // indistinguishable from a truncated file, and every consumer would read
282
+ // it as a healthy empty install.
283
+ if (hosts.length === 0 && unknownHosts.length === 0 && (workspaces.workspaces ?? []).length === 0) {
284
+ return { error: 'install_manifest_malformed: hosts must contain at least one host or the manifest must declare at least one workspace' };
285
+ }
280
286
  const backgroundExecutions = parseBackgroundExecutions({ backgroundExecution: value.backgroundExecution, backgroundExecutions: value.backgroundExecutions }, workspaces.workspaces ?? [], platform);
281
287
  if (backgroundExecutions.error)
282
288
  return { error: backgroundExecutions.error };
@@ -484,7 +490,7 @@ export function getPdCliEntry(paths, mode) {
484
490
  * authority for "which PD home does this process own" — components must not
485
491
  * re-derive it locally.
486
492
  */
487
- export { PD_EXPERIMENT_ROOT_ENV, PD_OPENCLAW_HOME_ENV, PD_OPENCLAW_STATE_DIR_ENV, PD_CODEX_HOME_ENV, PD_WORKBUDDY_CONFIG_DIR_ENV, PD_HOST_WORKSPACE_DIR_NAME, PD_HOME_MODES, PD_HOME_FAILURE_REASONS, resolvePdHome, resolveRealUserHome, isPathWithinRoot, } from './pd-home.js';
493
+ export { PD_EXPERIMENT_ROOT_ENV, PD_OPENCLAW_HOME_ENV, PD_OPENCLAW_STATE_DIR_ENV, PD_CODEX_HOME_ENV, PD_WORKBUDDY_CONFIG_DIR_ENV, PD_HOST_WORKSPACE_DIR_NAME, PD_HOME_MODES, PD_HOME_FAILURE_REASONS, resolvePdHome, resolveRealUserHome, isPathWithinRoot, canonicalizeDeepestExisting, } from './pd-home.js';
488
494
  export { ACTIVE_RELEASE_SCHEMA_VERSION, activeReleaseRecordPath, parseActiveReleaseRecord, readActiveReleaseRecord, } from './active-release.js';
489
495
  /**
490
496
  * Codex host-persistent binding location. The versioned payload directory is
@@ -85,6 +85,18 @@ export declare function resolveRealUserHome(env?: Readonly<Record<string, string
85
85
  * to hand-roll a `startsWith` prefix check.
86
86
  */
87
87
  export declare function isPathWithinRoot(root: string, candidate: string): boolean;
88
+ /**
89
+ * Realpath the deepest EXISTING ancestor of `target`, then re-append the
90
+ * missing tail. Unlike `realpathSync(target)` this also answers for paths that
91
+ * do not exist yet (PD creates its own directories), while still resolving any
92
+ * link that already sits on the path.
93
+ *
94
+ * Exported for test-harness sandbox guards: an escape check done on
95
+ * `path.resolve()` strings alone misses a junction/symlink sitting on an
96
+ * existing ancestor. Pair with `isPathWithinRoot` for a real-path boundary
97
+ * judgment (the same semantics resolvePdHome applies to experiment roots).
98
+ */
99
+ export declare function canonicalizeDeepestExisting(target: string): string | null;
88
100
  /**
89
101
  * Resolve the PD home for this process. Callers must treat `ok: false` as a
90
102
  * startup refusal — there is no degraded mode.
@@ -93,8 +93,13 @@ export function isPathWithinRoot(root, candidate) {
93
93
  * missing tail. Unlike `realpathSync(target)` this also answers for paths that
94
94
  * do not exist yet (PD creates its own directories), while still resolving any
95
95
  * link that already sits on the path.
96
+ *
97
+ * Exported for test-harness sandbox guards: an escape check done on
98
+ * `path.resolve()` strings alone misses a junction/symlink sitting on an
99
+ * existing ancestor. Pair with `isPathWithinRoot` for a real-path boundary
100
+ * judgment (the same semantics resolvePdHome applies to experiment roots).
96
101
  */
97
- function canonicalizeDeepestExisting(target) {
102
+ export function canonicalizeDeepestExisting(target) {
98
103
  const missing = [];
99
104
  let current = path.resolve(target);
100
105
  for (;;) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/install-layout",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-principles-disciple",
3
- "version": "1.155.3",
3
+ "version": "1.156.0",
4
4
  "description": "Interactive CLI installer for Principles Disciple OpenClaw plugin",
5
5
  "type": "module",
6
6
  "bin": {
@@ -63,18 +63,18 @@
63
63
  "author": "csuzngjh",
64
64
  "license": "Apache-2.0",
65
65
  "dependencies": {
66
- "@earendil-works/pi-agent-core": "1.2.0",
67
- "@earendil-works/pi-ai": "1.4.0",
68
- "@principles/install-layout": "^0.10.0",
66
+ "@earendil-works/pi-agent-core": "1.6.0",
67
+ "@earendil-works/pi-ai": "1.6.0",
68
+ "@principles/install-layout": "^0.11.0",
69
69
  "@sinclair/typebox": "^0.34.52",
70
70
  "@tufjs/models": "3.0.1",
71
71
  "@inquirer/prompts": "^8.8.0",
72
72
  "better-sqlite3": "^13.0.3",
73
73
  "commander": "^15.1.0",
74
- "fs-extra": "^11.4.0",
74
+ "fs-extra": "^11.4.1",
75
75
  "js-yaml": "^5.4.3",
76
76
  "micromatch": "^4.0.8",
77
- "ora": "^9.4.1",
77
+ "ora": "^10.0.0",
78
78
  "picocolors": "^1.0.0",
79
79
  "semver": "^7.8.6",
80
80
  "tar": "^7.5.22",
@@ -103,5 +103,5 @@
103
103
  "pd": {
104
104
  "bundledPluginVersion": "4.2.1"
105
105
  },
106
- "gitHead": "eb4674ed948673b9a0e5c22590f5dd9d8cfd7fed"
106
+ "gitHead": "06a20cb7842f41a6510937f92340343158164b9f"
107
107
  }
@@ -24,6 +24,13 @@ interface CandidateRepairOptions {
24
24
  workspace?: string;
25
25
  json?: boolean;
26
26
  }
27
+ interface CandidatePostProcessingRecoveryOptions {
28
+ candidateId: string;
29
+ workspace?: string;
30
+ reason: string;
31
+ confirm?: boolean;
32
+ json?: boolean;
33
+ }
27
34
  /**
28
35
  * Resolve `sourcePainId` from the canonical diagnostician task chain.
29
36
  *
@@ -112,6 +119,14 @@ export declare function handleCandidateAudit(opts: CandidateAuditOptions): Promi
112
119
  * Fills consumed_at if empty.
113
120
  */
114
121
  export declare function handleCandidateRepair(opts: CandidateRepairOptions): Promise<void>;
122
+ /**
123
+ * Resume only a candidate whose post-processing was parked by an invalid RAW
124
+ * recommendation kind. The data repair is performed separately; this command
125
+ * is an explicit, ADR-0022-verified Owner authorization that appends an audit
126
+ * record and moves the existing processing state to in_progress. It never
127
+ * creates a Dreamer task directly and never releases a genuine Owner park.
128
+ */
129
+ export declare function handleCandidatePostProcessingRecovery(opts: CandidatePostProcessingRecoveryOptions): Promise<void>;
115
130
  interface CandidateBackfillOptions {
116
131
  workspace?: string;
117
132
  json?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"candidate.d.ts","sourceRoot":"","sources":["../../src/commands/candidate.ts"],"names":[],"mappings":"AAgBA,OAAO,EACL,mBAAmB,EA6BpB,MAAM,0BAA0B,CAAC;AAkBlC,UAAU,oBAAoB;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,UAAU,oBAAoB;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IA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