Generation Pipeline Lifecycle
Every artifact generated in DOCCAD proceeds through an immutable eight-step lifecycle:
Lifecycle Steps
- Contract Ingestion: Load YAML contract from
contracts/and verify requested input parameters. - Deterministic Context Retrieval: Gather canonical evidence matching
allowed_evidencepath globs. Reject any generated pages or files outside the allowlist. - Prompt Compilation: Assemble prompt template from
prompts/. Wrap each evidence file in<<<EVIDENCE-DATAdelimiters to prevent prompt injection. - Router Execution: Resolve the active provider chain from
ai.config.yaml. Execute the primary provider (e.g.fixturein demo mode, or cloud provider with fallback). - Output Parsing: Extract YAML frontmatter and markdown body from model output.
- Deterministic Quality Gates: Validate output against schemas, test internal links, ensure external links match the allowlist, and check for unsafe
<script>constructs. - Provenance Stamping: Recompute
sha256hashes for all evidence sources and stamp them into frontmatter alongside model, provider, and timestamp. - PR Branch Persistence: Commit candidate files to an isolated
docs-gen/*branch and open a PR. Never commit directly tomain.