feat(runtime): revive ConcurrencyBurst per-instance under ADR 0015 invariants - #57
Merged
Conversation
…variants Adds the burst Concurrency Strategy per ADR 0015's PR #53 revival verdict: per-scope collection windows (BurstWindow, anchored at the first member), optional MaxBurstBatch cap-sealing, FIFO dispatch of rolled batches under a single Thread Lock hold, per-member DetachTimeout budgets, and full Admission Bound integration (each parked member occupies a MaxDetached slot until its terminal disposition). Every burst-lifecycle finding from the ADR 0015 review history (PR #54) is proven by a dedicated hardening test. Completes ADR 0012's accepted surface; force/steerability stays reserved. Closes #55
Member
Author
|
@codex review |
Member
Author
|
@codex security review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
ThomasK33
added a commit
that referenced
this pull request
Aug 28, 2026
README's concurrency section still claimed four strategies with burst staged; all five ship since #57. The ADR index in explanation.md still showed 0012 as staged and 0015 as Proposed; both are Accepted and implemented. Force/steerability preemption remains the sole rejected/reserved concept per ADR 0015.
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.
Revives
ConcurrencyBurstas a standalone, per-instance implementation per ADR 0015's PR #53 outcome, integrated with the merged Admission Bound (#56). This completes ADR 0012's accepted strategy surface; force/steerability stays reserved behind ADR 0015's formal-design bar.Closes #55
Design
BurstWindow(new option, required > 0 under burst): per-scope collection window, anchored at the first member's join — later arrivals never extend it, so a steady sub-window stream cannot starve dispatch. The window is collection time, not execution time.MaxBurstBatch(new option, 0 = uncapped): a window reaching the cap seals immediately with the cap-reaching member as the batch's last member; the next event opens a rolled window. Shaping is delivery-preserving (ADR 0015): boundaries move, no accepted member is ever dropped.DetachTimeoutstarting when it reaches the head of the FIFO (a healthy long predecessor cannot time a successor out); each member runs with its own freshDetachTimeout.MaxDetachedslot fromadmit()until its terminal disposition; the batch's final member's slot is retained throughReleaseLockso the tail cleanup stays counted. Disposed members' references clear immediately (payloads GC mid-batch).ignored/error+ slots freed; mid-batch lease loss → running memberpreempted(causeErrPreempted, mirroringrunLockedTail), un-started members skipped asignored— never run unserialized; member handler error →error, batch continues; Runtime Shutdown → parked members drained observably (same abandonment contract as debounce) before the admission drain completes.OnLockConflict,LockForcer, and the local preemption choreography from PR feat(runtime): ADR 0012 burst + preemption (staged on the #44/#50 design track) #53 are not revived (rejected by ADR 0015).Hardening-test coverage map (PR #54 burst-lifecycle findings)
TestBurstWindowAnchoredAtFirstMemberNotResetByArrivalsTestBurstCapReachingMemberSealsItsOwnWindowTestBurstConstructionValidationTestBurstAcknowledgesPromptlyWithoutPreludeLockAcquisitionTestBurstRolledBatchesDispatchInFIFOOrderTestBurstLockWaitBoundedAndMembersDisposedObservablyTestBurstQueuedBatchLockBudgetStartsAtHeadOfQueueDetachTimeoutbudgetTestBurstEveryMemberGetsItsOwnExecutionBudgetTestBurstDispatchBudgetStartsWhenWindowClosesTestBurstUncooperativeMemberTimesOutWithoutStarvingSuccessorsTestBurstLeaseLossCancelsRunningMemberAndSkipsRemainingTestBurstAbortedBatchRecordsTerminalOutcomeForEveryMemberTestBurstMemberHandlerErrorDoesNotAbortBatchTestBurstDisposedMemberReleasesEventForGCReleaseLockTestBurstFinalMemberSlotHeldThroughLockReleaseTestBurstParkedMembersOccupyAdmissionSlotsTestBurstOpenWindowDrainedByShutdownTestBurstDispatchRacingShutdownRejectedOrDrainedTestBurstIdleScopeCoordinatorRemovedTestBurstDispatchesCollectedBatchInJoinOrderTestBurstWindowOpenedDuringDispatchRunsAfterCurrentBatchValidation
mise run vet— clean across all workspace modules.GOFLAGS=-race mise run test— all modules green (root, adapters, examples, state backends).-count=10and-count=20, zero flakes.Generated with
mux• Model:anthropic:claude-fable-5• Thinking:xhigh