Repository navigation
fix(runtime): serialize concurrent task admission - #38
Open
xLagerFeuer wants to merge 1 commit into
Open
xLagerFeuer wants to merge 1 commit into
xLagerFeuer wants to merge 1 commit into
Conversation
Use an IMMEDIATE SQLite transaction to check active scope conflicts and insert a task atomically. Cover overlapping and disjoint TASK_CREATE requests with deterministic first-party regression tests.
This was referenced Nov 10, 2026
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.
Motivation
Two concurrent
Supervisor.handleRpcAsync(TASK_CREATE)calls can both passTaskPool.checkConflict()before either inserts its task. For overlapping scopes, both can then be admitted.Reproduction against
chekusu/wanman@d3a8138de6c21981a4f1449a7b3f201e724c55c9(Node 22): issue two overlappingTASK_CREATEcalls concurrently. Actual: both admitted. Expected: only one admitted. No specialWANMAN_RUNTIMEorWANMAN_URLsettings are required.Change
packages/runtime/src/task-pool.ts: check active scope conflicts and insert the task in one SQLiteIMMEDIATEtransaction.packages/runtime/src/supervisor.ts: routeTASK_CREATEthrough atomic admission.packages/runtime/src/__tests__/supervisor.test.ts: add overlapping and disjoint concurrency regression tests.The existing general-purpose task insertion API remains available to other callers.
Validation
pnpm typecheckwith pnpm 9.15.0: 5/5 workspace packages PASS.No scheduler, model invocation, or authorization policy changes.
AI-assisted contribution disclosure
VSM assessment: Current record · Snapshot used for this PR
Assessment date: 2026-10-29 (
reviewed_at) · Assessed source revision:d3a8138de6c21981a4f1449a7b3f201e724c55c9This PR was prepared by the OpenSiro Upstream Contributions AI-agent workflow, informed by the VSM assessment linked above. Technical analysis, code changes and reported checks were agent-driven; no independent human code review is claimed. For now, a human approves publication while monitoring the pipeline for errors. That approval is not a technical correctness guarantee. Fully autonomous publication is a future goal, not the status of this PR. AI-generated changes may be incomplete or incorrect; please review the diff and evidence independently.
The assessment describes the assessed source revision on the stated date; it is not a guarantee about this PR or later upstream code. Maintainers and their agents can compare the current record with the snapshot and reassess if the source or evidence has changed.