Commit 45ced00
refactor(core): one shared admission tenancy-posture classification, six seams folded onto it (#17101)
* refactor(core): fold the six admission tenancy-posture classifications onto one helper
The classification (branded "never registered" stays quiet, every other
rejection becomes AuthzStoreUnavailableError('tenancy', err)) was hand-written
at six admission seams. Any one of them degrading into a silent `catch`
re-opens #13906. It is now `classifyAdmissionTenancyPosture` in
@objectstack/core, with its own two-direction pins.
The RESOLUTION deliberately did not move: rest-server's kernel-vs-provider
branch, each seam's accessor-presence guard, and each seam's own reason why a
missing async accessor stays quiet are per-seam facts a shared owner would have
had to erase or carry a flag for.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* chore: changeset for the admission tenancy-posture classification fold
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* test(core): route the helper's source pin through the shared comment mask
`pnpm check:comment-mask-adoption` reds on a private regex comment stripper;
the shared `scripts/js-comment-mask.mjs` answers that question once.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* test(core): read the helper's implementation by SYMBOL SLICE, not by stripping comments
`check:cross-package-test-inputs` reds on the shared comment mask's specifier:
importing it makes this test's real inputs wider than its package, which needs
a glob widening plus a `vitest.repo-tests.json` entry. The reading does not need
comment stripping at all — the module doc is what names the forbidden symbols,
and it sits ABOVE the declaration. Slicing from the declaration to end of file
needs no stripper, keeps the test inside its package, and the preconditions of
the slice (found, starts at the declaration, comment-free) are now themselves
asserted instead of assumed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
* fix(spec): the retirement walk stops reading tsup's transient bundle, and a vanished path is not a crash
`Test Core (1/6)` failed on this PR's head with
`ENOENT ... open 'packages/spec/tsup.config.bundled_8xzodswt4ct.mjs'` raised by
`compliance-families-retirement.test.ts`'s `readFileSync`. The cause is the
walk's POPULATION, not this PR's diff:
- `turbo.json` gives `test:repo` `dependsOn: ["^build"]` — UPSTREAM builds
only, never its own package's — so `@objectstack/spec#build` runs
concurrently with the walk;
- tsup bundles `tsup.config.ts` to `tsup.config.bundled_<random>.mjs` beside
it, loads it and deletes it. `.gitignore` already declares that class
(`*.bundled_*.mjs`), but the walk is a filesystem walk, not a git walk, so
it enumerated the artifact anyway;
- `readdirSync` then `readFileSync` is not atomic, so the file is enumerated,
deleted, and the read raises ENOENT.
Reproduced deterministically on this tree: planting
`packages/spec/tsup.config.bundled_REPROBE.mjs` containing a retired name makes
the leg report it as an offender (exit 1) before this change, and exit 0 after
— proof the artifact really was in the radius, under a filename that changes
every run.
Two halves, and ⛔ neither skips or re-scopes a real source:
- the transient bundle is excluded by name pattern. It is a COPY of
`tsup.config.ts`, which the walk still reads, so this removes no coverage;
- a path that vanishes between enumeration and read is recorded and skipped —
a file that no longer exists cannot be a reference that SURVIVES in the
tree, which is exactly what the pin asserts. ⛔ Every non-ENOENT read fault
is still re-raised.
Both are pinned: a narrowness control (the pattern must not reach
`tsup.config.ts`, `index.mjs` or any authored `.mjs`) and a vanished-path
control with a positive read and an EISDIR leg. Ablating the pattern to
`/\.mjs$/` reddens the narrowness control, so it can fail.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADLdAs2pVcH17h9tZKWMBg
---------
Co-authored-by: os-musk <elon@objectstack.ai>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent 8a70e1b commit 45ced00
12 files changed
Lines changed: 742 additions & 186 deletions
File tree
- .changeset
- packages
- cloud-connection/src
- core/src/security
- plugins/plugin-sharing/src
- rest/src
- services
- service-datasource/src
- service-settings/src
- service-storage/src
- spec/src/system
Lines changed: 59 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 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 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
Lines changed: 21 additions & 27 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
61 | 58 | | |
62 | 59 | | |
63 | 60 | | |
| |||
1673 | 1670 | | |
1674 | 1671 | | |
1675 | 1672 | | |
1676 | | - | |
| 1673 | + | |
1677 | 1674 | | |
1678 | | - | |
1679 | | - | |
1680 | | - | |
1681 | | - | |
1682 | | - | |
1683 | | - | |
1684 | | - | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
| 1681 | + | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
1685 | 1686 | | |
1686 | 1687 | | |
1687 | 1688 | | |
| |||
1703 | 1704 | | |
1704 | 1705 | | |
1705 | 1706 | | |
1706 | | - | |
1707 | | - | |
1708 | | - | |
1709 | | - | |
1710 | | - | |
1711 | | - | |
1712 | | - | |
1713 | | - | |
1714 | | - | |
1715 | | - | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
1716 | 1710 | | |
1717 | 1711 | | |
1718 | 1712 | | |
| |||
0 commit comments