create-principles-disciple 1.148.11 → 1.149.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 (37) hide show
  1. package/_release/product-identity.json +1 -1
  2. package/codex-adapter/package.json +1 -1
  3. package/console/dist/server/index.js +7 -0
  4. package/console/dist/server/routes/compatibility-scan.d.ts +18 -0
  5. package/console/dist/server/routes/compatibility-scan.js +33 -0
  6. package/console/dist/shared/compatibility-scan-contract.d.ts +26 -0
  7. package/console/dist/shared/compatibility-scan-contract.js +1 -0
  8. package/console/dist/web/assets/app.js +31 -31
  9. package/core/dist/runtime/activation-compatibility-read-model.d.ts +20 -5
  10. package/core/dist/runtime/activation-compatibility-read-model.d.ts.map +1 -1
  11. package/core/dist/runtime/activation-compatibility-read-model.js +15 -3
  12. package/core/dist/runtime/activation-compatibility-read-model.js.map +1 -1
  13. package/core/package.json +1 -1
  14. package/dist/installer.d.ts +58 -7
  15. package/dist/installer.d.ts.map +1 -1
  16. package/dist/installer.js +131 -6
  17. package/dist/installer.js.map +1 -1
  18. package/host-runtime/package.json +1 -1
  19. package/install-layout/dist/index.d.ts +1 -1
  20. package/install-layout/dist/index.js +1 -1
  21. package/install-layout/dist/pd-home.d.ts +9 -2
  22. package/install-layout/dist/pd-home.js +77 -14
  23. package/install-layout/package.json +1 -1
  24. package/package.json +3 -3
  25. package/pd-cli/dist/commands/runtime-compatibility-scan.d.ts +5 -2
  26. package/pd-cli/dist/commands/runtime-compatibility-scan.d.ts.map +1 -1
  27. package/pd-cli/dist/commands/runtime-compatibility-scan.js +22 -2
  28. package/pd-cli/dist/commands/runtime-compatibility-scan.js.map +1 -1
  29. package/pd-cli/dist/services/config-doctor.d.ts +9 -0
  30. package/pd-cli/dist/services/config-doctor.d.ts.map +1 -1
  31. package/pd-cli/dist/services/config-doctor.js +15 -0
  32. package/pd-cli/dist/services/config-doctor.js.map +1 -1
  33. package/pd-cli/package.json +1 -1
  34. package/plugin/dist/bundle.js +5 -5
  35. package/release-manager/dist/installer.js +131 -6
  36. package/release-manager/package.json +1 -1
  37. package/workbuddy-adapter/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "productVersion": "2.8.6",
4
- "sourceCommit": "14077529ae736f07922c62010a266569ce034294"
4
+ "sourceCommit": "7ad401c6ecb8a3f50d53783c0091fcf65dccadd9"
5
5
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/codex-adapter",
3
- "version": "0.8.7",
3
+ "version": "0.8.8",
4
4
  "description": "Codex CLI host adapter for Principles Disciple — implements HostAdapter interface for OpenAI Codex CLI's stdin/stdout JSON hook model (ADR-0020).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -21,6 +21,7 @@ import { handleLifecycleRoute, disposeLifecycleModels } from './routes/lifecycle
21
21
  import { handleExaminerRoute } from './routes/examiner.js';
22
22
  import { handleActivationsRoute, disposeActivationsModels } from './routes/activations.js';
23
23
  import { handleReceiptsRoute, disposeReceiptsModels } from './routes/receipts.js';
24
+ import { handleCompatibilityScanRoute } from './routes/compatibility-scan.js';
24
25
  import { handleApprovalsGroupedRoute, disposeApprovalsGroupedModels } from './routes/approvals-grouped.js';
25
26
  import { handleGovernanceRoute, handleGovernanceExperienceRoute, resolveOwnerConfigSnapshot, disposeGovernanceModels } from './routes/governance.js';
26
27
  import { handleOwnerDecisionsRoute } from './routes/owner-decisions.js';
@@ -367,6 +368,12 @@ export function handleRequest(services) {
367
368
  asyncHandler(() => handleFailedTasksRoute(req, res, { workspaceDir: services.workspaceDir, subPath, featureFlags: services.feedbackFlags }))(req, res);
368
369
  return;
369
370
  }
371
+ // 5B-F: GET /api/runtime/compatibility-scan — read-only rule
372
+ // compatibility scan (reason-granular; never the per-row findings).
373
+ if (routePath === '/api/runtime/compatibility-scan') {
374
+ asyncHandler(() => handleCompatibilityScanRoute(req, res, services.workspaceDir))(req, res);
375
+ return;
376
+ }
370
377
  // PRI-533: GET /api/receipts/counts, /api/receipts/principles/:id
371
378
  if (routePath === '/api/receipts' || routePath.startsWith('/api/receipts/')) {
372
379
  const subPath = routePath.slice('/api/receipts'.length);
@@ -0,0 +1,18 @@
1
+ /**
2
+ * 5B-F — GET /api/runtime/compatibility-scan (read-only).
3
+ *
4
+ * Surfaces the SAME scan the installer preflight and `pd runtime
5
+ * compatibility-scan` use, reduced to reason-granular counts + samples (see
6
+ * `shared/compatibility-scan-contract.ts`). The scanner already holds the
7
+ * workspace DB connection semantics (`readonly`), so this route adds no
8
+ * runtime dependency — it reuses @principles/core/runtime in process.
9
+ *
10
+ * No mutation: the handler only constructs the read model and maps its result.
11
+ */
12
+ import type { IncomingMessage, ServerResponse } from 'node:http';
13
+ import type { ActivationCompatibilityScanResult } from '@principles/core/runtime';
14
+ import type { CompatibilityScanViewData } from '../../shared/compatibility-scan-contract.js';
15
+ /** Injectable seam so the route mapping is testable without seeding SQLite. */
16
+ export type CompatibilityScanner = (workspaceDir: string) => ActivationCompatibilityScanResult;
17
+ export declare function toCompatibilityScanView(result: ActivationCompatibilityScanResult): CompatibilityScanViewData;
18
+ export declare function handleCompatibilityScanRoute(req: IncomingMessage, res: ServerResponse, workspaceDir: string, scan?: CompatibilityScanner): Promise<void>;
@@ -0,0 +1,33 @@
1
+ import { ActivationCompatibilityReadModel } from '@principles/core/runtime';
2
+ import { sendSuccess, sendError, sendMethodNotAllowed, errorMessage } from '../utils/response.js';
3
+ const defaultScanner = workspaceDir => new ActivationCompatibilityReadModel({ workspaceDir }).scan();
4
+ export function toCompatibilityScanView(result) {
5
+ return {
6
+ status: result.status,
7
+ scannedActivations: result.scannedActivations,
8
+ unscannable: result.skipped.map(({ reason, count, sampleActivationIds }) => ({
9
+ reason,
10
+ count,
11
+ sampleActivationIds: [...sampleActivationIds],
12
+ })),
13
+ findingsTotal: result.findings.length,
14
+ ...(result.reason !== undefined ? { reason: result.reason } : {}),
15
+ ...(result.nextAction !== undefined ? { nextAction: result.nextAction } : {}),
16
+ };
17
+ }
18
+ /* eslint-disable @typescript-eslint/max-params */
19
+ export async function handleCompatibilityScanRoute(req, res, workspaceDir, scan = defaultScanner) {
20
+ if (req.method !== 'GET') {
21
+ sendMethodNotAllowed(res);
22
+ return;
23
+ }
24
+ try {
25
+ sendSuccess(res, toCompatibilityScanView(scan(workspaceDir)));
26
+ }
27
+ catch (error) {
28
+ // rc-9: a scan that throws is observable, not an empty list.
29
+ sendError(res, 500, 'compatibility_scan_failed', errorMessage(error), {
30
+ reason: 'compatibility_scan_failed',
31
+ });
32
+ }
33
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * 5B-F — read-only "rule compatibility scan" view shared by the console server
3
+ * and the browser.
4
+ *
5
+ * This is a DELIBERATELY reduced projection of the core scan result:
6
+ * reason-granular counts + bounded activation-id samples, never the per-row
7
+ * findings array. The console needs to answer "did this upgrade verify my
8
+ * rules?", not to re-render the CLI report.
9
+ *
10
+ * Type-only: the browser validates the wire payload in
11
+ * `ui/utils/validators.ts`; the server maps it in `server/routes/compatibility-scan.ts`.
12
+ */
13
+ export interface CompatibilityScanUnscannableView {
14
+ reason: string;
15
+ count: number;
16
+ sampleActivationIds: string[];
17
+ }
18
+ export interface CompatibilityScanViewData {
19
+ status: 'clean' | 'incomplete' | 'legacy_dependency' | 'no_state_db' | 'scan_failed';
20
+ scannedActivations: number;
21
+ /** Empty = every ACTIVE row was read. */
22
+ unscannable: CompatibilityScanUnscannableView[];
23
+ findingsTotal: number;
24
+ reason?: string;
25
+ nextAction?: string;
26
+ }
@@ -0,0 +1 @@
1
+ export {};