Skip to content

rbac: widen Axis-4 field projection to WideFieldMask - #1206

Merged
AdaWorldAPI merged 3 commits into
mainfrom
claude/patient-identity-architecture-r8lhi5
Sep 6, 2026
Merged

rbac: widen Axis-4 field projection to WideFieldMask#1206
AdaWorldAPI merged 3 commits into
mainfrom
claude/patient-identity-architecture-r8lhi5

Conversation

@claude

@claude claude Bot commented Sep 6, 2026

Copy link
Copy Markdown

What

ClassRbac::field_mask and ScopedDecision.field_mask returned a u64 FieldMask, which silently drops every field position >= 64. A role granted {1, 7, 92} resolved to {1, 7}.

Measured before the change:

WideFieldMask has 1/7/92 = true/true/true
FieldMask     has 1/7/92 = true/true/false
count: 3 vs 2

Both now carry WideFieldMask — the type both real consumers already speak (a2ui-server::project_surface, medcare-server::views::project, the latter having chosen it for exactly this ceiling). impl From<FieldMask> for WideFieldMask already existed, so every impl widens losslessly.

Width only, not policy

The trait default and the refused-decision arm both return WideFieldMask::from(FieldMask::FULL) — the same 64 low bits, zero-allocation Small tier. Whether those defaults should be EMPTY is a separate security-semantic decision and is deliberately not bundled here.

Tests

  • New wide_grant_survives_the_axis_4_fold: {1,7,92} through authorize_scoped, with an anti-vacuity assertion that the narrow type really would still lose 92 — so the regression cannot pass for the wrong reason if the seam is re-narrowed.
  • cargo check --workspace --all-targets exit 0.
  • lance-graph-contract + lance-graph-rbac full suites green.
  • Workspace-excluded lance-graph-ogar: 75/75 green.
  • a2ui-rs: zero files touched, suites green.

Second commit is doc-only: records that the canonical authority object rehomed to OGAR::ogar-rbac.

Consumed by AdaWorldAPI/OGAR's ogar-rbac branch of the same name.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PGkLH5cYiiWM4QmNkvBBvf


Generated by Claude Code

ClassRbac::field_mask and ScopedDecision.field_mask returned a u64
FieldMask, which silently drops every field position >= 64
(FieldMask::from_positions ignores them by documented contract). A role
granted {1, 7, 92} resolved to {1, 7}: the projection narrowed without
saying so, and no test could see it because no fixture used a position
past 64.

Both now carry WideFieldMask, the type both real consumers already speak
(a2ui-server::project_surface and medcare-server::views::project, the
latter having chosen it for exactly this ceiling).

Width only, not policy. The trait default and the refused-decision arm
both return WideFieldMask::from(FieldMask::FULL) -- the same 64 low bits,
lossless, zero-allocation Small tier. Whether those defaults should be
EMPTY is a separate security-semantic decision and is deliberately not
bundled here.

Adds wide_grant_survives_the_axis_4_fold: {1,7,92} through
authorize_scoped, with an anti-vacuity assertion that the narrow type
really would still lose 92, so the regression cannot pass for the wrong
reason if the seam is ever re-narrowed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PGkLH5cYiiWM4QmNkvBBvf
…rbac

Doc-only. The authority object now lives in OGAR/crates/ogar-rbac, where
it additionally takes its identity from ogar-auth's canonical user. This
copy stays only so the workspace-excluded adapter keeps building; it has
no consumers.

The orphan-rule reasoning already recorded here was NOT the thing that
moved: an authority object is the legal form in either crate, because
`impl ClassRbac for OgarClassView` is E0117 from any third crate whether
or not it shares a repository with the type.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PGkLH5cYiiWM4QmNkvBBvf
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

The `format` CI job failed on the wide-projection regression test added
in d57a8de: a single multi-line `assert_eq!` rustfmt wraps differently.

Formatting only, no behaviour change. My miss -- I ran `cargo fmt` on the
OGAR crates and on lance-graph-ogar, but never on the contract/rbac edits
themselves. `cargo fmt --all -- --check` is now clean and the regression
still passes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PGkLH5cYiiWM4QmNkvBBvf
@AdaWorldAPI
AdaWorldAPI merged commit 2918421 into main Sep 6, 2026
7 checks passed
AdaWorldAPI pushed a commit to AdaWorldAPI/OGAR that referenced this pull request Sep 6, 2026
AdaWorldAPI/lance-graph#1206 (the Axis-4 WideFieldMask widening) is
merged, so `main` now carries the widened `ClassRbac::field_mask` these
crates were pinned to a branch to reach.

Leaving the branch ref on OGAR main was the real exposure: a branch can
be deleted after its PR merges, and OGAR main would then stop resolving
its dependencies. Pointing at a feature branch was correct only while
that branch was the sole place the widened trait existed.

Resolves to main#2918421. ogar-auth 19/19, ogar-rbac 7/7, fmt and
clippy -D warnings clean.

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