create-principles-disciple 1.134.9 → 1.135.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 (66) hide show
  1. package/console/dist/server/routes/update.js +41 -1
  2. package/console/dist/server/update/mutation-controller.d.ts +41 -1
  3. package/console/dist/server/update/mutation-controller.js +34 -2
  4. package/console/dist/ui/components/onboarding/slashCommands.js +0 -1
  5. package/console/dist/ui/i18n/en.json +0 -1
  6. package/console/dist/ui/i18n/zh-CN.json +0 -1
  7. package/console/dist/web/assets/app.js +1 -4
  8. package/core/dist/index.d.ts +1 -2
  9. package/core/dist/index.d.ts.map +1 -1
  10. package/core/dist/index.js +0 -2
  11. package/core/dist/index.js.map +1 -1
  12. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +1 -17
  13. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  14. package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js +1 -1
  15. package/core/dist/runtime-v2/feature-flags/feature-flag-lifecycle.js.map +1 -1
  16. package/core/dist/runtime-v2/index.d.ts +0 -5
  17. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  18. package/core/dist/runtime-v2/index.js +0 -4
  19. package/core/dist/runtime-v2/index.js.map +1 -1
  20. package/core/dist/runtime-v2/types/index.d.ts +0 -2
  21. package/core/dist/runtime-v2/types/index.d.ts.map +1 -1
  22. package/core/dist/runtime-v2/types/index.js +0 -1
  23. package/core/dist/runtime-v2/types/index.js.map +1 -1
  24. package/core/package.json +1 -1
  25. package/dist/update/release-manager-authority.d.ts +13 -10
  26. package/dist/update/release-manager-authority.d.ts.map +1 -1
  27. package/dist/update/release-manager-authority.js +24 -14
  28. package/dist/update/release-manager-authority.js.map +1 -1
  29. package/dist/update/release-metadata-publisher.d.ts +142 -0
  30. package/dist/update/release-metadata-publisher.d.ts.map +1 -0
  31. package/dist/update/release-metadata-publisher.js +340 -0
  32. package/dist/update/release-metadata-publisher.js.map +1 -0
  33. package/package.json +2 -2
  34. package/plugin/dist/bundle.js +734 -742
  35. package/plugin/dist/governance-audit.js +172 -172
  36. package/plugin/dist/hooks/after-tool-call-helpers.d.ts +1 -1
  37. package/plugin/dist/rulehost-evidence.js +182 -182
  38. package/plugin/dist/templates/langs/en/skills/pd-mentor/SKILL.md +2 -5
  39. package/plugin/dist/templates/langs/zh/skills/pd-mentor/SKILL.md +2 -5
  40. package/plugin/dist/utils/workspace-resolver.d.ts +1 -1
  41. package/plugin/docs/COMMAND_REFERENCE.md +1 -21
  42. package/plugin/docs/COMMAND_REFERENCE_EN.md +0 -20
  43. package/plugin/openclaw.plugin.json +1 -1
  44. package/plugin/package.json +1 -1
  45. package/plugin/templates/langs/en/skills/pd-mentor/SKILL.md +2 -5
  46. package/plugin/templates/langs/zh/skills/pd-mentor/SKILL.md +2 -5
  47. package/release-manager/dist/update/release-manager-authority.d.ts +13 -10
  48. package/release-manager/dist/update/release-manager-authority.d.ts.map +1 -1
  49. package/release-manager/dist/update/release-manager-authority.js +24 -14
  50. package/release-manager/dist/update/release-manager-authority.js.map +1 -1
  51. package/release-manager/dist/update/release-metadata-publisher.d.ts +142 -0
  52. package/release-manager/dist/update/release-metadata-publisher.d.ts.map +1 -0
  53. package/release-manager/dist/update/release-metadata-publisher.js +340 -0
  54. package/release-manager/dist/update/release-metadata-publisher.js.map +1 -0
  55. package/release-manager/package.json +2 -2
  56. package/core/dist/runtime-v2/runtime-selector.d.ts +0 -77
  57. package/core/dist/runtime-v2/runtime-selector.d.ts.map +0 -1
  58. package/core/dist/runtime-v2/runtime-selector.js +0 -23
  59. package/core/dist/runtime-v2/runtime-selector.js.map +0 -1
  60. package/core/dist/runtime-v2/types/runtime-summary-types.d.ts +0 -93
  61. package/core/dist/runtime-v2/types/runtime-summary-types.d.ts.map +0 -1
  62. package/core/dist/runtime-v2/types/runtime-summary-types.js +0 -35
  63. package/core/dist/runtime-v2/types/runtime-summary-types.js.map +0 -1
  64. package/plugin/dist/commands/evolution-status.d.ts +0 -4
  65. package/plugin/dist/service/runtime-summary-service.d.ts +0 -156
  66. package/plugin/dist/types/runtime-summary.d.ts +0 -1
@@ -1827,7 +1827,9 @@ function releaseManagerFlagEnabled(workspaceDir) {
1827
1827
  }
1828
1828
  /**
1829
1829
  * PRI-698 Phase 1: gates routing /apply-full to the ReleaseManager write
1830
- * orchestration. Default off — the legacy updater serves with an explicit
1830
+ * orchestration. The registry default is ON (2026-09-07 graduation), so an
1831
+ * install with no explicit config value IS served by the ReleaseManager; only
1832
+ * an explicit `enabled: false` routes to the legacy updater, with the
1831
1833
  * `release_manager_write_disabled` fallback reason. Requires the shadow flag
1832
1834
  * too (the whole authority layer is gated on it first).
1833
1835
  */
@@ -2118,6 +2120,8 @@ async function syncReleaseManagerAuthority(workspaceDir) {
2118
2120
  updateMutationController.unregister(rmKind, RELEASE_MANAGER_AUTHORITY);
2119
2121
  // PRI-698 Phase 1: a structurally-ready apply-full with the write flag
2120
2122
  // off is a deliberate gate, not an unavailability — name it distinctly.
2123
+ // PRI-729: the reason is annotated with the declared vocabulary type, so
2124
+ // an undocumented fallback is a compile error — not a silent string.
2121
2125
  const reason = readiness.ready && rmKind === 'apply-full'
2122
2126
  ? 'release_manager_write_disabled'
2123
2127
  : `release_manager_unavailable:${readiness.reasons.join(',')}`;
@@ -2131,6 +2135,40 @@ const UPDATE_MUTATION_KINDS = new Map([
2131
2135
  ['/apply-full', 'apply-full'],
2132
2136
  ['/rollback', 'rollback'],
2133
2137
  ]);
2138
+ /** kind → wire path, for routing telemetry only. */
2139
+ const MUTATION_KIND_PATHS = new Map([...UPDATE_MUTATION_KINDS].map(([subPath, kind]) => [kind, `/api/update${subPath}`]));
2140
+ /**
2141
+ * PRI-729 — fail-loud routing telemetry (ADR-0024 D-1).
2142
+ *
2143
+ * The compatibility fallback is a designed migration state, and a migration
2144
+ * state nobody can see is indistinguishable from an accident. The
2145
+ * `X-PD-Mutation-Fallback-Reason` response header is per-request; this emits
2146
+ * ONE console line whenever a kind's resolved authority CHANGES, so an operator
2147
+ * can see exactly which kinds are still served by the legacy updater and why —
2148
+ * without the noise of the Companion's 6-hourly `/check` polling.
2149
+ *
2150
+ * Built from `describeGovernance()` rather than `resolveAuthority()`: the
2151
+ * former reports `active: 'none'` instead of throwing, so the telemetry needs
2152
+ * no alternate arm for the contract-impossible "no authority registered" state
2153
+ * (ERR-099 — a defensive alternate for an unreachable state ships uncovered).
2154
+ * The line is assembled branch-free from reachable-only parts.
2155
+ */
2156
+ const lastLoggedRouting = new Map();
2157
+ function logMutationRouting() {
2158
+ const governance = updateMutationController.describeGovernance();
2159
+ for (const kind of MUTATION_KINDS) {
2160
+ const info = governance[kind];
2161
+ const detail = [
2162
+ info.fallback ? 'compatibility fallback' : 'preferred authority',
2163
+ info.fallbackReason ?? '',
2164
+ ].filter((part) => part.length > 0).join(': ');
2165
+ const line = `${info.active} (${detail})`;
2166
+ if (lastLoggedRouting.get(kind) === line)
2167
+ continue;
2168
+ lastLoggedRouting.set(kind, line);
2169
+ console.log(`[update] ${MUTATION_KIND_PATHS.get(kind) ?? kind} → ${line}`);
2170
+ }
2171
+ }
2134
2172
  export async function handleUpdateRoute(req, res, workspaceDir, subPath) {
2135
2173
  const kind = UPDATE_MUTATION_KINDS.get(subPath);
2136
2174
  if (kind === undefined) {
@@ -2141,5 +2179,7 @@ export async function handleUpdateRoute(req, res, workspaceDir, subPath) {
2141
2179
  // readiness state before the controller resolves the authority. Pure
2142
2180
  // routing/decision work — no runtime mutation happens here.
2143
2181
  await syncReleaseManagerAuthority(workspaceDir);
2182
+ // PRI-729: make the routing decision observable (log on change only).
2183
+ logMutationRouting();
2144
2184
  await updateMutationController.dispatch(req, res, { workspaceDir }, kind);
2145
2185
  }
@@ -44,6 +44,40 @@ export declare const RELEASE_MANAGER_AUTHORITY: 'release-manager';
44
44
  export declare const PREFERRED_MUTATION_AUTHORITY: "release-manager";
45
45
  export type MutationKind = 'check' | 'apply' | 'apply-full' | 'rollback';
46
46
  export declare const MUTATION_KINDS: readonly MutationKind[];
47
+ /**
48
+ * PRI-729 — the closed vocabulary of compatibility-fallback reasons (ADR-0024 D-1).
49
+ *
50
+ * The ReleaseManager is the PREFERRED authority for every mutation kind and is
51
+ * consulted for all of them on every request (`createReleaseManagerAuthority`
52
+ * reports per-kind readiness before the controller resolves anything). A
53
+ * mutation therefore reaches the legacy console updater ONLY through one of the
54
+ * reasons below: the compatibility fallback is a DESIGNED migration decision,
55
+ * not an accident of which authority happened to register.
56
+ *
57
+ * Keeping the vocabulary closed is what makes "only an explicitly designed
58
+ * compatibility fallback may exist" checkable rather than aspirational — an
59
+ * undeclared reason is a type error at every call site and is reported loud at
60
+ * runtime (see `setFallbackReason`), never served silently.
61
+ *
62
+ * The parameterised forms carry a machine-readable sub-code after `:`:
63
+ * - `release_manager_unavailable:<readiness reasons>` — the authority module
64
+ * reports the kind not-ready (metadata source, layout, journal, or a
65
+ * capability the ReleaseManager does not implement).
66
+ * - `release_manager_refused_pre_transaction:<reason>` — the authority was
67
+ * ready but refused BEFORE opening a transaction (zero side effects), so
68
+ * the compatibility fallback may serve the request.
69
+ */
70
+ export type CompatFallbackReason = 'release_manager_shadow_disabled' | 'release_manager_write_disabled' | 'installer_missing' | 'authority_module_unavailable' | `release_manager_unavailable:${string}` | `release_manager_refused_pre_transaction:${string}`;
71
+ /** Literal (non-parameterised) compatibility-fallback reasons. */
72
+ export declare const COMPAT_FALLBACK_REASON_LITERALS: readonly ['release_manager_shadow_disabled', 'release_manager_write_disabled', 'installer_missing', 'authority_module_unavailable'];
73
+ /** Parameterised compatibility-fallback reason prefixes (sub-code follows `:`). */
74
+ export declare const COMPAT_FALLBACK_REASON_PREFIXES: readonly ['release_manager_unavailable:', 'release_manager_refused_pre_transaction:'];
75
+ /**
76
+ * True when `reason` belongs to the declared compatibility-fallback vocabulary.
77
+ * The wiring's runtime guard uses this so an undeclared reason is reported loud
78
+ * instead of being served as an undocumented degradation.
79
+ */
80
+ export declare function isDeclaredCompatFallbackReason(reason: string): boolean;
47
81
  export interface MutationContext {
48
82
  readonly workspaceDir: string;
49
83
  }
@@ -79,8 +113,14 @@ export declare class MutationController {
79
113
  * Emitted as the `X-PD-Mutation-Fallback-Reason` header whenever a dispatch
80
114
  * actually resolves to the fallback, and surfaced by describeGovernance().
81
115
  * Pass null to clear.
116
+ *
117
+ * PRI-729: the reason must be a member of the closed compatibility-fallback
118
+ * vocabulary. An undeclared reason is a programming error — a fallback was
119
+ * introduced without being designed — so it is reported loud (rc-9) while
120
+ * still being recorded, because refusing the Owner's mutation over a
121
+ * diagnostic string would be the worse failure.
82
122
  */
83
- setFallbackReason(kind: MutationKind, reason: string | null): void;
123
+ setFallbackReason(kind: MutationKind, reason: CompatFallbackReason | null): void;
84
124
  getFallbackReason(kind: MutationKind): string | undefined;
85
125
  register(kind: MutationKind, authority: MutationAuthority): void;
86
126
  unregister(kind: MutationKind, name: string): boolean;
@@ -11,6 +11,28 @@ export const RELEASE_MANAGER_AUTHORITY = 'release-manager';
11
11
  */
12
12
  export const PREFERRED_MUTATION_AUTHORITY = RELEASE_MANAGER_AUTHORITY;
13
13
  export const MUTATION_KINDS = ['check', 'apply', 'apply-full', 'rollback'];
14
+ /** Literal (non-parameterised) compatibility-fallback reasons. */
15
+ export const COMPAT_FALLBACK_REASON_LITERALS = [
16
+ 'release_manager_shadow_disabled',
17
+ 'release_manager_write_disabled',
18
+ 'installer_missing',
19
+ 'authority_module_unavailable',
20
+ ];
21
+ /** Parameterised compatibility-fallback reason prefixes (sub-code follows `:`). */
22
+ export const COMPAT_FALLBACK_REASON_PREFIXES = [
23
+ 'release_manager_unavailable:',
24
+ 'release_manager_refused_pre_transaction:',
25
+ ];
26
+ /**
27
+ * True when `reason` belongs to the declared compatibility-fallback vocabulary.
28
+ * The wiring's runtime guard uses this so an undeclared reason is reported loud
29
+ * instead of being served as an undocumented degradation.
30
+ */
31
+ export function isDeclaredCompatFallbackReason(reason) {
32
+ if (COMPAT_FALLBACK_REASON_LITERALS.includes(reason))
33
+ return true;
34
+ return COMPAT_FALLBACK_REASON_PREFIXES.some((prefix) => reason.startsWith(prefix) && reason.length > prefix.length);
35
+ }
14
36
  export class MutationController {
15
37
  authorities = new Map();
16
38
  /** PRI-672: per-kind reason the fallback is serving (machine-readable, rc-9). */
@@ -21,14 +43,24 @@ export class MutationController {
21
43
  * Emitted as the `X-PD-Mutation-Fallback-Reason` header whenever a dispatch
22
44
  * actually resolves to the fallback, and surfaced by describeGovernance().
23
45
  * Pass null to clear.
46
+ *
47
+ * PRI-729: the reason must be a member of the closed compatibility-fallback
48
+ * vocabulary. An undeclared reason is a programming error — a fallback was
49
+ * introduced without being designed — so it is reported loud (rc-9) while
50
+ * still being recorded, because refusing the Owner's mutation over a
51
+ * diagnostic string would be the worse failure.
24
52
  */
25
53
  setFallbackReason(kind, reason) {
26
54
  if (reason === null) {
27
55
  this.fallbackReasons.delete(kind);
56
+ return;
28
57
  }
29
- else {
30
- this.fallbackReasons.set(kind, reason);
58
+ if (!isDeclaredCompatFallbackReason(reason)) {
59
+ console.error(`[mutation-controller] undeclared compatibility-fallback reason for kind "${kind}": ${JSON.stringify(reason)}. `
60
+ + 'Every compatibility fallback must be declared in mutation-controller.ts '
61
+ + '(COMPAT_FALLBACK_REASON_LITERALS / COMPAT_FALLBACK_REASON_PREFIXES).');
31
62
  }
63
+ this.fallbackReasons.set(kind, reason);
32
64
  }
33
65
  getFallbackReason(kind) {
34
66
  return this.fallbackReasons.get(kind);
@@ -18,6 +18,5 @@ export const ONBOARDING_SLASH_COMMANDS = [
18
18
  { name: '/pd-pain', descriptionKey: 'pages.welcome.step3.commandDescriptions.pdPain' },
19
19
  { name: '/pd-help', alias: '/pdh', descriptionKey: 'pages.welcome.step3.commandDescriptions.pdHelp' },
20
20
  { name: '/pd-context', descriptionKey: 'pages.welcome.step3.commandDescriptions.pdContext' },
21
- { name: '/pd-evolution-status', descriptionKey: 'pages.welcome.step3.commandDescriptions.pdEvolutionStatus' },
22
21
  { name: '/pd-focus', descriptionKey: 'pages.welcome.step3.commandDescriptions.pdFocus' },
23
22
  ];
@@ -1609,7 +1609,6 @@
1609
1609
  "pdPain": "Report pain from OpenClaw session",
1610
1610
  "pdHelp": "Show all commands and usage guide",
1611
1611
  "pdContext": "Control context injection",
1612
- "pdEvolutionStatus": "Show evolution loop status",
1613
1612
  "pdFocus": "Manage CURRENT_FOCUS.md"
1614
1613
  },
1615
1614
  "nextButton": "Next",
@@ -1609,7 +1609,6 @@
1609
1609
  "pdPain": "从 OpenClaw 会话报告 pain",
1610
1610
  "pdHelp": "显示所有命令和使用指南",
1611
1611
  "pdContext": "控制上下文注入",
1612
- "pdEvolutionStatus": "查看 evolution 闭环状态",
1613
1612
  "pdFocus": "管理 CURRENT_FOCUS.md"
1614
1613
  },
1615
1614
  "nextButton": "下一步",