create-principles-disciple 1.148.9 → 1.148.10

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.
@@ -16,11 +16,10 @@
16
16
  * never writes installation files directly.
17
17
  */
18
18
  import * as fs from 'node:fs';
19
- import * as path from 'node:path';
20
- import * as os from 'node:os';
21
19
  import { readFileSync, writeFileSync } from 'node:fs';
22
20
  import { parseBootstrapRequest, serializeBootstrapResponse, handleBootstrapRequest, } from './bootstrap-protocol.js';
23
21
  import { createReleaseManagerAuthority } from './release-manager-authority.js';
22
+ import { resolvePdHome } from '@principles/install-layout';
24
23
  export async function runBootstrapExecutor(options) {
25
24
  let response;
26
25
  let resultFile = null;
@@ -34,28 +33,43 @@ export async function runBootstrapExecutor(options) {
34
33
  response = { ok: true, result: { pong: true } };
35
34
  }
36
35
  else {
37
- const authority = createReleaseManagerAuthority({
38
- pdHome: path.join(os.homedir(), '.pd'),
39
- // The executor resolves the metadata source exactly like the Console:
40
- // process env first, then the durable install.json tier. No guessing.
41
- metadataBaseUrl: process.env.PD_RELEASE_METADATA_URL,
42
- });
43
- // Only apply passes the authority readiness gate — read ops (inspect /
44
- // check) must answer on ANY installation so the repair flow can see the
45
- // actual state; check carries its own policy gating.
46
- if (request.op === 'apply' && !authority.kinds['apply-full'].ready) {
47
- const readiness = authority.kinds['apply-full'];
36
+ // PRI-872: the executor runs detached from the Console that spawned it,
37
+ // so it must resolve the SAME home through the same authority. Without
38
+ // this an experiment Console's update transaction would target the
39
+ // production install — the exact dual-open failure this ticket removes.
40
+ const pdHome = resolvePdHome();
41
+ if (!pdHome.ok) {
48
42
  response = {
49
43
  ok: false,
50
- reason: readiness.reasons[0] ?? 'install_state_corrupt',
51
- message: 'The installation is not ready for a signed release update.',
52
- nextAction: 'Run the official installer (npx create-principles-disciple) to repair the installation, then retry.',
44
+ reason: pdHome.reason,
45
+ message: pdHome.message,
46
+ nextAction: pdHome.nextAction,
53
47
  };
54
48
  }
55
49
  else {
56
- // handleBootstrapRequest never throws: manager failures come back as
57
- // structured protocol refusals.
58
- response = await handleBootstrapRequest(request, authority.manager);
50
+ const authority = createReleaseManagerAuthority({
51
+ pdHome: pdHome.pdHome,
52
+ // The executor resolves the metadata source exactly like the Console:
53
+ // process env first, then the durable install.json tier. No guessing.
54
+ metadataBaseUrl: process.env.PD_RELEASE_METADATA_URL,
55
+ });
56
+ // Only apply passes the authority readiness gate — read ops (inspect /
57
+ // check) must answer on ANY installation so the repair flow can see the
58
+ // actual state; check carries its own policy gating.
59
+ if (request.op === 'apply' && !authority.kinds['apply-full'].ready) {
60
+ const readiness = authority.kinds['apply-full'];
61
+ response = {
62
+ ok: false,
63
+ reason: readiness.reasons[0] ?? 'install_state_corrupt',
64
+ message: 'The installation is not ready for a signed release update.',
65
+ nextAction: 'Run the official installer (npx create-principles-disciple) to repair the installation, then retry.',
66
+ };
67
+ }
68
+ else {
69
+ // handleBootstrapRequest never throws: manager failures come back as
70
+ // structured protocol refusals.
71
+ response = await handleBootstrapRequest(request, authority.manager);
72
+ }
59
73
  }
60
74
  }
61
75
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-principles-disciple",
3
- "version": "1.148.9",
3
+ "version": "1.148.10",
4
4
  "description": "Interactive CLI installer for Principles Disciple OpenClaw plugin",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/workbuddy-adapter",
3
- "version": "0.5.8",
3
+ "version": "0.5.9",
4
4
  "description": "WorkBuddy host adapter for Principles Disciple — implements the HostAdapter interface for WorkBuddy's Git Bash command-hook model (ADR-0020 third host, SPEC workbuddy-host-adapter v0.3.0).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",