create-principles-disciple 1.142.1 → 1.142.3

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 (44) hide show
  1. package/console/dist/server/models/OwnerDecisionConsoleModel.js +3 -1
  2. package/console/dist/ui/i18n/en.json +3 -0
  3. package/console/dist/ui/i18n/zh-CN.json +3 -0
  4. package/console/dist/ui/pages/focus/FocusPage.js +10 -1
  5. package/console/dist/ui/pages/focus/OwnerDecisionCard.d.ts +3 -1
  6. package/console/dist/ui/pages/focus/OwnerDecisionCard.js +2 -2
  7. package/console/dist/web/assets/app.js +36 -3
  8. package/core/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.js +54 -0
  9. package/core/dist/runtime-v2/adapter/__tests__/artificer-l2-adapter.test.js.map +1 -1
  10. package/core/dist/runtime-v2/adapter/artificer-l2-adapter.d.ts.map +1 -1
  11. package/core/dist/runtime-v2/adapter/artificer-l2-adapter.js +53 -1
  12. package/core/dist/runtime-v2/adapter/artificer-l2-adapter.js.map +1 -1
  13. package/core/dist/runtime-v2/internalization/__tests__/scribe-intent-contract-normalization.test.d.ts +2 -0
  14. package/core/dist/runtime-v2/internalization/__tests__/scribe-intent-contract-normalization.test.d.ts.map +1 -0
  15. package/core/dist/runtime-v2/internalization/__tests__/scribe-intent-contract-normalization.test.js +78 -0
  16. package/core/dist/runtime-v2/internalization/__tests__/scribe-intent-contract-normalization.test.js.map +1 -0
  17. package/core/dist/runtime-v2/internalization/scribe-output.d.ts +13 -0
  18. package/core/dist/runtime-v2/internalization/scribe-output.d.ts.map +1 -1
  19. package/core/dist/runtime-v2/internalization/scribe-output.js +32 -0
  20. package/core/dist/runtime-v2/internalization/scribe-output.js.map +1 -1
  21. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.d.ts.map +1 -1
  22. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js +1 -0
  23. package/core/dist/runtime-v2/internalization/scribe-prompt-builder.js.map +1 -1
  24. package/core/dist/runtime-v2/internalization/scribe-runner.d.ts.map +1 -1
  25. package/core/dist/runtime-v2/internalization/scribe-runner.js +4 -0
  26. package/core/dist/runtime-v2/internalization/scribe-runner.js.map +1 -1
  27. package/core/dist/telemetry-event.d.ts +2 -2
  28. package/core/dist/telemetry-event.d.ts.map +1 -1
  29. package/core/dist/telemetry-event.js +3 -0
  30. package/core/dist/telemetry-event.js.map +1 -1
  31. package/core/package.json +1 -1
  32. package/package.json +2 -2
  33. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.d.ts.map +1 -1
  34. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.js +8 -0
  35. package/pd-cli/dist/commands/runtime-internalization-run-rulehost.js.map +1 -1
  36. package/pd-cli/package.json +1 -1
  37. package/plugin/dist/bundle.js +404 -398
  38. package/plugin/dist/core/signal-collector-host.d.ts +6 -0
  39. package/plugin/dist/core/trajectory.d.ts +8 -0
  40. package/plugin/dist/governance-audit.js +3 -3
  41. package/plugin/dist/rulehost-evidence.js +8 -4
  42. package/plugin/openclaw.plugin.json +1 -1
  43. package/plugin/package.json +1 -1
  44. package/release-manager/package.json +2 -2
@@ -143,12 +143,14 @@ async function deriveTaskDecisionItem(task, dependencies) {
143
143
  const sourceRunId = facts.task.humanReviewContext?.sourceRunId
144
144
  ?? facts.task.completionIntent?.sourceRunId ?? '';
145
145
  const artifact = facts.decisionArtifact;
146
+ // rollout 卡 title 用固定文案:brief.summary 已作为 summary 渲染,复用会让
147
+ // 同一段评审原文在同一张卡出现两次(PRI-787)。
146
148
  const title = review.brief.kind === 'evaluator'
147
149
  ? review.brief.principle.title
148
150
  ?? review.brief.principle.statement
149
151
  ?? review.brief.implementation.summary
150
152
  ?? '自动改进需要你的判断'
151
- : review.brief.summary ?? 'Rollout 评审需要你的判断';
153
+ : 'Rollout 评审需要你的判断';
152
154
  const summary = review.brief.kind === 'evaluator'
153
155
  ? review.brief.implementation.summary
154
156
  ?? (review.brief.concerns.length > 0
@@ -297,6 +297,9 @@
297
297
  "acceptCurrent": "Accept current version",
298
298
  "reviseOnce": "Revise once more",
299
299
  "rejectCurrent": "Reject",
300
+ "actionsLockedAuth": "Decision actions are locked: this console runs without access authentication (the Companion launches the console unauthenticated by default). Configure the console access token in Settings and restart the console to enable Accept / Revise once / Reject.",
301
+ "actionsLockedIdentity": "Decision actions are locked: Owner identity is missing or invalid. Configure Owner identity in Settings to enable decision actions.",
302
+ "goSettingsCta": "Open Settings",
300
303
  "instructionLabel": "Revision guidance (optional, one sentence)",
301
304
  "instructionPlaceholder": "e.g. Do not add new tool-naming requirements; only address the unresolved items from the last round.",
302
305
  "instructionRequired": "Fill in the revision guidance, or collapse the input and submit directly.",
@@ -297,6 +297,9 @@
297
297
  "acceptCurrent": "接受当前版本",
298
298
  "reviseOnce": "再修改一次",
299
299
  "rejectCurrent": "拒绝",
300
+ "actionsLockedAuth": "决策动作已锁定:当前控制台未开启访问认证(Companion 默认以无认证模式启动控制台)。在「设置」中配置控制台访问令牌并重启控制台后,接受 / 再修改一次 / 拒绝才会可用。",
301
+ "actionsLockedIdentity": "决策动作已锁定:拥有者身份未配置或无效。在「设置」中完成拥有者身份配置后,决策动作才会可用。",
302
+ "goSettingsCta": "前往设置",
300
303
  "instructionLabel": "修订指导(可选,一句话)",
301
304
  "instructionPlaceholder": "例如:不要增加新的工具命名要求,只处理上一轮未解决问题。",
302
305
  "instructionRequired": "请填写修订指导,或收起输入后直接提交。",
@@ -546,6 +546,15 @@ export function FocusPage({ featureFlags }) {
546
546
  const approvalDataUnavailable = (groupedData === null || groupedData.groups.length === 0) && pendingCount > 0;
547
547
  const ruleCodePending = ruleCodeItems.filter(item => item.action === 'code_tool_hook_shadow_activate' && item.enforcement !== 'safety_isolated');
548
548
  const ruleCodeAlerts = ruleCodeItems.filter(item => item.enforcement === 'safety_isolated');
549
+ // PRI-787: 决策动作被治理就绪门锁定时,必须在卡片上给出可见原因(rc-9 —
550
+ // 禁用不允许是无声的)。experienceData 未加载(null)时门默认放行、无锁定。
551
+ const ownerActionsLockedReason = experienceData === null
552
+ || (experienceData.readiness.authenticationMode === "authenticated"
553
+ && experienceData.readiness.ownerIdentityConfiguration === "configured")
554
+ ? null
555
+ : t(experienceData.readiness.authenticationMode !== "authenticated"
556
+ ? "pages.focus.ownerDecision.actionsLockedAuth"
557
+ : "pages.focus.ownerDecision.actionsLockedIdentity");
549
558
  // Map codes to i18n text
550
559
  // Governance Recovery Actions v1: tasks_need_human_review interpolates the
551
560
  // needs_human_review task count, not the approvals count.
@@ -556,7 +565,7 @@ export function FocusPage({ featureFlags }) {
556
565
  return (_jsx(PageShell, { children: _jsxs("div", { className: "animate-[pdFadeIn_400ms_ease-out]", children: [_jsx("div", { className: "font-mono text-[12px] tracking-[0.14em] text-ink-3 uppercase mb-3", children: t("pages.focus.eyebrow") }), _jsx(ShinyText, { as: "h1", className: "text-[29px] font-semibold tracking-tight text-ink mb-2", duration: 4.5, brightness: 0.5, disabled: pendingCount === 0, children: t("pages.focus.title") }), _jsx("p", { className: "text-ink-3 text-[14px] max-w-[760px] leading-relaxed mb-7", children: t("pages.focus.subtitle") }), _jsxs("section", { "aria-label": t("pages.focus.ownerDecision.sectionTitle"), className: "mb-7", "data-testid": "owner-decisions-section", children: [_jsxs("div", { className: "flex items-baseline gap-2 mb-3", children: [_jsx(SectionTitle, { children: t("pages.focus.ownerDecision.sectionTitle") }), _jsx("span", { className: "font-mono text-ink-4 text-[12px]", children: ownerDecisionError !== null
557
566
  ? t("pages.focus.ownerDecision.unavailable")
558
567
  : `· ${ownerDecisionItems.length}` })] }), ownerDecisionError !== null && (_jsx("p", { className: "text-ink-4 text-[12.5px]", children: t("pages.focus.ownerDecision.loadError") })), ownerDecisionError === null && ownerDecisionItems.length === 0 && (_jsx("p", { className: "text-ink-4 text-[13px]", children: t("pages.focus.ownerDecision.empty") })), ownerDecisionItems.map((item) => (_jsx(OwnerDecisionCard, { item: item, governanceReady: experienceData === null || (experienceData.readiness.authenticationMode === "authenticated"
559
- && experienceData.readiness.ownerIdentityConfiguration === "configured"), onResolved: () => { void loadData(); } }, item.reviewKey)))] }), experienceMode && experienceData !== null ? (_jsx(ExperienceSummaryCard, { snapshot: experienceData })) : !experienceMode ? (_jsxs("div", { className: "mb-7 px-[18px] py-[14px] bg-panel border border-line rounded-[6px]", children: [_jsx("div", { className: "flex items-center gap-2 mb-1", children: _jsx("span", { className: `inline-flex items-center rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase ${governanceState === "owner_review_ready" ? "bg-gov/10 text-gov border border-gov/20"
568
+ && experienceData.readiness.ownerIdentityConfiguration === "configured"), actionsLockedReason: ownerActionsLockedReason ?? undefined, onResolved: () => { void loadData(); } }, item.reviewKey)))] }), experienceMode && experienceData !== null ? (_jsx(ExperienceSummaryCard, { snapshot: experienceData })) : !experienceMode ? (_jsxs("div", { className: "mb-7 px-[18px] py-[14px] bg-panel border border-line rounded-[6px]", children: [_jsx("div", { className: "flex items-center gap-2 mb-1", children: _jsx("span", { className: `inline-flex items-center rounded-[2px] px-[7px] py-1 font-mono text-[11px] uppercase ${governanceState === "owner_review_ready" ? "bg-gov/10 text-gov border border-gov/20"
560
569
  : governanceState === "degraded" ? "bg-amber/10 text-amber border border-amber/20"
561
570
  : governanceState === "in_progress" ? "bg-green/10 text-green border border-green/20"
562
571
  : "text-ink-4 border border-line bg-surface/80"}`, role: "status", children: t(`pages.focus.stateLabel.${governanceState}`) }) }), _jsx("div", { className: "text-ink-2 text-[13px] leading-relaxed mt-1", children: stateReason }), _jsxs("div", { className: "text-ink-4 text-[13px] leading-relaxed mt-1", children: [_jsx("span", { className: "font-medium", children: t("pages.focus.nextActionLabel") }), " ", nextAction] })] })) : null, !experienceMode && (_jsxs(_Fragment, { children: [_jsx(ProseSummary, { pendingCount: pendingCount, deviationCount: deviationCount, stagnationCount: stagnationCount, evidenceCount: evidenceCount }), _jsx(FeedbackStratification, { gateBlocksToday: gateBlocksToday, inProgressCount: evidenceCount, pendingCount: pendingCount }), !experienceMode && governanceState === "none" && pendingCount === 0 && deviationCount === 0 && stagnationCount === 0 && (stateReasonCode === "state_db_missing" ? (_jsx(ZeroStateDbMissing, {})) : (_jsxs(_Fragment, { children: [_jsx(ZeroStateHealthy, {}), _jsx("div", { className: "mt-4", children: _jsx(OnboardingGuide, {}) })] }))), governanceState === "in_progress" && inProgressSummary && (_jsx(InProgressGuide, { summary: inProgressSummary })), degradedSignals && degradedSignals.length > 0 && (_jsx(DegradedSummary, { signals: degradedSignals }))] })), _jsx(DailyThoughtCard, {}), experienceMode && experienceData !== null && experienceData.summary.primaryAttention === "all_clear" && pendingGroups.length === 0 && (_jsx("div", { className: "mt-4", children: _jsx(OnboardingGuide, {}) })), !experienceMode && (_jsxs("section", { className: "mt-8", "aria-labelledby": "section-deviation", children: [_jsx(SectionTitle, { id: "section-deviation", children: evidenceCount > 0
@@ -3,5 +3,7 @@ export interface OwnerDecisionCardProps {
3
3
  item: OwnerDecisionItemData;
4
4
  onResolved: () => void;
5
5
  governanceReady?: boolean;
6
+ /** 非空时在动作区渲染可见的锁定原因(rc-9:禁用不允许是无声的)。 */
7
+ actionsLockedReason?: string;
6
8
  }
7
- export declare function OwnerDecisionCard({ item, onResolved, governanceReady }: OwnerDecisionCardProps): import("react").JSX.Element;
9
+ export declare function OwnerDecisionCard({ item, onResolved, governanceReady, actionsLockedReason, }: OwnerDecisionCardProps): import("react").JSX.Element;
@@ -12,7 +12,7 @@ import { Link } from "react-router-dom";
12
12
  import { useTranslation } from "react-i18next";
13
13
  import { toast } from "sonner";
14
14
  import { resolveOwnerDecision } from "../../api.js";
15
- export function OwnerDecisionCard({ item, onResolved, governanceReady = true }) {
15
+ export function OwnerDecisionCard({ item, onResolved, governanceReady = true, actionsLockedReason, }) {
16
16
  const { t } = useTranslation();
17
17
  const [actionLoading, setActionLoading] = useState(null);
18
18
  const [instruction, setInstruction] = useState("");
@@ -79,7 +79,7 @@ export function OwnerDecisionCard({ item, onResolved, governanceReady = true })
79
79
  : item.kind === "rulecode_decision"
80
80
  ? t("pages.focus.ownerDecision.kindRulecode")
81
81
  : t("pages.focus.ownerDecision.kindEvaluator");
82
- return (_jsxs("article", { className: "bg-panel border border-line rounded-[6px] p-4 mb-3", "data-testid": `owner-decision-${item.taskId}`, children: [_jsxs("div", { className: "flex items-start justify-between gap-3 mb-2", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-ink text-[14px] font-medium leading-snug", children: item.title }), _jsx("div", { className: "mt-1 text-ink-4 text-[11px] font-mono uppercase tracking-[0.08em]", children: kindLabel })] }), item.legacy && (_jsx("span", { className: "shrink-0 text-ink-4 border border-line rounded-[2px] px-[7px] py-[3px] text-[10.5px] font-mono", children: t("pages.focus.ownerDecision.legacyBadge") }))] }), _jsx("p", { className: "text-ink-2 text-[13px] leading-relaxed mb-2", children: item.summary }), item.review?.brief.kind === "evaluator" && (_jsxs("div", { className: "mb-3 grid gap-2 text-[12.5px] leading-relaxed", children: [item.review.brief.principle?.statement && (_jsxs("p", { children: [_jsx("span", { className: "font-medium text-ink", children: t("pages.focus.ownerDecision.principleLabel") }), " ", item.review.brief.principle.statement] })), item.review.brief.implementation?.summary && (_jsxs("p", { children: [_jsx("span", { className: "font-medium text-ink", children: t("pages.focus.ownerDecision.implementationLabel") }), " ", item.review.brief.implementation.summary] })), (item.review.brief.concerns?.length ?? 0) > 0 && (_jsxs("p", { className: "text-amber", children: [_jsx("span", { className: "font-medium", children: t("pages.focus.ownerDecision.concernLabel") }), " ", item.review.brief.concerns?.[0]] })), (item.review.brief.qualityChecklist?.items?.length ?? 0) > 0 && (_jsxs("div", { className: "mt-1 rounded-[3px] border border-line bg-surface-2 p-2", "data-testid": `owner-quality-checklist-${item.taskId}`, children: [_jsx("div", { className: "font-mono text-[10.5px] uppercase tracking-[0.06em] text-ink-3 mb-1", children: t("pages.focus.ownerDecision.qualityChecklistLabel") }), _jsx("ul", { className: "grid gap-0.5", children: item.review.brief.qualityChecklist?.items.map((qItem) => (_jsxs("li", { className: "flex items-start gap-1.5 text-[12px]", children: [_jsx("span", { className: qItem.pass ? "text-emerald" : "text-amber", "aria-hidden": "true", children: qItem.pass ? "✓" : "!" }), _jsx("span", { className: "sr-only", children: qItem.pass ? t("pages.focus.ownerDecision.qualityCheckStatus.passed") : t("pages.focus.ownerDecision.qualityCheckStatus.failed") }), _jsxs("span", { className: "text-ink-2", children: [_jsx("span", { className: "font-medium", children: t(`pages.focus.ownerDecision.qualityCheck.${qItem.id}`) }), " ", qItem.note] })] }, qItem.id))) })] }))] })), item.review?.brief.kind === "rollout" && item.review.brief.summary && (_jsx("p", { className: "mb-3 text-[12.5px] text-ink-2", children: item.review.brief.summary })), item.review && (_jsxs("div", { className: "mb-2 flex flex-wrap gap-2 text-[10.5px] font-mono uppercase tracking-[0.06em]", children: [_jsx("span", { className: "rounded-[2px] border border-line px-2 py-1 text-ink-3", children: t(`pages.focus.ownerDecision.evidence.${item.review.evidence.completeness}`) }), item.review.evidence.deterministicChecks.map(check => (_jsxs("span", { className: "rounded-[2px] border border-line px-2 py-1 text-ink-3", children: [check.check, ": ", check.status] }, check.check)))] })), item.machineRecommendation && (_jsxs("p", { className: "text-ink-3 text-[12.5px] mb-1", children: [_jsx("span", { className: "font-medium", children: t("pages.focus.ownerDecision.machineRecommendationLabel") }), " ", item.machineRecommendation, item.score !== undefined && _jsx("span", { className: "font-mono ml-1", children: item.score.toFixed(2) })] })), item.kind === "rollout_review" && (_jsx("p", { className: "text-ink-4 text-[12px] mb-1", children: t("pages.focus.ownerDecision.rolloutSafetyNote") })), evidenceUnavailable ? (_jsxs("div", { className: "mt-3 rounded-[3px] border border-amber/40 bg-amber/5 p-3", children: [_jsx("p", { className: "text-ink-2 text-[12.5px] leading-relaxed", children: t("pages.focus.ownerDecision.evidenceUnavailable") }), _jsx(Link, { to: "/failed", "data-testid": `owner-evidence-recover-${item.taskId}`, className: "mt-2 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", children: t("pages.focus.ownerDecision.goRecoverCta") })] })) : isTaskDecision ? (_jsxs(_Fragment, { children: [showInstruction && (_jsxs("div", { className: "mt-2 mb-2", children: [_jsx("label", { className: "block font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-2", children: t("pages.focus.ownerDecision.instructionLabel") }), _jsx("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value.slice(0, 500)), "data-testid": `owner-instruction-${item.taskId}`, placeholder: t("pages.focus.ownerDecision.instructionPlaceholder"), className: "w-full border border-line rounded-[var(--radius-md)] bg-surface text-ink px-3 py-2 text-[13px] min-h-[64px] resize-y focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gov" })] })), requiresPartialAcknowledgement && (_jsxs("label", { className: "mt-2 mb-1 flex items-start gap-2 text-[12px] text-ink-3", children: [_jsx("input", { type: "checkbox", checked: partialEvidenceAcknowledged, onChange: (event) => setPartialEvidenceAcknowledged(event.target.checked), "data-testid": `owner-partial-evidence-ack-${item.taskId}`, className: "mt-0.5" }), _jsx("span", { children: t("pages.focus.ownerDecision.partialEvidenceAcknowledgement") })] })), _jsxs("div", { className: "flex flex-wrap gap-2 mt-3", children: [canAccept && (_jsx("button", { type: "button", onClick: () => handleAction("accept_current"), disabled: !governanceReady || actionLoading !== null || (requiresPartialAcknowledgement && !partialEvidenceAcknowledged), "data-testid": `owner-accept-${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 disabled:opacity-50 disabled:cursor-not-allowed", children: actionLoading === "accept_current" ? t("common.loading") : t("pages.focus.ownerDecision.acceptCurrent") })), canRevise && (_jsx("button", { type: "button", onClick: () => {
82
+ return (_jsxs("article", { className: "bg-panel border border-line rounded-[6px] p-4 mb-3", "data-testid": `owner-decision-${item.taskId}`, children: [_jsxs("div", { className: "flex items-start justify-between gap-3 mb-2", children: [_jsxs("div", { children: [_jsx("h3", { className: "text-ink text-[14px] font-medium leading-snug", children: item.title }), _jsx("div", { className: "mt-1 text-ink-4 text-[11px] font-mono uppercase tracking-[0.08em]", children: kindLabel })] }), item.legacy && (_jsx("span", { className: "shrink-0 text-ink-4 border border-line rounded-[2px] px-[7px] py-[3px] text-[10.5px] font-mono", children: t("pages.focus.ownerDecision.legacyBadge") }))] }), _jsx("p", { className: "text-ink-2 text-[13px] leading-relaxed mb-2", children: item.summary }), item.review?.brief.kind === "evaluator" && (_jsxs("div", { className: "mb-3 grid gap-2 text-[12.5px] leading-relaxed", children: [item.review.brief.principle?.statement && (_jsxs("p", { children: [_jsx("span", { className: "font-medium text-ink", children: t("pages.focus.ownerDecision.principleLabel") }), " ", item.review.brief.principle.statement] })), item.review.brief.implementation?.summary && (_jsxs("p", { children: [_jsx("span", { className: "font-medium text-ink", children: t("pages.focus.ownerDecision.implementationLabel") }), " ", item.review.brief.implementation.summary] })), (item.review.brief.concerns?.length ?? 0) > 0 && (_jsxs("p", { className: "text-amber", children: [_jsx("span", { className: "font-medium", children: t("pages.focus.ownerDecision.concernLabel") }), " ", item.review.brief.concerns?.[0]] })), (item.review.brief.qualityChecklist?.items?.length ?? 0) > 0 && (_jsxs("div", { className: "mt-1 rounded-[3px] border border-line bg-surface-2 p-2", "data-testid": `owner-quality-checklist-${item.taskId}`, children: [_jsx("div", { className: "font-mono text-[10.5px] uppercase tracking-[0.06em] text-ink-3 mb-1", children: t("pages.focus.ownerDecision.qualityChecklistLabel") }), _jsx("ul", { className: "grid gap-0.5", children: item.review.brief.qualityChecklist?.items.map((qItem) => (_jsxs("li", { className: "flex items-start gap-1.5 text-[12px]", children: [_jsx("span", { className: qItem.pass ? "text-emerald" : "text-amber", "aria-hidden": "true", children: qItem.pass ? "✓" : "!" }), _jsx("span", { className: "sr-only", children: qItem.pass ? t("pages.focus.ownerDecision.qualityCheckStatus.passed") : t("pages.focus.ownerDecision.qualityCheckStatus.failed") }), _jsxs("span", { className: "text-ink-2", children: [_jsx("span", { className: "font-medium", children: t(`pages.focus.ownerDecision.qualityCheck.${qItem.id}`) }), " ", qItem.note] })] }, qItem.id))) })] }))] })), item.review && (_jsxs("div", { className: "mb-2 flex flex-wrap gap-2 text-[10.5px] font-mono uppercase tracking-[0.06em]", children: [_jsx("span", { className: "rounded-[2px] border border-line px-2 py-1 text-ink-3", children: t(`pages.focus.ownerDecision.evidence.${item.review.evidence.completeness}`) }), item.review.evidence.deterministicChecks.map(check => (_jsxs("span", { className: "rounded-[2px] border border-line px-2 py-1 text-ink-3", children: [check.check, ": ", check.status] }, check.check)))] })), item.machineRecommendation && (_jsxs("p", { className: "text-ink-3 text-[12.5px] mb-1", children: [_jsx("span", { className: "font-medium", children: t("pages.focus.ownerDecision.machineRecommendationLabel") }), " ", item.machineRecommendation, item.score !== undefined && _jsx("span", { className: "font-mono ml-1", children: item.score.toFixed(2) })] })), item.kind === "rollout_review" && (_jsx("p", { className: "text-ink-4 text-[12px] mb-1", children: t("pages.focus.ownerDecision.rolloutSafetyNote") })), evidenceUnavailable ? (_jsxs("div", { className: "mt-3 rounded-[3px] border border-amber/40 bg-amber/5 p-3", children: [_jsx("p", { className: "text-ink-2 text-[12.5px] leading-relaxed", children: t("pages.focus.ownerDecision.evidenceUnavailable") }), _jsx(Link, { to: "/failed", "data-testid": `owner-evidence-recover-${item.taskId}`, className: "mt-2 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", children: t("pages.focus.ownerDecision.goRecoverCta") })] })) : isTaskDecision ? (_jsxs(_Fragment, { children: [showInstruction && (_jsxs("div", { className: "mt-2 mb-2", children: [_jsx("label", { className: "block font-mono text-[11px] uppercase tracking-[0.08em] text-ink-3 mb-2", children: t("pages.focus.ownerDecision.instructionLabel") }), _jsx("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value.slice(0, 500)), "data-testid": `owner-instruction-${item.taskId}`, placeholder: t("pages.focus.ownerDecision.instructionPlaceholder"), className: "w-full border border-line rounded-[var(--radius-md)] bg-surface text-ink px-3 py-2 text-[13px] min-h-[64px] resize-y focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gov" })] })), requiresPartialAcknowledgement && (_jsxs("label", { className: "mt-2 mb-1 flex items-start gap-2 text-[12px] text-ink-3", children: [_jsx("input", { type: "checkbox", checked: partialEvidenceAcknowledged, onChange: (event) => setPartialEvidenceAcknowledged(event.target.checked), "data-testid": `owner-partial-evidence-ack-${item.taskId}`, className: "mt-0.5" }), _jsx("span", { children: t("pages.focus.ownerDecision.partialEvidenceAcknowledgement") })] })), !governanceReady && actionsLockedReason && (_jsxs("div", { className: "mt-3 rounded-[3px] border border-amber/40 bg-amber/5 p-3", "data-testid": `owner-actions-locked-${item.taskId}`, children: [_jsx("p", { className: "text-ink-2 text-[12.5px] leading-relaxed", children: actionsLockedReason }), _jsx(Link, { to: "/settings", "data-testid": `owner-actions-locked-settings-${item.taskId}`, className: "mt-2 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", children: t("pages.focus.ownerDecision.goSettingsCta") })] })), _jsxs("div", { className: "flex flex-wrap gap-2 mt-3", children: [canAccept && (_jsx("button", { type: "button", onClick: () => handleAction("accept_current"), disabled: !governanceReady || actionLoading !== null || (requiresPartialAcknowledgement && !partialEvidenceAcknowledged), "data-testid": `owner-accept-${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 disabled:opacity-50 disabled:cursor-not-allowed", children: actionLoading === "accept_current" ? t("common.loading") : t("pages.focus.ownerDecision.acceptCurrent") })), canRevise && (_jsx("button", { type: "button", onClick: () => {
83
83
  if (!showInstruction) {
84
84
  setShowInstruction(true);
85
85
  return;