create-principles-disciple 1.142.12 → 1.142.14

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 (46) hide show
  1. package/console/dist/ui/i18n/en.json +3 -0
  2. package/console/dist/ui/i18n/zh-CN.json +3 -0
  3. package/console/dist/ui/pages/focus/OwnerDecisionCard.js +19 -1
  4. package/console/dist/web/assets/app.js +18 -2
  5. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js +5 -3
  6. package/core/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  7. package/core/dist/runtime-v2/__tests__/governance-timestamp-schema.test.d.ts +2 -0
  8. package/core/dist/runtime-v2/__tests__/governance-timestamp-schema.test.d.ts.map +1 -0
  9. package/core/dist/runtime-v2/__tests__/governance-timestamp-schema.test.js +81 -0
  10. package/core/dist/runtime-v2/__tests__/governance-timestamp-schema.test.js.map +1 -0
  11. package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.js +81 -0
  12. package/core/dist/runtime-v2/__tests__/internalization-orchestrator.test.js.map +1 -1
  13. package/core/dist/runtime-v2/governance-experience-contract.d.ts.map +1 -1
  14. package/core/dist/runtime-v2/governance-experience-contract.js +6 -3
  15. package/core/dist/runtime-v2/governance-experience-contract.js.map +1 -1
  16. package/core/dist/runtime-v2/governance-projection-contract.d.ts.map +1 -1
  17. package/core/dist/runtime-v2/governance-projection-contract.js +7 -13
  18. package/core/dist/runtime-v2/governance-projection-contract.js.map +1 -1
  19. package/core/dist/runtime-v2/governance-timestamp-schema.d.ts +18 -0
  20. package/core/dist/runtime-v2/governance-timestamp-schema.d.ts.map +1 -0
  21. package/core/dist/runtime-v2/governance-timestamp-schema.js +19 -0
  22. package/core/dist/runtime-v2/governance-timestamp-schema.js.map +1 -0
  23. package/core/dist/runtime-v2/index.d.ts +0 -2
  24. package/core/dist/runtime-v2/index.d.ts.map +1 -1
  25. package/core/dist/runtime-v2/index.js +4 -2
  26. package/core/dist/runtime-v2/index.js.map +1 -1
  27. package/core/dist/runtime-v2/internalization/internalization-orchestrator.d.ts.map +1 -1
  28. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js +18 -2
  29. package/core/dist/runtime-v2/internalization/internalization-orchestrator.js.map +1 -1
  30. package/core/package.json +1 -1
  31. package/package.json +2 -2
  32. package/plugin/dist/bundle.js +437 -441
  33. package/plugin/dist/governance-audit.js +163 -163
  34. package/plugin/dist/rulehost-evidence.js +174 -174
  35. package/plugin/openclaw.plugin.json +1 -1
  36. package/plugin/package.json +1 -1
  37. package/release-manager/package.json +2 -2
  38. package/core/dist/runtime-v2/__tests__/workspace-guidance-migration.test.d.ts +0 -2
  39. package/core/dist/runtime-v2/__tests__/workspace-guidance-migration.test.d.ts.map +0 -1
  40. package/core/dist/runtime-v2/__tests__/workspace-guidance-migration.test.js +0 -328
  41. package/core/dist/runtime-v2/__tests__/workspace-guidance-migration.test.js.map +0 -1
  42. package/core/dist/runtime-v2/workspace-guidance-migration.d.ts +0 -12
  43. package/core/dist/runtime-v2/workspace-guidance-migration.d.ts.map +0 -1
  44. package/core/dist/runtime-v2/workspace-guidance-migration.js +0 -193
  45. package/core/dist/runtime-v2/workspace-guidance-migration.js.map +0 -1
  46. package/plugin/dist/core/workspace-guidance-migrator.d.ts +0 -12
@@ -304,6 +304,9 @@
304
304
  "instructionPlaceholder": "e.g. Do not add new tool-naming requirements; only address the unresolved items from the last round.",
305
305
  "instructionRequired": "Fill in the revision guidance, or collapse the input and submit directly.",
306
306
  "actionConsequence": "Accept = continue with the current version (the machine verdict is preserved permanently); Revise once = authorize one extra revision round (automatic budget unchanged); Reject = terminate this evolution.",
307
+ "acceptBlockedHardGate": "\"Accept\" is unavailable: this item contains a code-rule implementation and opens only after the adversarial sandbox hard gate passes.",
308
+ "acceptBlockedNoCandidate": "\"Accept\" is unavailable: no activation candidate exists for this principle — revise or reject to continue.",
309
+ "acceptBlockedGeneric": "\"Accept\" is unavailable: the current evidence does not meet the release conditions — revise or reject.",
307
310
  "advanced": "Advanced diagnostics",
308
311
  "resolved": "Resolution recorded.",
309
312
  "staleError": "The facts of this item changed (a new evaluation may exist). Your decision was NOT applied — refresh and decide again.",
@@ -304,6 +304,9 @@
304
304
  "instructionPlaceholder": "例如:不要增加新的工具命名要求,只处理上一轮未解决问题。",
305
305
  "instructionRequired": "请填写修订指导,或收起输入后直接提交。",
306
306
  "actionConsequence": "接受 = 按当前版本继续(机器原判定永久保留);再修改一次 = 授权额外一轮修订(自动预算不变);拒绝 = 终止本条演化。",
307
+ "acceptBlockedHardGate": "「接受」暂不可用:本条包含代码规则实现,须先通过对抗沙箱硬闸门验证才会开放。",
308
+ "acceptBlockedNoCandidate": "「接受」暂不可用:该原则尚无可批准的激活候选,请修订或拒绝以继续。",
309
+ "acceptBlockedGeneric": "「接受」暂不可用:当前证据未满足放行条件,请修订或拒绝。",
307
310
  "advanced": "高级诊断",
308
311
  "resolved": "裁决已记录。",
309
312
  "staleError": "该事项的事实已变化(可能有新的评估结果)。未执行你的决定,请刷新后重新裁决。",
@@ -25,6 +25,22 @@ export function OwnerDecisionCard({ item, onResolved, governanceReady = true, ac
25
25
  const canReject = item.allowedActions.includes("reject_current");
26
26
  const requiresPartialAcknowledgement = item.review?.capability.acceptRequirement.kind === "acknowledge_partial_evidence";
27
27
  const evidenceUnavailable = item.evidenceUnavailableReason !== undefined;
28
+ // PRI-798 P1-2: when accept is unavailable the copy must name the actual
29
+ // reason — the adversarial hard gate, a missing activation candidate, or
30
+ // insufficient review evidence are different situations with different next
31
+ // actions. Discriminate on the structured reason codes, never on !canAccept.
32
+ const acceptBlockedCopy = (() => {
33
+ const acceptRequirement = item.review?.capability.acceptRequirement;
34
+ if (acceptRequirement?.kind === "forbidden" &&
35
+ (acceptRequirement.reasonCode === "adversarial_hard_gate_failed" ||
36
+ acceptRequirement.reasonCode === "adversarial_hard_gate_not_passed")) {
37
+ return t("pages.focus.ownerDecision.acceptBlockedHardGate");
38
+ }
39
+ if (item.reasonCode === "rollout_activation_candidate_unresolved") {
40
+ return t("pages.focus.ownerDecision.acceptBlockedNoCandidate");
41
+ }
42
+ return t("pages.focus.ownerDecision.acceptBlockedGeneric");
43
+ })();
28
44
  async function handleAction(action) {
29
45
  if (action === "revise_once" && showInstruction && instruction.trim().length === 0) {
30
46
  // 指导为空也可以提交 — instruction 是可选的;这里仅在展开输入后要求非空确认
@@ -85,7 +101,9 @@ export function OwnerDecisionCard({ item, onResolved, governanceReady = true, ac
85
101
  return;
86
102
  }
87
103
  void handleAction("revise_once");
88
- }, disabled: !governanceReady || actionLoading !== null, "data-testid": `owner-revise-${item.taskId}`, className: "inline-flex items-center border border-line text-ink bg-surface rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed", children: actionLoading === "revise_once" ? t("common.loading") : t("pages.focus.ownerDecision.reviseOnce") })), canReject && (_jsx("button", { type: "button", onClick: () => handleAction("reject_current"), disabled: !governanceReady || actionLoading !== null, "data-testid": `owner-reject-${item.taskId}`, className: "inline-flex items-center border border-danger text-danger bg-surface rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:bg-danger/5 transition-colors disabled:opacity-50 disabled:cursor-not-allowed", children: actionLoading === "reject_current" ? t("common.loading") : t("pages.focus.ownerDecision.rejectCurrent") }))] }), _jsx("div", { className: "mt-2 text-ink-4 text-[11.5px] leading-relaxed", children: t("pages.focus.ownerDecision.actionConsequence") }), _jsxs("button", { type: "button", onClick: () => setShowAdvanced(!showAdvanced), className: "mt-2 text-ink-4 text-[11px] font-mono uppercase tracking-[0.08em] hover:text-ink-3", "data-testid": `owner-advanced-toggle-${item.taskId}`, children: [showAdvanced ? "▾" : "▸", " ", t("pages.focus.ownerDecision.advanced")] }), showAdvanced && (_jsxs("dl", { className: "mt-2 grid gap-1 text-[11.5px] font-mono text-ink-4", children: [_jsxs("div", { children: ["taskId: ", item.taskId] }), _jsxs("div", { children: ["reasonCode: ", item.reasonCode] }), _jsxs("div", { children: ["reviewKey: ", item.reviewKey.slice(0, 24), "\u2026"] }), _jsxs("div", { children: ["epoch: ", item.expectedRevisionEpoch] }), item.review?.brief.requiredChanges.map((change, index) => (_jsxs("div", { children: ["requiredChange: ", change] }, `${change}-${index}`))), item.review?.evidence.items.map((evidence, index) => (_jsxs("div", { children: [evidence.evidenceClass, "/", evidence.label, ": ", evidence.value] }, `${evidence.label}-${index}`)))] }))] })) : (_jsxs("div", { className: "mt-2", children: [_jsx("p", { className: "text-ink-4 text-[12px] mb-2", children: item.kind === "activation_approval"
104
+ }, disabled: !governanceReady || actionLoading !== null, "data-testid": `owner-revise-${item.taskId}`, className: "inline-flex items-center border border-line text-ink bg-surface rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:border-line-2 transition-colors disabled:opacity-50 disabled:cursor-not-allowed", children: actionLoading === "revise_once" ? t("common.loading") : t("pages.focus.ownerDecision.reviseOnce") })), canReject && (_jsx("button", { type: "button", onClick: () => handleAction("reject_current"), disabled: !governanceReady || actionLoading !== null, "data-testid": `owner-reject-${item.taskId}`, className: "inline-flex items-center border border-danger text-danger bg-surface rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:bg-danger/5 transition-colors disabled:opacity-50 disabled:cursor-not-allowed", children: actionLoading === "reject_current" ? t("common.loading") : t("pages.focus.ownerDecision.rejectCurrent") }))] }), _jsx("div", { className: "mt-2 text-ink-4 text-[11.5px] leading-relaxed", children: canAccept
105
+ ? t("pages.focus.ownerDecision.actionConsequence")
106
+ : acceptBlockedCopy }), _jsxs("button", { type: "button", onClick: () => setShowAdvanced(!showAdvanced), className: "mt-2 text-ink-4 text-[11px] font-mono uppercase tracking-[0.08em] hover:text-ink-3", "data-testid": `owner-advanced-toggle-${item.taskId}`, children: [showAdvanced ? "▾" : "▸", " ", t("pages.focus.ownerDecision.advanced")] }), showAdvanced && (_jsxs("dl", { className: "mt-2 grid gap-1 text-[11.5px] font-mono text-ink-4", children: [_jsxs("div", { children: ["taskId: ", item.taskId] }), _jsxs("div", { children: ["reasonCode: ", item.reasonCode] }), _jsxs("div", { children: ["reviewKey: ", item.reviewKey.slice(0, 24), "\u2026"] }), _jsxs("div", { children: ["epoch: ", item.expectedRevisionEpoch] }), item.review?.brief.requiredChanges.map((change, index) => (_jsxs("div", { children: ["requiredChange: ", change] }, `${change}-${index}`))), item.review?.evidence.items.map((evidence, index) => (_jsxs("div", { children: [evidence.evidenceClass, "/", evidence.label, ": ", evidence.value] }, `${evidence.label}-${index}`)))] }))] })) : (_jsxs("div", { className: "mt-2", children: [_jsx("p", { className: "text-ink-4 text-[12px] mb-2", children: item.kind === "activation_approval"
89
107
  ? t("pages.focus.ownerDecision.approvalHint")
90
108
  : t("pages.focus.ownerDecision.rulecodeHint") }), item.kind === "activation_approval" ? (_jsx(Link, { to: "/principles", "data-testid": `go-approvals-${item.taskId}`, className: "inline-flex items-center border border-gov text-gov bg-surface rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:bg-gov/5 transition-colors", children: t("pages.focus.ownerDecision.goApprovalsCta") })) : (_jsx(Link, { to: "/activation", "data-testid": `go-activation-${item.taskId}`, className: "inline-flex items-center border border-gov text-gov bg-surface rounded-[3px] px-[14px] py-[6px] text-[12.5px] hover:bg-gov/5 transition-colors", children: t("pages.focus.ownerDecision.goActivationCta") }))] }))] }));
91
109
  }