Conversation
REL-6:第二实例(应用已运行时通过 OS/命令行再次打开 workhub://workbench/... 深链)
此前直接执行窗口控制,跳过了正常 deep-link 分支才有的"workbench 窗按需建"步骤——
workbench 窗 tauri.conf.json 里 create:false,若用户从未点开过工作台,
execute_window_control 会报 "workbench window is not available",深链目标丢失。
抽出共享落地路径 apply_deep_link_plan(经 DeepLinkWindowHost trait 注入,便于脱离
真实 AppHandle 单测)+ handle_deep_link_plan,让 handle_deep_link_url(冷启动/运行时
深链)与 handle_single_instance_launch(第二实例)两条入口收敛到同一份判断逻辑,
不再各自维护一份。
新增 4 个单测(main.rs tests 模块):
- skipping_the_create_step_loses_a_workbench_deep_link_when_window_is_missing:
复现旧 bug(跳过建窗直接控制窗口 → "window is not available")
- apply_deep_link_plan_creates_the_missing_workbench_window_before_navigating:
验证新路径先建窗再控制
- apply_deep_link_plan_does_not_create_the_always_present_main_window:
非 workbench 目标不多走一次建窗
- single_instance_workbench_deep_link_creates_the_window_via_shared_apply_path:
串联 single_instance 的纯规划(argv → deep_links)与共享落地路径,证明第二实例
入口不再丢链
验证方式:临时把 apply_deep_link_plan 改回旧行为(跳过 create 直接 control)复现
两个新测试 FAILED("workbench window is not available"),确认是根因测试后再还原。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
/api/users 是全局用户目录(跨租户泄露 + 全局昵称排序 + 硬 .limit(200) 截断),却被消费端误当 工作区花名册用(成员数、加人选择器)。本单纯 additive 补齐正确数据源,不动 /api/users 本身: - 新增 GET /api/workspace/roster:任意工作区 active 成员可读本工作区花名册;按 membership join 严格隔离到 actor.workspaceId;limit/offset 分页(无硬 200 截断,深 offset 可翻至全量成员); 回工作区成员总数 total(修「计数错」)+ 头像/在线态占位。非成员 403、未登录 401。 - 新增 memberships.listActiveRosterPageByWorkspace(OPTIONAL 契约,仿 UserRepository.listActiveRefs): join users、绑定 workspaceId + 排除 membership/user 双软删、按 lower(nickname) 稳定序、limit/offset。 - 契约:workspaceRosterQuerySchema(coerce + 越界回退)/ workspaceRosterMemberVmSchema / workspaceRosterResultVmSchema 加在 packages/contracts/src/auth.ts。 - openapi.ts 补 GET /api/workspace/roster 文档(过 runtime↔openapi lockstep 门)。 - 测试基建:query-recorder 补 offset 透传。 消费端迁移(成员数/加人选择器改用本端点)属 Phase 2B,不在本单。 测试:工作区隔离、分页、超 200 经 offset 可达、非成员 403 全绿。 contracts 173/173、db 434 pass/0 fail、api 1758 pass/0 fail、pnpm -r typecheck 全绿。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
补齐 R19 确认缺失的四组 additive 后端端点,全部纯新增、不改既有端点/仓库方法行为: R19-19 项目归档/删除: - POST /api/projects/:id/archive、/api/projects/:id/delete - ProjectRepository.archiveProject/softDeleteProject(CAS 只命中活跃/未删行) - 门=管理员或项目所有者(比 canManageProjectDrive 更严),复用 ProjectServiceError R19-18 指派/认领: - POST /api/workitems/:id/assign(写 work_item_assignments,门=canManageWorkItemAssignees + 被指派人须为本工作区成员)、/api/workitems/:id/claim(复用 claimOwnerlessWorkItem, 门=canClaimWorkItem) - 新仓库 work-item-assignments.ts(upsert on (work_item,user) 唯一索引) R19-22 工作项评论: - GET/POST /api/workitems/:id/comments(门=canViewWorkItemRecord;author_nickname 取 actor) - 新仓库 comments.ts(list 升序 + 上限 / insert) R19-21 工作区审计列表: - GET /api/workspace/audit(仅管理员,工作区硬隔离,actor/action/时间范围过滤+分页,时间倒序) - audit.ts 新增 WorkspaceAuditLogRepository(独立类型/工厂,不动 AuditLogRepository) 契约进 packages/contracts,OpenAPI 七条路径补齐(lockstep 门绿),app.ts 挂载 workspace-audit。 测试:db 查询形状 8 + api 服务单测/路由联调 43;pnpm -r typecheck 全绿; db 439 / contracts 168 / api 1796 全通过。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
修复 codex P1-02:AUTH_MODE=password|hybrid 下桌面/CU 完全没有可用登录链路—— desktop-bootstrap 无条件 404,桌面只有 nickname 自动 bootstrap,用户被锁在门外。 - api routes/auth.ts(仅 desktop-bootstrap 段):密码模式从无条件 404 改为 「凭有效会话换设备令牌」的 exchange(复用 resolveOptionalCurrentUser,不新造鉴权); 无会话仍 404、垃圾 client token 403 fail-closed。不碰 SEC-1 的 resolveHumanActor/ensureDefaultWorkspaceMembership/墓碑逻辑与 /api/users 段。 - api-client:补 login(POST /api/auth/login) typed 方法,密码只走请求体,绝不进 URL。 - desktop-webview:新增 desktop-login.ts 凭据登录门(邮箱+密码表单,错误可见可重试, 参照 SEC-2 logout 状态机风格);browser.ts/workbench/boot.ts 的 bootstrap 探测 404=需要凭据 → 渲登录门,登录成功 → 换令牌落 workhub_client_token 后同 nickname 流; 登出态按探得的模式提示选门,昵称模式行为不变。 - 测试:API exchange 三态(有会话 201/无会话 404/坏 token 403)+ api-client login 往返/401 + desktop-login 模块 8 条;web/desktop main.test.ts 假客户端 stub 补 login 成员(共享接口新增所需)。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> # Conflicts: # packages/db/src/test-query-recorder.ts
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
R20 修复流水线 wave2:Phase 1 收尾 + Phase 2A API 打底,四条产线各自独立复验(根因测试修复前红/后绿),交叉合入后整仓集成终验全绿(pnpm -r typecheck + 全包测试 0 fail + cargo 117 passed)。
Phase 1 收尾
Phase 2A API 打底(全 additive,消费端切换在后续 2B/2C)
验证
整仓 typecheck 全包 Done;全包测试 16/16 包 0 fail;cargo 117 passed(含 REL-6 新增);api 1796 / db 439 / desktop-webview 1395 / contracts 168 / api-client 25。
🤖 Generated with Claude Code