r13-cascade-single-source-idiom-contract-sourced-fields

Pattern: R13 Cascade Single-Source Idiom for Config-Sourced Fields

Rule (Bible v19.1.5 refinement): Any field also present in contract.yaml MUST be read at runtime, never hardcoded. Concrete idiom for server.py:

# DON'T (hardcoded = dual source of truth = cascade drift):
return {"framework": "Bible v19.1.3", ...}
 
# DO (config-sourced):
c = contract_enforcer.contract
return {"framework": f"Bible {c.get('framework_version', 'unknown')}", ...}

Why it matters: Bumping contract.yaml framework_version without updating the hardcoded string causes a drift-check CI failure at deploy time (declared-vs-live workflow). On FiveTran-God-Agent-MCP PR #10 this manifested as: contract declared v19.1.5, live /health reported v19.1.3 — a 4-site hardcode cascade gap. Fixed by f-string sourcing; 4 hardcoded strings collapsed to 1 config-lookup pattern.

Generalizes beyond framework_version: any of pair_slug, contract_version, pair_status, framework_version, or pair-added contract fields should be lookup-sourced. If you’re writing a string that matches a contract.yaml key, you’re writing cascade debt.

Verification: grep grep -n 'Bible v19\.\|"framework":' src/ must return zero hardcoded version strings. Only docstring/comment mentions are acceptable (they’re documentation, not runtime state).

Adoption path (Bible v19.1.6 candidate): promote this idiom from skill mcp-server-development Pattern 3 up into Bible 05_TOOL_STANDARD.md as the R13 canonical reference implementation.

Platform scope: framework-agnostic. Pattern applies to any pair with a contract.yaml → any MCP server on Bible v19.1.x.