feat(ogar-vocab): all_promoted_classes() — single enumerator over the 32 promoted concepts#90
Merged
Merged
Conversation
… 32 promoted concepts Adds `pub fn all_promoted_classes() -> Vec<Class>` to ogar-vocab. Returns every promoted class fn's output (`project()`, `project_work_item()`, …, `currency_policy()`) in `class_ids::ALL` order. # Why Drives the W0.2 prerequisite called out in the Redmine Integration Plan (REDMINE-INTEGRATION-PLAN.md, post-#89 fixup). Before this, the 32 promoted constructor fns existed but weren't enumerable as a slice — a consumer wanting to drive all of them at once (e.g. `ogar_adapter_surrealql::emit_surrealql_ddl(&[Class])` for a whole-schema DDL emit) had to hand-list 32 calls, drift-prone. ```rust use ogar_vocab::all_promoted_classes; use ogar_adapter_surrealql::emit_surrealql_ddl; let ddl = emit_surrealql_ddl(&all_promoted_classes()); // → SurrealQL DDL for the full 32-concept schema, in codebook // (class_ids::ALL) order. ``` # Tests (4) - `all_promoted_classes_matches_class_ids_all_in_length` — count gate - `all_promoted_classes_matches_class_ids_all_order` — position-by-position pin: each entry's canonical_concept + canonical_id match the same position in class_ids::ALL - `all_promoted_classes_has_no_duplicates` — defensive against copy-paste typos in the enumerator - `all_promoted_classes_every_class_has_canonical_id` — every entry must round-trip through canonical_id() A new codebook promotion that adds to `class_ids::ALL` but forgets a constructor call here fails the length/order tests immediately. # Coverage 64/64 ogar-vocab unit tests pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The W0.2 prerequisite from the Redmine Integration Plan
Per the post-#89 fixup, the Foundation phase needs an enumerator so
rm-storehas one call site for whole-schema DDL emission viaogar_adapter_surrealql::emit_surrealql_ddl(&[Class]). Today the32 promoted classes have constructor fns but no enumerator → drift-prone.
The fix
Usage:
Tests (4)
codebook entries that forget the constructor call
order as part of the contract
without setting its canonical_concept
64/64 ogar-vocab tests pass.
Unblocks
rm-storesubstrate (Redmine Integration Plan)🤖 Generated with Claude Code