@xulthekl/team-flow 0.63.0 → 0.65.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/.github/workflows/ci.yml +2 -0
- package/CHANGELOG.md +57 -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 +2 -2
- package/docs/README_en.md +1 -1
- package/docs/state-machine.md +4 -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" +2 -2
- 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/scripts/guard/checks/_fs-utils.mjs +18 -0
- package/scripts/guard/checks/arch-design-light.mjs +39 -0
- package/scripts/guard/checks/arch-gate-exemptions.mjs +5 -3
- package/scripts/guard/checks/arch-merged-light.mjs +67 -0
- package/scripts/guard/checks/arch-readiness.mjs +1 -1
- package/scripts/guard/checks/arch-snapshot-light.mjs +30 -0
- package/scripts/guard/checks/arch-snapshot.mjs +5 -3
- package/scripts/guard/checks/artifacts-planned.mjs +38 -0
- package/scripts/guard/checks/compound-writeback-light.mjs +45 -0
- package/scripts/guard/checks/cross-change-consistency-light.mjs +75 -0
- package/scripts/guard/checks/direct-short-path.mjs +52 -0
- package/scripts/guard/checks/direct-test-result.mjs +30 -0
- package/scripts/guard/checks/execution-plan-ready.mjs +7 -1
- package/scripts/guard/checks/execution-reviews-passed-light.mjs +28 -0
- package/scripts/guard/checks/lightweight-completion-evidence.mjs +27 -0
- package/scripts/guard/checks/specs-merged.mjs +25 -1
- package/scripts/guard/checks/test-matrix-complete.mjs +27 -1
- package/scripts/guard/checks/test-matrix-ready.mjs +28 -1
- package/scripts/guard/checks/test-merged-light.mjs +36 -0
- package/scripts/guard/guard.mjs +102 -12
- package/scripts/infer-workflow.mjs +35 -4
- package/scripts/lib/arch-merge.mjs +404 -54
- 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 +1 -1
- package/scripts/lib/cmd-execution.mjs +44 -1
- package/scripts/lib/cmd-state.mjs +94 -4
- package/scripts/lib/config-loader.mjs +20 -0
- package/scripts/lib/execution-plan.mjs +3 -1
- package/scripts/lib/state-loader.mjs +43 -0
- package/scripts/lib/surface-scan.mjs +156 -0
- package/scripts/lib/test-merge.mjs +10 -2
- package/scripts/team-flow.mjs +6 -3
- 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-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/clean-code/SKILL.md +1 -1
- package/skills/jarvis/SKILL.md +2 -0
- package/skills/release-archivist/SKILL.md +60 -13
- package/skills/release-archivist/references/closing-procedures.md +1 -1
- package/skills/session-handoff/SKILL.md +1 -0
- package/skills/test-strategy/SKILL.md +1 -1
- package/skills/workflow-orchestrator/SKILL.md +2 -2
- package/skills/workflow-start/SKILL.md +63 -5
- package/skills/workflow-start/references/routing-rules.md +4 -4
|
@@ -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.65.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.65.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.65.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.65.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.65.0",
|
|
16
16
|
"source": ".",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "LT",
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -24,6 +24,7 @@ jobs:
|
|
|
24
24
|
- run: npm ci
|
|
25
25
|
- run: npm run build
|
|
26
26
|
- run: npm test
|
|
27
|
+
- run: npm run test:e2e
|
|
27
28
|
- name: Check version consistency
|
|
28
29
|
run: node scripts/check-version-consistency.mjs
|
|
29
30
|
- name: CLI smoke
|
|
@@ -83,6 +84,7 @@ jobs:
|
|
|
83
84
|
- run: npm ci
|
|
84
85
|
- run: npm run build
|
|
85
86
|
- run: npm test
|
|
87
|
+
- run: npm run test:e2e
|
|
86
88
|
- name: Check version consistency
|
|
87
89
|
run: node scripts/check-version-consistency.mjs
|
|
88
90
|
- name: Token efficiency lint (warning only)
|
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,63 @@ 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.65.0] - 2026-09-25
|
|
8
|
+
|
|
9
|
+
### Added(DDD 纯度 + 架构回写机制重构:O1–O9 全量落地;设计 = docs/plan/ddd-purity-and-arch-merge-design.md v1.5,P1.5 完整档 3 轮闭合 + 三批 P3/P4 独立评审全处置)
|
|
10
|
+
|
|
11
|
+
**O8 · 回写机制两段式重构(本版核心,registry 持久化 + 软着陆双路径)**
|
|
12
|
+
- 新增 `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**(写不出好过写出坏文件)+ 内容级幂等(时间戳不刷不写盘)。
|
|
13
|
+
- `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** 分界。
|
|
14
|
+
- `touchedFiles` 白名单追加 `.registry/`(登记永不 commit 修复);守恒断言 C2(B 级下界,有触发正例)/C3(半级)挂 merge;C4 运行时与 doctor 维度归 M1–M3 存量迁移批(待授权)。
|
|
15
|
+
- release-archivist 新增 **①-pre 语义段**(delta 产出纪律:evidence/reason 必填两类别、补种边界、R3-3、软着陆→硬切时点);planned ⚠ 块回指。
|
|
16
|
+
- 守卫横展:SKIPPED 物化**双形态识别**(新规范 `SKIPPED.md` + 存量 `SKIPPED`——arch-readiness/arch-snapshot/cmd-doctor 同步,防新规范卡死硬门)。
|
|
17
|
+
|
|
18
|
+
**O4/O5/O6/O7 · 设计层模板**
|
|
19
|
+
- O4 事件 schema 版本策略门禁(产品级 §3.2:major/minor/tombstone + 必填版本字段 → 评审阻塞 + 消费侧 upcasting)+ 变更级模板 §2.5 独立领域事件表(schema 版本/兼容级别列)。
|
|
20
|
+
- O7 Context Map **6→经典 8 模式**(+Partnership +Published Language)+ 新 `references/context-map-8.md`(模式表 + 决策流 Mermaid + CML NO-GO);ch04 F5 / SKILL F5 / 产品级枚举四处同步(教=用)。
|
|
21
|
+
- O5 新 `references/ddd-evented-playbook.md`(Saga 补偿矩阵 / Projection 重建 staging 优先 / 幂等键;设计层 ONLY 不生成代码)。
|
|
22
|
+
- O6 新 `references/adr-templates.md`(MADR/轻量/Y-Statement/废弃/RFC 五模板 + 三条件防泛滥 + replan_log 可机读唯一落点,不另起 `docs/adr/`);架构修订决策门接入。
|
|
23
|
+
|
|
24
|
+
**O1 · DDD 深度 advisory**
|
|
25
|
+
- SKILL 判定链新增 advisory 段(五项检查之前;领域复杂度三判据、禁 4 选 2 硬阈值)+ 结构化输出契约 `ddd_depth: full|lightweight` 与 `decision` **正交**(任意组合合法、禁推导);**红牌 `lightweight ≠ skipped` + 第 4/5 项(API/DB)不短路**;两条规则文本 lint 测试锁定(明示非行为护栏)。
|
|
26
|
+
|
|
27
|
+
**O2/O3 · 战略层(前批)+ O9 可读性**
|
|
28
|
+
- 产品级模板 §0 per-BC 统一语言索引(无定义列防第三真相源,唯一内容写入点 `docs/architecture/CONCEPTS.md`)+ §1 拆 1.1 子域(问题空间投资分级)/1.2 限界上下文(解空间);ch04 子域节、ch06 CONCEPTS 维护(两段拆分 + 主动纪律)、glossary 区分。
|
|
29
|
+
- O9 变更级模板 frontmatter 5 必填(mode/provenance/as_is_anchor/iteration_version/product_snapshot)+ 设计意图前置(首屏 ≤10 行)/证据下沉 evidence/ 纪律 + SKIPPED 命名统一 `.md`。
|
|
30
|
+
- **C4 代码注解扫描**(`tf arch scan-code`,唯一 A 级锚;emp-auth 只读实测 count=56 与 baseline 逐项吻合)+ P0-B' 快照只读 seed(provenance 分档仅 reverse-engineered,修投影域丢基线)。
|
|
31
|
+
|
|
32
|
+
**测试**:`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 双门禁过。
|
|
33
|
+
|
|
34
|
+
**行为变更**:① 带 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 清仓)。
|
|
35
|
+
|
|
36
|
+
## [0.64.0] - 2026-09-24
|
|
37
|
+
|
|
38
|
+
### Added(spec-superflow 2.0 同步:双前门 + 轻路径 + 轻量全局态闸门;设计 = docs/plan/spec-superflow-2.0-implementation-plan.md v2.1,P1.5 两轮独立评审 13+13 组全闭合)
|
|
39
|
+
|
|
40
|
+
**双前门(`workflow_variant` 与 `workflow` 正交)**
|
|
41
|
+
- direct(→`quick`):零文档零契约,`exploring→approved-for-build→executing→closing` 捷径;planned(→`full`):proposal+tasks 两份 + `tf execution plan --derive`(tasks.md 派生单 wave,免 recommend/receipt/DP-4)+ 一次最终审查。
|
|
42
|
+
- legacy/null 走既有全量流程零破坏(null≡legacy + TTY 单次提示 / headless 不挂起);`workflow` 枚举扩为五值(+`quick`/`lightweight`)。
|
|
43
|
+
- 新子命令:`tf state upgrade <dir> <planned|full>`(升档唯一机械入口:方向向上 + `variant_source=upgrade` + 回退 approved-for-build + 重算 hash;**降档拒绝**)。
|
|
44
|
+
- 新 CLI 参数:`tf execution plan --derive`、`tf arch-merge --light`、`tf test-merge --light`(changelog 归因锚 `change:<name>`)、guard `--workflow-variant`/`--planned-arch`。
|
|
45
|
+
|
|
46
|
+
**11 个新 guard 维度(CHECK_RUNNERS 20→31)+ 共享扫描层**
|
|
47
|
+
- `surface-scan.mjs`:三源合并(committed diff + 工作区 + untracked)+ `base_sha` 基线(缺省 origin merge-base,再缺 fail-closed)+ 架构 surface 路径模式表 + `.team-flow/aggregate-dirs.txt` 聚合清单(**缺失 FAIL,显式空文件 = 确认无聚合**)+ `.team-flow/scan-ignore` 排除。
|
|
48
|
+
- direct 侧:`direct-short-path`(碰 API/DB/聚合 → FAIL+升档指引,G1)、`direct-test-result`/`lightweight-completion-evidence`(只读 `tf test record` 程序化证据,guard 不现场跑测试)。
|
|
49
|
+
- planned 侧 closing「轻回写四灯」:`arch-merged-light`(同 sink:最小 architecture.md/api.md/database.md 持久源 + 全局台账 `change:<name>` 归因)、`compound-writeback-light`(禁 `compound_skipped` 自清)、`test-merged-light`、`cross-change-consistency-light`(**确定性扫描 runner**,语义级仍由 checker agent 兜底)+ `execution-reviews-passed-light`(≥5 行内容契约)+ `artifacts-planned`(proposal≥10 行 + checkbox,反空壳)+ `arch-design-light`/`arch-snapshot-light`(`planned_arch=true` 条件挂载)。
|
|
50
|
+
- 既有 4 维加轻分支:`test-matrix-ready/complete` 无契约轻判据(D4)、`execution-plan-ready` planned 豁免 DP-4、`specs-merged` planned 无 specs 即过/有 specs 无 delta 头 FAIL。
|
|
51
|
+
|
|
52
|
+
**状态机 schema(三环齐全)**
|
|
53
|
+
- `workflow_variant` / `variant_source` / `variant_direction` / `planned_arch` / `model_profile`(接入既有 `models` 键四档,非新配置)/ `base_sha` / `arch_design_light_skipped(+reason)`;`workflow_variant` 经 `tf state set` 通用通道**仅 exploring 态可写**。
|
|
54
|
+
|
|
55
|
+
**SKILL 层**
|
|
56
|
+
- workflow-start:Front Doors 三分支路由 + infer 双通道(`suggested_path` 绝不写入 workflow;arch 信号→建议 planned 而非 full)+ 架构门/Guardrails 按 variant 分叉(direct/planned 结构性不经 `exploring:specifying`,Q3 零代码满足的限定条件落地)。
|
|
57
|
+
- release-archivist:关门序列按 variant 三分叉(planned 回写+审查全前置、transition 最后——防 closing 维度死锁;direct 仅 transition)+ Verdict 新增 **ACCEPTED-RISK**(仅非 guard 维度、禁自判、不伪造通过、不自动合并)。
|
|
58
|
+
- jarvis/session-handoff:variant 回显;test-strategy/clean-code description 收紧(§3.8 静态复核)。
|
|
59
|
+
|
|
60
|
+
**测试(npm test 1237 + test:e2e 103 全绿;CI 补 `npm run test:e2e` 步骤)**
|
|
61
|
+
- `light-paths.test.mjs`(21 用例,每新维度正/负例)、`light-merge-survival.test.mjs`(D8 same-sink 存活三断言:marker 聚合行 + 演进归因 + API 端点经 full merge 存活)、`light-pilot.test.mjs`(P7 双路径真实 CLI 全链 + 升档/禁降档试点)。
|
|
62
|
+
- e2e test-matrix 登记 L1–L5。
|
|
63
|
+
|
|
7
64
|
## [0.63.0] - 2026-09-23
|
|
8
65
|
|
|
9
66
|
### Added(sop-flow 效率八项改进 S1–S6 + E1/E2;来源:emp-auth workflow-feedback 20260923-013114,经 308 行独立专家评审定稿)
|
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.65.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.65.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
|
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.65.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)
|
package/docs/state-machine.md
CHANGED
|
@@ -112,6 +112,8 @@ eight core states.
|
|
|
112
112
|
exploring ──── hotfix ─────────> bridging (fast-path)
|
|
113
113
|
bridging ──── hotfix ─────────> approved-for-build
|
|
114
114
|
exploring ──── tweak ──────────> approved-for-build (fast-path)
|
|
115
|
+
exploring ──── quick/lightweight ─> approved-for-build > executing > closing (direct 前门, v0.64.0)
|
|
116
|
+
exploring ──── full+planned ───> approved-for-build > executing > closing (planned 前门, v0.64.0)
|
|
115
117
|
|
|
116
118
|
exploring -> specifying -> bridging -> approved-for-build -> executing -> closing
|
|
117
119
|
^ ^ | ^ |
|
|
@@ -159,4 +161,5 @@ If the contract changed, the artifacts changed.
|
|
|
159
161
|
- `hotfix` follows `exploring -> bridging -> approved-for-build -> executing`.
|
|
160
162
|
- `hotfix` may skip full planning artifacts such as `proposal.md`, `design.md`, and `specs/`; `tasks.md` requires an explicit `tasks_skipped=true` + `tasks_skip_reason` (v0.22 §85) rather than a silent skip. The key is rejected for `full`/`auto` workflows — declare the mode first (`tf state set <dir> workflow hotfix|tweak`) or produce `tasks.md`.
|
|
161
163
|
- `hotfix` still requires a fresh minimal `execution-contract.md` and explicit DP-3 approval before implementation.
|
|
162
|
-
- `tweak`
|
|
164
|
+
- `tweak` is **no longer the only** path from `exploring` to `approved-for-build` (v0.64.0)——`quick`/`lightweight`(direct 前门)与 `full`+`workflow_variant=planned`(planned 前门)同样走该捷径,维度表分别由 `QUICK_TRANSITION_CHECKS` / `PLANNED_TRANSITION_CHECKS` 管辖(见 workflow-start SKILL「Front Doors」与 guard.mjs)。`workflow_variant` 与 `workflow` 是两个正交维度:direct→`quick`、planned→`full`,**不是 workflow 取值**。
|
|
165
|
+
- 升档唯一机械入口 `tf state upgrade <dir> <planned|full>`(方向向上 + `variant_source=upgrade`;降档拒绝)。`executing → debugging → executing` 对 quick/planned 按档分支(direct: `direct-test-result`;planned: `execution-plan-ready`+`tests-passing`),**不回落 full 表**。
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# team-flow 使用说明(研发团队版)
|
|
2
2
|
|
|
3
|
-
> 版本锚点:v0.
|
|
3
|
+
> 版本锚点:v0.65.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
|
|
|
@@ -232,7 +232,7 @@ 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 模式的完整转换矩阵**(31 个维度 + 1 个 workflow 限制维度;v0.64.0 增 quick/lightweight/planned 轻路径 11 维):
|
|
236
236
|
|
|
237
237
|
| 转换 | 维度 |
|
|
238
238
|
|------|------|
|
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.65.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.65.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.65.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.65.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.65.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.65.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"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// scripts/guard/checks/_fs-utils.mjs — light check 共享的文件系统小工具
|
|
2
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
|
|
5
|
+
/** 递归扫描 dir 下所有 .md,文件名或内容任一含 needle 即 true(dir 不存在 → false) */
|
|
6
|
+
export function filesContainDir(dir, needle) {
|
|
7
|
+
if (!existsSync(dir)) return false;
|
|
8
|
+
const entries = readdirSync(dir, { recursive: true, withFileTypes: true });
|
|
9
|
+
for (const e of entries) {
|
|
10
|
+
if (!e.isFile() || !/\.md$/i.test(e.name)) continue;
|
|
11
|
+
if (e.name.includes(needle)) return true;
|
|
12
|
+
const parent = typeof e.parentPath === 'string' ? e.parentPath : dir;
|
|
13
|
+
try {
|
|
14
|
+
if (readFileSync(join(parent, e.name), 'utf-8').includes(needle)) return true;
|
|
15
|
+
} catch { /* skip unreadable */ }
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// scripts/guard/checks/arch-design-light.mjs — 轻架构说明(§4,可选维度)
|
|
2
|
+
// v0.64.0:挂 planned 且 planned_arch=true(exploring→approved-for-build / approved-for-build→executing)。
|
|
3
|
+
// 判据:architecture/light-note.md 存在非空,或显式 skip-with-reason(arch_design_light_skipped
|
|
4
|
+
// + arch_design_light_skip_reason 两键齐全)。不要求 4A+DDD 全套 + 契约 + DP。
|
|
5
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { readState } from '../../lib/state-loader.mjs';
|
|
8
|
+
|
|
9
|
+
export function checkArchDesignLight(changeDir) {
|
|
10
|
+
const state = readState(changeDir);
|
|
11
|
+
|
|
12
|
+
if (state.arch_design_light_skipped === 'true') {
|
|
13
|
+
const reason = (state.arch_design_light_skip_reason || '').trim();
|
|
14
|
+
if (!reason || reason === 'null') {
|
|
15
|
+
return {
|
|
16
|
+
pass: false,
|
|
17
|
+
failures: ['arch_design_light_skipped=true but no skip reason — set arch_design_light_skip_reason via tf state set'],
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
return { pass: true, failures: [], reason: `skipped: ${reason}` };
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const notePath = join(changeDir, 'architecture', 'light-note.md');
|
|
24
|
+
if (!existsSync(notePath)) {
|
|
25
|
+
return {
|
|
26
|
+
pass: false,
|
|
27
|
+
failures: [
|
|
28
|
+
'architecture/light-note.md missing — write a short light architecture note '
|
|
29
|
+
+ '(touched surfaces, key decisions; no 4A+DDD suite needed), or skip explicitly: '
|
|
30
|
+
+ 'tf state set <dir> arch_design_light_skipped true + arch_design_light_skip_reason "<reason>"',
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const content = readFileSync(notePath, 'utf-8').trim();
|
|
35
|
+
if (!content) {
|
|
36
|
+
return { pass: false, failures: ['architecture/light-note.md is empty — write the light architecture note'] };
|
|
37
|
+
}
|
|
38
|
+
return { pass: true, failures: [] };
|
|
39
|
+
}
|
|
@@ -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 亦识别)';
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// scripts/guard/checks/arch-merged-light.mjs — 架构台账轻回写(§4,非 negotiable 底线)
|
|
2
|
+
// v0.64.0(D8/D10):
|
|
3
|
+
// - 无架构 surface → 过(G4)
|
|
4
|
+
// - 有 surface → 最小持久源齐(architecture.md 必产;触及 API/DB 另需 api.md/database.md)
|
|
5
|
+
// + 全局台账(docs/architecture/**)含归因 `change:<name>`(归因锚 = 扫描 + 条目,非快照)
|
|
6
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
7
|
+
import { join } from 'node:path';
|
|
8
|
+
import { readState } from '../../lib/state-loader.mjs';
|
|
9
|
+
import { scanArchitectureSurface } from '../../lib/surface-scan.mjs';
|
|
10
|
+
|
|
11
|
+
function filesContain(dir, needle) {
|
|
12
|
+
if (!existsSync(dir)) return false;
|
|
13
|
+
const entries = readdirSync(dir, { recursive: true, withFileTypes: true });
|
|
14
|
+
for (const e of entries) {
|
|
15
|
+
if (!e.isFile() || !/\.md$/i.test(e.name)) continue;
|
|
16
|
+
const parent = typeof e.parentPath === 'string' ? e.parentPath : dir;
|
|
17
|
+
try {
|
|
18
|
+
if (readFileSync(join(parent, e.name), 'utf-8').includes(needle)) return true;
|
|
19
|
+
} catch { /* skip unreadable */ }
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function minSourceOk(changeDir, rel) {
|
|
25
|
+
const p = join(changeDir, 'architecture', rel);
|
|
26
|
+
return existsSync(p) && readFileSync(p, 'utf-8').trim().length > 0;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function checkArchMergedLight(changeDir) {
|
|
30
|
+
const state = readState(changeDir);
|
|
31
|
+
const changeName = state.change_name || changeDir.split('/').filter(Boolean).pop();
|
|
32
|
+
const scan = scanArchitectureSurface(changeDir, state);
|
|
33
|
+
|
|
34
|
+
if (scan.error === 'no-baseline' || scan.error === 'diff-failed') {
|
|
35
|
+
return { pass: false, failures: [`surface scan failed (${scan.error}) — cannot verify ledger writeback, fail-closed`] };
|
|
36
|
+
}
|
|
37
|
+
if (scan.error === 'aggregate-list-missing') {
|
|
38
|
+
return {
|
|
39
|
+
pass: false,
|
|
40
|
+
failures: ['aggregate list missing (.team-flow/aggregate-dirs.txt) — cannot classify architecture surface, fail-closed'],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (scan.architectureSurface.length === 0) {
|
|
45
|
+
return { pass: true, failures: [], reason: 'no architecture surface touched — ledger writeback N/A (G4)' };
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const failures = [];
|
|
49
|
+
// D8 最小持久源:architecture.md 必产(聚合注册行 + 演进日志段 = marker 区投影输入)
|
|
50
|
+
if (!minSourceOk(changeDir, 'architecture.md')) {
|
|
51
|
+
failures.push('changes/<name>/architecture/architecture.md missing/empty — minimal persistent source required (aggregate lines + ### change:<name> evolution entry); run the light arch writeback');
|
|
52
|
+
}
|
|
53
|
+
if (scan.apiFiles.length > 0 && !minSourceOk(changeDir, 'api.md')) {
|
|
54
|
+
failures.push('API surface touched but architecture/api.md missing/empty — minimal endpoint delta required (feeds arch-merge rebuild)');
|
|
55
|
+
}
|
|
56
|
+
if (scan.dbFiles.length > 0 && !minSourceOk(changeDir, 'database.md')) {
|
|
57
|
+
failures.push('DB surface touched but architecture/database.md missing/empty — minimal schema delta required');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const anchor = `change:${changeName}`;
|
|
61
|
+
const globalLedger = join(scan.projectRoot, 'docs', 'architecture');
|
|
62
|
+
if (!filesContain(globalLedger, anchor)) {
|
|
63
|
+
failures.push(`global ledger (docs/architecture/**) has no '${anchor}' attribution — run: tf arch-merge --light <change-dir>`);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return failures.length ? { pass: false, failures } : { pass: true, failures: [] };
|
|
67
|
+
}
|
|
@@ -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 {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// scripts/guard/checks/arch-snapshot-light.mjs — 轻架构快照(§4,条件维度)
|
|
2
|
+
// v0.64.0(D10 裁决):仅当 light-note 产出时需要快照(供演进日志 diff 展示);
|
|
3
|
+
// arch-merged-light 的归因锚 = 扫描 + 台账条目,不依赖本快照——无 note / 已 skip → N/A 通过。
|
|
4
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { readState } from '../../lib/state-loader.mjs';
|
|
7
|
+
|
|
8
|
+
export function checkArchSnapshotLight(changeDir) {
|
|
9
|
+
const state = readState(changeDir);
|
|
10
|
+
|
|
11
|
+
const notePath = join(changeDir, 'architecture', 'light-note.md');
|
|
12
|
+
const hasNote = existsSync(notePath) && readFileSync(notePath, 'utf-8').trim().length > 0;
|
|
13
|
+
const skipped = state.arch_design_light_skipped === 'true';
|
|
14
|
+
|
|
15
|
+
if (!hasNote || skipped) {
|
|
16
|
+
return { pass: true, failures: [], reason: 'no light architecture note — snapshot N/A (D10: anchor is scan+ledger, not snapshot)' };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const snapPath = join(changeDir, 'architecture', 'snapshot-light.md');
|
|
20
|
+
if (!existsSync(snapPath)) {
|
|
21
|
+
return {
|
|
22
|
+
pass: false,
|
|
23
|
+
failures: ['light note present but architecture/snapshot-light.md missing — snapshot the touched surfaces before closing'],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
if (!readFileSync(snapPath, 'utf-8').trim()) {
|
|
27
|
+
return { pass: false, failures: ['architecture/snapshot-light.md is empty'] };
|
|
28
|
+
}
|
|
29
|
+
return { pass: true, failures: [] };
|
|
30
|
+
}
|
|
@@ -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,38 @@
|
|
|
1
|
+
// scripts/guard/checks/artifacts-planned.mjs — planned 的规划制品判据(§4.5②,替代四件套)
|
|
2
|
+
// v0.64.0(B-01 强化):不止「存在」——防空壳套餐:
|
|
3
|
+
// proposal.md 非空(≥10 个非空行)+ tasks.md ≥1 条 checkbox。
|
|
4
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { parseTaskLine } from '../../lib/md-normalize.mjs';
|
|
7
|
+
|
|
8
|
+
function nonEmptyLines(text) {
|
|
9
|
+
return text.split('\n').filter(l => l.trim()).length;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function checkArtifactsPlanned(changeDir) {
|
|
13
|
+
const failures = [];
|
|
14
|
+
const proposalPath = join(changeDir, 'proposal.md');
|
|
15
|
+
const tasksPath = join(changeDir, 'tasks.md');
|
|
16
|
+
|
|
17
|
+
if (!existsSync(proposalPath)) {
|
|
18
|
+
failures.push('proposal.md is missing — planned path requires proposal.md + tasks.md');
|
|
19
|
+
} else {
|
|
20
|
+
const proposal = readFileSync(proposalPath, 'utf-8');
|
|
21
|
+
const lines = nonEmptyLines(proposal);
|
|
22
|
+
if (lines < 10) {
|
|
23
|
+
failures.push(`proposal.md too thin (${lines} non-empty lines, need ≥10) — state intent, scope, and acceptance criteria`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (!existsSync(tasksPath)) {
|
|
28
|
+
failures.push('tasks.md is missing — planned path requires proposal.md + tasks.md');
|
|
29
|
+
} else {
|
|
30
|
+
const tasks = readFileSync(tasksPath, 'utf-8');
|
|
31
|
+
const taskCount = tasks.split('\n').map(l => parseTaskLine(l)).filter(Boolean).length;
|
|
32
|
+
if (taskCount < 1) {
|
|
33
|
+
failures.push('tasks.md has no task checkboxes — add at least one `- [ ]` task');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return failures.length ? { pass: false, failures } : { pass: true, failures: [] };
|
|
38
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// scripts/guard/checks/compound-writeback-light.mjs — 复利轻回写(§4,同 sink 不另起台账)
|
|
2
|
+
// v0.64.0:planned closing 必执行(含「无新增决策」的显式空捕获记录),
|
|
3
|
+
// **不走 compound_skipped 自清**(§3.7——自清会让 closed 后的全局库漏写无兜底)。
|
|
4
|
+
// 判据:docs/solutions/** 存在归因 `change:<name>` 的条目(INDEX 单写入口 tf solutions 系列产出)。
|
|
5
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
import { readState } from '../../lib/state-loader.mjs';
|
|
8
|
+
import { findProjectRoot } from '../../lib/surface-scan.mjs';
|
|
9
|
+
|
|
10
|
+
function filesContain(dir, needle) {
|
|
11
|
+
if (!existsSync(dir)) return false;
|
|
12
|
+
const entries = readdirSync(dir, { recursive: true, withFileTypes: true });
|
|
13
|
+
for (const e of entries) {
|
|
14
|
+
if (!e.isFile() || !/\.md$/i.test(e.name)) continue;
|
|
15
|
+
const parent = typeof e.parentPath === 'string' ? e.parentPath : dir;
|
|
16
|
+
try {
|
|
17
|
+
if (readFileSync(join(parent, e.name), 'utf-8').includes(needle)) return true;
|
|
18
|
+
} catch { /* skip */ }
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function checkCompoundWritebackLight(changeDir) {
|
|
24
|
+
const state = readState(changeDir);
|
|
25
|
+
const changeName = state.change_name || changeDir.split('/').filter(Boolean).pop();
|
|
26
|
+
|
|
27
|
+
// 自清通道对本维度无效(planned 禁 compound_skipped,§3.7)
|
|
28
|
+
if (state.compound_skipped === true || state.compound_skipped === 'true') {
|
|
29
|
+
return {
|
|
30
|
+
pass: false,
|
|
31
|
+
failures: ['compound_skipped is not accepted on the planned light path — capture into the global library (empty capture "no new decisions" is fine): tf solutions capture / ce-compound with change:<name> attribution'],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const projectRoot = findProjectRoot(changeDir);
|
|
36
|
+
const solutionsDir = join(projectRoot, 'docs', 'solutions');
|
|
37
|
+
const anchor = `change:${changeName}`;
|
|
38
|
+
if (filesContain(solutionsDir, anchor) || filesContain(solutionsDir, changeName)) {
|
|
39
|
+
return { pass: true, failures: [] };
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
pass: false,
|
|
43
|
+
failures: [`no solution entry attributed '${anchor}' (or '${changeName}') in docs/solutions/** — run compound capture (tf solutions capture / ce-compound), INDEX single-writer + dedup; an explicit 'no new decisions' entry satisfies this gate`],
|
|
44
|
+
};
|
|
45
|
+
}
|