Repository navigation
Refactor runtime submission, production, and result handling - #44
Merged
Merged
Conversation
Miskovy
marked this pull request as ready for review
October 31, 2026 14: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
Separate submission validation, input reconstruction, bounded range production, progress delivery, posting cleanup, and result validation into cohesive steps within their existing owners. Behavior and public APIs are preserved.
Motivation / related issue
Maintainer-requested implementation refactor for readability and maintainability.
What changed
Remove unused
ProductionClaim.exclusiveand postingfinishfields after checking implementation, tests, installed consumers, scripts, and benchmarks. Exclusivity remains in the reservation closure; the resolver remains local to its posting transaction. Consolidate duplicated message branches and result preparation.Contract / API impact
No changes to scheduling, admission, settlement, cancellation/deadlines, recovery, replacement, streams/order, credits, memory ownership, or shutdown. Existing owners retain their state; extracted modules contain pure validation/error projections. Exclusive drain/recovery-credit exchanges remain the most involved logic and stay with the dispatcher.
Starting-main versus candidate inventories match for source and declarations: Node 71 exports/17 values, browser 72 exports/18 values, including signatures and statistics fields. Of 60 existing declaration files, 56 are byte-identical; four internal owner declarations reflect private helpers and removed internal fields. Two internal modules are added. Public manifests, defaults, exports, and release artifacts are unchanged.
Testing
runtime:qualifypasses on clean baseline and candidate: build, 478 contracts, public types, compatibility compiler, installed ESM/CommonJS/TypeScript consumers, release-tool tests, lint, formatting, docs, diff, standard R2 (162 histories/2,746 actions), and standard R3 (11 fresh processes). Reservation invariants enabled.node-floor.mjschecks, both API inventories, and public fixtures pass with TypeScript 7.0.2 and 6.0.3.test:browserpasses graph/type checks and all 96 native/Vite isolated/non-isolated cases in Chromium 156.0.8078.4.Existing focused dispatch benchmark, same environment, 4 workers, 512 partitions, 2 warmups, 7 retained samples; median wall milliseconds:
No performance improvement is claimed. Existing observable-contract tests cover the extracted seams; no implementation-mirroring tests were added. Baseline and final checks have no product failures.
Platforms tested
Local: Fedora 44 x64, Node 24.22.1, runtime npm 11.19.1, pinned release CLI 11.19.0. CI: Linux/Windows x64 on Node 22.23.4, 24.22.1, 24.22.2, 26.12.1, and 26.13.0. macOS, ARM64, Firefox, and WebKit were not executed.
Documentation
No public contract changes; documentation and scripts are unchanged.
Checklist