Add reusable Workspace stories and preserve owner task visibility - #3990
Conversation
Signed-off-by: huangruiteng <huangrt01@163.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
Signed-off-by: huangruiteng <huangrt01@163.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
APPROVE with one P2 follow-up. Exact head: c0ce647e6d7c281da604462e4a09d7c95f12b9ed. No blocking finding in this bounded visibility fix; release qualification remains separate.
[P2] Preserve deferred status and resume context in the card/drawer
The new personalAgentTodoFromItem mapping correctly sets presentation done=false for deferred records, but its unchanged consumers only distinguish completed/blocked/open. In the real isolated Home Energy Buying Guide demo, opening “Refresh source dates immediately before publication” shows 待执行, 依赖:无, and 下一转换:推进或更新状态, although its source is deferred with a todo_done resume condition. goal-tasks-view.tsx:252 only badges blocked items; context-drawer.tsx:508-524 falls through to the open labels, and the mapper does not retain resume context. This is a display issue, not evidence of bypassing backend enforcement. Please preserve the typed deferred state through the shared card/drawer model, show a localized deferred label and the actual resume condition, and extend the browser test to open this record in both Board and List. No new state authority or separate list API is needed. Particularly valuable polish before a Workspace-focused release.
动机
个人工作区原先复用了公开分享的有界 Todo 预览,真实队列有更多任务时,卡片却停留在预览数量。这个 PR 恢复 owner 可见的队列,同时解决 deferred 的 legacy checked 位被当成“已完成”的混淆。附带的 source-checkout 场景提供多 Goal、多角色、决策和延期任务的可重复演示,但明确不是客户案例或实时 Agent 执行证据。
改动思路
在 base 36b27aaa17f5a44bb9c797b9e2f32a5007f913a2 和 exact head 比较既有 getShareTodos、Todo summary lanes、个人卡片映射及 CompletedTaskLane:公开分享预览与 owner queue 的范围确实不同,因此保留分享用途,给 owner 卡片选正确的既有输入。新增 helper 以稳定 todo_id 去重,缺 ID 时用 goal/index;主队列优先,补入独立 deferred lane。卡片与近期完成去重共同调用这个 helper,没有另造资源 API、分页状态或写入所有者。Board/List 继续共享 #3961/#3970 的 CompletedTaskLane 和 /api/chat/completed-todos snapshot cursor。
具体改动
status.ts:解析并保留后端已有的 optional deferred_items;没有改变后端 schema 或权限。dashboard-page.tsx:修改卡片映射、抽取共同队列选择、复用该选择计算完成事实;不改 CSS、布局或公开分享输入。demo/workspace/__init__.py、__main__.py、stories.json、README:隔离场景入口、三组数据和使用/回放/限制说明;prepare 经 bootstrap/configure/Todo/state APIs 创建独立状态,advance 只完成指定 owner decision 并打开直接后继,serve 用现有 Chat 后端和打包前端。没有另写运行内核、scheduler 或 live Agent。test_workspace_story_demo.py:保护现有目录和 symlink 边界,真实状态重放、计算产物、全局 registry 不变及跨 Goal 隔离。personal-workspace-browser-smoke.mjs:覆盖超过分享预览的任务、独立 deferred lane、重复 ID 和不计入完成列;继续运行共享历史/布局测试。- 打包 JS 与 index.html:本地从 exact-head 源码重新构建,git 保持干净,确认提交的 bundle 与源码一致。
关键代码讲解
personalAgentTodoItems:owner queue → 稳定 ID Map → 补充 deferred → 卡片及完成事实两个消费者;主队列条目优先,不覆写权威数据。personalAgentTodoFromItem:保留原 status,但将 deferred 的展示 done 位改为 false;上面的 P2 是未修改消费者对这个组合的呈现缺口。personalAgentTodoFacts:复用相同 item 集合,并排除 deferred 的逐项完成计数;既有累计完成数与 snapshot history 仍由原所有者提供。prepare/seed_story:拒绝非空陌生目录和根 symlink,匹配 manifest 的重复 prepare 不重置回放;通过公共 state API 构造场景,不把编写的案例伪装成执行轨迹。serve_isolated/advance:子进程只继承最小环境,root/port 用 stdin JSON 而不是解释器参数拼接;独立 HOME/CODEX_HOME 和不可用 Agent/Lark 可执行名限制演示。决策回放有显式 story/decision,且不执行采购、发布或部署。
对主干的风险
独立验证:两项 real-state pytest 通过;TypeScript 与两个 Vite 构建通过;打包 Personal Workspace 全套浏览器 smoke 通过(含桌面/移动及原有 snapshot 历史场景);diff whitespace 通过;实际启动 Chat backend,浏览器看到三 Goal,并在 research Goal 读到两项决策、11 个非完成工作、两个 monitor、7 个完成记录。完成列有虚拟化,不能把当前 DOM 可见行数当作总数。上述 deferred 抽屉反例也在真实页面复现。
UI 不是 default-off 新能力,常规 owner Workspace 直接受益;demo 仅显式 source 命令触发,不进入 wheel/catalog,不自动安装或启动 host。没有新 actor 权限。演示的待运行 monitor 当前沿用既有“执行中”标签,不应拿它证明 live execution。构建仍有大 bundle warning,属于已有性能边界;没有把一次 smoke 当作完整 v1.0 安装、升级、实时 IM/Agent 资格证明。
我的整体评价
前端修复范围小、复用正确,直接提高个人工作区可信度,是 v1.0 优先候选。演示约千行数据/驱动/文档有明确可运行用途与隔离测试,不增加安装态运行复杂度;不建议再扩展更多同形场景。未来维护检查已应用在共享 item selector;进一步改进应沿现有 Workspace model 补齐 deferred 标签/恢复条件,而非另加状态框架。P2 不阻断批准,但建议发布体验收尾优先处理。当前没有执行合并,也没有完成发布级资格验证。
English verdict: APPROVE exact head c0ce647e6d7c281da604462e4a09d7c95f12b9ed with a P2 deferred-label/resume-context follow-up. Owner cards now reuse the full queue and shared completed-history owner; no duplicate paging API or state authority. Independently verified two real-state tests, TypeScript/build reproducibility, packaged Workspace browser smoke, and a real isolated HTTP demo. Deferred records are still labeled open by existing card/drawer consumers; preserve their status and resume context before release polish is considered complete.
Signed-off-by: huangruiteng <huangrt01@163.com>
huangruiteng
left a comment
There was a problem hiding this comment.
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
1. Findings
此前 P2 已在 7d036c27ccd44a7d9586a71733e20b74d262c451 修复:延期 Todo 在 Board/List 卡片和详情中显示“已延期”,通过现有 schema/model 保留 resume_when,详情展示真实恢复条件与等待提示;缺失条件显示“未设置”,不推断或编造。未发现本次范围内剩余阻断问题。
2. 假设与边界
Demo 是独立的源码场景回放,不是 live Agent 成功案例;不启动调度器,不连接个人 registry、凭据或 IM。Task 管理操作仍使用现有确认/执行权限路径。本次没有改变首页布局、首屏入口、CTA 或导航。既有 watch-only monitor 的执行态文案不在这次延期修复范围内,也不作为真实运行证据。
3. 产品与架构判断
正向:个人 Workspace 使用 owner queue,而不是三项公开分享预览,避免漏掉实际待办和延期任务;延期不能因旧版 checked 标记被算作完成。Board/List 继续复用既有 CompletedTaskLane 及 /api/chat/completed-todos 快照历史,不新增状态接口或调度规则。与 #3961/#3970 的历史能力是复用关系。
未来可维护性检查:在既有投影边界补齐 typed optional 字段和双语文案即可,不需要新的 formatter、fetcher 或状态机。状态判定使用精确 deferred 值,没有 prose heuristic;展示提示不改变执行义务或 owner 权限。默认变化仅为 owner Workspace 的完整任务可见性和真实延期展示,公开分享投影保持原样。
4. 验证
npm run build:TypeScript 与两种生产构建通过;仅有既存 bundle 大于 500 kB 提示。npm run smoke:personal-workspace与npm run smoke:personal-workspace-packaged:均通过,覆盖桌面/移动布局、Board/List、4087 条完成历史虚拟化、延期与缺失条件反例。pytest tests/test_workspace_story_demo.py -q:2 passed;验证真实状态、目录隔离、重复准备和决策范围。- 通过真实 loopback Chat 服务浏览 demo,确认延期任务显示真实
todo_done条件。 - 完整 PR
git diff --check通过。只提交产品代码、合成场景、耐久回归及打包资源;截图和本地证据未提交。 loopx canary premerge --from-git-diff --goal-id loopx-meta:passed;9 个 catalog、8 个 risk-profile、1 个 public-boundary 检查通过,另有 diff/compile 通过;0 failures/skips/manual holds,self_merge_allowed=true。- 精确差异质量回执:
cqr_386f48d9d677afca5aee,15 个文件,fingerprint386f48d9d677afca5aee88f8a3bc8dfac64bf44ffafd611c706a18e803bd8b26;允许且执行一次有界修复,0 blockers/warnings/advisories,verify valid。
5. 合并决定
Owner 已明确授权补齐后自合并。最终 premerge 门禁已通过;不把旧 head 的 CI 当成本 head 证据。新 head 的远端 CI 仍在运行,当前 ruleset 没有 required status checks,本次依据上述本地 exact-scope 验证授权自合并。GitHub 对作者本人不接受 formal APPROVE,因此在此记录完整 self-review,按仓库授权流程合并。
English verdict: The deferred-state presentation gap is fixed at 7d036c27ccd44a7d9586a71733e20b74d262c451. Owner queue visibility and shared snapshot history remain intact. Both browser variants, the production build, real-state demo tests, exact-scope quality verification and all 18 selected premerge checks pass. No scheduling or permission semantics were added. Approved for the explicitly authorized self-merge; new-head remote CI is still running and is not represented as passed.
- 3f605c3 workspace stories + owner 任务可见性 (loopx-project#3990) - df5c557 codex-app TOML 往返修复 (loopx-project#3913) - 2f4c8f3 todo 延迟原生创建 (loopx-project#3980) 文档融合: repair-patterns.md 以上游英文表为源重建中文版 (184 旧行复用 + 新增 codex_app_automation_toml_contract_gap 手译)。 Co-Authored-By: Claude Code <noreply@anthropic.com>
- doctor.py REQUIRED_INSTALLED_SKILL_PHRASES: 13 条英文正文短语改为 中文等价串(loopx-pr-review/pr-program/doc-registry/benchmark/self-repair), 使安装检查不再对中文 SKILL.md 误报 repair_recommended - examples/__init__.py: 防 site-packages 同名包遮蔽(本地环境残留包 examples,CI 干净环境无此问题; scripts/__init__.py 已同步) fix(smoke): sync 42 个 smoke 断言到中文唯一文档(0 语义损失) - 42 个 smoke: 英文断言→中文文档实际文本(frontmatter/yaml/CLI/ 标识符/负断言保留),1 条无等价文本的断言删除并说明 - 分支漂移类 5 个 smoke 修复: capability 快照(reliability-diagnostics)、 external-scheduler-worker sleep 注入、lark goal-channel 连接嵌套、 outcome-followthrough 策略更新、ssh-reverse-proxy 连接重试 docs: demo/workspace/README.md 中文化(上游 loopx-project#3990 引入,英文残留) Co-Authored-By: Claude Code <noreply@anthropic.com>
Owner Workspace cards could stop at the three-item public-share preview, hiding work that was present in the queue. This prefers the owner queue, merges its dedicated deferred lane by stable ID, and keeps deferred entries out of completed work. Board/List retain the existing shared completed-history owner from #3961.
Adds a source-checkout demo at
python -m demo.workspace serve: three projects, four roles per project, 18 delivery tasks, two owner decisions and two watch-only monitors. Real LoopX state APIs and the packaged HTTP frontend are reused; preparation is isolated and repeatable, and replaying one decision only unblocks its direct successors. Documentation distinguishes authored scenarios from live execution.Validation: dashboard TypeScript/build; source and packaged Personal Workspace browser smokes (including 4,087-record completed-history pagination and full/deferred queue regression); status projection contract; two real-state replay/isolation tests; Ruff; public-boundary and whitespace scans. Exact-scope quality receipt
cqr_3381846dae44e7b2c828verified valid, with no blockers and one warning.The broader legacy demo-readiness diagnostic has pre-existing source-string failures for the old builder call and pre-i18n labels; those unrelated checks are unchanged. This is not release qualification. Live IM/Agent execution is intentionally unavailable in the isolated demo. Future-facing pass: centralized owner card/history item selection rather than adding another task model or capability.
Follow-up qualification fixes the interpreter command and transports root/port as JSON on stdin; artifact generation, state seeding and decision replay have separate local ownership. Real HTTP startup with a path containing spaces and a semicolon returned all three Goals and 60 tasks.