Skip to content

Commit daee5a4

Browse files
committed
Use the selected Goal runtime for Chat task reads and writes
Signed-off-by: huangruiteng <huangrt01@163.com>
1 parent 9dbe0f2 commit daee5a4

33 files changed

Lines changed: 1701 additions & 281 deletions

‎apps/presentation/dashboard/src/data/action-source-basis.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const todoBasis = {
55
provider_revision: z.string().min(1),
66
source_authority: z.enum(["file_v0", "sqlite_v0"]),
77
registry_sha256: digest,
8+
source_identity: digest.optional(),
89
};
910

1011
// Decode existing backend contracts; effect authority and stale-source checks

‎apps/presentation/dashboard/src/features/personal-workspace/channel-timeline.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ export const ChannelTimeline = memo(function ChannelTimeline({
251251
return (
252252
<Fragment key={item.id}><button className={`personal-proposal-row is-${item.proposal.status}`} data-action-kind={item.proposal.actionKind} onClick={() => onSelect({ item: item.proposal, kind: "proposal" })} type="button">
253253
<span><Sparkles size={17} /></span>
254-
<span><small>{pendingOperation ? t(`proposal.kind.${item.proposal.actionKind}`)
254+
<span><small>{pendingOperation || item.proposal.reviewPlan?.reason === "todo_creation_retry" ? t(`proposal.kind.${item.proposal.actionKind}`)
255255
: taskReceipt ? t("drawer.taskLaunchReceipt")
256256
: appliedTeamPlan ? (locale === "zh-CN" ? "团队分配 · 已记录" : "Team assignment · Recorded")
257257
: `${t(`proposal.kind.${item.proposal.actionKind}`)} · ${t(`proposal.status.${item.proposal.status}`)}`}</small><strong>{item.proposal.title}</strong>{item.proposal.impact ? <p>{item.proposal.impact}</p> : null}</span>

‎apps/presentation/dashboard/src/features/personal-workspace/context-drawer.tsx‎

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ export function ContextDrawer({ agents, attentionHistory = [], onSelectAttention
186186
const visibleProposalFields = selection.kind === "proposal"
187187
? selection.item.fields.filter(field => !completionProofFields.includes(field)) : [];
188188
const proposalTarget = selection.kind === "proposal" ? selection.item : null;
189+
const recoveringTodoCreation = proposalTarget?.reviewPlan?.reason === "todo_creation_retry";
190+
const preserveOriginalProposal = proposalTarget?.reviewPlan?.prohibitRegeneration === true;
191+
const retainedTodoGate = preserveOriginalProposal && proposalTarget?.actionKind === "todo.create"
192+
&& proposalTarget.gate?.kind === "canonical_authority_required" ? proposalTarget.gate : null;
193+
const shownProposalFields = retainedTodoGate ? [] : recoveringTodoCreation
194+
? visibleProposalFields.filter(field => field.key !== "text" && field.key !== "goal_id")
195+
: visibleProposalFields;
189196
const taskExecution = proposalTarget?.status === "applied" && !proposalReadbackUnavailable && !readOnly
190197
? proposalTarget.reviewPlan?.taskExecution : undefined;
191198
const proposalRequests = proposalTarget?.todoId
@@ -347,6 +354,8 @@ export function ContextDrawer({ agents, attentionHistory = [], onSelectAttention
347354
&& selection.item.reviewPlan?.operationFrame?.kind === "result"
348355
&& selection.item.reviewPlan.operationFrame.resultKind === "unknown";
349356
const decisionFrame = selection.kind === "proposal" ? selection.item.reviewPlan?.decisionFrame : undefined;
357+
const completedTodoCreation = proposalTarget?.actionKind === "todo.create"
358+
&& proposalTarget.reviewPlan?.interaction === "completed";
350359
const title = taskExecution ? t("drawer.taskLaunchReceipt")
351360
: selection.kind === "attention" ? t("drawer.titleAttention")
352361
: selection.kind === "todo" ? t("drawer.taskDetails")
@@ -1224,15 +1233,17 @@ export function ContextDrawer({ agents, attentionHistory = [], onSelectAttention
12241233
? <div role="status" className="personal-proposal-state is-error" data-testid="operation-readback-unavailable"><p>{t("proposal.readbackUnavailable")}</p>
12251234
{onRetryProposalReadback ? <button type="button" className="personal-secondary-action" disabled={proposalReadbackFetching} onClick={onRetryProposalReadback}>{t("proposal.readbackRetry")}</button> : null}</div> : null}
12261235
{selection.item.actionKind === "team.plan" && selection.item.status === "applied" ? <TeamPlanResult proposal={selection.item} t={t} /> : <section className="personal-proposal-card">
1227-
{!taskExecution ? <small>{selection.item.reviewPlan?.operationFrame?.kind === "pending"
1236+
{!taskExecution ? <small>{(selection.item.reviewPlan?.operationFrame?.kind === "pending" || recoveringTodoCreation)
12281237
? t(`proposal.kind.${selection.item.actionKind}`)
12291238
: `${t(`proposal.kind.${selection.item.actionKind}`)} · ${t(`proposal.status.${selection.item.status}`)}`}</small> : null}
12301239
{decisionFrame ? <span className={`personal-decision-chip is-${decisionFrame.decision}`}>{t(`proposal.decision.${decisionFrame.decision}`)}</span> : null}
12311240
<h3>{selection.item.title}</h3>
12321241
{selection.item.todoId && (selection.item.actionKind === "gate.resolve" || selection.item.actionKind === "todo.update")
12331242
? <div className="personal-attention-meta"><AttentionProvenance detail={proposalRequests.length === 1 ? proposalRequests[0].details : undefined} /></div> : null}
1234-
{selection.item.impact ? <p>{selection.item.impact}</p> : null}
1235-
{selection.item.reviewPlan && !selection.item.reviewPlan.creationExecution && !selection.item.reviewPlan.retryOriginal && !taskExecution && selection.item.actionKind !== "team.plan" && !(decisionFrame && ["ready", "applied"].includes(selection.item.status)) ? <p className="personal-proposal-explainer" data-action-review={selection.item.reviewPlan.interaction}>{operationUnknown
1243+
{retainedTodoGate ? <div className="personal-proposal-state is-gated" role="status">
1244+
<span>{retainedTodoGate.summary}{retainedTodoGate.nextAction ? <small>{retainedTodoGate.nextAction}</small> : null}</span>
1245+
</div> : selection.item.impact ? <p>{selection.item.impact}</p> : null}
1246+
{selection.item.reviewPlan && !retainedTodoGate && !selection.item.reviewPlan.creationExecution && !selection.item.reviewPlan.retryOriginal && !taskExecution && selection.item.actionKind !== "team.plan" && !(decisionFrame && ["ready", "applied"].includes(selection.item.status)) ? <p className="personal-proposal-explainer" data-action-review={selection.item.reviewPlan.interaction}>{operationUnknown
12361247
? t("actionReview.operation_reconcile_original")
12371248
: selection.item.reviewPlan.operationFrame?.kind === "inactive"
12381249
? t(`actionReview.${selection.item.reviewPlan.operationFrame.reason}`)
@@ -1245,7 +1256,7 @@ export function ContextDrawer({ agents, attentionHistory = [], onSelectAttention
12451256
: t(`actionReview.${selection.item.reviewPlan.reason}`)}</p> : null}
12461257
{selection.item.status === "ready" && !selection.item.reviewPlan?.creationExecution && selection.item.actionKind !== "team.plan" && !decisionFrame ? <p className="personal-proposal-explainer">{t("drawer.proposalExplainer")}</p> : null}
12471258
{selection.item.reviewPlan?.creationExecution ? <GoalCreationExecution execution={selection.item.reviewPlan.creationExecution}/> : null}
1248-
{!taskExecution && visibleProposalFields.length ? <dl>{visibleProposalFields.map((field) => <div key={field.key}><dt>{field.label}</dt><dd>{field.value}</dd></div>)}</dl> : null}
1259+
{!taskExecution && shownProposalFields.length ? <dl>{shownProposalFields.map((field) => <div key={field.key}><dt>{field.label}</dt><dd>{field.value}</dd></div>)}</dl> : null}
12491260
</section>}
12501261
{selection.item.reviewPlan?.creationProgress?.goalId && selection.item.status !== "applied" ? <div className="personal-proposal-state is-applied" role="status" data-testid="goal-creation-committed"><Check size={16} /><span>
12511262
<strong>{t("proposal.field.goalId")}: {selection.item.reviewPlan.creationProgress.goalId} · {t("proposal.status.applied")}</strong>
@@ -1266,10 +1277,23 @@ export function ContextDrawer({ agents, attentionHistory = [], onSelectAttention
12661277
? <p className="personal-proposal-state is-stale">{t("proposal.primary.operationCancelled")}</p> : null}
12671278
{selection.item.status === "deferred" ? <p className="personal-proposal-state is-gated">{t("drawer.proposalDeferred")}</p> : null}
12681279
{selection.item.status === "gated" && selection.item.actionKind === "gate.resolve" ? <div className="personal-proposal-state is-gated"><span><strong>{t("drawer.gateDecisionRecheckTitle")}</strong>{t("drawer.gateDecisionRecheck")}</span></div>
1269-
: selection.item.status === "gated" ? <div className="personal-proposal-state is-gated"><span><strong>{selection.item.actionKind === "operation.execute" ? selection.item.primaryLabel : selection.item.workspaceCandidates?.length || selection.item.gate?.kind === "agent_unavailable" ? selection.item.title : t("drawer.gateRequiresHost")}</strong>{selection.item.actionKind === "operation.execute" || selection.item.workspaceCandidates?.length || selection.item.gate?.kind === "agent_unavailable" ? selection.item.impact : t("drawer.gateRequiresHostDescription")}</span>{selection.item.gate?.nextAction ? <small>{selection.item.gate.nextAction}</small> : null}</div> : null}
1280+
: selection.item.status === "gated" && !retainedTodoGate ? <div className="personal-proposal-state is-gated"><span><strong>{selection.item.actionKind === "operation.execute" ? selection.item.primaryLabel : selection.item.workspaceCandidates?.length || selection.item.gate?.kind === "agent_unavailable" ? selection.item.title : t("drawer.gateRequiresHost")}</strong>{selection.item.actionKind === "operation.execute" || selection.item.workspaceCandidates?.length || selection.item.gate?.kind === "agent_unavailable" ? selection.item.impact : t("drawer.gateRequiresHostDescription")}</span>{selection.item.gate?.nextAction ? <small>{selection.item.gate.nextAction}</small> : null}</div> : null}
12701281
{!readOnly && selection.item.workspaceCandidates?.length ? <div className="personal-workspace-candidates" aria-label={t("drawer.workspaceCandidates")}>{selection.item.workspaceCandidates.map((candidate) => <button key={candidate.workspaceRef} onClick={() => void callbacks.onSelectWorkspaceCandidate?.(selection.item, candidate.workspaceRef)} type="button"><strong>{candidate.label}</strong><small>{t("proposal.workspaceGate.candidateValue")}</small></button>)}</div> : null}
1271-
{!readOnly && selection.item.actionKind !== "operation.execute" && selection.item.status === "error" && (!["team.plan", "goal.create"].includes(selection.item.actionKind) || (selection.item.reviewPlan?.retryOriginal && selection.item.reviewPlan.canApply)) ? <button className="personal-primary-action" onClick={() => void (selection.item.reviewPlan?.retryOriginal ? callbacks.onApplyProposal?.(selection.item) : callbacks.onTransitionProposal?.(selection.item, "regenerate"))} type="button"><RotateCcw size={17} />{t(selection.item.reviewPlan?.retryOriginal ? "drawer.retryOriginal" : "drawer.proposalRegenerate")}</button> : !readOnly && selection.item.actionKind !== "operation.execute" && selection.item.status !== "gated" && !(["team.plan", "goal.create"].includes(selection.item.actionKind) && ["error", "stale"].includes(selection.item.status)) && !((selection.item.actionKind === "team.plan" || decisionFrame || taskExecution) && selection.item.status === "applied") ? <button className="personal-primary-action" disabled={!['ready', 'deferred'].includes(selection.item.status) || selection.item.reviewPlan?.canApply === false} onClick={() => void callbacks.onApplyProposal?.(selection.item)} type="button"><Check size={17} />{selection.item.status === "applying" ? t("drawer.applying") : selection.item.primaryLabel ?? t("drawer.apply")}</button> : null}
1272-
{!readOnly && selection.item.actionKind !== "operation.execute" && !selection.item.reviewPlan?.creationProgress?.goalId && (["stale", "gated", "rejected"].includes(selection.item.status) || (selection.item.status === "ready" && selection.item.reviewPlan?.canApply === false)) ? <button className="personal-secondary-action" onClick={() => void callbacks.onTransitionProposal?.(selection.item, "regenerate")} type="button"><RotateCcw size={16} />{t("drawer.proposalRecheck")}</button> : null}
1282+
{!readOnly && selection.item.actionKind !== "operation.execute" && selection.item.status === "error"
1283+
&& ((selection.item.reviewPlan?.retryOriginal && selection.item.reviewPlan.canApply)
1284+
|| (!preserveOriginalProposal && !["team.plan", "goal.create"].includes(selection.item.actionKind)))
1285+
? <button className="personal-primary-action" onClick={() => void (selection.item.reviewPlan?.retryOriginal ? callbacks.onApplyProposal?.(selection.item) : callbacks.onTransitionProposal?.(selection.item, "regenerate"))} type="button"><RotateCcw size={17} />{t(selection.item.reviewPlan?.retryOriginal ? "drawer.retryOriginal" : "drawer.proposalRegenerate")}</button>
1286+
: !readOnly && selection.item.actionKind !== "operation.execute" && selection.item.status !== "gated"
1287+
&& !((preserveOriginalProposal || ["team.plan", "goal.create"].includes(selection.item.actionKind))
1288+
&& ["error", "stale"].includes(selection.item.status))
1289+
&& !((selection.item.actionKind === "team.plan" || decisionFrame || taskExecution || completedTodoCreation)
1290+
&& selection.item.status === "applied")
1291+
? <button className="personal-primary-action" disabled={!['ready', 'deferred'].includes(selection.item.status) || selection.item.reviewPlan?.canApply === false} onClick={() => void callbacks.onApplyProposal?.(selection.item)} type="button"><Check size={17} />{selection.item.status === "applying" ? t("drawer.applying") : selection.item.primaryLabel ?? t("drawer.apply")}</button>
1292+
: null}
1293+
{!readOnly && selection.item.actionKind !== "operation.execute" && !preserveOriginalProposal
1294+
&& !selection.item.reviewPlan?.creationProgress?.goalId && (["stale", "gated", "rejected"].includes(selection.item.status)
1295+
|| (selection.item.status === "ready" && selection.item.reviewPlan?.canApply === false))
1296+
? <button className="personal-secondary-action" onClick={() => void callbacks.onTransitionProposal?.(selection.item, "regenerate")} type="button"><RotateCcw size={16} />{t("drawer.proposalRecheck")}</button> : null}
12731297
{!readOnly && selection.item.persisted !== false && selection.item.actionKind !== "operation.execute" && selection.item.actionKind !== "gate.resolve" && ["ready", "gated"].includes(selection.item.status) ? <div className="personal-drawer-action-grid"><button className="personal-secondary-action" onClick={() => void callbacks.onTransitionProposal?.(selection.item, "defer")} type="button">{t("drawer.proposalDefer")}</button><button className="personal-secondary-action" onClick={() => void callbacks.onTransitionProposal?.(selection.item, "reject")} type="button">{t("drawer.decisionReject")}</button></div> : null}
12741298
{!["applied", "applying"].includes(selection.item.status) ? <button className="personal-secondary-action" onClick={onClose} type="button">{t("drawer.proposalClose")}</button> : null}
12751299
</>

‎apps/presentation/dashboard/src/features/personal-workspace/i18n.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,7 @@ const en = {
961961
"actionReview.canonical_update_retry": "The edit is not yet verified. Retry this operation to recover its result.",
962962
"actionReview.goal_creation_retry": "Goal initialization is incomplete. Retry the original creation; its recorded storage choice is preserved.",
963963
"actionReview.task_start_retry": "The Task was saved. Retry its original start to continue with that Task.",
964+
"actionReview.todo_creation_retry": "Confirmation submitted. Retry to recover the original result.",
964965
"actionReview.canonical_update_projection_pending": "The operation was committed; display delivery is pending. Retry this operation to restore the current view.",
965966
"actionReview.team_plan_retry": "Retry this assignment using the original plan. Current state is checked again, and any tasks already created are recovered without duplication.",
966967
"actionReview.apply_failed": "Execution did not complete. Check the failure and regenerate the preview before retrying.",
@@ -2587,6 +2588,7 @@ const zhCN: Record<WorkspaceMessageKey, string> = {
25872588
"actionReview.canonical_update_retry": "编辑结果尚未确认。重试此操作以恢复原结果。",
25882589
"actionReview.goal_creation_retry": "Goal 初始化尚未完成。请重试原创建操作,已记录的存储选择会保留。",
25892590
"actionReview.task_start_retry": "任务已保存。重试原操作以继续启动这个任务。",
2591+
"actionReview.todo_creation_retry": "已提交创建确认。重试本次确认以取回结果。",
25902592
"actionReview.canonical_update_projection_pending": "操作已提交,展示尚未同步。重试此操作以恢复当前视图。",
25912593
"actionReview.team_plan_retry": "可以从同一提案重试分配。系统会重新核验当前状态,并恢复已记录的结果,不会重复创建任务。",
25922594
"actionReview.apply_failed": "执行未完成。请检查失败原因并重新生成预览后再试。",

0 commit comments

Comments
 (0)