Repository navigation
Commit 54df640
Part of #24446
U1 of #24446: the access-class upgrade comparison and its boot report.
It works to the measurement in 6353200007 and the seat's GO in
6353222762, under claim 6353092498. U2, the marketplace refusal, follows
as a separate PR. The ADR-0126 dated note is a separate Tier H docs PR
that the seat cuts.
Clause-②: yes (widening: plugin-sharing's exported `SharingRuleService`
gains `listDeclaredRules()`; the report itself refuses nothing and adds
no key, code or setting)
Metadata-protocol: none
## What changed
**`plugin-security`: `access-upgrade-report.ts` (new), wired at
`kernel:bootstrapped` beside `catalog-reference-report.ts`.** At every
boot it compares the customer's access state with the registry this boot
registered. The customer's state is the activation-ledger rows, the
permission sets and positions this system authored (`_provenance:
'org'`, clones included), and the `sys_sharing_rule` rows. It covers
sharing rules, permission sets, positions and capabilities, and lists:
1. **Orphans:** ledger rows of type `position`, `permission` or
`sharing_rule` whose name the registry no longer resolves.
2. **Suspected re-enablements:** a switched-off orphan whose recorded
`package_id` is P, with every name of the same type that P now ships and
no ledger row covers. A permission-set candidate names the positions
whose definition binds it, which are the acceptance's "affected
positions".
3. **Sharing-rule collisions, per organization:** a `sys_sharing_rule`
row that holds a declared rule's name. Position, permission-set and
capability collisions are already refused at registration or at boot
(`security-catalog-namespace.ts`), so a boot that reaches this report
holds none of them.
4. **Broken references in the customer's items:**
- an environment-authored permission set that names an object, a field
or a capability the registry lacks. A capability counts as known when it
is registered or a package-shipped set still carries it, ADR-0066 ⑨'s
rule. This is the capability type's whole part, because capabilities are
code-only and never switched;
- a `sys_sharing_rule` row that names an object or a criteria field the
registry lacks.
5. **Field denies a customer set lacks:** a package-shipped set denies a
field (`readable: false`, or not `editable` on an object it grants edit
on), and an environment-authored set grants the same object with no
entry for that field.
It writes nothing and refuses nothing. It follows
`catalog-reference-report.ts`'s fail-closed shape:
- a scan, catalog read or declared-rule read that throws stops the
report, and nothing is judged from it;
- an absent ledger object, sharing-rule object or sharing service is
named in `absent`, and no `sharing_rule` row is judged without the
declared-rule list.
**Who is told.** The log gets one line per category, as now. The
existing notification ingress, `messaging.emit()` (ADR-0030), also gets
one `security.access_upgrade` event with `severity: 'warning'`. It
appears in Setup → Diagnostics → Notification Events and in the in-app
inbox. No object, page, route or setting is added.
- **`single`:** the Default Organization's `admin_full_access` holders
and any `OS_PLATFORM_OWNER_EMAIL` address.
- **`group` / `isolated`:** no emit. One `error` line is addressed to
the operator, because the notification family is organization-scoped
(ADR-0131 D9; the seat's option A, 6353787407). The ledger and the
catalog are deployment-level, and under a wall only the operator may
switch or clone (ADR-0126 §5, ADR-0131 D3). A tenant administrator is
never the fallback.
- **`dedupKey`** is the finding set's digest, so an unchanged set
notifies once, not at every boot.
- **No messaging service, no recipient, or a failed emit:** one error
line says the findings reached no administrator and names the fix.
- **Mandatory (the seat's question):** not set. The ingress has no
per-emit mandatory flag, so a recipient's mute hides it. Making it
mute-proof without a new setting means adding `security.access_upgrade`
to the messaging plugin's existing `mandatoryTopics` option. The
changeset says so.
**`plugin-sharing`: `SharingRuleService.listDeclaredRules()`.** It
answers every declared rule with its `packageId`. It answers `null` when
the service reads no declarations, which is no answer about any name.
plugin-security reaches it as the `sharingRules` service through a
structural type and gains no dependency.
## Two limits (accepted by the seat, 6353222762)
Both follow from ADR-0126 §9, under which a clone records no base, no
package and no link, and from the bare `(metadata_type, name)` ledger
key with its unread `package_id`:
- **A re-enablement is suspected.** Nothing records which name replaced
which, and the ledger keeps no version, so "arrived" can only mean
"shipped now by P with no ledger row". A package with several unswitched
names yields several candidates.
- **The field-deny check reads "grants the same object", not "copied
from that set".** It may name an unrelated customer set, so it is a
review item.
- **"The old name carrying a clone" is carried by the switch-off half.**
The sanctioned ceremony is clone plus switch-off, and a clone whose base
stays on is not a choice a rename un-makes. So the acceptance's
"switched off or cloned" case is met through the switch-off half. The
seat reads this as within ruling 6259332195's intent, not a change to
it.
## Scope held
- `packages/core/src/security/resolve-authz-context.ts` is unchanged. It
is read-only while #25248 is open, and this PR only imports
`readDefaultOrganizationId` from it.
- Not `packages/cloud-connection/**` (U2), not `docs/adr/**`, and no
`ORGANIZATION_OWNERSHIP_SHAPE_GENERATION` change.
## Tests
- `access-upgrade-report.test.ts`: per access type (permission set,
position, sharing rule, capability), under `single` and walled, each
with a CONTROL that raises nothing. It also covers clone bodies, the
fail-closed stops, and delivery: the dedup key, no messaging service, no
operator under a wall, a failed emit, and one log line per category.
- `access-upgrade-report.wiring.test.ts`: the acceptance end to end on a
real `ObjectQL` engine with `SecurityPlugin` started, under `single`,
`isolated` and `group`, with CONTROLs.
- Ablations, each red and then restored:
- dropping the re-enablement finding turns 10 pins red;
- letting a walled posture resolve the `single` audience turns 7 red;
- judging every package-less set as customer-authored turns the
stack-set CONTROL red.
The proof readings are in the os-dev-report on #24446: CI, dispatch
gates, `check-governed-merges --branch`, R1, R4 under `isolated` and
`group`, and the upgrade harness.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01MbmmTHFS1B1rgE6n8npUPN)_
---
Seat amendment · 2026-10-23T00:22Z (epic PM
`session_01Y5583bs2RDd53MH6kM1ca3`): `Clause-②` is corrected to `yes
(widening)` for the new public `SharingRuleService.listDeclaredRules()`,
and the walled bullet now follows option A. The changeset line follows
in the dev's next commit.
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 97967a9 commit 54df640
6 files changed
Lines changed: 1567 additions & 0 deletions
File tree
- .changeset
- packages/plugins
- plugin-security/src
- plugin-sharing/src
| 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 | + | |
0 commit comments