Skip to content

feat(contract): 6×(8:8) FacetCascade + V3 (part_of:is_a) fold + OSINT-V3 (custom:canon split)#613

Merged
AdaWorldAPI merged 2 commits into
mainfrom
claude/p-a-readmode-tail-variant
Jun 25, 2026
Merged

feat(contract): 6×(8:8) FacetCascade + V3 (part_of:is_a) fold + OSINT-V3 (custom:canon split)#613
AdaWorldAPI merged 2 commits into
mainfrom
claude/p-a-readmode-tail-variant

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jun 25, 2026

Copy link
Copy Markdown
Owner

What (P-A)

Extends the canonical classid → ReadMode registry with the tail_variant axis — which KEY shape (V1 / V2 / V3) a classid mints, resolved by the same classid_read_mode(c) lookup that already resolves value_schema and edge_codec. This is the reusable mechanism for the SoA value-tenant migration: migrating a class's identity to V3 = flip tail_variant on its ReadMode const; later migrating its tenants = flip value_schema on the same const. Two field-flips on one registry entry, no consumer rewrite either time.

Companion to #612 (the §2.2 doc correction); this is the code that §2.2 describes.

Changes (crates/lance-graph-contract)

  • New TailVariant { V1=0 (default), V2, V3 } enum (+ is_layout_preserving).
  • ReadMode gains tail_variant as its first field; all five existing consts pinned to TailVariant::V1zero re-mint of the V1/V2 corpus (RESERVE-DON'T-RECLAIM; DEFAULT.tail_variant = V1).
  • is_layout_preserving extended to the three-axis form.
  • Structural parity fuse (compile-time const _): asserts ReadMode's field set == the three canon axes {tail_variant, value_schema, edge_codec} from OGAR feat: Phase 3 BF16 wiring + φ-spiral reconstruction theory #128 — structural-against-canon, not runtime (OGAR's tail_variant is to-wire too).
  • guid-v3-tail feature gates the first V3 entry: CLASSID_OSINT_V3 = 0x1000_0700 + ReadMode::OSINT_V3 {V3, Cognitive, CoarseOnly} + BUILTIN_READ_MODES insert.

Tests

  • read_mode_osint_v3_routes_v3_tail_and_osint_domain asserts classid_read_mode(0x1000_0700).tail_variant == V3 and classid_concept_domain(0x1000_0700) == Osint — proving the high-u16 marker routes V3 without touching the canon domain byte.
  • Green: 736 lib (default) / 737 (guid-v3-tail), clippy -D warnings clean.

FMA-V3 (0x1000_0A01) and Genetics-V3 (domain TBD) are deferred ("rest later").

🤖 Generated with Claude Code

https://claude.ai/code/session_01TzqvDqbFRzyx17EkLKBoZF


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for an additional routing variant for certain graph identities, improving path selection for newer data layouts.
    • Introduced richer facet-based metadata handling for reading and interpreting graph nodes.
  • Bug Fixes

    • Fixed a routing edge case where some identities could be incorrectly folded into an empty path.
    • Clarified and corrected how routing behaves across older and newer layout variants.
  • Documentation

    • Updated internal release documentation to describe the new routing and facet behavior more clearly.

…(P-A)

Extend the single classid→ReadMode dispatch with a third axis tail_variant
{V1,V2,V3} resolved by classid_read_mode(), mirroring OGAR #128's
classid → {tail_variant, value_schema, edge_codec} envelope parser. Never a
public new_v3 — the registry field IS the mechanism, symmetric with value_schema.

Additive / default-V1 / non-breaking (nothing reads tail_variant yet). DEFAULT +
OSINT/FMA/PROJECT/ERP = V1 (L1, no corpus re-mint). Structural parity fuse names
all three axes vs the #128 canon.

OSINT-V3 is the first wired V3 class (gated `guid-v3-tail`):
  CLASSID_OSINT_V3 = 0x1000_0700 — the generation marker sits in the HIGH (custom)
  u16, leaving the canon LOW u16 (0xDDCC) untouched, so classid_concept_domain
  (which masks `classid as u16`) still routes ConceptDomain::Osint. This is the
  Codex-P1 fix: the rejected low-half 0x0000_1007 read domain 0x10 = Unassigned.
  No router flip — the live Custom:Canon byte order is preserved.

OSINT_V3 ReadMode = {V3, Cognitive, CoarseOnly} (same value model as OSINT, V3
tail). Gated test proves BOTH facts: tail_variant == V3 AND
classid_concept_domain(0x1000_0700) == Osint. FMA-V3 (0x1000_0A01) + Genetics
(domain TBD — 0x0D is HR, not Genetics) deferred to a follow-up.

Plan: .claude/plans/soa-value-tenant-migration-v2.md §2.1/§2.2.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TzqvDqbFRzyx17EkLKBoZF
@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This PR adds a guid-v3-tail feature flag, expands ReadMode with a TailVariant axis, introduces FacetTier and FacetCascade, adds V3 HHTL prefix folding, and routes soa_graph::hhtl_path through the V3 path when enabled.

Changes

V3 tail routing and facet substrate

Layer / File(s) Summary
Public contract and routing axis
crates/lance-graph-contract/Cargo.toml, crates/lance-graph-contract/src/canonical_node.rs
Adds the guid-v3-tail feature, NodeGuid::CLASSID_OSINT_V3, TailVariant, expanded ReadMode constants, conditional built-in routing, and the ReadMode tail-axis tests.
Facet cascade types
crates/lance-graph-contract/src/canonical_node.rs, .claude/board/LATEST_STATE.md
Adds FacetTier and FacetCascade with byte serialization, tier projections, chain accessors, distance metrics, validation tests, and the inventory note for the facet substrate.
V3 HHTL prefix folding
crates/lance-graph-contract/src/hhtl.rs, .claude/board/EPIPHANIES.md
Clarifies the v1 folding rule, adds from_guid_prefix_v3, and verifies v1 rejection, V3 path construction, and byte-sensitive routing in tests.
SoA graph V3 routing
crates/lance-graph-contract/src/soa_graph.rs
Selects NiblePath::from_guid_prefix_v3 for V3 tail variants and keeps the existing fallback for other modes.

Sequence Diagram(s)

sequenceDiagram
  participant H as soa_graph::hhtl_path
  participant R as classid_read_mode
  participant V3 as NiblePath::from_guid_prefix_v3
  participant V1 as NiblePath::from_guid_prefix
  H->>R: guid.classid()
  R-->>H: tail_variant
  alt tail_variant == V3
    H->>V3: guid
  else
    H->>V1: guid
  end
Loading
sequenceDiagram
  participant G as NodeGuid
  participant P as NiblePath::from_guid_prefix_v3
  participant F as from_packed
  G->>P: raw GUID bytes
  P->>F: full-depth HEEL·HIP·TWIG·LEAF path
  F-->>P: NiblePath or EMPTY
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Poem

🐰 I hopped through bytes with jaunty grace,
and found the V3 rabbit place.
Facets twinkled, paths stayed bright,
one nibble left, one nibble right.
A carrot toast to routes anew!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title reflects the main changes: FacetCascade, V3 folding, and OSINT-V3 routing.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fd1302fcca

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

/// `classid as u16` → low half) — unlike the rejected low-half `0x0000_1007`,
/// which read domain `0x10` = `Unassigned`. Resolves to [`ReadMode::OSINT_V3`].
#[cfg(feature = "guid-v3-tail")]
pub const CLASSID_OSINT_V3: u32 = 0x1000_0700;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid using a high-u16 V3 class marker

With guid-v3-tail enabled, this high-u16 marker makes every OSINT-V3 NodeGuid fail the existing HHTL lowering: NiblePath::from_guid_prefix returns None whenever classid >> 16 != 0 (crates/lance-graph-contract/src/hhtl.rs:291-299), and soa_graph::hhtl_path turns that into NiblePath::EMPTY (crates/lance-graph-contract/src/soa_graph.rs:143-149). Any OSINT-V3 domain projected through the existing graph surface will therefore render hhtl_depth = 0 and nearest_anchor will compare empty paths rather than the node's HEEL/HIP/TWIG prefix; either reserve a marker that the prefix fold can carry or add a V3-aware path lowering before registering this classid.

Useful? React with 👍 / 👎.

Resolves the Codex P2 on #613 (OSINT-V3 0x1000_0700 folded to EMPTY on the
graph surface) and lands the operator-directed 6-tier homogeneous facet.

Key-side routing (hhtl.rs / soa_graph.rs):
- NiblePath::from_guid_prefix_v3 (feature guid-v3-tail) folds the 4 HHTL
  tiers HEEL·HIP·TWIG·LEAF in FULL — BOTH bytes per 8:8 tile (part_of high +
  is_a low), depth 16. classid is NOT folded, so a V3 classid's high-u16
  generation marker never gates routing.
- soa_graph::hhtl_path is now schema-driven: a V3 classid (tail_variant==V3)
  routes via from_guid_prefix_v3 -> non-empty path; every other classid keeps
  the v1 fold. Fixes the latent EMPTY-fold.
- from_guid_prefix's "high u16 reserved-zero" doc + guard scoped to v1-fold;
  NOT a global classid law (V3 abolishes it by never folding classid).

Value-side facet (canonical_node.rs):
- FacetTier { lo, hi } (2B) + FacetCascade { facet_classid: u32,
  tiers: [FacetTier;6] } (16B = facet_classid(4) | 6x(8:8)=12, harvest 5.1).
- ALWAYS 8:8, content-blind: only the consumer projects meaning
  (part_of:is_a / 256:256 palette centroid / group:member / column:row /
  concatenated u16 ...). as_u16 + morton (the 2bit x 2bit Morton-tile reading,
  the amortization benefit), hi_chain/lo_chain, hi_distance/lo_distance.
- A reading over a borrowed [u8;16] - carries NO value-slab offset, so it
  does not touch the operator-LOCKED 480B layout (the classid->ClassView
  byte-pick is the separate, panel-gated step).

Board hygiene: EPIPHANIES E-FACET-8-8-ALWAYS + LATEST_STATE Contract Inventory.

739 lib tests green (default 737 + guid-v3-tail), clippy -D warnings + fmt clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TzqvDqbFRzyx17EkLKBoZF
@AdaWorldAPI AdaWorldAPI changed the title feat(contract): ReadMode tail_variant axis + OSINT-V3 high-u16 gen-marker (P-A) feat(contract): 6×(8:8) FacetCascade + V3 (part_of:is_a) fold + OSINT-V3 (custom:canon split) Jun 25, 2026
@AdaWorldAPI AdaWorldAPI merged commit 6136eb5 into main Jun 25, 2026
5 of 6 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Jun 25, 2026
CodeRabbit flagged MD028 on #614 — the blank line between the new facet
entry and the #613 entry breaks the blockquote. Quote it (`>`) so the two
entries stay in one blockquote, the fix CodeRabbit suggested.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TzqvDqbFRzyx17EkLKBoZF
AdaWorldAPI pushed a commit that referenced this pull request Jun 25, 2026
Same MD028 fix as #614: quote (`>`) the blank line between the new Phase-1
entry and the #613 entry so they stay one blockquote. Preempts the
identical CodeRabbit nit on this PR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TzqvDqbFRzyx17EkLKBoZF
AdaWorldAPI pushed a commit that referenced this pull request Jun 26, 2026
…bstrate

The doc was authored without awareness that V3 shipped (#613/#614 FacetCascade,
#615 mint_for). Three alignments; the AST-as-(part_of:is_a) idea is preserved:

- Slot-count "open gate" CLOSED: facet.rs FacetCascade = facet_classid(4) |
  6x(8:8) = 6 tiers (HEEL.HIP.TWIG.LEAF.family.identity), const_-asserted = the
  full-key 6-pair/12-slot answer; the key carries the 4-tier routing prefix
  (NiblePath::from_guid_prefix_v3), the complete address is the FacetCascade
  value facet. Nothing left to ratify.
- Carrier NOT missing: FacetCascade is content-blind and already lists
  (part_of:is_a) as a consumer projection (hi_chain=part_of, lo_chain=is_a).
  Only the deterministic rank-minter is genuinely new; it writes into existing
  tiers (no new type/layout).
- classid row is 0x1000_0700-shaped (shipped CLASSID_OSINT_V3: marker hi u16,
  domain on lo u16); its (part_of:is_a) ordering flagged OPEN pending the
  operator's Canon:Custom correction.

Doc-only, CONJECTURE status retained.

Claude-Session: https://claude.ai/code/session_01TANd15SECEb1Gm4cpaRVD9
AdaWorldAPI pushed a commit that referenced this pull request Jun 26, 2026
Operator decision (2026-06-26): the classid half-order flip
[custom(hi):canon(lo)] -> [canon(hi):custom(lo)] is deferred. It happens only
after (1) Phase 1 is complete AND (2) OSINT + FMA + CPIC are all re-encoded to
V3 shape (current custom:canon convention + high-u16 0x1000_xxxx gen marker;
OSINT done #613, FMA-V3 + CPIC-V3/Genetics-slot still to mint), then flipped
once, atomically, across the whole V3 set.

Forcing reason recorded in new §2.3: the flip reinterprets routing on every
classid (post-flip classid_concept_domain reads the HIGH u16), so a half-flipped
corpus mis-routes by construction — the I-LEGACY-API-FEATURE-GATED failure mode
(one accessor, two silent semantics by state). So the flip must be a single
coordinated reorder over a known-complete V3 set, never trickled in per consumer.

facet_mint's facet_classid stays a parameter (bakes in no half-order), so brick 2
is unaffected by the deferral. §7 Canon:Custom paragraph + brick-1 row updated to
"DEFERRED (§2.3)"; no shipped classid touched. Board: LATEST_STATE operator-
decision note prepended.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TANd15SECEb1Gm4cpaRVD9
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