ai-sdlc-delivery-graph

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

ai-sdlc-delivery-graph: Repository Traceability

ai-sdlc-delivery-graph:仓库可追溯性

Internal AI SDLC skill, not client-facing by default. Every rule below is important to follow. None of it can be skipped. The graph is a generated projection; repository artifacts and Git remain authoritative.
内部AI SDLC技能,默认不面向客户。 以下每条规则都必须遵守,无一例外。 该图是生成的投影;仓库工件和Git仍为权威来源。

0. Skill Card

0. 技能卡片

  • Skill name:
    ai-sdlc-delivery-graph
  • Primary audience: Delivery, Dev, QA, Architecture
  • Supporting audience: PM, BA, Security, Release
  • Audience tags: Delivery, Dev, QA, Architecture, BA
  • SDLC stage: Traceability and readiness
  • Purpose: Build a deterministic repository-wide lifecycle graph and answer trace, gap, coverage, and orphan questions from stable evidence anchors.
  • Output: complete
    _ai_sdlc/delivery-graph.toon
    for agents, plus
    _ai_sdlc/delivery-graph.json
    for schema/interoperability and
    _ai_sdlc/delivery-graph.md
    for human review when
    --write
    is requested
  • 技能名称:
    ai-sdlc-delivery-graph
  • 主要受众:交付、开发、QA、架构
  • 支持受众:产品经理、业务分析师、安全、发布
  • 受众标签:交付、开发、QA、架构、业务分析师
  • SDLC阶段:可追溯性与就绪性
  • 用途:构建确定性的全仓库生命周期图,基于稳定证据锚点回答追溯、缺口、覆盖率和孤立项相关问题。
  • 输出:供Agent使用的完整
    _ai_sdlc/delivery-graph.toon
    ,以及供 Schema/互操作性使用的
    _ai_sdlc/delivery-graph.json
    ,当使用
    --write
    参数时还会生成供人工审核的
    _ai_sdlc/delivery-graph.md

0.1 Required Inputs

0.1 必填输入

  • Repository root containing lifecycle Markdown and, optionally, Git history.
  • A stable trace ID or graph node ID for path queries.
  • Explicit structured trace lines when a relationship cannot be derived safely.
  • 包含生命周期Markdown文件的仓库根目录,可选包含Git历史。
  • 用于路径查询的稳定追溯ID或图节点ID。
  • 当无法安全推导关系时,需提供明确的结构化追溯行。

0.2 Clarification Rules

0.2 澄清规则

  • Report ambiguous short IDs with all matching scoped node IDs.
  • Never invent an edge because two terms look semantically similar.
  • Treat missing links as gaps or orphans instead of guessing intent.
  • 报告模糊的短ID时,需附带所有匹配的作用域节点ID。
  • 绝不能因两个术语语义相似就凭空创建关联边。
  • 将缺失的链接视为缺口或孤立项,而非猜测意图。

0.2.1 Flow Mode Flags

0.2.1 流程模式标志

  • Support
    --quick-flow
    and
    --full-flow
    ; full flow takes precedence.
  • Both modes rebuild from current authoritative inputs before answering.
  • Full flow requires reviewers to resolve every reported ambiguity and high-value requirement coverage gap before claiming readiness.
  • 支持
    --quick-flow
    --full-flow
    ;全流程模式优先级更高。
  • 两种模式在回答前都会基于当前权威输入重新构建。
  • 全流程模式要求审核者解决所有报告的模糊点和高价值需求覆盖率缺口后,才能宣称就绪。

0.3 Output Rules

0.3 输出规则

  • Report the graph fingerprint, node and edge counts, source fingerprint, coverage, gaps, and orphans.
  • Return query paths as ordered node and edge evidence, not prose-only claims.
  • Return the validation and handoff summary directly in the Codex response.
  • Emit
    ai-sdlc-handoff/v1
    with
    result
    ,
    blockers
    ,
    next_required
    , and
    next_optional
    ; actions include
    reason
    ,
    command
    , and
    expected_artifact
    .
  • Do not create
    summary.txt
    ,
    *-summary.txt
    , or another standalone summary file.
  • Do not create ad hoc summaries outside the canonical graph outputs.
  • 报告图指纹、节点和边的数量、源指纹、覆盖率、缺口和孤立项。
  • 查询路径以有序的节点和边证据形式返回,而非仅纯文本声明。
  • 在Codex响应中直接返回验证与交接摘要。
  • 输出包含
    result
    blockers
    next_required
    next_optional
    ai-sdlc-handoff/v1
    ;操作信息包含
    reason
    command
    expected_artifact
  • 不得创建
    summary.txt
    *-summary.txt
    或其他独立的摘要文件。
  • 不得在规范图输出之外创建临时摘要。

0.4 Artifact Routing

0.4 工件路由

  • Write generated graph data only below repository
    _ai_sdlc/
    .
  • Keep versioned schemas and interpretation rules in this skill package.
  • Preserve repository-relative evidence paths and one-based source line numbers.
  • 仅在仓库的
    _ai_sdlc/
    目录下写入生成的图数据。
  • 在此技能包中保留版本化Schema和解释规则。
  • 保留仓库相对证据路径和从1开始的源文件行号。

0.5 Feature State Machine

0.5 特性状态机

  • Graph indexing is read-only with respect to feature lifecycle state.
  • Read canonical
    _ai_sdlc/state.toon
    before interpreting feature status; do not create a feature-local
    state.toon
    or change its sequencing.
  • A graph gap may block a later gate but cannot advance or reopen state itself.
  • 图索引对特性生命周期状态为只读。
  • 在解释特性状态前,先读取规范的
    _ai_sdlc/state.toon
    ;不得创建特性本地的
    state.toon
    或修改其顺序。
  • 图缺口可能会阻塞后续关卡,但无法自行推进或重新打开状态。

0.6 Artifact Metadata And Metatags

0.6 工件元数据与元标签

  • Node and edge records use
    ai-sdlc-delivery-node/v1
    and
    ai-sdlc-delivery-edge/v1
    .
  • The aggregate uses
    ai-sdlc-delivery-graph/v1
    and deterministic SHA-256 fingerprints derived from normalized content.
  • Evidence producers use
    ai-sdlc-evidence-source/v1
    ; generated freshness records and ledgers use
    ai-sdlc-evidence-record/v1
    and
    ai-sdlc-evidence-ledger/v1
    .
  • Source Markdown participates through canonical
    artifact_metadata
    and
    metatags
    ; graph output does not replace or rewrite that metadata.
  • 节点和边记录使用
    ai-sdlc-delivery-node/v1
    ai-sdlc-delivery-edge/v1
  • 聚合数据使用
    ai-sdlc-delivery-graph/v1
    ,以及基于标准化内容生成的确定性SHA-256指纹。
  • 证据生成者使用
    ai-sdlc-evidence-source/v1
    ;生成的新鲜度记录和分类账使用
    ai-sdlc-evidence-record/v1
    ai-sdlc-evidence-ledger/v1
  • 源Markdown通过规范的
    artifact_metadata
    metatags
    参与;图输出不会替换或重写该元数据。

0.7 Specs Index

0.7 规范索引

  • Read canonical
    _ai_sdlc/specs-index.toon
    first and use
    specs-index.md
    for human discovery across implementation and refinement workspaces.
  • Scope short trace IDs by feature directory to prevent cross-feature identity collisions.
  • Do not mutate either specs index during graph generation.
  • 先读取规范的
    _ai_sdlc/specs-index.toon
    ,并使用
    specs-index.md
    在实现和细化工作区中供人工查找。
  • 按特性目录限定短追溯ID的作用域,防止跨特性标识冲突。
  • 在图生成过程中不得修改任一规范索引。

References

参考资料

  • Read
    references/delivery-graph-contract.md
    before interpreting nodes, edges, gaps, or query paths.
  • Use
    references/delivery-node.schema.json
    ,
    references/delivery-edge.schema.json
    , and
    references/delivery-graph.schema.json
    for machine contracts.
  • Use
    scripts/delivery_graph.py
    for deterministic indexing and queries.
  • Read
    references/evidence-ledger-contract.md
    before registering or judging evidence freshness. Validate inputs and outputs with
    references/evidence-source.schema.json
    and
    references/evidence-ledger.schema.json
    .
  • Use
    scripts/evidence_ledger.py
    to recalculate current file identities, propagate stale state, and query fresh coverage.
  • 在解释节点、边、缺口或查询路径前,先阅读
    references/delivery-graph-contract.md
  • 使用
    references/delivery-node.schema.json
    references/delivery-edge.schema.json
    references/delivery-graph.schema.json
    作为机器契约。
  • 使用
    scripts/delivery_graph.py
    进行确定性索引和查询。
  • 在注册或判断证据新鲜度前,先阅读
    references/evidence-ledger-contract.md
    。使用
    references/evidence-source.schema.json
    references/evidence-ledger.schema.json
    验证输入和输出。
  • 使用
    scripts/evidence_ledger.py
    重新计算当前文件标识、传播过期状态并查询有效覆盖率。

Script Usage

脚本用法

bash
python3 skills/ai-sdlc-delivery-graph/scripts/delivery_graph.py . --index --write --format toon --quick-flow
python3 skills/ai-sdlc-delivery-graph/scripts/delivery_graph.py . --trace AC-004 --to T006 --format toon
python3 skills/ai-sdlc-delivery-graph/scripts/delivery_graph.py . --gaps --format markdown
python3 skills/ai-sdlc-delivery-graph/scripts/delivery_graph.py . --orphans --format toon
python3 skills/ai-sdlc-delivery-graph/scripts/evidence_ledger.py . --index --as-of 2026-07-19 --write --format toon
python3 skills/ai-sdlc-delivery-graph/scripts/evidence_ledger.py . --coverage --as-of 2026-07-19 --format toon
python3 skills/ai-sdlc-delivery-graph/scripts/evidence_ledger.py . --stale --as-of 2026-07-19 --format markdown
bash
python3 skills/ai-sdlc-delivery-graph/scripts/delivery_graph.py . --index --write --format toon --quick-flow
python3 skills/ai-sdlc-delivery-graph/scripts/delivery_graph.py . --trace AC-004 --to T006 --format toon
python3 skills/ai-sdlc-delivery-graph/scripts/delivery_graph.py . --gaps --format markdown
python3 skills/ai-sdlc-delivery-graph/scripts/delivery_graph.py . --orphans --format toon
python3 skills/ai-sdlc-delivery-graph/scripts/evidence_ledger.py . --index --as-of 2026-07-19 --write --format toon
python3 skills/ai-sdlc-delivery-graph/scripts/evidence_ledger.py . --coverage --as-of 2026-07-19 --format toon
python3 skills/ai-sdlc-delivery-graph/scripts/evidence_ledger.py . --stale --as-of 2026-07-19 --format markdown

Purpose

目的

Make lifecycle traceability executable so reviewers can prove why work exists, what verifies it, what shipped it, and where delivery evidence is missing.
让生命周期可追溯性可执行,以便审核者能够证明工作存在的原因、验证依据、交付渠道以及交付证据缺失的位置。

Inputs

输入

  • Stable trace identifiers in lifecycle Markdown.
  • Refs:
    lines or co-located declaration references.
  • Optional explicit
    Component: <path> -> <trace-id>
    and
    Evidence: <path> -> <trace-id>
    links.
  • Conventional commit bodies containing
    Spec:
    and
    Task:
    and annotated Git tags for release nodes.
  • 生命周期Markdown中的稳定追溯标识符。
  • Refs:
    行或同位置的声明引用。
  • 可选的显式
    Component: <path> -> <trace-id>
    Evidence: <path> -> <trace-id>
    链接。
  • 包含
    Spec:
    Task:
    的常规提交正文,以及用于发布节点的带注释Git标签。

Steps

步骤

  1. Scan canonical lifecycle Markdown and hash every input file.
  2. Scope declared and referenced trace IDs to their feature.
  3. Add only evidence-backed semantic edges and Git task/release edges.
  4. Normalize and fingerprint nodes, edges, sources, gaps, and coverage.
  5. Inspect orphan and missing-coverage results.
  6. Run trace queries using a scoped node ID when a short ID is ambiguous.
  7. Write generated projections only when explicitly requested.
  8. Register evidence with captured artifact and dependency hashes, expiry, and upstream evidence identities.
  9. Rebuild the ledger for an explicit
    as_of
    date; resolve missing, changed, expired, unknown, ambiguous, or cyclic evidence before claiming coverage.
  1. 扫描规范的生命周期Markdown并哈希每个输入文件。
  2. 将声明和引用的追溯ID限定到其所属特性。
  3. 仅添加有证据支持的语义边和Git任务/发布边。
  4. 对节点、边、源、缺口和覆盖率进行标准化处理并生成指纹。
  5. 检查孤立项和缺失覆盖率结果。
  6. 当短ID模糊时,使用作用域节点ID执行追溯查询。
  7. 仅在明确请求时写入生成的投影。
  8. 注册证据时,捕获工件和依赖哈希、过期时间以及上游证据标识。
  9. 针对明确的
    as_of
    日期重新构建分类账;在宣称覆盖率前,解决缺失、变更、过期、未知、模糊或循环的证据问题。

Output Spec

输出规范

The graph contains sorted nodes, edges, gaps, orphans, coverage counters, source hashes, and fingerprints. Rebuilding identical inputs produces byte-identical TOON, JSON, and Markdown.
The TOON/JSON evidence ledger contains recalculated file identities, resolved subjects, freshness states, reason codes, upstream state, stale paths, and fresh-only requirement coverage.
Quality gate:
  • Pass when all node and edge evidence resolves, identities are unambiguous, fingerprints recompute, and required coverage gaps are understood.
  • Fail when an explicit query is absent or ambiguous, an edge endpoint is missing, or generated output drifts from current authoritative inputs.
图包含排序后的节点、边、缺口、孤立项、覆盖率计数器、源哈希和指纹。重新构建相同输入会生成字节完全一致的TOON、JSON和Markdown文件。
TOON/JSON证据分类账包含重新计算的文件标识、解析后的主题、新鲜度状态、原因代码、上游状态、过期路径以及仅有效需求的覆盖率。
质量关卡:
  • 当所有节点和边证据都已解析、标识明确、指纹可重新计算,且已理解所需覆盖率缺口时,判定为通过。
  • 当显式查询缺失或模糊、边端点缺失,或生成的输出与当前权威输入偏离时,判定为失败。

Examples

示例

TC-004 / AC-004
declares a test and creates a
verifies
edge to the acceptance criterion. A following
Refs: AC-004
under
T006
creates a task
traces-to
edge. A commit with
Task: T006
creates an
implements
edge.
TC-004 / AC-004
声明了一个测试,并创建了指向验收标准的
verifies
边。
T006
下的后续
Refs: AC-004
创建了任务的
traces-to
边。包含
Task: T006
的提交创建了
implements
边。

Edge Cases

边缘情况

  • The same
    AC-001
    in two features is two nodes and requires a scoped query.
  • A reference without a local declaration still becomes a placeholder node and is reported as an orphan or coverage gap.
  • Git-less fixture directories still produce valid lifecycle graphs.
  • Generated graph files never become their own inputs.
  • Evidence dependency cycles, duplicate IDs, ambiguous subjects, and unknown upstream evidence fail closed.
  • 两个特性中的同一个
    AC-001
    是两个节点,需要使用作用域查询。
  • 没有本地声明的引用仍会成为占位节点,并被报告为孤立项或覆盖率缺口。
  • 无Git的 fixture目录仍能生成有效的生命周期图。
  • 生成的图文件永远不会成为自身的输入。
  • 证据依赖循环、重复ID、模糊主题和未知上游证据会导致封闭失败。

Scope Boundary

范围边界

  • Do not infer semantic similarity, ownership, or policy decisions.
  • Do not mark evidence fresh without matching current hashes, expiry, and all upstream evidence states.
  • Do not edit lifecycle artifacts to make a graph appear complete.
  • Do not treat graph generation as approval, validation evidence, or release.
  • Do not overwrite producer manifests or evidence artifacts during indexing.
  • 不得推断语义相似性、所有权或政策决策。
  • 若未匹配当前哈希、过期时间和所有上游证据状态,不得标记证据为有效。
  • 不得编辑生命周期工件以使图看起来完整。
  • 不得将图生成视为批准、验证证据或发布。
  • 在索引过程中不得覆盖生成者清单或证据工件。