Delivery Harness Framework

通用项目生命周期路由流程

这张图把 delivery-harness-framework 放在入口层:先恢复状态、确认阶段、对齐领域词和 ADR、选择专门 skill 或 helper,再进入开发、验证、评审、交付和交接。通用 skill 只做跨仓库路由;业务路径交给 repo-specific harness;产品、工程、QA、安全和发布交给 gstack 系列 skill。

8标准 runtime 阶段,从 research 到 handoff。
9+核心入口:requirements、recover、env probe、report、agent team、agent brief、checkpoint、evidence、verify、tests。
10+gstack 专项路由覆盖产品、工程、设计、QA、安全、发布。
4 字段验证证据必须包含 command、exit_code、key_output、timestamp。
01

纵向主流程

主流程自上而下读取。蓝色节点是通用 harness 入口,绿色节点是可执行阶段,琥珀色节点是 gstack 或 repo-specific skill 的接管点,红色节点是安全阻断或需要用户决策的分支。

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;
02

阶段与 skill 路由

每一行表示用户请求落入某类生命周期阶段时,优先采用的 skill 或执行入口。

启动与恢复

用于新会话、接手 handoff、状态不明或需要先读 repo 事实。

delivery-harness-frameworkharness_recover.pyharness_env_probe.py

需求锁定

用于目标、范围、验收标准、限制条件或领域词汇不清晰的复杂任务;读取 CONTEXT.mdCONTEXT-MAP.md 与相关 ADR。

plannerreq-to-devharness_requirements.py

产品判断

用于定位、用户价值、demo 边界、优先级和取舍。

gstack-plan-ceo-reviewgstack-office-hoursoffice-hours

工程计划

用于架构、API、迁移、运行时、跨模块工作流和 vertical slice 拆分;每个切片标记 AFKHITL

gstack-plan-eng-reviewplannertask-flow-orchestratorharness-agent-brief.md

设计与浏览器体验

用于 UI、响应式、视觉验收、浏览器 smoke 和截图检查。

gstack-plan-design-reviewfrontend-designgstack-qa

安全与隐私

用于 auth、token、PII、公私边界、审批和审计。

gstack-csosecurity-reviewerguard

开发实现

用于 acceptance criteria 清楚、文件范围可控的修改;worker 可携带 durable brief。

tdd-guideatdd-guideworker agents

验证与评审

用于 fresh evidence、diff review、缺陷风险和测试缺口;debug 任务必须先建立 runnable feedback loop。

verification-loopgstack-reviewcode-reviewer

发布与交接

用于 commit、PR、deploy、canary、release docs、下一步状态。

gstack-shipgstack-land-and-deployharness_checkpoint.py
03

Runtime helper 速查

helper 何时使用 产出/门禁
scripts/harness_recover.py 恢复当前 phase、dirty 状态、next safe task、最近验证。 新会话不依赖聊天历史,先以 repo state 和 evidence 为准。
scripts/harness_env_probe.py 确认 hooks、tool policy、evidence schema、sandbox 字段是否可观察。 不能观察时明确标记,不推断 Desktop 全局状态。
scripts/harness_requirements.py 需求 artifact 成为 source of truth 前,尤其是 domain docs / ADR 已参与需求判断时。 缺字段、格式错误、未填模板时非零退出。
scripts/harness_agent_team.py 准备多 worker 或并行 agent 之前。 校验 role、scope、write_set、verification_command、可选 durable brief,阻断重叠写集。
scripts/harness_report.py 验证、评审、交接时查看本地 JSONL evidence。 空 evidence 明确报告,坏 JSONL 计数但不中断摘要。
scripts/harness_checkpoint.py 阶段转换、重大实现切片验证后、远程/发布前、结束会话前。 追加 docs/harness-state.md,记录 changed surfaces、验证、blockers、next safe task。
04

交付门禁

完成前必须能回答的五件事

  • 当前 lifecycle stage 是什么,为什么选择这个阶段。
  • 已经读取哪些 durable source,包括 AGENTS.md、repo index、state、handoff、runtime docs。
  • 本阶段由哪个 skill 接管,是否存在 repo-specific lifecycle harness。
  • fresh verification 的 commandexit_codekey_outputtimestamp 是否齐全。
  • 是否存在凭据、远程授权、破坏性操作、安全泄漏或外部依赖阻塞。