|
| 1 | +# Teploy contracts corpus — MANIFEST |
| 2 | + |
| 3 | +The machine-interface fixture corpus (X02 S2; ADR `_internal/ |
| 4 | +X02_RESOURCE_CONTRACT_ADR_2026-09-22.md` §4, adopted by |
| 5 | +DELEGATED_DECISIONS_2026-09-23 D15). teploy-cli owns the corpus because it |
| 6 | +produces the envelopes and sits at the bottom of the stack with no |
| 7 | +Neutron/Nucleus dependency and a public mirror. |
| 8 | + |
| 9 | +## Revision table |
| 10 | + |
| 11 | +| Corpus rev | Emitting CLI | Machine Interface | Notes | |
| 12 | +|---|---|---|---| |
| 13 | +| 1 | post-v0.1.37 main (S2 skeleton) | 1 | First goldens: version handshake, app-list envelope (MI + pre-MI legacy), error envelope (config-invalid, internal, invalid-code), release-record, attempt-name grammar, preview-state eras. | |
| 14 | + |
| 15 | +## Artifact status |
| 16 | + |
| 17 | +| Artifact | Schema | Fixtures | Producer | |
| 18 | +|---|---|---|---| |
| 19 | +| version-handshake | yes | valid (real `writeVersion` encoder) | teploy-cli | |
| 20 | +| app-list-envelope | yes | valid (real DTO tags) + legacy pre-MI | teploy-cli | |
| 21 | +| server-status-envelope | yes (appStatus root) | pending S2 tail (live `server status` capture) | teploy-cli | |
| 22 | +| error-envelope | yes | valid x2 + invalid code | teploy-cli | |
| 23 | +| release-record | yes | valid container | teploy-cli | |
| 24 | +| attempt-name | yes (pattern) | valid + invalid examples | teploy-cli | |
| 25 | +| preview-state | yes (canonical/legacy) | valid + legacy + ambiguous | teploy-cli | |
| 26 | +| observation-envelope | yes | pending S6 (dash encoder) | teploy-dash | |
| 27 | +| operation-record | yes | pending S5/S6 (dash) | teploy-dash | |
| 28 | + |
| 29 | +## Rules |
| 30 | + |
| 31 | +- Fixtures under `valid/` and `legacy/` are GENERATED from the real |
| 32 | + encoders where a CLI producer exists (`internal/cli/ |
| 33 | + contracts_golden_test.go`, run with `TEPLOY_UPDATE_CONTRACTS=1` to |
| 34 | + rewrite). Hand-authored fixtures say so in this file. Never edit a |
| 35 | + generated fixture by hand. |
| 36 | +- `invalid/` and `ambiguous/` fixtures MUST fail schema validation / |
| 37 | + adoption respectively — they pin refusals, not shapes. |
| 38 | +- A corpus change lands in the SAME commit as the code that changed the |
| 39 | + contract, with this manifest's revision table bumped. Non-additive |
| 40 | + changes bump `machine_interface` (D8) and are coordinated with |
| 41 | + teploy-dash's decoder first. |
| 42 | +- Legacy fixtures are first-class forever: an id-less server, a pre-MI |
| 43 | + envelope, a slug-keyed preview are states real deployments carry. |
| 44 | + |
| 45 | +## Regeneration |
| 46 | + |
| 47 | +``` |
| 48 | +cd teploy-cli |
| 49 | +TEPLOY_UPDATE_CONTRACTS=1 go test ./internal/cli/ -run TestContracts |
| 50 | +``` |
| 51 | + |
| 52 | +CI runs the same test WITHOUT the env var: any drift between the corpus |
| 53 | +and the encoders fails the build. |
| 54 | + |
| 55 | +## Known downgrade hazard (from the ADR §5 row 1) |
| 56 | + |
| 57 | +An older CLI rewriting `~/.teploy/servers.yml` silently drops unknown |
| 58 | +fields, so an `id` minted by a newer CLI can vanish on downgrade. The |
| 59 | +file itself cannot enforce it; the mitigation is consumer-side (dash |
| 60 | +treats id-vanished as ambiguous-legacy requiring explicit re-binding, |
| 61 | +never auto-re-mint). Consumers MUST NOT treat a missing |
| 62 | +`machine_interface` field as MI 0 — it means "pre-MI producer", the |
| 63 | +legacy decode path. |
0 commit comments