[F02] 证据矩阵读路径 + 观察者脱敏只读投影
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 969
Description
## 交付契约(user_visible_behavior)
任意有读权的角色调 getEvidenceMatrix(scope) 拿到主题 × 受访者矩阵:格子取值含完整五枚举(强/弱/未提及/附和/反例),附和不计入强度合计;头部同时返回 sessionCount 与 subjectCount 两个独立数,样本不对齐时两个数都正确。观察者只拿到脱敏聚合投影(原始洞察库/未验证假设整块不可见,只保留聚合后的来源分布);受访者不可见;未授权者得 NO_INTERVIEW_ACCESS。无引述时返回真实空态,不编造示例数据。
## Story
[requirements/01-insight-library-backend.md](https://github.com/boardx/workspacex/blob/main/phases/phase-11-research-insight-backend/requirements/01-insight-library-backend.md) — 章节 `R5`
## 验证(完成的唯一标准:每条命令退出码 0)
- [ ] `pnpm --filter api exec vitest run tests/itv/evidence-matrix-two-counts-real-db.test.ts`
- [ ] `pnpm --filter api exec vitest run tests/itv/evidence-matrix-observer-redaction.test.ts`
证据落盘:`phases/phase-11-research-insight-backend/sprints/sprint-02/evidence/F02.verify.log`
## 实现指引(notes)
算子出处:getEvidenceMatrix(读路径 + 空态 A1)。复用 apps/api/src/domain/interview/evidence-matrix.ts 已有纯逻辑——computeCellStrength(五取值同一次计算 + counterexample 布尔为 strength 的只读投影)、tallyThemeStrength(附和/未提及/反例不进强度合计);本 feature 补的是把持久化数据投影成矩阵 + 观察者脱敏过滤 + 两个计数字段的读端组装,不重写 evidence-matrix.ts。对应 coverage.md uc-6-5 R12:V4(矩阵格子枚举完整、附和不计入强度)、V6(sessionCount 与 subjectCount 两个数不相等时都正确)、V10(空态);观察者脱敏 = R5 权限矩阵(沿用项目工作台『研究洞察』Tab 已有观察者态注释,不新增角色)。矩阵格子取值本身在 R3 step4。依据等级:phase-01 已 confirmed 契约。has_ui:false,API 层验收。估点 3。
## 设计参照
(无 UI 或沿用现有界面)
## 前置依赖
- `F01` — 已就绪
## 元数据
| phase | sprint | 能力平面 | 优先级 | wave | area |
|---|---|---|---|---|---|
| 11 | 02 | CAP-API | P2 | - | itv |
## 开工流程(agent 必读)
> 本 issue 是仓库的**只读投影**;权威是 [`phases/phase-11-research-insight-backend/feature_list.json`](https://github.com/boardx/workspacex/blob/main/phases/phase-11-research-insight-backend/feature_list.json)。若两者不一致,以仓库为准。
1. 环境:`./init.sh`(验证失败先修基础状态,别在坏地基上开工)。
2. 认领:`pnpm harness claim --phase 11 --feature F02 --owner <你的-agent-id>`(同一 owner 同时最多一个 in_progress)。
3. 读上下文:[`requirements/`](https://github.com/boardx/workspacex/blob/main/phases/phase-11-research-insight-backend/requirements)(原始需求)、[`contracts/`](https://github.com/boardx/workspacex/blob/main/phases/phase-11-research-insight-backend/contracts)(本 feature 所属契约束:`ui.md` 给组件落点与 data-testid,`usecases.md` 给失败模式,`design-signoff.md` 给签核状态)、[`sprints/sprint-02/session-handoff.md`](https://github.com/boardx/workspacex/blob/main/phases/phase-11-research-insight-backend/sprints/sprint-02/session-handoff.md)(上一轮交接)。
4. 实现:只做本 feature 的最小实现,不顺手重构无关区域;不碰 `active-features.json`(脚本派生只读)。
5. 验证:逐条跑上方 verification,输出留到 `phases/phase-11-research-insight-backend/sprints/sprint-02/evidence/F02.verify.log`;然后 `pnpm harness verify --sprint 11/02 --feature F02` 门控转 passing——**不允许手改 status**。
6. 提交:分支 `worker/-11-f02-`,PR 关联本 issue(`Closes #<本 issue 号>`),收尾更新 progress.md 与 session-handoff.md。
完整硬约束见 [`AGENTS.md`](https://github.com/boardx/workspacex/blob/main/AGENTS.md);多 agent 协作规则见 [`.harness/instructions/multi-agent-coordination.md`](https://github.com/boardx/workspacex/blob/main/.harness/instructions/multi-agent-coordination.md)。
Contributor guide
No contributing guide indexed for this repository
Research direction
Read requirements/01-insight-library-backend.md section R5, the F01 handoff, and apps/api/src/domain/interview/evidence-matrix.ts; then run the two named Vitest integration tests. Implement the API read projection for the matrix, counts, empty state, and observer permissions without rewriting the existing pure logic. Done means both tests exit 0 and the verification log is saved at phases/phase-11-research-insight-backend/sprints/sprint-02/evidence/F02.verify.log.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100