Commit 5629e6f
committed
feat(scripts): derive and gate the platform-object tenancy census (#14957)
`PLATFORM_OBJECT_TENANCY`'s header stated the census as prose — three
hand-written digits plus a parenthetical attributing them — with nothing
re-deriving it. It failed in both directions a prose count can.
A wrong REASON behind a right total: the parenthetical named
`sys_sso_provider`'s `tenancy.enabled: false` as an addition to the
`managedBy: 'better-auth'` set it was already in, and left `sys_api_key`'s
identical opt-out unnamed. `24 + 1 = 25` stayed right, so neither a reader
nor a gate caught it; that count reached a PR body and a filed card, and two
independent re-measurements were spent proving a correct file correct.
Then a stale TOTAL: PR #15155 declared `systemFields: { tenant: false }` on
`sys_metadata_activation`, the object left the machinery's reach, and the
ungated prose kept the old digits while the same commit updated the gated
page next door. CI was green throughout.
The digits are deleted, not corrected. The header points at the derived
artefact and states the predicate it was missing: `resolveTenantFieldName`
answering non-null on the REGISTERED schema, after `applySystemFields` has
injected the tenant column, because the injected column is what the engine
sees. `managedBy` is not the predicate.
The generator loads `resolveTenantFieldName` and
`resolveInjectedSystemColumns` from source and EXECUTES them rather than
re-spelling what they decide — a transcription would be a second copy of a
rule the engine owns, free to drift while reading as authoritative. It needs
no build, so the gate runs in the `lint` job.
Each excluded object records the declarations on its OWN schema, verbatim and
not mutually exclusive: an object carrying two keeps both, which is what makes
the mis-attribution unrepeatable. An excluded object with no declared
mechanism is an ERROR — the generator refuses to write the row and the gate
reds — so a new exclusion mechanism is adjudicated, never absorbed into an
existing bucket's total.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012zGPuVVX3deAx9LdjK8jCk1 parent 845d767 commit 5629e6f
7 files changed
Lines changed: 1703 additions & 13 deletions
File tree
- .changeset
- .github/workflows
- packages/objectql/src/tenancy
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1593 | 1593 | | |
1594 | 1594 | | |
1595 | 1595 | | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
1596 | 1644 | | |
1597 | 1645 | | |
1598 | 1646 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
161 | 163 | | |
162 | 164 | | |
163 | 165 | | |
| |||
Lines changed: 27 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
41 | 56 | | |
42 | 57 | | |
43 | 58 | | |
| |||
0 commit comments