Skip to content

feat(ogar-doc-ir): project — ClassView × WideFieldMask masking over the in-memory DocIr#220

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/ogar-docir-architecture-jjzlig
Jul 20, 2026
Merged

feat(ogar-doc-ir): project — ClassView × WideFieldMask masking over the in-memory DocIr#220
AdaWorldAPI merged 1 commit into
mainfrom
claude/ogar-docir-architecture-jjzlig

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

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 classview feature → project module:

  • field_mask(ir, view, class) -> WideFieldMask — bit i set iff the document carries the i-th field of the class. 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.
  • position_of(view, class, key) — maps a DocIr field key to its ClassView bit position (FieldRef.label, then predicate_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-ir never names the arm crate, never builds a Dataset, never serializes. This is ClassView addressing as masking over existing in-memory data, not a wire format (the Firewall, ADR-022/023).

Dependency + build discipline

  • 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 (feature off), so the observation IR still lands ahead of the W4 classid ratification.

Verification (Rust 1.95, -p ogar-doc-ir)

  • cargo test --features classview22 passed (6 new project tests: mask sets exactly the carried bits · off-vocabulary field dropped · predicate_iri matching · 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

…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.
@cursor

cursor Bot commented Jul 20, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot 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
AdaWorldAPI marked this pull request as ready for review July 20, 2026 22:33
@AdaWorldAPI
AdaWorldAPI merged commit 63ac9c0 into main Jul 20, 2026
2 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Jul 20, 2026
…chitecture-jjzlig"

This reverts commit 63ac9c0, reversing
changes made to 2255643.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants