create-principles-disciple 1.147.18 → 1.148.1

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 (187) hide show
  1. package/_release/product-identity.json +1 -1
  2. package/codex-adapter/package.json +1 -1
  3. package/console/dist/server/config/pd-config-store.js +6 -6
  4. package/console/dist/server/index.d.ts +20 -0
  5. package/console/dist/server/index.js +104 -84
  6. package/console/dist/server/models/ApprovalsConsoleModel.d.ts +1 -1
  7. package/console/dist/server/models/ApprovalsConsoleModel.js +5 -2
  8. package/console/dist/server/models/GovernanceExperienceCollector.js +2 -1
  9. package/console/dist/server/models/GovernanceProjectionCollector.js +11 -10
  10. package/console/dist/server/models/IntentPageModel.js +1 -1
  11. package/console/dist/server/models/OwnerDecisionViewModel.d.ts +3 -2
  12. package/console/dist/server/models/OwnerDecisionViewModel.js +8 -7
  13. package/console/dist/server/routes/activations.js +5 -5
  14. package/console/dist/server/routes/approvals-grouped.js +2 -2
  15. package/console/dist/server/routes/approvals.js +7 -7
  16. package/console/dist/server/routes/config.d.ts +4 -4
  17. package/console/dist/server/routes/config.js +5 -5
  18. package/console/dist/server/routes/evidence-chain.d.ts +1 -1
  19. package/console/dist/server/routes/evidence-outcomes.d.ts +2 -2
  20. package/console/dist/server/routes/examiner.d.ts +12 -12
  21. package/console/dist/server/routes/examiner.js +2 -2
  22. package/console/dist/server/routes/failed-tasks.d.ts +4 -4
  23. package/console/dist/server/routes/failed-tasks.js +10 -10
  24. package/console/dist/server/routes/governance.d.ts +1 -1
  25. package/console/dist/server/routes/governance.js +3 -3
  26. package/console/dist/server/routes/intent-decisions.d.ts +6 -6
  27. package/console/dist/server/routes/intent-decisions.js +13 -13
  28. package/console/dist/server/routes/intent.js +6 -6
  29. package/console/dist/server/routes/lifecycle.js +3 -3
  30. package/console/dist/server/routes/onboarding.d.ts +1 -1
  31. package/console/dist/server/routes/onboarding.js +4 -4
  32. package/console/dist/server/routes/owner-decision.d.ts +5 -5
  33. package/console/dist/server/routes/owner-decision.js +3 -3
  34. package/console/dist/server/routes/owner-decisions.d.ts +3 -3
  35. package/console/dist/server/routes/owner-decisions.js +3 -3
  36. package/console/dist/server/routes/owner-identity.d.ts +1 -1
  37. package/console/dist/server/routes/owner-identity.js +1 -1
  38. package/console/dist/server/routes/principles.d.ts +4 -3
  39. package/console/dist/server/routes/principles.js +5 -4
  40. package/console/dist/server/routes/receipts.d.ts +2 -2
  41. package/console/dist/server/routes/receipts.js +4 -4
  42. package/console/dist/server.d.ts +2 -1
  43. package/console/dist/server.js +9 -1
  44. package/console/dist/shared/prompt-injection-contract.d.ts +1 -1
  45. package/console/dist/web/assets/app.js +23 -23
  46. package/core/dist/index.d.ts +1 -1
  47. package/core/dist/index.d.ts.map +1 -1
  48. package/core/dist/index.js +3 -2
  49. package/core/dist/index.js.map +1 -1
  50. package/core/dist/runtime/activation/approval-review-guard.d.ts +2 -2
  51. package/core/dist/runtime/activation/approval-review-guard.d.ts.map +1 -1
  52. package/core/dist/runtime/activation/approval-review-guard.js +6 -1
  53. package/core/dist/runtime/activation/approval-review-guard.js.map +1 -1
  54. package/core/dist/runtime/activation/prompt-budget-policy.d.ts +9 -1
  55. package/core/dist/runtime/activation/prompt-budget-policy.d.ts.map +1 -1
  56. package/core/dist/runtime/activation/prompt-budget-policy.js +9 -1
  57. package/core/dist/runtime/activation/prompt-budget-policy.js.map +1 -1
  58. package/core/dist/runtime/activation/recovery-control-surfaces.d.ts +1 -1
  59. package/core/dist/runtime/activation/recovery-control-surfaces.js +2 -2
  60. package/core/dist/runtime/activation/recovery-control-surfaces.js.map +1 -1
  61. package/core/dist/runtime/adapter/output-schema-registry.d.ts +1 -1
  62. package/core/dist/runtime/adapter/output-schema-registry.d.ts.map +1 -1
  63. package/core/dist/runtime/adapter/output-schema-registry.js +23 -18
  64. package/core/dist/runtime/adapter/output-schema-registry.js.map +1 -1
  65. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js +1 -1
  66. package/core/dist/runtime/adapter/pi-ai-runtime-adapter.js.map +1 -1
  67. package/core/dist/runtime/adapter/schema-json-converter.d.ts +1 -1
  68. package/core/dist/runtime/adapter/schema-json-converter.js +1 -1
  69. package/core/dist/runtime/adapter/tools/diagnostician-tool.js +1 -1
  70. package/core/dist/runtime/adapter/tools/diagnostician-tool.js.map +1 -1
  71. package/core/dist/runtime/diagnostician-output.d.ts +2 -2
  72. package/core/dist/runtime/diagnostician-output.d.ts.map +1 -1
  73. package/core/dist/runtime/diagnostician-output.js +1 -1
  74. package/core/dist/runtime/diagnostician-output.js.map +1 -1
  75. package/core/dist/runtime/feature-flags/plugin-surface-registry.d.ts.map +1 -1
  76. package/core/dist/runtime/feature-flags/plugin-surface-registry.js +10 -0
  77. package/core/dist/runtime/feature-flags/plugin-surface-registry.js.map +1 -1
  78. package/core/dist/runtime/governance-experience-contract.d.ts +4 -4
  79. package/core/dist/runtime/governance-experience-contract.d.ts.map +1 -1
  80. package/core/dist/runtime/governance-experience-contract.js +3 -2
  81. package/core/dist/runtime/governance-experience-contract.js.map +1 -1
  82. package/core/dist/runtime/governance-experience.d.ts.map +1 -1
  83. package/core/dist/runtime/governance-experience.js +2 -1
  84. package/core/dist/runtime/governance-experience.js.map +1 -1
  85. package/core/dist/runtime/governance-projection-contract.d.ts +14 -14
  86. package/core/dist/runtime/governance-projection-contract.d.ts.map +1 -1
  87. package/core/dist/runtime/governance-projection-contract.js +4 -3
  88. package/core/dist/runtime/governance-projection-contract.js.map +1 -1
  89. package/core/dist/runtime/governance-projection.d.ts.map +1 -1
  90. package/core/dist/runtime/governance-projection.js +2 -1
  91. package/core/dist/runtime/governance-projection.js.map +1 -1
  92. package/core/dist/runtime/index.d.ts +2 -2
  93. package/core/dist/runtime/index.d.ts.map +1 -1
  94. package/core/dist/runtime/index.js +2 -3
  95. package/core/dist/runtime/index.js.map +1 -1
  96. package/core/dist/runtime/internalization/artificer-runner.d.ts +1 -1
  97. package/core/dist/runtime/internalization/artificer-runner.d.ts.map +1 -1
  98. package/core/dist/runtime/internalization/artificer-runner.js +3 -2
  99. package/core/dist/runtime/internalization/artificer-runner.js.map +1 -1
  100. package/core/dist/runtime/internalization/diag-distiller-runner.d.ts.map +1 -1
  101. package/core/dist/runtime/internalization/diag-distiller-runner.js +3 -2
  102. package/core/dist/runtime/internalization/diag-distiller-runner.js.map +1 -1
  103. package/core/dist/runtime/internalization/diag-rootcause-runner.d.ts.map +1 -1
  104. package/core/dist/runtime/internalization/diag-rootcause-runner.js +3 -2
  105. package/core/dist/runtime/internalization/diag-rootcause-runner.js.map +1 -1
  106. package/core/dist/runtime/internalization/diag-router-runner.d.ts.map +1 -1
  107. package/core/dist/runtime/internalization/diag-router-runner.js +4 -3
  108. package/core/dist/runtime/internalization/diag-router-runner.js.map +1 -1
  109. package/core/dist/runtime/internalization/dreamer-runner.d.ts.map +1 -1
  110. package/core/dist/runtime/internalization/dreamer-runner.js +3 -2
  111. package/core/dist/runtime/internalization/dreamer-runner.js.map +1 -1
  112. package/core/dist/runtime/internalization/evaluator-runner.d.ts.map +1 -1
  113. package/core/dist/runtime/internalization/evaluator-runner.js +3 -2
  114. package/core/dist/runtime/internalization/evaluator-runner.js.map +1 -1
  115. package/core/dist/runtime/internalization/philosopher-runner.d.ts +1 -1
  116. package/core/dist/runtime/internalization/philosopher-runner.d.ts.map +1 -1
  117. package/core/dist/runtime/internalization/philosopher-runner.js +3 -2
  118. package/core/dist/runtime/internalization/philosopher-runner.js.map +1 -1
  119. package/core/dist/runtime/internalization/rollout-reviewer-output.d.ts +1 -1
  120. package/core/dist/runtime/internalization/rollout-reviewer-output.js +1 -1
  121. package/core/dist/runtime/internalization/rollout-reviewer-output.js.map +1 -1
  122. package/core/dist/runtime/internalization/rollout-reviewer-runner.d.ts.map +1 -1
  123. package/core/dist/runtime/internalization/rollout-reviewer-runner.js +3 -2
  124. package/core/dist/runtime/internalization/rollout-reviewer-runner.js.map +1 -1
  125. package/core/dist/runtime/internalization/router-context-evidence.d.ts +1 -1
  126. package/core/dist/runtime/internalization/router-context-evidence.d.ts.map +1 -1
  127. package/core/dist/runtime/internalization/router-context-evidence.js +4 -1
  128. package/core/dist/runtime/internalization/router-context-evidence.js.map +1 -1
  129. package/core/dist/runtime/internalization/scribe-runner.d.ts +1 -1
  130. package/core/dist/runtime/internalization/scribe-runner.d.ts.map +1 -1
  131. package/core/dist/runtime/internalization/scribe-runner.js +3 -2
  132. package/core/dist/runtime/internalization/scribe-runner.js.map +1 -1
  133. package/core/dist/runtime/learning-lab/actor-action-output.d.ts +1 -1
  134. package/core/dist/runtime/learning-lab/actor-action-output.d.ts.map +1 -1
  135. package/core/dist/runtime/learning-lab/actor-action-output.js +1 -1
  136. package/core/dist/runtime/learning-lab/actor-action-output.js.map +1 -1
  137. package/core/dist/runtime/observer/correction-observer.d.ts.map +1 -1
  138. package/core/dist/runtime/observer/correction-observer.js +3 -2
  139. package/core/dist/runtime/observer/correction-observer.js.map +1 -1
  140. package/core/dist/runtime/owner-decision/owner-decision-view-contract.d.ts +1 -1
  141. package/core/dist/runtime/owner-decision/owner-decision-view-contract.d.ts.map +1 -1
  142. package/core/dist/runtime/owner-decision/owner-decision-view-contract.js +2 -1
  143. package/core/dist/runtime/owner-decision/owner-decision-view-contract.js.map +1 -1
  144. package/core/dist/runtime/owner-decision/owner-decision-view.d.ts +8 -8
  145. package/core/dist/runtime/owner-decision/owner-decision-view.d.ts.map +1 -1
  146. package/core/dist/runtime/owner-decision/owner-decision-view.js +10 -9
  147. package/core/dist/runtime/owner-decision/owner-decision-view.js.map +1 -1
  148. package/core/dist/runtime/principle-reuse/reuse-evaluation-output.d.ts +1 -1
  149. package/core/dist/runtime/principle-reuse/reuse-evaluation-output.d.ts.map +1 -1
  150. package/core/dist/runtime/principle-reuse/reuse-evaluation-output.js +1 -1
  151. package/core/dist/runtime/principle-reuse/reuse-evaluation-output.js.map +1 -1
  152. package/core/dist/runtime/principle-reuse/reuse-evaluation-runner.d.ts.map +1 -1
  153. package/core/dist/runtime/principle-reuse/reuse-evaluation-runner.js +5 -4
  154. package/core/dist/runtime/principle-reuse/reuse-evaluation-runner.js.map +1 -1
  155. package/core/dist/runtime/schema-version.d.ts +30 -14
  156. package/core/dist/runtime/schema-version.d.ts.map +1 -1
  157. package/core/dist/runtime/schema-version.js +33 -13
  158. package/core/dist/runtime/schema-version.js.map +1 -1
  159. package/core/package.json +1 -1
  160. package/dist/installers/workbuddy-host-installer.d.ts +32 -1
  161. package/dist/installers/workbuddy-host-installer.d.ts.map +1 -1
  162. package/dist/installers/workbuddy-host-installer.js +819 -47
  163. package/dist/installers/workbuddy-host-installer.js.map +1 -1
  164. package/dist/utils/config-file-io.d.ts +27 -1
  165. package/dist/utils/config-file-io.d.ts.map +1 -1
  166. package/dist/utils/config-file-io.js +78 -3
  167. package/dist/utils/config-file-io.js.map +1 -1
  168. package/host-runtime/dist/prompt-injection-budget-observation.js +10 -8
  169. package/host-runtime/dist/signal-classifier.d.ts +3 -1
  170. package/host-runtime/dist/signal-classifier.js +5 -3
  171. package/host-runtime/package.json +1 -1
  172. package/package.json +3 -3
  173. package/pd-cli/package.json +1 -1
  174. package/pd-mcp-server/dist/version.d.ts +1 -1
  175. package/pd-mcp-server/dist/version.js +1 -1
  176. package/pd-mcp-server/package.json +1 -1
  177. package/plugin/dist/bundle.js +441 -441
  178. package/plugin/dist/core/event-log.d.ts +5 -0
  179. package/plugin/dist/governance-audit.js +2 -2
  180. package/plugin/dist/openclaw.plugin.json +1 -1
  181. package/plugin/dist/rulehost-evidence.js +9 -9
  182. package/plugin/openclaw.plugin.json +1 -1
  183. package/plugin/package.json +1 -1
  184. package/release-manager/dist/installers/workbuddy-host-installer.js +819 -47
  185. package/release-manager/dist/utils/config-file-io.js +78 -3
  186. package/release-manager/package.json +1 -1
  187. package/workbuddy-adapter/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Onboarding route - POST /api/v1/onboarding/run-demo
2
+ * Onboarding route - POST /api/onboarding/run-demo
3
3
  *
4
4
  * Spec: docs/superpowers/specs/2026-06-30-new-user-onboarding-design.md 6.3 change 5
5
5
  *
@@ -135,7 +135,7 @@ function parseDemoStdout(stdout) {
135
135
  * The demo typically completes in < 30s. We block on the subprocess so the
136
136
  * response carries the validated demo result in a single round-trip - the
137
137
  * frontend does not need to poll for the demo itself (it still polls
138
- * /api/v1/evidence-chain in step 3 for live evidence detection).
138
+ * /api/evidence-chain in step 3 for live evidence detection).
139
139
  *
140
140
  * Failure modes (rc-9-no-silent-fallback - every path returns a structured
141
141
  * error with reason + nextAction):
@@ -296,7 +296,7 @@ export async function handleOnboardingRoute(req, res, ctx) {
296
296
  });
297
297
  return;
298
298
  }
299
- // -- POST /api/v1/onboarding/run-demo --
299
+ // -- POST /api/onboarding/run-demo --
300
300
  if (subPath === '/run-demo') {
301
301
  if (req.method !== 'POST') {
302
302
  sendStructuredError(res, {
@@ -315,7 +315,7 @@ export async function handleOnboardingRoute(req, res, ctx) {
315
315
  statusCode: 404,
316
316
  error: 'not_found',
317
317
  reason: 'not_found',
318
- nextAction: `Route /api/v1/onboarding${subPath} not found. Use POST /api/v1/onboarding/run-demo.`,
318
+ nextAction: `Route /api/onboarding${subPath} not found. Use POST /api/onboarding/run-demo.`,
319
319
  });
320
320
  }
321
321
  /** No persistent resources to dispose - included for parity with other routes. */
@@ -3,8 +3,8 @@
3
3
  * (SPEC §15). Read-only: the Owner decision projection never mutates; the
4
4
  * approval/activation mutation services remain the final write authority.
5
5
  *
6
- * GET /api/v1/principles/owner-decision-inbox (static; dispatch before /:id)
7
- * GET /api/v1/principles/:id/owner-decision-view
6
+ * GET /api/principles/owner-decision-inbox (static; dispatch before /:id)
7
+ * GET /api/principles/:id/owner-decision-view
8
8
  *
9
9
  * Both ride the existing `principle_governance_projection_v2` flag (no new
10
10
  * runtime flag, SPEC §16) and reuse the route family's auth/workspace
@@ -21,9 +21,9 @@ export interface OwnerDecisionRouteParams {
21
21
  }>;
22
22
  now: () => string;
23
23
  }
24
- /** GET /api/v1/principles/owner-decision-inbox */
24
+ /** GET /api/principles/owner-decision-inbox */
25
25
  export declare function handleOwnerDecisionInboxRoute(params: OwnerDecisionRouteParams): Promise<void>;
26
- /** GET /api/v1/principles/owner-decision-library — compact titles/states for the Library list (§11.2). */
26
+ /** GET /api/principles/owner-decision-library — compact titles/states for the Library list (§11.2). */
27
27
  export declare function handleOwnerDecisionLibraryRoute(params: OwnerDecisionRouteParams): Promise<void>;
28
28
  /**
29
29
  * Parses `/:id/owner-decision-view` sub paths. Returns the decoded principle
@@ -32,7 +32,7 @@ export declare function handleOwnerDecisionLibraryRoute(params: OwnerDecisionRou
32
32
  */
33
33
  export declare function parseOwnerDecisionViewSubPath(subPath: string): string | null | 'invalid';
34
34
  /**
35
- * GET /api/v1/principles/:id/owner-decision-view.
35
+ * GET /api/principles/:id/owner-decision-view.
36
36
  * Returns false when the sub path does not match (caller continues routing).
37
37
  */
38
38
  export declare function handleOwnerDecisionViewRoute(params: OwnerDecisionRouteParams & {
@@ -4,7 +4,7 @@ import { sendSuccess, sendError, errorMessage } from '../utils/response.js';
4
4
  function featureDisabled(res) {
5
5
  sendError(res, 403, 'feature_disabled', 'Owner decision projection is disabled.', { reason: 'feature_disabled', nextAction: 'Enable features.principle_governance_projection_v2 in .pd/config.yaml.' });
6
6
  }
7
- /** GET /api/v1/principles/owner-decision-inbox */
7
+ /** GET /api/principles/owner-decision-inbox */
8
8
  export async function handleOwnerDecisionInboxRoute(params) {
9
9
  const { res, workspaceDir, featureFlags, now } = params;
10
10
  if (featureFlags?.principle_governance_projection_v2?.enabled !== true) {
@@ -19,7 +19,7 @@ export async function handleOwnerDecisionInboxRoute(params) {
19
19
  sendError(res, 500, 'owner_decision_inbox_error', errorMessage(error), { nextAction: 'inspect_runtime_state' });
20
20
  }
21
21
  }
22
- /** GET /api/v1/principles/owner-decision-library — compact titles/states for the Library list (§11.2). */
22
+ /** GET /api/principles/owner-decision-library — compact titles/states for the Library list (§11.2). */
23
23
  export async function handleOwnerDecisionLibraryRoute(params) {
24
24
  const { res, workspaceDir, featureFlags, now } = params;
25
25
  if (featureFlags?.principle_governance_projection_v2?.enabled !== true) {
@@ -53,7 +53,7 @@ export function parseOwnerDecisionViewSubPath(subPath) {
53
53
  }
54
54
  }
55
55
  /**
56
- * GET /api/v1/principles/:id/owner-decision-view.
56
+ * GET /api/principles/:id/owner-decision-view.
57
57
  * Returns false when the sub path does not match (caller continues routing).
58
58
  */
59
59
  export async function handleOwnerDecisionViewRoute(params) {
@@ -1,8 +1,8 @@
1
1
  /**
2
- * PRI-629 — /api/v1/governance/owner-decisions 路由。
2
+ * PRI-629 — /api/governance/owner-decisions 路由。
3
3
  *
4
- * GET /api/v1/governance/owner-decisions — 统一 Owner Inbox 投影
5
- * POST /api/v1/governance/owner-decisions/:taskId/resolve — Owner 裁决
4
+ * GET /api/governance/owner-decisions — 统一 Owner Inbox 投影
5
+ * POST /api/governance/owner-decisions/:taskId/resolve — Owner 裁决
6
6
  *
7
7
  * 安全模型(SPEC §28/§29):
8
8
  * - 全局 console token 认证由 server/index.ts 统一强制;
@@ -156,7 +156,7 @@ function sendOutcome(res, outcome) {
156
156
  export async function handleOwnerDecisionsRoute(req, res, ctx) {
157
157
  const { workspaceDir, subPath, ownerIdentity } = ctx;
158
158
  const method = req.method ?? 'GET';
159
- // GET /api/v1/governance/owner-decisions — list
159
+ // GET /api/governance/owner-decisions — list
160
160
  if (subPath === '' || subPath === '/') {
161
161
  if (method !== 'GET') {
162
162
  sendMethodNotAllowed(res);
@@ -174,7 +174,7 @@ export async function handleOwnerDecisionsRoute(req, res, ctx) {
174
174
  }
175
175
  return;
176
176
  }
177
- // POST /api/v1/governance/owner-decisions/:taskId/resolve
177
+ // POST /api/governance/owner-decisions/:taskId/resolve
178
178
  const resolveMatch = /^\/([^/]+)\/resolve$/.exec(subPath);
179
179
  if (resolveMatch) {
180
180
  if (method !== 'POST') {
@@ -220,5 +220,5 @@ export async function handleOwnerDecisionsRoute(req, res, ctx) {
220
220
  }
221
221
  return;
222
222
  }
223
- sendError(res, 404, 'not_found', `Route /api/v1/governance/owner-decisions${subPath} not found`);
223
+ sendError(res, 404, 'not_found', `Route /api/governance/owner-decisions${subPath} not found`);
224
224
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * GET/POST/DELETE /api/v1/owner-identity — install-level Owner identity
2
+ * GET/POST/DELETE /api/owner-identity — install-level Owner identity
3
3
  * registration (ADR-0022, PRI-578).
4
4
  *
5
5
  * - GET resolved identity (env > ~/.pd/owner.json > none) + file record
@@ -17,7 +17,7 @@ async function readJson(req) {
17
17
  /* eslint-disable @typescript-eslint/max-params */
18
18
  export async function handleOwnerIdentityRoute(req, res, homeDir, subPath, authConfig) {
19
19
  if (subPath !== '' && subPath !== '/') {
20
- sendError(res, 404, 'not_found', 'Unknown owner identity endpoint.', { nextAction: 'Use GET / POST / DELETE /api/v1/owner-identity.' });
20
+ sendError(res, 404, 'not_found', 'Unknown owner identity endpoint.', { nextAction: 'Use GET / POST / DELETE /api/owner-identity.' });
21
21
  return;
22
22
  }
23
23
  const method = req.method ?? 'GET';
@@ -3,9 +3,10 @@ import type { IncomingMessage, ServerResponse } from 'node:http';
3
3
  * GET /api/principles/core — read-only PD Core Principles reference (PRI-641).
4
4
  *
5
5
  * Served directly from the canonical `CORE_PRINCIPLES` registry (no ledger /
6
- * DB read). Dispatched in server/index.ts BEFORE the `/api/principles`
7
- * catch-all so `core` is never parsed as `/:id`; the `/api/v1/principles`
8
- * mount intentionally does NOT expose this endpoint.
6
+ * DB read). Dispatched in server/index.ts as an exact-match BEFORE the merged
7
+ * `/api/principles` mount so `core` is never parsed as `/:id` — under the
8
+ * PRI-1139 canonical dispatch this endpoint answers on both the canonical
9
+ * path and the deprecated `/api/v1` alias.
9
10
  *
10
11
  * Owner Decision Experience v1: the canonical Owner decision read endpoints
11
12
  * live in routes/owner-decision.ts and dispatch from handlePrinciplesRoute.
@@ -20,9 +20,10 @@ function getModel(workspaceDir) {
20
20
  * GET /api/principles/core — read-only PD Core Principles reference (PRI-641).
21
21
  *
22
22
  * Served directly from the canonical `CORE_PRINCIPLES` registry (no ledger /
23
- * DB read). Dispatched in server/index.ts BEFORE the `/api/principles`
24
- * catch-all so `core` is never parsed as `/:id`; the `/api/v1/principles`
25
- * mount intentionally does NOT expose this endpoint.
23
+ * DB read). Dispatched in server/index.ts as an exact-match BEFORE the merged
24
+ * `/api/principles` mount so `core` is never parsed as `/:id` — under the
25
+ * PRI-1139 canonical dispatch this endpoint answers on both the canonical
26
+ * path and the deprecated `/api/v1` alias.
26
27
  *
27
28
  * Owner Decision Experience v1: the canonical Owner decision read endpoints
28
29
  * live in routes/owner-decision.ts and dispatch from handlePrinciplesRoute.
@@ -174,7 +175,7 @@ async function getDeactivatedPrincipleIds(workspaceDir) {
174
175
  }
175
176
  }
176
177
  export async function handlePrinciplesRoute({ req, res, workspaceDir, subPath, featureFlags, now = () => new Date().toISOString(), }) {
177
- // GET /api/v1/principles/:id/governance. Gate before constructing any
178
+ // GET /api/principles/:id/governance. Gate before constructing any
178
179
  // Console model or projection reader so flag-off is a true no-read path.
179
180
  const governanceMatch = /^\/([^/]+)\/governance$/.exec(subPath);
180
181
  if (req.method === 'GET' && governanceMatch) {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Receipts API routes — PRI-533.
3
- * GET /api/v1/receipts/counts → per-principle receipt counts
4
- * GET /api/v1/receipts/principles/:principleId → per-principle receipt history
3
+ * GET /api/receipts/counts → per-principle receipt counts
4
+ * GET /api/receipts/principles/:principleId → per-principle receipt history
5
5
  */
6
6
  import type { IncomingMessage, ServerResponse } from 'node:http';
7
7
  export declare function handleReceiptsRoute(req: IncomingMessage, res: ServerResponse, workspaceDir: string, subPath: string): Promise<void>;
@@ -12,7 +12,7 @@ function getModel(workspaceDir) {
12
12
  /* eslint-disable @typescript-eslint/max-params */
13
13
  export async function handleReceiptsRoute(req, res, workspaceDir, subPath) {
14
14
  if (req.method !== 'GET') {
15
- sendError(res, 405, 'method_not_allowed', 'Only GET is supported on /api/v1/receipts');
15
+ sendError(res, 405, 'method_not_allowed', 'Only GET is supported on /api/receipts');
16
16
  return;
17
17
  }
18
18
  if (subPath === '/counts' || subPath === '/counts/') {
@@ -32,7 +32,7 @@ export async function handleReceiptsRoute(req, res, workspaceDir, subPath) {
32
32
  if (subPath.startsWith('/principles/')) {
33
33
  const rawId = subPath.slice('/principles/'.length);
34
34
  if (rawId.length === 0 || rawId.includes('/')) {
35
- sendNotFound(res, `Route /api/v1/receipts${subPath} not found`);
35
+ sendNotFound(res, `Route /api/receipts${subPath} not found`);
36
36
  return;
37
37
  }
38
38
  let principleId;
@@ -55,7 +55,7 @@ export async function handleReceiptsRoute(req, res, workspaceDir, subPath) {
55
55
  return;
56
56
  }
57
57
  // PD v2 Phase 1 (SPEC §13.8): the four audit queries.
58
- // GET /api/v1/receipts/evidence-audit?type=principle|activation|episode|effect&id=<selector>
58
+ // GET /api/receipts/evidence-audit?type=principle|activation|episode|effect&id=<selector>
59
59
  if (subPath === '/evidence-audit' || subPath === '/evidence-audit/') {
60
60
  const url = new URL(req.url ?? '/', 'http://localhost');
61
61
  const type = url.searchParams.get('type');
@@ -110,7 +110,7 @@ export async function handleReceiptsRoute(req, res, workspaceDir, subPath) {
110
110
  }
111
111
  return;
112
112
  }
113
- sendNotFound(res, `Route /api/v1/receipts${subPath} not found`);
113
+ sendNotFound(res, `Route /api/receipts${subPath} not found`);
114
114
  }
115
115
  export function disposeReceiptsModels() {
116
116
  // Models hold no persistent resources (request-scoped readonly connections
@@ -1 +1,2 @@
1
- export { main } from './server/index.js';
1
+ import { main } from './server/index.js';
2
+ export { main };
@@ -1 +1,9 @@
1
- export { main } from './server/index.js';
1
+ import { main } from './server/index.js';
2
+ export { main };
3
+ // Production entry (installed as <pd-runtime>/console/dist/server.js).
4
+ // server/index.ts only self-starts when executed directly, so the packaged
5
+ // entry must start the console explicitly.
6
+ main().catch((err) => {
7
+ console.error('[pd-console] Fatal startup error:', err);
8
+ process.exit(1);
9
+ });
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Shared wire-shape contract for the prompt-injection budget forecast on
3
- * `/api/v1/approvals/grouped` (PRI-908).
3
+ * `/api/approvals/grouped` (PRI-908).
4
4
  *
5
5
  * Single source of truth for the field shape within pd-console: the server
6
6
  * model (server/models/ApprovalsGroupedConsoleModel.ts) emits it and the UI