Repository navigation
Conversation
Snowflyt
force-pushed
the
design/owned-failures-and-cleanup
branch
from
October 19, 2026 13:42
afd1f9d to
10f3843
Compare
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
Propose routing
effectifyfailures back through their suspended generators and givingEffected.allexplicit ownership of child outcomes, sibling exit, and draining.The design follows the official Koka implementation at
198fc3bbd158246e7604210ee6692ee72c2d9c50, with source-linked mappings for await ownership, the resumption queue, cancellation, outstanding children, and error selection. It calls out the JavaScript adaptations explicitly:allchooses failure.finallycannot provide an unconditional shielding guarantee. It can already be running when cancellation arrives, or even override an incomingreturnand execute ordinary code afterward.Included
current/proposedexpectations; the same entry point always runs seven independent JavaScript iterator-protocol controls.This is a design-stage draft for review and archival. It does not change the runtime implementation, and the proposed regression expectations do not pass yet.
Validation
On tinyeffect 0.3.4 /
0a867fe930c86a2b16432581440468af0da1c129:npm run lintentry point passes with the existing typed ESLint configuration and default-project limit, with no lint errors or warnings.The standalone script requires Node 24.19 synchronous module hooks and native TypeScript support; these requirements do not expand the library's Node support requirements.
Related drafts
This proposal follows the narrower, independent drafts below. They establish prerequisites and context; this design-stage PR does not include their runtime changes.
The owned-outcome and drain contract here is the next coordinated design step, rather than a replacement for those isolated fixes.
Full lint entry-point correction
The initial two-script layout exceeded the existing type-aware lint default-project limit when the full
npm run lintcommand loaded nine files. The protocol controls now share the single reproducer entry point, leaving eight files. No ESLint configuration or limit is relaxed. Both oracle modes reportprotocolControlsseparately from the library cases.CI
CI run 39264096136 passed for
18a4b1994fb766ffe504cd8055ef416a3100a039: the full lint entry point, typecheck, and existing type-proof/runtime tests on Node 18, 20, and 22. The proposed-behavior oracle remains an intentionally failing standalone diagnostic until the runtime design is implemented.