Skip to content

Commit 968d6e0

Browse files
committed
fix(spec): stop four liveness proof entries asserting a premise #18587 falsified
`sharing_rule` became a governed metadata type when #18587 seeded packages/spec/liveness/sharing_rule.json, so the four sharing-related `blockedReason` entries in proof-registry.mts — plus one comment on `rls-check-post-image` carrying the same sentence — were recording a reason that had stopped being true. Each entry is re-read against what its proof ACTUALLY exercises, not swept: - bu-hierarchy-sharing, sharing-rule-org-scoped-listing and sharing-rule-criteria-required never author the spec shape (they call SharingRuleService.defineRule on the booted kernel, or POST a runtime body to /api/v1/sharing/rules), so they stay unbound — for a reason that is true. - declarative-rbac-seeding DOES author it (showcase defineSharingRule → bootstrapDeclaredSharingRules → the asserted sys_sharing_rule row), so it is recorded as a real ADR-0054 §3 binding candidate and deferred to that separate act: adoption is a ledger act, since every cited row must carry `proof`. No `bound` flag and no `ledgerBindings` change; no published bytes move. Claude-Session: https://claude.ai/code/session_01JbZnqu8bt6YqfJsr9vaFb3 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 6de7a2d commit 968d6e0

1 file changed

Lines changed: 44 additions & 15 deletions

File tree

‎packages/spec/scripts/liveness/proof-registry.mts‎

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,12 @@ export const HIGH_RISK_CLASSES: HighRiskClass[] = [
262262
proofRef: 'packages/qa/dogfood/test/showcase-d3-d4-capabilities.dogfood.test.ts#showcase-d3-d4-capabilities',
263263
bound: true,
264264
// The same file also pins the ADR-0058 D3 compound sharing `condition`
265-
// (`&&`), which silently skipped the AND before #1887 — but stack-level
266-
// sharing rules are not a governed metadata type, so only `check` binds.
265+
// (`&&`), which silently skipped the AND before #1887. That half is no
266+
// longer un-bindable for want of a coordinate: `sharing_rule` was seeded
267+
// into the ledger by #18587, so `sharing_rule.condition` is a governed
268+
// entry. Only `check` binds HERE because adopting that one is a separate
269+
// ADR-0054 §3 act with its own candidate question — `declarative-rbac-seeding`
270+
// authors and asserts the same key end to end (#18589).
267271
ledgerBindings: [{ type: 'permission', path: 'rowLevelSecurity.check' }],
268272
},
269273
{
@@ -468,9 +472,15 @@ export const HIGH_RISK_CLASSES: HighRiskClass[] = [
468472
bound: false,
469473
ledgerBindings: [],
470474
blockedReason:
471-
'sharing rules are authored at STACK level (`sharingRules`), which is not a governed metadata '
472-
+ 'type — the ledger governs per-type property surfaces, and there is no `permission.*` entry '
473-
+ 'for the rule\'s recipient kind.',
475+
'this proof never AUTHORS the spec shape. It calls `SharingRuleService.defineRule` on the booted '
476+
+ 'kernel with the RUNTIME column shape — `criteria` as an already-compiled FilterCondition, '
477+
+ '`recipientType`/`recipientId` — so `SharingRuleSchema` and `bootstrapDeclaredSharingRules` are '
478+
+ 'not on its path and no authorable `sharing_rule.*` key is exercised; what it pins is the '
479+
+ 'BU-subtree expansion inside the service. Binding `sharedWith.type` to it would be the '
480+
+ 'owner-anchor/allowTransfer mistake: a proof cited for a property it does not author. '
481+
+ 'Premise corrected 2026-09-17 (#18589): the old reason rested on this type having no ledger '
482+
+ 'coordinate at all, which #18587 supplied by seeding packages/spec/liveness/sharing_rule.json. '
483+
+ 'The blocker is the proof, not the ledger.',
474484
},
475485
{
476486
id: 'sharing-rule-criteria-required',
@@ -488,11 +498,15 @@ export const HIGH_RISK_CLASSES: HighRiskClass[] = [
488498
bound: false,
489499
ledgerBindings: [],
490500
blockedReason:
491-
'same shape as `showcase-bu-hierarchy-sharing`: the criteria is authored at STACK level '
492-
+ '(`sharingRules[].condition`), not as a property of a governed metadata type, so there is no '
493-
+ 'ledger entry to ratchet. Registered so the tag is not an orphan; it runs unconditionally in '
494-
+ 'the dogfood suite. The invariant itself is recorded in the empty-state registry '
495-
+ '(sharing `condition` → `closed`), which is the surface that CAN carry it.',
501+
'the ledger coordinate now EXISTS (#18587 seeded `sharing_rule`, and `condition` is a `live` row '
502+
+ 'on it) — and this proof still must NOT bind it. It POSTs a RUNTIME body to '
503+
+ '`/api/v1/sharing/rules`, a route that reaches `SharingRuleService.defineRule` with '
504+
+ '`SharingRuleSchema` never on the path (the proof\'s own header records exactly that), so the '
505+
+ 'authorable key is never written and a binding here would fake the kind of evidence this table '
506+
+ 'exists to refuse. Registered so the tag is not an orphan; it runs unconditionally in the '
507+
+ 'dogfood suite. The invariant itself is recorded in the empty-state registry '
508+
+ '(sharing `condition` → `closed`), which is the surface that CAN carry it. '
509+
+ 'Premise corrected 2026-09-17 (#18589).',
496510
},
497511
{
498512
id: 'declarative-rbac-seeding',
@@ -506,8 +520,18 @@ export const HIGH_RISK_CLASSES: HighRiskClass[] = [
506520
bound: false,
507521
ledgerBindings: [],
508522
blockedReason:
509-
'seeding acts on STACK-level `roles`/`sharingRules` collections, not on a per-type authorable '
510-
+ 'property — same shape as bu-hierarchy-sharing.',
523+
'NOT the bu-hierarchy shape, and no longer blocked on a missing coordinate: this proof DOES '
524+
+ 'author the spec shape. The showcase declares its rules through `defineSharingRule` '
525+
+ '(examples/app-showcase/src/security/sharing-rules.ts), `bootstrapDeclaredSharingRules` seeds '
526+
+ 'them, and the proof asserts the landed row — `object_name`, `recipient_type`, `recipient_id` '
527+
+ 'and the CEL→`criteria_json` translation — i.e. `name`/`object`/`sharedWith.type`/'
528+
+ '`sharedWith.value`/`condition` end to end, every one of them a `live` row on the '
529+
+ '`sharing_rule` ledger #18587 seeded. It is a REAL binding candidate, held back only because '
530+
+ 'ADR-0054 §3 adopts one class at a time and adoption is a ledger act: each cited row must carry '
531+
+ 'the matching `proof`, which that ledger deliberately claims on no row yet, and WHICH of the '
532+
+ 'five props this class owns is a decision of its own (`condition` is also exercised by '
533+
+ '`showcase-d3-d4-capabilities`). Left to that act rather than slipped in here; #18589 reports it '
534+
+ 'for filing.',
511535
},
512536
{
513537
id: 'permission-model-zoo',
@@ -719,9 +743,14 @@ export const HIGH_RISK_CLASSES: HighRiskClass[] = [
719743
bound: false,
720744
ledgerBindings: [],
721745
blockedReason:
722-
'same shape as `showcase-bu-hierarchy-sharing` and `sharing-rule-criteria-required`: the rules '
723-
+ 'are authored at STACK level (`sharingRules`), which is not a governed metadata type, and what '
724-
+ 'this file pins is a read-scope filter inside SharingRuleService. No ledger entry to ratchet.',
746+
'the fixtures are created over the REST admin route (`POST /sharing/rules`), which reaches '
747+
+ '`SharingRuleService.defineRule` without `SharingRuleSchema` — the `sharing-rule-criteria-required` '
748+
+ 'shape, not the `declarative-rbac-seeding` one — so no authorable key is written; and what this '
749+
+ 'file pins is a READ-SCOPE filter inside SharingRuleService (which org-less rows an org-bound '
750+
+ 'admin may list), which is not the behaviour of any `sharing_rule.*` property. '
751+
+ 'Premise corrected 2026-09-17 (#18589): the old reason rested on the absence of a ledger '
752+
+ 'coordinate, which #18587 supplied. The coordinate exists — this proof is simply not evidence '
753+
+ 'for it.',
725754
},
726755
{
727756
id: 'sharing-rule-org-less-caller',

0 commit comments

Comments
 (0)