From 6d113c32a34ae84d95763e762ac7ad0b8e82e71f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 24 Jun 2026 05:49:22 +0000 Subject: [PATCH] lance-graph-contract: mirror ConceptDomain::Automation (0x0C) from OGAR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wire-compat mirror of the OGAR ogar-vocab MARS/Automation codebook mint (AdaWorldAPI/OGAR, same branch). Without the matching ConceptDomain arm here, canonical_concept_domain(0x0Cxx) would return Automation in OGAR but Unassigned in the contract — a soft-fail wire-semantics drift (the integration-lead flagged this; the Anatomy 0x0A mint set the same two-repo precedent). - ConceptDomain::Automation variant + `0x0C => Automation` routing arm. - The 9 Automation concepts in CODEBOOK (0x0C01..0x0C09), so a zero-dep consumer can canonical_concept_id("mars_node_template") → 0x0C06. - domain_routes_on_high_byte: assert 0x0C → Automation, 0x0D → Unassigned. - codebook_ids_match_ogar_vocab drift guard: pin mars_application/knowledge_item/ mars_node_template/automation_trigger to their OGAR ids. Contract test suite green (the codebook + routing + drift-guard tests). Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP --- .../lance-graph-contract/src/ogar_codebook.rs | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/crates/lance-graph-contract/src/ogar_codebook.rs b/crates/lance-graph-contract/src/ogar_codebook.rs index e8119c59..45cd1326 100644 --- a/crates/lance-graph-contract/src/ogar_codebook.rs +++ b/crates/lance-graph-contract/src/ogar_codebook.rs @@ -60,7 +60,14 @@ pub enum ConceptDomain { Anatomy, /// `0x0BXX` — Auth (identity / authz: AuthStore, Zitadel, Zanzibar, Ory Keto). Auth, - /// Any high-byte slot not yet assigned a domain (`0x03XX`–`0x06XX`, `0x0CXX`+). + /// `0x0CXX` — Automation (the HIRO IT-automation stack: the MARS structural + /// CMDB — `mars_application` / `mars_resource` / `mars_software` / + /// `mars_machine` — and the Automation DO-arm actuators — `knowledge_item` / + /// `mars_node_template` / `action_handler` / `action_applicability` / + /// `automation_trigger`). Infrastructure config, not PHI. Mirrors OGAR + /// `ogar_vocab::ConceptDomain::Automation`. + Automation, + /// Any high-byte slot not yet assigned a domain (`0x03XX`–`0x06XX`, `0x0DXX`+). Unassigned, } @@ -79,6 +86,7 @@ pub fn canonical_concept_domain(id: u16) -> ConceptDomain { 0x09 => ConceptDomain::Health, 0x0A => ConceptDomain::Anatomy, 0x0B => ConceptDomain::Auth, + 0x0C => ConceptDomain::Automation, _ => ConceptDomain::Unassigned, } } @@ -321,6 +329,18 @@ pub const CODEBOOK: &[(&str, u16)] = &[ ("auth_zitadel", 0x0B02), ("auth_zanzibar", 0x0B03), ("auth_ory_keto", 0x0B04), + // ── 0x0CXX — Automation domain (HIRO IT-automation: MARS CMDB + DO-arm + // actuators; OGAR's 0x0C Automation domain). One domain spanning the MARS + // structural CMDB and the Automation behavioral vocabulary. ── + ("mars_application", 0x0C01), + ("mars_resource", 0x0C02), + ("mars_software", 0x0C03), + ("mars_machine", 0x0C04), + ("knowledge_item", 0x0C05), + ("mars_node_template", 0x0C06), + ("action_handler", 0x0C07), + ("action_applicability", 0x0C08), + ("automation_trigger", 0x0C09), ]; /// Resolve a **canonical-concept** string to its stable `u16` codebook id via @@ -394,7 +414,10 @@ mod tests { assert_eq!(canonical_concept_domain(0x0901), ConceptDomain::Health); assert_eq!(canonical_concept_domain(0x0A01), ConceptDomain::Anatomy); assert_eq!(canonical_concept_domain(0x0B01), ConceptDomain::Auth); + assert_eq!(canonical_concept_domain(0x0C01), ConceptDomain::Automation); + assert_eq!(canonical_concept_domain(0x0C09), ConceptDomain::Automation); assert_eq!(canonical_concept_domain(0x0500), ConceptDomain::Unassigned); + assert_eq!(canonical_concept_domain(0x0D00), ConceptDomain::Unassigned); } #[test] @@ -454,6 +477,11 @@ mod tests { assert_eq!(canonical_concept_id("vital_sign"), Some(0x0907)); assert_eq!(canonical_concept_id("auth_store"), Some(0x0B01)); assert_eq!(canonical_concept_id("auth_ory_keto"), Some(0x0B04)); + // 0x0CXX Automation (the MARS/Automation codebook pass minted these in OGAR). + assert_eq!(canonical_concept_id("mars_application"), Some(0x0C01)); + assert_eq!(canonical_concept_id("knowledge_item"), Some(0x0C05)); + assert_eq!(canonical_concept_id("mars_node_template"), Some(0x0C06)); + assert_eq!(canonical_concept_id("automation_trigger"), Some(0x0C09)); assert_eq!(canonical_concept_id("not_a_concept"), None); }