@xulthekl/team-flow 0.35.0 → 0.36.1
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/AGENTS.md +5 -2
- package/CHANGELOG.md +32 -0
- package/GEMINI.md +1 -1
- package/INSTALL.md +1 -1
- package/README.md +3 -2
- package/agents/architecture-reviewer.md +12 -0
- package/docs/README_en.md +1 -1
- 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/arch-gate-exemptions.mjs +68 -0
- package/scripts/guard/checks/arch-readiness.mjs +36 -0
- package/scripts/guard/checks/arch-snapshot.mjs +35 -0
- package/scripts/guard/guard.mjs +10 -2
- package/scripts/lib/arch-merge.mjs +405 -316
- package/scripts/lib/arch-parse.mjs +162 -0
- package/scripts/lib/cmd-arch.mjs +84 -0
- package/scripts/team-flow.mjs +4 -0
- package/skills/architecture-design/SKILL.md +22 -1
- package/skills/architecture-design/chapters/ch06-integration.md +4 -4
- package/skills/architecture-design/references/s3.5-architecture-template.md +164 -0
- package/skills/architecture-design/references/s3.5-loading-protocol.md +40 -0
- package/skills/architecture-design/references/s3.5-product-architecture.md +76 -0
- package/skills/session-handoff/references/handoff-template.md +2 -2
- package/skills/spec-writer/SKILL.md +1 -0
- package/skills/workflow-bootstrap/references/agents/arch-reverse-analyst.md +60 -0
- package/skills/workflow-orchestrator/SKILL.md +24 -7
- package/skills/workflow-orchestrator/references/feedback-loops.md +2 -0
- package/skills/workflow-orchestrator/references/s1-path-router.md +1 -1
- package/skills/workflow-orchestrator/references/s3-plan-pipeline.md +2 -1
- package/skills/workflow-orchestrator/references/s4-split-validate.md +11 -1
- package/skills/workflow-orchestrator/references/state-model.md +52 -0
|
@@ -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. 24 skills + 15 agents with embedded TDD, SDD, code review, debugging, delta spec sync, and design-system-driven prototyping.",
|
|
12
|
-
"version": "0.
|
|
12
|
+
"version": "0.36.1",
|
|
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.36.1",
|
|
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). 24 skills + 15 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). 24 skills + 15 agents, one install.",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.36.1",
|
|
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.36.1"
|
|
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, and local HTML prototyping.",
|
|
15
|
-
"version": "0.
|
|
15
|
+
"version": "0.36.1",
|
|
16
16
|
"source": ".",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "LT",
|
package/AGENTS.md
CHANGED
|
@@ -60,7 +60,7 @@ spec 驱动开发过程。8 态变更机:`exploring → specifying → bridgin
|
|
|
60
60
|
- 用法:`/e2e [原型|集成|验收] [spec路径]`
|
|
61
61
|
|
|
62
62
|
### 6. workflow-orchestrator(1 skill,产品级编排,v0.7 重设计 + v0.15.0 多需求)
|
|
63
|
-
- 编排产品级工作流:S1 路径路由(含需求选择)→ S2 PRD+原型(循环上提,orchestrator 直接编排,**冻结前 PRD 完整性评审**)→ S3 ce-plan(pipeline 快速路径,**入口问定 plan_mode**)→ S4 拆分验证+分发 → S5 全局监控
|
|
63
|
+
- 编排产品级工作流:S1 路径路由(含需求选择)→ S2 PRD+原型(循环上提,orchestrator 直接编排,**冻结前 PRD 完整性评审**)→ S3 ce-plan(pipeline 快速路径,**入口问定 plan_mode**)→ **ARCH 产品级架构设计(v0.36.0:architecture-design product 模式 8 步 → iterations/vN/architecture.md 快照 → 评审门 PASS 才进 S4)** → S4 拆分验证+分发 → S5 全局监控
|
|
64
64
|
- v0.7 关键变更:原型循环从 ce-brainstorm 内部上提到 orchestrator 层直接编排;新增反馈环路(vN 内修订+变更履历,非升版);新增增量入口(S1 路径路由器,**7 种入口路径**,v0.20.0 增「原型补跑/重跑」);S5 多 change 并行时必选
|
|
65
65
|
- **v0.20.0**:S1 路由新增第 7 种入口「原型补跑/重跑」(PRD 冻结 ∧ prototype 缺失/需重做 → 部分重入 S2 原型循环,PRD 不动、保留有效 S3/S4);后台子代理等待范式(依赖完成通知,禁 TaskOutput 轮询)(设计 §22)
|
|
66
66
|
- **v0.15.0 多需求并行**:`.team-flow/registry.yaml` 注册表 + 每需求一份 `.team-flow/requirements/<req-id>/orchestrator.yaml`,状态天然隔离
|
|
@@ -136,7 +136,10 @@ STRATEGY.md CONCEPTS.md 产品策略(BA) / 领域词汇
|
|
|
136
136
|
S3 计划阶段 → ce-plan(pipeline 快速路径,入口问定 plan_mode)
|
|
137
137
|
plan.md:change 拆分 + 依赖 DAG + 高阶技术方向(不含接口清单)
|
|
138
138
|
反馈环路:plan 暴露 PRD 问题可回退 S2
|
|
139
|
-
|
|
139
|
+
[ARCH 产品级架构设计(v0.36.0)] → architecture-design product 模式 8 步设计
|
|
140
|
+
→ docs/architecture/iterations/vN/architecture.md(6 产物快照,预测态不写全局)→ 评审门 PASS 才进 S4
|
|
141
|
+
skip 须物化(iterations/vN/SKIPPED);旧项目首轮 arch_baseline 缺失 → 逆向重建
|
|
142
|
+
S4 拆分验证与分发 → arch-readiness 门(快照覆盖 change 触及 BC)→ change-split-auditor 审计(必选门禁)→ 创建 change → 进入 team-flow
|
|
140
143
|
并行策略建议 + 验收标准预分配;反馈环路:依赖图不可执行可回退 S3
|
|
141
144
|
S5 全局监控(change≥2 必选)→ 跨 change 一致性 + 复利晋升 + 动态重规划
|
|
142
145
|
│
|
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,38 @@ The format loosely follows Keep a Changelog.
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.36.1] - 2026-08-05
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- **workflow-orchestrator 流程缺口修复**:0.36.0 的 `references/state-model.md` 已定义 ARCH(S3.5 产品级架构设计)阶段,但 SKILL.md 主体 Execution Flow(S1-S5)/ AGENTS.md / README 未同步该阶段——LLM 执行 orchestrator 会走 S3→S4 跳过架构设计。已同步 11 处:SKILL.md(定位表/Execution Flow 标题/ARCH 阶段节/反馈环路/增量入口/状态模型/Guardrails/Output Standard)+ AGENTS.md(产品级工作流/SOP)+ README(SOP)
|
|
13
|
+
|
|
14
|
+
## [0.36.0] - 2026-08-05
|
|
15
|
+
|
|
16
|
+
### Added(产品级架构设计增强——设计增强方案 v0.14 §57-§66)
|
|
17
|
+
|
|
18
|
+
#### 新阶段
|
|
19
|
+
- **architecture 阶段(S3.5)**:S3 计划之后、S4 拆分之前的产品级架构设计
|
|
20
|
+
- 场景判定(全新=正向设计 / 旧项目首轮=逆向重建 / 无结构性变更=可跳过,skip 须物化)
|
|
21
|
+
- 产出 `docs/architecture/iterations/vN/architecture.md`(6 产物:BC/聚合注册表/指令事件/状态机/概念 ER/时序),预测态快照不写全局
|
|
22
|
+
- 产品级评审门(architecture-reviewer `review_mode: product`,PASS 才进 S4)
|
|
23
|
+
|
|
24
|
+
#### 新命令
|
|
25
|
+
- **tf arch init/show**:项目级 `arch_baseline` 打戳(`.team-flow/arch-state.json`,防污染复刻 v0.13 schema_version 模式)
|
|
26
|
+
|
|
27
|
+
#### guard 门禁
|
|
28
|
+
- **arch-readiness**(exploring:specifying)+ **arch-snapshot**(executing:closing),arch_baseline 缺失 → WARN 不 FAIL(存量豁免)
|
|
29
|
+
|
|
30
|
+
#### arch-merge 重构(v0.14 §62)
|
|
31
|
+
- 当前态幂等 upsert 替代 append(marker 区代码独占写 + 成对校验,缺失/重复硬失败)
|
|
32
|
+
- 演进日志 changeName 去重 + schema-baseline 幂等追加
|
|
33
|
+
- 生成式 PHYSICAL-MODEL / DATABASE / API-INDEX(结构化解析,替代正则扫 markdown)
|
|
34
|
+
- 冲突预检(端点冲突 / 聚合重定义转产品级决策门)
|
|
35
|
+
- 并发安全:全局写锁 + 白名单 git add + 脏文件告警;dry-run 不落盘
|
|
36
|
+
|
|
37
|
+
#### 其他
|
|
38
|
+
- 变更级输入联动:iterations/vN/ 快照为主输入 + 五项检查路由分流(产品级决策 vs change 内细节)
|
|
39
|
+
- 旧项目逆向重建 `arch-reverse-analyst` + 全局三层数据面维护(L1 当前态 / L2 变更增量 / L3 迭代快照)
|
|
40
|
+
|
|
9
41
|
## [0.35.0] - 2026-08-05
|
|
10
42
|
|
|
11
43
|
### Added(C1 workflow-feedback 根因修复——6 条 feedback 4 个根因聚类)
|
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.36.1 | 阶段: {{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.36.1`
|
|
4
4
|
|
|
5
5
|
> 统一插件:**team-flow**(spec 驱动开发)+ **compound-engineering 核心子集**(全局复利)+ **architecture-design**(4A+DDD 增量设计)+ **prototype**(本地 HTML 原型)+ **e2e**(AC 驱动 E2E)+ **workflow-orchestrator**(产品级编排)+ **workflow-bootstrap**(既有项目接入)。一次安装,七套能力协同。
|
|
6
6
|
|
|
@@ -108,7 +108,8 @@ Skills 命名保留其来源前缀,作为功能分组的自然标识:
|
|
|
108
108
|
→ S1 路径路由器 → 判断入口路径(全新/续版/重新计划/继续执行/快速通道/Hotfix)
|
|
109
109
|
→ S2 PRD + 原型阶段 → ce-brainstorm + 原型循环上提(prototype → 自动评审 → 人工评审 → 冻结)
|
|
110
110
|
→ S3 计划阶段 → ce-plan(pipeline 快速路径)→ plan.md(change 拆分+依赖+技术方向)
|
|
111
|
-
→
|
|
111
|
+
→ [ARCH 产品级架构设计(v0.36.0 新增)] → 8 步设计 → iterations/vN/architecture.md 快照 → 评审门
|
|
112
|
+
→ S4 拆分验证与分发 → arch-readiness 门 → change-split-auditor 审计(必选门禁)→ 创建 change → 进入 team-flow
|
|
112
113
|
→ S5 全局监控(change≥2 必选)→ 跨 change 一致性 + 复利晋升 + 动态重规划
|
|
113
114
|
→ [复利贯穿层] 每个阶段转换点:检测→捕获→索引→注入
|
|
114
115
|
→ change 完成:arch-merge → prototype-sync(顺序提交)+ 复利晋升
|
|
@@ -23,9 +23,21 @@ You are an independent reviewer. You did NOT participate in producing the archit
|
|
|
23
23
|
| `architecture_dir` | 架构产出目录(e.g., `changes/<name>/architecture/`) |
|
|
24
24
|
| `global_arch_dir` | 全局架构目录(e.g., `docs/architecture/`) |
|
|
25
25
|
| `conventions_config` | conventions 配置(从 team-flow.config.json 读取的路径映射) |
|
|
26
|
+
| `review_mode` | `change`(默认,审查 `changes/<name>/architecture/` 三件套)\| `product`(v0.35.0,审查 `docs/architecture/iterations/vN/architecture.md` 产品级快照) |
|
|
26
27
|
|
|
27
28
|
If change_brief_path or architecture_dir is missing or unreadable, report `FAIL` with reason `INPUT_ERROR`.
|
|
28
29
|
|
|
30
|
+
## Product Mode(v0.35.0,v0.14 §60.5)
|
|
31
|
+
|
|
32
|
+
`review_mode: product` 时(S3.5 产品级评审门),审查对象与维度适配变化:
|
|
33
|
+
|
|
34
|
+
- **审查对象**:`docs/architecture/iterations/vN/architecture.md`(6 产物:Context Map / 聚合注册表 / 指令事件 / 状态机 / 概念 ER / 时序)+ `domains/` 按域详细页;**不审查** change 内三件套。
|
|
35
|
+
- **A1**:6 产物章节存在 + marker 成对 + anchor id 可解析(机械预检)。
|
|
36
|
+
- **A4**:对照 PRD 功能清单(F001_P0 逐条)→ BC/聚合/API 全覆盖映射;对照源是 PRD(非 change-brief——change-brief 是变更级输入)。
|
|
37
|
+
- **A5**:旧项目逆向重建场景对照现状代码/全局基线;正向设计场景仅检查与既有基线无矛盾。
|
|
38
|
+
- **A6**:conventions 合规(同 change 模式)。
|
|
39
|
+
- **skip 处理**:S3.5 显式跳过(`iterations/vN/SKIPPED` 标记)时本 agent 不执行。
|
|
40
|
+
|
|
29
41
|
## 6-Dimension Checklist
|
|
30
42
|
|
|
31
43
|
| Dim | Name | Baseline Source | Check Content | Severity |
|
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.36.1`
|
|
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/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). 24 skills, one install.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.36.1",
|
|
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.36.1: 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.36.1"
|
|
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.36.1.
|
|
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.36.1",
|
|
4
4
|
"description": "Unified plugin (24 skills + 15 agents) integrating team-flow, compound-engineering, architecture-design, prototype, design-system, workflow-orchestrator, workflow-bootstrap, e2e, session-handoff, workflow-feedback 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.36.1",
|
|
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). 24 skills + 15 agents, one install.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "LT"
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// scripts/guard/checks/arch-gate-exemptions.mjs — shared exemption logic for v0.35.0 arch gates
|
|
2
|
+
//
|
|
3
|
+
// v0.14 §59.4/§63.1(设计增强方案 v0.14):arch-readiness / arch-snapshot 两个架构门禁
|
|
4
|
+
// 共享同一套 legacy/skip 豁免语义,抽取到本模块作为唯一真相源,防止判定漂移。
|
|
5
|
+
//
|
|
6
|
+
// 豁免键背景:arch_baseline 完全复刻 v0.13 §48.1 schema_version 防污染模式——
|
|
7
|
+
// 仅 `tf arch init` 打戳(项目级 .team-flow/arch-state.json),缺失 = 存量信号,
|
|
8
|
+
// 不会被新 CLI 重写状态文件而污染。
|
|
9
|
+
import fs from 'node:fs';
|
|
10
|
+
import path from 'node:path';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 从 change 目录向上定位项目根(含 .team-flow/ 目录的最近祖先)。
|
|
14
|
+
* 找不到返回 null → 调用方按 legacy 安全降级(不阻断)。
|
|
15
|
+
*/
|
|
16
|
+
export function findProjectRoot(changeDir) {
|
|
17
|
+
let dir = path.resolve(changeDir);
|
|
18
|
+
while (dir !== path.dirname(dir)) {
|
|
19
|
+
if (fs.existsSync(path.join(dir, '.team-flow'))) return dir;
|
|
20
|
+
dir = path.dirname(dir);
|
|
21
|
+
}
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** 读取项目级架构状态(.team-flow/arch-state.json)。不存在/损坏 → null。 */
|
|
26
|
+
export function readArchState(root) {
|
|
27
|
+
if (!root) return null;
|
|
28
|
+
const p = path.join(root, '.team-flow', 'arch-state.json');
|
|
29
|
+
if (!fs.existsSync(p)) return null;
|
|
30
|
+
try { return JSON.parse(fs.readFileSync(p, 'utf-8')); }
|
|
31
|
+
catch { return null; }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* v0.14 §59.4:legacy = 项目架构基线未建立(arch_baseline 缺失)。
|
|
36
|
+
* 只有 `tf arch init` 打戳;缺失 = 存量信号。
|
|
37
|
+
*/
|
|
38
|
+
export function isLegacyArch(state) {
|
|
39
|
+
return state?.arch_baseline == null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** 项目级显式 skip 是否已物化(iterations/vN/SKIPPED 标记存在)。 */
|
|
43
|
+
export function isArchSkipMaterialized(root) {
|
|
44
|
+
const iterationsDir = root && path.join(root, 'docs', 'architecture', 'iterations');
|
|
45
|
+
if (!iterationsDir || !fs.existsSync(iterationsDir)) return false;
|
|
46
|
+
return fs.readdirSync(iterationsDir, { withFileTypes: true })
|
|
47
|
+
.filter(d => d.isDirectory())
|
|
48
|
+
.some(d => fs.existsSync(path.join(iterationsDir, d.name, 'SKIPPED')));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** 最近一个迭代的产品级架构快照路径(iterations/<latest>/architecture.md)。不存在 → null。 */
|
|
52
|
+
export function findLatestIterationSnapshot(root) {
|
|
53
|
+
const iterationsDir = root && path.join(root, 'docs', 'architecture', 'iterations');
|
|
54
|
+
if (!iterationsDir || !fs.existsSync(iterationsDir)) return null;
|
|
55
|
+
const dirs = fs.readdirSync(iterationsDir, { withFileTypes: true })
|
|
56
|
+
.filter(d => d.isDirectory())
|
|
57
|
+
.map(d => d.name)
|
|
58
|
+
.sort();
|
|
59
|
+
for (let i = dirs.length - 1; i >= 0; i--) {
|
|
60
|
+
const snap = path.join(iterationsDir, dirs[i], 'architecture.md');
|
|
61
|
+
if (fs.existsSync(snap)) return snap;
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export const ARCH_READINESS_FAIL_HINT =
|
|
67
|
+
'iterations/vN/architecture.md missing — 回 ARCH 阶段补快照,'
|
|
68
|
+
+ '或显式 skip 物化(iterations/vN/<vN>/SKIPPED 标记 + 理由)';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// scripts/guard/checks/arch-readiness.mjs — 架构就绪门禁(v0.35.0,v0.14 §59.4)
|
|
2
|
+
// 挂 exploring:specifying(与 arch-design 并列):产品级架构快照必须在 change 进入 specifying 前就绪。
|
|
3
|
+
//
|
|
4
|
+
// 规则:
|
|
5
|
+
// - arch_baseline == null(存量/重建未完成)→ PASS + WARN(不阻断,项目级豁免,P3 留逃生舱)
|
|
6
|
+
// - skip 已物化(iterations/vN/SKIPPED)→ PASS
|
|
7
|
+
// - iterations/<latest>/architecture.md 存在 → PASS
|
|
8
|
+
// - 否则 → FAIL,引导回 ARCH 补快照或显式 skip
|
|
9
|
+
import {
|
|
10
|
+
findProjectRoot, readArchState, isLegacyArch,
|
|
11
|
+
findLatestIterationSnapshot, isArchSkipMaterialized, ARCH_READINESS_FAIL_HINT,
|
|
12
|
+
} from './arch-gate-exemptions.mjs';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {string} changeDir - change directory path
|
|
16
|
+
* @returns {{ pass: boolean, failures: string[] }}
|
|
17
|
+
*/
|
|
18
|
+
export function checkArchReadiness(changeDir) {
|
|
19
|
+
const root = findProjectRoot(changeDir);
|
|
20
|
+
const state = readArchState(root);
|
|
21
|
+
|
|
22
|
+
// 存量/重建未完成 → WARN 不 FAIL(项目级豁免)
|
|
23
|
+
if (isLegacyArch(state)) {
|
|
24
|
+
console.warn(' [WARN] arch-readiness: project architecture baseline not established — S3.5 reconstruction pending');
|
|
25
|
+
return { pass: true, failures: [] };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (isArchSkipMaterialized(root)) {
|
|
29
|
+
return { pass: true, failures: [] };
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const snap = findLatestIterationSnapshot(root);
|
|
33
|
+
if (snap) return { pass: true, failures: [] };
|
|
34
|
+
|
|
35
|
+
return { pass: false, failures: [ARCH_READINESS_FAIL_HINT] };
|
|
36
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// scripts/guard/checks/arch-snapshot.mjs — 架构快照门禁(v0.35.0,v0.14 §59.4)
|
|
2
|
+
// 挂 executing:closing(先于 arch-merge):本轮迭代产品级架构快照必须已落盘("先快照后回写"强制化)。
|
|
3
|
+
//
|
|
4
|
+
// 规则:
|
|
5
|
+
// - arch_baseline == null(在途/存量)→ PASS + WARN(legacy 豁免)
|
|
6
|
+
// - skip 已物化(iterations/vN/SKIPPED)→ PASS
|
|
7
|
+
// - iterations/<latest>/architecture.md 存在 → PASS
|
|
8
|
+
// - 否则 → FAIL
|
|
9
|
+
import {
|
|
10
|
+
findProjectRoot, readArchState, isLegacyArch,
|
|
11
|
+
findLatestIterationSnapshot, isArchSkipMaterialized, ARCH_READINESS_FAIL_HINT,
|
|
12
|
+
} from './arch-gate-exemptions.mjs';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* @param {string} changeDir - change directory path
|
|
16
|
+
* @returns {{ pass: boolean, failures: string[] }}
|
|
17
|
+
*/
|
|
18
|
+
export function checkArchSnapshot(changeDir) {
|
|
19
|
+
const root = findProjectRoot(changeDir);
|
|
20
|
+
const state = readArchState(root);
|
|
21
|
+
|
|
22
|
+
if (isLegacyArch(state)) {
|
|
23
|
+
console.warn(' [WARN] arch-snapshot: project architecture baseline not established — 在途 change legacy 豁免');
|
|
24
|
+
return { pass: true, failures: [] };
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (isArchSkipMaterialized(root)) {
|
|
28
|
+
return { pass: true, failures: [] };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const snap = findLatestIterationSnapshot(root);
|
|
32
|
+
if (snap) return { pass: true, failures: [] };
|
|
33
|
+
|
|
34
|
+
return { pass: false, failures: [ARCH_READINESS_FAIL_HINT] };
|
|
35
|
+
}
|
package/scripts/guard/guard.mjs
CHANGED
|
@@ -16,6 +16,8 @@ import { checkExecutionReviewsPassed } from './checks/execution-reviews-passed.m
|
|
|
16
16
|
import { checkCompoundCaptured } from './checks/compound-captured.mjs';
|
|
17
17
|
import { checkTestMatrixComplete } from './checks/test-matrix-complete.mjs';
|
|
18
18
|
import { checkTestMatrixReady } from './checks/test-matrix-ready.mjs';
|
|
19
|
+
import { checkArchReadiness } from './checks/arch-readiness.mjs';
|
|
20
|
+
import { checkArchSnapshot } from './checks/arch-snapshot.mjs';
|
|
19
21
|
|
|
20
22
|
// Transition matrix: <from>:<to> → required check dimensions
|
|
21
23
|
const TRANSITION_CHECKS = {
|
|
@@ -25,13 +27,17 @@ const TRANSITION_CHECKS = {
|
|
|
25
27
|
// so requiring them before the transition was a chicken-and-egg deadlock
|
|
26
28
|
// (C1 事件:主代理被此门禁逼出绕行行为)。Artifact completeness is enforced
|
|
27
29
|
// by specifying:bridging (artifacts-exist remains there, single owner).
|
|
28
|
-
|
|
30
|
+
// v0.35.0 (v0.14 §59.4): arch-readiness 新增——产品级架构快照须在 specifying 前就绪
|
|
31
|
+
//(arch_baseline 缺失 → WARN 不 FAIL,项目级豁免)。
|
|
32
|
+
'exploring:specifying': ['arch-design', 'arch-readiness'],
|
|
29
33
|
'specifying:bridging': ['artifacts-exist', 'schema-valid'],
|
|
30
34
|
'bridging:approved-for-build': ['artifacts-exist', 'schema-valid', 'contract-fresh', 'dp-gate-passed'],
|
|
31
35
|
// v0.13 §49:test-matrix-ready 门禁前移——full 模式进入 executing 前强制测试准备度
|
|
32
36
|
//(矩阵存在非空 OR 显式 skip 附理由;legacy 豁免)。hotfix/tweak 沿用 §45.3 豁免,不挂。
|
|
33
37
|
'approved-for-build:executing': ['artifacts-exist', 'contract-fresh', 'dp-gate-passed', 'execution-plan-ready', 'test-matrix-ready'],
|
|
34
|
-
|
|
38
|
+
// v0.35.0 (v0.14 §59.4): arch-snapshot 新增——"先快照后回写"的强制化(legacy 豁免)。
|
|
39
|
+
// 仅在 full workflow 挂;hotfix/tweak 沿用 §59.4 豁免(紧急/微调不挂)。
|
|
40
|
+
'executing:closing': ['tasks-complete', 'tests-passing', 'specs-merged', 'execution-plan-ready', 'execution-reviews-passed', 'compound-captured', 'test-matrix-complete', 'arch-snapshot'],
|
|
35
41
|
|
|
36
42
|
// Debugging side-path
|
|
37
43
|
'executing:debugging': [],
|
|
@@ -180,6 +186,8 @@ async function main() {
|
|
|
180
186
|
'compound-captured': (dir) => checkCompoundCaptured(dir),
|
|
181
187
|
'test-matrix-complete': (dir) => checkTestMatrixComplete(dir),
|
|
182
188
|
'test-matrix-ready': (dir) => checkTestMatrixReady(dir),
|
|
189
|
+
'arch-readiness': (dir) => checkArchReadiness(dir),
|
|
190
|
+
'arch-snapshot': (dir) => checkArchSnapshot(dir),
|
|
183
191
|
};
|
|
184
192
|
|
|
185
193
|
const checks = [];
|