Skip to content

test: compare access decisions across the two storage layouts #1870 - #1892

Open
DmytroZaichenkoDev wants to merge 2 commits into
feat/issue-1870-1-replay-difffrom
feat/issue-1870-2-access-differ
Open

DmytroZaichenkoDev wants to merge 2 commits into
feat/issue-1870-1-replay-difffrom
feat/issue-1870-2-access-differ

Conversation

@DmytroZaichenkoDev

Copy link
Copy Markdown
Contributor

Stacked on #1891.

Seeds durable state — an owned resource, a read share, a write share, a published resource, a pending review copy, an application, app data — then asks 21 access questions of both layouts and compares the decisions.

Questions go over HTTP rather than into AccessService directly: populatePermissions runs the same eleven-rule chain and puts its result in the response, so this observes the real chain with a real context. A hand-built context would mostly prove the mock was set up the way the test expected.

Coverage — 10 of the 11 rules, each with a grant and a denial:

getOwnResourcesAccess   getAdminAccess       getGlobalReaderAccess
getAutoSharedAccess     getPerRequestPermissions
getAppResourceAccess    getReviewAccess      getPublicAccess
getSharedAccess         getAppSelfAccess

The 11th, getOwnResourcesAccessForChainedSchemaRichApplication, needs context.getDeployment() to be a schema-rich Application, and only the deployment-routing controllers set a deployment — ResourceController does not. It is listed under uncovered with that reason, and the matrix declares the whole chain, so a rule that is neither covered nor explained fails the run.

Each cell declares the permissions it must yield, and some what it must not. Without that a matrix that stopped exercising the chain would compare denied-to-denied and report the layouts identical.

Result is clean, as expected — shares and rules key on logical urls and bucketLocation stays legacy, so the inputs never change. Worth building anyway because the same differ answers "does the new engine decide identically?" when the chain is replaced in P3, and it has to exist while there is still a working reference implementation to capture behaviour from.

Found api_key_data/ unmapped on its first run — per-request keys threw, taking out every application caller. Fixed in #1889.

🤖 Generated with Claude Code

@DmytroZaichenkoDev
DmytroZaichenkoDev force-pushed the feat/issue-1870-1-replay-diff branch from 7643ad9 to 0286ab0 Compare September 2, 2026 14:31
@DmytroZaichenkoDev
DmytroZaichenkoDev force-pushed the feat/issue-1870-2-access-differ branch from 0a6cc22 to 132276a Compare September 2, 2026 14:31
@DmytroZaichenkoDev
DmytroZaichenkoDev force-pushed the feat/issue-1870-1-replay-diff branch from 0286ab0 to 84e69e4 Compare September 2, 2026 15:07
@DmytroZaichenkoDev
DmytroZaichenkoDev force-pushed the feat/issue-1870-2-access-differ branch from 132276a to 5d65dbb Compare September 2, 2026 15:07
@DmytroZaichenkoDev
DmytroZaichenkoDev force-pushed the feat/issue-1870-1-replay-diff branch from 84e69e4 to bd6648c Compare September 2, 2026 15:23
@DmytroZaichenkoDev
DmytroZaichenkoDev force-pushed the feat/issue-1870-2-access-differ branch 2 times, most recently from b4bc5ac to 480ed3a Compare September 2, 2026 15:56
@DmytroZaichenkoDev
DmytroZaichenkoDev force-pushed the feat/issue-1870-1-replay-diff branch from 48fc265 to df8b721 Compare September 3, 2026 10:53
@DmytroZaichenkoDev
DmytroZaichenkoDev force-pushed the feat/issue-1870-2-access-differ branch from 480ed3a to 3b03a3a Compare September 3, 2026 10:53
@DmytroZaichenkoDev
DmytroZaichenkoDev force-pushed the feat/issue-1870-1-replay-diff branch from df8b721 to acbc1b9 Compare September 3, 2026 11:58
@DmytroZaichenkoDev
DmytroZaichenkoDev force-pushed the feat/issue-1870-2-access-differ branch from 3b03a3a to 4415dcb Compare September 3, 2026 11:58
@DmytroZaichenkoDev
DmytroZaichenkoDev marked this pull request as ready for review September 3, 2026 15:05
Dmytro Zaichenko and others added 2 commits September 7, 2026 14:38
Seeds durable state - an owned resource, a read share, a write share, a
published resource, a pending review copy, an application, app data - and then
asks 21 access questions of both layouts, comparing the decisions.

The questions go over HTTP rather than into AccessService directly.
populatePermissions runs the same eleven-rule chain and puts its result in the
response, so this observes the real chain with a real context; a hand-built
context would mostly prove the mock was set up the way the test expected.

Every cell names the rule it exists to exercise and the permissions it must
yield, and some name permissions it must not. Without that a matrix that stopped
exercising the chain would compare denied to denied and report the layouts
identical. The matrix also declares the whole chain, so a rule that no cell
reaches fails unless it is listed as uncovered with a reason - one is, and the
reason is that it needs a deployment on the context, which no request this
differ can make ever has.

It should come back clean, and does: shares and rules key on logical urls and
bucketLocation stays legacy, so the inputs never change. The reason to build it
anyway is that the same differ answers "does the new engine decide identically?"
when the chain is replaced, and it has to exist while there is still a working
reference implementation to capture behaviour from.

Found api_key_data/ unmapped, which is fixed in the branch below.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Empty expects meant "no expectation", so all seven denied cells only
pinned cross-layout equality: both layouts granting the stranger READ
would have compared equal and passed. Empty expects now asserts that
the whole chain granted nothing.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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