You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(queue): claim-time execution-lane assignment — ledger + lane verb in repo-queue.py (OpenCode-half step 1) #1654
Part of the OpenCode-half redesign (design: files/opencode-half-redesign-2026-10-28.md in the keep-the-four-repos-healthy goal workspace; tracking: #1425). Drew's order, 2026-10-28: at least half of fleet tasks execute via OpenCode sessions.
Scope
Claim-time execution-lane assignment for the repo queues:
A per-queue assignment ledger stored with the queue (a small table beside agent.tasks in muse-dev): queue, task_id, assigned_lane (opencode | direct), executed_lane (filled at terminal state), fallback_reason, session_id, exclusion_reason, timestamps.
A new verb in ~/tools/repo-queue.py: lane <TASK_ID> --worker <WORKER> — atomically reads the ledger counts for the task's queue (in-flight + executed per lane), assigns opencode iff opencode_count ≤ direct_count (ties to opencode), writes the assignment row, and prints the lane. Safe under concurrent claims from two lanes.
The terminal verbs (complete / fail, and park resume bookkeeping) record the executed lane back into the ledger row; a repo-queue.py helper or the existing result payload carries the execution block (see the measurement issue for the tally consumer).
Acceptance criteria
Two lanes claiming alternately from the same queue receive a deterministic, replayable assignment sequence with ≥50% opencode at every prefix.
A task assigned opencode that terminates as direct (fallback) moves its count to the direct side, and the next assignment for that queue is opencode until parity is restored.
Ledger rows exist for 100% of tasks claimed after the verb ships; a claim with no ledger row is detectable by the fleet monitor.
No change to claim atomicity, leases, or existing verbs' behavior for queues the verb is not invoked on.
Still live: filed today (2026-10-28); a merged-PR search for lane assignment in this repo returned no resolving PR.
Notes: the body already carries an ## Acceptance criteria section, so no body edit was made. The ledger is a small table beside agent.tasks in muse-dev — additive, in the style of the pilot's earlier migrations (0008/0009); the lane verb must be safe under concurrent claims, per the body's deterministic-assignment criterion.
Risks: a claim with no ledger row must be detectable by the fleet monitor (body criterion) — worth adding that check to the monitor's Duty 1 pass when the verb ships, so the measurement cannot silently undercount.
Suggested approach: migration + lane verb + terminal-verb bookkeeping in one PR against ~/tools/repo-queue.py, verified by the alternating-claims replay in the acceptance criteria.
Labels normalized by fleet monitor:priority/high (foundation step for the ordered ≥50% split), effort/m, source/human, status/needs-triage, area/infra, meta/enriched.
Agent: queue worker (repo-worker-code), Lane A shift
Session / ID: queue task 1919
Found via: queue claim
Task: Implement claim-time lane ledger (migration 0010: agent.repo_task_lane_ledger + atomic assign/record RPCs) and the lane verb in ~/tools/repo-queue.py, with terminal-verb execution recording; test on a scratch queue.
Expectation: effort m; done = lane verb live, deterministic ≥50% opencode assignment verified on scratch queue, fallback self-correction verified.
Agent: queue worker (repo-worker-code), Lane A shift
Session / ID: queue task 1919
Found via: queue claim
Task: Lane ledger + lane verb implemented and verified.
Result:
Migration 0010 applied to muse-dev (additive): table agent.repo_task_lane_ledger (queue, task_id, assigned_lane, executed_lane, fallback_reason, session_id, exclusion_reason, timestamps) + RPCs agent.assign_repo_task_lane (per-queue advisory lock; assign opencode iff opencode_count ≤ direct_count, counting coalesce(executed, assigned); excluded rows count toward neither side; idempotent per task) and agent.record_repo_task_lane_execution (same lock; loud failure when no ledger row exists). SQL: ~/workspace/0010_apply.sql, copy in the goal workspace hidden_files/migrations/0010_lane_ledger.sql.
~/tools/repo-queue.py: new lane <TASK_ID> [--exclusion-reason ...] verb; complete / fail / park accept --execution {lane, session_id, fallback_reason, assigned} — complete merges it into result.execution, and all three record the executed lane into the ledger after the terminal verb succeeds. No change to existing verbs when --execution is omitted. Committed + pushed: dezren39/hatch e488cf1.
Tests (scratch queue, cleaned up after): two workers claiming alternately → assignments O,D,O,D,O,D (≥50% opencode at every prefix, deterministic); an opencode-assigned task completed as direct with fallback_reason=session_failed moved its count to direct and the next assignment was opencode (self-correction); exclusion assignment recorded with reason; repeat lane call idempotent; pilot health regression OK.
Activity
developing-today commentedon Oct 28, 2026
CODE-668
dezren39 commentedon Oct 28, 2026
Intake review
## Acceptance criteriasection, so no body edit was made. The ledger is a small table besideagent.tasksin muse-dev — additive, in the style of the pilot's earlier migrations (0008/0009); thelaneverb must be safe under concurrent claims, per the body's deterministic-assignment criterion.laneverb + terminal-verb bookkeeping in one PR against~/tools/repo-queue.py, verified by the alternating-claims replay in the acceptance criteria.priority/high(foundation step for the ordered ≥50% split),effort/m,source/human,status/needs-triage,area/infra,meta/enriched.dezren39 commentedon Oct 28, 2026
🤖 Agent note · picked up
laneverb in ~/tools/repo-queue.py, with terminal-verb execution recording; test on a scratch queue.files/opencode-half-redesign-2026-10-28.md(goal workspace) · tracking Deployed laptop opencode config has drifted from canonical HEAD — claude-code pause (PR #1316) not in effect live #1425dezren39 commentedon Oct 28, 2026
🤖 Agent note · done
laneverb implemented and verified.agent.repo_task_lane_ledger(queue, task_id, assigned_lane, executed_lane, fallback_reason, session_id, exclusion_reason, timestamps) + RPCsagent.assign_repo_task_lane(per-queue advisory lock; assign opencode iff opencode_count ≤ direct_count, counting coalesce(executed, assigned); excluded rows count toward neither side; idempotent per task) andagent.record_repo_task_lane_execution(same lock; loud failure when no ledger row exists). SQL:~/workspace/0010_apply.sql, copy in the goal workspacehidden_files/migrations/0010_lane_ledger.sql.~/tools/repo-queue.py: newlane <TASK_ID> [--exclusion-reason ...]verb;complete/fail/parkaccept--execution {lane, session_id, fallback_reason, assigned}— complete merges it intoresult.execution, and all three record the executed lane into the ledger after the terminal verb succeeds. No change to existing verbs when--executionis omitted. Committed + pushed: dezren39/hatche488cf1.fallback_reason=session_failedmoved its count to direct and the next assignment was opencode (self-correction); exclusion assignment recorded with reason; repeatlanecall idempotent; pilothealthregression OK.