feat(ogar-doc-ir): project — ClassView × WideFieldMask masking over the in-memory DocIr#220
Merged
Merged
Conversation
…he in-memory DocIr The neutral observation IR becomes addressable by a class's field basis WITHOUT serialization and WITHOUT depending on any consumer. The `project` module (off-by-default `classview` feature) hands out: - `field_mask(ir, view, class) -> WideFieldMask` — presence bits, read straight from `ir.fields` × `view.fields(class)` in memory. Presence IS the mask bit; no ∅ sentinel is invented at any boundary. - `masked_values(ir, view, class) -> Vec<MaskedField>` — the typed values addressed THROUGH the mask, borrowed in place, in class (bit) order. A consumer (e.g. lance-graph-arm-discovery) turns these into its own `Dataset`/`FeatureSpec` — presence → binary feature, addressed values → interned categories. The arrow points OUT: the neutral IR never names the arm, never builds a Dataset, never serializes (the Firewall, ADR-022/023). Depends only on the zero-dep masking contract (lance-graph-contract: ClassView / FieldMask / WideFieldMask), wired via `git branch = "main"` — the float-then-flip form the sibling ogar-class-view / ogar-from-ruff / ogar-render-askama crates use. Default build stays serde-only / no-canon, so the observation IR still lands ahead of the W4 classid ratification. 6 tests (generic over a test ClassView impl): mask sets exactly the carried bits, off-vocabulary fields drop at the boundary, predicate_iri matching, values in bit order, values agree with the mask, duplicate-first-wins.
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_81f598d9-4b15-444e-ba3b-5e4414baac31) |
AdaWorldAPI
marked this pull request as ready for review
July 20, 2026 22:33
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.
What
Makes the neutral observation IR (
DocIr) addressable by a class's field basis — the seam a discovery consumer (e.g.lance-graph-arm-discovery) needs — without serialization and without the IR depending on any consumer.New off-by-default
classviewfeature →projectmodule:field_mask(ir, view, class) -> WideFieldMask— bitiset iff the document carries thei-th field of the class. Read straight fromir.fields×view.fields(class)in memory. Presence IS the mask bit — no∅sentinel is invented at any boundary.masked_values(ir, view, class) -> Vec<MaskedField>— the typed values addressed through the mask, borrowed in place, in class (bit) order.position_of(view, class, key)— maps aDocIrfield key to itsClassViewbit position (FieldRef.label, thenpredicate_iri); an off-vocabulary key is dropped at the addressing boundary, never folded onto a valid bit.The dependency arrow points OUT
The neutral IR hands out a mask + addressed values; a consumer builds its own
Dataset/FeatureSpec— presence → binary feature, addressed values → interned categories.ogar-doc-irnever names the arm crate, never builds aDataset, never serializes. This isClassViewaddressing as masking over existing in-memory data, not a wire format (the Firewall, ADR-022/023).Dependency + build discipline
lance-graph-contract(ClassView/FieldMask/WideFieldMask), wired viagit branch = "main"— the float-then-flip form the siblingogar-class-view/ogar-from-ruff/ogar-render-askamacrates use.Verification (Rust 1.95,
-p ogar-doc-ir)cargo test --features classview→ 22 passed (6 newprojecttests: mask sets exactly the carried bits · off-vocabulary field dropped ·predicate_irimatching · values in bit order · values agree with the mask · duplicate-first-wins).cargo build(default) → serde-only, canon dep not pulled.cargo clippy --features classview --all-targets -- -D warnings→ clean.cargo fmt --check→ clean.🤖 Generated with Claude Code
Generated by Claude Code