lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

commit 582a37b43b56f20e51f0366652b93a67fbfc451c
parent 6aa22321792f6ed53e326d5a442d5598a64236f8
Author: triesap <tyson@radroots.org>
Date:   Mon,  6 Jul 2026 01:39:50 +0000

contracts: complete wiki article tag manifest

Diffstat:
Mcontracts/knowledge/knowledge_event_contract_manifest.v2.json | 21+++++++++++++++++++++
Mcontracts/knowledge/knowledge_event_contract_manifest.v2.sha256 | 2+-
Mcrates/events/src/contract.rs | 10++++++++++
Mcrates/events_codec/tests/knowledge_manifest.rs | 46++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 78 insertions(+), 1 deletion(-)

diff --git a/contracts/knowledge/knowledge_event_contract_manifest.v2.json b/contracts/knowledge/knowledge_event_contract_manifest.v2.json @@ -533,6 +533,27 @@ "semantic": "topic", "value_type": "text", "relay_indexed": true + }, + { + "name": "source", + "cardinality": "optional_many", + "semantic": "source", + "value_type": "event_pointer", + "relay_indexed": false + }, + { + "name": "a", + "cardinality": "optional_many", + "semantic": "addressable_coordinate", + "value_type": "addressable_coordinate", + "relay_indexed": true + }, + { + "name": "e", + "cardinality": "optional_many", + "semantic": "event_pointer", + "value_type": "event_id", + "relay_indexed": true } ], "reducers": [ diff --git a/contracts/knowledge/knowledge_event_contract_manifest.v2.sha256 b/contracts/knowledge/knowledge_event_contract_manifest.v2.sha256 @@ -1 +1 @@ -8249f0d85f0f618ed5c7bd2088171df1c80bb2cd6aef9a1577cd78b46215953e +29055d09268a110acfc95ebbcad1fcb763acda366fadc37ad81b59260b9d141d diff --git a/crates/events/src/contract.rs b/crates/events/src/contract.rs @@ -440,6 +440,13 @@ const TAG_A_OPTIONAL: RadrootsTagContract = tag( RadrootsTagValueType::AddressableCoordinate, true, ); +const TAG_A_MANY: RadrootsTagContract = tag( + "a", + RadrootsTagCardinality::OptionalMany, + RadrootsTagSemantic::AddressableCoordinate, + RadrootsTagValueType::AddressableCoordinate, + true, +); const TAG_E_ROOT: RadrootsTagContract = tag( "e", RadrootsTagCardinality::RequiredOne, @@ -654,6 +661,9 @@ const WIKI_ARTICLE_TAGS: &[RadrootsTagContract] = &[ TAG_SUMMARY, TAG_PUBLISHED_AT, TAG_TOPIC_MANY, + TAG_SOURCE_MANY, + TAG_A_MANY, + TAG_E_MANY, ]; const WIKI_REDIRECT_TAGS: &[RadrootsTagContract] = &[TAG_D, TAG_A_ADDRESS_REQUIRED]; const WIKI_MERGE_REQUEST_TAGS: &[RadrootsTagContract] = &[ diff --git a/crates/events_codec/tests/knowledge_manifest.rs b/crates/events_codec/tests/knowledge_manifest.rs @@ -149,6 +149,52 @@ fn knowledge_manifest_covers_required_fields_for_every_contract() { } #[test] +fn wiki_article_manifest_includes_reference_tag_contracts() { + let manifest = knowledge_contract_manifest(); + let article = manifest + .contracts + .iter() + .find(|contract| contract.contract_id == "radroots.wiki.article.v1") + .unwrap(); + + let expected = [ + ("d", "required_one", "identifier", "d_tag", true), + ("title", "optional_one", "title", "text", false), + ("summary", "optional_one", "summary", "text", false), + ( + "published_at", + "optional_one", + "published_at", + "unix_timestamp", + false, + ), + ("t", "optional_many", "topic", "text", true), + ("source", "optional_many", "source", "event_pointer", false), + ( + "a", + "optional_many", + "addressable_coordinate", + "addressable_coordinate", + true, + ), + ("e", "optional_many", "event_pointer", "event_id", true), + ]; + + assert_eq!(article.tag_contracts.len(), expected.len()); + for (name, cardinality, semantic, value_type, relay_indexed) in expected { + let tag = article + .tag_contracts + .iter() + .find(|tag| tag.name == name) + .unwrap(); + assert_eq!(tag.cardinality, cardinality); + assert_eq!(tag.semantic, semantic); + assert_eq!(tag.value_type, value_type); + assert_eq!(tag.relay_indexed, relay_indexed); + } +} + +#[test] fn knowledge_manifest_preserves_regular_immutable_classification() { let manifest = knowledge_contract_manifest(); for (contract_id, kind) in [