Repository navigation
id-caps: runtime feature-object library attachment registry (#12640) - #12896
Merged
Merged
Conversation
Implements the #6003 design note's adopted semantics as a pure registry state machine in a new library_attach module: - attach/detach staged and applied only at tick boundaries; the TickSnapshot a boundary hands out is what invocations resolve against, so a mid-tick detach never pulls behaviour from an in-flight invocation; - attach authorization: entity owner, or a world author holding an explicit attach capability on the entity's class; - attach-time capability intersection: a library's requirement footprint must fit inside (entity held caps ∩ world ceiling); widening attaches are refused with the widening capabilities named exhaustively — borrowing a library never borrows its author's privileges; - library state namespaced per (entity, library, major version): inert (kept, flagged where the design note requires) on detach and on minor upgrade without a declared migration, carried live across a minor upgrade with one, parked on major upgrade until the entity owner adopts or drops it. 20 new tests name their oracles (the design note's §1/§2/§3 rules); the full id-caps suite passes 199/199 and rustfmt is clean. Runtime wiring (invocation dispatch through the snapshot, declared migration execution, persistence) consumes this seam later. Refs #12640.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 46 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Implements the first slice of #12640: the runtime feature-object library attachment mechanism from the #6003 design note (adopted 2026-11-22), as a pure registry state machine in a new
id-capsmodule,library_attach.What lands
AttachmentRegistry— per-world registry of entities, live attachments, staged changes, and namespaced library state.begin_tick(); theTickSnapshothanded out at the boundary is what invocations resolve against, so a detach never pulls behaviour from an in-flight invocation. Attach/detach are authorized for the entity owner or a world author holding an explicit attach capability on the entity's class. Refused attaches stage nothing (atomic).LibraryOffer::from_manifestbuilds an offer from a parsedLibraryManifest(identity = content hash, footprint = declared requirements, version parsed fail-closed).Verification (laptop,
nix developin pkgs/id):cargo test -p id-caps library_attach— 20 passed / 0 failed, each test naming its oracle (the design-note rule it checks); fullcargo test -p id-caps— 199 passed / 0 failed;cargo fmt -p id-caps -- --checkclean after fmt.Not in this slice (named on #12640): runtime wiring — invocation dispatch through the snapshot in id-worlds, execution of declared migrations (modelled here by their contract), and persistence of the registry.
Refs #12640.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.