create-principles-disciple 1.145.25 → 1.145.27

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 (191) hide show
  1. package/_release/product-identity.json +1 -1
  2. package/console/dist/server/config/pd-config-store.d.ts +1 -0
  3. package/console/dist/server/config/pd-config-store.js +28 -6
  4. package/console/dist/server/models/RuleCandidateBindingConsoleModel.d.ts +26 -0
  5. package/console/dist/server/models/RuleCandidateBindingConsoleModel.js +309 -19
  6. package/console/dist/server/routes/config.js +7 -3
  7. package/console/dist/server/routes/rule-candidate-bindings.js +26 -1
  8. package/console/dist/shared/rule-candidate-binding-contract.d.ts +93 -8
  9. package/console/dist/shared/rule-candidate-binding-contract.js +4 -0
  10. package/console/dist/ui/api.d.ts +28 -0
  11. package/console/dist/ui/api.js +13 -1
  12. package/console/dist/ui/i18n/en.json +93 -25
  13. package/console/dist/ui/i18n/zh-CN.json +79 -11
  14. package/console/dist/ui/pages/control-center/RuntimeProfileManager.js +32 -67
  15. package/console/dist/ui/pages/focus/RuleCandidateBindingPanel.d.ts +29 -0
  16. package/console/dist/ui/pages/focus/RuleCandidateBindingPanel.js +229 -3
  17. package/console/dist/ui/utils/rule-binding-validators.d.ts +5 -0
  18. package/console/dist/ui/utils/rule-binding-validators.js +149 -7
  19. package/console/dist/web/assets/app.css +6 -0
  20. package/console/dist/web/assets/app.js +32 -32
  21. package/core/dist/runtime-v2/adapter/index.d.ts +0 -2
  22. package/core/dist/runtime-v2/adapter/index.d.ts.map +1 -1
  23. package/core/dist/runtime-v2/adapter/index.js +0 -1
  24. package/core/dist/runtime-v2/adapter/index.js.map +1 -1
  25. package/core/dist/runtime-v2/adapter/output-schema-registry.d.ts +3 -3
  26. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.d.ts.map +1 -1
  27. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js +1 -2
  28. package/core/dist/runtime-v2/adapter/pi-ai-runtime-adapter.js.map +1 -1
  29. package/core/dist/runtime-v2/cli/probe.d.ts +4 -15
  30. package/core/dist/runtime-v2/cli/probe.d.ts.map +1 -1
  31. package/core/dist/runtime-v2/cli/probe.js +24 -44
  32. package/core/dist/runtime-v2/cli/probe.js.map +1 -1
  33. package/core/dist/runtime-v2/config/index.d.ts +1 -1
  34. package/core/dist/runtime-v2/config/index.d.ts.map +1 -1
  35. package/core/dist/runtime-v2/config/index.js.map +1 -1
  36. package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts +10 -17
  37. package/core/dist/runtime-v2/config/pd-config-agent-binding.d.ts.map +1 -1
  38. package/core/dist/runtime-v2/config/pd-config-agent-binding.js +23 -27
  39. package/core/dist/runtime-v2/config/pd-config-agent-binding.js.map +1 -1
  40. package/core/dist/runtime-v2/config/pd-config-defaults.d.ts +3 -5
  41. package/core/dist/runtime-v2/config/pd-config-defaults.d.ts.map +1 -1
  42. package/core/dist/runtime-v2/config/pd-config-defaults.js +17 -20
  43. package/core/dist/runtime-v2/config/pd-config-defaults.js.map +1 -1
  44. package/core/dist/runtime-v2/config/pd-config-effective.d.ts.map +1 -1
  45. package/core/dist/runtime-v2/config/pd-config-effective.js +4 -1
  46. package/core/dist/runtime-v2/config/pd-config-effective.js.map +1 -1
  47. package/core/dist/runtime-v2/config/pd-config-redaction.d.ts.map +1 -1
  48. package/core/dist/runtime-v2/config/pd-config-redaction.js +4 -7
  49. package/core/dist/runtime-v2/config/pd-config-redaction.js.map +1 -1
  50. package/core/dist/runtime-v2/config/pd-config-types.d.ts +5 -1
  51. package/core/dist/runtime-v2/config/pd-config-types.d.ts.map +1 -1
  52. package/core/dist/runtime-v2/config/pd-config-types.js +6 -0
  53. package/core/dist/runtime-v2/config/pd-config-types.js.map +1 -1
  54. package/core/dist/runtime-v2/config/pd-config-validate.d.ts.map +1 -1
  55. package/core/dist/runtime-v2/config/pd-config-validate.js +6 -0
  56. package/core/dist/runtime-v2/config/pd-config-validate.js.map +1 -1
  57. package/core/dist/runtime-v2/golden-trace.d.ts.map +1 -1
  58. package/core/dist/runtime-v2/golden-trace.js +8 -1
  59. package/core/dist/runtime-v2/golden-trace.js.map +1 -1
  60. package/core/dist/runtime-v2/index.d.ts +4 -4
  61. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  62. package/core/dist/runtime-v2/index.js +2 -3
  63. package/core/dist/runtime-v2/index.js.map +1 -1
  64. package/core/dist/runtime-v2/internalization/artificer-intent-preflight.d.ts.map +1 -1
  65. package/core/dist/runtime-v2/internalization/artificer-intent-preflight.js +26 -95
  66. package/core/dist/runtime-v2/internalization/artificer-intent-preflight.js.map +1 -1
  67. package/core/dist/runtime-v2/internalization/bash-risk.d.ts +32 -0
  68. package/core/dist/runtime-v2/internalization/bash-risk.d.ts.map +1 -0
  69. package/core/dist/runtime-v2/internalization/bash-risk.js +785 -0
  70. package/core/dist/runtime-v2/internalization/bash-risk.js.map +1 -0
  71. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts +25 -2
  72. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.d.ts.map +1 -1
  73. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js +177 -14
  74. package/core/dist/runtime-v2/internalization/evaluator-prompt-builder.js.map +1 -1
  75. package/core/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
  76. package/core/dist/runtime-v2/internalization/evaluator-runner.js +14 -2
  77. package/core/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
  78. package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts +47 -0
  79. package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts.map +1 -1
  80. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js +164 -3
  81. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js.map +1 -1
  82. package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts +9 -1
  83. package/core/dist/runtime-v2/internalization/peer-runner-contracts.d.ts.map +1 -1
  84. package/core/dist/runtime-v2/internalization/peer-runner-contracts.js.map +1 -1
  85. package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts +39 -0
  86. package/core/dist/runtime-v2/internalization/pitask-metadata.d.ts.map +1 -1
  87. package/core/dist/runtime-v2/internalization/pitask-metadata.js +59 -0
  88. package/core/dist/runtime-v2/internalization/pitask-metadata.js.map +1 -1
  89. package/core/dist/runtime-v2/internalization/rule-source-correction.d.ts +60 -0
  90. package/core/dist/runtime-v2/internalization/rule-source-correction.d.ts.map +1 -0
  91. package/core/dist/runtime-v2/internalization/rule-source-correction.js +214 -0
  92. package/core/dist/runtime-v2/internalization/rule-source-correction.js.map +1 -0
  93. package/core/dist/runtime-v2/internalization/rulecode-verification-obligations.d.ts.map +1 -1
  94. package/core/dist/runtime-v2/internalization/rulecode-verification-obligations.js +65 -0
  95. package/core/dist/runtime-v2/internalization/rulecode-verification-obligations.js.map +1 -1
  96. package/core/dist/runtime-v2/internalization/scribe-output.d.ts +14 -2
  97. package/core/dist/runtime-v2/internalization/scribe-output.d.ts.map +1 -1
  98. package/core/dist/runtime-v2/internalization/scribe-output.js +57 -2
  99. package/core/dist/runtime-v2/internalization/scribe-output.js.map +1 -1
  100. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts +13 -1
  101. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts.map +1 -1
  102. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js +15 -3
  103. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js.map +1 -1
  104. package/core/dist/runtime-v2/internalization/scribe-runner.d.ts +34 -0
  105. package/core/dist/runtime-v2/internalization/scribe-runner.d.ts.map +1 -1
  106. package/core/dist/runtime-v2/internalization/scribe-runner.js +128 -4
  107. package/core/dist/runtime-v2/internalization/scribe-runner.js.map +1 -1
  108. package/core/dist/runtime-v2/internalization/textual-basis-anchor.d.ts +72 -0
  109. package/core/dist/runtime-v2/internalization/textual-basis-anchor.d.ts.map +1 -0
  110. package/core/dist/runtime-v2/internalization/textual-basis-anchor.js +100 -0
  111. package/core/dist/runtime-v2/internalization/textual-basis-anchor.js.map +1 -0
  112. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts +9 -7
  113. package/core/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
  114. package/core/dist/runtime-v2/pain-signal-runtime-factory.js +59 -121
  115. package/core/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
  116. package/core/dist/runtime-v2/runtime-protocol.d.ts +2 -3
  117. package/core/dist/runtime-v2/runtime-protocol.d.ts.map +1 -1
  118. package/core/dist/runtime-v2/runtime-protocol.js +15 -10
  119. package/core/dist/runtime-v2/runtime-protocol.js.map +1 -1
  120. package/core/dist/runtime-v2/store/lifecycle/lease-manager.d.ts.map +1 -1
  121. package/core/dist/runtime-v2/store/lifecycle/lease-manager.js +11 -2
  122. package/core/dist/runtime-v2/store/lifecycle/lease-manager.js.map +1 -1
  123. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.d.ts.map +1 -1
  124. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js +26 -0
  125. package/core/dist/runtime-v2/tools/artificer-l2-tool-contract.js.map +1 -1
  126. package/core/dist/telemetry-event.d.ts +2 -2
  127. package/core/dist/telemetry-event.d.ts.map +1 -1
  128. package/core/dist/telemetry-event.js +5 -0
  129. package/core/dist/telemetry-event.js.map +1 -1
  130. package/core/dist/workflow-funnel-loader.d.ts +0 -2
  131. package/core/dist/workflow-funnel-loader.d.ts.map +1 -1
  132. package/core/dist/workflow-funnel-loader.js.map +1 -1
  133. package/core/package.json +5 -1
  134. package/dist/mvp-config.d.ts.map +1 -1
  135. package/dist/mvp-config.js +8 -10
  136. package/dist/mvp-config.js.map +1 -1
  137. package/host-runtime/dist/internalization-consumer-cycle.js +4 -7
  138. package/host-runtime/dist/production-rulehost-gate.js +11 -1
  139. package/host-runtime/package.json +1 -1
  140. package/package.json +2 -2
  141. package/pd-cli/dist/commands/diagnose.d.ts +0 -3
  142. package/pd-cli/dist/commands/diagnose.d.ts.map +1 -1
  143. package/pd-cli/dist/commands/diagnose.js +20 -57
  144. package/pd-cli/dist/commands/diagnose.js.map +1 -1
  145. package/pd-cli/dist/commands/pain-retry.d.ts +0 -3
  146. package/pd-cli/dist/commands/pain-retry.d.ts.map +1 -1
  147. package/pd-cli/dist/commands/pain-retry.js +11 -39
  148. package/pd-cli/dist/commands/pain-retry.js.map +1 -1
  149. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.d.ts.map +1 -1
  150. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js +32 -0
  151. package/pd-cli/dist/commands/runtime-internalization-enqueue-successors.js.map +1 -1
  152. package/pd-cli/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
  153. package/pd-cli/dist/commands/runtime-internalization-run-once.js +4 -2
  154. package/pd-cli/dist/commands/runtime-internalization-run-once.js.map +1 -1
  155. package/pd-cli/dist/commands/runtime.d.ts +1 -4
  156. package/pd-cli/dist/commands/runtime.d.ts.map +1 -1
  157. package/pd-cli/dist/commands/runtime.js +25 -95
  158. package/pd-cli/dist/commands/runtime.js.map +1 -1
  159. package/pd-cli/dist/index.js +2 -5
  160. package/pd-cli/dist/index.js.map +1 -1
  161. package/pd-cli/dist/services/config-doctor.d.ts.map +1 -1
  162. package/pd-cli/dist/services/config-doctor.js +9 -21
  163. package/pd-cli/dist/services/config-doctor.js.map +1 -1
  164. package/pd-cli/dist/services/mainline-snapshot-assembler.d.ts.map +1 -1
  165. package/pd-cli/dist/services/mainline-snapshot-assembler.js +2 -2
  166. package/pd-cli/dist/services/mainline-snapshot-assembler.js.map +1 -1
  167. package/pd-cli/dist/services/resolve-runtime-from-pd-config.d.ts +0 -7
  168. package/pd-cli/dist/services/resolve-runtime-from-pd-config.d.ts.map +1 -1
  169. package/pd-cli/dist/services/resolve-runtime-from-pd-config.js +0 -5
  170. package/pd-cli/dist/services/resolve-runtime-from-pd-config.js.map +1 -1
  171. package/pd-cli/dist/services/runtime-adapter-resolver.d.ts +1 -8
  172. package/pd-cli/dist/services/runtime-adapter-resolver.d.ts.map +1 -1
  173. package/pd-cli/dist/services/runtime-adapter-resolver.js +13 -39
  174. package/pd-cli/dist/services/runtime-adapter-resolver.js.map +1 -1
  175. package/pd-cli/package.json +1 -1
  176. package/plugin/dist/bundle.js +468 -458
  177. package/plugin/dist/openclaw.plugin.json +1 -1
  178. package/plugin/openclaw.plugin.json +1 -1
  179. package/plugin/package.json +1 -1
  180. package/release-manager/dist/mvp-config.d.ts.map +1 -1
  181. package/release-manager/dist/mvp-config.js +8 -10
  182. package/release-manager/dist/mvp-config.js.map +1 -1
  183. package/release-manager/package.json +2 -2
  184. package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.d.ts +0 -72
  185. package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.d.ts.map +0 -1
  186. package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js +0 -837
  187. package/core/dist/runtime-v2/adapter/openclaw-cli-runtime-adapter.js.map +0 -1
  188. package/core/dist/runtime-v2/utils/cli-process-runner.d.ts +0 -35
  189. package/core/dist/runtime-v2/utils/cli-process-runner.d.ts.map +0 -1
  190. package/core/dist/runtime-v2/utils/cli-process-runner.js +0 -263
  191. package/core/dist/runtime-v2/utils/cli-process-runner.js.map +0 -1
@@ -1,3 +1,91 @@
1
+ /** Owner-facing projection DTOs for the rule-candidate binding queue (PRI-1048).
2
+ * Derived read-only views over existing authorities (state.db tasks/candidates,
3
+ * trajectory.db pain_events, the principle ledger, the internalization chain).
4
+ * No new persisted state; the Ledger remains the only binding authority. */
5
+ /** Which owner feedback produced the candidate. Text is null when the pain
6
+ * record is gone — the UI must show 未记录, never fabricate a quote. */
7
+ export interface RuleBindingPainSourceView {
8
+ painId: string;
9
+ text: string | null;
10
+ source: string;
11
+ createdAt: string | null;
12
+ }
13
+ /** The formal principle a candidate is currently bound to (ledger authority). */
14
+ export interface RuleBindingBoundPrincipleView {
15
+ principleId: string;
16
+ text: string;
17
+ status: string;
18
+ version: number;
19
+ revision: number;
20
+ decidedAt: string;
21
+ }
22
+ /** Where the bound candidate's regeneration chain stands. `stageKind` names the
23
+ * deepest internalization task reached ('scribe', 'artificer', …). Blocked
24
+ * carries the server's reasonCode (e.g. textual_basis_unanchored) verbatim. */
25
+ export interface RuleBindingGenerationView {
26
+ stage: 'not_built' | 'in_progress' | 'blocked' | 'advanced' | 'ambiguous';
27
+ stageKind: string | null;
28
+ reasonCode: string | null;
29
+ detail: string | null;
30
+ }
31
+ /** Real backend revision eligibility, resolved by the production resolver
32
+ * (resolveRuleBindingRevisionTarget + the same budget rule reviseRuleBindingOnce
33
+ * enforces). The UI may only offer 修订并继续 when status === 'ready'. */
34
+ export interface RuleBindingResumeView {
35
+ status: 'ready' | 'refused';
36
+ reason: string | null;
37
+ scribeTaskId: string | null;
38
+ /** CAS input for the revise-once request (ready only). */
39
+ taskRevisionEpoch: number | null;
40
+ }
41
+ /** PRI-1048 (Owner review R6 #4): read-only eligibility preview for the
42
+ * source-correct-once capability (PRI-1047) — the bounded one-shot source
43
+ * revision that applies when the Artificer stopped for a SOURCE-material
44
+ * defect and the binding revision budget is spent. Click-time authority
45
+ * stays with reviseRuleSourceOnce on the server. */
46
+ export interface RuleBindingSourceCorrectionView {
47
+ status: 'ready' | 'unavailable';
48
+ reason: string | null;
49
+ /** CAS inputs for the source-correct-once request (ready only). */
50
+ scribeTaskId: string | null;
51
+ artificerTaskId: string | null;
52
+ scribeArtifactDigest: string | null;
53
+ expectedBindingRevision: number | null;
54
+ }
55
+ export type RuleBindingQueueBindingView = {
56
+ status: 'unlinked';
57
+ } | {
58
+ status: 'bound';
59
+ principle: RuleBindingBoundPrincipleView;
60
+ } | {
61
+ status: 'binding_revoked';
62
+ } | {
63
+ status: 'attention';
64
+ reason: string;
65
+ };
66
+ export interface RuleBindingQueueItem {
67
+ candidateId: string;
68
+ text: string;
69
+ pain: RuleBindingPainSourceView;
70
+ diagnosisStatus: string;
71
+ binding: RuleBindingQueueBindingView;
72
+ generation: RuleBindingGenerationView | null;
73
+ resume: RuleBindingResumeView | null;
74
+ /** PRI-1048 R6 #4: non-null only when bound (null = the capability does not apply). */
75
+ sourceCorrection: RuleBindingSourceCorrectionView | null;
76
+ }
77
+ export interface RuleBindingQueueSummary {
78
+ painGroups: number;
79
+ candidates: number;
80
+ bound: number;
81
+ unlinked: number;
82
+ blocked: number;
83
+ }
84
+ export interface RuleBindingQueueView {
85
+ items: RuleBindingQueueItem[];
86
+ summary: RuleBindingQueueSummary;
87
+ truncated: boolean;
88
+ }
1
89
  export interface RuleBindingTargetView {
2
90
  principleId: string;
3
91
  text: string;
@@ -8,7 +96,7 @@ export interface RuleBindingTargetView {
8
96
  export interface RuleBindingReviewView {
9
97
  candidateId: string;
10
98
  candidateText: string;
11
- sourcePainId: string;
99
+ sourcePain: RuleBindingPainSourceView;
12
100
  evidence: string;
13
101
  candidateDigest: string;
14
102
  currentRevision: number;
@@ -18,13 +106,10 @@ export interface RuleBindingReviewView {
18
106
  reason: string;
19
107
  revision: number;
20
108
  } | null;
109
+ boundPrinciple: RuleBindingBoundPrincipleView | null;
21
110
  eligibleTargets: RuleBindingTargetView[];
111
+ generation: RuleBindingGenerationView | null;
112
+ resume: RuleBindingResumeView | null;
113
+ sourceCorrection: RuleBindingSourceCorrectionView | null;
22
114
  resumeNotice: string;
23
115
  }
24
- export interface RuleBindingQueueView {
25
- items: {
26
- candidateId: string;
27
- text: string;
28
- reason: string;
29
- }[];
30
- }
@@ -1 +1,5 @@
1
+ /** Owner-facing projection DTOs for the rule-candidate binding queue (PRI-1048).
2
+ * Derived read-only views over existing authorities (state.db tasks/candidates,
3
+ * trajectory.db pain_events, the principle ledger, the internalization chain).
4
+ * No new persisted state; the Ledger remains the only binding authority. */
1
5
  export {};
@@ -50,6 +50,34 @@ export declare function mutateRuleBinding(candidateId: string, body: RuleCandida
50
50
  revisionStatus?: string;
51
51
  nextAction?: string;
52
52
  }>>;
53
+ /** PRI-1048: consume the REAL backend revision capability (revise-once route);
54
+ * eligibility was resolved server-side from the production resolver. */
55
+ export declare function reviseRuleBindingOnce(candidateId: string, body: {
56
+ expectedBindingRevision: number;
57
+ expectedScribeTaskId: string;
58
+ expectedTaskRevisionEpoch: number;
59
+ requestId: string;
60
+ }): Promise<ApiResponse<{
61
+ status: string;
62
+ reason?: string;
63
+ nextAction?: string;
64
+ }>>;
65
+ /** PRI-1048 R6 #4: the bounded one-shot SOURCE correction (PRI-1047) — the
66
+ * capability that applies when the binding revision budget is spent and the
67
+ * Artificer stopped for a source-material defect. CAS inputs come from the
68
+ * server-computed sourceCorrection preview; the server re-validates all of it. */
69
+ export declare function correctRuleSource(candidateId: string, body: {
70
+ expectedBindingRevision: number;
71
+ expectedScribeTaskId: string;
72
+ expectedArtificerTaskId: string;
73
+ expectedScribeArtifactDigest: string;
74
+ reason: string;
75
+ requestId: string;
76
+ }): Promise<ApiResponse<{
77
+ status: string;
78
+ reason?: string;
79
+ nextAction?: string;
80
+ }>>;
53
81
  declare function fetchWorkspaces(): Promise<ApiResponse<WorkspaceEntryData[]>>;
54
82
  declare function addWorkspace(name: string, path: string): Promise<ApiResponse<WorkspaceEntryData>>;
55
83
  declare function removeWorkspace(name: string): Promise<ApiResponse<RemovedEnvelopeData>>;
@@ -1,5 +1,5 @@
1
1
  import { clearStoredToken, loadStoredToken, storeToken } from "./utils/token-storage.js";
2
- import { validateBindingReview, validateBindingQueue, validateBindingMutation } from './utils/rule-binding-validators.js';
2
+ import { validateBindingReview, validateBindingQueue, validateBindingMutation, validateBindingRevise } from './utils/rule-binding-validators.js';
3
3
  import { validateErrorResponse, validateHeaders, validateFeedbackReport, validateFeedbackDraftsList, validateFeedbackDraftEnvelope, validateFeedbackChannels, validateFeedbackSubmitResult, validateDeleteEnvelope, validateWorkspaceEntry, validateWorkspaceList, validateRemovedEnvelope, validateSyncResult, validateConfigSummary, validateConfigCatalog, validateAgentBindingUpdate, validateDefaultRuntimeUpdate, validateRuntimeProfileMutation, validateReadinessCheck, validateFeatureFlagUpdate, validateOutputLanguage, validateGovernanceQueue, validateRecoveryResult, validateFailedTaskDetail, validateOwnerDecisionsData, validateOwnerResolutionResult, validateActivations, validateDisableActivation, validateLifecycleMetrics, validateUpdateStatus, validateUpdateHistory, validateApplyUpdateResult, validateUpdateRecovery, validateUpdateTransaction, validateApprovalRecordDirect, validatePrinciplesList, validateCorePrinciples, validateApprovalsGrouped, validateEvidenceChain, validateTrajectoryData, validateIntentSummary, validateIntentDecisionList, validateIntentDecisionResult, validateIntentDecisionSummary, validateFollowUpResponse, validateIntentInitResult, validateIntentSaveResult, validateIntentRawContent, validateIntentVersions, validateOwnerGovernanceView, validateOwnerDecisionViewCore, validateOwnerDecisionInbox, validateOwnerDecisionLibrary, validateGovernanceExperienceSnapshot, validateRuleCodeOwnerReview, validateRuleCodeMutation, validateOwnerIdentityView, validateOwnerIdentityRegister, validateOwnerIdentityUnregister, } from "./utils/validators.js";
4
4
  // ── Auth ──────────────────────────────────────────────────────────────────────
5
5
  function getToken() {
@@ -136,6 +136,18 @@ export function fetchRuleBindingReview(candidateId, search = '') {
136
136
  export function mutateRuleBinding(candidateId, body) {
137
137
  return request(`/api/v1/governance/rule-candidate-bindings/${encodeURIComponent(candidateId)}`, { method: 'POST', body: JSON.stringify(body) }, validateBindingMutation);
138
138
  }
139
+ /** PRI-1048: consume the REAL backend revision capability (revise-once route);
140
+ * eligibility was resolved server-side from the production resolver. */
141
+ export function reviseRuleBindingOnce(candidateId, body) {
142
+ return request(`/api/v1/governance/rule-candidate-bindings/${encodeURIComponent(candidateId)}/revise-once`, { method: 'POST', body: JSON.stringify(body) }, validateBindingRevise);
143
+ }
144
+ /** PRI-1048 R6 #4: the bounded one-shot SOURCE correction (PRI-1047) — the
145
+ * capability that applies when the binding revision budget is spent and the
146
+ * Artificer stopped for a source-material defect. CAS inputs come from the
147
+ * server-computed sourceCorrection preview; the server re-validates all of it. */
148
+ export function correctRuleSource(candidateId, body) {
149
+ return request(`/api/v1/governance/rule-candidate-bindings/${encodeURIComponent(candidateId)}/source-correct-once`, { method: 'POST', body: JSON.stringify(body) }, validateBindingRevise);
150
+ }
139
151
  async function fetchWorkspaces() {
140
152
  return request("/api/workspaces", undefined, validateWorkspaceList);
141
153
  }
@@ -49,29 +49,101 @@
49
49
  "pages": {
50
50
  "focus": {
51
51
  "ruleBinding": {
52
- "title": "Formal principle for a rule",
53
- "separate": "A binding identifies the principle implemented by this rule. It does not approve or activate the rule, or approve a development design.",
54
- "unavailable": "Binding sources are unavailable. Reload to retry.",
55
- "awaiting": "Identity needs review",
56
- "manage": "Manage binding",
57
- "candidate": "Original rule candidate",
58
- "pain": "Source pain",
52
+ "title": "Formal principle attribution for rules",
53
+ "separate": "Attribution only states which principle a rule belongs to; it does not approve the rule, enable it, or replace a development design approval.",
54
+ "unavailable": "Attribution material is unavailable. Reload the page.",
55
+ "countsLine": "{{candidates}} rule candidates | {{painGroups}} feedback signals | {{bound}} linked | {{unlinked}} awaiting decision | {{blocked}} blocked",
56
+ "truncatedNote": "Too many candidates; showing the first {{count}}. The counts above cover displayed entries only.",
57
+ "groupPrefix": "From feedback:",
58
+ "painUnrecorded": "Original words not recorded",
59
+ "sourceUnreadable": "Records unreadable",
60
+ "sourceUnknown": "Source not recorded",
61
+ "sourceManual": "Owner feedback",
62
+ "sourceToolFailure": "Tool failure",
63
+ "groupCount": "{{count}} rule candidates",
64
+ "currentStage": "Current stage: ",
65
+ "boundTo": "Linked principle:",
66
+ "viewPrinciple": "Open principle",
67
+ "blockedLine": "Generation stopped at \"{{stage}}\": {{reason}}; no new rule generated yet.",
68
+ "blockedNoOwnerApproval": "No Owner approval needed right now - this is a material problem; the draft must be revised first.",
69
+ "blockedDetail": "Show blocking detail",
70
+ "blockReason": {
71
+ "textual_basis_unanchored": "draft citation check failed (the claimed Owner quote cannot be anchored in the material)"
72
+ },
73
+ "blockReasonUnknown": "generation blocked (server gave no reason code)",
74
+ "attentionLine": "Material problem ({{reason}}): shown as the server reports it; do not infer the attribution state from this.",
75
+ "nextLabel": "Next step: ",
76
+ "nextAwaitingOwner": "Choose which formal principle this rule implements - attribution only; it approves no code and enables no interception.",
77
+ "nextBoundGenerating": "The system is revising and validating the new rule artifact; no Owner action needed until it finishes.",
78
+ "nextBoundBlocked": "The draft must be revised and regenerated; no retry button is offered until the official recovery capability exists.",
79
+ "nextBoundBlockedNoResume": "Generation is blocked and cannot be resumed now ({{reason}}); revise the draft. An official recovery entry arrives in a later release.",
80
+ "nextBoundAdvanced": "Rule artifact generated; rule approval and activation happen on their own pages.",
81
+ "nextBoundNotBuilt": "Linked to a principle; rule generation has not started yet.",
82
+ "nextBoundAmbiguous": "Generation chain state is unclear; check technical details or reload.",
83
+ "nextRevoked": "Attribution withdrawn and artifacts kept; you may link again.",
84
+ "nextAttention": "Check the reason code in technical details, or reload.",
85
+ "techDetails": "Technical details",
86
+ "candidate": "Rule candidate text",
87
+ "pain": "Source pain signal",
59
88
  "evidence": "Diagnosis evidence",
60
- "current": "Current binding",
61
- "unlinked": "Unlinked",
89
+ "boundSince": "link revision {{revision}} ({{date}})",
90
+ "chooseTarget": "Choose the principle this rule implements: attribution only - it approves no code, enables no interception, and does not mean a development SPEC was approved.",
62
91
  "search": "Search formal principles",
63
- "noTarget": "Keep this unlinked if no formal principle is suitable.",
64
- "formation": "View the existing principle workflow",
92
+ "noTarget": "If no principle fits, keep it unlinked.",
93
+ "formation": "Open the principle formation flow",
65
94
  "version": "Version",
66
- "declaration": "Submitting declares this rule an implementation of the selected principle in the stated scope, and authorizes one bounded revision, generation and evaluation using the current configuration.",
67
- "reason": "Reason for binding or revocation",
68
- "bind": "Bind and resume once",
69
- "revoke": "Revoke binding",
70
- "bound": "Binding saved and one bounded revision requested. Rule approval remains separate.",
71
- "resumeFailed": "Binding saved but revision has not started. Inspect the recovery reason. Prior artifacts are unchanged; no automatic retry will occur.",
72
- "revoked": "Binding revoked. Historical artifacts remain. Running rules require separate deactivation.",
73
- "revokeBoundary": "Revocation does not stop running rules. In-flight operations that passed their final check may complete.",
74
- "stop": "View running rules and deactivation"
95
+ "declaration": "Submitting means: this rule is one implementation of the selected principle, and you authorize exactly one controlled revision/generation/validation run under the existing configuration.",
96
+ "reason": "Reason for linking or withdrawing",
97
+ "bind": "Link and run one revision",
98
+ "revokeSecondary": "Withdraw attribution (secondary)",
99
+ "bound": "Attribution saved; one controlled revision was requested. The rule still requires separate approval.",
100
+ "resumeFailed": "Attribution saved but the revision has not started. Check the recovery reason; old artifacts are unchanged and will not auto-retry.",
101
+ "revoked": "Attribution withdrawn; artifacts kept. Running rules must be stopped separately.",
102
+ "revokeBoundary": "Withdrawal does not stop running rules; in-flight operations that passed final checks may still complete.",
103
+ "stop": "Open rule runs and stop entry",
104
+ "openReview": "Review and act",
105
+ "closeReview": "Collapse",
106
+ "reviseCta": "Revise and continue",
107
+ "reviseStarted": "One controlled revision was requested; generation and validation continue under the existing configuration.",
108
+ "reviseAlreadyStarted": "This revision is already in progress; no repeat request needed.",
109
+ "resumeUnavailable": "Automatic revision is unavailable now ({{reason}}); a generic retry is not a source revision.",
110
+ "sourceCorrectionCta": "Correct source material and continue",
111
+ "sourceCorrectionStarted": "One source-material correction was authorized: the Scribe reopens for one round on the corrected material and the original Artificer resumes on the new artifact, under the existing configuration and budgets.",
112
+ "sourceCorrectionAlreadyStarted": "This source correction is already in progress (idempotent replay); no repeat request needed.",
113
+ "sourceCorrectionUnavailable": "The source-correction entry is unavailable now ({{reason}}).",
114
+ "resumeReason": {
115
+ "revision_budget_exhausted": "the revision budget of this link is spent",
116
+ "dreamer_lineage_not_unique": "dreamer task lineage is not unique",
117
+ "dreamer_missing": "dreamer task not found",
118
+ "philosopher_lineage_not_unique": "philosopher task lineage is not unique",
119
+ "philosopher_missing": "philosopher task not found",
120
+ "scribe_lineage_not_unique": "scribe task lineage is not unique",
121
+ "scribe_metadata_invalid": "scribe task metadata is invalid",
122
+ "predecessor_not_succeeded": "an upstream task has not succeeded",
123
+ "scribe_missing": "scribe task not found",
124
+ "candidate_kind_invalid": "candidate kind is invalid",
125
+ "binding_revision_stale": "binding revision is stale; reload",
126
+ "task_revision_stale": "task revision epoch is stale; reload",
127
+ "scribe_target_mismatch": "target scribe task mismatch; reload",
128
+ "task_lease_present": "the task is held by a worker; retry later",
129
+ "revision_snapshot_stale": "task state changed; reload"
130
+ },
131
+ "stateAwaitingOwner": "Awaiting principle choice",
132
+ "stateBoundGenerating": "Linked - generating",
133
+ "stateBoundBlocked": "Linked - blocked",
134
+ "stateBoundAdvanced": "Linked - generated",
135
+ "stateBoundNotBuilt": "Linked - not started",
136
+ "stateBoundAmbiguous": "Linked - chain unclear",
137
+ "stateRevoked": "Attribution withdrawn",
138
+ "stateAttention": "Material problem",
139
+ "stageDreamer": "dreaming",
140
+ "stagePhilosopher": "distilling",
141
+ "stageScribe": "drafting",
142
+ "stageArtificer": "rule generation",
143
+ "stageEvaluator": "rule validation",
144
+ "stageRolloutReviewer": "rollout review",
145
+ "viewRemaining": "Show the other {{count}} feedback groups",
146
+ "hideRemaining": "Collapse remaining feedback groups"
75
147
  },
76
148
  "eyebrow": "Governance Focus",
77
149
  "title": "What deserves your judgment right now",
@@ -1574,7 +1646,6 @@
1574
1646
  "fieldId": "Profile ID",
1575
1647
  "fieldIdHint": "Unique identifier, cannot be changed after creation (e.g. anthropic-cloud)",
1576
1648
  "fieldIdPlaceholder": "my-profile",
1577
- "fieldType": "Type",
1578
1649
  "fieldProvider": "Provider",
1579
1650
  "fieldProviderPlaceholder": "anthropic",
1580
1651
  "fieldModel": "Model",
@@ -1584,10 +1655,7 @@
1584
1655
  "fieldApiKeyEnvPlaceholder": "ANTHROPIC_API_KEY",
1585
1656
  "fieldBaseUrl": "Base URL (optional)",
1586
1657
  "fieldBaseUrlPlaceholder": "https://api.anthropic.com",
1587
- "fieldSource": "Source (optional)",
1588
- "fieldSourcePlaceholder": "default",
1589
- "typeOpenclaw": "openclaw",
1590
- "typePiAi": "pi-ai",
1658
+ "retiredBadge": "retired",
1591
1659
  "validationIdRequired": "Profile ID is required",
1592
1660
  "validationProviderRequired": "pi-ai profile requires provider",
1593
1661
  "validationModelRequired": "pi-ai profile requires model",
@@ -52,13 +52,42 @@
52
52
  "title": "规则的正式原则归属",
53
53
  "separate": "关联仅声明规则属于哪条原则;不批准规则、不启用规则,也不代替开发设计批准。",
54
54
  "unavailable": "关联材料暂不可读,请重新加载。",
55
- "awaiting": "待核实归属",
56
- "manage": "管理已有归属",
55
+ "countsLine": "共 {{candidates}} 条规则候选 · 来自 {{painGroups}} 次反馈 · {{bound}} 已关联 · {{unlinked}} 待决定 · {{blocked}} 受阻",
56
+ "truncatedNote": "候选较多,已按上限显示前 {{count}} 条;上方计数仅覆盖已显示条目。",
57
+ "groupPrefix": "来自反馈:",
58
+ "painUnrecorded": "原话未记录",
59
+ "sourceUnreadable": "记录暂不可读",
60
+ "sourceUnknown": "来源未记录",
61
+ "sourceManual": "拥有者反馈",
62
+ "sourceToolFailure": "工具失败",
63
+ "groupCount": "{{count}} 条规则候选",
64
+ "currentStage": "当前阶段:",
65
+ "boundTo": "已关联原则:",
66
+ "viewPrinciple": "查看原则详情",
67
+ "blockedLine": "生成停在「{{stage}}」:{{reason}};尚未生成新规则。",
68
+ "blockedNoOwnerApproval": "当前无需拥有者批准——这是材料问题,需要先修订草案。",
69
+ "blockedDetail": "查看受阻原因",
70
+ "blockReason": {
71
+ "textual_basis_unanchored": "草案引用核验未通过(声明的拥有者原话在材料中找不到锚点)"
72
+ },
73
+ "blockReasonUnknown": "生成受阻(服务端未给出原因码)",
74
+ "attentionLine": "材料异常({{reason}}):按服务端事实展示,不能据此判断关联状态。",
75
+ "nextLabel": "下一步:",
76
+ "nextAwaitingOwner": "为这条规则选择要落实的正式原则——只决定归属,不批准代码、不启用拦截。",
77
+ "nextBoundGenerating": "系统正在修订与验证新规则工件;完成前无需拥有者操作。",
78
+ "nextBoundBlocked": "需要修订草案后重新生成;正式恢复能力就绪前页面不会提供重试按钮。",
79
+ "nextBoundBlockedNoResume": "生成受阻且当前不可恢复({{reason}});需修订草案,后续版本会提供正式恢复入口。",
80
+ "nextBoundAdvanced": "规则工件已生成;规则审批与生效在各自页面单独进行。",
81
+ "nextBoundNotBuilt": "已关联原则;尚未开始生成新规则。",
82
+ "nextBoundAmbiguous": "生成链状态不明;请查看技术详情或重新加载。",
83
+ "nextRevoked": "归属已撤回,历史工件保留;可重新关联。",
84
+ "nextAttention": "请查看技术详情中的原因码,或重新加载。",
85
+ "techDetails": "技术详情",
57
86
  "candidate": "规则候选原文",
58
87
  "pain": "来源痛苦信号",
59
88
  "evidence": "诊断依据",
60
- "current": "当前关联",
61
- "unlinked": "尚未关联",
89
+ "boundSince": "第 {{revision}} 次关联({{date}})",
90
+ "chooseTarget": "选择这条规则要落实的原则:只决定归属,不批准代码、不启用拦截,也不代表开发 SPEC 已获批准。",
62
91
  "search": "搜索正式原则",
63
92
  "noTarget": "没有合适的正式原则时,保持未关联。",
64
93
  "formation": "查看既有原则形成流程",
@@ -66,12 +95,55 @@
66
95
  "declaration": "提交表示:该规则是所选原则在上述范围内的一种实现,并授权按现有配置自动续跑一次修订、生成和验证。",
67
96
  "reason": "关联或撤回的理由",
68
97
  "bind": "关联并自动续跑一次",
69
- "revoke": "撤回归属",
98
+ "revokeSecondary": "撤回归属(次级)",
70
99
  "bound": "关联已保存,已请求一次受控修订;后续规则仍须单独审批。",
71
100
  "resumeFailed": "关联已保存,但修订尚未开始。请查看恢复原因;旧工件未变,不会自动重试。",
72
101
  "revoked": "归属已撤回;历史工件保留。运行中的规则须另行停用。",
73
102
  "revokeBoundary": "撤回不停止已有运行规则;撤回前已通过最终检查的在途操作仍可能完成。",
74
- "stop": "查看规则运行与停用入口"
103
+ "stop": "查看规则运行与停用入口",
104
+ "openReview": "查看并处理",
105
+ "closeReview": "收起",
106
+ "reviseCta": "修订并继续",
107
+ "reviseStarted": "已请求一次受控修订;生成与验证将按现有配置继续。",
108
+ "reviseAlreadyStarted": "该修订已在进行中;无需重复请求。",
109
+ "resumeUnavailable": "当前不可自动修订({{reason}});不要把通用重试当作源修订。",
110
+ "sourceCorrectionCta": "修正源材料并继续",
111
+ "sourceCorrectionStarted": "已授权一次源材料修订:Scribe 将以修正后的材料重开一轮,原 Artificer 在新工件上定点续接;沿用原配置与预算。",
112
+ "sourceCorrectionAlreadyStarted": "该源材料修订已在进行中(幂等重放);无需重复请求。",
113
+ "sourceCorrectionUnavailable": "源材料修订入口当前不可用({{reason}})。",
114
+ "resumeReason": {
115
+ "revision_budget_exhausted": "本次关联的修订预算已用完",
116
+ "dreamer_lineage_not_unique": "构思任务血缘不唯一",
117
+ "dreamer_missing": "找不到构思任务",
118
+ "philosopher_lineage_not_unique": "提炼任务血缘不唯一",
119
+ "philosopher_missing": "找不到提炼任务",
120
+ "scribe_lineage_not_unique": "草稿任务血缘不唯一",
121
+ "scribe_metadata_invalid": "草稿任务元数据无效",
122
+ "predecessor_not_succeeded": "上游任务未成功完成",
123
+ "scribe_missing": "找不到草稿任务",
124
+ "candidate_kind_invalid": "候选类型无效",
125
+ "binding_revision_stale": "关联版本已过期,请重新加载",
126
+ "task_revision_stale": "任务修订版本已过期,请重新加载",
127
+ "scribe_target_mismatch": "目标草稿任务不匹配,请重新加载",
128
+ "task_lease_present": "任务正被执行方持有,稍后重试",
129
+ "revision_snapshot_stale": "任务状态已变化,请重新加载"
130
+ },
131
+ "stateAwaitingOwner": "待选择原则",
132
+ "stateBoundGenerating": "已关联 · 生成中",
133
+ "stateBoundBlocked": "已关联 · 受阻",
134
+ "stateBoundAdvanced": "已关联 · 已生成",
135
+ "stateBoundNotBuilt": "已关联 · 未开始生成",
136
+ "stateBoundAmbiguous": "已关联 · 链状态不明",
137
+ "stateRevoked": "已撤回归属",
138
+ "stateAttention": "材料异常",
139
+ "stageDreamer": "构思",
140
+ "stagePhilosopher": "提炼",
141
+ "stageScribe": "草稿撰写",
142
+ "stageArtificer": "规则生成",
143
+ "stageEvaluator": "规则验证",
144
+ "stageRolloutReviewer": "发布复核",
145
+ "viewRemaining": "显示其余 {{count}} 组反馈",
146
+ "hideRemaining": "收起其余反馈组"
75
147
  },
76
148
  "eyebrow": "治理焦点",
77
149
  "title": "现在,值得你判断的事",
@@ -1574,7 +1646,6 @@
1574
1646
  "fieldId": "Profile ID",
1575
1647
  "fieldIdHint": "唯一标识符,创建后不可修改(如 anthropic-cloud)",
1576
1648
  "fieldIdPlaceholder": "my-profile",
1577
- "fieldType": "类型",
1578
1649
  "fieldProvider": "Provider",
1579
1650
  "fieldProviderPlaceholder": "anthropic",
1580
1651
  "fieldModel": "Model",
@@ -1584,10 +1655,7 @@
1584
1655
  "fieldApiKeyEnvPlaceholder": "ANTHROPIC_API_KEY",
1585
1656
  "fieldBaseUrl": "Base URL(可选)",
1586
1657
  "fieldBaseUrlPlaceholder": "https://api.anthropic.com",
1587
- "fieldSource": "Source(可选)",
1588
- "fieldSourcePlaceholder": "default",
1589
- "typeOpenclaw": "openclaw",
1590
- "typePiAi": "pi-ai",
1658
+ "retiredBadge": "已退役",
1591
1659
  "validationIdRequired": "Profile ID 不能为空",
1592
1660
  "validationProviderRequired": "pi-ai profile 必须填写 provider",
1593
1661
  "validationModelRequired": "pi-ai profile 必须填写 model",