docs(ops): record final reviewer duty-sync repair round
Sync short-term, checklist, and handoff with remaining 6145 risk and the isolated PG verification path. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -60,6 +60,13 @@ severity: critical
|
||||
|
||||
生成/列表路径若吞掉自愈错误,会带着 `reviewer_id=2` 假成功。
|
||||
|
||||
## 最后一轮缺口(已在同分支修复)
|
||||
|
||||
- 移出成员只改 `exited` 不同步文档;前端移出不刷新矩阵
|
||||
- 空 assigned 若保留非成员占位,退出审核人会留在文档上
|
||||
- reviewer→viewer 时人仍 active,generic heal 会把槽位留下,必须按更新前 duty 显式撤销
|
||||
- `CreateOrGetDocument` 错误被 `_` 吞掉会假成功
|
||||
|
||||
## 开放问题
|
||||
|
||||
- 本轮不重跑真实 UI-13a;不得标 E2E 通过或任务 `done`
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
|
||||
## 焦点
|
||||
|
||||
1. **DOCREV-RT**: [项目 reviewer 同步到受控文档职责](short-term/2026-09-13-document-revision-reviewer-duty-sync.md)(`fix/document-revision-reviewer-duty-sync`;独立审查收紧已追加提交,暂不合入;不声称 E2E 通过)
|
||||
1. **DOCREV-RT**: [项目 reviewer 同步到受控文档职责](short-term/2026-09-13-document-revision-reviewer-duty-sync.md)(`fix/document-revision-reviewer-duty-sync`;最后一轮严格修复已提交,暂不合入;不声称 E2E 通过)
|
||||
2. **DOCREV-RT**: [质量修复子工作区契约](short-term/2026-09-13-document-revision-quality-repair-workspace-contract.md)(已合入 `dev@339e871`;仍 `in_progress`,待占槽重跑 UI-03)
|
||||
3. **DOCREV-RT**: [编辑弹窗 hydration 竞态](short-term/2026-09-13-document-revision-editor-hydration-race.md)(已合入 `dev@8b1a531`;仍 `in_progress`,待占槽重跑 UI-06)
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
title: "项目 reviewer 职责同步收紧"
|
||||
status: in_progress
|
||||
created: 2026-09-13
|
||||
updated: 2026-09-13
|
||||
related_task: "2026-09-13-document-revision-reviewer-duty-sync.md"
|
||||
---
|
||||
|
||||
# 项目 reviewer 职责同步收紧
|
||||
|
||||
## 最后一轮严格修复
|
||||
|
||||
- [x] 移出成员后端 reconcile + `ERR_DUTY_SYNC`;前端 `afterProjectMemberPersisted` 刷新文档
|
||||
- [x] Heal 空 assigned 仅清退出/非成员;在任成员保留;author 不清空
|
||||
- [x] 显式 revoke:reviewer→viewer、职责转移、退出、幂等;author 不进撤销集
|
||||
- [x] `CreateOrGetDocument` 失败任务不成功;fault test
|
||||
- [x] `gofmt` / `go vet` / `go test -short` / 相关 `-race` / `npm test` / `build` / 隔离 PG
|
||||
- [ ] 真实 UI-13a(本轮不做)
|
||||
|
||||
## 完成定义
|
||||
|
||||
- [x] 上述实现项有测试或隔离 PG 证据
|
||||
- [ ] 现场 UI-13a 仍开放,不得标 done
|
||||
@@ -0,0 +1,68 @@
|
||||
---
|
||||
title: "reviewer 职责同步:独立审查后最后一轮修复"
|
||||
created: 2026-09-13
|
||||
from: Cursor-Auto
|
||||
to: next-agent
|
||||
status: open
|
||||
---
|
||||
|
||||
# 交接:reviewer 职责同步(暂不合入)
|
||||
|
||||
## 目标(下一位 Agent 应完成什么)
|
||||
|
||||
- 不要在本分支继续改职责语义,除非新审查点
|
||||
- 合入前占 CURRENT 集成槽位,再 `--no-ff` 合 `dev`;本轮禁止 merge / 重建容器 / 声称 E2E
|
||||
- 6145 的 B 仍是空 `document_duty`,须再走成员 API 写成 reviewer 后自愈才会对齐文档
|
||||
|
||||
## 已完成
|
||||
|
||||
- Heal 以 assigned 为权威;空 assigned 只清失效审核/批准 holder
|
||||
- 成员增改/移出/恢复显式 reconcile(更新前 duty + 项目 advisory lock)再 heal
|
||||
- 账本创建失败任务失败
|
||||
- 隔离临时库 PG 用例(heal / revoke / 并发 upsert / 多 owner 回填)
|
||||
|
||||
## 未完成
|
||||
|
||||
- 真实 UI-13a
|
||||
- 合入 `dev` 与共享容器 schema 31 晋升
|
||||
|
||||
## 认领 / 槽位状态
|
||||
|
||||
| 项 | 值 |
|
||||
|----|-----|
|
||||
| mutex 已释放 | no(`document-revision-reviewer-duty-sync` 仍 `in_progress`) |
|
||||
| 集成槽位 holder | 他人 e2e;本任务未占槽 |
|
||||
| branch | `fix/document-revision-reviewer-duty-sync` |
|
||||
| worktree | - |
|
||||
|
||||
> 若 mutex 未释放,下一位须先在 CURRENT 认领或写 blocker。
|
||||
|
||||
## 关键文件
|
||||
|
||||
| 路径 | 说明 |
|
||||
|------|------|
|
||||
| `internal/docduty/revoke.go` | 显式槽位撤销 + reconcile |
|
||||
| `internal/server/project_members_handlers.go` | 增改删后 reconcile,`ERR_DUTY_SYNC` |
|
||||
| `scripts/run-isolated-duty-sync-pg-tests.sh` | 隔离 PG 入口 |
|
||||
|
||||
## 如何验证
|
||||
|
||||
```bash
|
||||
go test -short ./...
|
||||
go test -short -race ./internal/docduty ./internal/authz ./internal/bizdev ./internal/server
|
||||
cd web && npm test && npm run build
|
||||
# 隔离库,禁止 agent_system_dev:
|
||||
./scripts/run-isolated-duty-sync-pg-tests.sh
|
||||
```
|
||||
|
||||
## 风险 / Blocker
|
||||
|
||||
- 旧项目未写 `document_duty` 时,在任成员仍留在文档槽位(有意兼容)
|
||||
- 显式降级/退出才会撤 reviewer/approver;author 永不被 revoke
|
||||
- 6145 B 不会被臆造为 reviewer
|
||||
|
||||
## 相关链接
|
||||
|
||||
- CURRENT: [../CURRENT.md](../CURRENT.md)
|
||||
- Task: [../short-term/2026-09-13-document-revision-reviewer-duty-sync.md](../short-term/2026-09-13-document-revision-reviewer-duty-sync.md)
|
||||
- Checklist: [../checklists/2026-09-13-document-revision-reviewer-duty-sync.md](../checklists/2026-09-13-document-revision-reviewer-duty-sync.md)
|
||||
@@ -36,6 +36,7 @@ mutex: document-revision-reviewer-duty-sync
|
||||
3. [x] `gofmt` / `go vet` / `go test -short` / 相关 `-race` / `npm test` / `npm run build`
|
||||
4. [x] 原子提交
|
||||
5. [x] 独立审查收紧(暂不合入):Heal 以 assigned 为权威;成员变更带 duty 并同步文档;缺 role 不降 owner;写权精确断言;迁移多 owner 确定回填;并发 upsert PG 用例;自愈失败不假成功
|
||||
6. [x] 最后一轮:移出成员 sync + 前端刷新;空 assigned 只清失效 holder;显式 revoke 再 heal;账本创建失败不成功
|
||||
|
||||
## 验收标准
|
||||
|
||||
@@ -48,13 +49,15 @@ mutex: document-revision-reviewer-duty-sync
|
||||
|
||||
- Audit: [../../audit/2026-09-13-document-revision-reviewer-duty-sync.md](../../audit/2026-09-13-document-revision-reviewer-duty-sync.md)
|
||||
- Remediation: [../../remediation/2026-09-13-document-revision-reviewer-duty-sync.md](../../remediation/2026-09-13-document-revision-reviewer-duty-sync.md)
|
||||
- Checklist: [../checklists/2026-09-13-document-revision-reviewer-duty-sync.md](../checklists/2026-09-13-document-revision-reviewer-duty-sync.md)
|
||||
- Handoff: [../handoffs/2026-09-13-document-revision-reviewer-duty-sync.md](../handoffs/2026-09-13-document-revision-reviewer-duty-sync.md)
|
||||
|
||||
## 证据 / 备注
|
||||
|
||||
- mutex:`document-revision-reviewer-duty-sync`(新 mutex,不占用已有 in_progress)
|
||||
- 基线:`dev@639969f`
|
||||
- 证据(只读):`.doc/test-reports/assets/2026-09-13-document-revision-runtime-ui/schema30-ui13a-reviewer-duty-sync-failure/`
|
||||
- 验证:`go test -short ./...` PASS;`go test -short -race ./internal/docduty/ ./internal/authz/ ./internal/bizdev/` PASS;`cd web && npm test` PASS;`npm run build` PASS
|
||||
- 验证(最后一轮):`gofmt`/`go vet` PASS;`go test -short ./...` PASS;相关 `-race` PASS(server 包首次 TempDir cleanup flake,复跑 PASS);`npm test`/`build` PASS;隔离 PG PASS
|
||||
- PG 集成已写 heal/空 assigned/多 owner 回填/并发 upsert;`-short` 或无 `TEST_DATABASE_URL` 时跳过
|
||||
- 隔离跑法:`scripts/run-isolated-duty-sync-pg-tests.sh`(`TEST_DATABASE_URL` 或 `PG_ADMIN_URL` 建临时库)。拒绝 `agent_system_dev`
|
||||
- 本轮已在已运行的 context Postgres 上 `CREATE DATABASE agent_duty_sync_itest_*`,串行跑通后 `DROP`;未 `env-service`、未动共享库数据
|
||||
|
||||
@@ -30,7 +30,7 @@ updated: 2026-09-13
|
||||
1. 访问角色仍是 `owner/member/viewer`;文档职责另存 `document_duty`(`author`/`reviewer`/`approver`/空),同一项目同一职责仅一名在任成员。
|
||||
2. `Resolve`:author=指定编制人或创建者;reviewer/approver=指定职责,否则仅当请求 id 是在任成员才采用;**禁止**默认 2/3。
|
||||
3. `Heal`:项目 `document_duty` 为权威。assigned 非零则对齐(错 ID——即使对方也是在任成员——或同 ID 旧名称);assigned 为空才保留当前值,避免臆造/清空。禁止「任意 active member 就放过」。
|
||||
4. 列表/生成走自愈;**失败必须返回可诊断错误**,生成路径不得假成功。成员增改/恢复后服务端再 heal 已有受控文档。
|
||||
4. 列表/生成走自愈;**失败必须返回可诊断错误**,生成路径不得假成功;`CreateOrGetDocument` 失败不得报告成功。成员增改/移出/恢复按更新前 duty 显式 revoke 后再 heal。
|
||||
5. 前端立项与立项后增改/恢复都发 `document_dutyFromMemberRole`。更新成员省略 `project_role` 时保留现有访问角色,禁止默认 `member` 把 owner 降级。
|
||||
6. 迁移 owner 回填:创建者优先,否则最低 `user_id`,单行 UPDATE,避免部分唯一索引冲突。
|
||||
|
||||
|
||||
Reference in New Issue
Block a user