diff --git a/crates/thing-testkit/fixtures/README.md b/crates/thing-testkit/fixtures/README.md new file mode 100644 index 0000000..edb41dc --- /dev/null +++ b/crates/thing-testkit/fixtures/README.md @@ -0,0 +1,22 @@ +# thing-testkit fixtures + +Each `.cc` is a CultCache single-file store of contract documents, written under the pinned +clock `2026-01-01T00:00:00Z`. The builders are `thing_testkit::fixture`; the bytes below are +frozen, and a normal test run only compares and reads them. The rows are the fixture table of +`docs/thing2-build-spec.md` section 2.5; map rules are those of the build spec. + +| File | Holds | Map rules | +|---|---|---| +| `f01-swarm-dashboard.surface.cc` | One surface: a Grid Box root, a Text bound with a Number Format, a Repeat over a RecordsSource prefix whose template binds Item members, and a Button whose CommandRef is declared | 6, 9 | +| `f09-composition-stack.surface.cc` | One surface whose Use passes one argument of each ArgValue arm and a Slot holding a second Use (two levels), and the publisher CompositionDocument both name | 5 | +| `f10-hostile.surface.cc` | Four surfaces, one hostile shape each: an undeclared CommandRef, a duplicate id after expansion, an unresolved Use, and a Bind whose schema no fixture provides; plus the one composition (`dup`) the duplicate-id surface expands | 4, 5, 6 | + +A surface whose bytes the contract refuses (an unknown union arm) cannot live in a store: that +case is `crates/thing-contract/tests/goldens/node-unknown-arm.bin`, read in place and fed to +`MemState::put_raw`. + +## Regenerate + +`THING_BLESS=1 cargo test -p thing-testkit --test fixtures every_fixture_round_trips` rewrites +the files through `golden::check`, the one bless door; review the diff before committing. Run +the tests without `THING_BLESS` to compare.