Repository navigation
Pin ADR-059 embedding-access-boundary invariant with a regression test (closes #1737) - #1891
Merged
Merged
Conversation
closes #1737) #1737 asked for runtime access-filtering in the aggregation walk plus an access-change requeue trigger. ADR-059 (the governing decision, §2/§6/§7) supersedes that: the boundary is made UNREACHABLE BY CONSTRUCTION, not filtered. Per §7, aggregation needs no access filtering and re-embedding needs no access-change trigger, because the two load-bearing invariants already prevent a boundary from ever appearing inside an embeddable root's aggregate: 1. Content member_of is root-only (§2) — enforced by assert_root_only_membership at every member_of insert site, so an embeddable has_child descendant cannot carry its own restriction. 2. The aggregation walk follows has_child only (get_children), never member_of — so content filed into a restricted collection via member_of is never pulled into an unrelated open root's vector; collections/non-embeddable types contribute nothing. Verified empirically and pinned so neither invariant (nor the rejected 'filter at runtime' alternative) can silently reopen the leak: an open embeddable root's aggregate includes its own has_child subtree but excludes a restricted-collection member's content, and add_to_collection on a has_child descendant is rejected (member_of is root-only). No production code change — the fix is the already-enforced structural invariant; this adds the missing regression test that pins it. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Contributor
Author
|
APPROVE (self-review; test-only change, no production logic — cannot add a bug). Grounded in ADR-059 §2/§6/§7 (fetched from nodespace-docs): the leak is unreachable by construction via the root-only member_of constraint (§2, enforced) + the has_child-only aggregation walk. The regression test verifies both invariants empirically. Gate green. |
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#1737 asked for runtime access-filtering in the embedding aggregation walk plus an access-change requeue trigger. ADR-059 (the governing decision, §2/§6/§7) supersedes that: the boundary is made unreachable by construction, not filtered. Per §7, "aggregation needs no access filtering and re-embedding needs no access-change trigger," because two load-bearing invariants already prevent a boundary from appearing inside an embeddable root's aggregate:
member_ofis root-only (§2) — enforced byassert_root_only_membershipat everymember_ofinsert site, so an embeddablehas_childdescendant cannot carry its own restriction.has_childonly (get_children), nevermember_of— so content filed into a restricted collection viamember_ofis never pulled into an unrelated open root's vector; collections / non-embeddable types contribute nothing.The issue's runtime-filter + requeue approach was the rejected alternative.
Change
No production change — the fix is the already-enforced structural invariant. This adds the missing regression test that pins it (verified passing): an open embeddable root's aggregate includes its own
has_childsubtree but excludes a restricted-collection member's content, andadd_to_collectionon ahas_childdescendant is rejected (member_of is root-only). Neither invariant — nor a reintroduced runtime-filter — can silently reopen the leak.Closes #1737. Full pre-push gate green.
Co-Authored-By: Claude Opus 4.8 [email protected]