Skip to content

dir-sim: licence-state planes through the DT64 lane and selection sockets - #2107

Merged
AdaWorldAPI merged 4 commits into
mainfrom
claude/dirsim-license-dt64
Nov 16, 2026
Merged

AdaWorldAPI merged 4 commits into
mainfrom
claude/dirsim-license-dt64

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

D-DIRSIM-LICENSE-DT64-1 binds the DR64 licence planes from #2105 through the existing DT64 sockets.

Rebased onto main (42d8b2a), which now contains #2105 and #2106. The PR is these four commits. It extends #2106's dt64 module, so dir-sim still has a single dt64 module.

Gate 0: source contract (corrections to #2105, commit cd0b537)

Findings 1 and 3 were confirmed in code and are fixed in license.rs. Finding 2 was already fixed on #2105's head (69d3b5f, a_repeated_user_is_refused_in_either_order); this PR adds a JSON null first-entry case.

Rule Test Disable run
A code's index is its content: (sku, via, state) order. Reordered pages or users give the same code at the same index. reordered_pages_and_users_keep_every_code_in_place first-seen order → red
Each code has a stable identity: predicate_iri and code_of. same —
A null first entry is still a duplicate. a_null_first_entry_is_still_a_duplicate —
Not listed, not read, read-empty and read-holding are four distinct answers. missing_empty_and_held_paths_stay_distinct —
The planes summarise and the evidence explains. The decoded pages are owned beside the planes, and explain(user, code) returns every path behind a bit, including each assignedByGroup. holder_count and path_count stay separate. the_evidence_keeps_both_assigning_groups_behind_one_bit explain ignoring direct vs group → red
assignedLicenses is a separate property with its own Evidence, never derived from the paths. effective_skus_are_not_assignment_paths effective SKUs read from paths → red
Coverage comes from @odata.nextLink, in any page order. Exactly one page ends the collection = Complete; a link nobody followed = Partial; two ends = Ambiguous. coverage_reads_the_page_links_in_any_order no end page treated as complete → red
The planes record the version they were built over. used by the Gate 1 refusals —

LicensePlanes::build now takes (view, version, Vec<LicensesPage>, Vec<SkuPage>) and owns the evidence instead of borrowing it.

Gate 1: the socket (dt64.rs, feature dt64)

  • LicenseLanes::over(&DirLanes, &LicensePlanes, class, scope) implements LaneSource and SelectionSource.
    • Its row order is the DirLanes coordinate space: that version's user ordinals.
    • It owns its own FrameStore.
    • It refuses another version, another population size, and a collection that is not Complete.
  • Fields bind by identity. lane_of maps basis.predicate_iri to a code and never reads the field position.
  • LicenseBasis::of(&planes, class) gives one field per code, in code order. A store binds it once (D5), so a changed codebook cannot be checked against the old class.
  • StatePlane is a membership mask, not a value lane. A reader uses contains(row) (bit extraction) or hands words() to mask-RISC as a mask. It has no path accessor.
  • Kept::and is a bitmap AND that refuses another relation size. Its result reaches a selection only through the existing select(&Kept) boundary.

Gates 2–4 (tests/license_dt64.rs, feature dt64)

The fixture has:

  • 512 users with exactly 64 codes (one full DR64 tile), and 5 groups;
  • every 7th user with two groups assigning the same SKU in the same state;
  • licence pages in 4 linked parts;
  • 5 users in one OU, and a later observation revision.

The oracle comes from the fixture's own rule, never from the planes. User ordinals follow the directory's GUID order, so the oracle maps users through View::user_ordinal.

Gate 2:

  • select users by licence state;
  • intersect with the 5-user OU selection; the result is read through both sockets in one row order, and its UPNs equal the view's;
  • resolve one user's 64 codes under the source frame;
  • recover both assigning groups behind one bit;
  • compare holders against paths;
  • refuse a 65th code.

Gate 4: typed refusals.

  • A reordered or later source: ForeignFrame.
  • A code that the old basis names and that no longer exists: Unbound. It is never read at the slot that now holds another code; a surviving code resolves to its new index.
  • A new basis against a store bound over the old one: Bind(_).
  • Mismatched versions: OtherVersion.
  • A foreign reader scope: Scope.
  • The wrong row order: CoordinateSpace.
  • A field outside the basis: FieldNotInBasis.
  • An assignedLicenses field: Unbound.
  • A partial collection: Incomplete(Partial).
  • An explanation for an unread user: ExplainRefusal::NotRead.

Disable runs:

  • Binding by position instead of identity: 2 tests red.
  • No coverage check: 1 test red.

Gate 3, measured. One run, release build, this container's VM; not certified on a dedicated host.

Phase Time Allocations
Plane construction 158 µs median (21 runs) —
Cold binding: source, basis, store, bind 45 µs 150 allocs, 18.9 KB
Selection positions: state ∩ OU, held by both sources 5.9 µs 15 allocs, 2.0 KB
Warm read: check, borrow, every selected bit 160 ns median 0 allocs (asserted)
Terminal: UPN strings 1.3 µs 3 allocs, 143 B
  • No user × SKU × group table is built. The resident planes take 4,096 B. A bit table over every user × code × group combination would take 20,480 B, and the query path's ~2 KB is asserted below a fraction of that.
  • The full operation is not zero-allocation. The cold binding and the selection lists allocate; only the warm read path is zero.

Locality questions (dr-dt64-locality-execution-contract.md)

  1. Resolved once per binding vs per operation.
    • Once per binding: code identity → code index, frame, scope and row order, plus the planes, built once per observation.
    • Per operation: the check (frame, route, basis count, per-field identity compare) and the bit reads.
  2. Witnesses. Source frame-store identity, route, basis digest, per-field predicate_iri, coordinate space (population and version), scope, and the planes' version and coverage.
  3. Bytes copied. Selection position lists (4 B per selected user) and the intersection bitmap. No plane bytes are copied.
  4. Measured vs hypothesis. The table above is measured. The rest is described from the code, not measured.

Consumer handoff (report-rs, later)

LicensePlanes::build(&view, version, licence_pages, sku_pages)?
DirLanes::new(&view, version, USER_CLASS, scope)
LicenseLanes::over(&dir, &planes, LICENSE_CLASS, scope)?   // refuses other version, size, incomplete pages
LicenseBasis::of(&planes, LICENSE_CLASS) → BindStore::register(...)
BindStore::bind_lanes(&basis, lic.frames(), &lic, LaneRequest { selection: dir.space(), .. })
  → LaneBinding::selected(field, sel) → (StatePlane, &[u32])   // StatePlane::contains(row)
planes.explain(user, code) / planes.paths(user) / planes.effective(user)   // evidence, typed refusals

Admission limits:

  • At most 64 codes, and one class basis per codebook.
  • Scope is a consistency check, not authorization. IAM decides separately (contract boundary 5); nothing here grants a field.

Open

  • Kept carries its relation's size, not its version. The caller vouches that both results are over the same version, and DT64 checks the coordinate space on read.
  • DR512 users × OU × group lanes are not built (kept separate, as requested).
  • capacity_coverage() exists for the SKU capacity pages, but nothing refuses on it yet.

Checks after the rebase:

  • dir-sim with dt64: 306 passed, 0 failed.
  • clippy -D warnings with dt64: clean.
  • Before the rebase, the run without features also passed (298), and clippy was clean without features and with rbac.
  • fmt clean.
  • The CI step in identity.yml runs license_dt64 with dt64.
  • Board row D-DIRSIM-LICENSE-DT64-1.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XAqKMQJzQD5KvNm8BtbsWG

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dcc0af64-7f94-472c-b169-4d5fab8b4fc1
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review November 16, 2026 14:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T14:30:03.653749Z f037d26 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

💡 Codex Review

Some(LaneAddr {
space: self.space(),
lane: u16::from(field),

P2 Badge Resolve directory lanes by predicate identity

When a caller registers a basis with SMTP before UPN, binding succeeds but field 0 returns UPN and field 1 returns SMTP because this implementation ignores basis and uses the field position as the physical lane. An unrelated predicate at either position is also accepted. LaneSource explicitly requires mapping the supplied FieldRef, and BindStore::bind_lanes only validates the caller's registered basis, not its correspondence to directory attributes. Resolve supported predicate identities to their physical lanes and return None for unsupported predicates so alternate bases cannot silently read the wrong property.


match (pages, ends) {
(0, _) => Coverage::NotCollected,
(_, 1) => Coverage::Complete,
(_, 0) => Coverage::Partial,

P2 Badge Verify pagination continuity before declaring complete coverage

If an intermediate page is missing but the final page is present, this classifies the collection as Complete: for a three-page collection, supplying only the first page with its next link and the terminal third page produces exactly one end. The link to the missing second page is never checked. LicenseLanes::over consequently accepts these incomplete planes, and users on the missing page are silently absent from licence-state selections. Preserve page provenance or a verified collection-completion witness and check continuity rather than treating the presence of one terminal page as proof that every next link was followed.

ℹ️ 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".

…ept with the planes

Gate 0 of D-DIRSIM-LICENSE-DT64-1 (corrections to #2105): code index = (sku, via, state) order with a stable predicate IRI per code; the decoded pages are owned as evidence (paths with assignedByGroup, effective SKUs kept separate); coverage from @odata.nextLink; the planes record their version.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on sockets

D-DIRSIM-LICENSE-DT64-1 Gates 1-4: LicenseLanes (LaneSource + SelectionSource) in the row order of the version's DirLanes; fields bind codes by predicate IRI; StatePlane is a membership mask, not a value lane; LicenseBasis; Kept::and; typed refusals; 512-user projection with oracle parity and allocation counts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… dt64

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AdaWorldAPI
AdaWorldAPI force-pushed the claude/dirsim-license-dt64 branch from f037d26 to 3844bf1 Compare November 16, 2026 14:35
@AdaWorldAPI
AdaWorldAPI merged commit a050f92 into main Nov 16, 2026
1 check passed
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