Answer A-3: the finding writer is generic over the contract's plain structs, replacing A-1's accessors
mesh/check checking 51a9919c5622 on 60e99f38759b
mesh/delivery closed: a newer head of the same pull request

Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
2026-11-11 21:35:22 +01:00
parent 3e7befcb0b
commit 51a9919c56
@@ -21,3 +21,10 @@ names the principle that settles it, and is cited as "design 47 G A-n".
- **A-2** (§655; principle 7, the rule that code shared between modules lives in mesh-sdk) `nats-tools/internal/busarchive`
moves whole with `bussnap` into mesh-sdk as its own package `go/busarchive`, its tests with it; every other importer
(verify, the nightly dump) imports it from there, and no copy stays in mesh-catalog.
- **A-3** (§686, §640, §687; principle 7; replaces A-1) The generated contract types stay as they are, plain structs whose
fields every importer already reads; nothing is generated for the writer and no field is renamed. mesh-sdk's writer is
generic over the contract's body types (`Writer[F, C, S, A any]`, one type parameter per body) and works on their wire
form: it marshals a body, reads and sets `kind`, `scope`, `id`, `subject`, `at` and `since` by their contract names,
and runs `views.CheckFinding` on that form. A body whose wire form lacks a field the contract names fails loudly at its
first write (principle 3) and in the writer's unit test, which runs against the real generated types of
`mesh-conditions`.