What We Learned
Writing implementation-ready GitHub issues directly from API contracts (OpenAPI, Protobuf, service communication maps) surfaces schema drift that code reviews would miss. When we generated 16 Block C/E issues from choco-hq’s contract surface, the RBAC issue exposed three conflicting role definitions:- Proto (
common.proto:120): 6 roles — reader, contributor, editor, reviewer, maintainer, admin - DB migration (
000001_initial_schema.up.sql:80): 4 roles — owner, admin, editor, viewer - Acceptance criteria (
acceptance-criteria.yaml:415): 6 roles — aligned with proto
Why It Matters
Schema drift between contract layers (proto, DB, acceptance criteria) is invisible to CI. Linters check syntax, not semantic alignment. The only reliable detection method is a human or agent reading across contract boundaries — which is exactly what issue generation forces you to do. The cost gradient is steep: catching drift during issue writing is free. Catching it during code review costs a round-trip. Catching it in production costs an incident.The Pattern
- Read all contracts for the target scope (proto, OpenAPI, DB migrations, acceptance criteria)
- Cross-reference enums, field names, and cardinality across layers
- Flag mismatches as explicit acceptance criteria in the issue (e.g., “DB migration aligns CHECK constraint with proto enum”)
- Include the file paths and line numbers so the implementer can verify