Skip to content

feat(workbench): single-interaction flows for stale approval cards, tasks, monitors, reports, and reversible lifecycle actions - #10281

Merged
loopx-agent merged 1 commit into
mainfrom
codex/single-click-workbench-actions-20261206
Dec 6, 2026
Merged

loopx-agent merged 1 commit into
mainfrom
codex/single-click-workbench-actions-20261206

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Summary

Aligns Workbench owner actions with the single-round interaction contract in docs/development/design.md ("Most ordinary capabilities should complete in one round... preview mechanics belong behind the surface, not as a mandatory second click"):

  1. Stale & drifted approval cards (StewardInlineCards.tsx, loopx/actions.ts):
    • Added canAutoApplyRegeneratedProposal() and executeCoreActionProposal(): clicking 批准并执行 / Approve & apply on a stale card (or when apply hits HTTP 409 action_stale) transparently refreshes via /regenerate, verifies the refreshed proposal is ready, un-gated, non-operation.execute, and preserves the exact reviewed actionKind, goalId, riskLevel, and canonical parameters, then applies immediately in the same single click.
    • No silent escalation: if regeneration becomes gated, failed, or changes parameters/risk, execution halts cleanly and shows the updated proposal/gate for review. gated cards remain strictly recheck-only (重新检查 / Recheck).
    • Removed the noisy stale-preview warning banner (当前预览已过时,请重新生成预览后再执行) and filtered pure internal dry-run boilerplate (Canonical LoopX ... dry-run validated) from default visible bullets while keeping substantive evidence intact.
  2. Task creation, card mutations & monitor Run now (loopx/tasks.ts, GoalTasks.tsx, GoalTodoInspector.tsx):
    • Added createGoalTodoOneClick() and executeTodoMutationOneClick() (preserving Core dry-run/preview safety checks + 1 automatic stale retry under the hood).
    • Collapsed two-click 预览创建 -> 确认创建 and 预览 -> 确认执行 ceremonies into single submit actions; zero-input actions (archive and owned monitor 立即运行 / Run now) execute directly in 1 click without opening an empty inline form.
  3. Report review & reversible lifecycle (GoalReports.tsx, GoalLifecycle.tsx):
    • Report 通过验收 / 打回修改 apply in 1 click while keeping passive viewing 100% read-only and requiring feedback for reject.
    • Reversible Goal 暂停 / 恢复 (stop / resume) apply in 1 menu click; irreversible 删除 (delete) retains its explicit danger confirmation Dialog.

Verification

  • npm -w packages/web run typecheck → 0 errors
  • npm -w packages/web test → 881 passed / 0 failed (including live Python ChatHTTPServer contract matrix verifying 1-click stale refresh + apply end-to-end, safety-boundary no-escalation tests, monitor busy-gate tests, and reversible vs irreversible lifecycle tests)
  • npm -w packages/web run build → succeeded (✓ built in 13.04s)
  • scripts/check_rfc_bilingual.py --base origin/main --head HEAD → passed
  • loopx check --scan-path ... → ok: True, errors=0

Visual Evidence & Delivery Boundary

  • Tested revision: codex/single-click-workbench-actions-20261206 (built web bundle apps/workbench/packages/web/dist).
  • Verified DOM & rendered behavior across all affected cards (CoreActionProposalCard stale/ready/gated/changed, GoalTasks, GoalTodoInspector, GoalReports, GoalLifecycle): stale approval cards no longer render the orange stale-preview banner or internal dry-run boilerplate and expose a single primary 批准并执行 action + 忽略.

…nteraction flows across approval, task, monitor, report, and lifecycle controls

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机

用户在 Workbench 的 审批关口 卡片上遭遇过时预览(stale)时,不得不先点击「重新生成预览」再点击「批准并执行」,在任务创建、任务卡片操作、监控立即运行、报告验收打回、以及可逆的 Goal 启停流程中也普遍存在多余的“预览 -> 确认执行”二次交互,显著拖慢了日常操作体验。

改动思路

在不弱化任何服务端状态校验、审批关口和不可逆保护边界的前提下,将“刷新预览 + 安全一致性检查 + 自动执行”合并为前端单次点击流:canAutoApplyRegeneratedProposal 严格校验新预览仍为 preview_ready、无新增门禁、参数与风险级别未漂移时才直接 apply,否则自动停在最新预览态等待人工确认;同时保持 GoalLifecycle 的不可逆删除确认弹窗与 GoalReports 的纯浏览只读语义不变。

具体改动

  • apps/workbench/packages/web/src/loopx/actions.ts:新增 canAutoApplyRegeneratedProposal() 与 executeCoreActionProposal(),支持 stale / failed / 409-stale 卡片一键刷新并在安全前提下自动执行。
  • apps/workbench/packages/web/src/components/StewardInlineCards.tsx:stale 卡片直接展示主按钮「批准并执行」,移除冗余的橙色过时预览提示条与内部 Canonical LoopX ... dry-run validated 模板话术;failed 展示「重试执行」,gated 保持仅「重新检查」。
  • apps/workbench/packages/web/src/loopx/tasks.ts、GoalTasks.tsx、GoalTodoInspector.tsx、GoalReports.tsx、GoalLifecycle.tsx:收敛任务创建、卡片状态流转、归档、监控立即运行、报告通过/打回及可逆启停为单次点击;不可逆删除保留显式确认弹窗。
  • 同步更新 zh.ts/en.ts/ja.ts 文案与 5 组前端/实后端契约测试,全量 npm -w packages/web test 881/881 通过、tsc --noEmit 与 vite build 通过。

对主干的风险

风险低且边界可控。自动续跑仅在前端调用同一条服务端 preview -> apply 校验链后,经 canAutoApplyRegeneratedProposal() 逐项确认无 gated/参数漂移/风险升级才触发;一旦上游状态或参数发生实质变化(或遇到新的审批关口),流程会立即中止并展示最新预览让用户重新决策。不可逆操作(如删除 Goal)的二次确认弹窗、以及只读浏览页面不产生任何写入副作用的约束均保持不变。实测 881 项单元测试与真实 Python ChatHTTPServer 契约矩阵全部通过,未发现回归或公共边界泄漏。

我的整体评价

改动直接命中高频交互痛点,保持了服务端预览/执行的唯一权威性与安全护栏,测试覆盖充分(含 stale/gated/409/参数漂移/风险升级/不可逆删除等正反用例),达到合入标准。

English Verdict: Approve — single-interaction Workbench action flows preserve all server-side validation, gate, and irreversible-action boundaries with full 881/881 unit and live ChatHTTPServer contract verification.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Reviewed exact head: 10281@77da5b9618be96db6100d85558e3661854cf3130

动机 / Motivation

用户在 Workbench 的 审批关口 卡片上遇到过时预览(stale)时,必须先点击「重新生成预览」再二次点击「批准并执行」;任务创建、任务卡片流转、监控立即运行、报告验收打回以及可逆的 Goal 启停中也普遍存在冗余的“预览 -> 确认”两步交互,显著增加人工操作摩擦。

改动思路 / Approach

在不弱化服务端 preview -> apply 权威校验、审批关口与不可逆操作保护边界的前提下,将前端“刷新预览 + 安全一致性校验 + 自动执行”收敛为单次点击流:canAutoApplyRegeneratedProposal 严格检查新预览仍为 preview_ready、无新增门禁、核心参数与风险级别均未漂移后才自动 apply,否则自动停在最新预览态等待人工确认;同时保持 GoalLifecycle 不可逆删除确认弹窗和 GoalReports 被动浏览只读语义不变。

具体改动 / Changes

  • apps/workbench/packages/web/src/loopx/actions.ts:新增 canAutoApplyRegeneratedProposal() 与 executeCoreActionProposal(),支持 stale / failed / 409-stale 卡片一键刷新并在安全一致时自动执行;当新预览出现 gated、参数变更或风险升级时自动中止于预览态。
  • apps/workbench/packages/web/src/components/StewardInlineCards.tsx:stale 卡片直接显示主按钮「批准并执行」,移除多余的橙色过时预览提示条与内部 Canonical LoopX ... dry-run validated 模板话术;failed 显示「重试执行」,gated 保持仅「重新检查」。
  • apps/workbench/packages/web/src/loopx/tasks.ts、GoalTasks.tsx、GoalTodoInspector.tsx、GoalReports.tsx、GoalLifecycle.tsx:收敛任务创建、卡片状态变更、归档、自有监控立即运行、报告通过/打回以及可逆启停为单次点击;不可逆删除保留显式确认弹窗,报告被动打开保持零写入。
  • 同步更新 zh.ts/en.ts/ja.ts 多语言文案与 5 组单元测试/实后端契约测试,在 worktree 内通过 tsc --noEmit、npm -w packages/web test(881/881)、npm -w packages/web run build、check_rfc_bilingual.py 与 loopx check。

对主干的风险 / Risks

风险低且边界清晰可控。自动执行仅在前端完整经过服务端既有 preview -> apply 校验链,并由 canAutoApplyRegeneratedProposal() 逐项核验无新增 gated 门禁、无参数漂移、无风险升级后才会发起 apply;一旦上游状态发生实质变化,前端会立即回退到最新预览态要求用户显式确认。不可逆删除的危险确认弹窗、只读页面的零写入约束以及原有后端 API 契约均未放宽。全量 881 项单元测试与真实 Python ChatHTTPServer 契约矩阵全部通过,未发现回归或公私边界泄漏。

我的整体评价 / Verdict

该改动准确消除 Workbench 高频操作中的重复预览仪式,同时完整保留了服务端权威校验、审批门禁与不可逆删除护栏,代码与测试质量扎实,满足合入条件。

English Verdict: Approve — single-interaction Workbench action flows preserve server-side preview/apply validation, gate stops, and irreversible delete confirmation across 881/881 unit and live ChatHTTPServer contract tests at 10281@77da5b9618be96db6100d85558e3661854cf3130.

@loopx-agent
loopx-agent merged commit 925c7db into main Dec 6, 2026
22 of 25 checks passed
@loopx-agent
loopx-agent deleted the codex/single-click-workbench-actions-20261206 branch December 6, 2026 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant