Register U2 single-role-authority child task card
Why: enable U2 dispatch via agent-exec run on Agent-System-RDM; child branch lives on the L1 initiative until host bumps Dev's RDM gitlink. Evidence: parent L1 charter .task/feature-iam-role-permission-linked-capabilities.md (PR #628, head=f23ce7b). Impact: U2 child card registered; RDM-side dependency recorded in the goal (no Backend edits from this unit). Refs: /tmp/iam-role-permission-plan-20261019-sqfu_4g4/plan.md revision 3 U2; PR #628; U1 commit afb65c5.
This commit is contained in:
@@ -0,0 +1,98 @@
|
||||
# feature/iam-role-permission-linked-capabilities-u2-single-role-authority 任务卡
|
||||
|
||||
任务主记录:<PR 链接,交付前填写>;状态:进行中;owner:weichen
|
||||
|
||||
## 基线与授权
|
||||
|
||||
- 权威仓:ssh://git@git-ssh.u1680832.nyat.app:31411/weichen/Agent-System-Dev.git;目标分支:main;R0(initial_base_sha)= 7716b28cfff5200e7cfe9ec75aff5bcd71b234ed
|
||||
- 工作区:/home/weichen/projects/Agent-System-Dev-wt-feature-iam-role-permission-linked-capabilities(worktree);分支:feature/iam-role-permission-linked-capabilities
|
||||
- 分支类型:child;initiative_id:feature-iam-role-permission-linked-capabilities;root_target:main;immediate_target:feature/iam-role-permission-linked-capabilities;accepting_requirements:false;parent_branch:feature/iam-role-permission-linked-capabilities;parent_head_sha:f23ce7bf6035d11ab4b0bb45002d4b08dac5f71f;parent_pr:PR #628
|
||||
|
||||
- 授权与交付终点:按方案 U2 在 `Agent-System-RDM` 仓修复单一角色权威与请求上下文,实现 R5/R7 与 KTD7;不开 PR、不入 main。
|
||||
- 交付模式:goal-first
|
||||
- 实施执行:agent-per-unit(配置:AGENT-EXECUTION.md)
|
||||
- 合入执行:agent(已授权交付范围内,Review 通过、冲突解决且当前 HEAD 的 CI 通过后合入)
|
||||
- 当前阶段:实施单元待派发
|
||||
- 流程依据:仓库根目录 policy/delivery.md;父 L1 charter 见 `.task/feature-iam-role-permission-linked-capabilities.md`
|
||||
|
||||
## 目标与非目标
|
||||
|
||||
**目标**:让 RDM 把所有权限/角色权威来源统一到 Backend 的公开 provider(`extension.RolePolicyProvider`、`extension.SystemActionProvider`),不再有 rdm.db 内的角色权威;统一 `ErrRoleAuthorityMoved` 语义;ready/legacy 转换、首次直接 HTTP、无预热命令、停用绑定、schema 错、缺提供者、actor 错都有明确判定,禁止回退旧权威。
|
||||
|
||||
**范围**:
|
||||
- `internal/perms/{role_provider,role_migration,roles,system,perms}.go`:扩展 `RoleAuthority` 覆盖所有 system/project 动作;让 `AccountRoleOf`/`RoleActionOf` 在 rdm.db 不可用时返回 `ErrRoleAuthorityMoved`。
|
||||
- `internal/rdmapp/{perms_api,system_projects,member_search}.go`:把所有 `ps.AccountRoleOf`/`ps.RoleActionOf` 调用替换为基于 `RoleAuthority` 的请求上下文读取。
|
||||
- `plugins/rdm/{system_projects,plugin}.go`:插件入口同样走 `RoleAuthority`。
|
||||
- 测试:复用 `internal/perms/role_migration_test.go` 与 `internal/rdmapp/system_projects_test.go`/`project_creator_permissions_test.go` 等既有表,加新表覆盖 ready/legacy/首 HTTP/无 warmup/停用绑定/schema 错/缺提供者/actor 错。
|
||||
|
||||
**非目标**:
|
||||
- 不编辑 Backend / Frontend / Documents / Dev。
|
||||
- 不引入新数据库表。
|
||||
- 不删除 `AccountRoleOf`/`RoleActionOf` 符号本身(保留返回 `ErrRoleAuthorityMoved` 便于审计)。
|
||||
- 不削弱既有拒绝。
|
||||
- 不引入通用权限引擎。
|
||||
|
||||
**验收条件**:方案 C22 + 既有 C01-C05/C08/C09/C24 不退化;新表覆盖上述七类场景全 PASS。
|
||||
|
||||
## 关联方向与规划
|
||||
|
||||
- 主记录:方案 revision 3 `/tmp/iam-role-permission-plan-20261019-sqfu_4g4/plan.md`(U2)
|
||||
- 前置:U1 capability-association(Backend L1 afb65c5;尚未合入 main)
|
||||
|
||||
## 需求分析
|
||||
|
||||
| ID | 描述 | 项目符合度及依据 | 优先级 | 验收条件 | 依赖 | 结论 |
|
||||
|---|---|---|---|---|---|---|
|
||||
| U2-R1 | RDM 不再有本地角色权威 | 既有 `internal/perms/roles.go:207/239` 的 `AccountRoleOf`/`RoleActionOf` 仍读 rdm.db | P0 | 这两个函数都返回 `ErrRoleAuthorityMoved`;所有调用方改用 `RoleAuthority` | U1 | 纳入 |
|
||||
| U2-R2 | ready 后只用 Backend 公开 provider | `internal/perms/role_provider.go` 已能用 `RoleAuthority.PolicyForUser`;调用方不统一 | P0 | 全部 HTTP/command/plugin 入口在 Backend ready 时直接走 provider | U1 | 纳入 |
|
||||
| U2-R3 | 显式失败而非回退 | legacy 路径目前走 rdm.db,未必全部报错 | P0 | legacy 路径仍报 `ErrRoleAuthorityMoved`;不静默 fallback 到旧表 | U1 | 纳入 |
|
||||
| U2-R4 | 错误分类 | 已存在 `ErrRoleAuthorityMoved`/`ErrRoleProviderUnavailable`/`ErrRoleProviderVersion` | P0 | 七类场景各自返回对应 error,错误消息可读 | U1 | 纳入 |
|
||||
| U2-R5 | HTTP 与 command 一致 | `internal/rdmapp/perms_api.go` 多处入口 | P0 | 同一 actor 的同一动作在 HTTP 与 command 上结果一致;用相同 `RoleAuthority` 实例 | U1 | 纳入 |
|
||||
|
||||
## 阶段记录
|
||||
|
||||
| 阶段 | 对象版本 | 状态 | 决策/执行者 | 时间 | 依据 |
|
||||
|---|---|---|---|---|---|
|
||||
| 需求拆解 | 本卡 | 已完成 | host | 2026-10-19 | 方案 U2 + 既有源码 |
|
||||
| 需求评估 | 本卡 | 已完成 | host | 2026-10-19 | `AccountRoleOf/RoleActionOf` 调用点搜索 |
|
||||
| 需求表确认 | 本卡 | 已完成 | host | 2026-10-19 | U2-R1..U2-R5 |
|
||||
| 方案设计 | 单元包 JSON | 已完成 | host | 2026-10-19 | KTD7 |
|
||||
| 实施计划 | 单元包 JSON | 已完成 | host | 2026-10-19 | allowed_paths/verification/timeout_seconds |
|
||||
| 实施与自检 | 待 worker | 待执行 | — | — | `scripts/agent-exec run` |
|
||||
| 正式测试与验收 | 待 worker 自检 + host 验证 | 待执行 | — | — | C22 + 新表 |
|
||||
| 代码 Review | 待独立会话 | 待执行 | — | — | fresh session, `--role review` |
|
||||
| 合入 | 待 host | 待执行 | — | — | RDM L1 PR + transport apply + Dev gitlink bump |
|
||||
| 合入核验与收口 | 待 host | 待执行 | — | — | L1 PR #628 base gate |
|
||||
|
||||
## 同步记录
|
||||
|
||||
| 节点 | sync_base_sha | tested_head_sha | checked_at |
|
||||
|---|---|---|---|
|
||||
| 启动 | f23ce7bf6035d11ab4b0bb45002d4b08dac5f71f | f23ce7bf6035d11ab4b0bb45002d4b08dac5f71f | 2026-10-19T03:30:00Z |
|
||||
|
||||
## 证据(Evidence)
|
||||
|
||||
| 时间(UTC) | 命令 | 被测HEAD | exit | 来源 | sha256(16) |
|
||||
|---|---|---|---|---|---|
|
||||
|
||||
## Agent 实施收据
|
||||
|
||||
| 单元 ID | 预期范围 | 配置摘要 | 角色 | 候选顺序 | attempt | CLI/模型 | 终态 | transport | fallback | 源码外收据路径 |
|
||||
|---|---|---|---|---|---|---|---|---|---|---|
|
||||
| iam-link-u2 | RDM `internal/perms`、`internal/rdmapp/{perms_api,system_projects,member_search}`、`plugins/rdm/{system_projects,plugin}` | AGENT-EXECUTION.md digest=bd3a7de57a3a9e1a4495b94c5fa5c08d71e7be8c (RDM dev-manager pin) | implementation | [cursor, antigravity, pi] | 1 | 待记录 | 待记录 | 待记录 | 否 | 待记录 |
|
||||
|
||||
## 结果与验证(完成后填写)
|
||||
|
||||
- 结果:
|
||||
- 验证:PASS/FAIL/SKIP/NOT_RUN 逐项
|
||||
- 影响与剩余项:
|
||||
|
||||
## 合入与清理
|
||||
|
||||
- Review 记录:NOT_RUN
|
||||
- 冲突记录:NOT_RUN
|
||||
- CI 记录:NOT_RUN
|
||||
- 合入记录:NOT_RUN
|
||||
- 清理记录:NOT_RUN
|
||||
|
||||
<!-- Local receipt: SELF. Digests detect corruption; they do not authenticate a reviewer or CI. -->
|
||||
@@ -60,7 +60,7 @@
|
||||
| 子任务分支 | 必需 | 状态 | PR | 单元 | 范围摘要 |
|
||||
|---|---|---|---|---|---|
|
||||
| feature/iam-role-permission-linked-capabilities-u1-capability-association | 是 | 已完成(Backend 子分支 afb65c5 推送,Dev gitlink bump 待 host;独立 Review 待 fresh session) | —(child 不开 PR) | U1 | Backend `internal/authz/catalog`、`internal/store/role_policy`、公开扩展 DTO;RDM `internal/perms/role_provider.go` 与创建能力判定;KTD1/KTD3/KTD4;C06/C08/C09/C10 |
|
||||
| feature/iam-role-permission-linked-capabilities-u2-single-role-authority | 是 | 待启动 | — | U2 | RDM `perms_api.go`、`system_projects.go`、`plugins/rdm/{system_projects,plugin}.go`;Backend `hostcaps.go`;KTD7;C22 |
|
||||
| feature/iam-role-permission-linked-capabilities-u2-single-role-authority | 是 | 已登记卡片,待 agent 派发 | —(child 不开 PR) | U2 | RDM `perms_api.go`、`system_projects.go`、`plugins/rdm/{system_projects,plugin}.go`;Backend `hostcaps.go`;KTD7;C22 |
|
||||
| feature/iam-role-permission-linked-capabilities-u7-canonical-two-trees | 是 | 待启动 | — | U7 | RDM `internal/projects/{projects,provisioning,projection_rename}.go`、`internal/rdmapp/{projects_api,system_projects,project_resource_authz}.go`;Backend `internal/server/{project_lifecycle,server}.go`;KTD2/KTD5/KTD6/KTD8/KTD10;C01-C05/C11-C17/C19-C21/C26-C31 |
|
||||
| feature/iam-role-permission-linked-capabilities-u3-capability-exposure | 是 | 待启动 | — | U3 | Backend/RDM 解释接口、HTTP/command 错误分类、创建/添加成员/对话失败原因;KTD1/KTD2/KTD6 |
|
||||
| feature/iam-role-permission-linked-capabilities-u4-frontend-auto-discover | 是 | 待启动 | — | U4 | Frontend `RolePermissionsPanel.tsx`、`AccountUsersPanel.tsx`、`adminRdmSections.tsx`、`TaskSidebar.tsx`、`App.tsx`、`store.ts`、`api.ts`、`rolePermissions.ts`、`projectmeta.ts`;KTD9;C13-C15/C19-C21/C23 |
|
||||
|
||||
Reference in New Issue
Block a user