contract: vendor the machine-snapshot checksum manifest and assert it here too (#208) - #210
Merged
Merged
Conversation
… here too (#208) contracts/machine_snapshot/ is vendored verbatim in TWO repos -- FactoryLM (producer) and MIRA (consumer) -- and MIRA PRD #3048 calls it the compatibility boundary both projects must test the exact same payload against. A checksum guard on ONE side does not protect a boundary. The failure mode is a one-sided edit, and the repo that edits its own copy keeps passing against it; neither goes red. MIRA added CHECKSUMS.sha256 + an integrity test in #3060, so until now the guard covered MIRA only. CHECKSUMS.sha256 is vendored byte-identical from MIRA. All six fixtures were verified byte-identical across both repos before vendoring, so this passes with no fixture changes. ALSO -- and this is what would have made the guard useless: the workflow's paths filter was services/plc-modbus/** only, so a PR editing ONLY a file under contracts/machine_snapshot/ never triggered the job. That is precisely the one-sided edit the guard exists to catch; it would have sat silent for its own purpose. contracts/machine_snapshot/** added. Proven by execution: 8 pass -> append a newline to snapshot_v1_valid.json -> the checksum test fails with the regeneration instructions -> restore -> 212 passed (204 on main + 8 new).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #208.
contracts/machine_snapshot/is vendored verbatim in two repositories — FactoryLM (producer) and MIRA (consumer) — and MIRA PRD #3048 calls it "the compatibility boundary between repositories; both projects must test against the exact same payload."A checksum guard on one side does not protect a boundary. The failure mode is a one-sided edit, and the repo that edits its own copy keeps passing against it — neither goes red. MIRA added
CHECKSUMS.sha256+ an integrity test in #3060, so until now the guard covered MIRA only.CHECKSUMS.sha256is vendored byte-identical from MIRA. All six fixtures were verified byte-identical across both repos immediately before vendoring, so this passes with no fixture changes.The part that would have made the guard useless
The workflow's paths filter was
services/plc-modbus/**only. A PR editing only a file undercontracts/machine_snapshot/never triggered the job — which is exactly the one-sided edit the guard exists to catch. It would have sat silent for its own purpose.contracts/machine_snapshot/**added to the filter, with a comment saying why so nobody prunes it later as noise.Evidence
Proven by execution, not asserted:
The guard also asserts every fixture on disk is listed, so a new unguarded fixture can't slip in behind a green check.
Note on the mechanism
Checksums detect drift; they don't prevent two copies existing. #208's step 2 — a real shared source (single-source + CI sync check, submodule/subtree, or a published contract package) — is still open and deliberately not attempted here. This is the floor, not the destination.