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
@@ -28,7 +28,6 @@ I'm your intelligent mentor, helping you understand and use all features of Prin
28
28
  | `/pd-init` | Initialize strategy | New project startup |
29
29
  | `/pd-bootstrap` | Environment tool scan and upgrade | Tool upgrade |
30
30
  | `/pd-research` | Initiate tool upgrade research | Deep research |
31
- | `/pd-evolution-status` | View trust score and security stage | Permission check |
32
31
  | `/pd-status` | View system status (GFI and Pain Dictionary) | Health check |
33
32
  | `/pd-help` | Get interactive command guidance | This skill |
34
33
 
@@ -55,7 +54,6 @@ I'm your intelligent mentor, helping you understand and use all features of Prin
55
54
 
56
55
  **Recommended Flow**:
57
56
  1. `/pd-status` - Check system status (GFI and Pain Dictionary)
58
- 2. `/pd-evolution-status` - View EP tier and evolution status
59
57
 
60
58
  **Script**: "Problems are the fuel of evolution. Let me help you diagnose and fix systematically."
61
59
 
@@ -66,8 +64,7 @@ I'm your intelligent mentor, helping you understand and use all features of Prin
66
64
  **Trigger**: The user explicitly asks for a Principles Disciple progress or health review (mentioning PD, EP, GFI, or system status)
67
65
 
68
66
  **Recommended Flow**:
69
- 1. `/pd-evolution-status` - View current trust score
70
- 2. `/pd-status` - Check GFI and Pain Dictionary status
67
+ 1. `/pd-status` - Check GFI and Pain Dictionary status
71
68
 
72
69
  **Script**: "Let me help you review the current system status."
73
70
 
@@ -78,7 +75,7 @@ I'm your intelligent mentor, helping you understand and use all features of Prin
78
75
  **Trigger**: The user asks about Principles Disciple permissions, blocks, or security stages
79
76
 
80
77
  **Recommended Flow**:
81
- 1. `/pd-evolution-status` - View trust score and security stage
78
+ 1. `/pd-status` - Check system status
82
79
  2. Explain current stage's capability boundaries
83
80
 
84
81
  **Script**: "Trust is earned, not given. Let me help you understand your current security level."
@@ -28,7 +28,6 @@ disable-model-invocation: true
28
28
  | `/pd-init` | 初始化战略 | 新项目启动 |
29
29
  | `/pd-bootstrap` | 环境工具扫描与升级 | 装备升级 |
30
30
  | `/pd-research` | 发起工具升级研究 | 深度调研 |
31
- | `/pd-evolution-status` | 查看EP等级与安全状态 | 状态查询 |
32
31
  | `/pd-status` | 查看系统状态(GFI和痛苦词典) | 健康检查 |
33
32
  | `/pd-help` | 获取交互式命令引导 | 本技能 |
34
33
 
@@ -55,7 +54,6 @@ disable-model-invocation: true
55
54
 
56
55
  **推荐流程**:
57
56
  1. `/pd-status` - 检查系统状态(GFI 和痛苦词典)
58
- 2. `/pd-evolution-status` - 查看 EP 等级和进化状态
59
57
 
60
58
  **话术**: "问题就是进化的燃料。让我帮你系统化地诊断和修复。"
61
59
 
@@ -66,8 +64,7 @@ disable-model-invocation: true
66
64
  **触发条件**: 用户明确要求 Principles Disciple 的进度或健康回顾(提及 PD、EP、GFI、系统状态)
67
65
 
68
66
  **推荐流程**:
69
- 1. `/pd-evolution-status` - 查看当前信任积分
70
- 2. `/pd-status` - 查看 GFI 和痛苦词典状态
67
+ 1. `/pd-status` - 查看 GFI 和痛苦词典状态
71
68
 
72
69
  **话术**: "让我帮你回顾一下系统状态。"
73
70
 
@@ -78,7 +75,7 @@ disable-model-invocation: true
78
75
  **触发条件**: 用户询问 Principles Disciple 的权限、拦截或安全等级
79
76
 
80
77
  **推荐流程**:
81
- 1. `/pd-evolution-status` - 查看信任积分和安全等级
78
+ 1. `/pd-status` - 查看系统状态
82
79
  2. 解释当前等级的能力边界
83
80
 
84
81
  **话术**: "信任是挣来的,不是给的。让我帮你了解当前的安全等级。"
@@ -59,7 +59,7 @@ export declare function resolveCommandWorkspaceDir(api: OpenClawPluginApi, ctx:
59
59
  * the wrong workspace.
60
60
  *
61
61
  * @param ctx - Plugin command context (has workspaceDir + config properties)
62
- * @param source - Source label for error messages (e.g. 'evolution-status', 'pain')
62
+ * @param source - Source label for error messages (e.g. 'pain', 'pd-status')
63
63
  * @param logger - Optional logger for divergence warnings (the plugin API logger)
64
64
  */
65
65
  export declare function resolvePluginCommandWorkspaceDir(ctx: PluginCommandContext, source: string, logger?: {
@@ -1,7 +1,7 @@
1
1
  # Principles Disciple Command Reference
2
2
 
3
3
  > 当前版本重点:EP (Evolution Points) 系统已接替 trust score 成为唯一门控机制。
4
- > `rollback` 只回滚 `user_empathy` slice,`/pd-evolution-status` 读的是运行时 summary。
4
+ > `rollback` 只回滚 `user_empathy` slice。
5
5
 
6
6
  ---
7
7
 
@@ -9,32 +9,12 @@
9
9
 
10
10
  | 命令 | 用途 | 当前口径 |
11
11
  |---|---|---|
12
- | `/pd-evolution-status` | 查看控制面与进化面的当前状态 | 读取 `RuntimeSummaryService` 的 canonical state |
13
12
  | `/pd-status empathy` | 查看情绪/共情事件统计 | 用于观察 `user_empathy` 与 `system_infer` 事件是否稳定落日志 |
14
13
  | `/pd-rollback last` | 回滚最近一次情绪惩罚 | 只回滚 `user_empathy` 对应的 GFI slice |
15
14
  | `/pd-help` | 显示帮助 | |
16
15
 
17
16
  ---
18
17
 
19
- ## `/pd-evolution-status`
20
-
21
- ### 它现在显示什么
22
-
23
- - `EP Tier`: 当前 EP 等级 (Seed → Sprout → Sapling → Tree → Forest)
24
- - `Session GFI`: 当前会话 GFI 与峰值
25
- - `GFI Sources`: 当前 summary 能解释出来的 friction 来源
26
- - `Pain Flag`: pain flag 是否激活
27
- - `Gate Events`: 最近的 block / bypass
28
- - `Queue / Directive`: evolution queue 与 directive 的当前状态
29
-
30
- ### 重要说明
31
-
32
- - 这是当前控制面的权威读模型入口。
33
- - 它优先读取 canonical `.state`,并尽量合并 live session / buffered events。
34
- - 如果数据不完整,会显示 `partial` 或 warning,而不是静默显示 `0`。
35
-
36
- ---
37
-
38
18
  ## `/pd-rollback`
39
19
 
40
20
  ### 当前行为
@@ -8,31 +8,11 @@
8
8
 
9
9
  | Command | Purpose |
10
10
  |---|---|
11
- | `/pd-evolution-status` | View EP tier, GFI, pain flag, and gate events |
12
11
  | `/pd-status empathy` | Inspect empathy/frustration event statistics |
13
12
  | `/pd-rollback last` | Roll back the latest empathy penalty |
14
13
 
15
14
  ---
16
15
 
17
- ## `/pd-evolution-status`
18
-
19
- ### What it shows
20
-
21
- - `EP Tier`: Current evolution tier (Seed → Sprout → Sapling → Tree → Forest)
22
- - `Session GFI`: Current session GFI and peak
23
- - `GFI Sources`: Currently attributable friction sources
24
- - `Pain Flag`: Whether a pain flag is active
25
- - `Gate Events`: Recent block / bypass counts
26
- - `Queue / Directive`: Evolution queue and directive state
27
-
28
- ### Important notes
29
-
30
- - This is the main operator entry point into the control plane.
31
- - It reads canonical `.state` and tries to merge live session state and buffered events when available.
32
- - When data is incomplete, it surfaces `partial` or warnings instead of silently printing `0`.
33
-
34
- ---
35
-
36
16
  ## `/pd-rollback`
37
17
 
38
18
  ### Current behavior
@@ -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": "1.233.1",
5
+ "version": "1.234.0",
6
6
  "activation": {
7
7
  "onStartup": true,
8
8
  "onCapabilities": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "principles-disciple",
3
- "version": "1.233.1",
3
+ "version": "1.234.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",
@@ -28,7 +28,6 @@ I'm your intelligent mentor, helping you understand and use all features of Prin
28
28
  | `/pd-init` | Initialize strategy | New project startup |
29
29
  | `/pd-bootstrap` | Environment tool scan and upgrade | Tool upgrade |
30
30
  | `/pd-research` | Initiate tool upgrade research | Deep research |
31
- | `/pd-evolution-status` | View trust score and security stage | Permission check |
32
31
  | `/pd-status` | View system status (GFI and Pain Dictionary) | Health check |
33
32
  | `/pd-help` | Get interactive command guidance | This skill |
34
33
 
@@ -55,7 +54,6 @@ I'm your intelligent mentor, helping you understand and use all features of Prin
55
54
 
56
55
  **Recommended Flow**:
57
56
  1. `/pd-status` - Check system status (GFI and Pain Dictionary)
58
- 2. `/pd-evolution-status` - View EP tier and evolution status
59
57
 
60
58
  **Script**: "Problems are the fuel of evolution. Let me help you diagnose and fix systematically."
61
59
 
@@ -66,8 +64,7 @@ I'm your intelligent mentor, helping you understand and use all features of Prin
66
64
  **Trigger**: The user explicitly asks for a Principles Disciple progress or health review (mentioning PD, EP, GFI, or system status)
67
65
 
68
66
  **Recommended Flow**:
69
- 1. `/pd-evolution-status` - View current trust score
70
- 2. `/pd-status` - Check GFI and Pain Dictionary status
67
+ 1. `/pd-status` - Check GFI and Pain Dictionary status
71
68
 
72
69
  **Script**: "Let me help you review the current system status."
73
70
 
@@ -78,7 +75,7 @@ I'm your intelligent mentor, helping you understand and use all features of Prin
78
75
  **Trigger**: The user asks about Principles Disciple permissions, blocks, or security stages
79
76
 
80
77
  **Recommended Flow**:
81
- 1. `/pd-evolution-status` - View trust score and security stage
78
+ 1. `/pd-status` - Check system status
82
79
  2. Explain current stage's capability boundaries
83
80
 
84
81
  **Script**: "Trust is earned, not given. Let me help you understand your current security level."
@@ -28,7 +28,6 @@ disable-model-invocation: true
28
28
  | `/pd-init` | 初始化战略 | 新项目启动 |
29
29
  | `/pd-bootstrap` | 环境工具扫描与升级 | 装备升级 |
30
30
  | `/pd-research` | 发起工具升级研究 | 深度调研 |
31
- | `/pd-evolution-status` | 查看EP等级与安全状态 | 状态查询 |
32
31
  | `/pd-status` | 查看系统状态(GFI和痛苦词典) | 健康检查 |
33
32
  | `/pd-help` | 获取交互式命令引导 | 本技能 |
34
33
 
@@ -55,7 +54,6 @@ disable-model-invocation: true
55
54
 
56
55
  **推荐流程**:
57
56
  1. `/pd-status` - 检查系统状态(GFI 和痛苦词典)
58
- 2. `/pd-evolution-status` - 查看 EP 等级和进化状态
59
57
 
60
58
  **话术**: "问题就是进化的燃料。让我帮你系统化地诊断和修复。"
61
59
 
@@ -66,8 +64,7 @@ disable-model-invocation: true
66
64
  **触发条件**: 用户明确要求 Principles Disciple 的进度或健康回顾(提及 PD、EP、GFI、系统状态)
67
65
 
68
66
  **推荐流程**:
69
- 1. `/pd-evolution-status` - 查看当前信任积分
70
- 2. `/pd-status` - 查看 GFI 和痛苦词典状态
67
+ 1. `/pd-status` - 查看 GFI 和痛苦词典状态
71
68
 
72
69
  **话术**: "让我帮你回顾一下系统状态。"
73
70
 
@@ -78,7 +75,7 @@ disable-model-invocation: true
78
75
  **触发条件**: 用户询问 Principles Disciple 的权限、拦截或安全等级
79
76
 
80
77
  **推荐流程**:
81
- 1. `/pd-evolution-status` - 查看信任积分和安全等级
78
+ 1. `/pd-status` - 查看系统状态
82
79
  2. 解释当前等级的能力边界
83
80
 
84
81
  **话术**: "信任是挣来的,不是给的。让我帮你了解当前的安全等级。"
@@ -27,26 +27,29 @@
27
27
  * decision that must stay explicit (see the analysis doc §4.3); it can never
28
28
  * be relaxed for apply/apply-full/rollback.
29
29
  *
30
- * apply/apply-full/rollback stay structurally not-ready until the Phase 4
31
- * activation rollout opens the `shadow_mode_read_only` gate (its own go/no-go);
32
- * until then these kinds explicitly fall back to the legacy console updater —
33
- * TEMPORARY migration debt per ADR-0024 D-1, not a supported long-term state.
30
+ * `apply` and `rollback` stay structurally not-ready until their own work
31
+ * lands; until then these kinds explicitly fall back to the legacy console
32
+ * updater — TEMPORARY migration debt per ADR-0024 D-1, not a supported
33
+ * long-term state. The two gaps are independent (PRI-729 audit §4):
34
+ * `rollback` waits on the Phase 2 same-version restore (`ROLLBACK_AVAILABLE`),
35
+ * while `apply` is the plugin-diff mechanism, which the ReleaseManager does not
36
+ * implement at all — no signed whole-payload release can express it.
34
37
  *
35
38
  * PRI-698 Phase 1: `apply-full` (full-runtime update) is served by the real
36
39
  * ReleaseManager.apply() orchestration (installer + journal) and reports the
37
40
  * same base readiness as `check`. The CONSOLE additionally gates the routing
38
- * behind the `release_manager_write_authority` flag (default off) — flag-off
39
- * dispatches fall back explicitly with `release_manager_write_disabled`.
40
- * `apply` (the plugin-diff mechanism, which the ReleaseManager does not
41
- * implement) and `rollback` (Phase 2 — must prove same-version restore first)
42
- * stay structurally not-ready with explicit reasons.
41
+ * behind the `release_manager_write_authority` flag (default ON since the
42
+ * 2026-09-07 graduation) — flag-off dispatches fall back explicitly with
43
+ * `release_manager_write_disabled`.
43
44
  */
44
45
  import { ReleaseManager, type InstallStatus, type LegacyUpdaterDecision } from './release-manager.js';
45
46
  import { type ReleaseMetadataSource } from './release-metadata-source.js';
46
47
  /** Mutation kinds the console MutationController routes (PRI-659 contract). */
47
48
  export declare const RELEASE_MANAGER_AUTHORITY_KINDS: readonly ['check', 'apply', 'apply-full', 'rollback'];
48
49
  export type ReleaseManagerAuthorityKind = (typeof RELEASE_MANAGER_AUTHORITY_KINDS)[number];
49
- export type ReleaseManagerAuthorityReason = 'metadata_source_unconfigured' | 'bootstrap_not_installed' | 'install_state_corrupt' | 'journal_not_supported' | 'rollback_not_available';
50
+ /** Why a capability is structurally absent from the ReleaseManager (not a mere precondition). */
51
+ export type ReleaseManagerStructuralGap = 'rollback_not_available' | 'plugin_diff_not_supported';
52
+ export type ReleaseManagerAuthorityReason = 'metadata_source_unconfigured' | 'bootstrap_not_installed' | 'install_state_corrupt' | 'journal_not_supported' | ReleaseManagerStructuralGap;
50
53
  export interface ReleaseManagerAuthorityReadiness {
51
54
  readonly ready: boolean;
52
55
  readonly reasons: readonly ReleaseManagerAuthorityReason[];
@@ -1 +1 @@
1
- {"version":3,"file":"release-manager-authority.d.ts","sourceRoot":"","sources":["../../src/update/release-manager-authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAGH,OAAO,EACL,cAAc,EAEd,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAgC,KAAK,qBAAqB,EAAE,MAAM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AM,IAAI,CAAC;IAC1B,mFAAmF;IACnF,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC,CAAC;CAC1F;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;IACjC,mFAAmF;IACnF,QAAQ,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,2BAA2B,EAAE,gCAAgC,CAAC,CAAC,CAAC;IAChG;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAE,qBAAqB,CAAC;CAChD;AAkBD,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,8BAA8B,GACtC,uBAAuB,CAkFzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,OAAO,GAAG;IAChE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;CAC5B,CAeA"}
@@ -27,19 +27,20 @@
27
27
  * decision that must stay explicit (see the analysis doc §4.3); it can never
28
28
  * be relaxed for apply/apply-full/rollback.
29
29
  *
30
- * apply/apply-full/rollback stay structurally not-ready until the Phase 4
31
- * activation rollout opens the `shadow_mode_read_only` gate (its own go/no-go);
32
- * until then these kinds explicitly fall back to the legacy console updater —
33
- * TEMPORARY migration debt per ADR-0024 D-1, not a supported long-term state.
30
+ * `apply` and `rollback` stay structurally not-ready until their own work
31
+ * lands; until then these kinds explicitly fall back to the legacy console
32
+ * updater — TEMPORARY migration debt per ADR-0024 D-1, not a supported
33
+ * long-term state. The two gaps are independent (PRI-729 audit §4):
34
+ * `rollback` waits on the Phase 2 same-version restore (`ROLLBACK_AVAILABLE`),
35
+ * while `apply` is the plugin-diff mechanism, which the ReleaseManager does not
36
+ * implement at all — no signed whole-payload release can express it.
34
37
  *
35
38
  * PRI-698 Phase 1: `apply-full` (full-runtime update) is served by the real
36
39
  * ReleaseManager.apply() orchestration (installer + journal) and reports the
37
40
  * same base readiness as `check`. The CONSOLE additionally gates the routing
38
- * behind the `release_manager_write_authority` flag (default off) — flag-off
39
- * dispatches fall back explicitly with `release_manager_write_disabled`.
40
- * `apply` (the plugin-diff mechanism, which the ReleaseManager does not
41
- * implement) and `rollback` (Phase 2 — must prove same-version restore first)
42
- * stay structurally not-ready with explicit reasons.
41
+ * behind the `release_manager_write_authority` flag (default ON since the
42
+ * 2026-09-07 graduation) — flag-off dispatches fall back explicitly with
43
+ * `release_manager_write_disabled`.
43
44
  */
44
45
  import * as fs from 'node:fs';
45
46
  import { ReleaseManager, ReleaseManagerError, } from './release-manager.js';
@@ -49,9 +50,14 @@ import { resolveReleaseMetadataSource } from './release-metadata-source.js';
49
50
  export const RELEASE_MANAGER_AUTHORITY_KINDS = ['check', 'apply', 'apply-full', 'rollback'];
50
51
  /**
51
52
  * Structural gate for the kinds whose write path does not exist yet:
52
- * `rollback` arrives with the Phase 2 restore migration; `apply` (plugin
53
- * diff) is not a ReleaseManager mechanism at all. `apply-full` left this
54
- * gate in PRI-698 Phase 1.
53
+ * `rollback` arrives with the Phase 2 restore migration. `apply-full` left
54
+ * this gate in PRI-698 Phase 1.
55
+ *
56
+ * `apply` (plugin diff) is NOT gated here: it is not a ReleaseManager
57
+ * mechanism at all (see the `apply` kind below), so its reason is a separate
58
+ * structural gap — a plugin-diff update needs a "current deployment → target
59
+ * deployment" comparison that signed whole-payload releases cannot express.
60
+ * Conflating the two made the fallback reason inaccurate (PRI-729 audit §4 B3).
55
61
  */
56
62
  const ROLLBACK_AVAILABLE = false;
57
63
  /**
@@ -131,11 +137,15 @@ export function createReleaseManagerAuthority(options) {
131
137
  },
132
138
  apply: {
133
139
  ready: false,
134
- reasons: ROLLBACK_AVAILABLE ? baseReasons : [...baseReasons, 'rollback_not_available'],
140
+ // Structural, and independent of rollback: the plugin-diff mechanism is
141
+ // not a ReleaseManager mechanism, so this kind stays not-ready even once
142
+ // rollback lands (PRI-729 audit §4 B3).
143
+ reasons: [...baseReasons, 'plugin_diff_not_supported'],
135
144
  },
136
145
  // PRI-698 Phase 1: the full-runtime write path exists (ReleaseManager.apply
137
146
  // → installer → journal). Console routing is additionally flag-gated
138
- // (`release_manager_write_authority`, default off).
147
+ // (`release_manager_write_authority`, registry default ON since the
148
+ // 2026-09-07 graduation — only an explicit `enabled: false` disables it).
139
149
  'apply-full': {
140
150
  ready: baseReady,
141
151
  reasons: baseReasons,
@@ -1 +1 @@
1
- {"version":3,"file":"release-manager-authority.js","sourceRoot":"","sources":["../../src/update/release-manager-authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,mBAAmB,GAGpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAsB,MAAM,qBAAqB,CAAC;AACpH,OAAO,EAAE,4BAA4B,EAA8B,MAAM,8BAA8B,CAAC;AAExG,+EAA+E;AAC/E,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,CAAU,CAAC;AAerG;;;;;GAKG;AACH,MAAM,kBAAkB,GAAG,KAAK,CAAC;AA0BjC;;;;;GAKG;AACH,SAAS,0BAA0B,CAAC,MAAc;IAChD,MAAM,EAAE,eAAe,EAAE,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;IACvD,IAAI,CAAC;QACH,EAAE,CAAC,UAAU,CAAC,eAAe,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;Q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O,EAAE,WAAW;SACrB;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,KAAK;YACZ,OAAO,EAAE,kBAAkB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAE,CAAC,GAAG,WAAW,EAAE,wBAAwB,CAAW;SAClG;KACwF,CAAC;IAE5F,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC;AAC3D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gCAAgC,CAAC,KAAc;IAM7D,IAAI,KAAK,YAAY,mBAAmB,EAAE,CAAC;QACzC,OAAO;YACL,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;SAC3C,CAAC;IACJ,CAAC;IACD,OAAO;QACL,MAAM,EAAE,8BAA8B;QACtC,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QAC/D,UAAU,EAAE,IAAI;QAChB,iBAAiB,EAAE,KAAK;KACzB,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"release-manager-authority.js","sourceRoot":"","sources":["../../src/update/release-manager-authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EACL,cAAc,EACd,mBAAmB,GAGpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,kBAAkB,EAAsB,MAAM,qBAAqB,CAAC;AACpH,OAAO,EAAE,4BAA4B,EAA8B,MAAM,8BAA8B,CAAC;AAExG,+EAA+E;AAC/E,MAAM,CAAC,MAAM,+BAA+B,GAAG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— the production supply side of the
3
+ * read contracts in release-metadata-source.ts / trust-metadata.ts.
4
+ *
5
+ * For one release this module emits EXACTLY the byte set ReleaseManager
6
+ * already consumes (see apply-payload.ts and release-manager.ts):
7
+ *
8
+ * root.json / timestamp.json / snapshot.json / targets.json TUF chain
9
+ * targets/channels/<channel>.json signed channel pointer payload
10
+ * targets/releases/<releaseId>/metadata.json release metadata payload
11
+ * targets/releases/<releaseId>/release-asset-<platform>-<arch>.tar.gz
12
+ *
13
+ * No second release identity: releaseId and the canonical digests come from
14
+ * deriveReleaseId/buildReleaseMetadata, and both produced documents are
15
+ * re-validated with the SAME strict parsers the ReleaseManager uses, so a
16
+ * publisher-side defect fails here instead of at an install. Publication is
17
+ * byte-deterministic: the same identity inputs, the same signing key and the
18
+ * same previous-state TUF versions re-emit identical files (idempotent
19
+ * re-publish of one release is a no-op, not a mutation).
20
+ *
21
+ * Advance discipline: the channel pointer is only produced together with the
22
+ * artifact target whose sha256 is bound into the release metadata — there is
23
+ * no API shape that advances the pointer without the verifiable artifact
24
+ * existing in the same file set. Monotonicity against the currently
25
+ * published channel pointer (`previous`) is enforced here, fail-loud, before
26
+ * any bytes are emitted.
27
+ *
28
+ * Trust material: one ed25519 key signs all four TUF roles — the same
29
+ * single-key shape the ReleaseManager test suite verifies against. The
30
+ * install side pins root.json at install time, so this module never rotates
31
+ * the root (root version stays 1; rotation is separate governance work).
32
+ */
33
+ import { type ChannelMetadata } from './channel-metadata.js';
34
+ import { type ReleaseMetadata } from './release-metadata.js';
35
+ import { type ReleaseChannelName } from './product-identity.js';
36
+ export declare const RELEASE_PUBLICATION_TUF_SPEC_VERSION = "1.0.31";
37
+ export type ReleasePublicationErrorCode = 'invalid_input' | 'expires_not_future' | 'publication_not_monotonic' | 'publication_conflict' | 'signing_key_invalid';
38
+ export declare class ReleasePublicationError extends Error {
39
+ readonly code: ReleasePublicationErrorCode;
40
+ readonly field: string;
41
+ readonly nextAction: string;
42
+ constructor(code: ReleasePublicationErrorCode, field: string, message: string, nextAction: string);
43
+ }
44
+ /**
45
+ * The release-asset archive that will be published as the artifact target.
46
+ * `bytes` are the EXACT bytes served at the target path — the sha256 bound
47
+ * into the release metadata is computed over them.
48
+ */
49
+ export interface PublicationArchive {
50
+ readonly platform: string;
51
+ readonly arch: string;
52
+ readonly nodeAbi: string;
53
+ readonly bytes: Buffer;
54
+ }
55
+ /** Previously published state of the metadata repository, when one exists. */
56
+ export interface PreviousPublication {
57
+ /** The currently published `targets/channels/<channel>.json` payload. */
58
+ readonly channelPayload: unknown;
59
+ /** TUF metadata versions of the currently published repository. Absent roles start at 1. */
60
+ readonly tufVersions?: {
61
+ readonly root?: number;
62
+ readonly timestamp?: number;
63
+ readonly snapshot?: number;
64
+ readonly targets?: number;
65
+ };
66
+ }
67
+ export interface ReleasePublicationInput {
68
+ readonly productVersion: string;
69
+ readonly sourceCommit: string;
70
+ readonly channel: ReleaseChannelName;
71
+ /** Monotonic channel pointer version — must strictly increase per advance. */
72
+ readonly channelVersion: number;
73
+ /** Monotonic publication sequence — must strictly increase per advance. */
74
+ readonly publicationSequence: number;
75
+ /** RFC3339 UTC (`...Z`) expiry for the channel, release metadata and TUF roles. */
76
+ readonly expiresAt: string;
77
+ readonly minBootstrapVersion: string;
78
+ readonly dataSchemaForwardReadableFrom: string;
79
+ readonly archive: PublicationArchive;
80
+ /** PEM-encoded ed25519 PRIVATE key signing the whole repository. */
81
+ readonly signingKeyPem: string;
82
+ readonly previous?: PreviousPublication | null;
83
+ }
84
+ export interface PublicationFile {
85
+ /** Repository-relative path as served at the metadata base URL. */
86
+ readonly path: string;
87
+ readonly bytes: Buffer;
88
+ }
89
+ export interface ReleasePublicationManifest {
90
+ readonly releaseId: string;
91
+ readonly productVersion: string;
92
+ readonly channel: ReleaseChannelName;
93
+ readonly platform: string;
94
+ readonly arch: string;
95
+ readonly nodeAbi: string;
96
+ readonly sourceCommit: string;
97
+ readonly artifactSha256: string;
98
+ readonly artifactSizeBytes: number;
99
+ readonly artifactTargetPath: string;
100
+ readonly keyId: string;
101
+ readonly signingScheme: 'ed25519';
102
+ readonly publicationSequence: number;
103
+ readonly channelVersion: number;
104
+ readonly expiresAt: string;
105
+ readonly files: readonly {
106
+ readonly path: string;
107
+ readonly sha256: string;
108
+ readonly sizeBytes: number;
109
+ }[];
110
+ }
111
+ export interface ReleasePublication {
112
+ readonly manifest: ReleasePublicationManifest;
113
+ readonly releaseMetadata: ReleaseMetadata;
114
+ readonly channelPayload: ChannelMetadata;
115
+ /** The complete served-repository content, ready to publish as-is. */
116
+ readonly files: readonly PublicationFile[];
117
+ }
118
+ /**
119
+ * Gzip wrapper for a built release archive. Node's zlib emits a deterministic
120
+ * gzip header (no embedded mtime or file name), so the same archive bytes
121
+ * always produce the same published artifact bytes — the CLI `gzip` would not
122
+ * (it stores name + mtime in the header).
123
+ */
124
+ export declare function gzipReleaseArchive(archiveBytes: Buffer): Buffer;
125
+ /**
126
+ * Parses a `sha256sum`-style digest file (`<hex>` or `<hex> <name>`) into
127
+ * the lowercase hex digest, failing loud on anything else.
128
+ */
129
+ export declare function parseSha256DigestFile(content: string): string;
130
+ /**
131
+ * True when the input is a syntactically valid RFC3339 UTC timestamp
132
+ * (`...Z`). Exported for CLI argument validation before any IO happens.
133
+ */
134
+ export declare function isRfc3339UtcTimestamp(value: unknown): value is string;
135
+ /**
136
+ * Builds the complete signed release publication. Pure: no filesystem or
137
+ * network IO — callers (the publish script / CI) own byte transport.
138
+ */
139
+ export declare function buildReleasePublication(input: ReleasePublicationInput): ReleasePublication;
140
+ /** Ephemeral ed25519 key PEM for dry-run pipelines without configured trust material. */
141
+ export declare function generateEphemeralSigningKeyPem(): string;
142
+ //# sourceMappingURL=release-metadata-publisher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-metadata-publisher.d.ts","sourceRoot":"","sources":["../../src/update/release-metadata-publisher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAeH,OAA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