The relay is the hosted service that puts your board on your phone and on your other machines. It stores sealed board records and decides who may fetch them. Reading them takes the board key, and only your paired devices hold it.
This page explains who is who on the relay, every table it stores, what it can read, how pairing moves the board key, and where the protection ends. It is written from the code, and each claim names the file that makes it true. The promises behind it are the H rows in SPEC.md, chiefly H5 and H7.
GitHub (people's identity)
a GitHub App with Metadata read-only
^
| sign-in; a role check on every write
|
+-------------+ ps_ cookie +-------------------------------------+
| Phone |<------------>| Relay |
| browser | sealed | /data/auth.sqlite |
| device key | records, | /data/boards/devices.sqlite |
| (IndexedDB) | wrapped keys,| /data/boards/<board>.journal.sqlite|
| board keys | approvals | /data/backups/ (14 days) |
| (localStorage) +-------------------------------------+
+-------------+ ^ pm_ (machine) ^ pa_ (one per agent)
^ | |
| the person's tap +-----+------------------+------+
| | Machine |
+-----+----+ terminal | board key file (mode 600) |
| Person |---------------->| relay.json: pm_, pa_ cache |
+----------+ | device roster (public keys) |
| agent agent agent ... |
+-------------------------------+
- Person: a human with a GitHub account.
- Phone: a browser signed in as the person and paired with a machine.
- Machine: a computer with a linked repository. Its CLI holds the board key.
- Agent: a worktree on a machine, registered on the board as a seat.
- Relay: one Node service (
apps/relay/src/io/deploy/server.mjs) that orders sealed records and checks who may fetch them.
The relay signs people in through a GitHub App whose only permission is repository Metadata, read-only (githubAppManifest in apps/relay/src/io/github.js). It refuses a GitHub token that carries OAuth App scopes (tokenResult in apps/relay/src/io/github.js). The GitHub user token is used once to learn the account's numeric id and login; only that id and login are stored (signedIn in apps/relay/src/io/auth.js).
The relay asks GitHub for the person's repository role on every write, and caches read checks for under ten minutes (access and ACCESS_WINDOW_MS in apps/relay/src/io/auth.js). It pins the repository's numeric id when a board is linked, so a different repository that takes the same name inherits nothing.
Browser sign-in uses one-use state, PKCE and a binding cookie (beginWeb and finishWeb in apps/relay/src/io/auth.js). The session cookie, pb_session, is HttpOnly and SameSite=Lax, and Secure over HTTPS (apps/relay/src/io/auth/http.js). The CLI signs in with GitHub's device flow. From an SSH shell, the relay first shows a page naming the board folder and the machine's host name, and the board links only after the person confirms it there (beginDevice and confirmDevice in apps/relay/src/io/auth.js, relayOn in packages/link/src/io/relay.js).
On top of the GitHub identity, the relay issues its own credentials. Each one is a prefix and 32 random bytes (random in apps/relay/src/io/auth.js). The relay keeps only a SHA-256 hash of each, and checks expiry and revocation on every use (issue and credential in apps/relay/src/io/auth.js).
| Credential | Who holds it | What it can do | Lifetime |
|---|---|---|---|
ps_ person session |
The phone, in the pb_session cookie. The CLI holds one in memory while it links a board, and clears any saved copy (loadLink in packages/link/src/io/relay.js). |
Everything the person's GitHub role allows: link boards, issue pm_ and pa_, approve phone requests, make person-only moves. |
7 days |
pm_ machine credential |
One per board per machine, in <git common dir>/pullboard/relay.json, mode 600 (linkFile in packages/link/src/io/relay.js). |
Upload snapshots, register agent seats, publish phone approvals, upload key wraps for paired devices, issue pa_ tokens and spend a pg_ grant. It cannot make person-only moves. |
30 days |
pa_ agent token |
One per agent seat, cached in relay.json or supplied as PULLBOARD_RELAY_TOKEN (actorTransport in packages/link/src/io/relay.js). |
Moves on one board as one named agent. | 1 day by default, 30 at most |
pg_ action grant |
Issued to the phone after the person taps approve, then sealed to the machine's in-memory reply key (nativePhoneAction in packages/link/src/io/relay/phone.js). |
One exact native action, such as revoking a device or a token or deleting the relay copy, bound to its approval context. | 120 seconds at most, one use |
pd_ sign-in ticket |
The CLI, during a device sign-in. The relay keeps its hash in memory. | Poll for or cancel one pending sign-in. | GitHub's device-code lifetime |
pc_ confirmation ticket |
The person's browser, in the fragment of the confirmation link. The relay keeps its hash in memory. | Confirm or decline one board link. | The sign-in, plus 10 minutes after GitHub confirms |
A person session can revoke any of its account's credentials through POST /auth/tokens/revoke; a machine or agent credential can revoke only itself (revoke in apps/relay/src/io/auth.js). Deleting a board's relay copy, or letting it expire, deletes every credential bound to it (forgetBoard in apps/relay/src/io/auth.js). The relay keeps the hashes of the ones still live until they would have expired, so a machine that uses one later hears that the relay copy was deleted and keeps working locally.
The relay labels each record with a sender taken from the credential that sent it, and ignores any sender named in the request (sender in apps/relay/src/io/service.js). Every client refuses a record its sender may not make: a machine credential may send snapshots, seat registrations, the coordinator seat and phone-approved moves, and an agent may act only as itself (relaySenderProblem in packages/state/src/logic/relay/sender.js). On the machine, a terminal that carries an agent marker or an SSH marker cannot take person actions, and the person uses the view or the phone instead (requirePersonChannel in packages/person/src/io/main.js).
Everything durable lives on one volume at /data: auth.sqlite, then devices.sqlite and one journal per board under boards/, then backups/ (apps/relay/src/io/deploy/server.mjs). The relay keeps its files at mode 600 in directories at mode 700.
| Table | File | What it holds | Kept until |
|---|---|---|---|
relay_users |
auth.sqlite |
Each signed-in GitHub account: its numeric id and login. | No deletion path. |
relay_boards |
auth.sqlite |
Each linked board: board id, repository owner/name, repository id, link time. |
The board is deleted, or 90 days pass without activity. |
relay_board_off |
auth.sqlite |
Per board turned off by a relink: the board id, its repository id, the board that replaced it, the account that relinked and the time. It is the off receipt that keeps one active link per repository. | No deletion path. |
relay_cleanup |
auth.sqlite |
Board ids whose deletion is in progress. | The deletion finishes. |
relay_deleted_credentials |
auth.sqlite |
Per credential of a deleted board: its SHA-256 hash, the board id, its expiry. | The credential's own expiry. |
relay_credentials |
auth.sqlite |
Per credential: id, SHA-256 hash, kind, account, board, agent or machine name, created, expiry, revoked flag. | The board is deleted or expires. Session rows stay, expired or revoked. |
relay_seats |
auth.sqlite |
Per board seat: board, agent name, how the seat was made (machine, registered or root), its creator, the registering move's sequence and digest, and its first credential's id, creation and expiry. | The board is unlinked or deleted. |
relay_coordinator_events |
auth.sqlite |
Each coordinator token the person issued: board, reason (bootstrap, reissue or reset), session id, the revoked token ids, the issued id and the time. | The board is unlinked or deleted. |
relay_action_grants |
auth.sqlite |
Per approved action: grant hash, request id, account, the full approval context in clear, expiry, used flag. For a passkey grant on a person request, the context is the board, the request id and the SHA-256 of the request's exact intent. | No deletion path. |
relay_passkeys |
auth.sqlite |
Per passkey a person registered: its credential id, account, public key and algorithm, signature counter and creation time. The private key stays in the person's authenticator. | No deletion path. |
relay_person_authority |
auth.sqlite |
One row: the relay's Ed25519 key pair that signs the passkey stamp on person requests. Only the public key leaves the relay. | No deletion path. |
device |
boards/devices.sqlite |
Per paired phone: account, device id, revoked flag. | No deletion path; a revoked row stays so its id is never reused. |
device_session |
boards/devices.sqlite |
Per signed-in browser session: account, session id, the paired device it belongs to, and its expiry, so a revoked device's sessions are refused. | Its expiry; expired rows are deleted whenever a session is recorded. |
wrapped_key |
boards/devices.sqlite |
Per phone and board: the board key, encrypted to that phone's public key, and the engine version. | The device is revoked or the board deleted. A board that expires idle leaves its wraps behind. |
enrollment |
boards/devices.sqlite |
A pending phone pairing: account, locator, expiry, and the phone's signed public enrollment (device id, public key, label, created time, MAC). | Deleted once the machine accepts it, or after it expires at 10 minutes. |
person_enrollment |
boards/devices.sqlite |
Per new-device challenge: account, nonce, device, expiry, the person-signed challenge payload, whether it was used, and the opaque board-key wrap once a trusted machine released it. The relay cannot open the wrap. | No deletion path yet; a used or expired challenge stays as a row. |
phone_approval |
boards/devices.sqlite |
Per request: id, account, publishing board, board, device, action, machine, expiry, the context in clear, the sealed intent, its state and the phone's sealed reply. | No deletion path; expired requests are marked expired. |
excluded_inventory |
boards/devices.sqlite |
Per account and machine: the machine label, excluded-board count, engine version and encrypted repository-name list. The relay cannot open the list. | The machine replaces its publication, or publishes an empty list when no boards remain excluded. No time-based deletion path. |
excluded_inventory_wrap |
boards/devices.sqlite |
Per account, machine and enrolled device: the excluded-list key encrypted to that device. Reads recheck the device is active. | The machine replaces or clears its publication. Revocation blocks reads but does not delete this row. |
journal_meta |
boards/<board>.journal.sqlite |
The board id and the journal format. | The board is deleted or expires. |
journal_head |
boards/<board>.journal.sqlite |
The latest sequence number and the time of the last move or request. | The board is deleted or expires. |
journal_record |
boards/<board>.journal.sqlite |
Per record: sequence, arrival time, kind (move or request), sealed payload, sender kind, sender account, agent or machine name, and, for a person request a passkey confirmed, its stamp: board, request id, intent digest, passkey credential id, time and the relay's signature. | The next snapshot covers it. |
journal_registration |
boards/<board>.journal.sqlite |
Per seat a move registered: the target seat, its creator, the move's sequence and the sealed move's digest, so a replica checks who created a seat. | The board is deleted or expires. |
journal_snapshot |
boards/<board>.journal.sqlite |
One sealed snapshot: the sequence it covers, arrival time, sealed payload, sender. | The next snapshot replaces it. |
board_link_delivery |
boards/<board>.journal.sqlite |
Per cross-board envelope a linked board receives: the source board, a correlation id, the link id and generation, its position, digest, the sealed envelope and its receipt. The relay cannot open the envelope. | The board is deleted or expires; it counts toward the board storage quota. |
page_meta |
boards/<board>.journal.sqlite |
The board id and the history page format. | The board is deleted or expires. |
page_object |
boards/<board>.journal.sqlite |
Per sealed history page: its id, the sequence it reaches, the sealed payload, its child page ids and its creation time. | Collection deletes a page that no current root, pin or staged upload reaches. |
page_upload |
boards/<board>.journal.sqlite |
Per staged page upload: id, the sender's account id, kind and agent or machine name, the sequence it covers and its expiry. | It is published, or it expires. |
page_upload_object |
boards/<board>.journal.sqlite |
Which sealed pages a staged upload holds: the upload id and the page id. | Its upload is deleted. |
page_pin |
boards/<board>.journal.sqlite |
Per read in flight: id, the reader's account id, kind and agent or machine name, the root page it reads and its expiry. | It expires. |
journal_upload_status |
boards/<board>.journal.sqlite |
One opaque, board-key-sealed notice of a refused snapshot upload. The relay cannot read its repository name, measured size or reported limit. | The next accepted snapshot clears it atomically, or the board is deleted or expires. A later notice is ignored once a snapshot exists. |
storage_warning |
boards/storage-quota.sqlite |
Per board refused for account storage: the board, the account id and login in clear, the bytes used and allowed, and the bytes the refused write needed. | The board's next stored checkpoint, or the board is unlinked. |
Once a day the relay copies each journal into backups/ and keeps each copy for 14 days; deleting a board deletes its copies at once (apps/relay/src/io/retention.js). After 60 days without activity the relay warns on the next contact, and at 90 days it deletes the board.
Some state lives only in memory and ends with the process: machine-to-machine pairing packages, pending sign-ins with their GitHub device codes and board confirmations, GitHub App installation tokens, and the read-permission cache (apps/relay/src/logic/pairing/store.js, apps/relay/src/io/auth.js, apps/relay/src/io/github.js).
The relay sees who and when. It knows every GitHub account that signs in, every linked repository name, and for each record its sequence, arrival time, size, kind and sender: the person's account, a machine's id (machine- and a random UUID, from packages/link/src/io/relay/machine.js) or an agent's seat name. From those it can tell how active each board is and which agents work on it. It knows which phones are paired to which account and which boards each phone has keys for, along with each phone's public key and its label, Phone browser. Like any web service, it receives the network address of every request.
It also reads phone approvals. A machine publishes each approval with its context in clear: account, boards, device, action, target (a repository name, device id or token id), machine id, the exact command text and the expiry (approvalContext in packages/link/src/logic/relay/approval.js). The relay keeps that context in phone_approval and again in relay_action_grants. When a board is linked from an SSH shell, the relay holds the machine's host name and the board's folder name in memory to show on the confirmation page.
Board contents travel sealed: items, criteria, shouts, verdicts and spec rows. The machine seals each snapshot, move and request with AES-256-GCM under the board key, and the associated data binds the board id, the sequence and the kind (seal in packages/kernel/src/logic/seal.js). The relay checks only that a payload is canonical base64url, then stores the bytes unparsed (sealed in apps/relay/src/io/service.js, apps/relay/src/io/journal.js). Your repository's code stays on your machine; only board records go to the relay.
The relay never receives a board key in a form it can use. A phone gets it wrapped to the phone's own ECDH key, and another machine gets it sealed under a secret that exists only in the printed pairing code. The pairing secrets themselves stay off the relay: the phone's secret rides in the link's fragment, which the browser never sends (apps/relay/src/io/browser/devices.js).
Linking a board. pullboard relay on makes a 256-bit board key on the machine and keeps it in ~/.pullboard/relay-keys/<board>.key, mode 600 (generateBoardKey in packages/kernel/src/logic/seal.js, storeBoardKey in packages/keys/src/io/relay.js). The person signs in and the relay records the link. The machine receives its pm_ and uploads the board's first sealed snapshot.
Pairing a phone. The machine makes a one-time locator and secret, keeps the secret in its private relay-machine/state.json, and shows both in a QR code (beginDeviceEnrollment in packages/link/src/io/relay/machine.js). The phone makes an ECDH P-256 key pair whose private half cannot be exported, and keeps it in IndexedDB (createDeviceKeys in packages/keys/src/logic/device.js). It signs its public key with an HMAC derived from the secret and posts it through the relay (signDeviceEnrollment). The machine checks that MAC before it trusts the key, so the relay cannot slip in a key of its own (acceptDeviceEnrollment in packages/link/src/io/relay/machine.js). The machine then wraps the board key to the public key it recorded itself (wrapForRecordedDevice) and uploads the wrap with its pm_. It wraps again on every sync (deliverDeviceWraps in packages/link/src/io/relay.js). The phone unwraps it with its private key and keeps the board key in localStorage (deviceBoardKeys in apps/relay/src/io/browser/devices.js, used by apps/relay/src/io/browser/client.js).
Pairing another machine. pullboard relay pair prints a code made of the board id, a locator and a 256-bit secret. The machine seals the board key and a snapshot under that secret and posts the package (sealPairingBundle in packages/person/src/io/pairing.js). The relay holds it in memory for ten minutes and hands it out once, to a caller who can read the board (apps/relay/src/logic/pairing/store.js, apps/relay/src/logic/pairing/http.js).
Phone approvals. For a native action that needs the person, such as revoking a device, the machine publishes the context and a sealed intent, authenticated with an HMAC under the board key so the relay cannot invent one (phoneProposal in packages/link/src/io/relay/phone.js). The intent also carries the machine's host name and the board's name, sealed, so the phone can show them and the relay cannot read or change them (proposalNames in packages/link/src/io/relay/phone.js). The phone shows the request. On a tap the relay issues a pg_; the phone seals it to the machine's in-memory reply key, and the machine spends it once (issueActionGrant and consumeActionGrant in apps/relay/src/io/auth.js).
One order for every move. The relay gives each record the next sequence number atomically and refuses repeats and gaps (insert in apps/relay/src/io/journal.js). Every client applies records in that order with the CLI's own rules.
A relay canary is an opt-in monitor on an ordinary client machine. It checks the authenticated board move path by signing in as its configured ordinary seat, sending a nonce-bearing shout through the normal ordered move, pulling the fresh event and unsealing the exact returned move. A successful /health response alone is not a round trip. The canary does not alter the relay API or add a server-side table.
pullboard relay canary on [--timeout <milliseconds>] stores relay.canary in this machine's settings: an enabled flag, an absolute checkout path, the registered non-coordinator agentId, and an optional deadline (5 seconds by default; 100–25,000 ms when set). The credentials stay in the existing local link and key stores. The setting binds the run to that checkout and seat. To monitor one board from two machines, link that board normally on each and configure one ordinary seat per machine after the feature lands. pullboard relay canary off disables an existing setting (or leaves an absent setting unset); status reads local observations without a network request; run executes one probe; watch runs an immediate probe and then checks once per minute until stopped with Ctrl-C. The watch is separate from the ordinary ten-minute health scan.
Each machine keeps its observations and minute schedule in a private SQLite file at <git common dir>/pullboard/relay-health.sqlite. A fresh result is healthy or degraded; after two minutes without a recent sample, status is unknown. Two consecutive failed probes create an alert. A latency alert requires a complete ten-minute window and at least ten successful samples, with p95 above two seconds. The local Needs-you entry reports the actual queued move count from that machine's outbox. It is local telemetry: it is not included in sealed board presentations or sent to other devices as health state.
On an alert or recovery, the configured seat sends notices through ordinary native ordered shouts to the coordinator and person. If the relay or native notification route is unavailable, the notice remains pending locally and is retried; a later delivery is labeled delayed. A local alert or successful native write is not a phone acknowledgement. Closed-phone push delivery is a separate notification path.
For an operational drill, interrupt the authenticated sign-in, move-upload or fresh-event-read route used by the client, then restore that route and run a complete probe. Do not substitute an HTTP health endpoint for those client routes. The expected recovery is a later successful sealed round trip; if its notice could not travel during the outage, it remains delayed. Configuration alone does not mean either production host has been linked or has completed a successful probe.
A new relay process on the same /data volume keeps every account, link, credential hash, paired phone, wrapped key, approval and journal; apps/relay/tests/logic/http/device.test.js reopens the relay's databases as a new process would and proves that a paired phone and its wrapped keys survive. A restart ends what lives only in memory, so a half-finished sign-in or pairing starts again. The service runs as a single replica, since one writer owns these SQLite files (apps/relay/src/io/deploy/README.md).
A phone pairs again when its browser storage is cleared, when it signs in as another account, or when the device is revoked. The hosted page can be installed to the Home Screen and asks the browser to keep its storage, since Safari on iPhone can clear a site's storage after seven days without a visit (apps/relay/src/logic/browser/install.js).
Immutable facts derived from accepted main are stored in the private Git-common-directory cache. The cache retains current main and at most eight recent commit groups by default; older groups are evicted in the same transaction as insertion, and SQLite reclaims the freed space. The default database cap is 512 MiB. PULLBOARD_MAIN_FACTS_MAX_BYTES sets the local byte cap (minimum 16384); PULLBOARD_MAIN_FACTS_RECENT_COMMITS sets the number of recent groups (1–1000). Invalid values use the defaults. Oversized legacy cache contents are discarded and rebuilt. If the cache is unavailable, busy, unsafe or cannot write, facts are derived without the cache; source and board authority are unchanged. Evictions emit one diagnostic line.
The relay sees metadata. The section on what it can read lists all of it: accounts, repository names, record sizes and timing, seat names, machine ids, which phones hold which boards, and network addresses.
A compromised relay could serve a compromised page. Every script the phone runs comes from the relay (apps/relay/src/io/browser/page.js), and nothing outside the relay pins or signs that code. Such a page could read the board keys the phone keeps in localStorage.
Approval context is in clear. The relay reads each requested action, its target, the machine id and the command text, and keeps them with no deletion path.
The sender of a record is the relay's word. The seal binds the board, the sequence and the kind, and leaves the sender outside it (packages/kernel/src/logic/seal.js), so a compromised relay could relabel a validly sealed move. The device key only agrees keys: it cannot sign, and no passcode or Face ID guards it. A phone approval proves a tap in a browser that holds the session cookie.
Agents on a machine share what is on disk. Every agent runs as the same operating-system user, so any of them can read the board key file and relay.json. The pm_ there can issue a pa_ for any seat name the relay is given (issueToken in apps/relay/src/io/auth.js), and only the client checks that the name is a registered seat (actorTransport in packages/link/src/io/relay.js).
Revoking a phone stops new wraps and deletes its stored ones, and the board keys it already received stay usable to whoever holds them. Board key rotation is a separate step.
Some rows have no deletion path: relay_users, relay_action_grants, relay_passkeys, relay_person_authority, phone_approval, person_enrollment and the device tombstones. A board that expires for inactivity leaves its wrapped_key rows behind.
RFC 0004 describes keeping the board key in the operating system's keychain. The code keeps it in a mode-600 file and moves any older keychain copy into that file (packages/keys/src/io/relay.js).
Every item travels the same hops from claim to merged. Each row below names the invariant the hop must keep, the harness that proves it, and the live receipt that shows it in production. A harness runs real git, a real SQLite board and real child processes in its own temp folders, never in a checkout, and its after-hook fails it if any process it started is still alive. NONE means no harness exists yet: that is real debt, not a pass. A row is current only when its harness passes and the live receipt agrees.
node packages/gate/src/io/matrix.js --live runs every harness under packages/gate/tests/fixtures/pipeline/ one after another and prints this matrix with PASS, FAIL or NONE and each timing; --json prints the same rows for a view screen. A repro row names the fix commit it must fail before: node packages/gate/src/io/matrix.js --only <harness> --against <commit>^ runs it on the older tree. The harnesses are slow and are not part of the gate; packages/gate/tests/io/matrix.test.js keeps this table, the harness files and the runner in step.
Harness results below are from 8 November 2026. Live receipts are this board's pullboard gate-health report for the two hours before 11:45 pm CT that night, while the machine ran at load 60 or more.
What the matrix says today:
- Board command latency: through the warm resident process, show, whoami and inbox meet 200 ms on the fixture board; status, claim and next do not yet. A fresh process loads 1,415-1,674 modules for each seat command. The periodic main audit runs the same check (
apps/cli/src/io/landing/budget.js): a module count over its ceiling inpackages/gate/data/ceilings/board-commands.json, or a median over 200 ms, files a board item naming the command, the value, the ceiling, the modules it newly loads and the commits since the last passing check; a pass lowers each ceiling to what it measured. - Five hops pass their harness while production disagrees, command latency above among them. The other four: READY misses, requeue time, admission time and SUBMIT_HANDOFF_DEAD counts in the window still include gates that started before the 8 Nov fixes, on runners under load 60. Each becomes current when a later window agrees.
Every move the loop makes, written down from the code as it is on 9 November 2026, so nothing can happen that is not on this page. Each row cites the function that does it (function in file) and the harness that proves it, or NONE where nothing does; a NONE row is open debt. packages/state/tests/fixtures/machines.json holds the same tables as data, and packages/state/tests/machines.test.js fails when the code names a status, a move, a job kind or a job step that the map lacks, or the map names one the code lacks.
One invariant runs through all of it: a job, a lease or an offer whose item is no longer in the state it serves ends at once. Where the code breaks it, the row says violated and names a gap from the list at the end.
An item has five statuses, declared with its moves as STATES and MOVES in packages/state/src/logic/machine/declaration.js. One function writes a status, checkedItemMove in packages/store/src/io/board.js, and the board file's own triggers refuse any change that no move declares (UNDECLARED_MOVE) or any status that is not declared (UNDECLARED_STATE).
| Status | Final | Means |
|---|---|---|
open |
no | waiting for a builder; claimable once what it waits on is verified |
claimed |
no | one seat holds it under a lease, its criterion frozen |
submitted |
no | gated green (or intaken from outside) at a pinned commit, waiting on review |
verified |
no | accepted at its commit; landed once item_merged_commit is set |
withdrawn |
yes | nobody should build it; nothing leaves it |
These are not statuses. Each is a field or an event on top of one:
| Flag | Stored as | Set by | Note |
|---|---|---|---|
| merged | item_merged_commit and a merged event | merged in packages/store/src/io/board/merged.js |
a flag on a verified item, never a status; the display stage is landed |
| held | item_hold_reason, item_hold_by, item_hold_at | applyItemHold in packages/items/src/logic/holds.js |
blocks claim (ITEM_HELD) and landing selection; lifted by applyItemHoldRelease or liftConditionalHold |
| reopened | a reopen event | reopen in packages/store/src/io/board/reopen.js |
an event; the item goes to open |
| in review | item_review_by, item_review_until and a review job | reserveWithin in packages/store/src/io/board/reserve/review.js |
the reserve move; status stays submitted |
| frozen | item_frozen_digest | claim in packages/store/src/io/board/claim.js |
the criterion a claim is judged against |
| lapsed claim | item_lease_until in the past | current in packages/store/src/io/board/query.js |
read as open by every reader; written back only by a later release or claim |
A declared move is in MOVES; an undeclared one is a code path the declaration does not name.
| Move | From | To | By | Cause | Where | Guard (refusals) | Emits | Harness |
|---|---|---|---|---|---|---|---|---|
add (undeclared) |
(new) | open |
agent, coordinator | pullboard add | insertItem in packages/store/src/io/board/add.js |
machine_item_start trigger (UNDECLARED_MOVE) | add | apps/cli/journeys/verify/machine.test.js |
claim |
open, claimed |
claimed |
agent, coordinator | pullboard claim, next, next --take | claim in packages/store/src/io/board/claim.js |
NOT_CLAIMABLE, HELD, ITEM_HELD, LANE_HELD, BLOCKED, WRONG_LANE, ROUTE, ITEM_BUILD_BUDGET, ONE_CLAIM, REOPEN_HELD_FOR_BUILDER, PENDING_REFREEZE, LINE_WIP_LIMIT | claim or renew | apps/lib/tests/claim.test.js |
release |
open, claimed |
open |
agent, coordinator | pullboard release; stale and idle maintenance | releaseClaim in packages/store/src/logic/board/claim.js |
NOT_YOURS, RELEASE_REASON, ENGINE_VERSION | release (+hold_item after a second release) | apps/lib/tests/hold.test.js |
lapse |
claimed |
open |
clock | a claim lease runs out; written only by an edit of an expired claim or by stale maintenance as a release | applyStaleState in packages/store/src/logic/board/stale/apply.js |
caller checks STALE_STATE_CHANGED; the move's state check is passed as null | release {expiredClaim} and stale_maintenance; never a lapse event | apps/lib/tests/lapse/claim.test.js |
submit |
claimed |
submitted |
agent, coordinator | pullboard submit, after its queued gate is green | submit in packages/store/src/io/board/submit.js |
NOT_YOURS, PENDING_REFREEZE, BAR_NOT_READY, CLAUSE_UNTICKED, SUBMISSION_PROOF, CHILDREN_OPEN, HEAD_NOT_NEW; CLI: DIRTY, OUTSIDE_LANE, GATE_RED | submit | apps/cli/tests/io/submit/handoff.test.js |
submit-merge |
claimed |
verified |
agent, coordinator | pullboard submit of a carried acceptance | submit in packages/store/src/io/board/submit.js |
the submit guards, MERGE_ONLY_PROOF, SELF_VERIFY, PROOF_REQUIRED | merge-only-accept, submit | apps/cli/journeys/verify/machine.test.js |
intake |
open |
submitted |
agent, coordinator | pullboard intake | applyOutsideIntake in packages/store/src/io/outside.js |
NOT_CLAIMABLE, OUTSIDE_HEAD_CHANGED | outside-intake | apps/cli/journeys/verify/machine.test.js |
reserve |
submitted |
submitted |
agent, coordinator | next --verify, plain next's mandatory review | reserveWithin in packages/store/src/io/board/reserve/review.js |
NOT_SUBMITTED, GATE_PENDING, REVIEW_COOLDOWN, COMPANION_WINDOW, SELF_VERIFY, SAME_FAMILY, REQUIRED_REVIEW_FAMILY, ROUTE, REVIEW_HELD | reserve | packages/moves/tests/logic/moves/reserveNextReview/durable.test.js |
accept |
submitted, verified |
verified |
agent, coordinator | pullboard verify accept; verified to verified only for a new review on newer engines | verify in packages/store/src/io/board/verify.js |
NOT_SUBMITTED, GATE_PENDING, ALREADY_MERGED, SELF_VERIFY, CRITERIA_CHANGED, PROOF_REQUIRED, CHECK_RED | accept and a verdict row | apps/cli/journeys/verify/machine.test.js |
accept (machine) (undeclared) |
submitted |
verified |
coordinator | a machine-proved submission is accepted after submit | acceptMachineSubmission in packages/verify/src/io/machine.js |
every accept guard passed as null; only the caller's MACHINE_PROOF check and the database proof trigger | accept by coordinator | NONE |
reject |
submitted, verified |
open |
agent, coordinator | pullboard verify reject | verify in packages/store/src/io/board/verify.js |
as accept, plus BAD_REASON, NOTE_REQUIRED, BAR_CLAUSE_REQUIRED | reject and a verdict row (+hold_item, bar-sharpen) | packages/board/tests/from-store/any.test.js |
reopen |
submitted, verified |
open |
agent, coordinator | pullboard reopen; automatic trunk conflict; verdict withdrawal; stale verdict at landing | reopen in packages/store/src/io/board/reopen.js |
NOT_SUBMITTED, COORDINATOR_ONLY, ALREADY_MERGED, VERDICT_WITHDRAW_*, NOTE_REQUIRED, BAD_CONFLICT | reopen | apps/cli/journeys/land/merge.test.js |
escalate |
open, claimed |
open |
agent, coordinator | pullboard escalate | escalate in packages/store/src/logic/board/escalate.js |
CLOSED, NOTE_REQUIRED, NOT_YOURS | escalate | apps/cli/journeys/verify/machine.test.js |
refreeze |
open, claimed, submitted, verified |
open |
coordinator | pullboard refreeze (edit --criterion) | refreeze in packages/store/src/io/board/refreeze.js |
COORDINATOR_ONLY, CLOSED (verified only inside a spec correction, never merged), BAR_NOT_READY | refreeze | apps/cli/journeys/verify/machine.test.js |
refreeze |
claimed |
claimed |
agent, coordinator | the holder takes a refrozen bar | refreeze in packages/store/src/io/board/refreeze.js |
NOT_YOURS, UNKNOWN_SPEC | refreeze | apps/cli/journeys/verify/machine.test.js |
withdraw |
open, claimed, submitted, verified |
withdrawn |
coordinator | pullboard withdraw; a forced merged on an unverified item | withdraw in packages/store/src/io/board/withdraw.js |
CLOSED, COORDINATOR_ONLY, NOTE_REQUIRED, STALE_MAIN_RED | withdraw; ends a queued or running hand-off record | apps/cli/journeys/verify/machine.test.js |
patch |
submitted, verified |
submitted |
coordinator | pullboard patch attach or remove | invalidateItemPatch in packages/items/src/io/patches.js |
ITEM_PATCH_STATE, COORDINATOR_ONLY, ALREADY_MERGED | item_patch_attach or item_patch_remove | apps/cli/journeys/verify/machine.test.js |
patch-claimed |
claimed |
claimed |
coordinator | pullboard patch on a claimed item | invalidateItemPatch in packages/items/src/io/patches.js |
ITEM_PATCH_STATE, COORDINATOR_ONLY | item_patch_attach | apps/cli/journeys/verify/machine.test.js |
patch-objected |
claimed, submitted |
open |
agent | pullboard patch object | applyItemPatchObjection in packages/items/src/io/patches.js |
ITEM_PATCH_WINDOW, NOTE_REQUIRED | item_patch_object | apps/cli/journeys/verify/machine.test.js |
rehomeImport |
open |
verified |
agent | pullboard rehome with a carried ACCEPT | applyRehomeItem in packages/items/src/io/rehome.js |
REHOME_VERDICT, NOT_AT_COMMIT, SELF_VERIFY, CRITERIA_CHANGED, PROOF_REQUIRED | rehome_import, rehome_applied | apps/cli/journeys/verify/machine.test.js |
reland |
open |
verified |
coordinator | landing re-lands an accepted green item | relandAccepted in packages/store/src/logic/board/reland.js |
COORDINATOR_ONLY, RELAND_NOT_ELIGIBLE, NOT_AT_COMMIT, SELF_VERIFY, CRITERIA_CHANGED, PROOF_REQUIRED; declared in packages/state/src/logic/machine/move/reopen.js |
reland | packages/moves/tests/reopen.test.js |
red return (undeclared) |
claimed |
claimed |
clock | a queued gate comes back red; the builder keeps the claim with a renewed lease | returnToBuilder in packages/store/src/io/submit/handoff/retry.js |
the hand-off record's own state; lease set with setItem | renew {queuedRedReturn}, submit_handoff_returned | apps/cli/tests/io/submit/handoff.test.js |
merged (undeclared) |
verified |
verified |
coordinator | pullboard merged, or a landing batch finishing | merged in packages/store/src/io/board/merged.js |
COORDINATOR_ONLY, NOT_VERIFIED, FORCED_REASON; no check for an existing item_merged_commit on the CLI path (the batch path checks it) | merged | apps/cli/journeys/land/main.test.js |
No move declares these, so the board file refuses them whatever command asks. A harness can assert each one.
| Change | Enforced by | Harness |
|---|---|---|
| submitted → claimed | storeTriggers in packages/state/src/io/machine.js |
apps/cli/journeys/verify/machine.test.js |
| verified → claimed | storeTriggers in packages/state/src/io/machine.js |
apps/cli/journeys/verify/machine.test.js |
| withdrawn → open | storeTriggers in packages/state/src/io/machine.js |
apps/cli/journeys/verify/machine.test.js |
| withdrawn → claimed | storeTriggers in packages/state/src/io/machine.js |
apps/cli/journeys/verify/machine.test.js |
| withdrawn → submitted | storeTriggers in packages/state/src/io/machine.js |
apps/cli/journeys/verify/machine.test.js |
| withdrawn → verified | storeTriggers in packages/state/src/io/machine.js |
apps/cli/journeys/verify/machine.test.js |
| verified and merged to open or submitted (guard only: the trigger allows verified to open and to submitted; only the ALREADY_MERGED guards in verify, reopen and patch, and CLOSED in refreeze, stop it) | reopen in packages/store/src/io/board/reopen.js |
packages/moves/tests/reopen.test.js |
restoreDocumentinpackages/store/src/io/exchange.js: board import and relay restore drop the machine triggers and insert any item_status.undoQueuedWithinpackages/outbox/src/logic/undo.js: relay undo suspends the guards and reapplies an inverse changeset.acceptMachineSubmissioninpackages/verify/src/io/machine.js: accept with every guard passed as null.mergedinpackages/store/src/io/board/merged.js: a second pullboard merged overwrites item_merged_commit and logs a second merged event.
A job is a row with append-only steps and a lease (RFC 0008). Its current step is the last one written; done is a mark set only by finishJob in packages/jobs/src/io/lease.js. Job leases are LEASE_MS, 2 minutes. Each table names the item state the job serves, and whether the code ends the job once the item leaves it.
- Id:
<hand-off id>. Created byshadowSubmitHandoffinpackages/jobs/src/io/shadow.js. - Serves: item claimed by the hand-off's seat at its commit and frozen digest, until the gate's green turns into the submit.
- States:
queued,captured,running,collected,green,submitted,red,incomplete,infrastructure,ownership-wait,ended,reoffered,withdrawn,done. Terminal:green,submitted,red,incomplete,ownership-wait,ended,withdrawn,done. - Lease: none in production since f226542983; legacy handoff-drive rows carried a 2-minute lease (LEASE_MS).
- Ends when its item moves on: partial, at
startSubmitHandoffinpackages/store/src/io/submit/handoff/retry.js: checked on queue and on queued to running; a running record is resumed with no item check (no driver resumes one since #6580 deleted the hand-off worker). The fallback's predicate is submitted-at-commit (submittedAt), which is the wrong serving state for a pre-submit gate. - Harness:
apps/cli/tests/io/submit/handoff.test.js.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | queued |
pullboard submit queues its gate; checks claimed, owner, live lease, digest | queueSubmitHandoff in packages/store/src/io/submit/handoff/retry.js |
queued |
running |
the driver starts; checks claimed, owner, digest | startSubmitHandoff in packages/store/src/io/submit/handoff/retry.js |
running |
green |
code 0 and the item is submitted at the result commit | completeSubmitHandoff in packages/store/src/io/submit/handoff/retry.js |
running |
red |
a red gate; the builder keeps the claim | completeSubmitHandoff in packages/store/src/io/submit/handoff/retry.js |
running |
ownership-wait |
the source needs another lane's file | completeSubmitHandoff in packages/store/src/io/submit/handoff/retry.js |
running |
infrastructure |
SUBMIT_HANDOFF_DEAD or another infrastructure stop | recordInfrastructureStop in packages/store/src/io/submit/handoff/retry.js |
infrastructure |
queued |
a retry under a new id, up to INFRASTRUCTURE_RETRY_LIMIT (3) | retryStoppedHandoff in packages/store/src/io/submit/handoff/retry.js |
queued |
ended |
the item is withdrawn | endWithdrawnHandoff in packages/store/src/io/submit/handoff/retry.js |
running |
ended |
the item is withdrawn; the running driver is not told | endWithdrawnHandoff in packages/store/src/io/submit/handoff/retry.js |
running |
withdrawn |
legacy leased row only: the fallback finds its item no longer submitted at its commit | endDeadGateJobs in packages/drive/src/io/reclaim.js |
running |
ended |
legacy leased row only: the fallback finds no step for 20 minutes | endDeadGateJobs in packages/drive/src/io/reclaim.js |
ended |
reoffered |
gate.reofferInfraEnd is on and the job ended as infrastructure: one more gate job is offered for the same candidate, then this one is done | reofferGateJob in packages/drive/src/io/reclaim.js |
- Id:
review:<item>. Created byreserveReviewinpackages/jobs/src/io/review.js. - Serves: item submitted at the reserved commit and digest, reserved by this reviewer.
- States:
reserved,lapsed,released,accept-queued,accept-settled. Terminal: none (released, never done). - Lease: LEASE_MS 120 s on the job; item_review_until follows the reviewLease setting (30 m); renewed only when the same reviewer reserves again; extended by a sweep while the reviewer heartbeats.
- Ends when its item moves on: violated (gap SM5), at
sweepLapsedReviewsinpackages/store/src/io/board/review/lease.js: no verdict, withdraw or reopen releases the job; reclaimLapsedReviews extends the lease while the reviewer heartbeats whatever the item's state - Harness:
packages/moves/tests/logic/moves/reserveNextReview/durable.test.js.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | reserved |
next --verify reserves | reserveReview in packages/jobs/src/io/review.js |
reserved |
reserved |
the same reviewer reserves again | renewReview in packages/jobs/src/io/review.js |
reserved |
lapsed |
a sweep finds the lease lapsed and the reviewer silent | reclaimLapsedReviews in packages/jobs/src/io/review.js |
reserved |
released |
another reviewer takes it over | releaseReview in packages/jobs/src/io/review.js |
reserved |
accept-queued |
verify accept queues the frozen check as a runner job and names it on the review job (ae1fb799be, #8636) | ACCEPT_QUEUED in apps/cli/src/io/test/accept.js |
accept-queued |
accept-settled |
the check job's receipt records the reviewer's accept or reject once (ae1fb799be, #8636) | settleQueuedAccept in packages/api/src/io/test/accept.js |
- Id:
land:run:<uuid>. Created bydriveLandinginpackages/drive/src/io/landing.js. - Serves: the verified, unmerged items of one landing pass.
- States:
started,finished,failed,done. Terminal:done. - Lease: LEASE_MS 120 s renewed every 5 s until the run returns; LANDING_STALL_MS 10 min without progress stalls it.
- Ends when its item moves on: held, at
mergeGroupinpackages/landing/src/io/step/merge.js: the job never reads items, but every landing step re-checks verified at the commit (selection, merge, trunk, publish) - Harness:
apps/cli/journeys/land/main.test.js.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | started |
automatic landing or pullboard land | driveLanding in packages/drive/src/io/landing.js |
started |
finished |
the run returned; then done | driveLanding in packages/drive/src/io/landing.js |
started |
failed |
LAND_STALLED or a throw; lease released, never done | driveLanding in packages/drive/src/io/landing.js |
- Id:
land:batch:<batch> or land:merged:<ids>:<commit>. Created bylandBatchinpackages/land/src/io/runs.js. - Serves: the batch's verified items at their recorded commits.
- States:
select,compose,prove,merge,record,publish,done. Terminal:done. - Lease: taken or renewed between steps; LAND_PROOF_NOT_GREEN and JOB_LEASED leave the lease to lapse with no done.
- Ends when its item moves on: partial, at
landMergedinpackages/land/src/io/runs.js: the batch steps check items; landMerged relies on its caller's check - Harness:
apps/lib/tests/durable/land/done.test.js.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | select |
a batch or pullboard merged starts the sequence | finishSequence in packages/land/src/io/sequence.js |
select |
compose |
next step | finishSequence in packages/land/src/io/sequence.js |
compose |
prove |
next step | finishSequence in packages/land/src/io/sequence.js |
prove |
merge |
proof green | finishSequence in packages/land/src/io/sequence.js |
merge |
record |
next step | finishSequence in packages/land/src/io/sequence.js |
record |
publish |
next step | finishSequence in packages/land/src/io/sequence.js |
publish |
done |
finished | finishSequence in packages/land/src/io/sequence.js |
- Id:
main-test:<key>. Created bymainRedLookupinpackages/drive/src/io/main/red.js. - Serves: no item: main's tree and one test file.
- States:
queued,offered,unoffered,receipt. Terminal:receipt. - Lease: none.
- Ends when its item moves on: n/a, at
mainRedLookupinpackages/drive/src/io/main/red.js: keyed by tree; no driver ends a job queued by receiptComparison - Harness: NONE.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | queued |
a red file is looked up on main | receiptComparison in packages/landing/src/io/main/red/receipt.js |
queued |
offered |
the recheck offers the queued file to a runner | offerMainTests in packages/api/src/io/recheck.js |
queued |
unoffered |
the queued tree is not among trunk's recent commits | offerMainTests in packages/api/src/io/recheck.js |
queued |
receipt |
submit returns a main test result | returnMainTest in packages/gate/src/io/main/verdict.js |
- Id:
gate-verdict:<item>:<candidate>. Created byrecordGateVerdictinpackages/gate/src/io/main/verdict.js. - Serves: item submitted at the candidate, waiting on main's own test result.
- States:
awaiting-main,verdict. Terminal:verdict. - Lease: none; finished on each drain pass (5 s).
- Ends when its item moves on: violated (gap SM16), at
finishAwaitingVerdictsinpackages/gate/src/io/main/verdict.js: no item check - Harness: NONE.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | awaiting-main |
a gate red only where main is red | recordGateVerdict in packages/gate/src/io/main/verdict.js |
awaiting-main |
verdict |
main's result arrives | finishAwaitingVerdicts in packages/gate/src/io/main/verdict.js |
- Id:
flakeDiagnoseKey(tree, file, case). Created byqueueFlakeDiagnosesinpackages/drive/src/io/diagnose.js. - Serves: a finished gate's verdict.
- States:
queued,diagnosed,attached. Terminal:attached. - Lease: released when finished.
- Ends when its item moves on: n/a, at
finishFlakeDiagnoseinpackages/drive/src/io/diagnose.js: runs after the verdict; never changes the item - Harness: NONE.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | queued |
a verdict with flaky tests | queueFlakeDiagnoses in packages/drive/src/io/diagnose.js |
queued |
diagnosed |
diagnosis done | finishFlakeDiagnose in packages/drive/src/io/diagnose.js |
diagnosed |
attached |
attached to the item | finishFlakeDiagnose in packages/drive/src/io/diagnose.js |
- Id:
<kind>:<tree>. Created bykeyedResultinpackages/drive/src/io/keyed.js. - Serves: no item: a tree id.
- States:
produce.started,part.<name>,result. Terminal:result. - Lease: LEASE_MS 120 s renewed every 5 s until produce settles, with no stall bound.
- Ends when its item moves on: n/a, at
produceUnderLeaseinpackages/drive/src/io/keyed.js: keyed by content - Harness: NONE.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | produce.started |
the first reader takes the lease | produceUnderLease in packages/drive/src/io/keyed.js |
produce.started |
result |
produce returned | produceUnderLease in packages/drive/src/io/keyed.js |
- Id:
test-run:<uuid>. Created byqueueTestRuninpackages/drive/src/io/queue.js. - Serves: no item that it ends: the seat that queued it, and an optional item for display.
- States:
queued,running,pulled,result,lost,cancelled,delivered. Terminal:delivered. - Lease: LEASE_MS 120 s, taken by the worker and renewed every RENEW_MS; a worker that dies stops renewing and the run is reported lost 2 minutes later.
- Ends when its item moves on: n/a, at
workTestRuninpackages/drive/src/io/queue.js: serves the queuing seat, never an item state; no driver ends it on an item move - Harness: NONE.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | queued |
pullboard test queues a run and starts its detached worker | queueTestRun in packages/drive/src/io/queue.js |
queued |
running |
the worker takes the lease | workTestRun in packages/drive/src/io/queue.js |
running |
result |
the work returned or failed; lease released | workTestRun in packages/drive/src/io/queue.js |
running |
pulled |
the worker offered its runner job and names it (job id, and how long it may wait unclaimed), so the receipt settles the run if the worker stops | runJobFor in apps/cli/src/io/test/pull.js |
pulled |
result |
the worker records the runner receipt; or, once the worker is gone, the receipt is read as the result and the lease released | endLostTestRuns in packages/drive/src/io/queue.js |
running |
lost |
the lease lapsed and the worker process is gone; lost step recorded and lease released | endLostTestRuns in packages/drive/src/io/queue.js |
result |
delivered |
next hands the finished run to its seat once | deliverTestRun in packages/drive/src/io/queue.js |
queued |
cancelled |
the seat cancels its run; the job ends and the worker group stops | cancelTestRun in packages/drive/src/io/queue.js |
lost |
delivered |
next hands the lost run to its seat once | deliverTestRun in packages/drive/src/io/queue.js |
- Id:
land:<items>:<key>. Created byofferLandingJobinpackages/api/src/io/landing.js. - Serves: the landing's accepted items at the trunk sha they were accepted against; the runner re-checks each and the board applies the receipt.
- States:
request,offered,claimed,receipt,runaway,done. Terminal:done. - Lease: LEASE_MS 120 s taken by the claiming runner and renewed by it; a lapsed lease is claimable again with no sweeper.
- Ends when its item moves on: held, at
offerLandingJobinpackages/api/src/io/landing.js: the runner re-checks each item before it pushes and the board checks the permit on every renewal - Harness:
apps/lib/tests/durable/land.test.js.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | request |
the offer carries a request, recorded before it is offered | offerJob in packages/api/src/io/jobs.js |
| (none) | offered |
the job is offered with the capabilities a runner needs | offerLandingJob in packages/api/src/io/landing.js |
offered |
claimed |
a runner with every capability takes the lease | claimJob in packages/api/src/io/jobs.js |
claimed |
claimed |
a lapsed lease is taken by another runner, as the next attempt | claimJob in packages/api/src/io/jobs.js |
claimed |
receipt |
the holding runner posts its receipt | postReceipt in packages/api/src/io/jobs.js |
receipt |
done |
the receipt is recorded and the lease released | postReceipt in packages/api/src/io/jobs.js |
claimed |
runaway |
the job has been claimed gate.jobMaxAttempts times without a receipt, so it ends and the coordinator hears once | endRunaway in packages/api/src/io/jobs.js |
runaway |
done |
the ended job is finished so no runner takes it again | endRunaway in packages/api/src/io/jobs.js |
- Id:
<gate job>:shard:<n>. Created byofferProofShardsinpackages/api/src/io/gate.js. - Serves: item submitted at the candidate, one slice of its proof files; the gate result applies when the last shard posts.
- States:
request,offered,claimed,receipt,runaway,done. Terminal:done. - Lease: LEASE_MS 120 s taken by the claiming runner and renewed by it; a lapsed lease is claimable again with no sweeper.
- Ends when its item moves on: n/a, at
offerProofShardsinpackages/api/src/io/gate.js: a shard serves its gate job; the gate result applies once and a moved item refuses it - Harness: NONE.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | request |
the offer carries a request, recorded before it is offered | offerJob in packages/api/src/io/jobs.js |
| (none) | offered |
the job is offered with the capabilities a runner needs | offerProofShards in packages/api/src/io/gate.js |
offered |
claimed |
a runner with every capability takes the lease | claimJob in packages/api/src/io/jobs.js |
claimed |
claimed |
a lapsed lease is taken by another runner, as the next attempt | claimJob in packages/api/src/io/jobs.js |
claimed |
receipt |
the holding runner posts its receipt | postReceipt in packages/api/src/io/jobs.js |
receipt |
done |
the receipt is recorded and the lease released | postReceipt in packages/api/src/io/jobs.js |
claimed |
runaway |
the job has been claimed gate.jobMaxAttempts times without a receipt, so it ends and the coordinator hears once | endRunaway in packages/api/src/io/jobs.js |
runaway |
done |
the ended job is finished so no runner takes it again | endRunaway in packages/api/src/io/jobs.js |
- Id:
test:<commit>:<tag>. Created byofferTestJobinapps/cli/src/io/test/pull.js. - Serves: no item that it ends: the seat waiting on pullboard test; the board records the receipt and applies nothing.
- States:
request,pending,offered,claimed,receipt,runaway,done. Terminal:done. - Lease: LEASE_MS 120 s taken by the claiming runner and renewed by it; a lapsed lease is claimable again with no sweeper.
- Ends when its item moves on: n/a, at
offerTestJobinapps/cli/src/io/test/pull.js: serves the pulling runner's work; no driver ends it on an item move - Harness:
apps/cli/tests/io/resident/board.test.js.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | request |
the offer carries a request, recorded before it is offered | offerJob in packages/api/src/io/jobs.js |
| (none) | pending |
the board writes the job with its whole request, unclaimable until its run row commits | intend in packages/store/src/io/board/runs.js |
pending |
offered |
the run row has committed, so the job is offered | confirm in packages/store/src/io/board/runs.js |
| (none) | offered |
the job is offered with the capabilities a runner needs | offerTestJob in apps/cli/src/io/test/pull.js |
offered |
claimed |
a runner with every capability takes the lease | claimJob in packages/api/src/io/jobs.js |
claimed |
claimed |
a lapsed lease is taken by another runner, as the next attempt | claimJob in packages/api/src/io/jobs.js |
claimed |
receipt |
the holding runner posts its receipt | postReceipt in packages/api/src/io/jobs.js |
receipt |
done |
the receipt is recorded and the lease released | postReceipt in packages/api/src/io/jobs.js |
claimed |
runaway |
the job has been claimed gate.jobMaxAttempts times without a receipt, so it ends and the coordinator hears once | endRunaway in packages/api/src/io/jobs.js |
runaway |
done |
the ended job is finished so no runner takes it again | endRunaway in packages/api/src/io/jobs.js |
- Id:
baseline:<item>:<request>. Created byofferCheckBaselineinpackages/api/src/io/baseline.js. - Serves: item whose frozen check is measured at main; the receipt is recorded on the item's pending baseline.
- States:
offered,claimed,receipt,runaway,done. Terminal:done. - Lease: LEASE_MS 120 s taken by the claiming runner and renewed by it; a lapsed lease is claimable again with no sweeper.
- Ends when its item moves on: n/a, at
applyCheckBaselineReceiptinpackages/api/src/io/baseline.js: a moved request refuses the result (stale); no driver ends the job on an item move - Harness:
packages/board/tests/from-store/check-baseline-worker.test.js.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | offered |
add or edit offers the check at main's captured commit, or returns the open job for that request | offerCheckBaseline in packages/api/src/io/baseline.js |
offered |
claimed |
a runner with every capability takes the lease | claimJob in packages/api/src/io/jobs.js |
claimed |
claimed |
a lapsed lease is taken by another runner, as the next attempt | claimJob in packages/api/src/io/jobs.js |
claimed |
receipt |
the holding runner posts its receipt | postReceipt in packages/api/src/io/jobs.js |
receipt |
done |
the receipt is recorded, applied to the item's baseline by applyCheckBaselineReceipt, and the lease released | applyCheckBaselineReceipt in packages/api/src/io/baseline.js |
claimed |
runaway |
the job has been claimed gate.jobMaxAttempts times without a receipt, so it ends and the coordinator hears once | endRunaway in packages/api/src/io/jobs.js |
runaway |
done |
the ended job is finished so no runner takes it again | endRunaway in packages/api/src/io/jobs.js |
- Id:
screen:<commit>:<digest>@<base>. Created byrunScreenJobinpackages/drive/src/io/screen.js. - Serves: a submitted sprint item at its commit on the current base: the merge, static checks on its changed files, and secrets and hook rules re-checked by trusted code.
- States:
produce.started,part.<name>,result. Terminal:result. - Lease: LEASE_MS 120 s renewed every 5 s until the screen settles, with no stall bound.
- Ends when its item moves on: n/a, at
runScreenJobinpackages/drive/src/io/screen.js: keyed by commit, digest and base, so a moved item or base names a new screen; items not frozen at sprint are never screened - Harness:
packages/drive/tests/io/screen.test.js.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | produce.started |
the first driver to screen a sprint item at this commit, digest and base takes the lease | produceUnderLease in packages/drive/src/io/keyed.js |
produce.started |
result |
the scratch-tree merge, static checks and trusted re-check returned one green or red receipt | produceUnderLease in packages/drive/src/io/keyed.js |
- Id:
pull-out:<item>:<landed commit, 12 hex>. Created byrunPullOutJobinpackages/landing/src/io/step/pull.js. - Serves: an item whose landing is pulling: the lander reverts its landed commit on main and records pulled.
- States:
queued,reverted,pushed,blocked,done. Terminal:blocked,done. - Lease: none: one runPullOutJob call reverts, pushes and records in turn; a rerun finds the item no longer pulling.
- Ends when its item moves on: held, at
runPullOutJobinpackages/landing/src/io/step/pull.js: created only while the item's landing is pulling, and recordPulled refuses NOT_PULLING, so a moved item is never pulled twice; only a sprint item reaches pulling - Harness:
packages/landing/tests/io/step/pull.test.js.
| From | To | Trigger | Where |
|---|---|---|---|
| (none) | queued |
the item's landing is pulling, so the lander creates its pull-out job at the landed commit and the fetched trunk | runPullOutJob in packages/landing/src/io/step/pull.js |
queued |
blocked |
the revert of the landed commit conflicts on the trunk tip; the step names the conflicted paths and the landing stays pulling | runPullOutJob in packages/landing/src/io/step/pull.js |
queued |
reverted |
revertLanded wrote the revert commit on the trunk tip | runPullOutJob in packages/landing/src/io/step/pull.js |
reverted |
pushed |
pushTrunkThroughFence pushed the revert to trunk under the item's hop epoch | runPullOutJob in packages/landing/src/io/step/pull.js |
pushed |
done |
recordPulled wrote the pulled event at the pushed revert, and the job finished | runPullOutJob in packages/landing/src/io/step/pull.js |
| Process | What it does | Where | Serves | Harness |
|---|---|---|---|---|
| test-run | pullboard test --compare-main runs files on runners under a gate-slot lease; its queued run is the test-run job | runTestFiles in packages/gate/src/io/test/run.js |
no item | packages/gate/tests/fixtures/pipeline/e2e.js |
| main-red refresh | refreshes main-red comparisons under a resource lease and a cache file; no job row | refreshMainRedComparisons in packages/landing/src/io/main/red.js |
no item | NONE |
| sentinels | board sentinels run under an activeRun deadline of timeout + 10 s; no job row | beginSentinelRun in packages/sentinels/src/io/main.js |
no item | NONE |
| seat heartbeat | a heartbeat row every 60 s; proves the seat alive and never selects or claims | heartbeatSeat in packages/store/src/io/presence.js |
the seat | apps/cli/tests/io/resume/heartbeat.test.js |
| claim heartbeat | re-claims or re-reserves at half the lease while a queued gate runs; stops with ITEM_LEASE_LOST when the item is no longer claimed or submitted by this seat at its digest and commit | createQueuedItemLease in packages/git/src/io/lease.js |
item claimed or submitted by this seat | apps/cli/journeys/submit/handoff/queued.test.js |
| landing lease | board_meta landing_lease, 120 s, renewed every 5 s by the lander | landingLeaseMove in packages/store/src/logic/board/landing/lease.js |
one lander per board | apps/lib/tests/landing/lease.test.js |
Branches run in this order. P runs once per command; B is plain next, --build and --wait; C is next --take (and plain next when a main-red repair routes there); D is next --verify; E is the idle end. Fresh says whether the hand-out is re-checked where it is printed: guarded means re-checked inside the write transaction that claims or reserves; advisory means nothing is written and the later claim or reserve is guarded; stale means it can name an item that is no longer in the state shown.
| # | Path | Inspects | Returns | Side effects | Hands out | Fresh | Where |
|---|---|---|---|---|---|---|---|
| P1 | all | lapsed leased gate jobs | nothing | DJ15 fallback: ends stale and idle legacy gate jobs, drives at most one by one transition within 1 s | nothing | n/a | fallbackReclaim in apps/cli/src/io/reclaim.js |
| P2 | builder | an undelivered red queued gate for this seat | red queued gate on #N; #N stays claimed by you until | records delivery | claimed |
stale (gap SM13) | queuedReds in packages/store/src/io/queued/red.js |
| B1 | builder --wait | an unread shout that asks this seat to act on #N | a shout asks you to act on #N | marks the inbox read | open, claimed, submitted |
stale (gap SM7) | takeWaitShouts in packages/activity/src/io/shouts.js |
| B2 | builder | an ownership wait in this lane | #N waits on your ownership of ... | none | nothing | fresh | nextWithProgress in apps/cli/src/io/commands/next.js |
| B3 | builder | open main-red items main already passes | nothing | withdraws them as coordinator | nothing | fresh | closePassingMainReds in packages/sandbox/src/io/take.js |
| B4 | builder | a routable main-red repair with no mandatory review | switches to the next --take path | none | nothing | fresh | mainRedBuildOffer in packages/sandbox/src/io/take.js |
| B6 | builder | a mandatory review (plain next) and no own claim | next to verify: #N; reserved for you until ... | reserves a review | submitted |
guarded | reserveWithin in packages/store/src/io/board/reserve/review.js |
| B7 | builder | this seat's own claim | you hold #N | parks it on unmet deps; opens the item folder; never renews the lease | claimed |
stale (gap SM6) | nextOnce in apps/cli/src/io/next.js |
| B8 | builder | a review worth offering beside a build | review offered: #N; build available: ... | none (advisory) | submitted, open |
advisory | sayReviewOffer in apps/cli/src/io/next/say.js |
| B9 | builder | nothing picked, another lane's pick, or a route mismatch | idle reason | next-idle event | nothing | n/a | otherLaneWork in packages/moves/src/io/selection.js |
| B10 | builder | a light item with no diagnosis and a light seat active | diagnose #N | none (advisory) | open |
advisory | nextPick in packages/moves/src/io/selection.js |
| B11 | builder --wait | the pick is still open | available #N; claim it when ready | does not claim | open |
advisory | nextOnce in apps/cli/src/io/next.js |
| B12 | builder | a live item folder for the pick | skipped #N | omits it and retries | nothing | n/a | liveFolderRefusal in apps/cli/src/io/item/folder.js |
| B13 | builder | the pick | claimed #N with criterion, check, brief and any returned red | claims in one write transaction | open, lapsed claim |
guarded | claimOrdered in apps/cli/src/io/claim.js |
| C1 | take | a mandatory review and no held build | next to verify: #N | reserves a review | submitted |
guarded | nextTake in packages/sandbox/src/io/take.js |
| C2 | take | main-red build routing | claimed #N, or an offer to another seat, or a release request | claims, wakes a routed seat, or releases ROUTED_ELSEWHERE | open |
guarded | nextTake in packages/sandbox/src/io/take.js |
| C3 | take | held claim, held review, any review, infra-stopped claim, then a build | you hold #N; next to verify; claimed #N | renews a held review; reserves; claims; a held claim is not renewed | claimed, submitted, open |
stale (gap SM6) | dispatchWork in packages/store/src/io/eligibility.js |
| D1 | reviewer | submitted heads that conflict with trunk | returned #N to its builder unreviewed | reopens, or shouts the live review holder once | nothing | guarded | returnUnmergeable in packages/verify/src/logic/next.js |
| D2 | reviewer | next --verify N | next to verify: #N | reserves that review | submitted |
guarded | nextReview in packages/verify/src/logic/next.js |
| D3 | reviewer | the best eligible review | next to verify: #N, reserved for you until ... | reserves after re-checking status, commit and digest | submitted |
guarded | reserveChosen in packages/store/src/io/board/reserve/next.js |
| E1 | all | nothing to do | plain next waits up to 90 s, then answers work (exit 0), board finished (exit 3) or IDLE_TIMEOUT (exit 4); next --no-wait answers at once; or NOTHING_FREE, REVIEW_NOT_READY, NEXT_TIMEOUT | next-idle event; the wait re-checks after 1, 2, 4, 8 and 16 s, then every 30 s, waking early on board and git file changes | nothing | n/a | refuseNextIdle in apps/cli/src/io/next/steps.js |
Every build claim and every review reservation is checked in one write transaction, so two seats never both win and no reviewer gets its own work. The stale branches only print: none of them writes a claim, but each can tell a seat to act on an item that has moved on.
| Case | Today | Intended | Harness |
|---|---|---|---|
| two seats claim the same item | the claim move runs in one write transaction; the second gets HELD and next retries | same | apps/lib/tests/claim.test.js |
| two reviewers reserve the same item | reserveChosen re-checks status, commit and digest inside the transaction; the second gets REVIEW_HELD and retries | same | packages/store/tests/io/board/reserve/next.test.js |
| a reviewer is offered its own work | notBuilder and the session skip list refuse it in the transaction (SELF_VERIFY) | same | apps/cli/journeys/verify/machine.test.js |
| dead seat holding a claim | the lease runs out; readers see open; the next write frees it with builder first refusal | same | apps/lib/tests/lapse/claim.test.js |
| heartbeat-only claim (seat alive, no work) | a live holder heartbeat vetoes expiry; idle maintenance releases it after health.stuck | a heartbeat proves the seat, never the work; an untouched claim frees after its idle window | apps/lib/tests/lapse/idle.test.js |
| dead reviewer | the review job lapses after 2 minutes and the item is offered again | same | packages/moves/tests/logic/moves/reserveNextReview/durable.test.js |
| red gate | the hand-off ends red; the builder keeps the claim with a renewed lease and next tells it once | same | apps/cli/tests/io/submit/red.test.js |
| red notice after the claim lapsed | next still says the item stays claimed by you until a past time | the notice reads the live lease and says the claim lapsed | packages/gate/tests/fixtures/pipeline/red-notice-after-the-claim-lapsed.js |
| a red from an older head shown at claim | returnedRecord shows the newest red or infrastructure gate without matching the current commit | only a red at the item's current commit is shown | packages/gate/tests/fixtures/pipeline/a-red-from-an-older-head-shown-at-claim.js |
| main moved while an item was in review | a clean move keeps the verdict; a real conflict reopens the item naming the file | same | apps/cli/journeys/land/merge.test.js |
| main moved after acceptance, before landing | the land job merges on the moved trunk and checks there; a red or a conflict leaves trunk where it was | same | apps/lib/tests/durable/land.test.js |
| gate driver lease lost | a refused renewal retakes the lease on the next tick | same, but only while its item still is in its serving state | NONE |
| gate driver killed | the gate is requeued on the same candidate within seconds, with no builder red | same | NONE |
| live driver mistaken for dead | a sweep never declares a live, same-incarnation driver dead for a lapsed lease alone | same | NONE |
| runner lost mid-shard | the idle probe stops the orphan worker; the gate requeues with attempt + 1; three infrastructure stops end it | same | apps/runner/tests/io/pipeline/worker.test.js |
| seat runs a stale CLI | a worktree runs the main checkout's current CLI | same | apps/cli/journeys/worktree/current.test.js |
| landing crash | killing the lander at any stage lets the next accept land both items without manual recovery | same | apps/cli/journeys/land/main.test.js |
| two landers | the board landing lease admits one; a stalled relay cannot block the holder's heartbeat | same | apps/lib/tests/landing/lease.test.js |
| a reject or reopen during landing | every landing step re-checks verified at the commit, so the item drops out of the batch | same, proven between select and merge | packages/gate/tests/fixtures/pipeline/a-reject-or-reopen-during-landing.js |
| withdrawal mid-gate | the hand-off record ends withdrawn and its ticket is dropped, but a running driver is not stopped and runs to its verdict | the driver ends at its next renewal tick | apps/cli/journeys/verify/machine.test.js |
| reopen or reject mid-gate | next skips a gate older than the reopen; the driver keeps running | the driver ends at its next renewal tick | packages/store/tests/io/board/next/gate.test.js |
| new head submitted while a gate runs | the old worker is signalled, its slot freed and the new head queued | same | apps/cli/journeys/submit/handoff/queued.test.js |
| lapsed gate job whose item moved on (zombie) | a fallback pass ends legacy kind gate rows | every job kind ends at once when its item leaves its serving state | apps/cli/tests/io/submit/handoff.test.js |
| review held on an item that was withdrawn or verified | the review job is not released; a heartbeating reviewer keeps extending it | a verdict, withdraw or reopen releases it in the same transaction | packages/gate/tests/fixtures/pipeline/review-held-on-an-item-that-was-withdraw.js |
| next resumes a claim that changed in the same moment | you hold #N prints from the read snapshot | re-read in the transaction that prints | packages/gate/tests/fixtures/pipeline/next-resumes-a-claim-that-changed-in-the.js |
| a shout names an item this seat cannot act on | next --wait returns a shout asks you to act on #N only for an item open in the seat's lane, claimed by it or reservable by it | same | packages/gate/tests/fixtures/pipeline/a-shout-names-an-item-this-seat-cannot-a.js |
| pullboard merged run twice | the same commit is a no-op naming the record; a different commit is refused MERGED_ALREADY and nothing is overwritten | same | packages/gate/tests/fixtures/pipeline/pullboard-merged-run-twice.js |
| board restored from an export with an undeclared status | the import refuses it UNDECLARED_STATE before it inserts any row | same | packages/gate/tests/fixtures/pipeline/board-restored-from-an-export-with-an-un.js |
| queued main-test job never driven | stays queued with no end | driven or ended within its lease | packages/gate/tests/fixtures/pipeline/queued-main-test-job-never-driven.js |
| landing run fails or its proof is not green | the job is lease-freed but never done; nothing lists it again | it ends failed and done | packages/gate/tests/fixtures/pipeline/landing-run-fails-or-its-proof-is-not-gr.js |
| machine sleeps past every lease | every lease lapses at once; the next command's fallback and the drain retake them | same, with no job driven for an item that moved on meanwhile | packages/gate/tests/fixtures/pipeline/machine-sleeps-past-every-lease.js |
| board write contention | a write holds the board lock under 1 s past slow commands, readers, gate workers and dead holders | same | packages/gate/tests/fixtures/pipeline/board/write.js |
| the P7 chaos test | SPEC P7 names test/durable-chaos-26.test.js as its gate; the file does not exist | the chaos test kills drivers at random and asserts each job finishes once | NONE |
Ordered by severity. Each is a brief the coordinator can file as it stands; a test marked (new) does not exist yet.
- SM2 (high): the fallback lists only kind gate. Files:
packages/drive/src/io/reclaim.js,apps/cli/src/io/reclaim.js. Test:apps/cli/tests/io/submit/handoff.test.js. Criterion: lapsedGateJobs lists kinds gate and gate-drive; a lapsed gate-drive job whose hand-off is ended, or whose item left its serving state, ends stale on the next next or status, never driven. - SM3 (high): a running hand-off resumes with no item check. Files:
packages/store/src/io/submit/handoff/retry.js. Test: NONE. Criterion: startSubmitHandoff on a running record checks the item is claimed by the record's seat at its digest, as it does for a queued one, and refuses SUBMIT_HANDOFF_CHANGED otherwise; the worker then ends the job. - SM4 (high): the fallback's serving predicate is wrong for pre-submit gates. Files:
apps/cli/src/io/reclaim.js. Test:apps/cli/tests/io/submit/handoff.test.js. Criterion: the active predicate takes the hand-off record: a queued or running gate serves claimed by its seat at its digest, and only a post-submit job serves submitted at its commit; a pre-submit gate for a claimed item is never ended stale. - SM5 (medium): review jobs outlive their item's review. Files:
packages/jobs/src/io/review.js,packages/store/src/io/board/review/lease.js,packages/store/src/io/board/verify.js. Test:packages/moves/tests/logic/moves/reserveNextReview/durable.test.js. Criterion: verify, withdraw and reopen release the item's review job (step released, done) in the same transaction; reclaimLapsedReviews never extends a lease whose item is not submitted. - SM6 (medium): next resumes a held claim from a snapshot. Files:
apps/cli/src/io/next.js,packages/store/src/io/eligibility.js. Test: test/next-held-claim-fresh.test.js (new). Criterion: next and next --take print you hold #N only after re-reading, in the board read that prints, that #N is claimed by this seat with a live lease; otherwise they fall through to selection. - SM7 (medium): next --wait shouts can hand out any item. Files:
packages/activity/src/io/shouts.js. Test: test/next-wait-shout-scope.test.js (new). Criterion: a shout ends next --wait with a shout asks you to act on #N only when #N is open in this seat's lane, claimed by this seat, or reservable by it; any other shout is printed and the wait continues. - SM8 (medium): landing jobs and freed gate drivers never reach done. Files:
packages/drive/src/io/landing.js,packages/land/src/io/sequence.js. Test: test/jobs-reach-done.test.js (new). Criterion: a failed landing run, a finish sequence stopped by LAND_PROOF_NOT_GREEN, and a gate driver freed by a signal each end with a failed or ended step and done, so no job row is left unowned and not done. - SM9 (medium): queued main-test jobs have no driver. Files:
packages/landing/src/io/main/red/receipt.js,packages/drive/src/io/main/red.js. Test: test/main-test-job-ends.test.js (new). Criterion: a main-test job queued by receiptComparison is driven to a receipt or ended within one drain pass after its lease would lapse. - SM10 (medium): pullboard merged runs twice. Files:
packages/store/src/io/board/merged.js. Test: test/merged-twice.test.js (new). Criterion: merged on an item that already has item_merged_commit refuses ALREADY_MERGED unless it names the same commit, which writes nothing. - SM12 (medium): machine acceptance skips the accept guards. Files:
packages/verify/src/io/machine.js. Test: test/machine-verification-guards.test.js (new). Criterion: acceptMachineSubmission passes the accept move's state and notBuilder checks, and refuses NOT_SUBMITTED for an item that left submitted. - SM13 (low): the red notice ignores a lapsed claim. Files:
packages/store/src/io/queued/red.js. Test: test/queued-red-notice-lease.test.js (new). Criterion: queuedReds reads the item through current(), and the notice says the claim lapsed when it did. - SM14 (low): a returned red is not tied to the current head. Files:
packages/store/src/io/board/next.js. Test: test/next-returned-red-head.test.js (new). Criterion: returnedRecord shows a red or infrastructure gate only when its commit and digest match the item's current head. - SM15 (low): board import accepts undeclared statuses. Files:
packages/store/src/io/exchange.js. Test: test/import-undeclared-status.test.js (new). Criterion: restoreDocument refuses UNDECLARED_STATE for any item_status not in STATES before it inserts. - SM16 (low): gate-verdict jobs never check their item. Files:
packages/gate/src/io/main/verdict.js. Test: test/gate-verdict-item-state.test.js (new). Criterion: finishAwaitingVerdicts ends a job whose item is no longer submitted at its candidate with a withdrawn step and writes no verdict. - SM17 (low): the P7 chaos gate is missing. Files: test/durable-chaos-26.test.js (new). Test: test/durable-chaos-26.test.js (new). Criterion: the chaos test SPEC P7 names exists: it kills drivers and runner channels at random points and asserts every job finishes exactly once.