create-principles-disciple 1.150.6 → 1.151.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 (126) hide show
  1. package/README.md +5 -5
  2. package/_release/product-identity.json +1 -1
  3. package/codex-adapter/dist/ingestion/codex-version.d.ts +14 -12
  4. package/codex-adapter/dist/ingestion/codex-version.js +19 -20
  5. package/codex-adapter/package.json +1 -1
  6. package/console/dist/server/bind-guard.d.ts +6 -13
  7. package/console/dist/server/bind-guard.js +8 -17
  8. package/console/dist/server/index.d.ts +9 -3
  9. package/console/dist/server/index.js +55 -53
  10. package/console/dist/server/models/ActivationsConsoleModel.js +2 -1
  11. package/console/dist/server/models/OwnerDecisionConsoleModel.js +58 -19
  12. package/console/dist/server/routes/activations.js +2 -2
  13. package/console/dist/server/routes/diagnostician.js +1 -1
  14. package/console/dist/server/routes/evidence-outcomes.d.ts +3 -2
  15. package/console/dist/server/routes/evidence-outcomes.js +1 -1
  16. package/console/dist/server/routes/failed-tasks.js +1 -1
  17. package/console/dist/server/routes/governance.d.ts +9 -6
  18. package/console/dist/server/routes/governance.js +10 -6
  19. package/console/dist/server/routes/owner-decisions.d.ts +3 -3
  20. package/console/dist/server/routes/owner-decisions.js +1 -1
  21. package/console/dist/server/routes/owner-identity.d.ts +4 -5
  22. package/console/dist/server/routes/owner-identity.js +4 -4
  23. package/console/dist/server/routes/rule-candidate-bindings.js +1 -1
  24. package/console/dist/server/routes/update.js +24 -6
  25. package/console/dist/server/utils/request-guard.d.ts +35 -0
  26. package/console/dist/server/utils/request-guard.js +81 -0
  27. package/console/dist/server/utils/response.d.ts +0 -1
  28. package/console/dist/server/utils/response.js +0 -3
  29. package/console/dist/web/assets/app.css +95 -167
  30. package/console/dist/web/assets/app.js +32 -37
  31. package/core/dist/runtime/activation/activation-control-types.d.ts +3 -0
  32. package/core/dist/runtime/activation/activation-control-types.d.ts.map +1 -1
  33. package/core/dist/runtime/activation/rulecode-owner-decision-service.d.ts.map +1 -1
  34. package/core/dist/runtime/activation/rulecode-owner-decision-service.js +3 -2
  35. package/core/dist/runtime/activation/rulecode-owner-decision-service.js.map +1 -1
  36. package/core/dist/runtime/activation/sqlite-activation-safety-store.d.ts.map +1 -1
  37. package/core/dist/runtime/activation/sqlite-activation-safety-store.js +26 -13
  38. package/core/dist/runtime/activation/sqlite-activation-safety-store.js.map +1 -1
  39. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  40. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js +22 -8
  41. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js.map +1 -1
  42. package/core/dist/runtime/adapter/structured-output-repair.d.ts +17 -2
  43. package/core/dist/runtime/adapter/structured-output-repair.d.ts.map +1 -1
  44. package/core/dist/runtime/adapter/structured-output-repair.js +26 -5
  45. package/core/dist/runtime/adapter/structured-output-repair.js.map +1 -1
  46. package/core/dist/runtime/governance-experience-contract.d.ts +12 -12
  47. package/core/dist/runtime/governance-experience-contract.d.ts.map +1 -1
  48. package/core/dist/runtime/governance-experience-contract.js +0 -2
  49. package/core/dist/runtime/governance-experience-contract.js.map +1 -1
  50. package/core/dist/runtime/governance-experience.d.ts.map +1 -1
  51. package/core/dist/runtime/governance-experience.js +8 -16
  52. package/core/dist/runtime/governance-experience.js.map +1 -1
  53. package/core/dist/runtime/internalization/approved-rule-revision.d.ts.map +1 -1
  54. package/core/dist/runtime/internalization/approved-rule-revision.js +2 -1
  55. package/core/dist/runtime/internalization/approved-rule-revision.js.map +1 -1
  56. package/core/dist/runtime/internalization/pitask-metadata.d.ts +1 -1
  57. package/core/dist/runtime/internalization/pitask-metadata.d.ts.map +1 -1
  58. package/core/dist/runtime/recovery-sweep-service.d.ts +7 -0
  59. package/core/dist/runtime/recovery-sweep-service.d.ts.map +1 -1
  60. package/core/dist/runtime/recovery-sweep-service.js +1 -0
  61. package/core/dist/runtime/recovery-sweep-service.js.map +1 -1
  62. package/core/dist/runtime/store/context/promoted-evidence-reader.d.ts +59 -0
  63. package/core/dist/runtime/store/context/promoted-evidence-reader.d.ts.map +1 -0
  64. package/core/dist/runtime/store/context/promoted-evidence-reader.js +201 -0
  65. package/core/dist/runtime/store/context/promoted-evidence-reader.js.map +1 -0
  66. package/core/dist/runtime/store/context/sqlite-context-assembler.d.ts.map +1 -1
  67. package/core/dist/runtime/store/context/sqlite-context-assembler.js +43 -2
  68. package/core/dist/runtime/store/context/sqlite-context-assembler.js.map +1 -1
  69. package/core/dist/runtime/store/sqlite-connection.d.ts.map +1 -1
  70. package/core/dist/runtime/store/sqlite-connection.js +96 -37
  71. package/core/dist/runtime/store/sqlite-connection.js.map +1 -1
  72. package/core/package.json +1 -1
  73. package/dist/installer.d.ts +14 -0
  74. package/dist/installer.d.ts.map +1 -1
  75. package/dist/installer.js +36 -77
  76. package/dist/installer.js.map +1 -1
  77. package/dist/mvp-config.js +1 -1
  78. package/dist/mvp-config.js.map +1 -1
  79. package/dist/update/data-compatibility.d.ts.map +1 -1
  80. package/dist/update/data-compatibility.js +3 -1
  81. package/dist/update/data-compatibility.js.map +1 -1
  82. package/dist/update/release-manager.d.ts +5 -0
  83. package/dist/update/release-manager.d.ts.map +1 -1
  84. package/dist/update/release-manager.js +11 -1
  85. package/dist/update/release-manager.js.map +1 -1
  86. package/host-runtime/dist/adaptive-decision-protocol.d.ts +36 -8
  87. package/host-runtime/dist/adaptive-decision-protocol.js +79 -20
  88. package/host-runtime/dist/adaptive-selection.js +6 -1
  89. package/host-runtime/dist/cli-recovery-probe.d.ts +42 -1
  90. package/host-runtime/dist/cli-recovery-probe.js +16 -3
  91. package/host-runtime/dist/conversation-ingestion/pipeline.d.ts +0 -29
  92. package/host-runtime/dist/conversation-ingestion/pipeline.js +39 -2
  93. package/host-runtime/package.json +1 -1
  94. package/package.json +2 -2
  95. package/pd-cli/dist/commands/candidate.d.ts.map +1 -1
  96. package/pd-cli/dist/commands/candidate.js +117 -3
  97. package/pd-cli/dist/commands/candidate.js.map +1 -1
  98. package/pd-cli/dist/commands/console.d.ts +0 -4
  99. package/pd-cli/dist/commands/console.d.ts.map +1 -1
  100. package/pd-cli/dist/commands/console.js +4 -67
  101. package/pd-cli/dist/commands/console.js.map +1 -1
  102. package/pd-cli/dist/commands/runtime-activation.d.ts.map +1 -1
  103. package/pd-cli/dist/commands/runtime-activation.js +4 -8
  104. package/pd-cli/dist/commands/runtime-activation.js.map +1 -1
  105. package/pd-cli/dist/commands/runtime-recovery-failed-tasks.d.ts.map +1 -1
  106. package/pd-cli/dist/commands/runtime-recovery-failed-tasks.js +114 -63
  107. package/pd-cli/dist/commands/runtime-recovery-failed-tasks.js.map +1 -1
  108. package/pd-cli/dist/program.d.ts.map +1 -1
  109. package/pd-cli/dist/program.js +0 -8
  110. package/pd-cli/dist/program.js.map +1 -1
  111. package/pd-cli/dist/services/console-launcher.d.ts +1 -18
  112. package/pd-cli/dist/services/console-launcher.d.ts.map +1 -1
  113. package/pd-cli/dist/services/console-launcher.js +4 -92
  114. package/pd-cli/dist/services/console-launcher.js.map +1 -1
  115. package/pd-cli/package.json +1 -1
  116. package/plugin/dist/bundle.js +440 -423
  117. package/plugin/dist/openclaw.plugin.json +1 -1
  118. package/plugin/openclaw.plugin.json +1 -1
  119. package/plugin/package.json +1 -1
  120. package/release-manager/dist/installer.js +36 -77
  121. package/release-manager/dist/mvp-config.js +1 -1
  122. package/release-manager/dist/update/release-manager.js +11 -1
  123. package/release-manager/package.json +1 -1
  124. package/workbuddy-adapter/package.json +1 -1
  125. package/console/dist/server/config/AuthConfig.d.ts +0 -14
  126. package/console/dist/server/config/AuthConfig.js +0 -42
@@ -2,7 +2,7 @@
2
2
  "id": "principles-disciple",
3
3
  "name": "Principles Disciple",
4
4
  "description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
- "version": "4.0.0",
5
+ "version": "4.1.0",
6
6
  "activation": {
7
7
  "onStartup": true,
8
8
  "onCapabilities": [
@@ -2,7 +2,7 @@
2
2
  "id": "principles-disciple",
3
3
  "name": "Principles Disciple",
4
4
  "description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
- "version": "4.0.0",
5
+ "version": "4.1.0",
6
6
  "activation": {
7
7
  "onStartup": true,
8
8
  "onCapabilities": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "principles-disciple",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "Principles Disciple is an AI Agent Governance System. Stop correcting the same AI behavior across sessions. Turn repeated Agent corrections into Owner-approved, observable, reversible behavior principles.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -2728,6 +2728,22 @@ export function ensureConsoleResolution() {
2728
2728
  export function ensureCodexAdapterResolution() {
2729
2729
  ensureComponentFileDependencyLinks(getInstalledCodexAdapterDir(), '@principles/codex-adapter');
2730
2730
  }
2731
+ /**
2732
+ * PRI-1145: the INSTALLED host-runtime declares the same `file:../<component>`
2733
+ * siblings as the other runtime components (core / install-layout), but it was
2734
+ * the only one with no `ensure*Resolution()` caller. `installBundledHostRuntime`
2735
+ * therefore left the npm-materialized `node_modules/@principles/core` physical
2736
+ * copy in place, so a second core byte lived on the machine outside the
2737
+ * "every component resolves the canonical runtime core" invariant. Reuses the
2738
+ * shared helper (Connection Before Creation) instead of a new mechanism.
2739
+ *
2740
+ * Ordering contract: MUST run after installBundledHostRuntime() AND after every
2741
+ * `file:../` sibling it declares is deployed (core, install-layout). A missing
2742
+ * sibling fails the install loud (the helper).
2743
+ */
2744
+ export function ensureHostRuntimeResolution() {
2745
+ ensureComponentFileDependencyLinks(getInstalledHostRuntimeDir(), '@principles/host-runtime');
2746
+ }
2731
2747
  /**
2732
2748
  * SPEC workbuddy-host-adapter §4.1/§5: the bundled @principles/workbuddy-adapter
2733
2749
  * payload installs as a runtime sibling exactly like codex-adapter, and its
@@ -3065,22 +3081,16 @@ export class ConsoleVerifyError extends Error {
3065
3081
  }
3066
3082
  }
3067
3083
  /**
3068
- * PD Console health shape, bound to the posture we launched (rc-5: Object.hasOwn
3069
- * for untrusted keys).
3084
+ * PD Console health shape (rc-5: Object.hasOwn for untrusted keys).
3070
3085
  *
3071
3086
  * P1-B: `data.overall` is the PD-specific discriminative field — the generic
3072
- * { success: true } envelope alone matches any service. PRI-1054 review P2:
3073
- * `data.authenticationMode` must equal the launched posture, because that is the
3074
- * same fact `pd console open` refuses on (`console_authentication_mode_mismatch`).
3075
- * Without it the installer certified ANY healthy PD console on 3100..3119 as
3076
- * "the console I just launched", including a pre-existing no-auth one that
3077
- * `pd console open` had already refused to adopt.
3087
+ * { success: true } envelope alone matches any service.
3078
3088
  *
3079
3089
  * (Hoisted above the G1 P0-1 identity verifier — its first caller in file
3080
3090
  * order — for no-use-before-define discipline; the autolaunch probe below
3081
3091
  * shares this same shape contract.)
3082
3092
  */
3083
- function isLaunchedConsoleHealth(payload, expectedMode) {
3093
+ function isLaunchedConsoleHealth(payload) {
3084
3094
  if (typeof payload !== 'object' || payload === null)
3085
3095
  return false;
3086
3096
  if (!Object.hasOwn(payload, 'success') || Reflect.get(payload, 'success') !== true)
@@ -3093,18 +3103,7 @@ function isLaunchedConsoleHealth(payload, expectedMode) {
3093
3103
  if (!Object.hasOwn(data, 'overall'))
3094
3104
  return false;
3095
3105
  const overall = Reflect.get(data, 'overall');
3096
- if (overall !== 'healthy' && overall !== 'degraded' && overall !== 'error')
3097
- return false;
3098
- if (!Object.hasOwn(data, 'authenticationMode'))
3099
- return false;
3100
- return Reflect.get(data, 'authenticationMode') === expectedMode;
3101
- }
3102
- /** sendUnauthorized's envelope — the only responder worth offering the token to. */
3103
- function isConsoleUnauthorizedEnvelope(payload) {
3104
- if (typeof payload !== 'object' || payload === null)
3105
- return false;
3106
- return Object.hasOwn(payload, 'success') && Reflect.get(payload, 'success') === false
3107
- && Object.hasOwn(payload, 'error') && Reflect.get(payload, 'error') === 'unauthorized';
3106
+ return overall === 'healthy' || overall === 'degraded' || overall === 'error';
3108
3107
  }
3109
3108
  /** P0-1 (SPEC v1.2 §7 / invariant I-3): the response must prove it came from
3110
3109
  * THIS child — a one-shot nonce injected through the child env and echoed by
@@ -3112,7 +3111,7 @@ function isConsoleUnauthorizedEnvelope(payload) {
3112
3111
  * 200+JSON cannot know the value, so they all fail closed here. The nonce
3113
3112
  * value never enters logs or diagnostics. */
3114
3113
  function isVerifiedConsoleIdentity(payload, expectedNonce) {
3115
- if (!isLaunchedConsoleHealth(payload, 'no_auth'))
3114
+ if (!isLaunchedConsoleHealth(payload))
3116
3115
  return false;
3117
3116
  const data = Reflect.get(payload, 'data');
3118
3117
  if (typeof data !== 'object' || data === null || Array.isArray(data))
@@ -3163,7 +3162,7 @@ export async function verifyConsole(workspaceDir) {
3163
3162
  // Cleared at every attempt exit below; attempts are strictly serial.
3164
3163
  const nonce = randomUUID();
3165
3164
  process.env.PD_CONSOLE_VERIFY_NONCE = nonce;
3166
- const child = spawn(process.execPath, [serverEntry, '--workspace', workspaceDir, '--port', String(port), '--no-auth', '--host', '127.0.0.1'], {
3165
+ const child = spawn(process.execPath, [serverEntry, '--workspace', workspaceDir, '--port', String(port), '--host', '127.0.0.1'], {
3167
3166
  stdio: 'pipe',
3168
3167
  env: { ...process.env },
3169
3168
  detached: false,
@@ -3315,9 +3314,9 @@ function openBrowserForOnboarding(url) {
3315
3314
  return { opened: false, reason: err instanceof Error ? err.message : String(err) };
3316
3315
  }
3317
3316
  }
3318
- function requestConsoleHealth(port, token, timeoutMs) {
3317
+ function requestConsoleHealth(port, timeoutMs) {
3319
3318
  return new Promise((resolve) => {
3320
- const req = http.get(`http://127.0.0.1:${port}/api/health`, { headers: token ? { Authorization: `Bearer ${token}` } : {} }, (res) => {
3319
+ const req = http.get(`http://127.0.0.1:${port}/api/health`, (res) => {
3321
3320
  const chunks = [];
3322
3321
  res.on('data', (c) => chunks.push(c));
3323
3322
  res.on('end', () => {
@@ -3336,31 +3335,13 @@ function requestConsoleHealth(port, token, timeoutMs) {
3336
3335
  });
3337
3336
  }
3338
3337
  /**
3339
- * Is the console READY on this port — meaning the one launched in `posture`?
3340
- *
3341
- * Two-phase on purpose:
3342
- * 1. bare GET first: a bearer credential must never be sprayed at up to
3343
- * CONSOLE_AUTOLAUNCH_PORT_SCAN_LIMIT unidentified local ports;
3344
- * 2. the token is attached only to a responder that answered 401 with the
3345
- * console's own error envelope, and 200 is accepted only when
3346
- * `authenticationMode` matches the launched posture.
3347
- * An authenticated console answers 401 to a bare probe, so phase 1 alone cannot
3348
- * distinguish it — phase 2 is the proof that the responder accepts THIS token.
3338
+ * Is the console READY on this port? A single bare GET is enough now: the
3339
+ * Console has no credential, so a 200 with a healthy envelope (and the
3340
+ * launcher's one-shot nonce where required) is the whole proof.
3349
3341
  */
3350
- async function probeAutolaunchHealth(port, posture, timeoutMs = 1500) {
3351
- const expectedMode = posture.authenticated ? 'authenticated' : 'no_auth';
3352
- const bare = await requestConsoleHealth(port, undefined, timeoutMs);
3353
- if (bare === null)
3354
- return false;
3355
- if (bare.status === 200)
3356
- return isLaunchedConsoleHealth(bare.payload, expectedMode);
3357
- if (bare.status !== 401 || !posture.authenticated)
3358
- return false;
3359
- if (!isConsoleUnauthorizedEnvelope(bare.payload))
3360
- return false;
3361
- const authorized = await requestConsoleHealth(port, posture.token, timeoutMs);
3362
- return authorized !== null && authorized.status === 200
3363
- && isLaunchedConsoleHealth(authorized.payload, expectedMode);
3342
+ async function probeAutolaunchHealth(port, timeoutMs = 1500) {
3343
+ const response = await requestConsoleHealth(port, timeoutMs);
3344
+ return response !== null && response.status === 200 && isLaunchedConsoleHealth(response.payload);
3364
3345
  }
3365
3346
  /**
3366
3347
  * Task 8: Auto-launch the PD Console at the end of a successful install by
@@ -3382,32 +3363,8 @@ async function probeAutolaunchHealth(port, posture, timeoutMs = 1500) {
3382
3363
  export function resolveConsoleWorkspaceDir(host, projectWorkspaceDir, homeDir) {
3383
3364
  return host === 'workbuddy' ? getWorkbuddyWorkspaceDir(homeDir) : projectWorkspaceDir;
3384
3365
  }
3385
- /**
3386
- * PRI-1054: the authentication posture to auto-launch the console in.
3387
- *
3388
- * The update chain must NOT invent a posture: PD Companion asks for an
3389
- * authenticated console whenever PD_CONSOLE_TOKEN is in its environment, and it
3390
- * restores that token from its own encrypted state on every launch. Hardcoding
3391
- * `--no-auth` here therefore swapped a healthy authenticated console for a
3392
- * no-auth one on every release, and the next Companion start aborted with
3393
- * `console_authentication_mode_mismatch` — i.e. configuring a token made every
3394
- * later release brick the desktop app.
3395
- *
3396
- * Inheriting this process's own PD_CONSOLE_TOKEN keeps the machine's posture
3397
- * unchanged, because `pd console open` reads the same variable (console.ts
3398
- * resolves `opts.token ?? process.env.PD_CONSOLE_TOKEN` and only skips auth for
3399
- * `--no-auth`). No new authority: the variable stays the single declaration.
3400
- */
3401
- function readConsoleAuthPosture(env = process.env) {
3402
- const token = env.PD_CONSOLE_TOKEN?.trim();
3403
- return token ? { authenticated: true, token } : { authenticated: false };
3404
- }
3405
3366
  async function autoLaunchConsole(workspaceDir) {
3406
- const posture = readConsoleAuthPosture();
3407
- const noAuthFlag = posture.authenticated ? '' : ' --no-auth';
3408
- // The instruction the Owner may follow by hand — it must carry the same
3409
- // posture as the launch, or following it re-creates the collision.
3410
- const manualOpenCommand = `pd console open --workspace "${workspaceDir}"${noAuthFlag}`;
3367
+ const manualOpenCommand = `pd console open --workspace "${workspaceDir}"`;
3411
3368
  // Test/smoke seam (mirrors PD_SKIP_GLOBAL_SHIM): isolated installs (release
3412
3369
  // smoke, upgrade gate) must not spawn a detached console that holds the
3413
3370
  // installed files open or pops a browser.
@@ -3422,8 +3379,6 @@ async function autoLaunchConsole(workspaceDir) {
3422
3379
  // Spawn `pd console open` detached — reuses handleConsoleOpen (port detection,
3423
3380
  // reuse, health). --no-browser because we open /welcome ourselves.
3424
3381
  const launchArgs = [pdCliEntry, 'console', 'open', '--workspace', workspaceDir, '--no-browser'];
3425
- if (!posture.authenticated)
3426
- launchArgs.push('--no-auth');
3427
3382
  const child = spawn(process.execPath, launchArgs, { detached: true, stdio: 'ignore', shell: false });
3428
3383
  child.unref();
3429
3384
  // Wait for the console to become ready (bounded poll on
@@ -3432,7 +3387,7 @@ async function autoLaunchConsole(workspaceDir) {
3432
3387
  while (Date.now() < deadline) {
3433
3388
  for (let i = 0; i < CONSOLE_AUTOLAUNCH_PORT_SCAN_LIMIT; i++) {
3434
3389
  const port = CONSOLE_AUTOLAUNCH_BASE_PORT + i;
3435
- if (await probeAutolaunchHealth(port, posture)) {
3390
+ if (await probeAutolaunchHealth(port)) {
3436
3391
  // HashRouter: client-side routes live under /#/ — server only serves /,
3437
3392
  // anything else (incl. /welcome) is treated as an API path and returns
3438
3393
  // 404 not_found. Must open /#/welcome so the browser loads index.html
@@ -4299,6 +4254,10 @@ transaction) {
4299
4254
  installBundledCodexAdapter(pluginDir);
4300
4255
  stepIndex++;
4301
4256
  installBundledLayoutPackage(pluginDir);
4257
+ // PRI-1145: host-runtime declares file:../core + file:../install-layout.
4258
+ // Both siblings are deployed above, so its physical nested copies are
4259
+ // corrected here — same contract as the adapters below.
4260
+ ensureHostRuntimeResolution();
4302
4261
  // PRI-711: the adapter's own file: deps must resolve or pd-cli's eager
4303
4262
  // import graph crashes on every command. Runs only once ALL adapter
4304
4263
  // siblings exist — the manifest declares file:../core, file:../host-runtime
@@ -128,7 +128,7 @@ export function buildSuccessOutput(opts) {
128
128
  nextActions.push(`Console ready at ${consoleUrl} (browser opened automatically)`);
129
129
  }
130
130
  else {
131
- nextActions.push('Start console: pd console --workspace <path> --no-auth (listens on 127.0.0.1 only)');
131
+ nextActions.push('Start console: pd console --workspace <path> (listens on 127.0.0.1 only)');
132
132
  }
133
133
  }
134
134
  if (isComplete) {
@@ -268,7 +268,12 @@ export class ReleaseManager {
268
268
  if (!decision.allowed) {
269
269
  // PRI-848: the reason travels structured — the Console must map refusal
270
270
  // states from a reason code, never by parsing the note string.
271
- return { kind: 'no_update', reason: decision.reason, note: decision.message };
271
+ return {
272
+ kind: 'no_update',
273
+ reason: decision.reason,
274
+ note: decision.message,
275
+ nextAction: decision.nextAction,
276
+ };
272
277
  }
273
278
  // PRI-853 (SPEC §10 wired, live-run fix): data compatibility preflight
274
279
  // runs against the CURRENTLY ACTIVE version — the release whose data must
@@ -284,6 +289,7 @@ export class ReleaseManager {
284
289
  kind: 'no_update',
285
290
  reason: 'install_identity_unverifiable',
286
291
  note: 'The installation has no readable active release record, so its data compatibility cannot be proven.',
292
+ nextAction: 'No runtime change was made. Run the official installer (npx create-principles-disciple) to repair the active release record, then retry the update.',
287
293
  };
288
294
  }
289
295
  const windowVersion = parseProductVersion(releaseMetadata.compatibility.dataSchemaForwardReadableFrom, 'compatibility.dataSchemaForwardReadableFrom');
@@ -293,6 +299,10 @@ export class ReleaseManager {
293
299
  kind: 'no_update',
294
300
  reason: 'destructive_migration_requires_maintenance',
295
301
  note: `Release ${releaseMetadata.productVersion} only guarantees data readable back to ${windowVersion.productVersion}, but the installed release is ${activeVersion.productVersion}. An ordinary update could strand code rollback.`,
302
+ // PRI-1153: state the facts and an executable step. There is no
303
+ // "official maintenance workflow" entry in this repository, so the
304
+ // refusal must not promise one.
305
+ nextAction: `No runtime change was made. Back up this workspace's ".pd" directory, then contact the maintainer to migrate data from ${activeVersion.productVersion} before installing ${releaseMetadata.productVersion}; this ordinary update path cannot cross the ${windowVersion.productVersion} schema boundary.`,
296
306
  };
297
307
  }
298
308
  // PRI-850: honor a caller-generated transaction id (bootstrap executor
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-principles-disciple",
3
- "version": "1.150.6",
3
+ "version": "1.151.0",
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.6.1",
3
+ "version": "0.6.2",
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",
@@ -1,14 +0,0 @@
1
- import type { IncomingMessage } from 'node:http';
2
- export interface AuthConfigOptions {
3
- cliToken?: string;
4
- envToken?: string;
5
- noAuth?: boolean;
6
- }
7
- export declare class AuthConfig {
8
- private readonly token;
9
- private readonly enabled;
10
- constructor(opts?: AuthConfigOptions);
11
- isEnabled(): boolean;
12
- getToken(): string | null;
13
- isAuthenticated(req: IncomingMessage): boolean;
14
- }
@@ -1,42 +0,0 @@
1
- import * as crypto from 'crypto';
2
- export class AuthConfig {
3
- token;
4
- enabled;
5
- constructor(opts = {}) {
6
- const token = opts.cliToken ?? opts.envToken ?? null;
7
- this.enabled = !opts.noAuth && token !== null && token.length > 0;
8
- this.token = token;
9
- }
10
- isEnabled() {
11
- return this.enabled;
12
- }
13
- getToken() {
14
- return this.token;
15
- }
16
- isAuthenticated(req) {
17
- if (!this.enabled) {
18
- return true;
19
- }
20
- const authHeader = req.headers.authorization;
21
- if (typeof authHeader !== 'string') {
22
- return false;
23
- }
24
- const match = /^Bearer\s+(.+)$/i.exec(authHeader);
25
- if (!match) {
26
- return false;
27
- }
28
- const [, provided] = match;
29
- if (!provided) {
30
- return false;
31
- }
32
- if (!this.token) {
33
- return false;
34
- }
35
- const providedBuf = Buffer.from(provided, 'utf8');
36
- const expectedBuf = Buffer.from(this.token, 'utf8');
37
- if (providedBuf.length !== expectedBuf.length) {
38
- return false;
39
- }
40
- return crypto.timingSafeEqual(providedBuf, expectedBuf);
41
- }
42
- }