design: IRVersion is never enforced on decode #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
`IR.Types` haddock promises: "A version mismatch causes the engine to reject the document and roll back." But `FromJSON IRVersion` accepts any Int (IR/Types.hs:96-97) and nothing anywhere compares against `currentIRVersion`. A v1 document parses fine as long as the field names happen to match — the actual failure mode is a confusing field/tag parse error or, worse, silent acceptance.
Also: version-bump discipline is a comment ("Bump this whenever Condition or Action sums are extended") with no enforcement, and the Service.Action parser already grew a parallel compat mechanism (priority defaults to 100 when absent, IR/Types... IR/Domain/Service.hs:79,86) — two ad-hoc strategies for the same problem.
Proposal: `FromJSON IRDocument` checks version against a supported range and fails with a dedicated error; add a golden test that pins the wire format so an unbumped schema change fails CI. Coordinate with spec issue on rollback compatibility window (FrogOS/spec#4).