thing-contract: each field's type owns its domain (Seq, Version, Count, Segment), injective record keys, domain refusal cases, per-field privacy doctests
Seq, Version, Count and Segment check their domain in new, and their Deserialize calls new, so the constructors and every decode door hold one rule. Record keys take Segment so they split at the last dot; the asset key prefix is thing:asset_catalog:. result-missing-slot is dropped (CultLib's rule). Goldens are re-blessed in the next commit; this commit's goldens_match fails until then. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
649844aa59
commit
f2ab72d84d
13 changed files with 629 additions and 124 deletions
|
|
@ -5,6 +5,22 @@
|
|||
|
||||
use thing_contract::*;
|
||||
|
||||
pub fn seq(value: i32) -> Seq {
|
||||
Seq::new(value).unwrap()
|
||||
}
|
||||
|
||||
pub fn ver(value: i64) -> Version {
|
||||
Version::new(value).unwrap()
|
||||
}
|
||||
|
||||
pub fn count(value: i32) -> Count {
|
||||
Count::new(value).unwrap()
|
||||
}
|
||||
|
||||
pub fn seg(value: &str) -> Segment {
|
||||
Segment::new(value).unwrap()
|
||||
}
|
||||
|
||||
pub fn nid(id: &str) -> NodeId {
|
||||
NodeId::new(id)
|
||||
}
|
||||
|
|
@ -114,7 +130,7 @@ pub fn invocation() -> CommandInvocation {
|
|||
CommandInvocation {
|
||||
invocation_id: "3f2b8c1e-5d44-4a6b-9a07-1c2d3e4f5a6b".into(),
|
||||
surface_key: "thing:surface:provider.a.main".into(),
|
||||
surface_version: 7,
|
||||
surface_version: ver(7),
|
||||
command: CommandId::new("go"),
|
||||
payload: RecordPayload { schema: SchemaId::new("gamecult.thing.test.go.v1"), bytes: vec![0x91, 0x01, 0xff, 0x00] },
|
||||
captured: vec![
|
||||
|
|
|
|||
Loading…
Reference in a new issue