contract: unified ClassView render — facet value rows + is_a-walk resolution#650
Conversation
…olution
Additive, zero-dep extension of lance-graph-contract's class_view module
implementing the operator-confirmed "unified ClassView render": any app
calls the same projection — resolve (is_a rail) → carve (FieldMask) →
emit — with routes as thin per-app skins. Closes the two gaps the q2
cockpit-server OSINT card surfaced in the contract: a VALUE column read
from the node's 12-byte facet, and is_a-walk fallback so every classid
renders.
NEW `ValueRow<'a>` { label, predicate, position, value } — the
value-projected sibling of `RenderRow`: one populated field paired with
the byte it reads from the V3 content-blind 12-byte facet payload.
Position i binds to facet byte i per .claude/v3/soa_layout/le-contract.md
§3 (the payload is a dumb byte register the ClassView projects; the class
picks the reading, never a slot in the byte). Presence-only C2 holds: the
mask gates which rows exist, never what a byte means.
NEW provided trait methods (all defaulted → non-breaking for existing
implementors):
- `facet_rows(class, mask, &[u8;12]) -> Vec<ValueRow>` — emit a row for
each position that is BOTH mask-present AND < 12 (facet-backed).
Positions >= 12 are value-slab fields, out of facet scope — skipped,
never folded (mirrors the FieldMask 64-guard style).
- `is_a_parent(class) -> Option<ClassId>` — the taxonomy hop; default
None = no taxonomy.
- `resolve_render_class(class) -> ClassId` — the monotonic zero-fallback
ladder: bespoke card → nearest ancestor's card → original (empty
fields on the result = caller renders the generic facet dump). Walks
is_a_parent while fields are empty; cycle- and depth-safe via a hard
16-hop cap + an on-stack [ClassId;16] visited array (no HashSet).
Wires the already-locked E-V3-FACET-4-PLUS-12 §3 register into a
projection; no new doctrine. +7 tests (facet position/byte binding, off-
bit + >=12 skip, FULL-mask 3-field, is_a→ancestor, orphan→self, cycle +
self-loop termination, 20-parent depth cap, render_rows regression
canary). class_view 21/21, contract lib 822 green; fmt + clippy
(-D warnings, --all-targets) clean. Board: LATEST_STATE Contract
Inventory + AGENT_LOG entries same commit.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012jEwwaT5JZ5x8qWvcnaMYC
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR extends the ChangesClassView facet projection and taxonomy resolution
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Additive, zero-dep extension of
lance-graph-contract::class_viewimplementing the operator-ratified unified ClassView render: any app calls the same projection — resolve (is_a rail) → carve (FieldMask) → emit — with routes as thin per-app skins. This closes the two gaps the q2 cockpit-server OSINT card surfaced in the contract.What's added (all defaulted trait methods / new type — non-breaking for every implementor)
facet_rows— the value-projected sibling ofrender_rows: field position i binds to facet byte i per.claude/v3/soa_layout/le-contract.md§3 ("the 12-byte payload is a dumb byte register the ClassView projects"). Positions ≥ 12 are value-slab fields — skipped, never folded (mirrors theFieldMask64-guard). C2 presence-never-semantics holds: the mask gates which rows exist, never what a byte means.resolve_render_class— the zero-fallback render ladder: bespoke card → nearestis_aancestor with a non-empty field set → return the original class (emptyfields()on the result = caller renders the generic facet dump). 16-hop cap + on-stack visited array: cycle- and depth-safe, no allocation beyond the walk, never fails.is_a_parent— the taxonomy hop, defaultNone(walk degenerates to identity;OgarClassViewwiring from its subClassOf cache is follow-up).Verification
cargo test -p lance-graph-contract: class_view 21/21 (7 new), contract lib 822 passing, 0 failurescargo clippy -p lance-graph-contract --all-targets -- -D warningsclean; fmt cleanrender_rowsbehavior unchangedBoard hygiene (same commit)
LATEST_STATE.mdContract Inventory entry +AGENT_LOG.mdprepend. EPIPHANIES untouched deliberately — this wires the already-lockedE-V3-FACET-4-PLUS-12§3 register into a projection, no new doctrine.Consumer notes
Call
resolve_render_class(concept)first, thenfacet_rowson the resolved class. Per le-contract §3b, reading a new tenant lane downstream still owes an ICC/Spearman/Cronbach certification before the reading is trusted —facet_rowshands over bytes positionally, not a validated semantic reading.Merge order
This PR merges first. The companion q2 PR (cockpit unified card routes + OSINT detail popup) consumes this API via the path dep, and q2's Railway Dockerfile clones lance-graph @ main HEAD — the q2 build only sees this once it's on main.
🤖 Generated with Claude Code
Generated by Claude Code
Summary by CodeRabbit
New Features
Bug Fixes