@xulthekl/team-flow 0.64.0 → 0.67.0
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.
- package/.claude/always/phase-guard.md +1 -1
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.cursor-plugin/marketplace.json +1 -1
- package/.cursor-plugin/plugin.json +1 -1
- package/.github/plugin/marketplace.json +2 -2
- package/CHANGELOG.md +60 -0
- package/GEMINI.md +1 -1
- package/INSTALL.md +1 -1
- package/README.md +1 -1
- package/agents/architecture-design.md +1 -1
- package/agents/architecture-reviewer.md +6 -2
- package/agents/prd-completeness-reviewer.md +10 -0
- package/agents/prd-writer.md +1 -0
- package/agents/release-archivist.md +2 -0
- package/docs/README_en.md +1 -1
- package/docs/team-flow /344/275/277/347/224/250/350/257/264/346/230/216/357/274/210/347/240/224/345/217/221/345/233/242/351/230/237/347/211/210/357/274/211.md" +8 -6
- package/gemini-extension.json +1 -1
- package/hooks/session-start +2 -2
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/prd/v1/prd.md +1 -1
- package/scripts/guard/checks/arch-gate-exemptions.mjs +5 -3
- package/scripts/guard/checks/arch-readiness.mjs +1 -1
- package/scripts/guard/checks/arch-snapshot.mjs +5 -3
- package/scripts/guard/checks/history-risk.mjs +132 -0
- package/scripts/guard/checks/prd-clarity-state.mjs +41 -0
- package/scripts/guard/checks/prd-clarity.mjs +176 -0
- package/scripts/guard/guard.mjs +16 -8
- package/scripts/infer-workflow.mjs +20 -0
- package/scripts/lib/arch-merge.mjs +384 -50
- package/scripts/lib/arch-parse.mjs +5 -2
- package/scripts/lib/arch-registry.mjs +523 -0
- package/scripts/lib/arch-scan-code.mjs +518 -0
- package/scripts/lib/cmd-arch.mjs +9 -1
- package/scripts/lib/cmd-doctor.mjs +3 -3
- package/scripts/lib/cmd-prd.mjs +84 -1
- package/scripts/lib/cmd-solutions.mjs +3 -0
- package/scripts/lib/cmd-state.mjs +31 -1
- package/scripts/lib/config-loader.mjs +20 -0
- package/scripts/lib/solutions-capture.mjs +5 -0
- package/scripts/lib/solutions-index-gen.mjs +33 -3
- package/scripts/lib/solutions-inject.mjs +34 -9
- package/scripts/lib/state-loader.mjs +13 -0
- package/scripts/team-flow.mjs +3 -0
- package/skills/architecture-design/SKILL.md +29 -11
- package/skills/architecture-design/chapters/ch04-entity-to-aggregate.md +18 -7
- package/skills/architecture-design/chapters/ch06-integration.md +12 -3
- package/skills/architecture-design/glossary.md +5 -1
- package/skills/architecture-design/references/adr-templates.md +56 -0
- package/skills/architecture-design/references/context-map-8.md +47 -0
- package/skills/architecture-design/references/ddd-evented-playbook.md +41 -0
- package/skills/architecture-design/references/s3.5-architecture-template.md +36 -4
- package/skills/architecture-design/references/s3.5-loading-protocol.md +5 -4
- package/skills/architecture-design/references/s3.5-product-architecture.md +6 -6
- package/skills/architecture-design/templates/architecture.md +20 -0
- package/skills/ce-brainstorm/SKILL.md +3 -3
- package/skills/ce-brainstorm/references/grounding.md +1 -1
- package/skills/ce-brainstorm/references/prd-84-authoring-spec.md +26 -3
- package/skills/ce-brainstorm/references/prototype-loop.md +8 -0
- package/skills/ce-compound/references/concepts-vocabulary.md +1 -1
- package/skills/ce-compound/references/full-mode-workflow.md +2 -2
- package/skills/ce-compound/references/lightweight-mode.md +1 -1
- package/skills/ce-compound/references/promotion-rules.md +1 -1
- package/skills/ce-compound/references/three-tier-index.md +1 -1
- package/skills/ce-plan/references/research-workflow.md +1 -1
- package/skills/jarvis/references/protocols.md +1 -0
- package/skills/release-archivist/SKILL.md +21 -0
- package/skills/release-archivist/references/closing-procedures.md +1 -1
- package/skills/workflow-orchestrator/SKILL.md +8 -4
- package/skills/workflow-orchestrator/references/s1-path-router.md +7 -0
- package/skills/workflow-orchestrator/references/s2-prd-prototype-loop.md +16 -2
- package/skills/workflow-orchestrator/references/s3-plan-pipeline.md +1 -1
- package/skills/workflow-start/SKILL.md +1 -1
- package/templates/prd.md +9 -1
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
{
|
|
10
10
|
"name": "team-flow",
|
|
11
11
|
"description": "8-state spec workflow + compound global compounding + architecture-design (4A/DDD) + local HTML prototype + product-level orchestration + bootstrap + e2e + session handoff + workflow feedback + independent business analysis. 28 skills + 17 agents with embedded TDD, SDD, code review, debugging, delta spec sync, and design-system-driven prototyping.",
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.67.0",
|
|
13
13
|
"source": "./",
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "LT",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "team-flow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.0",
|
|
4
4
|
"description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking) + business-analysis (independent requirement/scenario artifact) + design-system (design tokens + component contract + AI primer + showcase) + test-strategy (test strategy design) + project-initialize (new service onboarding) + jarvis (team-flow decision agent, opt-in). 28 skills + 17 agents, one install.",
|
|
5
5
|
"source": "./",
|
|
6
6
|
"author": {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "team-flow",
|
|
3
3
|
"displayName": "team-flow",
|
|
4
4
|
"description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking) + business-analysis (independent requirement/scenario artifact) + jarvis (team-flow decision agent, opt-in). 28 skills + 17 agents, one install.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.67.0",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "LT",
|
|
8
8
|
"url": "https://github.com/LT"
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Unified workflow plugins and skills for AI coding agents (team-flow: team-flow + compound + architecture-design + prototype).",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.67.0"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "team-flow",
|
|
14
14
|
"description": "Unified workflow with planning artifacts, execution contracts, TDD, review gates, systematic debugging, delta spec sync, architecture-design, independent business analysis, and local HTML prototyping.",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.67.0",
|
|
16
16
|
"source": ".",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "LT",
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,66 @@ All notable changes to `team-flow` will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format loosely follows Keep a Changelog.
|
|
6
6
|
|
|
7
|
+
## [0.67.0] - 2026-09-25
|
|
8
|
+
|
|
9
|
+
### Added(agent-governance 治理演进全量:P0–P2 七批次;设计 = 工作区 `teamflow-agent-governance-design-memo.md` v0.5 + 实施计划 v1.2,P1.5 标准档两轮 + 收官验证 0 Critical)
|
|
10
|
+
|
|
11
|
+
**版本号说明**:**跳过 0.66.0**——该号预留给 ddd-purity 的 legacy 回写硬切(`docs/plan/ddd-purity-and-arch-merge-design.md` §5.4-7 等 13 处引用 + arch-merge/arch-registry 代码注释),agent-governance 先行完成故占 0.67.0。
|
|
12
|
+
|
|
13
|
+
**P0-1 · PRD 清晰度机械门(DEC-8a 复议推翻落地,Q5)**
|
|
14
|
+
- 新增 `scripts/guard/checks/prd-clarity.mjs` + `tf prd check-clarity <dir|file>`:弱词 8 类(权威正文 = prd-84 §4,收口 5→8 类)/ 必需段缺失 / §8.4 左列技术维度漂移,**fail-closed**(段缺失即 FAIL、FAIL exit 1),兼容 `requirement/vN` 与 `prd/vN` 老布局;误报校准唯一落点 = `WEAK_RULES` 词表(「处理」/单字「等」刻意排除,双侧留痕)。
|
|
15
|
+
- **三处接入**:CLI / standalone(`prototype-loop.md` §3.5.5 前置)/ orchestrated(`s2-prd-prototype-loop.md` step 3.4,**含无 UI 路径不可绕过**);FAIL 不派发 reviewer 直接回改。
|
|
16
|
+
- **DEC-8 拆 a/b scope**:a=弱词机械门推翻(回写 5 文件勘误)/ b=历史痕迹检测维持;模板撰写指引 blockquote **实例化剥离规则**(模板+prd-writer+prd-84 三处送执行者,防指引弱词死循环)。
|
|
17
|
+
- **跨层管道**:check-clarity 落 `.team-flow/prd-clarity.json` → `tf state init` 拷贝 change state(`prd_clarity_result`,**有意不在 SETTABLE_FIELDS**——可自助写 = 绕过通道)→ 变更级维度消费。
|
|
18
|
+
|
|
19
|
+
**P0-2 · reviewer 异常上报(双通道)**
|
|
20
|
+
- prd-completeness-reviewer / architecture-reviewer / release-archivist:会话输出先 `FINAL VERDICT` 一行、仅 Critical/Important 展开;**落盘报告保留全量明细**(SendMessage fallback 修正链与 DP-A 裁定依赖);release-archivist `dp_6`/`dp_7` 必填字段任何 status 不删、pass 仅省展开块。
|
|
21
|
+
|
|
22
|
+
**P1-1 · 接活前双维度(guard 31→33 维)**
|
|
23
|
+
- 新维度 `prd-clarity` + `history-risk`:挂 full `bridging→approved-for-build`/`approved→executing` 与 quick/lightweight/planned 前门;hotfix/tweak 有意不挂。
|
|
24
|
+
- `history-risk`(experimental):INDEX severity 风险向(confirmations 是复发信号不作正向分)、**N<3 最小样本中性**(单条不压制)、通用词根黑名单(防 source 列误关联)、命中 critical 即阻断(补救 = 改 INDEX 源头,无 state 确认通道——如实声明)。
|
|
25
|
+
- 缺失态三处中性(无记录/INDEX 空/无匹配)→ **冷启动零行为变化**;`inferMode` 新增 `clarity`/`risk` 双信号(workflow-start 路由建议级消费,与 guard 阻断分工)。
|
|
26
|
+
- 横展 9 处齐(guard/state-loader/cmd-state/新测试/使用说明矩阵/test-matrix/guard-dimensions 头部映射/e2e skill/.gitignore),**v0.64 遗留计数三分裂一并对齐**(test 头 20 / 使用说明 31 / e2e skill 19 → 统一 33)。
|
|
27
|
+
|
|
28
|
+
**P1-2 · 产品级 A 档文案降级**
|
|
29
|
+
- S1 确认合并(低风险三条件)/ ce-brainstorm scope 推荐 Lightweight(判定不清按 Standard 起步)/ ARCH 增量裁剪轻审 / S3 一次确认;**红线不动**:prd_draft 强制确认、红区永久挂起、DP-A、4A+DDD 六产物、skip 物化。
|
|
30
|
+
|
|
31
|
+
**P2-1/2/3 · 复利三件**
|
|
32
|
+
- P2-1:`tf solutions capture --source-event` 来源事件锚 + `type: correction` 纠错类;jarvis HOLD 协议新增 ④' 纠错捕获步骤(**纪律级**——两个自动钩子候选均观测不到 HOLD 已证伪;误捕获不可接受;非 Jarvis 场景显式缩范围入待办)。
|
|
33
|
+
- P2-2:INDEX 第 9 列 `flags`(**纯派生随重建重算**:有锚+confirmations<3=probation 见习 / ≥3=auto-ok 毕业 / 无锚存量 grandfather auto-ok)+ inject 双门控(见习排除 + `DP-A|Code Landing|publish|发布闸|代码落地` 红区硬排除,计数可见含空结果分支)+ doctor 列数 7–9 + **五处手动读 fallback 同门**(降级不降门)+ 8 测试含重建存活正例。
|
|
34
|
+
- P2-3:S1/S3/ce-brainstorm 三处顶层 `tf solutions inject` 调用(注入不限 scope——防 A 档默认轻档零注入)+ 收益量化协议入 S1(冷启动 0 条目不计收益 0;真实样例收益实测入待办)。
|
|
35
|
+
|
|
36
|
+
**验证**:P4 双门禁——plugin-validator **PASS**(Major:`.npmignore` 漏排 `/.team-flow/` 运行时记录已修 + pack 反验);skill-reviewer **PASS_WITH_WARNINGS**(1C+4M+7m 全修,含 s2 无 UI 路径绕过 3.4 的 fail-open、S3 phase 口径 build→plan、红区关键词 3→5);`npm run check-versions` ✓;`npm test` 1343→**1383**(+40:prd-clarity 18 + clarity-history 14 + probation 8);`test:e2e` 103 全绿;`lint:skills` 87/7 与基线同。存量 PRD 校准 1 处真命中按「不过就改」修正,`check-clarity` PASS。
|
|
37
|
+
|
|
38
|
+
## [0.65.0] - 2026-09-25
|
|
39
|
+
|
|
40
|
+
### Added(DDD 纯度 + 架构回写机制重构:O1–O9 全量落地;设计 = docs/plan/ddd-purity-and-arch-merge-design.md v1.5,P1.5 完整档 3 轮闭合 + 三批 P3/P4 独立评审全处置)
|
|
41
|
+
|
|
42
|
+
**O8 · 回写机制两段式重构(本版核心,registry 持久化 + 软着陆双路径)**
|
|
43
|
+
- 新增 `scripts/lib/arch-registry.mjs`:`docs/architecture/.registry/registry.json` 唯一存储(JSON·固定键序·零依赖可重放);schema 五段冻结(aggregates 含 `events[]`、bounded_contexts 含 `context_map[]`——O4/O7 登载体预置;subdomains 含 Core/Supporting/Generic;source 全段必填 `base|change:<name>`);delta 四 op 匹配矩阵(new/extend/refactor/retire;retire 不删行置 status+reason;违约分流软着陆 WARN / 硬切 violation);**save 前 validate fail-closed**(写不出好过写出坏文件)+ 内容级幂等(时间戳不刷不写盘)。
|
|
44
|
+
- `arch-merge` 双路径:`.arch-delta.json` 存在 → **seed 先于 delta**(首跑自动 seed:closed changes 聚合 + 快照 + schema-baseline 表 + API-INDEX 端点,红牌 12)→ schema 校验(结构错 abort、evidence 类软着陆 WARN)→ registry 落盘 → **四生成式改源**(PHYSICAL-MODEL/DATABASE/API-INDEX/INDEX ← registry,R-b 修复;schema-baseline.sql 保留单向 append 兼容);缺失 → legacy 重算路径 + 显式登记(v0.66.0 硬切)。**物理事实机械补种**(本次 DDL 表 / 扫描端点 / current 聚合 → 补 + WARN 不静默)与**语义意图只经 delta** 分界。
|
|
45
|
+
- `touchedFiles` 白名单追加 `.registry/`(登记永不 commit 修复);守恒断言 C2(B 级下界,有触发正例)/C3(半级)挂 merge;C4 运行时与 doctor 维度归 M1–M3 存量迁移批(待授权)。
|
|
46
|
+
- release-archivist 新增 **①-pre 语义段**(delta 产出纪律:evidence/reason 必填两类别、补种边界、R3-3、软着陆→硬切时点);planned ⚠ 块回指。
|
|
47
|
+
- 守卫横展:SKIPPED 物化**双形态识别**(新规范 `SKIPPED.md` + 存量 `SKIPPED`——arch-readiness/arch-snapshot/cmd-doctor 同步,防新规范卡死硬门)。
|
|
48
|
+
|
|
49
|
+
**O4/O5/O6/O7 · 设计层模板**
|
|
50
|
+
- O4 事件 schema 版本策略门禁(产品级 §3.2:major/minor/tombstone + 必填版本字段 → 评审阻塞 + 消费侧 upcasting)+ 变更级模板 §2.5 独立领域事件表(schema 版本/兼容级别列)。
|
|
51
|
+
- O7 Context Map **6→经典 8 模式**(+Partnership +Published Language)+ 新 `references/context-map-8.md`(模式表 + 决策流 Mermaid + CML NO-GO);ch04 F5 / SKILL F5 / 产品级枚举四处同步(教=用)。
|
|
52
|
+
- O5 新 `references/ddd-evented-playbook.md`(Saga 补偿矩阵 / Projection 重建 staging 优先 / 幂等键;设计层 ONLY 不生成代码)。
|
|
53
|
+
- O6 新 `references/adr-templates.md`(MADR/轻量/Y-Statement/废弃/RFC 五模板 + 三条件防泛滥 + replan_log 可机读唯一落点,不另起 `docs/adr/`);架构修订决策门接入。
|
|
54
|
+
|
|
55
|
+
**O1 · DDD 深度 advisory**
|
|
56
|
+
- SKILL 判定链新增 advisory 段(五项检查之前;领域复杂度三判据、禁 4 选 2 硬阈值)+ 结构化输出契约 `ddd_depth: full|lightweight` 与 `decision` **正交**(任意组合合法、禁推导);**红牌 `lightweight ≠ skipped` + 第 4/5 项(API/DB)不短路**;两条规则文本 lint 测试锁定(明示非行为护栏)。
|
|
57
|
+
|
|
58
|
+
**O2/O3 · 战略层(前批)+ O9 可读性**
|
|
59
|
+
- 产品级模板 §0 per-BC 统一语言索引(无定义列防第三真相源,唯一内容写入点 `docs/architecture/CONCEPTS.md`)+ §1 拆 1.1 子域(问题空间投资分级)/1.2 限界上下文(解空间);ch04 子域节、ch06 CONCEPTS 维护(两段拆分 + 主动纪律)、glossary 区分。
|
|
60
|
+
- O9 变更级模板 frontmatter 5 必填(mode/provenance/as_is_anchor/iteration_version/product_snapshot)+ 设计意图前置(首屏 ≤10 行)/证据下沉 evidence/ 纪律 + SKIPPED 命名统一 `.md`。
|
|
61
|
+
- **C4 代码注解扫描**(`tf arch scan-code`,唯一 A 级锚;emp-auth 只读实测 count=56 与 baseline 逐项吻合)+ P0-B' 快照只读 seed(provenance 分档仅 reverse-engineered,修投影域丢基线)。
|
|
62
|
+
|
|
63
|
+
**测试**:`npm test` 1237 → **1343**(+106:registry 24 / arch-merge O8 e2e+seed 16 / arch-template 31 / C4 28 等)+ `test:e2e` 103 全绿;反向验证 ×9;`lint:skills` 87/7 与基线逐条同。P3/P4:三批独立评审(P0-B' 2I+5m、P0-A 1C+2I+6m、全并段 3C+8I+6m)全部处置闭合;plugin-validator/skill-reviewer 双门禁过。
|
|
64
|
+
|
|
65
|
+
**行为变更**:① 带 delta 的 change 走 registry 路径(旧 change 无 delta 自动 legacy,零破坏)② `tf arch scan-code` 新命令(退出码恒 0,status=na/partial ≠ PASS)③ skip 物化新规范 `SKIPPED.md`(存量 `SKIPPED` 门禁仍识别)。**软着陆**:delta 缺失合法、v0.66.0 硬切(退出条件 = legacy 登记数归零 + 存量 change 清仓)。
|
|
66
|
+
|
|
7
67
|
## [0.64.0] - 2026-09-24
|
|
8
68
|
|
|
9
69
|
### Added(spec-superflow 2.0 同步:双前门 + 轻路径 + 轻量全局态闸门;设计 = docs/plan/spec-superflow-2.0-implementation-plan.md v2.1,P1.5 两轮独立评审 13+13 组全闭合)
|
package/GEMINI.md
CHANGED
|
@@ -8,7 +8,7 @@ The workflow is self-contained and does not require OpenSpec or Superpowers at r
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
<!-- team-flow-phase-guard-start -->
|
|
11
|
-
# team-flow v0.
|
|
11
|
+
# team-flow v0.67.0 | 阶段: {{state}} | 工作流: {{workflow}}
|
|
12
12
|
当前阶段允许的操作由 workflow-start 路由规则定义。
|
|
13
13
|
禁止跨越 DP gate 进入下一阶段。变更范围以 execution-contract.md 的 Intent Lock 为准。
|
|
14
14
|
<!-- team-flow-phase-guard-end -->
|
package/INSTALL.md
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# team-flow
|
|
2
2
|
|
|
3
|
-
> 当前版本:`v0.
|
|
3
|
+
> 当前版本:`v0.67.0`
|
|
4
4
|
|
|
5
5
|
> 统一插件:**team-flow**(spec 驱动开发)+ **compound-engineering 核心子集**(全局复利)+ **architecture-design**(4A+DDD 增量设计)+ **prototype**(本地 HTML 原型)+ **e2e**(AC 驱动 E2E)+ **workflow-orchestrator**(产品级编排)+ **workflow-bootstrap**(既有项目接入)。一次安装,十三套能力协同(详见下文「十三套能力」)。
|
|
6
6
|
|
|
@@ -87,7 +87,7 @@ artifacts: # required: list of produced files, skipped: em
|
|
|
87
87
|
- architecture/sql/migration/...
|
|
88
88
|
|
|
89
89
|
# product 模式(v0.36.0)
|
|
90
|
-
decision: completed | skipped # completed: 8 步设计完成;skipped: 迭代无结构性变更(须物化 SKIPPED
|
|
90
|
+
decision: completed | skipped # completed: 8 步设计完成;skipped: 迭代无结构性变更(须物化 SKIPPED.md 标记;存量 SKIPPED 亦识别)
|
|
91
91
|
reason: "..."
|
|
92
92
|
snapshot_path: docs/architecture/iterations/vN/architecture.md
|
|
93
93
|
verdict: pending_review # 评审门(architecture-reviewer product 视角)在产出后进行
|
|
@@ -37,13 +37,13 @@ If change_brief_path or architecture_dir is missing or unreadable **in change mo
|
|
|
37
37
|
`review_mode: product` 时(S3.5 产品级评审门),审查对象与维度适配变化:
|
|
38
38
|
|
|
39
39
|
- **审查对象**:`product_snapshot_path`(`docs/architecture/iterations/vN/architecture.md`,6 产物:Context Map / 聚合注册表 / 指令事件 / 状态机 / 概念 ER / 时序)+ `domains/` 按域详细页;**不审查** change 内三件套。
|
|
40
|
-
- **A1**:6 产物章节存在 + marker 成对 + anchor id 可解析(机械预检);**不执行** change 模式的 `test -f architecture/{architecture,database,api}.md
|
|
40
|
+
- **A1**:6 产物章节存在 + **§0 统一语言索引**(存在、per-BC 分列、表头无「定义/含义」列 —— O2 判据①②;唯一内容写入点=docs/architecture/CONCEPTS.md)+ **§1.1 子域段**(存在、与 §1.2 BC 段物理分离、每行有 Core/Supporting/Generic 分类**且业务问题列非空** —— O3 判据①②;子域描述不含 `Service`/`Impl`/包名类实现载体词 = 反例校验 O3-③)+ marker 成对 + anchor id 可解析(机械预检);**不执行** change 模式的 `test -f architecture/{architecture,database,api}.md`。**日期锚门控(§4.0 纪律 1,存量不追溯)**:快照 `established_at` < 2026-09-25,**或 `established_at` 缺失/不可解析** → 缺 §0 / §1.1 记 **WARN 不 FAIL**。
|
|
41
41
|
- **A2**:SQL/结构有效(若快照含 sql/ 引用;机械 grep)。
|
|
42
42
|
- **A3**:对照 `references/s3.5-architecture-template.md`(产品级模板),非 `templates/architecture.md`(变更级模板)。
|
|
43
43
|
- **A4**:对照 PRD 功能清单(F001_P0 逐条)→ BC/聚合/API 全覆盖映射;对照源是 PRD(非 change-brief——change-brief 是变更级输入)。
|
|
44
44
|
- **A5**:旧项目逆向重建场景对照现状代码/全局基线;正向设计场景仅检查与既有基线无矛盾。
|
|
45
45
|
- **A6**:conventions 合规(同 change 模式)。
|
|
46
|
-
- **skip 处理**:S3.5 显式跳过(`iterations/vN/SKIPPED`
|
|
46
|
+
- **skip 处理**:S3.5 显式跳过(`iterations/vN/SKIPPED.md` 标记;存量无扩展名 SKIPPED 亦识别)时本 agent 不执行。
|
|
47
47
|
- **报告落盘**:product 模式评审报告落盘 `docs/architecture/iterations/vN/auto-review.md`(非 `changes/<name>/architecture/auto-review.md`——product 模式无 change 目录)。
|
|
48
48
|
|
|
49
49
|
## 6-Dimension Checklist
|
|
@@ -143,6 +143,10 @@ Aggregate all findings and determine verdict.
|
|
|
143
143
|
|
|
144
144
|
## Output Format
|
|
145
145
|
|
|
146
|
+
**双通道协议(agent-governance P0-2,异常才上报;change/product 两模式同样适用)**:
|
|
147
|
+
1. **落盘通道**:按下方模板完整写审查报告(change 模式 = change 目录内 auto-review;**product 模式 = `docs/architecture/iterations/vN/auto-review.md`**)——**必须保留全量维度明细**(SendMessage fallback 修正链与 DP-A 人工裁定依赖落盘全量,不得删减)。
|
|
148
|
+
2. **会话输出通道**(返回派发方的消息):**先打印 Verdict 一行**(形如 `FINAL VERDICT: PASS (C0/I1/M2) — report: <落盘路径>`——标记名遵循 workflow-start 结果协议 `FINAL VERDICT:`);随后**仅当 Critical>0 或 Important>0 时**展开对应 findings;**Critical=0 且 Important=0 时只输出 Verdict 一行**,不展开 A1–A6 明细。
|
|
149
|
+
|
|
146
150
|
```markdown
|
|
147
151
|
# Architecture Auto-Review Report
|
|
148
152
|
|
|
@@ -93,6 +93,12 @@ If `prd_path` is missing or unreadable, report `FAIL` with reason `INPUT_ERROR`.
|
|
|
93
93
|
|
|
94
94
|
**(b)形态核验(v0.62.0 · G7)——判据必须同时查「形态」与「内容」**:
|
|
95
95
|
|
|
96
|
+
> **机械结果引用(agent-governance P0-1,D6)**:派发方(orchestrated 路径 = 编排层 S2;
|
|
97
|
+
> standalone 路径 = ce-brainstorm 主会话)在派发本 agent **之前**已跑 `tf prd check-clarity`
|
|
98
|
+
> (弱词 8 类 / 必需段 / §8.4 左列漂移,PASS 才会派发到此处)。若输入材料(或派发消息)携带其
|
|
99
|
+
> 输出,G7 第 1 条与精确性判级**直接引用该机械结果**(命中即记,不重复人工扫词);未携带时按下方
|
|
100
|
+
> 判据独立执行(机械结果是加速器不是前置依赖,缺了照常判)。
|
|
101
|
+
|
|
96
102
|
| # | 核验项 | 判级 |
|
|
97
103
|
|---|---|---|
|
|
98
104
|
| 1 | §8.4 是否「一功能一表 + 编号业务叙述」,且**左列为画面/入口锚点**(出现「维度 / 字段 / 类型」等技术维度名 = 违规) | Important |
|
|
@@ -123,6 +129,10 @@ Aggregate findings → final verdict per the Judgment Criteria.
|
|
|
123
129
|
|
|
124
130
|
## Output Format
|
|
125
131
|
|
|
132
|
+
**双通道协议(agent-governance P0-2,异常才上报)**:
|
|
133
|
+
1. **落盘通道**:按下方模板完整写 `requirement/{ITERATION_VERSION}/prd-completeness-review.md`——**必须保留全量维度明细**(SendMessage fallback 修正链与人工裁定依赖落盘全量,不得删减)。
|
|
134
|
+
2. **会话输出通道**(返回派发方的消息):**先打印 Verdict 一行**(形如 `FINAL VERDICT: PASS (C0/I2/M3) — report: requirement/vN/prd-completeness-review.md`——标记名遵循 workflow-start 结果协议 `FINAL VERDICT:`);随后**仅当 Critical>0 或 Important>0 时**展开对应 findings(逐条带 D 维度与定位);**Critical=0 且 Important=0 时只输出 Verdict 一行**,不展开维度明细。Minor 计数不展开。
|
|
135
|
+
|
|
126
136
|
```markdown
|
|
127
137
|
# PRD Completeness Review Report
|
|
128
138
|
|
package/agents/prd-writer.md
CHANGED
|
@@ -96,6 +96,7 @@ summary: "..." # 2-3 sentence overview + 待主会话确认
|
|
|
96
96
|
- 不写接口 / 表 / 类 / 算法等实现契约(属 change 级 spec/design)
|
|
97
97
|
- 不修改 business-analysis.md / dialogue-log.md / detail_ledger / ledger.md
|
|
98
98
|
- 不删除模板占位——无信息章节保留 `{占位}`
|
|
99
|
+
- **剥离撰写指引 blockquote**(agent-governance P0-1 模板声明同步):模板中所有 `>` 元指令指引段(「语汇/精确/完整性」「可解析性」等,含模板内 `⚠ 撰写指引剥离规则` 自身)是给撰写者的指令,**实例化时整体剥离、不写入 prd.md 正文**——指引自带弱词示例,保留会直接触发冻结前 `tf prd check-clarity` FAIL 且首版无豁免 = 死循环(剥离规则见 `templates/prd.md` §8.4 指引块)
|
|
99
100
|
- **不把维度清单写进 §8.4 正文**(无列名清单、无 checkbox 列表、无「按…维覆盖,不适用标 NA」式转述)
|
|
100
101
|
- **不写历史痕迹**:删除线、版本锚点(`v0.5ac` / `v0.47`)、「原口径作废」「已被推翻」一律不进正文
|
|
101
102
|
- **不写技术标识符**:类名 / 方法名 / 表名 / 行号不进正文主干
|
|
@@ -33,6 +33,8 @@ If `change_dir` or the contract is missing/unreadable, report `FAIL` with reason
|
|
|
33
33
|
|
|
34
34
|
## Structured Output Contract
|
|
35
35
|
|
|
36
|
+
**异常才上报(agent-governance P0-2)**:返回给编排层的会话输出 = 下方 YAML **恒返回**(`dp_6`/`dp_7` 是 `workflow-start` 发起 closing 决策的必填字段,**任何 status 下都不得删字段**——只收摘要不收明细);YAML **之后的展开明细**(逐项验证记录、writeback 过程、WARN 讨论)**仅当 `status != pass` 时输出**——`status=pass` 时省略展开块。**YAML 与展开块之外,仍按 Red Lines 协议以 `FINAL VERDICT: …` 行结尾**(本段只约束展开明细的省略,不改变终态标记要求)。落盘的 closing 总结保留全量明细(人工追溯依赖)。
|
|
37
|
+
|
|
36
38
|
Return the following YAML to the orchestration layer:
|
|
37
39
|
|
|
38
40
|
```yaml
|
package/docs/README_en.md
CHANGED
|
@@ -126,7 +126,7 @@ npm install -g team-flow
|
|
|
126
126
|
|
|
127
127
|
### Version
|
|
128
128
|
|
|
129
|
-
- Current: `v0.
|
|
129
|
+
- Current: `v0.67.0`
|
|
130
130
|
- v0.9.1 highlights: DP-4 execution-mode recommendations, a portable runtime across 17 platforms, and a raw-package smoke with no plugin-root variable.
|
|
131
131
|
- Self-contained — no OpenSpec or Superpowers runtime required
|
|
132
132
|
- Upstream: [Fission-AI/OpenSpec](https://github.com/Fission-AI/OpenSpec), [obra/superpowers](https://github.com/obra/superpowers)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# team-flow 使用说明(研发团队版)
|
|
2
2
|
|
|
3
|
-
> 版本锚点:v0.
|
|
3
|
+
> 版本锚点:v0.67.0(28 skills + 17 agents)· 更新日期:2026-09-21
|
|
4
4
|
> 读者:使用 team-flow 做日常研发的工程师。不需要你懂插件内部实现,只需要照着路径走。
|
|
5
5
|
> 配套文档:安装细节见 [INSTALL.md](../INSTALL.md);状态机细节见 [state-machine.md](state-machine.md);决策点细节见 [decision-points.md](decision-points.md);平台差异见 [platform-matrix.md](platform-matrix.md)。
|
|
6
6
|
|
|
@@ -70,7 +70,7 @@ npm install -g @xulthekl/team-flow
|
|
|
70
70
|
### 2.2 验证安装
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
|
-
tf --version # 应输出 0.
|
|
73
|
+
tf --version # 应输出 0.67.0
|
|
74
74
|
tf doctor # 体检 13 项固定 + 1 项条件:版本一致性 / plugin author / hooks / Codex manifest / skills /
|
|
75
75
|
# runtime 分发 / dist / Node 版本 / docs / change 状态 / change 测试门禁 / 架构状态 / 复利台账
|
|
76
76
|
# (末项"配置"仅在仓库根存在 team-flow.config.json 时出现)
|
|
@@ -232,14 +232,14 @@ workflow-start 在初始化时自动推断(`tf runtime infer`),你也可
|
|
|
232
232
|
tf runtime guard check <change-dir> <from-state> <to-state> [--workflow full|hotfix|tweak]
|
|
233
233
|
```
|
|
234
234
|
|
|
235
|
-
**full
|
|
235
|
+
**full 模式的完整转换矩阵**(**33 个维度** + 1 个 workflow 限制维度;v0.64.0 增 quick/lightweight/planned 轻路径 11 维;agent-governance P1-1 增 **prd-clarity / history-risk** 接活前双维度——**无记录/INDEX 空的冷启动场景**零行为变化;INDEX 积累丰富的项目 history-risk 命中即阻断,属该维 experimental 设计而非回归):
|
|
236
236
|
|
|
237
237
|
| 转换 | 维度 |
|
|
238
238
|
|------|------|
|
|
239
239
|
| exploring→specifying | arch-design、arch-readiness |
|
|
240
240
|
| specifying→bridging | artifacts-exist、schema-valid |
|
|
241
|
-
| bridging→approved-for-build | artifacts-exist、schema-valid、contract-fresh、dp-gate-passed、dp3-approved、**gates-probed**(v0.63.0) |
|
|
242
|
-
| approved-for-build→executing | artifacts-exist、contract-fresh、dp-gate-passed、execution-plan-ready、test-matrix-ready |
|
|
241
|
+
| bridging→approved-for-build | artifacts-exist、schema-valid、contract-fresh、dp-gate-passed、dp3-approved、**gates-probed**(v0.63.0)、**prd-clarity**、**history-risk**(P1-1) |
|
|
242
|
+
| approved-for-build→executing | artifacts-exist、contract-fresh、dp-gate-passed、execution-plan-ready、test-matrix-ready、**prd-clarity**、**history-risk**(P1-1) |
|
|
243
243
|
| **executing→closing** | **11 维**:**contract-fresh(v0.63.0)**、tasks-complete、tests-passing、specs-merged、execution-plan-ready、execution-reviews-passed、compound-captured、test-matrix-complete、arch-snapshot、delegation-status、arch-merged |
|
|
244
244
|
| executing↔debugging | debugging 入口无门禁;回 executing 挂 contract-fresh、execution-plan-ready |
|
|
245
245
|
| exploring→bridging / exploring→approved-for-build | 0 维,但**一一对应**:`exploring→bridging` 仅 hotfix 可走、`exploring→approved-for-build` 仅 tweak 可走;full 走或其他组合都直接 FAIL |
|
|
@@ -263,6 +263,8 @@ tf runtime guard check <change-dir> <from-state> <to-state> [--workflow full|hot
|
|
|
263
263
|
| arch-merged | executing→closing | 架构增量未回写全局台账 → **先跑 `tf arch-merge <change-dir>` 再转换**(v0.53.0 B' 时序);确无增量可回写时 `tf state set <dir> arch_merge_skipped true` + `arch_merge_skip_reason` |
|
|
264
264
|
| delegation-status | executing→closing | 非 glaf4-delegation 模式直接 PASS;该模式须 `delegation_status=success` |
|
|
265
265
|
| artifacts-exist / schema-valid | specifying→bridging 起 | 四件套缺失或 Validator 不通过(SHALL/MUST、Scenario、跨段冲突) |
|
|
266
|
+
| prd-clarity | 接活前(bridging→approved / approved→executing,quick/lightweight/planned 前门) | 产品级 PRD 清晰度记录为 fail → 回 S2 重跑 `tf prd check-clarity` 修至 PASS 后重建 change;无记录 = 中性放行(存量/direct/hotfix) |
|
|
267
|
+
| history-risk | 同上(experimental) | solutions INDEX 中**按 change 名词根匹配**的条目 N≥3 且最高 severity=critical → 阻断。**出路(改数据源头,无 state 确认通道)**:① 坑已根治 → 按 compound 退役/降档处理相关条目后重建 INDEX;② 误关联 → 调整 change 名避开词根。N<3 / INDEX 空 / 无匹配 = 中性 |
|
|
266
268
|
|
|
267
269
|
**设计哲学**:门禁硬,但**可豁免的维度都有留痕出口,不可豁免的维度只能改产物**——这点要分清,不要以为万事都能绕:
|
|
268
270
|
|
|
@@ -752,4 +754,4 @@ tf runtime guard check <change-dir> <from> <to> --json
|
|
|
752
754
|
|
|
753
755
|
---
|
|
754
756
|
|
|
755
|
-
*本文档基于 v0.60.0 源码全量核对产出(2026-09-13
|
|
757
|
+
*本文档基于 v0.60.0 源码全量核对产出(2026-09-13 同步),v0.67.0 增量同步 agent-governance 改动(33 维矩阵 / prd-clarity·history-risk 出路 / 复利注入与见习门控,2026-09-25)。发现与实际行为不符,请 `/team-flow:workflow-feedback` 反馈——这正是本插件的演进方式。*
|
package/gemini-extension.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "team-flow",
|
|
3
3
|
"description": "Unified workflow plugin: team-flow (spec-driven dev) + compound-engineering core subset + architecture-design (4A/DDD) + prototype (local HTML) + business-analysis (independent requirement/scenario artifact) + jarvis (team-flow decision agent, opt-in). 28 skills, one install.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.67.0",
|
|
5
5
|
"contextFileName": "GEMINI.md"
|
|
6
6
|
}
|
package/hooks/session-start
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
|
-
# v0.
|
|
2
|
+
# v0.67.0: auto-sync CLI version with plugin version
|
|
3
3
|
set -e
|
|
4
4
|
|
|
5
5
|
# ═══════════════════════════════════════════════════════════════
|
|
6
6
|
# Plugin version (update this when releasing new versions)
|
|
7
7
|
# ═══════════════════════════════════════════════════════════════
|
|
8
|
-
PLUGIN_VERSION="0.
|
|
8
|
+
PLUGIN_VERSION="0.67.0"
|
|
9
9
|
|
|
10
10
|
# ═══════════════════════════════════════════════════════════════
|
|
11
11
|
# Step 1: Auto-sync CLI version with plugin version
|
package/llms.txt
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## Overview
|
|
4
4
|
spec-superflow is a self-contained workflow integration plugin for Claude Code, Cursor, OpenAI Codex CLI/App, GitHub Copilot CLI, Gemini CLI, OpenCode, WorkBuddy, and Trae. It merges spec-driven planning artifacts (proposal, specs, design, tasks) with disciplined execution guardrails (TDD, review gates, controlled handoff) into one unified workflow.
|
|
5
5
|
|
|
6
|
-
Current version: v0.
|
|
6
|
+
Current version: v0.67.0.
|
|
7
7
|
|
|
8
8
|
## Key Documents
|
|
9
9
|
- README.md: Chinese homepage with full usage guide and FAQ
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xulthekl/team-flow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.0",
|
|
4
4
|
"description": "Unified plugin (28 skills + 17 agents) integrating team-flow, compound-engineering, architecture-design, prototype, design-system, workflow-orchestrator, workflow-bootstrap, e2e, session-handoff, workflow-feedback, business-analysis for multi-agent coding tools.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
package/plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "team-flow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.0",
|
|
4
4
|
"description": "Unified workflow plugin: team-flow (spec-driven dev: TDD/SDD/code-review/debugging) + compound-engineering core subset (brainstorm/plan/compound/strategy/ideate/proof, global compounding) + architecture-design (4A+DDD incremental design & global compounding) + prototype (local HTML prototype, zero external deps) + e2e (Playwright E2E, AC-driven) + workflow-orchestrator (product-level workflow orchestration) + workflow-bootstrap (existing project onboarding) + session-handoff (context transfer) + workflow-feedback (issue tracking) + business-analysis (independent requirement/scenario artifact) + design-system (design tokens + component contract + AI primer + showcase) + test-strategy (test strategy design) + project-initialize (new service onboarding) + jarvis (team-flow decision agent, opt-in). 28 skills + 17 agents, one install.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "LT"
|
package/prd/v1/prd.md
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
| L1流程分类 | L2流程分组 | L3业务流程 | L4子流程 | 利益相关 | 价值描述 | 流程名称 | 流程描述 | 变更类型 | 关联系统 | 关联需求编号 | 备注 |
|
|
25
25
|
|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
26
26
|
| 研发工作流 | 协作协议层 | TF-COLLAB-001 | / | 开发团队 | 统一 skill 间数据流转和衔接 | Skill 协作协议流程 | 为 17 个 skill 建立声明式 Schema + Handoff 模板协作机制 | 新增 | team-flow plugin | TF-2026-001 | 覆盖四套子系统 |
|
|
27
|
-
| 研发工作流 | 协作协议层 | TF-COLLAB-001 | TF-COLLAB-001-S1 | 开发团队 | PRD 产出标准化 | PRD 对齐子流程 | ce-brainstorm 产出 PRD 格式到 prd/vN/prd.md
|
|
27
|
+
| 研发工作流 | 协作协议层 | TF-COLLAB-001 | TF-COLLAB-001-S1 | 开发团队 | PRD 产出标准化 | PRD 对齐子流程 | ce-brainstorm 产出 PRD 格式到 prd/vN/prd.md,模板可配置 | 新增 | ce-brainstorm skill | TF-2026-001-S1 | Phase 1 交付物 |
|
|
28
28
|
| 研发工作流 | 协作协议层 | TF-COLLAB-001 | TF-COLLAB-001-S2 | 开发团队 | 工件契约机器可解析 | Schema 协议子流程 | 每个 skill 声明 input/output schema,建立工件契约 | 新增 | 全部 17 个 skill | TF-2026-001-S2 | Phase 2 交付物 |
|
|
29
29
|
| 研发工作流 | 协作协议层 | TF-COLLAB-001 | TF-COLLAB-001-S3 | 开发团队 | 决策点交互优化 | Handoff + DP 优化子流程 | 标准化 handoff 文件,优化 8 个 DP 信息展示 | 新增 | DP-0 ~ DP-7 | TF-2026-001-S3 | Phase 3 交付物 |
|
|
30
30
|
|
|
@@ -61,13 +61,15 @@ export function findLatestIterationDir(root) {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* skip 物化检查:只认最新迭代目录的
|
|
64
|
+
* skip 物化检查:只认最新迭代目录的 skip 标记(v0.36.3 修复——防旧迭代陈旧标记
|
|
65
65
|
* 错误豁免新迭代的结构性变更,P3 原则要防的失效模式)。
|
|
66
|
+
* ★ 命名双形态识别(P3 C-3 / O9 B8):写侧新规范统一 `SKIPPED.md`(s3.5 SOP + orchestrator),
|
|
67
|
+
* 存量有无扩展名 `SKIPPED`(emp-auth v2/v3)——读侧两态皆认,防新规范物化后门禁不可见卡死。
|
|
66
68
|
*/
|
|
67
69
|
export function isArchSkipMaterialized(root) {
|
|
68
70
|
const latest = findLatestIterationDir(root);
|
|
69
71
|
if (!latest) return false;
|
|
70
|
-
return fs.existsSync(path.join(latest, 'SKIPPED'));
|
|
72
|
+
return fs.existsSync(path.join(latest, 'SKIPPED.md')) || fs.existsSync(path.join(latest, 'SKIPPED'));
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
/** 最近一个迭代的产品级架构快照路径(iterations/<latest>/architecture.md)。不存在 → null。 */
|
|
@@ -80,4 +82,4 @@ export function findLatestIterationSnapshot(root) {
|
|
|
80
82
|
|
|
81
83
|
export const ARCH_READINESS_FAIL_HINT =
|
|
82
84
|
'iterations/<vN>/architecture.md missing — 回 ARCH 阶段补快照,'
|
|
83
|
-
+ '或显式 skip 物化(iterations/<vN>/SKIPPED 标记 +
|
|
85
|
+
+ '或显式 skip 物化(iterations/<vN>/SKIPPED.md 标记 + 理由;存量 SKIPPED 亦识别)';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
// 规则:
|
|
5
5
|
// - arch_baseline == null(存量/重建未完成)→ PASS + WARN(不阻断,项目级豁免,P3 留逃生舱)
|
|
6
|
-
// - skip 已物化(iterations/vN/SKIPPED)→ PASS
|
|
6
|
+
// - skip 已物化(iterations/vN/SKIPPED.md;存量 SKIPPED 亦识别——双态见 arch-gate-exemptions)→ PASS
|
|
7
7
|
// - iterations/<latest>/architecture.md 存在 → PASS
|
|
8
8
|
// - 否则 → FAIL,引导回 ARCH 补快照或显式 skip
|
|
9
9
|
import {
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
//
|
|
4
4
|
// v0.53.0 注释修正:原写「(先于 arch-merge)」。B' 方案(设计增强方案 v0.25 §110)已把
|
|
5
5
|
// arch-merge 前移到本转换**之前**执行,"先于 arch-merge"不再成立。二者现同挂本转换且
|
|
6
|
-
// **无数据依赖**:本 check 只读 `docs/architecture/iterations
|
|
7
|
-
//
|
|
6
|
+
// **无数据依赖**:本 check 只读 `docs/architecture/iterations/`;arch-merge 自 P0-B'-① 起
|
|
7
|
+
// (ddd-purity-and-arch-merge-design v1.5)**只读不写**该目录(seedFromSnapshots 读快照聚合),
|
|
8
|
+
// 不构成数据依赖(P3 MIN-1:原「arch-merge 全流程不触碰该目录(已逐行核对)」已过期)。
|
|
9
|
+
// "先快照后回写"仍是语义前提(快照在 ARCH 阶段产出,早于整个 closing)。
|
|
8
10
|
//
|
|
9
11
|
// 规则:
|
|
10
12
|
// - arch_baseline == null(在途/存量)→ PASS + WARN(legacy 豁免)
|
|
11
|
-
// - skip 已物化(iterations/vN/SKIPPED)→ PASS
|
|
13
|
+
// - skip 已物化(iterations/vN/SKIPPED.md;存量 SKIPPED 亦识别——双态见 arch-gate-exemptions)→ PASS
|
|
12
14
|
// - iterations/<latest>/architecture.md 存在 → PASS
|
|
13
15
|
// - 否则 → FAIL
|
|
14
16
|
//
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// scripts/guard/checks/history-risk.mjs — 变更级历史履历维度(agent-governance P1-1,experimental)
|
|
2
|
+
//
|
|
3
|
+
// 三维路由(风险 × 清晰度 × 履历)的履历维。设计要点(memo §3.2 v0.5 / plan §6 v1.2):
|
|
4
|
+
//
|
|
5
|
+
// 1. **信号方向**:数据源 = compound solutions INDEX(severity 列)+ 条目 frontmatter
|
|
6
|
+
// (confirmations)。`confirmations` 源语义是**复发信号**(每来源 change 升一档 severity,
|
|
7
|
+
// solutions-promote.mjs)——**不得当"履历好"正向分**。本 runner 取
|
|
8
|
+
// 「相关条目最高 severity」作风险信号:复发越重 → severity 越高 → 越阻断。
|
|
9
|
+
//
|
|
10
|
+
// 2. **任务→条目映射**:change_name 分词(去纯数字段/日期段)与 INDEX 的 domain/summary
|
|
11
|
+
// 关键词匹配。词根为空或无匹配 = 无法关联 = 中性(不是低风险判定)。
|
|
12
|
+
//
|
|
13
|
+
// 3. **最小样本规则(反方 I5)**:相关条目 **N < 3 → 中性**——1 条 critical 不得永久压制全域
|
|
14
|
+
// (severity 只升不降 + 退役语义是 compound-lifecycle P2 待决策,恢复路径未建,
|
|
15
|
+
// 故以样本量作压制闸)。N ≥ 3 且最高 severity = critical → **FAIL(强制 HITL)**。
|
|
16
|
+
//
|
|
17
|
+
// 4. **缺失态**:INDEX 不存在 / 空表(本仓冷启动现状)→ 中性 PASS,零行为变化。
|
|
18
|
+
//
|
|
19
|
+
// experimental 绑定行为:命中即阻断(= 强制 HITL)并带 reason 留痕(非纯标签)。
|
|
20
|
+
// 首版为保守方向的有意代价(压制恢复路径待退役语义立项,plan §12)。
|
|
21
|
+
import fs from 'node:fs';
|
|
22
|
+
import path from 'node:path';
|
|
23
|
+
|
|
24
|
+
const MIN_SAMPLE = 3;
|
|
25
|
+
const BLOCK_SEVERITY = 'critical';
|
|
26
|
+
const SEVERITY_ORDER = ['low', 'medium', 'high', 'critical'];
|
|
27
|
+
|
|
28
|
+
/** 自 changeDir 向上定位含 docs/solutions/INDEX.md 的工作区根(限 6 层)。 */
|
|
29
|
+
export function findSolutionsIndex(changeDir) {
|
|
30
|
+
let dir = path.resolve(changeDir);
|
|
31
|
+
for (let i = 0; i < 6; i += 1) {
|
|
32
|
+
const idx = path.join(dir, 'docs', 'solutions', 'INDEX.md');
|
|
33
|
+
if (fs.existsSync(idx)) return idx;
|
|
34
|
+
const parent = path.dirname(dir);
|
|
35
|
+
if (parent === dir) break;
|
|
36
|
+
dir = parent;
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* 解析 INDEX 表数据行 → [{phase, domain, severity, summary, source}]。
|
|
43
|
+
* 列:| date | phase | domain | type | severity | summary | file | source(可选) |
|
|
44
|
+
*/
|
|
45
|
+
export function parseIndexRows(indexText) {
|
|
46
|
+
const rows = [];
|
|
47
|
+
for (const line of indexText.split(/\r?\n/)) {
|
|
48
|
+
if (!line.trim().startsWith('|')) continue;
|
|
49
|
+
const cells = line.split('|').map((c) => c.trim());
|
|
50
|
+
// cells[0] === '',数据列从 index 1 起
|
|
51
|
+
const phase = cells[2] || '';
|
|
52
|
+
const domain = cells[3] || '';
|
|
53
|
+
const severity = (cells[5] || '').toLowerCase();
|
|
54
|
+
const summary = cells[6] || '';
|
|
55
|
+
const source = cells[8] || '';
|
|
56
|
+
if (!phase || phase.toLowerCase() === 'phase') continue; // 表头
|
|
57
|
+
if (/^-+$/.test(phase)) continue; // 分隔行
|
|
58
|
+
if (!severity || !SEVERITY_ORDER.includes(severity)) continue; // 坏行丢弃(与 inject 同策略)
|
|
59
|
+
rows.push({ phase, domain, severity, summary, source });
|
|
60
|
+
}
|
|
61
|
+
return rows;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 通用词黑名单:change 名里的流程词会命中 INDEX 的 source 列(来源 change 名)与
|
|
65
|
+
// 任意 summary(如 'change' 命中一切 source='…-change-…'),造成全表误关联 → N 虚高。
|
|
66
|
+
const GENERIC_WORDS = new Set([
|
|
67
|
+
'change', 'feature', 'fixing', 'fixed', 'update', 'upgrade', 'release',
|
|
68
|
+
'version', 'branch', 'story', 'task', 'batch', 'patch', 'review',
|
|
69
|
+
]);
|
|
70
|
+
|
|
71
|
+
/** change_name → 匹配词根(去数字段/日期段/通用流程词,长度 ≥ 4 的词)。 */
|
|
72
|
+
export function changeKeywords(changeName) {
|
|
73
|
+
return String(changeName || '')
|
|
74
|
+
.split(/[-_\s]+/)
|
|
75
|
+
.filter((w) => w.length >= 4 && !/^\d+$/.test(w) && !GENERIC_WORDS.has(w.toLowerCase()))
|
|
76
|
+
.map((w) => w.toLowerCase());
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function checkHistoryRisk(changeDir) {
|
|
80
|
+
const indexFile = findSolutionsIndex(changeDir);
|
|
81
|
+
if (!indexFile) {
|
|
82
|
+
return { pass: true, failures: [], reason: 'no solutions INDEX (neutral — 冷启动)' };
|
|
83
|
+
}
|
|
84
|
+
const rows = parseIndexRows(fs.readFileSync(indexFile, 'utf-8'));
|
|
85
|
+
if (rows.length === 0) {
|
|
86
|
+
return { pass: true, failures: [], reason: 'INDEX empty (neutral — 冷启动)' };
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const changeName = path.basename(path.resolve(changeDir));
|
|
90
|
+
const keys = changeKeywords(changeName);
|
|
91
|
+
if (keys.length === 0) {
|
|
92
|
+
return { pass: true, failures: [], reason: `no matchable keywords in change name '${changeName}' (neutral)` };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const related = rows.filter((r) => {
|
|
96
|
+
const hay = `${r.domain} ${r.summary} ${r.source}`.toLowerCase();
|
|
97
|
+
return keys.some((k) => hay.includes(k));
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
if (related.length < MIN_SAMPLE) {
|
|
101
|
+
return {
|
|
102
|
+
pass: true,
|
|
103
|
+
failures: [],
|
|
104
|
+
reason: `related entries N=${related.length} < ${MIN_SAMPLE} (neutral — 最小样本规则,单条不压制)`,
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const worst = related.reduce(
|
|
109
|
+
(acc, r) => (SEVERITY_ORDER.indexOf(r.severity) > SEVERITY_ORDER.indexOf(acc) ? r.severity : acc),
|
|
110
|
+
'low',
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
if (worst === BLOCK_SEVERITY) {
|
|
114
|
+
const samples = related.filter((r) => r.severity === BLOCK_SEVERITY).slice(0, 3)
|
|
115
|
+
.map((r) => `"${r.summary}"`).join('; ');
|
|
116
|
+
return {
|
|
117
|
+
pass: false,
|
|
118
|
+
failures: [
|
|
119
|
+
`history risk: ${related.length} related solution entries (N≥${MIN_SAMPLE}), worst severity=critical — ${samples}.`,
|
|
120
|
+
// 如实声明补救通道(P4 skill-reviewer M3:本维度只读 INDEX 不读 state,无 state 确认落点)
|
|
121
|
+
'出路(均改数据源头,无 state 确认通道):① 坑已根治 → 按 compound 退役/降档流程处理相关条目后重建 INDEX;'
|
|
122
|
+
+ '② 误关联(change 名词根撞车)→ 调整 change 名避开匹配。确认前该转换保持阻断(experimental 保守方向的有意代价)。',
|
|
123
|
+
],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
pass: true,
|
|
129
|
+
failures: [],
|
|
130
|
+
reason: `related N=${related.length}, worst severity=${worst} (below block threshold)`,
|
|
131
|
+
};
|
|
132
|
+
}
|