refactor(runtime): make Fiber the sole lifecycle owner - #3479
Draft
likun666661 wants to merge 1 commit into
Draft
Conversation
Generated-by: Codex
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.
Purpose
This is a focused ownership-model experiment stacked on #3250 at
7a7acf58b48a6ffcabe19248c3ea681ea20387e2.It proposes one invariant:
The temporary stacked base branch makes this review show only the ownership refactor. It is not intended to replace
main; the branch can be retargeted after the underlying foundation is settled.Model
If an environment needs independent failure, disposal, or resources, it should be represented by a child Fiber rather than another owning Context.
Changes
Fiber.parentpoints directly to a parent Fiber; Context ancestry no longer doubles as runtime ownership.context; derived Context views must be created by that Fiber.Context.plugin()delegates toFiber.mount()andContext.effect()delegates toFiber.own().fiber.await().FAILED/errorand prevents unsafe automatic reactivation until disposal.Invariants covered by tests
fiber,parent,root, orlogger.Validation
git diff --check: passing.Review focus
The main question is whether this ownership split is a better K0 boundary than allowing Context ancestry to participate in lifecycle authority. API naming and compatibility can be adjusted after that boundary is agreed.
Generative tooling disclosure
OpenAI Codex made a substantive contribution to the design, implementation, tests, and PR wording. The commit carries a
Generated-by: Codextrailer.