Skip to content

docs(adr): ADR-0131 — organization ownership is total: no NULL organization_id; declared metadata stays in code; rows only when an organization authored them (Refs #13564) - #14976

Draft
hotlong wants to merge 14 commits into
mainfrom
claude/discussion-13564-a38847
Draft

docs(adr): ADR-0131 — organization ownership is total: no NULL organization_id; declared metadata stays in code; rows only when an organization authored them (Refs #13564)#14976
hotlong wants to merge 14 commits into
mainfrom
claude/discussion-13564-a38847

Conversation

@hotlong

@hotlong hotlong commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds ADR-0131 (Proposed); marks ADR-0126 Superseded; annotates ADR-0105 D10 (withdrawn) and ADR-0005 (per-organization overlay axis retired for now). Staging (D14): one pre-17.3 revert of the unreleased ADR-0126 flow machinery (C0); everything else is the v18 line. Three sentences:

  1. Metadata is the registry, in two provenances. A managed package is code: edited in code only, changed by publishing a new version, never materialized as rows, and sealed at runtime (no overlay, no disable, no clone — packaged flows included). Metadata authored at runtime — Studio, the cloud build agent, or a template package copied once into the database — is saved in the database and edited in the UI; it is the environment's, and its ledger carries no organization column. Template packages are refused on shared-DB multi-tenant deployments.
  2. A row with an organization column exists only when an organization authored it — assignments (this user holds this position or set), business units, sharing rules, business data — NOT NULL, referencing registry items by name. The catalog itself (positions, permission sets, capabilities) has one home, the environment registry: single-tenant admins author it there (the organization is the environment); shared-DB tenants assign but do not define. The four catalog tables retire (ADR-0094 completed).
  3. A table with no organization column is deployment-level or code-level, governed by permission, not by a wall.

Consequences: NULL has nothing left to mean (D1); one predicate for Layer 0 and every driver (D8); a missing stamp is a refused write (D9); seeders, per-organization catalog machinery and the #13491 ledger retire (D13); sys_metadata loses its column with no split because no per-organization metadata remains (D6); #13636 / PR #14923 superseded (§1.6); no platform organization (§1.5, rejected alternative).

Maintainer rulings, verbatim in the record's header — among them 「数据库中不应该有允许 org_id 为空的状况」「既然不让改,又要求每个租户 seed 一遍,好像很蠢」「我宁可先不让他编辑」「创业阶段,应该定一套最稳定可靠的方案」「代码推送过来的元数据就只能在代码中修改…studio 界面上配置的元数据…可以在界面上修改」「先完全封死。flow 也先不让改…模版形式直接进库…单库多租户禁止安装…受管软件包…不让改」.

What this PR is and is not

Open questions for the merge decision (§6)

Four of five were accepted as proposed on 2026-09-04 (「接受你的建议」) and folded into D5/D6/D7. One remains:

  1. Existing customized template rows: keep as Default Organization overrides, or accept loss under the startup posture? Ruled when C4 is cut.

Post-17.2 audit verdicts are recorded in §7; revert cards #15024 (ADR-0126 machinery) and the #14949 NULL-screen revert are filed for landing before 17.3; PR #14923 closed unmerged; ADR-0126 marked Superseded in PR #15023.

Refs #13564 · #13636 · #10103 · #13491 · #2734 · #12699 · #11665 · #12150 · #14484 · #14547 · cloud#1239 · cloud#1664

🤖 Generated with Claude Code

…zation_id, a platform organization owns deployment-level rows, sharing is declared

Proposed record cut from the maintainer's 2026-09-03/04 ruling on #13564 (verbatim
「或者说我们数据库中,不应该有允许 org_id 为空的状况」/「认可这个方向,起草 ADR 和分阶段的卡」).
Docs-only; empty changeset. Governed surface — hand-merge only (Prime Directive #14).

Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tooling labels Sep 3, 2026
hotlong and others added 3 commits September 4, 2026 00:23
…n owner, org-axis red lines stand

Answers the maintainer's 2026-09-04 question 「集团多组织架构考虑了吗」: fixes the owner ADR-0105
D10's reserved 'platform-global' template rows must take (never NULL — platform organization or
group root, declared), keeps D6's red lines, adds §6 Q6.

Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… template rows / layered master data)

Maintainer rulings 2026-09-04, verbatim: 「不考虑集团级模板行,作废相关需求」「不考虑 分层主数据」.
D12 no longer offers an owner choice; §6 Q6 removed; ADR-0105 status line, D10 paragraph and
Phase 2 list annotated withdrawn.

Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…hen an organization authored them, no platform organization

Rewritten on the maintainer's 2026-09-04 rulings (verbatim in the record): declared metadata is
never seeded; Studio/build-agent metadata is DB-resident and UI-editable with no organization
column; organization-level template editing stays closed (copy-on-write if ever opened);
references by name, registry-first; deployment-level state has no column; #13636 / PR #14923
superseded (§1.6); the platform organization of the first draft is recorded as a rejected
alternative.

Refs #13564 #13636

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@hotlong hotlong changed the title docs(adr): ADR-0131 — organization ownership is total: no NULL organization_id, a platform organization owns deployment-level rows, sharing is declared (Refs #13564) docs(adr): ADR-0131 — organization ownership is total: no NULL organization_id; declared metadata stays in code; rows only when an organization authored them (Refs #13564) Sep 3, 2026
hotlong and others added 6 commits September 4, 2026 01:07
…nto the two provenances; activation ledger has no reserved column

Maintainer 2026-09-04: 「代码中定义的元数据运行时不可修改,要修改就软件包重新发版本;不想用的可以停用;想改的可以复制
一个重新改」. Restates ADR-0126 O/C/E against code vs Studio provenance; amends ADR-0126 D3's
'org column reserved, written NULL' (a nullable column is the shape D1 forbids); adds §6 Q6 on a
disable switch for views/dashboards.

Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…es are copied in and editable, refused on shared-DB multi-tenant; ADR-0005 overlay axis and ADR-0126 O/C regimes paused

Maintainer 2026-09-04, verbatim: 「你这么说还不如先完全封死。flow 也先不让改。然后软件包应该有两种安装方式,有一种是
模版形式直接进库,那就是所有都可以修改。但是单库多租户禁止安装这种模版软件包;有一种是受管软件包,什么都以软件包中
的为准,就是不让改。」 sys_metadata needs no split (no per-organization metadata remains); C12 template
install mode added; ADR-0126 and ADR-0005 carry amendment notes.

Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…achinery is removed before the next release, not sealed

Maintainer 2026-09-04: 「ADR-0126 已经开发完了吗?还没发版本呢」. Measured: #12158/#12296, #12156, #12419
landed on main from 2026-08-26; last release 17.2.0 tagged 2026-08-23 (npm serves 17.2.0). No
compatibility obligation ⇒ remove (ADR-0049), §6 Q7 resolved, epic #12150 superseded.

Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…gistry); assignments are organization rows; the four catalog objects retire

Maintainer 2026-09-04: 「角色、岗位、权限集,Setup 里组织自建的是组织级。这个说的是单库单租户吧,单库多租户我可以禁止
他们创建。但是你要支持我绑定到人员。」 Single-tenant Setup creation = environment metadata write
(ADR-0094 D3 redirect); shared-DB tenants assign but do not define; sys_user_position /
sys_user_permission_set reference by name; sys_position, sys_permission_set,
sys_position_permission_set, sys_capability retire (ADR-0094 completed). One source at selection.

Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…d source, no cross-source uniqueness

Follows D3 (one catalog home). Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…vert, everything else on the v18 line

Maintainer 2026-09-04: 「ADR-0126 可以先作废,我发 17.3,然后后续这么大的改动应该放到 v18吧?」 D14 rewritten;
§1.7 keeps ADR-0126's survey findings; C0 (revert #12296/#12419/#12156 before 17.3) added; §6 staging
question resolved.

Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
hotlong and others added 2 commits September 4, 2026 01:50
… not the name; sys_http_delivery and sys_email are tenant data (#13565, #11741); sys_metadata_activation is reverted before 17.3

Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…rganization first; the seed loader's sys_ exemption is withdrawn (#14547 root)

Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… declaration, settings, grant row, overlay axis) and the post-17.2 audit verdicts; one open question remains

Maintainer: 「接受你的建议」. Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
os-sales pushed a commit that referenced this pull request Sep 3, 2026
…1 anchor

`check-adr-anchors` is red on the previous head: this branch cited `ADR-0131`
22 times and `docs/adr/0131-*.md` does not exist — ADR files stop at 0130 and
PR #14976 (which would author it) is open and draft. The gate treats an
unresolvable ADR id as a citation squat: whoever later writes a real ADR-0131
would retroactively falsify every one of those citations at once (#6634).

No legitimate forward-reference form exists. The gate's only citation exemption
is CROSS_REPO_QUALIFIERS (objectui / object-ui / cloud), so a repo qualifier is
skipped but `ADR-0131 (PR #14976)` is not — the qualifier must be a sibling
repo, not a PR. Its allowlist is shrink-only and documented to stay empty.

⛔ Deliberately NOT done: no allowlist entry, and no `docs/adr/0131-*.md`
created here — that file belongs to PR #14976 and `docs/adr/**` is governed.

Every citation now reads "the v18 org-ownership decision (PR #14976)", keeping
the decision letters (D8 / C1) that carry the actual meaning. Issue and PR
references (#14547, #14949, #10103, #13564) are untouched — they resolve.
Substance is unchanged; the ADR id can be restored once #14976 lands.

check-adr-anchors now exits 0: "OK (53 anchored file(s) … 31871 citation(s)
across 4202 file(s) resolve)".

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AUF1NoViznQK32gqpK8wS8
…05 keeps, what this record decides, the costs

Maintainer 2026-09-04: 「你目前新的 ADR 有重新考虑集团版的规则吗?帮我具体列一下」. Refs #13564

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@hotlong
hotlong requested a review from os-zhuang September 4, 2026 01:34
@hotlong hotlong self-assigned this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant