Skip to content

Commit 6d113c3

Browse files
committed
lance-graph-contract: mirror ConceptDomain::Automation (0x0C) from OGAR
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EYvNjD8M8LMNYbRy3gq2FP
1 parent 1c6a7db commit 6d113c3

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

crates/lance-graph-contract/src/ogar_codebook.rs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ pub enum ConceptDomain {
6060
Anatomy,
6161
/// `0x0BXX` — Auth (identity / authz: AuthStore, Zitadel, Zanzibar, Ory Keto).
6262
Auth,
63-
/// Any high-byte slot not yet assigned a domain (`0x03XX`–`0x06XX`, `0x0CXX`+).
63+
/// `0x0CXX` — Automation (the HIRO IT-automation stack: the MARS structural
64+
/// CMDB — `mars_application` / `mars_resource` / `mars_software` /
65+
/// `mars_machine` — and the Automation DO-arm actuators — `knowledge_item` /
66+
/// `mars_node_template` / `action_handler` / `action_applicability` /
67+
/// `automation_trigger`). Infrastructure config, not PHI. Mirrors OGAR
68+
/// `ogar_vocab::ConceptDomain::Automation`.
69+
Automation,
70+
/// Any high-byte slot not yet assigned a domain (`0x03XX`–`0x06XX`, `0x0DXX`+).
6471
Unassigned,
6572
}
6673

@@ -79,6 +86,7 @@ pub fn canonical_concept_domain(id: u16) -> ConceptDomain {
7986
0x09 => ConceptDomain::Health,
8087
0x0A => ConceptDomain::Anatomy,
8188
0x0B => ConceptDomain::Auth,
89+
0x0C => ConceptDomain::Automation,
8290
_ => ConceptDomain::Unassigned,
8391
}
8492
}
@@ -321,6 +329,18 @@ pub const CODEBOOK: &[(&str, u16)] = &[
321329
("auth_zitadel", 0x0B02),
322330
("auth_zanzibar", 0x0B03),
323331
("auth_ory_keto", 0x0B04),
332+
// ── 0x0CXX — Automation domain (HIRO IT-automation: MARS CMDB + DO-arm
333+
// actuators; OGAR's 0x0C Automation domain). One domain spanning the MARS
334+
// structural CMDB and the Automation behavioral vocabulary. ──
335+
("mars_application", 0x0C01),
336+
("mars_resource", 0x0C02),
337+
("mars_software", 0x0C03),
338+
("mars_machine", 0x0C04),
339+
("knowledge_item", 0x0C05),
340+
("mars_node_template", 0x0C06),
341+
("action_handler", 0x0C07),
342+
("action_applicability", 0x0C08),
343+
("automation_trigger", 0x0C09),
324344
];
325345

326346
/// Resolve a **canonical-concept** string to its stable `u16` codebook id via
@@ -394,7 +414,10 @@ mod tests {
394414
assert_eq!(canonical_concept_domain(0x0901), ConceptDomain::Health);
395415
assert_eq!(canonical_concept_domain(0x0A01), ConceptDomain::Anatomy);
396416
assert_eq!(canonical_concept_domain(0x0B01), ConceptDomain::Auth);
417+
assert_eq!(canonical_concept_domain(0x0C01), ConceptDomain::Automation);
418+
assert_eq!(canonical_concept_domain(0x0C09), ConceptDomain::Automation);
397419
assert_eq!(canonical_concept_domain(0x0500), ConceptDomain::Unassigned);
420+
assert_eq!(canonical_concept_domain(0x0D00), ConceptDomain::Unassigned);
398421
}
399422

400423
#[test]
@@ -454,6 +477,11 @@ mod tests {
454477
assert_eq!(canonical_concept_id("vital_sign"), Some(0x0907));
455478
assert_eq!(canonical_concept_id("auth_store"), Some(0x0B01));
456479
assert_eq!(canonical_concept_id("auth_ory_keto"), Some(0x0B04));
480+
// 0x0CXX Automation (the MARS/Automation codebook pass minted these in OGAR).
481+
assert_eq!(canonical_concept_id("mars_application"), Some(0x0C01));
482+
assert_eq!(canonical_concept_id("knowledge_item"), Some(0x0C05));
483+
assert_eq!(canonical_concept_id("mars_node_template"), Some(0x0C06));
484+
assert_eq!(canonical_concept_id("automation_trigger"), Some(0x0C09));
457485
assert_eq!(canonical_concept_id("not_a_concept"), None);
458486
}
459487

0 commit comments

Comments
 (0)