You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 94c8cab
Browse filesBrowse the repository at this point in the historyBrowse files
fix(kernel): keep ADR-0037's promise and prove the reset case
Round 2 of Step 11's review. No blockers; two long-standing promises the packet
was the right place to settle.
ADR-0037 said of the idempotency port's raw Guid tenant: "The strongly-typed
TenantId lands with the tenancy schema in Packet 6, and both move together." They
did not. Packet 6 typed ITenantContext.TenantId and left IIdempotencyStore on a
raw Guid, with IdempotentAttribute carrying a comment naming the seam it crossed
at a single call site — and nothing recorded the divergence, which is how a
promise like that gets discovered three packets later by someone who trusted it.
The three methods, the internal key and the census now take TenantId, the
unwrapping site is gone, and Amendment 4 records it.
The guard changed shape with the type, not just its signature. It refused
Guid.Empty; a typed id has two ways to be unassigned, and reading .Value on the
first throws from inside the id type. It now tests IsInitialized() before both
sentinels, matching AuditInput.EnsureValid and the unit of work's setter, and its
test drives the unassigned value from an array element because default(TenantId)
does not compile.
The Phase Exit Decision names a case that reads with app.tenant_id RESET rather
than merely unset, and nothing asserted it. The distinction is the whole reason
the policies use NULLIF: a never-set GUC reads NULL, a reset one reads the empty
string, and ''::uuid raises 22P02 — so without NULLIF a reused connection would
error rather than filter. Measured: removing NULLIF from the nineteen policy
predicates turns the new case red with exactly that 22P02.
Module: Tenancy
ADR: 0037, 0003
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments