[F05] 普遍性断言写作约束:独立受访者不足即阻断并给实际人数
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 7m
- Merged PRs (30d)
- 969
Description
## 交付契约(user_visible_behavior)
报告撰写者对草稿文本调 checkGeneralizationClaim,系统统计该主题的独立受访者数(同一人多条引述只算 1 人,附和与虚拟来源不计入),达全仓统一门槛才允许『用户普遍认为』类表述;不足则阻断(GENERALIZATION_UNSUPPORTED),返回实际独立受访者数与改写建议。实测:4 位独立受访者时阻断、补到 5 位放行。
## 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) — 章节 `R4`
## 验证(完成的唯一标准:每条命令退出码 0)
- [ ] `pnpm --filter api exec vitest run tests/itv/generalization-claim-gate-real-db.test.ts`
证据落盘:`phases/phase-11-research-insight-backend/sprints/sprint-02/evidence/F05.verify.log`
## 实现指引(notes)
算子出处:checkGeneralizationClaim。复用 apps/api/src/domain/interview/generality-claim.ts 的 countIndependentSubjects(同一人多次发言只算 1、附和与 sourceKind=virtual 不计入)与阈值单源 packages/contracts/src/thresholds.ts(门槛 5 全仓声明一次,本域只引用不重声明),本 feature 补的是从持久化引述/主题真实取数喂给该纯函数 + controller 接线,不重写计数口径也不新抄阈值字面量。对应 coverage.md uc-6-5 R12:V7(4 位阻断给实际人数与改写建议、补到 5 放行、同一人 3 条只算 1)。异常出处 R4 E9;规则出处 R7『普遍性断言门槛是全仓单一常量』;主流程 R3 step7。V7b(跨组织聚合 <8)明确跨束不在本阶段范围(R6)。依据等级:phase-01 已 confirmed 契约(I-27)。has_ui:false。估点 2。
## 设计参照
(无 UI 或沿用现有界面)
## 前置依赖
- `F01` — 已就绪
## 元数据
| phase | sprint | 能力平面 | 优先级 | wave | area |
|---|---|---|---|---|---|
| 11 | 02 | CAP-API | P3 | - | 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 F05 --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/F05.verify.log`;然后 `pnpm harness verify --sprint 11/02 --feature F05` 门控转 passing——**不允许手改 status**。
6. 提交:分支 `worker/-11-f05-`,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
Run ./init.sh, then read requirements/01-insight-library-backend.md section R4 and inspect checkGeneralizationClaim, apps/api/src/domain/interview/generality-claim.ts, and packages/contracts/src/thresholds.ts. Use tests/itv/generalization-claim-gate-real-db.test.ts as the verification entry point; done means the real-data gate blocks four independent subjects with the count and rewrite suggestion, allows five, and the test exits 0 with evidence saved to F05.verify.log.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 82/100