Repository navigation
Join preparation cleanup before intake close completes - #47
Merged
Merged
Conversation
A cancelled receipt can precede cooperative callback cleanup. Pin close and stop ownership, earlier withdrawn work, shared waiter cancellation, and a callback factory that aborts before handing back its task.
Retain direct preparation awaitables beyond withdrawal so close and engine shutdown wait for cooperative cleanup. Preserve prompt input rejection and logical queue progress, cancel tasks returned after a factory abort, and shield shared close completion from shutdown waiter cancellation.
The regression intentionally replaces cancellation with a late callback error; suppress the cancelled exception context so the test states that outcome directly.
A second runner cancellation can publish completion before cleanup, while stop awaited from its own preparation waits on itself. Pin both lifecycle boundaries before fixing shutdown ownership.
Run shutdown once in its own shielded task and publish completion only after it joins. Refuse stop from an intake callback context so cleanup cannot await itself; callers can request stop through the run signal.
Keep folded event exports available while retaining intake preparation cleanup guarantees.
asher-aqi
changed the base branch from
feat/accumulating-continuation
to
main
November 14, 2026 04:22
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
A withdrawn intake receipt can reject before its preparation callback finishes cancellation cleanup. Keep that callback owned so close and engine shutdown wait for it, including work withdrawn before close began.
Python shutdown now survives repeated runner cancellation. Both ports reject stop from the engine's own intake callback context, preventing shutdown from waiting on itself. Late values remain discarded. No reducer revision, stored schema or window policy changes.
Stacked on #46 (
feat/accumulating-continuation). Retarget to main after its parent lands; do not merge into the feature branch.Original implementation evidence
After: failing controls committed first now pass. Tests retain prompt receipt/capacity behavior, late-result refusal, shared waiter cancellation and synchronous/eager callback creation. Stop refusal is tested in preparation, context, judge and sink.
Integration check
The branch includes main's folded-event exports at
42eda91. The changes introduced by this layer are unchanged after removing diff line numbers and blob hashes. The combined stack has the same tree as the previously tested composition. All eight distinct CI jobs passed on this updated head. Duplicate runs also passed. The optional Macroscope review check was skipped.Merge Danger
Door: two-way
No persisted format changes. Close can now wait longer for callback cleanup. A callback that never settles can keep close pending; arbitrary detached children remain the caller's responsibility.
Blast Radius: lifecycle
Input cancellation stays prompt. Already-applied writes can still commit after a fence. Package publication is separate.