Skip to content

Commit ad35745

Browse files
os-trumpclaude
andauthored
docs(runtime): correct the app-flip read comment falsified by the read gate (#15063)
`packages/runtime/src/domains/packages.ts` justified the publish-drafts app list read with "left org-aware on purpose — a layered read is a superset, never a loss". Since `getMetaItems` began resolving `organizationIdForMetaRead` on `request.type` itself, that read is env-wide for `app`: the registry declares `app` `allowOrgOverride: false`, so the predicate answers `undefined` and the `organizationId` this route still passes is dropped at the gate. The behaviour is correct and unchanged here — an org-scoped `app` row is an unhydratable phantom that `loadMetaFromDb` walks past, so dropping the organization is the repair. Only the justification was wrong, and it was wrong in the direction that invites the next reader to restore the organization and resurrect those rows. Comment only: the read, the gate and `organizationIdForMetaWrite` are untouched. Claude-Session: https://claude.ai/code/session_016yfqQh2dBgPAymYd7xipza Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8af8c2e commit ad35745

1 file changed

Lines changed: 19 additions & 3 deletions

File tree

packages/runtime/src/domains/packages.ts

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -590,9 +590,25 @@ export async function handlePackagesRequest(deps: DomainHandlerDeps, path: strin
590590
// org-scoped flip was a phantom: the app looked published for
591591
// the life of the process and went back to `_unpublished:
592592
// true` on the next restart, because the env-wide row it left
593-
// untouched is the only one cold boot loads. The READ above is
594-
// left org-aware on purpose — a layered read is a superset,
595-
// never a loss.
593+
// untouched is the only one cold boot loads. The
594+
// `getMetaItems` read below is env-wide for the same
595+
// reason, and since #14683 it is so by construction: that
596+
// method applies `organizationIdForMetaRead` to
597+
// `request.type` itself, and the predicate answers
598+
// `undefined` for every type the registry declares
599+
// non-overridable — `app` among them, rolled back to
600+
// `allowOrgOverride: false` in #6483. The `organizationId`
601+
// this route still hands that call is dropped at the gate.
602+
//
603+
// ⛔ Dropping it is the REPAIR, not an oversight to undo.
604+
// An org-scoped `app` row is an unhydratable phantom —
605+
// `loadMetaFromDb` walks past it, and
606+
// `reportUnhydratableOrgScopedRows` exists to say so — so
607+
// an org-aware read here would resurrect rows that vanish
608+
// at the next restart and flip `_unpublished` on them
609+
// instead of on the row cold boot hydrates. Read scope and
610+
// write scope now answer one question through one registry
611+
// flag; ⛔ never "restore" the organization to this read.
596612
const flipped: string[] = [];
597613
const flipOrganizationId = organizationIdForMetaWrite('app', organizationId);
598614
try {

0 commit comments

Comments
 (0)