@@ -87,7 +87,7 @@ impl NamespaceRegistry {
8787 /// - `lance-graph-callcenter::hydration::parse_super_domain_name`
8888 /// - OQ-4 resolution in PR #366 / EPIPHANIES 2026-05-13 sprint-7 meta entry
8989 pub fn seed_defaults ( ) -> Self {
90- let mut ids = HashMap :: with_capacity ( 16 ) ;
90+ let mut ids = HashMap :: with_capacity ( 29 ) ;
9191 // Live cognitive namespaces.
9292 ids. insert ( "SMB" . to_string ( ) , 0 ) ; // export-only per v5 ratification
9393 ids. insert ( "WorkOrder" . to_string ( ) , 1 ) ;
@@ -108,6 +108,26 @@ impl NamespaceRegistry {
108108 ids. insert ( "Medical/HPO" . to_string ( ) , 17 ) ;
109109 ids. insert ( "Medical/DRON" . to_string ( ) , 18 ) ;
110110 ids. insert ( "Medical/CHEBI" . to_string ( ) , 19 ) ;
111+ // Foundation/<vocab> reserved range 20..=29 (PR-bO-1..bO-5, bO-8).
112+ // L1 upper ontology + L2 utility vocabularies hydrated by
113+ // lance-graph-ontology::hydrators. Public OWL/RDF sources kept
114+ // pristine in data/ontologies/; this registry is the local
115+ // IRI ↔ context_id matching table (O(1) via lance_cache).
116+ ids. insert ( "Foundation/DOLCE-DUL" . to_string ( ) , 20 ) ;
117+ ids. insert ( "Foundation/OWL-Time" . to_string ( ) , 21 ) ;
118+ ids. insert ( "Foundation/PROV-O" . to_string ( ) , 22 ) ;
119+ ids. insert ( "Foundation/QUDT" . to_string ( ) , 23 ) ;
120+ ids. insert ( "Foundation/schema-org" . to_string ( ) , 24 ) ;
121+ ids. insert ( "Foundation/SKOS" . to_string ( ) , 25 ) ;
122+ // FinancialAccounting/<vocab> reserved range 30..=39
123+ // (PR-bO-6, bO-7, bO-13, bO-15, bO-16).
124+ ids. insert ( "FinancialAccounting/FIBO-FND" . to_string ( ) , 30 ) ;
125+ ids. insert ( "FinancialAccounting/FIBO-BE" . to_string ( ) , 31 ) ;
126+ ids. insert ( "FinancialAccounting/ZUGFeRD" . to_string ( ) , 32 ) ;
127+ ids. insert ( "FinancialAccounting/ZUGFeRD-Rules" . to_string ( ) , 33 ) ;
128+ ids. insert ( "FinancialAccounting/SKR03" . to_string ( ) , 34 ) ;
129+ ids. insert ( "FinancialAccounting/SKR04" . to_string ( ) , 35 ) ;
130+ ids. insert ( "FinancialAccounting/SKR03-Bau" . to_string ( ) , 36 ) ;
111131 Self { ids }
112132 }
113133
@@ -147,9 +167,12 @@ impl NamespaceRegistry {
147167 self . ids . iter ( ) . map ( |( k, v) | ( k. as_str ( ) , * v) )
148168 }
149169
150- /// First context id that is not currently in use. Skips the seed ranges
151- /// to keep allocations dense within their family (v1 ids 0..=3 + 10..=19
152- /// occupied by `seed_defaults`; first dynamic id therefore lands at 20).
170+ /// First context id that is not currently in use. Walks `0u32..` and
171+ /// returns the first value not present in the registry. With the
172+ /// current `seed_defaults` (16 cognitive + 13 Foundation/FinancialAccounting
173+ /// entries), the seed occupies 0..=5 + 10..=19 + 20..=25 + 30..=36;
174+ /// the first dynamic id therefore lands at 6 (next gap), then 7..=9,
175+ /// then 26..=29, then 37+. Allocation stays dense across seed gaps.
153176 fn next_free_id ( & self ) -> u32 {
154177 let mut candidate: u32 = 0 ;
155178 let used: std:: collections:: BTreeSet < u32 > = self . ids . values ( ) . copied ( ) . collect ( ) ;
@@ -165,9 +188,15 @@ mod tests {
165188 use super :: * ;
166189
167190 #[ test]
168- fn seed_defaults_has_sixteen_entries ( ) {
191+ fn seed_defaults_has_twenty_nine_entries ( ) {
169192 let r = NamespaceRegistry :: seed_defaults ( ) ;
170- assert_eq ! ( r. len( ) , 16 ) ;
193+ // 6 cognitive (SMB, WorkOrder, Healthcare, Network, Email, SharePoint)
194+ // + 10 Medical/* (ICD10CM..CHEBI)
195+ // + 6 Foundation/* (DOLCE-DUL, OWL-Time, PROV-O, QUDT, schema-org, SKOS)
196+ // + 7 FinancialAccounting/* (FIBO-FND, FIBO-BE, ZUGFeRD, ZUGFeRD-Rules,
197+ // SKR03, SKR04, SKR03-Bau)
198+ // = 29
199+ assert_eq ! ( r. len( ) , 29 ) ;
171200 }
172201
173202 #[ test]
@@ -183,17 +212,26 @@ mod tests {
183212 // Medical/<sub> reserved range 10..=19.
184213 assert_eq ! ( r. get( "Medical/ICD10CM" ) , Some ( 10 ) ) ;
185214 assert_eq ! ( r. get( "Medical/CHEBI" ) , Some ( 19 ) ) ;
215+ // Foundation/<vocab> reserved range 20..=29.
216+ assert_eq ! ( r. get( "Foundation/DOLCE-DUL" ) , Some ( 20 ) ) ;
217+ assert_eq ! ( r. get( "Foundation/OWL-Time" ) , Some ( 21 ) ) ;
218+ assert_eq ! ( r. get( "Foundation/SKOS" ) , Some ( 25 ) ) ;
219+ // FinancialAccounting/<vocab> reserved range 30..=39.
220+ assert_eq ! ( r. get( "FinancialAccounting/FIBO-FND" ) , Some ( 30 ) ) ;
221+ assert_eq ! ( r. get( "FinancialAccounting/SKR03" ) , Some ( 34 ) ) ;
222+ assert_eq ! ( r. get( "FinancialAccounting/SKR04" ) , Some ( 35 ) ) ;
223+ assert_eq ! ( r. get( "FinancialAccounting/SKR03-Bau" ) , Some ( 36 ) ) ;
186224 }
187225
188226 #[ test]
189227 fn allocate_skips_to_first_unused_id ( ) {
190228 let mut r = NamespaceRegistry :: seed_defaults ( ) ;
191- // 0..=5 and 10..=19 are taken; first free id is 6.
229+ // Occupied: 0..=5, 10..=19, 20..=25, 30..=36. First free id is 6.
192230 let id = r. allocate ( "CallCenter" ) ;
193231 assert_eq ! ( id, 6 ) ;
194232 // Idempotent: re-allocate returns the same id.
195233 assert_eq ! ( r. allocate( "CallCenter" ) , 6 ) ;
196- // Next allocation skips again.
234+ // Next allocation skips again (still in 6..=9 gap) .
197235 assert_eq ! ( r. allocate( "Splat" ) , 7 ) ;
198236 }
199237
0 commit comments