flowchart TD
A["入口 使用 delivery-harness-framework"]:::router
B["读取本地规则 AGENTS.md 和 repo-index"]:::router
C["恢复当前状态 harness_recover.py"]:::helper
D["探测运行环境 harness_env_probe.py"]:::helper
E{"请求是否明确"}:::decision
F["Requirements 捕获 DoD、范围、约束 读取 CONTEXT / ADR"]:::stage
G["验证需求 artifact harness_requirements.py validate PATH"]:::helper
H{"是否需要专门判断"}:::decision
I["产品判断 gstack-plan-ceo-review gstack-office-hours"]:::gstack
J["工程/设计计划 vertical slices AFK / HITL"]:::gstack
J2["原型学习 / 深模块判断 throwaway prototype deep module review"]:::gstack
K["安全或隐私边界 gstack-cso security-reviewer"]:::gstack
L{"是否多 agent 并行"}:::decision
M["校验 agent team harness_agent_team.py validate PLAN.json 可选 durable brief"]:::helper
N["Development repo workflow / TDD / scoped workers"]:::stage
O["Validation 测试、smoke、fresh evidence debug 先建 feedback loop"]:::stage
P["证据报告 harness_report.py"]:::helper
Q{"是否用户可见或浏览器相关"}:::decision
R["浏览器 QA gstack-qa 或 gstack-qa-only"]:::gstack
S{"是否准备交付"}:::decision
T["Review gstack-review / code-reviewer"]:::gstack
U["Ship / Deploy gstack-ship gstack-land-and-deploy gstack-canary"]:::gstack
V["Release docs gstack-document-release / doc-updater"]:::gstack
W["Checkpoint / Handoff harness_checkpoint.py append"]:::helper
X["最终输出 阶段、已读来源、skill 路由、验证证据、阻塞项"]:::router
Y["阻断 缺少凭据、远程授权、破坏性操作、安全泄漏"]:::danger
A --> B --> C --> D --> E
E -- "不明确" --> F --> G --> H
E -- "明确" --> H
H -- "产品" --> I --> L
H -- "工程或设计" --> J --> J2 --> L
H -- "安全" --> K --> L
H -- "无需专项" --> L
L -- "是" --> M --> N
L -- "否" --> N
N --> O --> P --> Q
Q -- "是" --> R --> S
Q -- "否" --> S
S -- "先评审" --> T --> W
S -- "发布/部署" --> U --> V --> W
S -- "只交接" --> W
W --> X
D -. "不可观察或缺文件" .-> Y
K -. "命中高风险" .-> Y
U -. "未获授权" .-> Y
Y --> W
classDef router fill:#e4eef0,stroke:#2f7f9f,color:#1f2a2e;
classDef helper fill:#e9f4ee,stroke:#3b8b6a,color:#1f2a2e;
classDef stage fill:#fff3d8,stroke:#b87916,color:#1f2a2e;
classDef gstack fill:#f1eadb,stroke:#8a6f3f,color:#1f2a2e;
classDef decision fill:#fffaf0,stroke:#29363a,color:#1f2a2e;
classDef danger fill:#f8e4df,stroke:#b65448,color:#1f2a2e;