@volter/supercode-teams
v0.3.396
Published
A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.
Readme
@volter/supercode-teams
Optional vault connections and credential profiles belong to the shared host SDK, independently of Teams. The vault guide covers connection and launch; Teams sign-in and machine grants do not confer vault access.
Harness Teams, the harness's part of Volter Teams, has a server and machines. A machine daemon, one per OS user, serves this machine's
doors: panes, launch, files, ports, attention, titles, a signed describe, and harness.v1.
The description's name uses the same normalized persisted enrollment name as mail
addresses, including when no connector is running. An unenrolled home uses the
normalized OS hostname; hostname retains the OS's full hostname separately.
A Teams server retains a shared session catalog, membership and access rules, and routes
callers to enrolled machines. It runs as a Node process (server/index.mjs) or as a Cloudflare
Worker with one Durable Object (worker/); both host the same server/core.mjs. Existing OpenTelemetry pipelines can publish
evidence without installing Volter Harness on each developer's machine. Start with the
Teams guide; the design is
Teams server, CLI and API.
The server and machine daemon use SQLite and require Node 22.13.0 or newer. Package exports: . (the daemon,
channel and client), /machine, /client, /admission, /fleet, /server,
/workspace-client, /workspace-cli, /connector, /connector/native-continuation and /contracts. The
workspace client is browser-safe and takes explicit credentials. Native capture and execution use
the matching harness SDK and native core; source capabilities and fidelity remain explicit.
Fresh-session materialization supports Claude Code and Codex with requested value_lossless;
telemetry alone does not establish resumable native history.
Context-scoped workspace API verbs resolve a native caller's retained agent
binding before choosing a login, including storage work and sender identity
observation. Resumed callers need no SUPERCODE_AGENT_ID launch variable for
that lookup. An unresolved native hint or an unavailable lookup
refuses custodian fallback when no agent identity is known. A known launch
identity may retain its own reader; the selected context still must match its
agent and Org. An authenticated positive plain-session result permits ordinary
context selection only when the daemon verifies that the local socket's calling
process is that exact native session. Unknown or mismatched callers refuse.
Windows session-context recovery inherits the daemon's accepted named-pipe handle
into a read-only helper and uses GetNamedPipeClientProcessId plus process ancestry
to identify a live Claude Code session. The kernel creation FILETIME must also
match the native registry's procStart exactly; missing or mismatched process
instances refuse. Channel retains its socket reader across helper spawning.
It never selects that session from an
environment hint. The helper builds from packaged C# source with the system .NET
Framework compiler; an unavailable compiler, pipe proof or ancestor refuses recovery.
Verified native Windows Codex recovery remains unavailable. This path does not
change pane or own-mail authority. See the caller decision.
The CLI also requires the
returned caller/native-session binding to match its request. A shared Codex
app-server with multiple open rollout families is an ambiguous caller and
refuses; environment input never selects one family. One complete family and
non-shared harnesses such as Claude retain the plain path. When the hosted
machine-ownership GET is unavailable, a
member-connected daemon can read the existing session identity and descriptor
through its verified custodian context, requiring the exact live native binding
and enrolled source on this machine. That context reads identity only; recovered
agents still receive their own delegated readers. A machine-only enrollment
cannot use this compatibility path. F116 investigation
records the hosted route refusal and a real plain-session recovery, with a
complete connector cut-over still unqualified. Ordinary commands outside a native
session retain normal context
selection. Local context, server and sign-in/account bootstrap verbs remain
separate. Source changes and an actual unbound-session refusal
do not qualify a successful delegated storage request or publication.
The node door's harness.v1.close.route reads a remote close route and the
verified caller at its local origin. harness.v1.sessions.close_remote accepts
that forwarded caller at the target's Teams door only, under pane control. It
retains native live-work checks, then calls the existing pane-close door to
recheck its grant, recorded starter and host entry. It adds no caller identity
or origin-attestation protocol. Native activity coverage on this path currently
includes Claude Code and Codex. Other recognized harness panes refuse without
foreign: true when their activity cannot be read; plain command panes are
handled separately. A nonstarter needs explicit
foreign: true for that one pane. These are node-door methods, not additions to
the native harness service. Scope and qualification.
A session can submit a command to a plain shell pane it started. The input gate
requires that exact starter in the launch journal, a current shell foreground,
no known native session in the pane, and a successful native activity reading
with no session beneath its root. The launch kind is read by its first word's
command name (zsh -f is zsh). It rechecks the host entry and starter after
that reading. A named harness or mail message IDs keep the mail refusal; this
exception does not admit a control attachment or a harness composer turn.
Windows local caller claims keep their existing refusal; a forwarded remote
starter uses the existing Teams caller contract.
Source scope and pending Windows qualification.
See the public client declarations, contracts, and implementation specification.
Close an owned Node server
createTeamsServer(...).close() shares one teardown promise with concurrent callers.
It waits for HTTP closure, admitted maintenance and the store worker's exit before
releasing the data-directory lock. The store replies after closing SQLite, closes
its own message port and exits naturally. New store requests refuse once close
starts; an unexpected worker exit rejects pending requests. A failed normal
teardown retains its store handle and ownership evidence.
This source change has static and archive checks. The Windows assertion retained on c41 remains unattributed. Current Windows normal shutdown, including concurrent callers and actual worker exit, is recorded in the cleanup evidence; startup and uncertain-cleanup failures remain unqualified.
Question door
panes.answer (also harness.v1.panes.answer; supercode teams answer <pane> <option>)
answers the question a pane shows at its bottom: choice is an option's number or its
label, and question (optional) is the question the caller read, so a different question is
never answered. The number is typed as raw keys at once, never behind the pane's retained
input. Enter follows only when the same question still shows with its marker on that option.
The reply says answered when the screen no longer shows that question. It requires pane
control, and is held to the pane input rule: a caller on this machine answers a pane it did
not start only with foreign (--foreign). That includes a person's terminal and any caller
whose identity is not established, every local caller on Windows; it is logged as unidentified.
This machine's board answers any pane, and so does another machine's caller holding control on
the pane. Each answer is logged with who answered and whom for (answerer). The machine record publishes such a
pane's session as needs_input with evidence.question, which a board puts on the card;
supercode workflow answer <card> <option> answers it from there (ADR 0064).
Native retry door
panes.retry (also harness.v1.panes.retry) accepts pane, its observed
expected_pid, stable message_ids, and the same caller/foreign attribution as
the pane input door. It requires pane control. status_only: true reads a prior
request's retained native receipt without submitting input, including after a
daemon restart. Unknown IDs are answered with known: false.
A new retry submits only continue, only for a current recoverable Claude Code or
Codex failure with an empty composer. The delivery queue repeats those checks
before pasting; a changed turn or human draft refuses that retry. Suspended panes
are skipped. queued: true means pending native acceptance, not success. This
door makes one requested act; the orchestrator recovery command
owns timing and retry policy.
Board Codex launches carrying SUPERCODE_BOARD_PROCESS_GUARD=1 read the selected
native executable's authentication status before creating a pane. The read uses
the requested configuration, working directory and daemon environment; that same
environment is pinned for the pane, including any explicit CODEX_HOME override.
A provider requiring an absent account fails the launch with its authentication
home. Custom providers use their native OpenAI-auth requirement. Unreadable or
unsupported native status also fails, with its own reason. The reader requests
no token and starts no login. It requires native explicit gateway-auth support
and refuses a gateway requiring sign-in. Recorded reads and remaining launch
qualification.
The machine daemon
Machine records in this checkout also retain bounded process observations
(fleet, operator plus whole-machine view on a peer) and CRIT observations
(health_events, whole-machine view). Each sequence keeps up to 2048 events
within 4 MiB and names its retained floor. Observation never grants execution,
caller identity or a mailbox sender. The board owner's
role listeners consume those
records through their existing admission; Teams does not run role policy.
The process producer requires the new native harness.v1.sessions.processes
door. Source and package presence are separate from publication and runtime
qualification; see the dated record.
supercode teams machine start runs it with its local door only; supercode teams connect runs
the same daemon enrolled to the selected Teams context, adding catalog sync and the server link.
The daemon owns one supercode harness serve and the tmux terminal host.
Hosted-pane process traces resolve interpreter package names in a disposable child with a two-second deadline. A package manifest on an unavailable volume cannot hold the daemon's event loop or filesystem worker pool; when that lookup cannot finish, the trace names the script's basename instead of claiming a package owner.
Mail identifies its writer separately from the credential that carried it.
Linked session/operator/agent addresses are claimed writer identities;
credential-principal and credential-name name the Teams-authenticated
carrier. A custodian's person name is never substituted for that session or
operator. Stored older link records receive the same display normalization
without rewriting their evidence. Native agent ownership is not inferred from
the carrier. Writer/carrier source scope
retains D200's return-address boundary and leaves runtime qualification open.
Native open coordinates Claude Code and Codex resumes with a stable session
key and separate launch records for each incarnation. A retained shell or ended
pane stays with its owner; resuming opens a new pane in the session's recorded
directory. An unconfirmed writer refuses another resume. Remote opens execute
the destination's own CLI as the verified caller and retain its detached pane
answer in that helper's launch receipt. Both the native CLI and the Teams daemon
must support this contract; older versions refuse before opening the target.
Source scope and qualification
separate this implementation from unperformed native and fleet qualification.
It alone opens <supercode home>/mail.sqlite in WAL mode. A separate SQLite writer lease lasts until shutdown.
Clients and native pane wrappers ask its socket for mail and launch bindings. Record mail summaries contain at most
20 unread and 20 recent headers per mailbox within 32 KiB, alongside exact count and unread_count totals.
Truncated windows say partial; inbox, thread and show on the owning machine still read the held messages.
Ended session mailboxes without unread mail or import failures are omitted. Held records and individual changed
rows can exceed 8 MiB: the local board stream assembles bounded JSON parts atomically, and peer records and node
RPC replies split their existing JSON lines. See the record transport decision.
At the first start, it imports the
legacy Maildir from a private snapshot and removes only successfully imported, byte-verified sources; unknown or
unreadable files remain diagnostics. The writer lease is acquired before publishing the local socket.
Import and index setup then run with the channel hello available. Every product stream is refused
with this machine daemon is preparing its index and mail; retry once startup completes
until initialization finishes. This reports preparation without opening a partially imported store
to clients. Mail and launch readiness still requires complete import and retirement.
Startup retention and delivery schedule rebuilding read at most 128 rows per page and yield
after each committed page. Delivery workers start after the whole derived schedule is ready.
Interrupted imports queue directory cursors after the entries' imported rows. A row can commit first,
so a restart may revisit a committed entry idempotently. JSONL acceptance and its byte offset commit
together. A changed directory refuses; recorded input errors reopen their directories for
repair. Import statistics include the last committed directory cursor. Product readiness still waits for import
and retirement, with no fixed completion deadline. Source scope and pending full-home measurement
distinguish this checkpoint correction from an availability qualification.
Ordinary retirement byte verification also checkpoints checked file stamps and
its cursor together. Restart rechecks the bound prefix before hashing its
suffix, and archive activation rechecks it again. Local statistics expose
retirement_verification; completion there describes verification alone,
not mail readiness or a measured startup duration.
On macOS/Linux the legacy-wrapper guard distinguishes recycled PIDs by stable process/binding observations.
A completed installed legacy Codex wrapper can stay running: its binding is imported and the old Maildir path
is removed. Its later best-effort stderr appends can fail; no compatibility alias is installed. An unfinished or unreadable wrapper refuses;
Windows keeps its conservative alive-owner refusal. Ordinary reads never reopen the retired folder.
Before the first SQLite start, supercode teams mail migration-check --home /absolute/supercode-home/teams --json
reads that guard locally without a daemon connection or migration. Admission is not proof that the import will finish.
Seed reads and stamp rechecks admit at most four concurrent operations and settle the whole batch before refusal.
The six-second budget remains: an exhausted read answers admitted:false, observation_complete:false,
read_error.code:legacy_wrapper_admission_budget and work with its phase, elapsed phase times and completed seed counts/bytes.
Partial observations grant no admission or process authority; filesystem calls are not preempted by the budget.
The source boundary and pending qualification
name the trusted legacy ABI, loss of later legacy diagnostics and existing retirement recovery.
Mail bodies are kept like their headers. At most 200,000 read messages are kept, the oldest removed with their bodies,
and never a mailbox's newest 1,000; a read header whose body is not kept shows an explicit placeholder; carrier/terminal
event log tables keep 10,000 rows each. The pages removals free go back to the disk (incremental auto_vacuum; an older
store is replaced by a compacted copy, mail/compaction.mjs). Read the
dated qualification scope before inferring platform support.
Mail with no recorded live recipient-session door keeps its original address and a durable five-minute retry without counting the wait as a delivery failure. Permanent native refusals and retained expiries are visible in message inspection; later native confirmation preserves the historical failure while clearing its current status. See the session-wait contract and original expiry investigation. These are source changes; native resume/restart and release qualification remain open.
Native mail-history reads process the opened file's initial extent in 64 KiB blocks, holding one unfinished record instead of the whole transcript and line array. Returned mail history and individual records can still be large. The allocation evidence names the source boundary and the remaining runtime qualification.
The connector sends each session as its log (ADR 0070; connector/log-sync.mjs). A native log (Claude Code, Codex,
Pi and OpenClaw, under a rule that keeps all history with native capture on) is the file's own bytes from the length
the server holds, whole records, one PUT a part (1 MiB, or one record alone up to 16 MiB). Each record is masked at
its own length on a redaction worker thread (connector/redactor.mjs); one that cannot be masked at its own length is
sent withheld. A log the server holds to its file's last complete record is tailed: each change the
machine's session index reports, and each write to its file (watched itself while written in the last ten minutes),
sends its new records at once on a second redaction worker, with no open, no harness load and no queue. Any other
session is a decoded log: each complete message once, as JSONL of the wire message (again, under its own id, when it
changes). A session's pass (the open with
its descriptor: title, repository, mail and background agents; its bundle files by hash; a decoded session's
messages; a native log not yet caught up, 32 parts a pass) runs one at a time in the connector's serial queue, at
most every five seconds a session unless a reader watches it. supercode teams status says that custody
registration does not purge data already sent; a Teams administrator purges session text through
POST /api/v1/teams/:team/sessions/purge.
Complete turn labels and notes stay in per-session files, with the same cache budget as origins.
Retained origins are read on demand. Their LRU cache keeps at most 32 records and 4 MiB of serialized UTF-8 data; records over 1 MiB stay on disk without caching. Assignments persist before caching, and rule pruning walks files one at a time. These budgets exclude parsed-graph overhead, individual record I/O and origins held by active callers. Origin-cache source scope leaves write-through timing, restart and real memory qualification open.
Profile histories, last observed digests, pending bodies and refusal waits stay in complete per-session files with a separate cache using the same budgets. Publication selects at most 100 headers while visiting files individually, preserving stable queue order, held-observation pruning and refusal waits. Migration keeps the old aggregate authoritative until every file and the new header are durable; legacy folding refuses this format. Profile persistence scope leaves active records, scan/write timing and runtime memory qualification open.
Native effect intents and results stay in complete individual files, including reported results. Records and durable intent markers have separate caches using the same budgets (64 records / 8 MiB serialized data combined). Missing marker/record pairs refuse rather than making an attempted action new. Migration retains the aggregate until all pairs and the versioned header are durable; legacy folding refuses. Effect persistence scope leaves actual no-replay/persistence, scan/write timing and memory qualification open.
Agent launch bindings use complete per-session files and a separate cache with those same budgets. Presence checks avoid assignment copies; binding edits copy eligible pending records, and a returned reader context persists before the declaration request. The daemon's launch-intent callback uses that store. Existing retry/refusal and seven-day settled-record expiry remain. Migration retains the aggregate until records/version header are durable; old folding refuses. Binding-store source scope leaves actual reader/identity/persistence, scan/write timing and memory qualification open.
supercode teams rpc mail.statistics reads local storage counts and import/retention receipts. It is refused remotely
and through the app door. Writer groups count stored envelope copies, not call attempts or quotas; database page
counts exclude physical WAL size. Successful imports record their actual source reads, bytes, batch sizes and time.
Connector discovery normally follows this OS user's default native stores and
each declared worker home. For a fresh connector home, teams connect
--worker-homes-only --worker-home /absolute/worker-home --harness codex --cwd
/project --foreground follows only declared worker stores; Claude Code is
also supported. The scope is retained on reconnect and appears in teams
status and teams roots --json. Missing homes are reported without default
store fallback. SDK embeddings use includeMachineHomes: false with fresh
state and an index/activity reader supplied as daemon. Both index and activity
subscriptions then carry the declared native homes; withdrawing a feed waits
for confirmed activity cleanup. Failed cleanup keeps its handle and reports
that withdrawal or stop is incomplete; embeddings still close their owned
native SDK client. This limits capture discovery, while the full machine
daemon's live-identity readers and explicit native effects retain their own
behavior. See the scope and qualification
limits.
harness.v1.panes.presence (also panes.presence) takes { pane: "p_…" }
and returns { pane, present }. The caller needs observation of that exact
pane, whole-machine view, or operator authority. This read uses the host's
complete context observation, rather than absence from the grant-filtered
pane list, and includes pending launches. An unread host or older terminal
package/pane server refuses; it supplies no absence verdict. For a caller
that is a session or a board and a pane that is present it also returns
yours: whether that caller's close would be admitted as the starter's, with
nothing closed. launch names the key the caller launched the pane under: a
board on another machine is the starter of a journal row with that key and no
recorded starter (a launch a daemon before 0.5.314 recorded). The dispatcher
uses this read to reconcile a final close refusal: a pane read absent settles
it, and a pane read yours is closed again.
Two doors reach it:
The operator-only harness.v1.agents.session node door also recovers server
ownership for hand-started/adopted sessions missing a local launch binding.
The connected machine reads only its own uniquely captured native origin and
requires unended ownership of an active agent. Recovered bindings retain the
canonical ownership revision and are rechecked before their reader is reused
or renewed. Harness Teams remote context selection asks this door even without
launch agent variables. Unknown/changed ownership refuses; recovery creates no
machine grant and commands use the agent context. The
source record
names the required server/daemon pairing and pending actual qualification.
- Local: an owner-only Unix socket,
$SUPERCODE_HOME/teams/machine.sock(or, when that path is too long for a socket address, a per-user 0700 directory under/tmp, which a temporary-file sweep may remove: the daemon binds a removed path again within seconds, unless another daemon took it meanwhile. Daemon and callers alike refuse that directory unless it is a real directory, not a symlink, owned by this user with mode 0700). On Windows it is a named pipe,\\.\pipe\supercode-<hash>, which by default only its owner may open. Whoever can open it is this OS user, an operator. The local CLI, the agent inside the machine and a service on the same box (RH2's connector) use it. - Remote: the Teams server. The daemon holds one outbound WebSocket link; the server forwards a caller's channel over it after checking the caller's machine grants, and the daemon re-derives that admission from its own synced copy of the grants before every door.
supercode teams files get <path> --machine <name> --out <local-file> copies a
regular file in 4 MiB ranges with bounded memory. If the channel closes, it opens
a new one and continues at the next unwritten byte, with at most three reconnects
per range. It checks the remote size and modification time after reconnecting and
at completion; a changed file, premature EOF, invalid range or exhausted reconnect
budget fails the copy. --out stages beside the destination and replaces it only
after the whole copy succeeds, removing the staged file on failure. Without
--out, bytes stream to stdout; a failure leaves the already emitted prefix and
returns a nonzero exit code. Reconnection diagnostics go to stderr.
--timeout-ms N shares one deadline across all ranges and reconnections;
--trace retains the machine-door progress receipts. The
download decision describes the consistency boundary.
The machine's custodian holds it as operator. Anyone else holds a machine grant:
operate (the whole machine: harness.v1 and launch), or view, observe, interact,
control, files, ports on named targets (pane:<key>, runtime:<id>, root:/path,
port:<pane>/<n>), or on every target of one kind (pane:*, port:*). * carries only
operate and view: a grant that reaches more names the kind it reaches, so it never covers
a kind another product serves on the same machine. title.set needs control on its target.
observe on a root:/path reads it (stat, list, read, search); files also changes it.
A workplace can open one pane or one folder for someone who is not a member of the team. A
server trusts only admin-consented app installations with
delegation.surfaces or delegation.sessions for that team. Register the exact issuer origin
on the app; install the needed module separately. Operator issuer allowlists grant no access.
Keys are cached separately per origin, and each token must match a
publication or session binding for that exact issuer. Staging never opens a production
binding or publication. Tokens use Ed25519 (keys at ORIGIN/.well-known/jwks.json, audience this server's
public origin), each naming a pane (pane:<key>) or a folder (root:/path) on one machine of one
team, and view or control. A token opens only a surface the machine's custodian published on
this server (the machine's publications, /machines/{id}/publications): the same team, machine and
exact target, published to that workplace and to the Room the token names, by the machine's current
custodian while still an active member of the team. A token naming no Room, or one for
anything else, for a wildcard (pane:*) or for the whole filesystem (root:/) opens nothing, and a
token must carry iat and live at most 15 minutes (exp - iat and exp - now). The hosted viewer
at /view#token=… opens it; the server turns the token into a machine grant on exactly that target
(a pane: observe, and control to type; a folder: observe to read, files to change) that
expires with the token, and closes the channel then. Before it writes that grant, and while the
channel is open every 15 seconds, the server asks the workplace whether the token still admits what it was issued for
(POST <issuer>/api/v3/delegated/status); when the workplace answers that it does not (the member's
binding revoked, their Task closed, their contract ended), the grant is deleted and the channel closes
with access_revoked, which the viewer shows rather than reconnecting; an open with such a token is
refused (403 access_revoked) and writes no grant. An unreachable workplace leaves the channel to
the token's expiry. A page embedding the viewer sends it a fresh
token by postMessage({ type: 'delegated-token', token }), which the viewer asks for with
delegated-token-needed.
teams publish records the surface on this server (only the machine's custodian can), then puts
the pane or folder of the connected machine (or --machine NAME) into a workplace Room as a
Surface, through the workplace's own door with a session token of yours; if the workplace refuses,
the record is withdrawn. The workplace is sent the surface's reference ({ machine, target, team }) and the Machine
it belongs to (machineRef, <team>/<machine>), never this server's address (RH2 ADR 0050 decision 4). It serves the
surface through the registration that publishes that Machine, else, when none does yet (just after teams connect) or
the Machines → RH2 resources registration publishes it as <team>/<machine>#source=<namespace> (a source namespace), through the one
installation in the Room's or your organization with a viewer; the Machines page lists the surface under its Machine
only when the two references agree. teams unpublish SURFACE (the surface key or the publication id)
deletes this server's record first, on whichever of your machines holds it, which deletes the
grants minted on it and closes their channels at once, then stops it in the workplace by its key. It fails
when this server holds no such record, unless --workplace-only; --record-only deletes the
record here without a workplace call or token. Removing a member likewise ends every delegated
grant on the surfaces they published. A surface published before this server kept records opens nothing until its custodian
records it with teams publish … --record-only (no workplace call, no workplace token):
supercode teams publish pane <ctx> --room room_… --workplace https://pilot.runhuman.com --organization acme --token-stdin
supercode teams publish root ./reports --room room_… --workplace https://pilot.runhuman.com --organization acme --token-stdinsupercode teams machine start # local door only
supercode open --new bash --detach # a pane; prints its contextKey
supercode open <ctx> # attach; ctrl-] detaches
supercode teams input <ctx> "make test"
supercode teams input <ctx> --key Escape # keys by tmux name: C-c, "Down Enter", …
supercode teams title set <ctx> "rate-limit rescue" # also names the owned tmux window
supercode teams suspend <ctx> # remote input refused; its processes keep running; observe keeps streaming
supercode teams resume <ctx> --input "carry on" # the input that hands the pane back
supercode teams log verify # the hash chain across every rotation
supercode teams panes servers # existing Windows servers; starts none, unknown facts stay null
supercode teams panes requests # the daemon's unanswered pane-server requests: op, target, age
supercode teams panes retire-server PIPE OBSERVED_PID # only an empty compatible server; never ends panes
supercode teams machines access grant laptop --to user:usr_… --caps operate --ttl 1h
supercode teams machines access grant laptop --to agent:agent_… # operate, until revoked
supercode open <ctx> --on laptop # through the selected context's server
supercode discover --fleet # every reachable machine of the context
supercode open --new claude --on laptop # a pane on an enrolled machineFleet discovery bounds the server's machine-list read and each machine's
complete discovery read at 15 seconds. A machine's deadline covers connection,
hello, SDK startup and its first answer; a whole-index read (--limit 0) then
reads the rest of its index in cursor pages of 2,048, each under its own
deadline, and again the sessions updated since the read began. Expiry cancels
its transport and names it in unreachable, while other machines' results
remain available. Each machine's unread sources and still-reading harnesses are
carried into the answer's failed and reconciling. A timed-out
machine list fails explicitly because its targets are unknown. The SDK's
fleetDiscover({ timeoutMs }) can select a shorter positive deadline. See
recorded candidate reads
for the observed results and limits.
Pane viewers stay with their pane for as long as it runs. A closed view
attaches again unless the close says the pane ended (pane exited, tmux client
exited, or the pane-gone words) or is about the viewer's own access (terminal
access ended): a lost daemon connection, a machine generation handover or end,
a view dropped for falling behind and a failed attachment all attach again. An
attempt refused because the daemon is away (a lost transport, a door or stream
open that times out, a daemon stopping or starting) or at its capacity (a full
pane server queue or pane host grant table) is tried again, waiting 1 s and
doubling to 30 s; the wait starts at 1 s again once a view has served for 30 s.
Each attempt still asks the daemon to admit the same pane and mode.
The pane ending, including the daemon answering that the pane is gone, ends the
viewer with status 0, so the terminal closes its window: Windows Terminal keeps
open a tab whose command exits non-zero. A grant, ownership or protocol refusal
ends the viewer with status 1 and its reason on screen; failed attempts close their channels. Main’s control input during recovery is held up to 64 KiB and sent after the new
attachment’s first screen; additional input at that bound is refused visibly.
Ctrl-] detaches. The
source and package reading
does not qualify a live Windows restart on these candidate bytes.
Remote read deadlines
teams health status, teams panes ls, teams jobs, teams launches list and
remote teams log verify share a 6000 ms caller budget, including front-door startup,
caller identity, machine-name lookup, connection, node-stream admission and reply.
Inspection imports only the modules it needs, and releases its completed channel
without waiting for a peer's WebSocket close handshake. --timeout-ms 7000 selects a caller
budget; --trace writes hop receipts as JSON lines on stderr. A timeout names the
last confirmed hop and phase, and closes its transport. An older server or daemon
can supply less detail. A timeout is an unanswered read, not evidence of absence.
See ADR 0071.
Machine session index
teams rpc harness.v1.sessions.index.diagnostics '{"query":{}}' also keeps the last 16 completed discovery
receipts and up to 16 active receipts, with the full active count. They name index
selection, metadata projection, preview reads, live projection and activity enrichment,
with selected/returned row counts and request-local preview I/O counters. Query text and
transcript contents are excluded. The counters exclude the metadata owner's watch and
rename work; its existing aggregate counters remain separate. Discoveries over a second
also write their longest stage and receipt to the slow log. Ordinary preview pages read
at most four rows concurrently, preserving page order and each file's identity checks.
The TypeScript daemon owns session metadata in its mail database, under the same
exclusive writer lease. Public discover, harness serve and the Harness SDK's
discovery/index doors ask this owner. session-index.capabilities is the local
preflight; older daemons are refused before issuing a moved request.
@volter/supercode-teams/session-index-client exports the preflighted socket
client and caller-home normalization. Node 22.15 or newer with zstd support is
required for archived Codex metadata.
Sources are keyed by harness, physical root and profile/registry selection.
Watches precede listings and share owned physical coverage. Native directory
watches bind only selected session trees, including exact symlink targets;
macOS/Windows use recursive streams and Linux uses inotify directory watches.
Root lifecycle entries, missing-path ancestors, ledger/database files and registry
membership use 15-second reads unless an owned watch already covers them.
The daemon's live registries, settings and machine-record entries share that
observer with a one-second period. Registry-list and tmux-absence caches validate
identity before every use and need no native watch. Diagnostics expose
watch_directories for all observation owners in the daemon, with physical path,
native/read mode, recursion and targets; native_watches names every registration
through the daemon's watch thread with its acknowledged file/directory kind (null
while binding). Direct transcript file watches remain native.
Hourly reconciliation repairs missed events. The scale decision
names the native-watch failure paths and measured platform scope.
Metadata changes and verified file offsets commit together with cursor-addressed
row changes; unchanged warm files contribute no transcript reads. A refused
source retains its prior rows and reports the path, error and retry deadline.
Returned rows alone receive bounded previews, except an explicit preview search
which must inspect eligible candidates before counting/pagination. Only a Claude
name miss activates late rename reads; subsequent appends update that cache.
OpenCode/Goose compare native session-column marks. A message rewrite that changes no native mark remains unobservable until a later mark change or reconciliation; the owner never writes into their stores. Hermes has no equivalent sequence and requires a complete read after DB/WAL changes. Orchestrator bindings use their native change cursor. Selected homes and workspace filters remain query-scoped; metadata and display names never prove a calling session or authorize a mutation.
Windows with the same filters share one retained, ordered metadata projection. An ordinary part update reprojects its affected lineage components; pagination copies the requested window, without copying the whole inventory per change. Diagnostics include projection rebuild, part-update and metadata-row counters.
Invalidations coalesce while a window refresh waits behind another operation. Completed reconciliation retains a healthy incremental projection; recovery rebuilds one whose update failed. Preview refresh compares each returned row's committed compound source fingerprints and relevant Codex topic. Unchanged content keeps its previews while live display is refreshed; failed previews remain eligible for retry. Live display uses indexed session/receipt and scoped registry lookups for the current rows, preserving existing candidate precedence. Unchanged registry JSON can reuse an in-process parsed result after opening and verifying its file; process liveness and birth are still checked. The raw cache retains at most 512 entries and 1 MiB of verified source bytes, with 64 KiB per entry. Larger or evicted records are read normally. Diagnostics count retained source bytes and entries; these are not JavaScript heap measurements. The source and package record separates compilation from runtime and scale qualification.
Each index stream owns its windows (up to 2048 rows, or explicit limit: 0 for
all rows). Revisions describe current-window changes; change_cursor addresses
the durable metadata stream. Resize prepares its full result before changing the
window. Unsubscribe, EOF, a failed stream or lost operator grant releases it.
The daemon serves these windows independently of the retained native runtime
and session-service child. Discovery's separate activity reading still uses that
service until its step-5 port; an unavailable reading returns activity_error.
This describes the port branch's source contract. Windows and runtime qualification are pending and must be recorded separately from source review.
The caller-owned session-read-client admits 64 pending replies (ordinary
requests stop at 48, reserving 16 slots for unfollow), 64 opening/retained
followers, and one Mi UTF-16 units of serialized parameters plus string id
per request. Exported SESSION_READ_CAPACITY/-32051 refuses further work
before it is posted. Unconfirmed follower cleanup and worker termination
retain their exact owners without replacement. These are owner/text budgets,
not a total-memory ceiling. The source record
states the unqualified runtime paths.
Its runtime-state polling streams registry entries, admits each regular
receipt at one MiB and retains only validated fields in one candidate per
followed source. Older candidates are rescanned after a refused probe;
unconfirmed file/directory cleanup blocks successor reads with the exact owner
retained. The registry source record
states source-only ordering, fallback and qualification limits.
The ./sdk-session-read subpath supplies the caller-owned discover, load
and export binding used by MCP. Discovery queries the existing machine index;
load and export call the lossless session owners with the caller's environment,
working directory and cancellation signal. It preserves typed SDK error fields
and closes its index connection after the request. This binding is source-only
until the port's final recordings; it adds no runtime-control authority.
The ./harness-runtime-session subpath composes the caller-owned runtime
service with the actual local receipt store, the selected environment/cwd and
the caller's pinned Node CLI. Resumed history first checks the Claude transcript
filename, then queries the existing incremental index and loads its bounded
semantic display through the shared reader. The service samples live runtime
events every ten milliseconds, independently of session-file polling. Its
request replies retain exact numeric IDs and the existing typed SDK error
fields. Closing it cancels admissions, surrenders owned connections and drains
their listeners/transports. The npm stdio front door uses this composition;
the machine daemon's remaining native service lane is still separate. Conversation
lifecycle methods use the same session: live new/reset borrows its connection,
and other mutations keep the existing harness/store door followed by indexed
or API readback. Detached mutation calls keep the 120-second bound and tracked
late cleanup. Session reduction uses the same caller binding and the existing
source/projection/store owners, with a receipt only after durable reload and
inversion. The optional reduction-store override belongs to the embedding
caller, not to request parameters. This is
source-only until the port's final recorded operations; no provider, receipt
or credential operation ran while coding.
Products served behind the daemon
Another product serves its own kind of target on the machine (Volter Browsers:
browser-profile:<name>) through the daemon's product stream, opened with
{ target: '<kind>:<name>', ...params }. The product calls serveProduct from products.mjs,
which listens on loopback and writes a receipt, products/<name>.json, naming the kinds it
serves, its endpoint and a token. The daemon admits the caller first. Then it dials the newest
live receipt's endpoint and tells the product the principal, the capabilities held on that
target and the caller's params. Each side first proves it holds the receipt's token, the
product before it hears anything, and the token never crosses the wire. The daemon then
relays text messages both ways, each under the channel's frame limit. The product enforces what each
capability admits on its kind. A grant on * reaches a product's target only for view.
A remote caller is re-admitted every 15 s and when a grant it holds expires. The daemon decides from the grants it holds, then refreshes them from the server, at most once per interval. Wider capabilities are passed on; narrower ones close the stream. The server closes a member's channels when their membership is deactivated, or when a group they reached a machine through loses them or is deleted.
supercode teams browser <profile> --machine <name> serves a machine's browser profile as a
local CDP endpoint: chromium.connectOverCDP('<printed address>') drives it, each connection
riding its own product stream. The machine's own CDP address and Volter Browsers' publication token
never leave it. The endpoint answers any local process that reaches it, like a browser's own
debugging port.
A target whose kind has no live receipt is refused as not served on this machine. The
harness's own kinds (pane, runtime, root, port) are never served by a product.
The app door: web apps on this machine
A web app on this machine (Supercode's chat app, for one) reaches the machine with no sign-in through
the daemon's app door, which is off until the person turns it on. It is core supercode, not a Teams
feature: it needs no Teams server, login or enrollment, only this machine's daemon. The daemon
ships in this package for now, so supercode app-door uses it, as supercode health does.
supercode app-door on --origin http://127.0.0.1:6025 # the app's own origin; more with commas
supercode app-door link http://127.0.0.1:6025/ --open # open the app paired with the door
supercode app-door status # { enabled, door, origins, listening, failure?, file }
supercode app-door rotate # a new token: every earlier link stops working
supercode app-door offWhen the door is on, the daemon listens on ws://127.0.0.1:7389/channel (--port changes the port) and relays a
WebSocket there to its own local socket, as the Volter Desktop's door and a Teams server relay theirs:
the same machine channel (supercode-machine-channel.v1), with every door this OS user's local
socket serves. In the browser, openBrowserLocalMachine opens it and browserHarnessTransport
carries harness.v1 over it (@volter/teams/browser-channel). An opening is admitted only from a
named origin (a browser names the page's origin, and no page can forge it) and with the door's
token as a bearer. subprotocol. The token is kept in app-door.json, which only its owner can
read. app-door link hands it to the app in the URL fragment, which no request carries, so another
local user who can reach the port still cannot get in. The link does pass through the command that
opens the browser (--open), where on Linux another user may read a process's arguments; print the
link and open it yourself there, and rotate when a link may have leaked. The app should drop the
fragment from its address once it has kept the pairing. Each opening goes in the account log, and
refusals at most once a minute for the whole door, since any page can knock. Turning the door off, rotating
its token or removing an origin closes the channels already admitted; a door left with no origin is
off. While its port is taken the daemon retries every ten seconds, and status shows why it is not
listening (app-door.state.json).
Native mail receipts
Claude's SendMessage success acknowledges its peer transport. Native sends say
that transcript acceptance is unconfirmed and may wait behind a modal screen;
they do not promise a turn or the next tool call. Direct sessions.message
receipts use delivery.how: accepted and native_acceptance_confirmed: false.
Transport handoff and a native model receipt remain separate facts. An agent's mail to its own session
(agent message) answers delivered: true, or queued: true for a handoff the harness accepted, as a Room notice does.
The daemon retains qualified native acknowledgement UUIDs against the exact
mail ID, recipient socket and original sender. A matching native queue-full
notice records delivery.state: dropped in JSON and rendered mailbox reads.
A recorded local sender receives one retained failure notice. Linked return
addresses do not authorize that automatic wake. Unknown notices stay retained;
neither the pool's last sender nor a socket's current occupant substitutes for
an absent acknowledgement. Nothing is automatically resent. A positive native
transcript receipt takes precedence over a drop of the peer copy.
This is candidate source. Original native records and qualification limits cover a historical drop notice and current native-history reads, with the new acknowledgement/write/notice path and publication still unqualified.
Native mail continuation
User turns sent with sessions.message and as_user: true remain waiting
while the terminal queue owns them without delivery confirmation. Queue
acceptance acknowledges the stored mailbox copy to avoid handing it over again;
it does not report typed or delivered_to_bus: true. Confirmed pane delivery
reports typed, and hosted-runtime input reports started or steered.
Workplace turns await the initial native input attempt instead of returning
waiting solely on filing. A working turn does not delay that attempt.
For the person's own Claude Code input, the matching native
queue-operation/enqueue confirms input acceptance as native-input-accepted;
this does not claim the model has consumed the line or finished its turn.
Peer mail retains its native conversation-reference requirement.
Following an edge now requires an explicit machine-operator approval through
supercode message continuation attest SOURCE SUCCESSOR. show SOURCE --json
reads its current-instance status; revoke SOURCE removes its authority before
recording the revocation. Full local Claude Code UUID addresses and a matching,
unchanged native terminal row are required. Each followed edge is approved
separately. An exact live receiver still wins.
The daemon uses a fresh Ed25519 key held only in memory. Signed decisions are
retained in <supercode home>/mail-continuation-attestations/<epoch>/ as audit
evidence, never imported as authority. Restart requires new approvals. File,
pane and mail grants cannot approve a route; sender grants on every recipient
still apply. This attests the operator routing decision, not the native writer,
and does not isolate arbitrary code executing as the daemon's OS user.
See the operator guide
and source qualification.
Mail to an old Claude Code address follows only an operator-approved explicit terminal
continued-in record to a live UUID on the same machine. It never infers a route
from a name or working directory. The send result and receipt retain
continuation: { addressed, recipient, chain, attestations }; send logs retain that metadata.
An explicit --id retains its original recipient and plan in the daemon's SQLite
store before filing/input can start. A repeat reports that attempt rather than
delivering to a later successor. A pre-filing refusal leaves an unsent record
that allows a retry; uncertain handover holds the ID. Waiting keyed agent mail
keeps its original recipients too. Exact sender/ID legacy mailbox copies,
including their claims/wakes, are reconciled before successor lookup and adopted
as held attempts even without a log or marker. An adopted legacy agent copy
without its original plan waits rather than replanning. Legacy send logs without
a no-submission fact remain uncertain; already erased legacy evidence cannot be
recovered. Relay recovery stays intact; this is not a promise of
exactly-once native input after a lost lower-layer answer. See the
source boundaries.
The target daemon rechecks mail grants on all routed addresses. A grant on only
the old address does not cover its continuation. Caller identity, pane ownership,
history access and old mailbox contents are unchanged.
The named lookup reads at most 64 KiB per transcript tail and follows at most 16 links within a shared 4,096-project-entry / 750 ms work budget. Incomplete, changed, conflicting or cyclic records are refused. The filesystem reads are asynchronous; an in-progress OS read is not cancelled by the elapsed budget.
Files (under $SUPERCODE_HOME/teams)
machine.key|pub (the host key; it signs describe and nothing else) · machine.sock ·
machine.json · launches.jsonl · log.jsonl (hash-chained, rotating to log.<ts>.jsonl) ·
attention.json · app-door.json (the app door's setting and token) · app-door.state.json (whether the daemon serves it) · titles.json · suspended.json · limits.json · products/ (receipts of
products served behind the daemon) · workspaces/ (Teams contexts, credentials and connector
enrollments).
limits.json is read when the daemon starts: maxAttachmentsPerPrincipal (16),
protocolFloor (2), logRotateBytes (16 MiB), logKeep (8).
RH2 seats
Bind a session to its seat in an RH2 Room with supercode teams sessions bind REF --room ROOM --agent PRINCIPAL --rh2 ORIGIN.
Only the session custodian can grant this binding, in person or through an app they installed with
sessions.access (the Agents → Room agents app binds a card agent's main session this way). The returned session
({ agentPrincipalId, harness, reference: { id, team } }) can be passed to RH2’s room-member door: RH2 addresses a session
by its reference and takes the registration that provides the agent's sessions in the Room's organization (RH2 ADR 0050
decision 4); it stores no Teams address.
The binding is the resource ${ROOM}:seat:${PRINCIPAL}: through it the Room's notices and lines reach the session.
unbind accepts the same flags. --conversation names the resource directly; it is mutually exclusive with --agent.
Page shared session history
A session's history is its logs (ADR 0070, Reads): the newest messages of a native log are its display window, older pages are read backward from the log's chain in R2 a chunk at a time, and a decoded log is paged by its lines. Each page is in ascending order; a cursor names a log offset.
Marks
A Teams server serves the marks of what a session runs without a credential: GET /marks/harness/<id> (a harness's
launcher mark), /marks/provider/<id> (a model provider's: anthropic, google, openai, xai) and
/marks/model/<id> (its provider's, by supercode-ui's modelProvider), each an SVG cached for a day, a redirect to the
brand for Volter Harness's own harness ids, and 404 for anything else. They are supercode-ui's one catalogue
(@volter/supercode-ui/marks); server/mark-catalogue.mjs is its copy, written by the pre-commit hook. A workplace
names the route as an installation's marks endpoint (/marks/{kind}/{id}) and draws the image on a session's face.
Read server work diagnostics
An administrator reads the team object's recent work with supercode teams storage work --json (handler records, slow
work, active records and machine links that dropped), what the store holds by table with storage tables, the age of
the rows that age out (idempotency records, events not yet sealed into a page) with storage ages, and the search
shards with storage index, and where a session's rows are (the team object, the directory) with storage sessions. Failed and successful object calls emit teams_object_refused and teams_object_call to
Workers Logs and Analytics Engine at the calling boundary. Every append is counted in teams_work as bytes_in and
bytes_already_held. Rows SQL writes while no work runs are emitted once a minute as teams_work_outside, one record
per work that left them (none when no work did), under the object's :outside Analytics Engine index. A set alarm,
which Cloudflare bills as a row written, counts as one: the running work's, else setAlarm's outside any.
Built-in Codex capacity recovery
The machine daemon's known-screen handler automatically retries a current Codex capacity failure. It reads the native failed-turn event and the current panel every 5 seconds, with a retry delay of 20 seconds that doubles up to five minutes. It keeps retrying capacity failures instead of stopping after five attempts. This starts and stops with the machine daemon and needs no external scheduled task.
The failure streak resets as soon as the native transcript records assistant
output, reasoning, or a tool call/result after the retry. It does not wait for
the whole turn to finish, and it does not reset from a spinner, user input, or
the turn-start event alone. The backoff-reset accountability record names the
native evidence; the request ID and delivery acknowledgement remain retained.
The native mail database retains each retry's input IDs before enqueue and its
acknowledgement afterwards, so a connector restart does not paste an accepted
retry twice. Queued input is reported pending until confirmed. Suspended panes,
interrupted turns and nonempty composers stay untouched; the queue rechecks the
current failure and composer before pasting. The machine status record exposes
capacity_recovery; the accountability log records submissions and confirmations
under known-screen.
Direct agent CLI entry
Ending an agent also closes its admitted program panes, through each machine's
existing claimed closure door and machine credential. The launch journal keeps
the original agent/team/machine/source tuple and native pane incarnation;
agent closures AGENT returns target_kind: "pane", its exact target, and the
retained close outcome alongside native session closures. Reconciliation picks
up launches that settle after end. General delegated access stays revoked; no
cleanup credential or person-context fallback is introduced. Older launches
without original ownership or a native incarnation remain unqualified. This
extends agent-end lifecycle
and does not change named Windows session-close guards. Runtime qualification
is separate from this source contract.
The npm front door serves supercode agent whoami|list|get|sessions|message|record|update|end|closures
through this package's workspace-cli entry in the same Node process. The entry
exports the existing workspaceMain and errorExit; it introduces no identity
or grant authority. Mailbox agent declare, agent show and agent retire retain their machine
mail routes and TypeScript argument validation. The command drains its output
and Windows fetch handles before exiting. An explicit Teams CLI or Node override
keeps its CLI process contract. This is source implementation; candidate runtime
qualification is separate.
agent get AGENT and agent sessions [AGENT] accept an immutable agent ID or
an exact name/path from agent list in the selected Org. Name resolution reads
the paginated catalogue and refuses ambiguous matches; use the immutable ID
when an ended agent or another branch shares a name. The reserved root
selector retains the server's root read. Human tables show --after for the
next page. These read selectors do not change mutation selectors or session
access. Recorded source CLI readings
resolve the listed box maintainer by ID, path and leaf name and print its real
session rows; installed forwarding and Windows remain unqualified.
Source graph reads
@volter/supercode-teams/source-graph exports typed read-only helpers; declarations own the API. One Node owner serves graph shape, versions/constraints and digests. source-graph-owner provides its internal line transport. Current recordings qualify synthetic local graphs, not activation or Native/installed operation.
@volter/supercode-teams/mail-values owns the retained native ABI address, machine-name, ID and held-record projection. It reads only explicitly selected enrollment data and never sends mail or enrolls. Current recordings retain exact numeric/refusal frames, distinct native integration and actual daemon limits.
The caller-local ./harness-runtime-session also composes the process/session
and ancestry readers. On Windows it reads Codex hook metadata from the selected
local machine door, with cancellation, a bounded frame and explicit refusal on
an unanswered or malformed record set. This does not infer identity or grant
control from a process association. The npm stdio composition uses these Node
readers. The machine daemon now owns one Node runtime session in process,
retaining global runtime lifetime across caller disconnects and routing events
only to registered operator owners. Every response/event rechecks the current
grant. A newly opened connection whose handle cannot be delivered is closed.
Shutdown drains owned runtime operations before closing the mail store and
terminal host. The old native service child, its restart machinery and the
separate native hook-ancestry exchange retire. Final recorded operations remain
pending.
./runtime-registry-session composes the actual caller-local receipt store,
daemon incremental index, complete source loader and existing HTTP effects
owner. Resolved bearers stay in its private maps. Transferred runtime clients
belong to the caller; closing the registry releases its remaining probes,
clients and private resolved handles. This is source composition only, with
final runtime, Windows and real-used-home recordings still pending.
teams files put <path> [--in <file>] sends the same 4 MiB ranges used by
files get, so each base64 request stays below the machine channel's 8 MiB
frame. It waits for each exact write receipt before sending the next offset.
Only the first range truncates; an empty input still truncates/creates an empty
file. The result stays { written: <total bytes> }. This is an incremental
write, not atomic replacement: a refused/interrupted later range leaves any
already-written prefix at the destination and stops the upload. The CLI still
reads its complete input into memory; this change addresses frame size, not
streaming memory use. Positional receiver writes complete short writes before
acknowledging the range; a no-progress write refuses. Grant checks still apply
to every range. Source/static checks do not qualify an actual transfer,
interruption, Windows or installed runtime; none was operated while coding.
Heartbeat stage cleanup recovery (2026-10-18 source checkpoint)
An inactive retained heartbeat stage is retried before the next stage or shutdown cleanup. Active requests, changed ownership and uncertain descriptors still refuse; a transient pathname-cleanup failure can recover without a restart. [The decision](../../docs/adr/0160-heartbeat-stage-cl
