|
| 1 | +# ABI Contract Validation |
| 2 | + |
| 3 | +Roadmap linkage: |
| 4 | +- `t81-roadmap#2` |
| 5 | +- `t81-roadmap/PHASE1_STABILIZATION_MATRIX.md` (`P1-S3`) |
| 6 | + |
| 7 | +This document defines the ABI contract validation path for `ternary_gcc_plugin`. |
| 8 | + |
| 9 | +## Contract Scope |
| 10 | + |
| 11 | +The ABI contract is the union of: |
| 12 | + |
| 13 | +1. exported helper declarations in `include/ternary_runtime.h`, |
| 14 | +2. helper implementation coverage in `runtime/ternary_runtime.c`, |
| 15 | +3. helper symbol documentation in `README.md` and `docs/SPECIFICATION.md`. |
| 16 | + |
| 17 | +## Drift Policy |
| 18 | + |
| 19 | +Any change to helper declarations (add/remove/rename/signature change) must include: |
| 20 | + |
| 21 | +1. header updates (`include/ternary_runtime.h` and related helper headers), |
| 22 | +2. runtime implementation updates, |
| 23 | +3. documentation updates (`README.md`, `docs/SPECIFICATION.md`, and this page if process changes), |
| 24 | +4. successful ABI validation run via `scripts/validate_abi_contract.sh`. |
| 25 | + |
| 26 | +## Reproducible Validation |
| 27 | + |
| 28 | +Run: |
| 29 | + |
| 30 | +```bash |
| 31 | +scripts/validate_abi_contract.sh |
| 32 | +``` |
| 33 | + |
| 34 | +This command performs: |
| 35 | + |
| 36 | +1. helper-doc parity check (`tools/check_helper_docs.py`), |
| 37 | +2. compile/link smoke checks against runtime ABI (`tests/test_abi.c`, `tests/test_varargs.c`), |
| 38 | +3. execution of those ABI smoke binaries. |
| 39 | + |
| 40 | +## Escalation Rule |
| 41 | + |
| 42 | +If ABI drift impacts downstream ecosystem contracts, link follow-up work in: |
| 43 | + |
| 44 | +1. `t81-roadmap` Phase 1 tracker, |
| 45 | +2. downstream consumers (`t81-lang`, `t81-python`) when relevant. |
0 commit comments