Skip to content

Commit ce300c8

Browse files
Jack Qclaude
andauthored
docs(spec): widen the #8778 organizationField scope pin to name the cloud#1395 ruling (#10168)
The #8778 scope pin on `tenancy.organizationField` admitted exactly one consumer (audit stamping). The maintainer ruling recorded on cloud#1395 (2026-08-17T03:18Z) widens it BY NAME to three sanctioned platform-row writers, and requires the widening be declared rather than discovered. Annotation/prose only: no schema shape change, no accept/reject behaviour change. The behaviour change is #10101's. Claude-Session: https://claude.ai/code/session_016gcKVsiywU9CcS96S5t9qD Co-authored-by: Claude <noreply@anthropic.com>
1 parent 68f65ff commit ce300c8

3 files changed

Lines changed: 45 additions & 4 deletions

File tree

packages/spec/src/data/injected-system-columns.test.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,15 @@ describe('resolveInjectedSystemColumns (#5378)', () => {
8181
});
8282

8383
it('is blind to the stamp-only `tenancy.organizationField` (#8778 read-neutrality)', () => {
84-
// The #8778 ruling's scope pin: `organizationField` is consulted by audit
85-
// stamping ONLY. The injection plan must reach the same verdicts with and
86-
// without it — on a plain tenant object, and on the shipped sys_api_key
84+
// The #8778 scope pin, as widened by the cloud#1395 ruling (2026-08-17):
85+
// `organizationField` is consulted by the sanctioned platform-row WRITERS
86+
// only — audit stamping today, `plugin-approvals` and the automation-run
87+
// recorder once #10101 lands. No READ path reads it, and that is what this
88+
// test pins; the widening does not touch it, because all three sanctioned
89+
// consumers stamp rows rather than read them.
90+
//
91+
// The injection plan must reach the same verdicts with and without it —
92+
// on a plain tenant object, and on the shipped sys_api_key
8793
// shape (better-auth managed + `enabled: false`), where the plan's
8894
// better-auth bail must keep running BEFORE tenancy is read at all.
8995
const withKey = resolveInjectedSystemColumns({

packages/spec/src/data/object.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1685,7 +1685,10 @@ describe('TenancyConfigSchema — #2763 strategy/crossTenantAccess removal', ()
16851685
it('accepts the stamp-only `organizationField`, with no default materialized (#8778)', () => {
16861686
// The shipped shape: sys_api_key stays unwalled (`enabled: false`) while
16871687
// audit rows stamp the organization of the key they describe. The key is
1688-
// read by audit stamping ONLY — read-neutrality is pinned beside each
1688+
// consulted by the sanctioned platform-row writers only — audit stamping
1689+
// today, plus `plugin-approvals` and the automation-run recorder once
1690+
// #10101 lands under the cloud#1395 widening of the #8778 scope pin. No
1691+
// read path reads it either way: read-neutrality is pinned beside each
16891692
// read path (driver tenant scope, Layer 0, injection plan), not here.
16901693
expect(
16911694
TenancyConfigSchema.parse({ enabled: false, organizationField: 'active_organization_id' }),

packages/spec/src/data/object.zod.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,38 @@ const TENANCY_MODES_EXPLAINER =
538538
* move of a general field-roles mechanism — a consumer other than audit
539539
* stamping needs its own ruling before reading it.
540540
*
541+
* That pin is WIDENED **by name** by the maintainer ruling recorded on
542+
* cloud#1395, 2026-08-17T03:18Z, accepting the decision-inbox recommendations
543+
* in full — verbatim: 「新进卡六张 同意你的建议」. It is transcribed here so the
544+
* widening is declared, not discovered (#10110):
545+
*
546+
* > Ruled: Option A — extend the #8778 ruling: `resolveRecordOrganizationField`
547+
* > is promoted to a shared resolver used by all three platform-row writers
548+
* > (approvals, automation runs, audit). A platform row's organization is the
549+
* > SUBJECT record's organization; actor context is the fallback, never the
550+
* > primary.
551+
*
552+
* The ruling sanctions exactly THREE consumers of this key, and no others:
553+
*
554+
* 1. **audit stamping** — plugin-audit's `resolveRecordOrganizationField`;
555+
* the original #8778 consumer and, as of this annotation, still the only
556+
* one wired up;
557+
* 2. **`plugin-approvals`** — the approval-row writer;
558+
* 3. **the automation-run recorder** — reached when
559+
* `resolveRecordOrganizationField` is promoted to the shared platform-row
560+
* resolver.
561+
*
562+
* Consumers 2 and 3 are sanctioned but not yet implemented: #10101 carries that
563+
* behaviour change (this card is annotation-only and changes no accept/reject
564+
* behaviour). Which is why the `.describe()` below still speaks of audit rows —
565+
* it states what reads the key TODAY, and #10101 updates it as the readers
566+
* actually land.
567+
*
568+
* ⛔ The refusal posture is UNCHANGED for a FOURTH consumer. Three named
569+
* platform-row writers are still not a general field-roles mechanism: anything
570+
* outside the list above needs its own maintainer ruling before reading this
571+
* key, exactly as #8778 required.
572+
*
541573
* @example Shared database, platform-default tenant column (organization_id)
542574
* {
543575
* enabled: true

0 commit comments

Comments
 (0)