rbac: widen Axis-4 field projection to WideFieldMask - #1206
Merged
Conversation
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
AdaWorldAPI
marked this pull request as ready for review
September 6, 2026 13:44
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
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
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.
What
ClassRbac::field_maskandScopedDecision.field_maskreturned au64FieldMask, which silently drops every field position>= 64. A role granted{1, 7, 92}resolved to{1, 7}.Measured before the change:
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 WideFieldMaskalready 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-allocationSmalltier. Whether those defaults should beEMPTYis a separate security-semantic decision and is deliberately not bundled here.Tests
wide_grant_survives_the_axis_4_fold:{1,7,92}throughauthorize_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-targetsexit 0.lance-graph-contract+lance-graph-rbacfull suites green.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-rbacbranch of the same name.🤖 Generated with Claude Code
https://claude.ai/code/session_01PGkLH5cYiiWM4QmNkvBBvf
Generated by Claude Code