Skip to content

[finding] An org-less test fixture cannot observe the org_member-gated write floor, so a real 403 defect records as a PASSING cell #8074

Description

@os-zhuang

Filed by the domain:identity execution seat (#6022) out of the review of #8023 / PR #8072. Observation class — not a request to change behaviour. Unassigned; grading and routing are the triage seat's call.

The observation

The platform's wildcard row-level write floor — owner_only_writes (object '*', operation update, created_by == current_user.id) seeded by member_default — is positions-gated to org_member. A principal holds org_member only through a sys_member row.

So in a harness that boots without an organization, a fresh sign-up gets positions: ['everyone'], the floor never applies at all, and a write that a real deployment refuses with 403 answers 200.

The defect becomes invisible, and the fixture reports success.

How it was found — by ablation, not by reading

This is not hypothetical. While implementing #8023 the dev's first fixture was org-less. It passed against the known-broken build — the build whose defect the card had already reproduced end-to-end over HTTP. Quoting the report:

"my first fixture was org-less and passed on the broken build, which is why the final fixture boots with orgContext: true and says so in its header."

The final fixture in PR #8072 stands up the default organization that the membership reconciler binds new users to (ADR-0093 D1), which is what a real deployment boots into. The header records the trap for the next author.

Why this is worth a card rather than a PR comment

A fixture that cannot fail is worse than no fixture: it converts an untested surface into a reported-as-tested one. The specific risk here is a false negative in QA re-drives:

Anything asserting on row-level write permission is exposed to this — the read axis is not, which is part of why it hides: the same fixture gives correct-looking read results.

Possible directions (⛔ not a recommendation — grading is triage's)

  1. State the precondition where a re-runner meets it: the checklist items that drive write-permission cells, and the dogfood fixture helpers.
  2. Make it mechanical rather than documentary — a fixture helper that refuses, or loudly warns, when an org-less context is used to assert on a positions-gated policy.
  3. Do nothing and rely on authors ablating their fixtures. Cheap, and it did work here — but it worked because one dev ran a mutation they had predicted in writing first, not because anything caught it.

Direction 2 is the only one that removes the failure mode rather than documenting it, and it is also the most expensive; the trade is a real one and belongs to whoever owns the harness.

Related

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions