present() refuses nil on decode and null/undefined on encode in every slot the Rust type does not make optional;
required() goes. mint runs the slot record, so factories hold every domain the decode door holds, and freezes the
outcome and effect deep. ParamName/Scalar become the C# arm codecs; lists are named IReadOnlyList<T>. codecs and
definitions tests read the names and members from tests/thing-contract-parity.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Present(ReadOnlyMemory<byte>) is deleted. The constructor copies any view, default
included, as an empty payload; a nil on the wire (which decodes to a default view) is
noted by the constructor and refused in OnAfterDeserialize, so the nil-positions rows hold.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MemoryMarshal.TryGetArray answers true for any empty view, so it cannot tell nil
from empty; equality with default can. The commit before this fails the new payload test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The nil-positions vector found the regression (invocation-all-inputs 4.1: the
view decodes nil to default and was accepted though Rust refuses). ThingDomain.Present
for byte views refuses an empty view with no backing store; an empty array stays a
present, empty payload. Test pins both and the empty payload's wire round trip.
The commits before this one fail NilPositionTests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The previous two commits do not build: Command.cs lacked the using. This one
restores the build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replaces the false comment that reopening never compares type names with the
end-to-end pin: id, content hash and a member type name moved together are
refused; the same patch without the type name opens.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under thing2:ruling:payload-bytes-read-only the payload holds a copy made at
construction (wire bytes unchanged). New tests: a T[] argument (including
through Builders.Boxed) is copied; no list of any decoded golden is writable;
a caller's buffer written after construction does not change the payload. The
byte[] exemption in the mutable-collection scan is removed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reopening a single-file store at CultLib b3bd8dd5 does not compare recorded type names (a store
patched in id and Int64 opens and reads), so the test hands ResolvePersistedSchema a persisted
catalog entry with one member type changed (and one with Assets as a List): both are refused,
and the same entry with a moved id and unchanged names resolves.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A store whose id still matches the local registry is not compared, so the patched store changes
the id and Int64 together, as a real shape change does. Presence threshold set to the measured
174 required slots. goldens/README.md is the base file plus the nil-vector section (the earlier
commit rewrote its line endings).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
catalog-members.tsv (27 rows) and type-names.txt (168 types) are generated from the C# types on
Yggdrasil at CultLib b3bd8dd5 and read by NameSetTests; the package owns the names, every other
runtime is held to them. NameSetTests also patches System.Int64 to System.Int32 in a store C#
wrote and requires reopen to refuse. Presence and list tests no longer count ThingDomainException
as a door.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The two previous GameCult.Thing.Contract commits do not build: ParamDecl's constructor assigned
InputKind. This restores Kind = Present(kind, "Kind").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deleted the 38 + 17 + 3 internal static Instance fields and public static unit-arm properties.
Unit arms are built with new ImageFitContain() and told by a type test; the arm constructors are
public. Builders rewritten (65 uses); UnitArmTests replaces the SameAs assertions: every decoded
unit arm is its arm type, no union base exposes a static member of its own kind, and
new ImageFitFill() still writes 92 02 90.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ThingDomain.Present and Items; every constructor, factory and key builder passes each non-nullable
reference parameter through Present (refusal names the slot, never a value) and each list through
Items (a private read-only copy, nil items refused). Lists are IReadOnlyList on every type.
TextInputNode's slot 2 property and parameter are InputKind, matching Rust input_kind.
Tests: NilPositionTests reads the Rust vector row by row; PresenceTests and ReadOnlyListTests
walk every door by reflection; InputKindNameTests. NameSetTests and the unit-arm rewrite follow.
Unit-arm statics are still present in this commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blessed with THING_BLESS=1 on Yggdrasil; the sha256 list of every existing golden is identical
before and after (only this file is new), and the compare run passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rename kind to input_kind at key 2 (the wire is the slot key; no golden byte moves).
nil_positions.rs walks every array element of every value golden, splices nil over it and
records whether the Rust decode door accepts it, into goldens/nil-positions.tsv. The tsv is
blessed by the next commit; this one builds, and its nil test fails until then.
golden_bytes, blessing and goldens_dir move to tests/common so both test files share one path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The factory and key builders took a non-integer through the decode leaf; the encode leaf refuses it. Deep chain bound corrected to 83 Box levels.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Goldens, refusals, store read, keys, domains at every constructor and every door (CultLib
MessagePack, MessagePack Standard, System.Text.Json), factories-only reflection, deepest chain
the 256 bound admits. Goldens are linked from crates/thing-contract/tests/goldens, read only.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
One C# type per Rust type, keys in the crate's slot order. Unions are abstract classes with an
internal constructor and sealed arms; unit arms are shared instances. ThingDomain owns the four
domains and ThingKeys the key grammar. CommandResult is built by four factories only; its
constructor is private. Builds against CultLib b3bd8dd5 through CultLibRoot. Tests follow in the
next commit; this one builds.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>