Development record
jsonstrict.NoDuplicateKeys compares object keys byte-exactly, but encoding/json binds a struct field case-insensitively (its foldName: Unicode simple folding) and keeps the last match. So a receipt carrying "verificationResult": "REJECT" then "VerificationResult": "PROMOTE" passes the duplicate-key refusal and the receipt_gate reads PROMOTE, the exact reviewer-reads-REJECT, gate-reads-PROMOTE evasion the refusal exists to close; "disabled":false,"Disabled":true flips the rules.json kill switch the same way. The check must fold keys per object the way encoding/json matches them.
jsonstrict.NoDuplicateKeys compares object keys byte-exactly, but encoding/json binds a struct field case-insensitively (its foldName: Unicode simple folding) and keeps the last match. So a receipt carrying "verificationResult": "REJECT" then "VerificationResult": "PROMOTE" passes the duplicate-key refusal and the receipt_gate reads PROMOTE, the exact reviewer-reads-REJECT, gate-reads-PROMOTE evasion the refusal exists to close; "disabled":false,"Disabled":true flips the rules.json kill switch the same way. The check must fold keys per object the way encoding/json matches them.
Grounds
- pursued: every key spelling encoding/json binds to one field is refused as a duplicate; a spelling the decoder binds that NoDuplicateKeys admits (TestFoldingMatchesEncodingJSONAndEqualFold's premise failing, or a twin passing receipt_gate) would show it wrong
Frontmatter
| id | iss-2609252251311346 |
|---|---|
| type | issue |
| lifecycle | resolved |
| severity | major |
.abcd/work/issues/resolved/iss-2609252251311346-jsonstrict-noduplicatekeys-compares.md
open on GitHub ↗ · commit history ↗