Parallel Lanes: the Claude Runner and Three Antigravity Workers
Impossible OS runs the Claude runner on main and three Antigravity CLI (agy) worker lanes, each launched on Gemini 4 Neon at medium effort (agy --model=gemini-4-neon-medium --effort=medium: the lane's model and effort in .conclave/lanes.toml, the same launch as the Resolute-SDK Gemini campaign; a lane whose map model is an orchestrator model, such as gemini-pro-orchestrator-neon, still resolves its variant from ~/.gemini/antigravity-cli/settings.json and gets no --effort), coordinated directly through the local inter-lane bus without going through Heliograph.
Topology
| Lane | Worktree | Branch | Role | Domain Affinity |
|---|---|---|---|---|
main (orchestrator) |
. (primary tree) |
main |
The Claude runner (scripts/run.sh): builds its own sections, integrates worker handoffs at its section boundaries, full builder/tester, pusher, ecosystem gateway |
Remaining / cross-domain, lifecycle, kernel and boot sections |
lane-1 |
../impossible-os-lane-1 |
lane/lane-1 |
Worker | 01-boot-platform through 05-storage-filesystems, 07-networking, 16-architecture-ports |
lane-2 |
../impossible-os-lane-2 |
lane/lane-2 |
Worker | 09-desktop-shell, 10-platform-services, 11-apps, 12-user-platform-sdk, 13-tools-accessories |
lane-3 |
../impossible-os-lane-3 |
lane/lane-3 |
Worker | 00-infrastructure, 06-desktop-foundation, 08-graphics-ui, 14-host-tools, 15-installer-release, 17-polish-hardening, 18-future-research |
Since 2026-11-30 (the Claude Orchestrator switch) main is the Claude runner ([lane.main] engine = "claude"); the three workers run agy. A worker starts only beside a live runner and run.sh start conflicts only with a four-lane writer recorded for main, so the order is bash scripts/run.sh start, then bash scripts/lane.sh start lane-1 (or each worker). Reversal: engine = "agy", model = "gemini-pro-orchestrator-neon" on [lane.main].
Direct Local Communication and Anti-Clash Leases
- Inter-lane state lives under
$XDG_STATE_HOME/impossible-os/lanes/: top-level<lane>.jsonfiles hold worker heartbeats and activeleased_paths, whilebus/holdsclaims.json,handoffs.json,ecosystem.json,main.json, andmessages/<lane>.jsonlguarded bybus.lock(fcntl.flock). Claims are persisted inclaims.jsonfirst and worker<lane>.jsonrecords are rebuilt/reconciled against them; explicitlane_bus.py ack <lane> --ids ...and flush-before-ackpoll --ackprevent lost steering messages on broken pipes. .conclave/lanes.toml,/procprocess-ancestry identity checks (lanes.caller_identity()), andscripts/lanes.pyenforce branch identity (lane/<lane>), caller identity, and dynamic path leases at commit time through.githooks/pre-commit: a worker cannot commit without an active lease, on a wrong/detached branch, in another worker's worktree, or override withSKIP_LANE_CHECK=1, andmaincannot commit over paths held by a live worker untilintegrate-begintransfers ownership cleanly. (Because all lanes share one OS user account and$XDG_STATE_HOME, process-ancestry and tmux ownership checks guard against accidental cross-lane/cross-clone mixups rather than hostile multi-user escalation.)- Workers prefer ready sections matching their domain affinity in
scripts/lane_bus.py claim-nextand automatically overflow to other disjoint ready sections so all three workers stay busy without file conflicts. - Lifecycle code (locks, liveness, signals, deadlines) goes to the Claude Orchestrator on
mainby default (operator, 2026-11-28):[routing] claudein.conclave/lanes.tomllists it, andlane_bus.pyrefuses those paths to every worker claim, assignment and lease expansion, including a directory lease that contains one and paths inferred from a section's text (lanes.routed_to_claude,_refuse_claude_routed). - Each lane can start independently. If the Orchestrator is offline, a worker may claim and prepare at most one non-overlapping slice (
claim-nextreturns exit3withwaiting-for-orchestratoronce capped) untilmainintegrates it.
Execution Split and Ecosystem Boundaries
- Workers (
lane-1,lane-2,lane-3): implement sections onlane/<lane>, run fast lint/syntax/targeted checks plus Astraplanandroundworktree pre-screen passes viascripts/codex-dispatch.sh(verified onhandoffviamanifest.jsonl,.donestatus0, and transcriptHIGHEST:/Turn completedchecks beforemainruns its authoritative Astra chain), commit locally withSKIP_COUNT=1(lint Checks 37 and 42 skip their plan and program-needs halves on a worker commit, because onlymainmay stage the files they would ask for;main's own commits run them in full), and submitscripts/lane_bus.py handoff. Workers inspect../SDK,../Brand, sibling apps,todo/imports.json,docs/design/brand-contract.json,TODO-13, andTODO-15read-only so they know what exists ecosystem-wide, and send immediate mid-slice requests (scripts/lane_bus.py ecosystem-request <lane> --target sdk|brand|apps|heliograph --kind feature|propose|asset|needs|pull|bug --summary "..." [--blocking]) or--ecosystem-requestattachments whenever an unbuilt/unsynced SDK or Brand capability is needed. Workers are blocked by.githooks/pre-pushfrom pushing, never run full builds or QEMU smoke matrices, never stamp final[x]rows intodo/, never callhelio, and never edit orchestrator-only shared surfaces (todo/imports.json,docs/design/brand-contract.json,docs/design/brand-requests.json,helio.conf,.conclave/lanes.toml,.conclave/reviewers.toml,todo/implementation-plan.md,TODO-13,TODO-15). - Orchestrator (
main): integratesready(or interruptedintegrating/rolling-back) worker handoffs (integrate-begin->git merge --ff-only/git cherry-pick->integrate-record --shas-> full build/tests/QEMU +main-manifest Astra chain ->[x]stamps andtodo-plan.py --sync-> pushorigin/main+ci-wait.py->integrate-doneverifying currentmaintip, reversepatch-idnon-reversion, and byte-exact landing: for every worker file it re-merges the worker's change onto main's blob (git cat-file blob,git merge-file) and requires the result to equal that blob, so a lost final newline, blank line or binary edit is caught; a change that cannot be re-merged cleanly (a conflict, or binary content main rewrote) needs--adapted, the orchestrator's confirmation of a hand resolution; orintegrate-rollback-begin-> newest-first revert of persistedintegrated_shas->integrate-reject), dispatches idle workers, and serves as the sole gateway to sibling repositories (helio,scripts/imports.pyfor Impossible SDK/apps, anddocs/design/brand-contract.json/brand-requests.jsonfor Impossible Brand), resolving worker requests withecosystem-resolve(which notifies the requesting worker directly viaecosystem_resolved).scripts/agy-hook-bridge.pysuppressesheliograph_inbox.pyin worker sessions while injectingscripts/lane_bus.py hook-inboxinto all four lanes. The bridge takes its lane fromIMPOSSIBLE_OS_LANEalone, whichlane.shsets in the session environment at launch (unset meansmain), and finds its checkout by reading.gitfiles, so neither spends a hook's time budget on a process. In PostToolUse every agent dispatch record is written first, in oneagent_dispatch_recorder.pycall, whatever the budget; optional work runs only in the time left. A failed record or spool write makes the bridge exit 1, and a spooled message is removed only after the output carrying it was written. Claim and assign check and fast-forward a worker checkout under that lane's own lock, never under the bus lock every lane's hooks share.
Self-Healing, Self-Improving, and Direct Operator Steering
- One lifecycle, repaired by every command:
scripts/lane.shis a thin wrapper overpython3 scripts/lanes.py lane <command>, run from the primary checkout (a linked worktree's copy refuses, because the records every checkout shares name the primary checkout as their root), which owns each lane's lifecycle under the lane's flock. Every command (start,stop,attach,watch,send,status, and each heartbeat tick) first runs onereconcile(): it reads what actually exists (each launched process carriesIMPOSSIBLE_OS_LANE_PROC=<writer|heartbeat>:<lane>:<token>and this repository's root in its environment; a process is running while its recorded PID has its recorded/procstart time; a zombie is dead; an entry that cannot be read counts as running, so nothing starts beside it and nothing signals it (a process on its way out, which briefly refuses the read of its environment, is waited out rather than called unknown); only the pane process of its own tagged session is ever adopted as a writer or heartbeat, so a tagged helper a crashed writer left behind is not; a recorded PID is kept only while it carries this lane's tag, and where it is reached and stopped (session, socket, pane) is read from the process, never from the record), repairs the lane's one record ($XDG_STATE_HOME/impossible-os/lanes/sessions/<lane>/life.json, written whole and atomically, never edited in place; a malformed one is rebuilt from what exists) and removes this repository's own launch sessions that no live process runs in, then acts in steps that are each safe to repeat. The record has one schema, with one check per field (type, range, a finite time, a string a subprocess can take (no NUL, encodable as an OS argument), an entry's complete shape as a registered process or a launch not yet registered); a field that fails it, or that the schema does not name, is dropped and rebuilt the same way, and a lane with nothing gets no record at all, so no checkout claims a lane it never used. A lane start reconciles with any pending stop still in place (so an interrupted stop is finished first), checks its launch settings, and binds the shared bus only once every refusing check has passed; only finishing a stop clears a stop request, never a start (so a stop published while a start runs is not lost), so a refused start leaves the bus unbound for another clone and the pending stop for the next command to finish. A command that uses a lane (status,send,attach) also restores supervision: an armed lane whose heartbeat is gone gets a new one, so an interrupted start never leaves a writer on its own. A stop first names all its target lanes in one atomic write (sessions/stop-request-<root hash>.json, one per repository, so clones sharing a state directory never act on each other's; a request no lane command wrote is reported as an error, never read as a stop of every lane), then records each lane's stop (stopping) before its teardown (a stop that leaves a lane with nothing removes its record, so no root stays claimed), and whichever lane command reconciles a named or stopping lane next finishes it (a heartbeat tick never does: its lane's heartbeat simply ends; a laterstartof a lane takes it off the request), so an interrupted stop never leaves a disarmed writer taking input. A launcher stopped by SIGINT, SIGTERM or SIGKILL at any point, or a writer that crashes, is repaired by the next lane command. Each launch gives the writer and the heartbeat a tmux session of their own, named for that launch; both sessions carry the PATH the start checkedagyon, and the start records that PATH, the model it resolved and the heartbeat interval inlife.jsonwhen it arms the lane, so a launch, a restored heartbeat and every recovery run the same executable with the same model and interval whoever issues the command; the writer's pane registers itself (lanes.py lane execchecks under the lane lock that the record names its own PID and launch token, then execs the writer with the same PID and start time), and input goes only to that registered pane. Stop and every rollback kill only the sessions tmux itself tags as this repository's launch sessions for that lane and kind (a recorded name only says which server to ask, so no record field can aim a kill elsewhere; a process is signalled only when/proctags it as this lane's kind, never because a record names its PID, and an entry that cannot be classified stops the teardown before anything is killed), by exact name, never a window or a pane, and then rescan until no process with the lane's tag remains before releasing ownership, so an operator's windows in any other session (including one carrying a lane's base name) survive. A lane's launcher follows itsenginein.conclave/lanes.toml:agylanes runagy; aclaudeengine is allowed only onmain, wherelane.sh starthands the lane toscripts/run.sh start --engine claude(the single-lane runner, which supervises itself) and records no four-lane state, andlane.sh stopfirst tears down anything the four-lane lifecycle recorded formain(a four-lane writer started before the map changed), then runsscripts/run.sh stoponce, last, with no lifecycle lock held. Every numeric lane setting (LANE_STOP_WAIT_SECS,LANE_REAP_SECS,LANE_IDLE_SECS) is read by one parser with one bound each;startandstoprefuse an unusable value before they record anything, and finishing or repairing recorded state uses the default instead, so a bad setting never leaves a lane half-stopped. Each lane in the stop request carries when it was requested, and reconcile reads the request once: the stop it finishes is exactly the one it read, a newer stop published meanwhile stays in the request, and a start whose reconcile finished a stop requested after the start began refuses, so the stop that came last wins even when its own command was interrupted; a stop that finds its lane armed again under the lock stops it again before it reports success. The single-lane runner owns its own stop and nothing replays it from another shell or clone (a stop of aclaudemain reaches it even on a bus another clone owns, where this repository has no four-lane state): an interrupted or failed runner stop is finished by runninglane.sh stopagain, andrun.sh stoprefuses from a shell without a tmux client, reports success only once both its sessions are gone, and clears an active run phase whenever the four-lane orchestrator does not own it (so a retried stop clears what an interrupted one left), failing when that clear fails or when whether the orchestrator owns it cannot be told. The single-lane runner's identity (its tmux server and its two session names) is one record,.claude/state/run-identity:run.sh startresolves it under the main-runner lock before any ownership check and records it once every check has passed, right before anything is created (so a refused start leaves none; a start that finds the run already live records it too), and refuses one name for both sessions; the record has one format (three lines, an absolute socket path, two different session names from[A-Za-z0-9_-], all UTF-8, since tmux rewrites.and:in a session name), checked by one validator on whatever a start resolves, before anything is recorded or armed, and on every read, the same way inrun-common.shandlanes.py, and a record that breaks it is refused with what to fix, never read as "no record"; a start checks its saved conversation id before it records or arms anything; a session carrying the four-lane lifecycle tag is never taken for the runner's, whatever its name; every later step (stop, status, attach, its heartbeat, and four-lane admission when it looks for the runner) takes the identity from that record, never from the caller's environment, so a stop, status, attach or lane start from a shell on another server, or without the start'sRUN_SESSIONoverrides, still finds the run.stopremoves the record. Withmainconfigured forclaude,lane.sh attachandwatchhand over torun.sh attachandwatch. The bus keeps an armed orchestrator's claims through a crash by the same record (lanes.life_armed).statuschecks bus ownership like every other lane command. A stop of a lane that has nothing (no record, no process, and nothing on this repository's own bus: no worker record, no claim, nomain.jsonfor main) writes no record and only retires its request; shared bus records are removed only under the bus lock, after checking the bus is still this repository's, so no stop can leave a record behind to block another clone; a lane that has something was started by its own clone, which bound the bus first. A start checks that the lane's record is this repository's, and that its heartbeat interval is a whole number of seconds from 1 to half the map'sstale_secsand at most 86400, the one bound both the start and the record use (the bus declares a lane offline afterstale_secswithout a beat), before it binds the bus, and records its launch settings only when it arms a disarmed lane. Releasing a stopped lane's bus claims is part of its recorded stop, throughlane_bus.py release-stopped <lane>, whose authority is the recorded stop itself, checked under the bus lock (the bus must already be bound to this repository, and the lane's lifecycle record must belong to this repository and showstoppingtrue,armedfalse and no writer or heartbeat; it deletes only that lane's claims in states a stopped owner does not keep, keeps any claim one of the lane's own saved handoffs can reconnect (left for the orchestrator's reaper), and repairs nothing else, so any caller, a worker included, can finish a stop, while the generalreap-stale --apply, which also repairs handoffs, keeps its orchestrator check): a lane staysstoppinguntil the release is confirmed, so whichever command finishes the stop also releases the claims, and a stop whose release failed says so and exits nonzero.lane.sh stopgoes on with the other lanes when one fails, and the single-lane runner stop still runs, once, last. Single-lane admission askslanes.py lane busy, never a tmux session name, and admitsrun.shonly on its explicit idle answer (exit 3); it answers busy (0) only on positive evidence that a lane process runs or a lane is armed, and "cannot tell" (4) when uncertainty is the only evidence or a lock cannot be had, which admission treats as busy andrun.sh stopas a reason to fail and keep the phase. - Every lane command runs under one deadline (the single-transaction lane lifecycle): a stop or start gets six times
LANE_STOP_WAIT_SECSplus 30 s, every other command 30 s (LANE_COMMAND_SECSoverrides it), and every wait it makes, the bus lock, the lane and runner locks, each tmux call, both phases of a process teardown (TERM takes at most half the time left, so KILL always runs) and a claude main'srun.shcall, takes at most the time left. A command that runs out of time refuses with exit 2 and gives nothing up. A stop records all its targets in the stop journal in one write before it waits for anything; the journal keeps each lane's latest stop generation (a counter, not a clock), so a start admitted before a stop that has since finished still stays down. Every stop makes sure each target has a detached finisher (lanes.py lane finish-stop <lane>, outside every lane session) before and after it records the request, in one hold of the journal lock, so a stop killed at any step is finished with no other command. A lane has at most one owner and one waiting successor per repository: a stop that finds the owner alive starts the successor, which takes over when the owner leaves and reads the journal afresh, so the owner retires on its own clock (LANE_FINISH_SECS, one hour) and a suspended stop or owner never keeps one waiting. The finisher waits until no stop is running (each stop holds a shared lock for its life), then retries with backoff until the request is consumed. The journal, the lane records and the bus records are read with the bounded, nonblocking record reader, so a FIFO in their place never blocks a stop. A claude main's request is taken out only once both its four-lane teardown andrun.sh stopsucceeded; on a bus another clone owns, the stop and its finisher take the same decision (worker targets are confirmed empty and retired, the runner is stopped).run.shruns under coreutilstimeout, which ends it and its group at the deadline even if the lane command that called it was killed; a claude start passes the journal generation it was admitted on, andrun.sh startrefuses under the runner lock when a stop of main came after it (lane stopped-since). Git, bus and phase-guard helpers take only the time left, and a tmux server or session counts as gone only when tmux itself says so (a timeout or a permission error is "cannot tell", and ownership is kept).status alland a heartbeat round read each tmux server once; a teardown always lists afresh. - Self-healing and self-aware supervision:
scripts/overnight/lane-heartbeat.shrunslanes.py lane tick <lane>everyLANE_HEARTBEAT_SECS: it refreshes the lane's bus heartbeat, preserves armed crash-recovering claims within the backoff recovery window, restarts a dead writer with exponential backoff while armed (escalating a worker's repeated deaths tomainas ahealmessage), writessessions/<lane>/health.jsontelemetry, nudges an idle writer in its registered pane only when work is pending and no writable client is attached (or attachment cannot be told), and onmainrunslane_bus.py reap-stale --applyto heal abandoned claims, reconcile<lane>.jsonleases againstclaims.json, flush crashed landing/ecosystem notifications, or recover interrupted integration/rollback transitions. A recovery takes the main-runner lock before the lane lock, the orderrun.shand every lane admission use.lane.sh stopclears a lane's ownership only after confirming its writer and heartbeat are gone.mainandoperatormay sendsteerinstructions vialane_bus.py message; workers directnote|heal|improve|optimizefeedback tomain. - Full keyboard and mouse control across all 5 lanes: Every tmux runner session (single-lane
scripts/run.shfor Claude/agy plus all 4 Antigravity lanes inscripts/lane.sh) enforces fail-closedIMPOSSIBLE_OS_PRIMARY_ROOTsession ownership, pins its writer pane ID (the single-lane runner inIMPOSSIBLE_OS_WRITER_PANE; each lane in itslife.jsonrecord, written when the writer's pane registers itself), initializeshistory-limit 50000before creating the pane along withmouse on,focus-events on,extended-keys on, andset-clipboard on, attaches read-write (attach, never-r), checks interactive attachment under the lane lock before sending any pinned-pane idle nudge, and supports direct command injection into 1 or all 4 Antigravity lanes viabash scripts/lane.sh send <lane|all> "<instruction>"(refused from worker checkouts or worker process trees).
Launchers and Desktop Shortcuts
bash scripts/lane.sh setup-worktrees
bash scripts/lane.sh start orchestrator # or lane-1 | lane-2 | lane-3 | all
bash scripts/lane.sh status
bash scripts/lane.sh attach lane-1
bash scripts/lane.sh send all "focus on review findings first"
bash scripts/lane.sh stop all
bash scripts/lane-desktop.sh install # creates the 4 Desktop Gemini campaign shortcuts
Switching Between Single-Lane Claude Campaign and 4-Lane Gemini
- Single-lane
scripts/run.sh(Claude Code or standaloneagy) and 4-lanescripts/lane.shshareRUN_MAIN_LOCK(main-runner.lock) and refuse to start concurrently: stopping all 4 Gemini lanes (bash scripts/lane.sh stop all) clears their armed markers and reaps any abandoned worker or solomainclaims beforebash scripts/run.sh start, while stopping the single-lane campaign (bash scripts/run.sh stop) clearssequencer-armedandrun-sessionlocks beforebash scripts/lane.sh start. bash scripts/run.sh startrefuses while any 4-lane Gemini session is running/armed or any handoff is mid-integration (integrating/rolling-back); queuedreadyworker handoffs remain safely parked on theirlane/<lane>branches and theirleased_pathsstay protected from single-lane edits onmainuntil Gemini Orchestrator integrates or releases them.