Repository navigation
docs(objectql): Multi-Tenant Schemas says the injected organization_id is stamped on insert and NOT NULL on a table the driver creates - #25322
Queued
objectstack-fleet[bot] wants to merge 1 commit into
Conversation
… NOT NULL on a table the driver creates "Multi-Tenant Schemas" said the column stays NULL where no organization context exists. Since the driver creates a tenant column NOT NULL, a table it creates refuses that write. Say what main does: the stamp (ADR-0131 D9), the NOT NULL at CREATE TABLE (ADR-0131 D1 and the tenant-column-not-null-ddl changeset), the tables that stay nullable until the ownership ceremony, and the opt-out for organization-less rows. Claude-Session: https://claude.ai/code/session_01Er1tmLgRYyGBSrDcDsUMqQ Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Oct 23, 2026
objectstack-fleet
Bot
added this pull request to the merge queue
Oct 23, 2026
Any commits made after this event will not be merged.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Elon · project thread
Fixes #25137
Clause-②: no
Metadata-protocol: none
What changed
One file, docs only:
content/docs/protocol/objectql/schema.mdx, section "Multi-Tenant Schemas" (+19 / -3).organization_id"is server-populated on insert and stays NULL where no organization context exists" now says the platform stamps it on insert, so the author never writes it.maindoes, each claim with its source:required: falseis the authoring surface, not the stored value; NULL is not an organization (ADR-0131 D1).singlewith the Default Organization, and a write that names none is refused wherever an organization can exist (ADR-0131 D9).NOT NULLatCREATE TABLE, so the database refuses a row with no organization, anupsertincluded (ADR-0131 D1's driver note, and thetenant-column-not-null-ddlchangeset of@objectstack/driver-sql/@objectstack/driver-turso). The in-memory driver enforces noNOT NULL(the same D1 note).os migrate organization-ownershiptightens it; the ceremony cannot tighten a rotated shard or a Turso remote table;os migrate planlists every tenant column still nullable (the changeset's "Unchanged" bullet; ADR-0131 D1 and its 2026-10-22 amendment, item 2). Both are linked to theirdeployment/clisections.D1's wording, measured before citing it. The card and the changeset both quote D1 as "There is no nullable tenant column anywhere". That sentence is no longer D1: the 2026-10-22 amendment (ruling of record
6328195425) replaced it with a paragraph that says where the column is NOT NULL and which nullable columns remain. So the page cites D1 for what the amended text says (NOT NULL at the engine and at every table the driver creates; NULL is not a state), and does not quote the retired sentence.Per-hit verdicts (the other pages)
Rule applied: a sentence that describes a database from before the ownership ceremony, or history, stays; only a sentence that claims today's behaviour and is wrong changes. None changed.
origin/main9dc1f42d5)deployment/seed-tenancy-repair.mdx:18deployment/seed-tenancy-repair.mdx:33organization_id = NULL" on a first boot:47). See Acceptance notes on its tensedeployment/seed-tenancy-repair.mdx:162WHERE organization_id IS NULLdeployment/seed-tenancy-repair.mdx:179organization_id = NULLdeployment/seed-tenancy-repair.mdx:295deployment/seed-tenancy-repair.mdx:304deployment/seed-tenancy-repair.mdx:344WHERE organization_id IS NULLdeployment/cli.mdx:1904os migrate duplicatesinventories itdeployment/cli.mdx:1934seed-tenancy-repair.mdx:304permissions/permission-sets.mdx:193cli.mdxis not edited, so this PR has no hunk beside draft PR #25212's (its onecli.mdxhunk is at@@ -756).The PM's readings, measured
schema.mdx:721-723atorigin/main9dc1f42d5read "it is server-populated on insert and stays NULL where no organization context exists".cli.mdxelsewhere): holds. fix(lint)!: refuse an email template HTML body hole the mail renderer cannot encode for its placement (#25189) #25212's files list onecli.mdxhunk (@@ -756,7 +756,7 @@, +1 / -1) and nothing undercontent/docs/protocol/**,seed-tenancy-repair.mdxorpermission-sets.mdx. This PR does not touchcli.mdx.registry.ts,registry-tenant-index-declaration.test.ts,object.zod.ts) and named this page under its Acceptance notes, carrier none. No overlap.Gates
Head
2f9543d:node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 41 commands (29 pnpm, 12 direct node) for the one changed path. Each was run with its exit code captured before any pipe and recorded asCOMMAND :: exit CODE;--ranreconciles 41 derived, 41 run, 0 NOT-MEASURED, 0 UNRUN. All 41 exit 0. One needed a second run:pnpm --filter @objectstack/spec run check:skill-examplesfirst exited 3 (PREREQUISITE NOT MET:packages/client-react/distheld no declarations in a fresh worktree); afterpnpm --filter '@objectstack/client-react...' buildit exits 0 (262 prose examples type-check across 3 surfaces).check:doc-anchorsresolves all 573 internal fragment links, the two new ones included. Before the gates,@objectstack/lint...and@objectstack/specwere built under the verify lock (VERDICT command-exit 0).Not measured locally, CI's: the Build Docs and Test Core jobs, the type-check lanes, and the wide-population families the derivation names. No package source moves, so no test or ablation applies.
No published file moves (
content/docs/**is in no package'sfiles[]), so this carriesskip-changesetand no changeset.Acceptance notes
seed-tenancy-repair.mdxdescribes its defect in the present tense (:30-34, and:72"Atkernel:readyon a fresh install no organization exists yet"). Onmainthesingleposture creates the Default Organization at boot, before seeds load, and the seed loader refuses an organization-less row on an install that registers the organization object (packages/metadata-protocol/src/seed-loader.ts, theunownedbranch). The section is anchored to 17.0.0 GA, so this PR leaves it; a reader on 18.x may still take it for today's behaviour. Carrier: none..changeset/*.md, and the sentence then lives in the two drivers'CHANGELOG.md. ADR-0131 D1's driver note carries the same fact durably.os-dev.mdforbids HTML comments in GitHub text. It is the same shape PR docs(pm-dispatch): a project-coordinator reference — the cross-lane scheduling rules a Claude Code project runs by, so its instructions name only its lanes #25255 carried through the relay; reported as a deviation.claude/project-thread-c1stko, which names no issue; the claim (comment6354581569) records it as the identity.Generated by Claude Code