feat(contract): facet_schema — classid-selected 6x2 | 4x3 | 2x48 facet readings#619
Merged
Conversation
…ings of the 12-byte facet payload
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.
Summary
Adds
lance_graph_contract::facet_schema— a small, purely additive modulethat formalizes the classid-selected format of a
FacetCascade's 12 payloadbytes.
96 bitstiles three ways, all exact, all re-tilings of the samebytes (no re-encoding, no byte moved):
TierCascade6 × (8:8)(part_of:is_a)FacetCascade::tiers/hi_chain/lo_chainSpoTriplet4 × (8:8:8)(subject:predicate:object)ruff_spo_*triple corpusPair482 × 48-bithelixSigned360andcam_pq[u8; 6]are both 48-bitNew API on
FacetCascade(allconst):payload(),schema(),as_triplets(),as_pair48(),from_triplets(),from_pair48(); plus theFacetSchemaenum +FacetSchema::of_classid().Scope / safety
pub modline; no existing type, method,or layout changed.
NodeRow.value/
ValueTenant/soa-value-tenant-migration-v1/v2surface is untouched —this is purely the 16-byte key facet.
FacetSchema::TierCascade == 0, so every existingfacet keeps its
6 × (8:8)meaning.schemasub-fieldwithin the
{domain}{schema}facet_classidis marked pending ratificationin
FacetSchema::of_classid(defaults toTierCascade); the explicitas_*/from_*accessors need no convention.Test Plan
#[cfg(test)]round-trip tests included (triplet/pair48 round-trip + classidpreserved; payload is the 12 bytes after the classid; both re-tilings are the
same bytes; schema defaults to
TierCascade). Relies on lance-graph CI forcargo test/clippy/fmt(authored via API without a local build).🤖 Generated with Claude Code
https://claude.ai/code/session_01Mwq1QKpw4zRd6oaGRoJhF2
Generated by Claude Code