ai-sdlc-delivery-graph: Repository Traceability
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.
0. Skill Card
- Skill name:
- 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 is requested
0.1 Required Inputs
- 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.
0.2 Clarification Rules
- 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.
0.2.1 Flow Mode Flags
- Support and ; 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.
0.3 Output Rules
- 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 with , , , and
; actions include , , and .
- Do not create , , or another standalone summary file.
- Do not create ad hoc summaries outside the canonical graph outputs.
0.4 Artifact Routing
- Write generated graph data only below repository .
- Keep versioned schemas and interpretation rules in this skill package.
- Preserve repository-relative evidence paths and one-based source line numbers.
0.5 Feature State Machine
- Graph indexing is read-only with respect to feature lifecycle state.
- Read canonical before interpreting feature status; do
not create a feature-local or change its sequencing.
- A graph gap may block a later gate but cannot advance or reopen state itself.
0.6 Artifact Metadata And Metatags
- Node and edge records use and
.
- 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 and
; graph output does not replace or rewrite that metadata.
0.7 Specs Index
- Read canonical
_ai_sdlc/specs-index.toon
first and use 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.
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.
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
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.
- lines or co-located declaration references.
- Optional explicit
Component: <path> -> <trace-id>
and
Evidence: <path> -> <trace-id>
links.
- Conventional commit bodies containing and and annotated Git
tags for release nodes.
Steps
- Scan canonical lifecycle Markdown and hash every input file.
- Scope declared and referenced trace IDs to their feature.
- Add only evidence-backed semantic edges and Git task/release edges.
- Normalize and fingerprint nodes, edges, sources, gaps, and coverage.
- Inspect orphan and missing-coverage results.
- Run trace queries using a scoped node ID when a short ID is ambiguous.
- Write generated projections only when explicitly requested.
- Register evidence with captured artifact and dependency hashes, expiry, and
upstream evidence identities.
- Rebuild the ledger for an explicit date; resolve missing, changed,
expired, unknown, ambiguous, or cyclic evidence before claiming coverage.
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.
Examples
declares a test and creates a
edge to the
acceptance criterion. A following
under
creates a task
edge. A commit with
creates an
edge.
Edge Cases
- The same 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.
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.