@sushanglewis/lincoln 1.8.3 → 1.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,9 @@ extends:
20
20
  3. 维护跨子页面影响关系:PRD、用户故事、相关者分析、数据模型等核心文档变更时,在门户中标注受影响的设计文档与原型页面,使下游阶段知悉影响范围。
21
21
  4. 对 designer 的输入完整性负责:PRD、用户故事、相关者分析、数据模型、流程图、页面地图必须完整、一致、无歧义;designer 回退确认时,PM 优先澄清,而非让 designer 自行假设。
22
22
  5. 在 `product-prototype` 阶段以 reviewer 身份确认原型的功能、字段、流程与需求文档一致。
23
+ 6. PRD 质量把关:输出 PRD 前完成「需求清晰度六问」自检(用户有哪些、场景是什么、边界在哪里、如何管异常、如何体验好、最终谁决策),六问全部有明确答案才允许定稿。
24
+ 7. PRD 只承载业务内容:技术调研、技术方案、架构/接口/数据库设计等只进设计阶段的归档页,不写入 PRD;过程性疑问(待确认、TODO 之类)在对话中解决后才以结论形式落文档。
25
+ 8. 交叉验证决策权:研发计划阶段以测试场景反向挑战 PRD 发现的缺口,必须由人类 PM 决策闭环——修复(PRD 升版重冻结)或接受(记录理由与影响)二选一;PM 未决策不得视为闭环。
23
26
 
24
27
  ## 专属规则
25
28
 
@@ -283,6 +283,8 @@
283
283
  "handoff_versions_match",
284
284
  "prd_has_required_sections",
285
285
  "prd_snapshot_present",
286
+ "prd_content_hygiene",
287
+ "prd_cross_validated",
286
288
  "artifact_meta_complete",
287
289
  "ids_valid",
288
290
  "portal_index_fresh"
@@ -115,12 +115,14 @@ You may still read the categorized example templates under `.claude/templates/is
115
115
  - Include `<meta name="page-uid" content="...">`, `<meta name="nav-group" content="...">`, and `<meta name="nav-label" content="...">` (injected by the renderer from CLI args; annotations come from the YAML `annotations` block).
116
116
  - Provide the full annotation meta tags so the portal right panel explains functionality, layout, fields, boundary cases, and exception flows.
117
117
  - State the applicable role(s), scenario, page state (default / empty / loading / error / success), and which functions are visible and usable in that state via the `doc-purpose`, `doc-rules`, and `doc-boundaries` annotations, so each sub-page precisely depicts what a given role sees and can do in that case.
118
+ - Depict only the final system as it will ship: no demo-only buttons, explanatory text rows, or walkthrough-only jumps. Explanations belong in the `doc-*` annotation metas rendered in the portal right panel, never as on-screen prose.
119
+ - Declare the user story and business-flow step the page implements via `doc-stories` / `doc-refs`, so the prototype aligns bidirectionally with the PRD: every flow step has at least one page, and every page belongs to a flow step or story.
118
120
  - Use `LincolnPrototype.ui` builders and `prototype.css` tokens for every visual element so both light and dark themes render correctly; verify both themes by toggling the portal theme switch.
119
121
  - Assign a stable `data-uid` attribute to every interactive element, screen region, and WebView placeholder.
120
122
  - Override `LincolnPrototype.data` in the page script for issue-specific mock data (user, org, webviews, settings, unread items).
121
123
 
122
124
  7. Optionally create or update `{process_slug}/designs/<design_id>/prototype.pen` with Pencil tools if the PM explicitly asks for a Pencil prototype. If you use Pencil tools, call `get_editor_state(include_schema: true)` first and use `snapshot_layout` to check for clipping/overlap.
123
- 8. Update the root `{process_slug}/pages/docs/prd.html` section 9 "相关产物链接" with the `ui-spec.html`, `fields.html`, and HTML prototype links. If the PRD already has an approved snapshot, warn the PM that changes require a version bump and re-freeze via `python scripts/lincoln_prd.py freeze`.
125
+ 8. Update the「相关产物链接」section of the root `{process_slug}/pages/docs/prd.html` (PRD sections are matched by name — numbering is cosmetic) with the `ui-spec.html`, `fields.html`, and HTML prototype links. If the PRD already has an approved snapshot, warn the PM that changes require a version bump and re-freeze via `python scripts/lincoln_prd.py freeze`.
124
126
  9. Ask the PM to open `{process_slug}/index.html` in a browser, toggle the theme switch in the macOS menubar, and review both light and dark renderings of each prototype page inside the portal.
125
127
  10. When the PM confirms the prototype, add `<!-- prototype-status: approved -->` to `ui-spec.html`.
126
128
  11. Run `python scripts/stage_loader.py --stage product-prototype --action record-artifacts`.
@@ -143,4 +145,5 @@ You may still read the categorized example templates under `.claude/templates/is
143
145
  - Prototype links use relative paths so they work both inside the portal iframe and when opened standalone.
144
146
  - Do not add collapse toggles or custom panel chrome to the portal; the right annotation panel is always visible.
145
147
  - The system tray is portal-level chrome. Never redraw the tray inside an app prototype page with `.menubar`, `.tray-icon`, `.tray-panel`, `bindTray`, or `trayMenu`. Tray scenario pages must be thin controllers that post `lincoln-tray-state` messages to the portal.
148
+ - 原型即最终系统样貌:禁止仅用于演示的模拟按钮、屏内说明文字与演示跳转;解释一律走 `doc-*` 注释由门户右侧面板呈现;每个原型页面经 `doc-stories` / `doc-refs` 标注所属用户故事与业务流程步骤,与 PRD 文字双向对齐。
146
149
  - After approval, tell the user to run: `claude plan-tdd-development <session_id> <design_id>`.
@@ -80,7 +80,17 @@ Produce a clear, agreed-upon `{process_slug}/pages/docs/requirements.html` and t
80
80
  --markdown {process_slug}/pages/docs/user-stories.md
81
81
  ```
82
82
 
83
- 9. Generate the root-level PRD at `{process_slug}/pages/docs/prd.html` using the Markdown-first renderer:
83
+ 9. 需求清晰度六问自检(Six-Question Gate)。起草原稿前逐项回答,答案落入 PRD 对应章节;任何一项答不出,先按 Human Interaction Rules 问人类 PM,禁止带着未决问题落笔:
84
+
85
+ | 六问 | 落笔位置 | 答不出时的动作 |
86
+ |---|---|---|
87
+ | 用户有哪些? | 用户故事 | 请 PM 补充分角色 |
88
+ | 场景是什么?何时触发、如何完成? | 业务流程图 | 与 PM 走查主流程 |
89
+ | 边界在哪里?明确不做什么 | 需求背景(非目标)+ 业务规则 | 请 PM 划定非目标 |
90
+ | 如何管异常?覆盖每个失败的系统行为 | 业务规则(异常处理) | 逐场景请 PM 裁决 |
91
+ | 如何体验好?质量与体验判据 | 非功能需求(体验要求) | 请 PM 给出体验判据 |
92
+ | 最终谁决策? | 版本说明(决策人) | 请 PM 指定决策人 |
93
+ 10. Generate the root-level PRD at `{process_slug}/pages/docs/prd.html` using the Markdown-first renderer:
84
94
 
85
95
  ```bash
86
96
  python scripts/lincoln_render.py \
@@ -90,25 +100,33 @@ Produce a clear, agreed-upon `{process_slug}/pages/docs/requirements.html` and t
90
100
  --markdown {process_slug}/pages/docs/prd.md
91
101
  ```
92
102
 
93
- Write `{process_slug}/pages/docs/prd.md` with at least these H2 chapters, but feel free to add, merge, or reorder them to best tell the story:
94
-
95
- - `## 1. 需求背景`
96
- - `## 2. 用户故事`
97
- - `## 3. 功能拆解`
98
- - `## 4. 业务流程图` (use ` ```mermaid ` diagrams)
99
- - `## 5. 验收标准`
100
- - `## 6. 业务规则`
101
- - `## 7. 非功能需求`
102
- - `## 8. 关联系统/接口`
103
- - `## 9. 相关产物链接`
104
- - `## 10. 风险与开放问题`
103
+ Write `{process_slug}/pages/docs/prd.md` following this progressive skeleton. Keep all thirteen chapters in this order as the default narrative; you may insert additional business chapters inside the skeleton when this requirement's shape calls for it. Section headings are matched by name — numbering is cosmetic, not part of the contract:
104
+
105
+ - `## 1. 版本说明` — 当前版本、文档状态、决策人(最终谁拍板)。
106
+ - `## 2. 修订记录` — 版本/日期/作者/变更摘要 表格。
107
+ - `## 3. 功能列表` — 功能/优先级/状态/对应用户故事 表格。
108
+ - `## 4. 需求背景`
109
+ - `## 5. 用户故事`
110
+ - `## 6. 功能拆解`
111
+ - `## 7. 业务流程图` (use ` ```mermaid ` diagrams)
112
+ - `## 8. 验收标准`
113
+ - `## 9. 业务规则`(边界与异常处理)
114
+ - `## 10. 非功能需求`(含体验要求)
115
+ - `## 11. 关联系统/接口`
116
+ - `## 12. 相关产物链接`
117
+ - `## 13. 风险与开放问题`
118
+
119
+ PRD 正文禁则(读者是研发团队,文档只讲业务场景):
120
+ - 不写技术调研、技术方案、架构设计、接口设计、数据库设计等内容——这类内容只进 design 阶段维护的归档页 `feasibility.html`。
121
+ - 不写任何过程性提醒("待确认""待人类 PM 确认""TODO"、agent 注等)——疑问在对话中解决,解决后才落文档。
122
+ - 同一信息只用一种方式描述:文字、表格、mermaid 图组合使用,但不重复表达同一内容。
105
123
 
106
124
  It must also carry:
107
125
  - `<!-- version: v1.0 -->` marker (added automatically by the renderer from the Markdown file or `--version`).
108
126
  - Meta tags: `doc-title`, `nav-group="Docs"`, `doc-version="v1.0"`, and a stable `doc-uid` (all injected by the renderer).
109
- 10. When the PM confirms, add an approval marker inside `requirements.html`: `<!-- status: approved -->`.
110
- 11. After human approval, run `python scripts/lincoln_prd.py freeze` to create the immutable snapshot `{process_slug}/pages/docs/snapshots/prd-v1.0.html`.
111
- 12. Run `python scripts/stage_loader.py --stage clarify --action record-artifacts` to persist the artifact paths and refresh `{process_slug}/assets/js/package-data.js`.
127
+ 11. When the PM confirms, add an approval marker inside `requirements.html`: `<!-- status: approved -->`.
128
+ 12. After human approval, run `python scripts/lincoln_prd.py freeze` to create the immutable snapshot `{process_slug}/pages/docs/snapshots/prd-v1.0.html`.
129
+ 13. Run `python scripts/stage_loader.py --stage clarify --action record-artifacts` to persist the artifact paths and refresh `{process_slug}/assets/js/package-data.js`.
112
130
 
113
131
  ## Human Interaction Rules
114
132
 
@@ -122,6 +140,8 @@ Produce a clear, agreed-upon `{process_slug}/pages/docs/requirements.html` and t
122
140
  - Every document page opens with `## 页面意图` (目标读者 + 本页回答什么问题) and `## 边界` (本页不覆盖什么 + 单一事实来源链接).
123
141
  - Content follows standard Markdown: a single H1, H2 chapters, and tables/Mermaid over long prose. Never duplicate content across pages — link to the single source of truth instead.
124
142
  - These pages are business-facing: 需求背景、用户角色、旅程、业务状态、业务流程、验收标准. Technical research or solution comparisons performed while clarifying are only background for the PM's decision — do not register them into any page; they may be summarized later into the archived `feasibility.html` by the design stage.
143
+ - 过程性内容不进入任何页面:待确认事项、agent 提醒、对话记录只留在对话里,解决后才以结论形式落文档。
144
+ - 同一信息只描述一次:文字、表格、mermaid 图可以组合使用,但不得用多种方式重复表达同一内容;需要引用时链接到单一事实来源。
125
145
 
126
146
  ## 认知象限确认(Johari)
127
147
 
@@ -79,7 +79,7 @@ Create `{process_slug}/pages/docs/` HTML design documents with enough product, d
79
79
  4. Create the PM→UX handoff contract at `{process_slug}/handoffs/pm-to-ux/pm-to-ux.handoff.yaml` referencing the approved design docs and PRD versions.
80
80
  5. Create the human-readable PM→UX handoff portal page at `{process_slug}/pages/docs/handoff-pm-to-ux-v1.0.html` and the narrative master handoff document at `{process_slug}/handoffs/pm-to-ux/master-handoff-pm-to-ux-v1.0.md`. These summarize core decisions, scope, open questions, and the context pack for the receiving UX Agent.
81
81
  6. Keep all documents traceable to the approved requirement and transcript timestamps where available.
82
- 7. Update the root `{process_slug}/pages/docs/prd.html` section 9 "相关产物链接" with links to the new design documents and handoff artifacts. If the PRD already has an approved snapshot (`pages/docs/snapshots/prd-v*.html`), warn the PM that any content change requires bumping the version marker and re-freezing via `python scripts/lincoln_prd.py freeze`.
82
+ 7. Update the「相关产物链接」section of the root `{process_slug}/pages/docs/prd.html` (PRD sections are matched by name — numbering is cosmetic) with links to the new design documents and handoff artifacts. If the PRD already has an approved snapshot (`pages/docs/snapshots/prd-v*.html`), warn the PM that any content change requires bumping the version marker and re-freezing via `python scripts/lincoln_prd.py freeze`.
83
83
  8. Ask the PM to review `design-review.html` and linked docs (they can open `{process_slug}/index.html` in a browser).
84
84
  9. When the PM confirms, add `<!-- status: approved -->` to `design-review.html`.
85
85
  10. Run `python scripts/stage_loader.py --stage product-design-docs --action record-artifacts`.
@@ -640,33 +640,75 @@ def check_tdd_plan_complete(design_id: str):
640
640
  # PRD checks
641
641
  # ---------------------------------------------------------------------------
642
642
 
643
+ # 递进骨架(issue-129):版本说明 → 修订记录 → 功能列表 → 需求展开。
644
+ # 章节编号不参与匹配,PM 可按需求类型在骨架内增插业务章节。
643
645
  REQUIRED_PRD_SECTIONS = [
644
- "## 1. 需求背景",
645
- "## 2. 用户故事",
646
- "## 3. 功能拆解",
647
- "## 4. 业务流程图",
648
- "## 5. 验收标准",
649
- "## 6. 业务规则",
650
- "## 7. 非功能需求",
651
- "## 8. 关联系统/接口",
652
- "## 9. 相关产物链接",
653
- "## 10. 风险与开放问题",
646
+ "版本说明",
647
+ "修订记录",
648
+ "功能列表",
649
+ "需求背景",
650
+ "用户故事",
651
+ "功能拆解",
652
+ "业务流程图",
653
+ "验收标准",
654
+ "业务规则",
655
+ "非功能需求",
656
+ "关联系统/接口",
657
+ "相关产物链接",
658
+ "风险与开放问题",
654
659
  ]
655
660
 
661
+ PRD_SECTION_PATTERNS = [
662
+ (name, re.compile(rf"^##\s*(?:\d+\s*[.、.]?\s*)?{re.escape(name)}\s*$", re.MULTILINE))
663
+ for name in REQUIRED_PRD_SECTIONS
664
+ ]
665
+
666
+ # PRD 正文禁则:过程性疑问在对话中解决,技术内容归归档页(issue-129 第 4/6 条)。
667
+ PRD_FORBIDDEN_PROCESS_RE = re.compile(r"待确认|待人类|待补充|待\s*PM|TODO|FIXME", re.IGNORECASE)
668
+ PRD_FORBIDDEN_TECH_HEADING_RE = re.compile(
669
+ r"^##+\s*.*(技术调研|技术方案|可行性研究|架构设计|接口设计|数据库设计)",
670
+ re.MULTILINE,
671
+ )
672
+
673
+ CROSS_VALIDATION_PASS_RE = re.compile(
674
+ r"<!--\s*cross-validation:\s*pass\s+prd-version:\s*(v\d+\.\d+)\s*-->"
675
+ )
676
+
677
+
678
+ def _prd_hygiene_violations(content: str) -> list[str]:
679
+ violations = sorted(set(PRD_FORBIDDEN_PROCESS_RE.findall(content)))
680
+ violations.extend(sorted(set(PRD_FORBIDDEN_TECH_HEADING_RE.findall(content))))
681
+ return violations
682
+
656
683
 
657
684
  def check_prd_has_required_sections(path: str):
658
685
  target = PROJECT_ROOT / path
659
686
  if not target.exists():
660
687
  fail(f"PRD missing: {target}")
661
688
 
662
- text = read_document_file(target)
663
- missing = [section for section in REQUIRED_PRD_SECTIONS if section not in text]
689
+ content = read_document_file(target)
690
+ missing = [name for name, pattern in PRD_SECTION_PATTERNS if not pattern.search(content)]
664
691
  if missing:
665
692
  fail(f"PRD missing required sections: {', '.join(missing)}")
666
693
 
667
694
  pass_check("PRD has all required sections")
668
695
 
669
696
 
697
+ def check_prd_content_hygiene(path: str):
698
+ target = PROJECT_ROOT / path
699
+ if not target.exists():
700
+ fail(f"PRD missing: {target}")
701
+
702
+ violations = _prd_hygiene_violations(read_document_file(target))
703
+ if violations:
704
+ fail(
705
+ "PRD contains content that belongs in conversation or archived pages, "
706
+ f"not the PRD: {', '.join(violations)}"
707
+ )
708
+
709
+ pass_check("PRD content hygiene OK")
710
+
711
+
670
712
  def check_prd_snapshot_present(path: str):
671
713
  target = PROJECT_ROOT / path
672
714
  if not target.exists():
@@ -692,6 +734,43 @@ def check_prd_snapshot_present(path: str):
692
734
  pass_check(f"PRD snapshot present: {snapshot_path}")
693
735
 
694
736
 
737
+ def check_prd_cross_validated(path: str):
738
+ target = PROJECT_ROOT / path
739
+ if not target.exists():
740
+ fail(f"Cross-validation report missing: {target}")
741
+
742
+ match = CROSS_VALIDATION_PASS_RE.search(read_document_file(target))
743
+ if not match:
744
+ fail(
745
+ "Cross-validation report has no pass marker. Every gap must be closed by a "
746
+ "human-PM decision (PRD fix with re-freeze, or accepted with recorded "
747
+ "rationale) before adding '<!-- cross-validation: pass prd-version: vX.Y -->'."
748
+ )
749
+
750
+ prd_path = target.parent / "prd.html"
751
+ if not prd_path.exists():
752
+ fail(f"PRD missing next to cross-validation report: {prd_path}")
753
+
754
+ if extract_markdown_version is None:
755
+ fail("markdown version extraction is not available")
756
+
757
+ prd_version = extract_markdown_version(prd_path)
758
+ if prd_version != match.group(1):
759
+ fail(
760
+ f"Cross-validation pass marker is for PRD {match.group(1)}, but the PRD is now "
761
+ f"{prd_version or 'unversioned'}. Re-run cross-validation against the current PRD."
762
+ )
763
+
764
+ violations = _prd_hygiene_violations(read_document_file(prd_path))
765
+ if violations:
766
+ fail(
767
+ f"PRD regressed after cross-validation pass: {', '.join(violations)}. "
768
+ "Fix the PRD, bump its version, re-freeze, and re-run cross-validation."
769
+ )
770
+
771
+ pass_check(f"PRD cross-validation pass marker matches PRD {prd_version}")
772
+
773
+
695
774
  # ---------------------------------------------------------------------------
696
775
  # Registry
697
776
  # ---------------------------------------------------------------------------
@@ -729,6 +808,8 @@ EXIT_CHECKS = {
729
808
  "tdd_plan_complete": check_tdd_plan_complete,
730
809
  "prd_has_required_sections": check_prd_has_required_sections,
731
810
  "prd_snapshot_present": check_prd_snapshot_present,
811
+ "prd_content_hygiene": check_prd_content_hygiene,
812
+ "prd_cross_validated": check_prd_cross_validated,
732
813
  }
733
814
 
734
815
 
@@ -13,6 +13,7 @@ inputs:
13
13
  required: true
14
14
  outputs:
15
15
  - "{process_slug}/pages/docs/tdd-plan.html"
16
+ - "{process_slug}/pages/docs/prd-cross-validation.html"
16
17
  required_tools:
17
18
  - Read
18
19
  - Bash
@@ -1,10 +1,10 @@
1
1
  # plan-tdd-development
2
2
 
3
- You are executing the Lincoln workflow step `tdd-development-plan`: turn the confirmed product design and prototype into a TDD development plan.
3
+ You are executing the Lincoln workflow step `tdd-development-plan`: turn the confirmed product design and prototype into a TDD development plan, then reverse-drive the PRD with test scenarios so gaps close before development.
4
4
 
5
5
  ## Goal
6
6
 
7
- Create `{process_slug}/pages/docs/tdd-plan.html` as the bridge from product design to OpenSpec and GitHub Issues.
7
+ Create `{process_slug}/pages/docs/tdd-plan.html` as the bridge from product design to OpenSpec and GitHub Issues, and produce `{process_slug}/pages/docs/prd-cross-validation.html` so every test scenario (正常/边界/异常) challenges the PRD — SDD tests reverse-drive PRD completeness.
8
8
 
9
9
  ## Input
10
10
 
@@ -16,11 +16,13 @@ Create `{process_slug}/pages/docs/tdd-plan.html` as the bridge from product desi
16
16
  在执行本 prompt 前:
17
17
  1. 调用 `superpowers:writing-plans` 规划 `tdd-plan.html` 结构。
18
18
  2. 遵循 `superpowers:test-driven-development` 方法论:确保每个任务切片都是“先写失败测试 → 最小实现 → 重构”序列。
19
- 3. 在 `tdd-plan.html` 的 Markdown source 头部加入:
19
+ 3. 在 `tdd-plan.html` 的 Markdown source 头部加入:
20
20
  `> **Required sub-skill:** Use superpowers:test-driven-development for all implementation`
21
21
 
22
22
  ## Steps
23
23
 
24
+ ### Phase 1 — TDD 计划
25
+
24
26
  1. Verify that `{process_slug}/pages/docs/ui-spec.html` contains `<!-- prototype-status: approved -->` or `[x] PM 已确认原型`.
25
27
  2. Confirm `{process_slug}/designs/<design_id>/prototype.pen`, `{process_slug}/pages/docs/fields.html`, and the design review package exist.
26
28
  3. Read the confirmed design docs and inspect the `.pen` through Pencil tools if visual structure is needed.
@@ -34,11 +36,39 @@ Create `{process_slug}/pages/docs/tdd-plan.html` as the bridge from product desi
34
36
  - Task slices suitable for OpenSpec tasks and GitHub Issues
35
37
  - Risks, dependencies, and out-of-scope items
36
38
  5. Add `<!-- status: ready-for-openspec -->` when the plan is complete.
37
- 6. Run `python scripts/stage_loader.py --stage tdd-development-plan --action record-artifacts`.
39
+
40
+ ### Phase 2 — PRD 交叉验证(测试反向驱动 PRD)
41
+
42
+ 6. **场景回问**:从 tdd-plan 的测试场景(正常、边界、异常)逐一回问 `{process_slug}/pages/docs/prd.html`:该场景涉及的业务规则与验收标准在 PRD 中是否有明确答案?逐项记录「场景 → PRD 答案(章节 + 条文)」,PRD 无答案者标记为缺口。
43
+ 7. **对齐闭环**:建立业务流程步骤 ↔ 原型页面双向对齐矩阵——PRD 业务流程图中的每个步骤至少有 1 个原型页面承载;每个原型页面归属于某流程步骤或用户故事。任一侧对不上即为缺口(流程中断或原型多余)。
44
+ 8. **渲染报告**:写 `{process_slug}/pages/docs/prd-cross-validation.md`(顶部含 `<!-- version: v1.0 -->`),用 `lincoln_render.py` 渲染为 `{process_slug}/pages/docs/prd-cross-validation.html`:
45
+
46
+ ```bash
47
+ python scripts/lincoln_render.py \
48
+ --stage tdd-development-plan \
49
+ --target {process_slug}/pages/docs/prd-cross-validation.html \
50
+ --title "PRD 交叉验证报告" \
51
+ --markdown {process_slug}/pages/docs/prd-cross-validation.md
52
+ ```
53
+
54
+ 报告必须含:场景 → PRD 答案映射表、缺口清单、决策记录表(缺口 / 闭环方式 / PM 决策 / 理由)、PRD 修订回执。
55
+ 9. **闭环缺口**:每个缺口由人类 PM 决策二选一——
56
+ - **修复**:修订 `prd.md`,bump `<!-- version: vX.Y -->`,运行 `python scripts/lincoln_prd.py freeze` 重新冻结,然后重跑 Phase 2;
57
+ - **接受**:在决策记录表中记录理由与影响,经人类 PM 明确认可。
58
+
59
+ 全部缺口闭环后,在报告 markdown 末尾追加 `<!-- cross-validation: pass prd-version: vX.Y -->`(vX.Y = 当前 PRD 版本)并重新渲染。未闭环前禁止写入该标记。
60
+ 10. Run `python scripts/stage_loader.py --stage tdd-development-plan --action record-artifacts`.
61
+
62
+ ## Output Artifacts
63
+
64
+ - `{process_slug}/pages/docs/tdd-plan.html`
65
+ - `{process_slug}/pages/docs/prd-cross-validation.html`(含场景→PRD 答案映射、缺口清单、决策记录、闭环标记)
38
66
 
39
67
  ## Rules
40
68
 
41
69
  - Keep the plan executable by an engineer without requiring extra product decisions.
42
70
  - Every task slice must map back to a design artifact and acceptance criterion.
43
71
  - Do not generate OpenSpec artifacts in this step.
72
+ - 交叉验证发现的 PRD 缺口不得自行编造业务答案,必须交回人类 PM 决策(修复或接受)。
73
+ - pass 标记中的版本必须与当前 PRD 版本一致;PRD 后续任何改动都会使标记失效,须重跑 Phase 2。
44
74
  - After completion, tell the user to run: `claude propose-with-openspec <session_id> <design_id> <change_name>`.
@@ -61,6 +61,9 @@ gates:
61
61
  - check: prd_has_required_sections
62
62
  args:
63
63
  - '{process_slug}/pages/docs/prd.html'
64
+ - check: prd_content_hygiene
65
+ args:
66
+ - '{process_slug}/pages/docs/prd.html'
64
67
  - check: human_approved
65
68
  - check: prd_snapshot_present
66
69
  args:
@@ -18,6 +18,7 @@ variables:
18
18
  - process_slug
19
19
  artifact_templates:
20
20
  '{process_slug}/pages/docs/tdd-plan.html': .claude/templates/issue-package/page-doc.html.tpl
21
+ '{process_slug}/pages/docs/prd-cross-validation.html': .claude/templates/issue-package/page-doc.html.tpl
21
22
  agent:
22
23
  primary: lc-engineer
23
24
  reviewers:
@@ -36,11 +37,12 @@ skills:
36
37
  artifacts:
37
38
  required:
38
39
  - '{process_slug}/pages/docs/tdd-plan.html'
40
+ - '{process_slug}/pages/docs/prd-cross-validation.html'
39
41
  references:
40
42
  skill_prompt: .claude/skills/plan-tdd-development/SKILL.md
41
43
  agent_guide: .claude/agents/engineer.md
42
44
  context:
43
- goal: 基于已确认的产品设计文档、字段规格、UI 规格和 Pencil 原型,生成可执行的测试驱动研发计划(`tdd-plan.html`),作为从产品设计到 OpenSpec 变更提案的桥梁。所有产物通过 {process_slug}/index.html 门户访问。
45
+ goal: 基于已确认的产品设计文档、字段规格、UI 规格和 Pencil 原型,生成可执行的测试驱动研发计划(`tdd-plan.html`),作为从产品设计到 OpenSpec 变更提案的桥梁;随后执行 PRD 交叉验证——用测试场景反向挑战 PRD(业务规则、验收标准、流程与原型对齐),全部缺口经人类 PM 决策闭环后方可离开本阶段。所有产物通过 {process_slug}/index.html 门户访问。
44
46
  execution: "调用 plan-tdd-development skill 基于已确认的产品设计文档、字段规格、UI 规格和 Pencil 原型,生成包含验收映射、测试场景与任务切片的 tdd-plan.html,作为 OpenSpec 提案的输入。"
45
47
  gates:
46
48
  entry:
@@ -49,3 +51,6 @@ gates:
49
51
  - product-prototype
50
52
  exit:
51
53
  - check: artifacts_present
54
+ - check: prd_cross_validated
55
+ args:
56
+ - '{process_slug}/pages/docs/prd-cross-validation.html'
@@ -54,6 +54,8 @@ workflow:
54
54
  exit_checks:
55
55
  - check: prd_has_required_sections
56
56
  args: ["{process_slug}/pages/docs/prd.html"]
57
+ - check: prd_content_hygiene
58
+ args: ["{process_slug}/pages/docs/prd.html"]
57
59
  - check: human_approved
58
60
  args: ["{session_id}"]
59
61
  - check: prd_snapshot_present
@@ -114,9 +116,12 @@ workflow:
114
116
  action: plan-tdd-development
115
117
  artifacts:
116
118
  - "{process_slug}/pages/docs/tdd-plan.html"
119
+ - "{process_slug}/pages/docs/prd-cross-validation.html"
117
120
  exit_checks:
118
121
  - check: tdd_plan_complete
119
122
  args: ["{design_id}"]
123
+ - check: prd_cross_validated
124
+ args: ["{process_slug}/pages/docs/prd-cross-validation.html"]
120
125
 
121
126
  - id: propose
122
127
  name: OpenSpec 提案
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "name": "lincoln",
11
11
  "description": "AI-Native product R&D collaboration system for Conductor + Claude Code. Orchestrates stages, gates, artifacts, skills, and roles across product, design, and engineering into a repeatable workflow from recordings to GitHub Issues to Obsidian knowledge base.",
12
- "version": "1.8.3",
12
+ "version": "1.8.4",
13
13
  "author": {
14
14
  "name": "Lincoln contributors"
15
15
  },
@@ -28,5 +28,5 @@
28
28
  ]
29
29
  }
30
30
  ],
31
- "version": "1.8.3"
31
+ "version": "1.8.4"
32
32
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lincoln",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "AI-Native product R&D collaboration system for Conductor + Claude Code + OpenSpec + GitHub + Obsidian",
5
5
  "author": {
6
6
  "name": "Lincoln contributors"
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.8.3",
2
+ "version": "1.8.4",
3
3
  "manifests": [
4
4
  {
5
5
  "path": ".claude-plugin/plugin.json",
@@ -12,9 +12,9 @@ Lincoln is an AI-Native R&D workflow system spanning **IDEs, agent harnesses, co
12
12
 
13
13
  ## Latest Release
14
14
 
15
- [![Release](https://img.shields.io/badge/release-v1.8.3-blue)](RELEASE.md)
15
+ [![Release](https://img.shields.io/badge/release-v1.8.4-blue)](RELEASE.md)
16
16
 
17
- **v1.8.3** is released: SecurityAnalyzer pre-tool-use gating, Trace 2.0 event log, session friction scoring and knowledge recall, plus multi-dimensional stakeholder analysis in the clarify stage.
17
+ **v1.8.4** is released: hook-injected less-is-more artifact discipline, plus a fix syncing the `policies` directory into vendored projects.
18
18
 
19
19
  See the full release notes in [RELEASE.md](RELEASE.md).
20
20
 
@@ -101,6 +101,12 @@ lincoln update # upgrade to the latest release and re-sync
101
101
  lincoln update --check # check for a newer version without installing
102
102
  ```
103
103
 
104
+ Or upgrade the package directly via npm and then re-sync:
105
+
106
+ ```bash
107
+ npm install -g @sushanglewis/lincoln@latest && lincoln update
108
+ ```
109
+
104
110
  On an older install (e.g. from the `lincoln-install` era), or if npm reports `EEXIST: file already exists`, a leftover bin from an old package is blocking the install — clean up first, then reinstall:
105
111
 
106
112
  ```bash
@@ -236,6 +242,7 @@ Before submitting a PR, please read:
236
242
 
237
243
  | Version | Date | Key capabilities |
238
244
  |---|---|---|
245
+ | v1.8.4 | 2026-10-08 | PM-stage PRD quality gates: six-question clarity check, 13-section progressive PRD skeleton, content-hygiene and cross-validation checks, final-system-only prototype discipline (#129) |
239
246
  | v1.8.3 | 2026-10-08 | Less-is-more artifact discipline (hook-injected); platform-aware install hints for non-npm CLIs; `lincoln update` refreshes external skill libraries |
240
247
  | v1.7.0 | 2026-09-05 | SecurityAnalyzer gating; Trace 2.0 event log; friction scoring/knowledge recall/trace condensation/MR mining; parallel specialist delegation; stakeholder analysis model |
241
248
  | v1.6.3 | 2026-08-15 | Markdown-first issue-package documents; `--render-stage` batch rendering; local `mermaid.min.js` runtime |
@@ -12,9 +12,9 @@ Lincoln 是一个贯穿 **IDE、Agent Harness、代码托管、知识管理、
12
12
 
13
13
  ## 最新版本
14
14
 
15
- [![Release](https://img.shields.io/badge/release-v1.8.3-blue)](RELEASE.md)
15
+ [![Release](https://img.shields.io/badge/release-v1.8.4-blue)](RELEASE.md)
16
16
 
17
- **v1.8.3** 已发布:新增 SecurityAnalyzer 安全门控、Trace 2.0 事件日志与会话摩擦学习/知识召回能力,clarify 阶段支持多维度相关者分析。
17
+ **v1.8.4** 已发布:新增少即是多制品生成纪律(hook 注入),修复 policies 目录未同步进 vendored 项目的问题。
18
18
 
19
19
  查看完整发布说明:[RELEASE.md](RELEASE.md)
20
20
 
@@ -101,6 +101,12 @@ lincoln update # 升级本体 + 同步框架 + 刷新外部技能库
101
101
  lincoln update --check # 只检查是否有新版本,不安装
102
102
  ```
103
103
 
104
+ 也可以直接用 npm 把本体升到最新再同步框架:
105
+
106
+ ```bash
107
+ npm install -g @sushanglewis/lincoln@latest && lincoln update
108
+ ```
109
+
104
110
  技能库同步遵循 dependencies.yaml 的 pin 策略:本地有未提交修改的仓库会被跳过并警告(不会被强制覆盖),非 npm 管理的 CLI(如 gh)缺失时只提示安装命令。同步失败降级为警告,不会阻断升级。
105
111
 
106
112
  如果还是旧版安装(例如 bin 名是 `lincoln-install` 的时代),或更新时 npm 报 `EEXIST: file already exists`,说明有旧包残留的 bin 文件挡住了安装,先清理再重装:
@@ -238,6 +244,7 @@ Lincoln 的 `.claude/` 是开放的系统提示层,欢迎基于同一套元模
238
244
 
239
245
  | 版本 | 日期 | 关键能力 |
240
246
  |---|---|---|
247
+ | v1.8.4 | 2026-10-08 | PM 阶段 PRD 质量门控:需求六问自检、13 章递进骨架、PRD 内容卫生与交叉验证校验、原型最终样貌纪律(#129) |
241
248
  | v1.8.3 | 2026-10-08 | 少即是多制品生成纪律(hook 注入);非 npm CLI 平台化安装提示;`lincoln update` 同步刷新外部技能库 |
242
249
  | v1.7.0 | 2026-09-05 | SecurityAnalyzer 安全门控;Trace 2.0 事件日志;摩擦学习/知识召回/Trace 浓缩/MR 挖掘;并行专家子代理委托;相关者分析模型 |
243
250
  | v1.6.3 | 2026-08-15 | Markdown-first issue-package 文档;`--render-stage` 批量渲染;Mermaid 图表本地渲染 |
@@ -1,3 +1,24 @@
1
+ # Lincoln v1.8.4 Release Notes
2
+
3
+ **Release date:** 2026-10-08
4
+
5
+ ## Highlights
6
+
7
+ - **PM 阶段 PRD 质量整治 (#129)** — 把「PM 产出的 PRD 必须经得起研发团队与测试挑战」从 prompt 建议升级为可执行的门控:
8
+ - **需求清晰度六问自检** — clarify-requirements 起草原稿前必须逐项回答:用户有哪些、场景是什么、边界在哪里、如何管异常、如何体验好、最终谁决策;答不出先问人类 PM,禁止带未决问题落笔。
9
+ - **13 章递进骨架** — PRD 固定为「版本说明 → 修订记录 → 功能列表 → 需求背景 → … → 风险与开放问题」的渐进结构,章节按名字匹配、编号只是装饰,PM 可按需求形态在骨架内增插业务章节。
10
+ - **双注册表内容卫生校验** — 两份校验器(stage gates 与 workflow exit_checks)同步新增 `prd_content_hygiene`:PRD 正文禁止过程性短语(待确认/待 PM/TODO 等)与技术性章节(技术调研/架构设计/数据库设计等),技术内容只进 design 阶段的归档页 feasibility.html。
11
+ - **SDD 测试反向驱动交叉验证** — plan-tdd-development 新增 Phase 2:从测试场景(正常/边界/异常)逐一回问 PRD 业务规则与验收标准,并建立业务流程步骤 ↔ 原型页面双向对齐矩阵;缺口必须由人类 PM 决策闭环(修复 = PRD 升版重冻结,或接受 = 记录理由与影响),全部闭环后交叉验证报告才能写入 pass 标记,`prd_cross_validated` 校验器强制 pass 标记版本与当前 PRD 版本严格相等并对 PRD 复检卫生,防止后续阶段编辑回潮。
12
+ - **原型只画最终样貌** — build-product-prototype 明确禁止仅用于演示的模拟按钮、屏内说明文字与演示跳转,解释一律走 `doc-*` 注释由门户右侧面板呈现;每个原型页面标注所属用户故事与业务流程步骤,与 PRD 文字双向对齐。
13
+ - **PM 角色质量职责** — lc-pm 新增三条专属职责:输出 PRD 前完成六问自检、PRD 只承载业务内容、交叉验证缺口必须经人类 PM 决策才允许闭环。
14
+
15
+ ## Migration Notes
16
+
17
+ - 无破坏性变更:新校验只在 `clarify` 与 `tdd-development-plan` 阶段出口执行,既有已审批产物不受影响;重跑这两个阶段时需满足新版骨架与卫生规则。
18
+ - 升级后执行 `lincoln update` 即把新 prompt、校验器与门控接线同步进各 harness;进行中的 issue 工作包从下一阶段起自动适用新规则。
19
+
20
+ ---
21
+
1
22
  # Lincoln v1.8.3 Release Notes
2
23
 
3
24
  **Release date:** 2026-10-08
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "1.8.3",
3
- "generatedAt": "2026-10-08T06:44:27.829Z",
2
+ "version": "1.8.4",
3
+ "generatedAt": "2026-10-08T15:05:56.234Z",
4
4
  "files": [
5
5
  {
6
6
  "path": ".claude-plugin/hooks.json",
@@ -8,11 +8,11 @@
8
8
  },
9
9
  {
10
10
  "path": ".claude-plugin/marketplace.json",
11
- "sha256": "11b5a97c00ce9b5ad558cd0d4929a9b3acaabc006fa3a20c223e3026a778fb8c"
11
+ "sha256": "eedc0fe820496ffa76731e694758753e81d55bcbab1b3f4700562559aeebeba8"
12
12
  },
13
13
  {
14
14
  "path": ".claude-plugin/plugin.json",
15
- "sha256": "18060c38b9f9d9a3ca1b356a33d39810f13248cf1ee9bdd224fb6b2ca9d907e0"
15
+ "sha256": "c18a2bb7fa9907deccc2e14556a3279d876ed08560eb092a59f341587f7fe7c9"
16
16
  },
17
17
  {
18
18
  "path": ".claude/agents/architect.md",
@@ -56,7 +56,7 @@
56
56
  },
57
57
  {
58
58
  "path": ".claude/agents/pm.md",
59
- "sha256": "75e9481a9bb0b87fd051416f1680f748ddd62e61209c29697acb589fbbb11fa1"
59
+ "sha256": "eaf7c02ca5b268376e3df7ebe5862bee739688748b8a9472818117b74cfdd627"
60
60
  },
61
61
  {
62
62
  "path": ".claude/agents/qa.md",
@@ -152,7 +152,7 @@
152
152
  },
153
153
  {
154
154
  "path": ".claude/schemas/stage-definition.schema.json",
155
- "sha256": "5746190d5de63f7481bc161d4c6a301a43b776886b99ffb0c099609bb5422a05"
155
+ "sha256": "153a15c095706c259fabb313227eb183615b84596020f70326ea5e3541f9797e"
156
156
  },
157
157
  {
158
158
  "path": ".claude/schemas/workflow-stage.schema.json",
@@ -172,7 +172,7 @@
172
172
  },
173
173
  {
174
174
  "path": ".claude/skills/build-product-prototype/prompts/main.md",
175
- "sha256": "390589f01598b749d8c85e5ecab425ea70b428cb3fe91484b91136168e0b4a82"
175
+ "sha256": "6523aa6def0f75f93cbbbcbb76e5de285ecc730bb81211add8900826f6a51d5b"
176
176
  },
177
177
  {
178
178
  "path": ".claude/skills/clarify-requirements/SKILL.md",
@@ -180,7 +180,7 @@
180
180
  },
181
181
  {
182
182
  "path": ".claude/skills/clarify-requirements/prompts/main.md",
183
- "sha256": "5431aa1a268058d397d1a0acbf79d50b8c87e42ab3ae7f329e0e810e2e519f7b"
183
+ "sha256": "c96b1972e085fdea5c28c152c69fa8421d814fc9ce4a7169fa5c8f94619ef36c"
184
184
  },
185
185
  {
186
186
  "path": ".claude/skills/dependencies.yaml",
@@ -192,7 +192,7 @@
192
192
  },
193
193
  {
194
194
  "path": ".claude/skills/draft-product-design/prompts/main.md",
195
- "sha256": "22d3a9635ab3937206eb1bb686728e5d5135b9b1de27ca76d6976180ab97b8ab"
195
+ "sha256": "77aa515515dbe87216041f064a480ddac269889e2e5f296843537ab92d794c44"
196
196
  },
197
197
  {
198
198
  "path": ".claude/skills/lc-analyze-frameworks/SKILL.md",
@@ -348,15 +348,15 @@
348
348
  },
349
349
  {
350
350
  "path": ".claude/skills/lc-workflow/validators/validate.py",
351
- "sha256": "2ef99c40e29de06761005ac58f9e47a32955a104a18987d4b8059507f179bdbf"
351
+ "sha256": "0a6b9afab31c0e0e4b33dc7cc2e421604bafbc386cb9bd259098232f161e0e1b"
352
352
  },
353
353
  {
354
354
  "path": ".claude/skills/plan-tdd-development/SKILL.md",
355
- "sha256": "e90e6fba34fa718cae42b7f9f12e044152f5e1742500704824022d4bac62f4e3"
355
+ "sha256": "71c9497cd6bb6cbf0486fd3955bdf41579c6c2691f4c060a343d4712ba485143"
356
356
  },
357
357
  {
358
358
  "path": ".claude/skills/plan-tdd-development/prompts/main.md",
359
- "sha256": "44ed17546594d97aa25cf88af8b124f8978c114229b7522517b23d909cdd1321"
359
+ "sha256": "9a5a3a5b84c27e52026e8f6d01f3c350d5ac478af4f349c6756a5b40e2150705"
360
360
  },
361
361
  {
362
362
  "path": ".claude/skills/process-interview/SKILL.md",
@@ -404,7 +404,7 @@
404
404
  },
405
405
  {
406
406
  "path": ".claude/stages/clarify.yaml",
407
- "sha256": "14d3ddb85431fb1800fff8794a6c6aeec378cc8e88bf458f7b593409b8380b1c"
407
+ "sha256": "506491928f9e68fb643912046b66b565035ed9c2b397a9613d3541cd46d35327"
408
408
  },
409
409
  {
410
410
  "path": ".claude/stages/explore-opensource.yaml",
@@ -496,7 +496,7 @@
496
496
  },
497
497
  {
498
498
  "path": ".claude/stages/tdd-development-plan.yaml",
499
- "sha256": "6195affc25c98b63564cbfea0020132729209dd76180b01fa96645a6c25fe2ef"
499
+ "sha256": "2e684504983e2b9488ffc885a018832883395fd8b0b9beadf4cd6f30e73d06bf"
500
500
  },
501
501
  {
502
502
  "path": ".claude/stages/workflow-router.yaml",
@@ -528,7 +528,7 @@
528
528
  },
529
529
  {
530
530
  "path": ".claude/workflows/interview-to-knowledge.yaml",
531
- "sha256": "ba7178a7459025e9fa003cc9b0f3318ec0dc7f0b0bda89114d69723028398d47"
531
+ "sha256": "8f858613592282504701141d65c36cc44c82d4ea47c14b890db90559a30f9e9c"
532
532
  },
533
533
  {
534
534
  "path": ".claude/workflows/oss-first-design.yaml",
@@ -540,7 +540,7 @@
540
540
  },
541
541
  {
542
542
  "path": ".version-bump.json",
543
- "sha256": "9050ff12f124a1b2579d975e90b2669b2893444c7086118801977fc3c53d4612"
543
+ "sha256": "19c15c1eae8c4e4a1062f0e82bdbf4201910f6fd9a42019a0627fa7e41061546"
544
544
  },
545
545
  {
546
546
  "path": "CLAUDE.md",
@@ -556,15 +556,15 @@
556
556
  },
557
557
  {
558
558
  "path": "README.en.md",
559
- "sha256": "ffdd23fd7d0c3c915c370204a2946c795f86d0daf4b2d25dd8625b6569c18bf8"
559
+ "sha256": "12325801ae226d0dfa825b66cae2fb48758af0c979d890f56f7447fa1be8b89b"
560
560
  },
561
561
  {
562
562
  "path": "README.md",
563
- "sha256": "ed869d2870af28080f376572576b62d70a3f73fcd8dd44f86f41de754d7a8df8"
563
+ "sha256": "8b5427ce20877fddd96a763f50841bf91706e0611e22320fd255dbc19d72e66d"
564
564
  },
565
565
  {
566
566
  "path": "RELEASE.md",
567
- "sha256": "027304754761c791630b61d474b03b703adf5faf97da990850c6976cdf10801d"
567
+ "sha256": "a4d72d108a6f676a48392327bab1a5b88b40eaf3c8eec581d3866705f3994942"
568
568
  },
569
569
  {
570
570
  "path": "SKILL.md",
@@ -776,7 +776,7 @@
776
776
  },
777
777
  {
778
778
  "path": "scripts/validate_stage.py",
779
- "sha256": "ad154306596c82d9436d282c7e10484a43d6814b5a90fe8b458643a371edec7a"
779
+ "sha256": "45259fce089fb9fc72df5b1a1c00a3c782008662e9de551aff45aff44a732019"
780
780
  },
781
781
  {
782
782
  "path": "tools/lincoln-installer/.gitignore",
@@ -788,7 +788,7 @@
788
788
  },
789
789
  {
790
790
  "path": "tools/lincoln-installer/package.json",
791
- "sha256": "a47d678d0f5390965c9d2125e4c9335b81b42bbf654a7f2b8c95ad34fb6a2ee8"
791
+ "sha256": "8af7b6ee0dc6da02d47413495af0b8f042d90ffb0a79c46e8bce5c6dafb19671"
792
792
  },
793
793
  {
794
794
  "path": "tools/lincoln-installer/src/cli.tsx",
@@ -1072,11 +1072,11 @@
1072
1072
  },
1073
1073
  {
1074
1074
  "path": "tools/lincoln/package-lock.json",
1075
- "sha256": "5f41e5b6fe2347030a6ea415667bfbddfb854c6bca10fe024fe9aafd4d452fdb"
1075
+ "sha256": "5156ad816f5a4eb0ea354943b74af393c2586878bf5b64a1ab228bb6cae98ae4"
1076
1076
  },
1077
1077
  {
1078
1078
  "path": "tools/lincoln/package.json",
1079
- "sha256": "da52cdabdf3af3fc189466ba555b77c0b698075288600e6f29d56a85bb64decd"
1079
+ "sha256": "6631b2928992358105633a0e0b4c693c40e40fbd73757f74a39dc8bd2302165e"
1080
1080
  },
1081
1081
  {
1082
1082
  "path": "tools/lincoln/src/cli.tsx",
@@ -324,37 +324,82 @@ def check_portal_index_fresh() -> None:
324
324
  # ---------------------------------------------------------------------------
325
325
 
326
326
 
327
+ # 递进骨架(issue-129):版本说明 → 修订记录 → 功能列表 → 需求展开。
328
+ # 章节编号不参与匹配,PM 可按需求类型在骨架内增插业务章节。
327
329
  REQUIRED_PRD_SECTIONS = [
328
- "## 1. 需求背景",
329
- "## 2. 用户故事",
330
- "## 3. 功能拆解",
331
- "## 4. 业务流程图",
332
- "## 5. 验收标准",
333
- "## 6. 业务规则",
334
- "## 7. 非功能需求",
335
- "## 8. 关联系统/接口",
336
- "## 9. 相关产物链接",
337
- "## 10. 风险与开放问题",
330
+ "版本说明",
331
+ "修订记录",
332
+ "功能列表",
333
+ "需求背景",
334
+ "用户故事",
335
+ "功能拆解",
336
+ "业务流程图",
337
+ "验收标准",
338
+ "业务规则",
339
+ "非功能需求",
340
+ "关联系统/接口",
341
+ "相关产物链接",
342
+ "风险与开放问题",
338
343
  ]
339
344
 
345
+ PRD_SECTION_PATTERNS = [
346
+ (name, re.compile(rf"^##\s*(?:\d+\s*[.、.]?\s*)?{re.escape(name)}\s*$", re.MULTILINE))
347
+ for name in REQUIRED_PRD_SECTIONS
348
+ ]
349
+
350
+ # PRD 正文禁则:过程性疑问在对话中解决,技术内容归归档页(issue-129 第 4/6 条)。
351
+ PRD_FORBIDDEN_PROCESS_RE = re.compile(r"待确认|待人类|待补充|待\s*PM|TODO|FIXME", re.IGNORECASE)
352
+ PRD_FORBIDDEN_TECH_HEADING_RE = re.compile(
353
+ r"^##+\s*.*(技术调研|技术方案|可行性研究|架构设计|接口设计|数据库设计)",
354
+ re.MULTILINE,
355
+ )
356
+
357
+ CROSS_VALIDATION_PASS_RE = re.compile(
358
+ r"<!--\s*cross-validation:\s*pass\s+prd-version:\s*(v\d+\.\d+)\s*-->"
359
+ )
360
+
361
+
362
+ def _read_prd_text(target: Path) -> str:
363
+ if target.suffix == ".html":
364
+ return extract_html_markdown(target)
365
+ return target.read_text(encoding="utf-8")
366
+
367
+
368
+ def _prd_hygiene_violations(text: str) -> list[str]:
369
+ violations = sorted(set(PRD_FORBIDDEN_PROCESS_RE.findall(text)))
370
+ violations.extend(sorted(set(PRD_FORBIDDEN_TECH_HEADING_RE.findall(text))))
371
+ return violations
372
+
340
373
 
341
374
  def check_prd_has_required_sections(path: str) -> None:
342
375
  target = PROJECT_ROOT / path
343
376
  if not target.exists():
344
377
  fail(f"PRD missing: {target}")
345
378
 
346
- if target.suffix == ".html":
347
- text = extract_html_markdown(target)
348
- else:
349
- text = target.read_text(encoding="utf-8")
379
+ text = _read_prd_text(target)
350
380
 
351
- missing = [section for section in REQUIRED_PRD_SECTIONS if section not in text]
381
+ missing = [name for name, pattern in PRD_SECTION_PATTERNS if not pattern.search(text)]
352
382
  if missing:
353
383
  fail(f"PRD missing required sections: {', '.join(missing)}")
354
384
 
355
385
  pass_check("PRD has all required sections")
356
386
 
357
387
 
388
+ def check_prd_content_hygiene(path: str) -> None:
389
+ target = PROJECT_ROOT / path
390
+ if not target.exists():
391
+ fail(f"PRD missing: {target}")
392
+
393
+ violations = _prd_hygiene_violations(_read_prd_text(target))
394
+ if violations:
395
+ fail(
396
+ "PRD contains content that belongs in conversation or archived pages, "
397
+ f"not the PRD: {', '.join(violations)}"
398
+ )
399
+
400
+ pass_check("PRD content hygiene OK")
401
+
402
+
358
403
  def check_prd_snapshot_present(path: str) -> None:
359
404
  target = PROJECT_ROOT / path
360
405
  if not target.exists():
@@ -374,6 +419,40 @@ def check_prd_snapshot_present(path: str) -> None:
374
419
  pass_check(f"PRD snapshot present: {snapshot_path}")
375
420
 
376
421
 
422
+ def check_prd_cross_validated(path: str) -> None:
423
+ target = PROJECT_ROOT / path
424
+ if not target.exists():
425
+ fail(f"Cross-validation report missing: {target}")
426
+
427
+ match = CROSS_VALIDATION_PASS_RE.search(_read_prd_text(target))
428
+ if not match:
429
+ fail(
430
+ "Cross-validation report has no pass marker. Every gap must be closed by a "
431
+ "human-PM decision (PRD fix with re-freeze, or accepted with recorded "
432
+ "rationale) before adding '<!-- cross-validation: pass prd-version: vX.Y -->'."
433
+ )
434
+
435
+ prd_path = target.parent / "prd.html"
436
+ if not prd_path.exists():
437
+ fail(f"PRD missing next to cross-validation report: {prd_path}")
438
+
439
+ prd_version = _extract_document_version(prd_path)
440
+ if prd_version != match.group(1):
441
+ fail(
442
+ f"Cross-validation pass marker is for PRD {match.group(1)}, but the PRD is now "
443
+ f"{prd_version or 'unversioned'}. Re-run cross-validation against the current PRD."
444
+ )
445
+
446
+ violations = _prd_hygiene_violations(_read_prd_text(prd_path))
447
+ if violations:
448
+ fail(
449
+ f"PRD regressed after cross-validation pass: {', '.join(violations)}. "
450
+ "Fix the PRD, bump its version, re-freeze, and re-run cross-validation."
451
+ )
452
+
453
+ pass_check(f"PRD cross-validation pass marker matches PRD {prd_version}")
454
+
455
+
377
456
  # ---------------------------------------------------------------------------
378
457
  # Registry
379
458
  # ---------------------------------------------------------------------------
@@ -397,6 +476,8 @@ EXIT_CHECKS = {
397
476
  "handoff_versions_match": check_handoff_versions_match,
398
477
  "prd_has_required_sections": check_prd_has_required_sections,
399
478
  "prd_snapshot_present": check_prd_snapshot_present,
479
+ "prd_content_hygiene": check_prd_content_hygiene,
480
+ "prd_cross_validated": check_prd_cross_validated,
400
481
  "portal_index_exists": check_portal_index_exists,
401
482
  "artifact_meta_complete": check_artifact_meta_complete,
402
483
  "ids_valid": check_ids_valid,
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sushanglewis/lincoln",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@sushanglewis/lincoln",
9
- "version": "1.8.3",
9
+ "version": "1.8.4",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "ink": "^5.2.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sushanglewis/lincoln-recorder",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "Cross-tool terminal UI for recording Lincoln interviews",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lincoln-install",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "Terminal TUI installer for the Lincoln AI-Native R&D workflow system",
5
5
  "type": "module",
6
6
  "main": "dist/main.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sushanglewis/lincoln",
3
- "version": "1.8.3",
3
+ "version": "1.8.4",
4
4
  "description": "Global Lincoln agent harness plugin CLI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",