Compare commits

...
Author SHA1 Message Date
OpenRig contributors 7d7970fd50 fix(daemon): keep binary files byte-identical in rig bundles
Bundle create read every vendored agent-package file, and the declared
culture, docs and startup files, as UTF-8 text and wrote it back as UTF-8.
Any byte sequence that is not valid UTF-8 became U+FFFD, and the integrity
manifest was hashed from the changed copy, so inspect and install verified
the corrupted bytes as intact.

Copy those files as bytes: the pod assembler reads them with readFileBuffer
and writes the same bytes, and the install-side skills and workflow-spec
routers copy with fs.copyFileSync. Rewriting rig.yaml and agent.yaml import
refs stays a text operation.

Refs #245
2026-10-01 01:14:37 +00:00
Mike SchwarzandOpenRig contributors afde814f5b fix(daemon): keep a blocked row's park timer through a seat handover (#242)
* fix(daemon): keep a blocked row's park timer through a seat handover

At a seat swap, the occupant invalidator stops every watchdog job the retiring
generation registered. A park timer (rig queue block --wake-after, with or without
--wake-max) is registered by the parking seat, so a handover stopped it too. Nothing
re-armed it, and the row stayed blocked with no timer, which is the strand reported
in korallis/agent-stack#61.

The rig's parked-owner consumer eventually noticed the dead wake and sent one generic
wake once the new occupant was idle. The recorded wake time, message and backoff
cadence were still lost.

A blocked row's current queue-generated timer wakes the seat that owns the row, and
the successor inherits that row, so the swap now keeps it. The queue lists those
timers: each is still the row's current armed wake, is still active, and still
targets the row's destination. The watchdog drop leaves them running.

Every other job the retiring generation registered still stops: operator-attached
watchdogs, superseded or stale timers, timers of rows rerouted to another seat, and
occupant-only jobs. Re-parking still retires the kept timer, so no duplicate is
created. A failed handover never reaches the invalidator, as before.

* fix(daemon): retire a park timer when its row is rerouted

routeToFallback moved a blocked row to a new owner but left the row's park timer
active and aimed at the old owner, so it could fire to the old owner. The
pre-delivery check only refuses timers whose rows are all terminal. That was already
reachable on main (park, reroute, fire), and keeping park timers through a handover
also let it happen after a swap (review-r2).

The reroute now retires the row's current park-generated timer through the existing
retireParkGeneratedTimer path, reason park_rerouted, the same one re-park and exit
use. The new owner has no dedicated wake from a reroute, as before; the retired timer
leaves the row's wake dead, so the parked-owner backstop covers it.

* fix(daemon): leave a repeating queue wait running when its row is rerouted

The previous commit retired every park timer on reroute. A repeating queue wait
already delivers to the row's current owner (evaluateQueueWait sends to view.owner),
so it woke the new owner correctly, and retiring it took that wake away. Only a
periodic park timer is aimed at the old owner, so only that is retired now.

Tests now fire through the engine with resolveQueueWait wired, as startup.ts wires
it. After a periodic reroute the row shows no live park timer, and the new owner's
parked diagnosis sees it as unhealthy, so the backstop covers the new owner. A
repeating wait survives the reroute, with or without swaps, and delivers only to the
new owner.

---------

Co-authored-by: OpenRig contributors <[email protected]>
2026-09-30 17:19:00 -07:00
Mike SchwarzandOpenRig contributors cc2c37dc2f fix(daemon): keep UTF-8 intact across herdr socket chunks (#241)
createHerdrSocketRpc decoded each socket chunk on its own, so a
multi-byte character split across two chunks became U+FFFD while the
JSON line still parsed. Setting the socket encoding to UTF-8 uses Node's
streaming decoder, which carries an incomplete character into the next
chunk. Newline framing, id matching and error, end and timeout handling
are unchanged.

The new test drives the real RPC over a private unix socket and splits
the reply inside 2-, 3- and 4-byte characters, plus a case where
another id's line arrives first.

Co-authored-by: OpenRig contributors <[email protected]>
2026-09-30 16:11:27 -07:00
Rudy Mizrahi Celekli cc02aef23f fix(daemon): preserve executable mode during atomic file edits (#235)
Signed-off-by: Rudy Celekli <[email protected]>
2026-09-30 16:04:49 -07:00
Rudy Mizrahi CelekliandOpenRig contributors 657bc01368 fix(cli): preserve local rsync directory content operands (#231)
Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: OpenRig contributors <[email protected]>
2026-09-30 16:04:20 -07:00
Rudy Mizrahi Celekli 9b9cf9ec4c fix(daemon): release SSE subscriptions aborted during replay (#233)
Signed-off-by: Rudy Celekli <[email protected]>
2026-09-30 16:03:50 -07:00
Rudy Mizrahi Celekli 7810d5120a fix(cli): disclose stale environment service receipts (#232)
Signed-off-by: Rudy Celekli <[email protected]>
2026-09-30 15:57:21 -07:00
Rudy Mizrahi Celekli 6678cef5a1 fix(daemon): preserve discovery claims during async rescans (#237)
Signed-off-by: Rudy Celekli <[email protected]>
2026-09-30 15:56:39 -07:00
Rudy Mizrahi Celekli 3dca5ee54b fix(cli): decode SSH and rsync output across UTF-8 chunks (#230)
Signed-off-by: Rudy Celekli <[email protected]>
2026-09-30 15:49:34 -07:00
Mike Schwarzanddev-driver e6bfdce242 fix(transport): distinguish unverified runtime from stopped agent (#240)
Co-authored-by: dev-driver <dev-driver@openrig-build>
2026-09-30 15:24:11 -07:00
d3ad0d1995 fix(daemon): observe native processes independently of the inherited locale (#239)
Both native process listers run `ps` with an `lstart` column and parse it with
an English date pattern. `ps` formats that column through the locale, so a
daemon that inherited a non-English locale (for example LANG=de_DE.UTF-8,
LC_TIME=fr_FR.UTF-8 or LC_ALL=ja_JP.UTF-8) saw every row fail the pattern:
process detection and resume metadata silently came back empty.

Each `ps` call now runs with a child-only `LC_ALL=C`, spread over the existing
environment. The parent environment, the column sets, the parsers and every
identity requirement are unchanged.

On macOS, the C locale also makes `ps` print non-ASCII bytes in the command
column as escapes (for example `\240`) instead of raw UTF-8. Token boundaries
and every ASCII identity token (executable name, session and resume ids) are
unchanged.


Claude-Session: https://claude.ai/code/session_01V8RzdrMhGkYLV4rn96kNMN

Co-authored-by: v-openrig-build <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-09-30 15:14:59 -07:00
Toan NguyenandOpenRig contributors 56a3efeaa1 fix(tmux): finish the printable-separator migration for client and cursor reads (#12) (#179)
Co-authored-by: OpenRig contributors <[email protected]>
2026-09-30 15:10:40 -07:00
Rudy Mizrahi Celekli f45c64f642 fix(daemon): clamp oversized suffix ranges to asset bounds (#234)
Signed-off-by: Rudy Celekli <[email protected]>
2026-09-30 15:04:25 -07:00
Rudy Mizrahi Celekli 8a8a3633ca fix(daemon): keep fenced example headings out of context addresses (#236)
Signed-off-by: Rudy Celekli <[email protected]>
2026-09-30 15:00:29 -07:00
Rudy Mizrahi Celekli c149053c5e fix: Keep CLI request deadlines active through response bodies (#201)
* fix(cli): retain request deadlines through response bodies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(cli): preserve unknown outcomes for unreadable responses

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
2026-09-30 14:59:53 -07:00
Rudy Mizrahi Celekli 87fc4fa2d5 fix(attach): accept runtime guards for existing nodes (#228)
Signed-off-by: Rudy Celekli <[email protected]>
2026-09-30 14:59:15 -07:00
f056f06a34 fix(daemon): keep ps rows whose command name contains spaces (#82)
listNativeProcesses reads `ps -Ao pid,ppid,pgid,tpgid,ucomm,lstart,command`
and matched ucomm with \S+. ucomm can contain spaces on both platforms:
macOS app helpers ("Slack Helper", "QuickTime Player"), and on Linux task
names that prctl(PR_SET_NAME) and process.title rewrite ("tmux: server",
"node (vitest 1)"). Every such row was silently dropped from the process
table, which is why the real-ps tests could not find their own (renamed)
vitest worker on Linux. lstart always begins with a weekday word and runs to
the year, and ucomm (16 bytes at most) is too short to contain such a date,
so matching ucomm lazily up to the first date is exact.

Co-authored-by: Martin <[email protected]>
Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-30 14:58:44 -07:00
Thomas Bray da2297e13a fix(paths): make module URLs and transcript containment portable (#168)
* Fix module URL conversion and transcript containment across platforms

* Refresh generated integrity digest for portable precompact hook

* fix(transcripts): contain unsafe fallback paths

* test(transcripts): cover unsafe fallback separators
2026-09-30 14:44:47 -07:00
Thomas BrayandMTG-Thomas 812e1e555f refactor(tmux): add shell-free argv execution seam (#167)
* refactor: argv-exec seam in TmuxAdapter (Windows/psmux path)

Every multiplexer invocation is now built as an argv array first.
A new optional ArgvExecFn dep runs it WITHOUT a shell
(execFile-style: argv[0] is the binary, rest verbatim, no quoting
layer) — the Windows/psmux path, where POSIX shells, single-quote
quoting and /dev/null redirections do not exist.

Default behavior is byte-identical: without argvExec every method
renders the exact legacy shell string (the existing suite pins all
of them). startServer (-D detach/redirection) and signalPaneProcess
(Unix kill, not a mux command) stay on the string path deliberately.

New tmux-argv-exec suite pins exact argv per op; live smoke
(/tmp, throwaway) drove real tmux 3.5a 7/7 through execFile with
the string path rigged to throw.

* Wire shell-free tmux execution without changing runtime adapters

---------

Co-authored-by: MTG-Thomas <[email protected]>
2026-09-30 14:44:12 -07:00
Guillaume FossierandClaude Sonnet 5.5 b2679174e5 fix(cli): skip ps for daemon process liveness on Windows (#173)
readProcessState shelled out to `ps -o state= -p <pid>` to reject zombies.
Windows has no ps and no zombie state, so isProcessAlive returned false for a
live daemon child and startup failed with "liveness could not be confirmed".
On win32 the process.kill(pid, 0) probe now decides on its own. POSIX behavior
is unchanged.

Refs #172

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
2026-09-30 14:43:40 -07:00
c0a322950c test(cli): skip release-surface tag diffs when v0.3.1/v0.3.2 are absent (#152)
* test(cli): skip release-surface tag diffs when v0.3.1/v0.3.2 are absent

The worked-example (AC-2) block called generateSurfaceDiff in the describe
body, so in a fork or a shallow/--no-tags clone the throw during collection
failed the whole file, including the six unit tests that need no tags.

Check for the two tags up front and skip only the AC-2 and AC-4 blocks when
they are missing, with a hint to fetch tags. Move the AC-2 diff into
beforeAll so a skipped block does no git work. Under CI (which clones with
full history) a missing tag still fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* test(cli): only treat CI=true as CI in the release-surface tag guard

A truthiness check read CI=false as CI, so a tagless local run with
CI=false failed instead of skipping. Match scripts/ci-macos-process-probe.mjs
and GitHub Actions, which set CI=true.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Coder8124 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-09-30 14:43:08 -07:00
JUSHUANGHUI LI 4658c48842 fix(cli): report unknown seat launch outcome on timeout (#191) 2026-09-30 14:39:26 -07:00
Qiaochu Huandhobostay c849d54f5f fix(daemon): leave user config content untouched when stripping codex activity hooks (#186)
stripCodexActivityHooks applied a global /\n{3,}/ collapse (and a
leading-newline trim) to the entire ~/.codex/config.toml document, not
just to the excision seam. Disabling the managed activity-hooks block
silently rewrote unrelated user content, including blank lines inside
TOML multiline strings, changing parsed values in a file the function
documents as touched only at the managed block.

The \n* prefix in the excision pattern already absorbs the blank-line
separator the block was appended with, so replacing the match with a
single newline restores the seam exactly. Drop the document-wide
collapse and the leading trim, and add regression tests that pin
byte-exact preservation of newline runs between user sections and
blank lines inside multiline strings.

Co-authored-by: hobostay <[email protected]>
2026-09-30 14:38:54 -07:00
Qiaochu Huandhobostay b3b9bdc09d fix(daemon): project file-shaped entries instead of failing them on ENOTDIR (#185)
projectEntry probes whether a source is directory- or file-shaped with
listFiles(entry.absolutePath). In production, startup.ts wires listFiles
to a recursive fs.readdirSync walk, which throws ENOTDIR for file-shaped
entries such as subagents (.claude/agents/<name>.yaml). The throw was
caught by project()'s per-entry handler, so every file-shaped entry
silently landed in ProjectionResult.failed and was never installed; the
single-file copy branch was unreachable outside tests. Unit tests missed
this because their mock listFiles returns [] for file paths instead of
throwing, diverging from the production wiring.

Treat a listFiles throw as not-a-directory in all four runtime adapters
(claude, codex, pi, stub) so file-shaped entries fall through to the
existing file copy branch, and add regression tests that drive a
file-shaped subagent through project() with readdirSync-backed fsOps.

Co-authored-by: hobostay <[email protected]>
2026-09-30 14:38:24 -07:00
Toan Nguyen 757b204348 fix(kernel): give kernel Claude seats the shared activity hooks (#160) (#178) 2026-09-30 14:37:53 -07:00
Toan Nguyen ed0f323092 fix(daemon): derive terminal pickup for closed qitems (#164) (#176) 2026-09-30 14:37:22 -07:00
Mike SchwarzandOpenRig contributors bcc0010de9 fix: replace stopped same-name rig generations on YAML import (#196)
* fix(daemon): rig remove never kills another rig's live seat; seat refs skip archived rigs (#174)

An archived duplicate of a live rig shares its name and its seats'
canonical session names.

- `rig remove <archived-rigId> <node>` killed the tmux session by name,
  so it could end the live rig's seat. Removal now asks whether another
  node owns that session name, using the handover's live-ownership check,
  now shared as session-owner.ts. If another node owns it, removal
  leaves the session running, doesn't block on or reroute the queue
  work addressed to it, and reports the owner as `sessionKeptFor`. The
  node itself is still removed.
- Seat refs (`member@rig`) for seat launch, stop, model and handover
  resolved rigs by name including archived ones, so they failed with
  "matched multiple nodes". They now resolve unarchived rigs only, as
  default reads do since migration 042. Other findRigsByName callers
  are unchanged.

* fix(daemon): archived rigs don't claim a live seat's session or input target (#174)

Review follow-up. Archiving a rig keeps its bindings, so the archived twin
still names the live seat's session:

- Removing the live node found the archived twin as the "other owner",
  kept the session and removed the node's open work. Removal now ignores
  owners in archived rigs, so the live node kills its own session and
  still refuses open work without --fallback. The handover check is
  unchanged.
- The delivery guard needs exactly one match for a target, and the twin's
  binding made it two, so delivery to the live seat failed. Unarchived
  matches now win, and archived ones count only when nothing else
  matches. Exactly one match is still required, so a truly ambiguous
  live target still refuses.
- `rig remove` and `rig shrink` human output now says when a session was
  kept, and for whom.

* fix(daemon): a YAML import archives the stopped same-name rig it replaces (#141)

After the seats' tmux server died, `rig up <same rig.yaml>` created a
second, unarchived rig with the same name. Every seat name then matched
two nodes, so launches and kills were refused.

When an explicit YAML import (PodRigInstantiator.instantiate) finds an
unarchived rig with the same name, it first confirms that rig is stopped:
- no running session rows (the existing running-name guard); and
- for every session name it used, this daemon's tmux reports positive
  absence or "no server running".

It then archives that rig in the same database transaction that creates
the replacement. The earlier rig's records are kept, and the output names
it with `rig unarchive <id>`. If the rig can't be confirmed stopped, the
import creates nothing and says why.

If creating the replacement fails, the service hook refuses it, or every
replacement node fails and the replacement is removed, the earlier rig
is un-archived. An adapter that cannot probe keeps today's behavior.

* fix(daemon): one YAML import per rig name while it may archive a generation (#141)

Review follow-up to the stopped-generation archive.

- Concurrency. The stopped check awaits tmux, and a second same-name
  import could run during that wait. It could replace the same old rig
  too, or archive the first import's in-progress replacement, which has
  no running sessions yet. The YAML import now takes a per-database,
  per-name in-flight claim, and a same-name import arriving meanwhile is
  refused (generation_unconfirmed). Unrelated names are unaffected. The
  create transaction also rechecks that the same-name set is the one it
  checked, and that each archive changed its row, so a rollback restores
  only archives this import made.
- Responses. generation_unconfirmed is now a 409 conflict with its
  message on POST /api/up and POST /api/rigs/import, not a 500. The
  archive notice also rides the attention_required outcome, where the
  replacement is kept.

* fix(cli): print the #141 archive notice on the attention 409 and the generation_unconfirmed message

rig up returned from its status >= 400 block before either warnings loop, so the
archive notice (old rig id and its unarchive command) on an attention 409 reached
--json only. Print the response warnings after the attention nodes; that path returns
early, so nothing prints twice. Render generation_unconfirmed verbatim like
rig_name_running instead of the validate-your-spec fallback. JSON output and exit
codes are unchanged.

* fix(daemon): archived generations don't block the replacement's handover or pod shrink

A YAML re-import archives the stopped earlier generation, which keeps its bindings
to the session names the live replacement now uses.

Handover: a fresh, fork or rebuild successor reuses the seat's own session name,
so the archived binding made finalize return successor_already_managed after the
successor had replaced the process. The owner check skips archived rigs for
composer-launched successors, as removeNode does. A discovered successor is still
blocked by any other owner.

Pod shrink: shrinkPod counted and, with --fallback, rerouted queue work addressed
to member session names that another unarchived node owns. It now applies
removeNode's ownership rule first, so shrinking the archived pod neither stops on
nor moves the replacement's work.

* fix(daemon): keep a shrink target's own shared-name work in the up-front check

C3's shrinkPod ownership filter excluded only the node being checked, so when two
members of the pod being shrunk shared a session name, each counted the other as its
owner. Their open queue work then dropped out of the up-front check. Without
--fallback the shrink removed one member and failed on the last. With --fallback the
work wasn't rerouted.

findOtherSessionOwner gains an optional excludeNodeIds, applied in both the binding
and the session-row lookups before the first match, and its default is unchanged.
shrinkPod passes the whole target, so only an unarchived owner outside the target
takes a name's work out of the check. Before C3, shrinking such a pod refused up front
or rerouted with --fallback, and that behavior is restored.

---------

Co-authored-by: OpenRig contributors <[email protected]>
2026-09-30 14:08:23 -07:00
5177ec8913 fix: provider-aware Codex readiness for non-OpenAI providers (#222)
* fix: provider-aware Codex readiness for non-OpenAI providers (#194)

`rig setup` and the kernel runtime probe treated `codex login status` as the
only Codex authentication check. A user whose Codex selects a custom provider
with `requires_openai_auth = false` and an `env_key` (the reported Amazon
Bedrock bearer-token provider) failed setup and was never offered a Codex
kernel, even with the provider's credential set.

Both checks now read the provider selected in `$CODEX_HOME/config.toml`. For
an explicit provider entry with `requires_openai_auth = false` and an
`env_key`, a nonblank variable counts as local credential availability; the
kernel probe still requires the Codex executable. Every other case keeps the
OpenAI login check, including a missing file, a parse error, a legacy
top-level `profile`, and built-in or undeclared providers, so an unresolved
config never earns readiness. The setup message says this is a local
credential check, not remote authentication or inference.

`AWS_BEARER_TOKEN_BEDROCK` joins the known provider-auth names, so an operator
who names it in `recovery.provider_auth_env_allowlist` can forward it to
managed seats. Nothing is forwarded without that opt-in.

Other Codex config layers (project, system or managed config, requirements,
`-c`, `--profile`) are not resolved.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V8RzdrMhGkYLV4rn96kNMN

* docs: narrow the #194 unresolved-config wording

An unresolved Codex config does not take the new env-key shortcut; readiness
still follows the existing login result. The comment and one test title now say
that, instead of implying OpenRig validates every configuration. No behavior
change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V8RzdrMhGkYLV4rn96kNMN

---------

Co-authored-by: v-openrig-build <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-09-30 13:37:36 -07:00
Mike Schwarzanddev-driver 5b344e0578 fix(claude): preserve unset native config selection (#225)
Co-authored-by: dev-driver <dev-driver@openrig-build>
2026-09-30 12:02:47 -07:00
Mike Schwarzandv-openrig-build b43498d7da docs(contributing): ask security and integration PRs for practical scenarios (#224)
Adds a 'Before a security or integration PR' section to CONTRIBUTING.md, a
security question block to the PR template, and a trust-model bullet to
SECURITY.md's scope notes. Additive only; existing scope text is unchanged.

Co-authored-by: v-openrig-build <[email protected]>
2026-09-30 11:57:13 -07:00
Mike Schwarzanddev-qa 8b5e948807 chore(release): prepare 0.6.3 regression repair notes (#223)
Co-authored-by: dev-qa <dev-qa@openrig-build>
2026-09-30 11:25:15 -07:00
Mike Schwarzanddev-qa 4dc4047cdb fix(ci): serialize script tests sharing build outputs (#221)
Co-authored-by: dev-qa <dev-qa@openrig-build>
2026-09-30 11:03:08 -07:00
ammann 700af77ae0 fix(cli): protect proof media from artifact writes (#177) 2026-09-30 11:02:23 -07:00
Mike SchwarzandOpenRig contributors 3b1b335dbe fix(daemon): rig remove never kills another rig's live seat; seat refs skip archived rigs (#174) (#181)
* fix(daemon): rig remove never kills another rig's live seat; seat refs skip archived rigs (#174)

An archived duplicate of a live rig shares its name and its seats'
canonical session names.

- `rig remove <archived-rigId> <node>` killed the tmux session by name,
  so it could end the live rig's seat. Removal now asks whether another
  node owns that session name, using the handover's live-ownership check,
  now shared as session-owner.ts. If another node owns it, removal
  leaves the session running, doesn't block on or reroute the queue
  work addressed to it, and reports the owner as `sessionKeptFor`. The
  node itself is still removed.
- Seat refs (`member@rig`) for seat launch, stop, model and handover
  resolved rigs by name including archived ones, so they failed with
  "matched multiple nodes". They now resolve unarchived rigs only, as
  default reads do since migration 042. Other findRigsByName callers
  are unchanged.

* fix(daemon): archived rigs don't claim a live seat's session or input target (#174)

Review follow-up. Archiving a rig keeps its bindings, so the archived twin
still names the live seat's session:

- Removing the live node found the archived twin as the "other owner",
  kept the session and removed the node's open work. Removal now ignores
  owners in archived rigs, so the live node kills its own session and
  still refuses open work without --fallback. The handover check is
  unchanged.
- The delivery guard needs exactly one match for a target, and the twin's
  binding made it two, so delivery to the live seat failed. Unarchived
  matches now win, and archived ones count only when nothing else
  matches. Exactly one match is still required, so a truly ambiguous
  live target still refuses.
- `rig remove` and `rig shrink` human output now says when a session was
  kept, and for whom.

---------

Co-authored-by: OpenRig contributors <[email protected]>
2026-09-30 10:23:18 -07:00
Mike SchwarzandOpenRig contributors e3ebd4ac2c fix(daemon): clean up unusable snapshot refresh helpers (#189)
* fix(daemon): a snapshot refresh probe never leaves its tmux session behind (#188)

`rig down` probes Claude resumability in a private `rigged-refresh-*`
tmux session. Two paths left it running, and every retry added another:

- After a seats' tmux server restart, the new server reuses pane ids,
  so a stale seat binding could name the probe's brand-new pane. The
  probe's kill then asked the guard to resolve the helper by name, which
  threw, and the unawaited write let the throw escape: the snapshot
  failed ("Cannot establish managed input target rigged-refresh-...")
  and the helper was never killed.
- When the new pane could not be proven, the probe returned failure
  without removing the session it had just created.

createProbeSession now refuses to use a probe whose new pane is named by
a managed record, or whose pane it cannot prove. It removes that helper
immediately, by the name this call just created. The probe write is
awaited, so a later refusal returns as a result instead of throwing.
Managed or changed targets are still never killed.

* fix(daemon): roll back an unusable probe only by the id its create returned (#188)

Review follow-up. The allocation rollback killed the helper by name after
awaiting creation and pane observation, which could kill a session that a
managed record had adopted meanwhile, or a different session that had taken
the name.

The probe is now created with `new-session -P -F '#{session_id}'`, and the
rollback kills only that session id. It leaves the helper in place, and
says so, when the id is unknown or a managed record now claims the helper's
name. A binding that names only the reused pane id under another session
name is stale and does not block the rollback. A cleanup failure is
reported in the result. The awaited probe write is unchanged.

* fix(daemon): check the helper's identity in the same tmux command that removes it (#188)

Review follow-up. A tmux session id is unique only for one server's
lifetime. If the server restarted between creating the refresh helper and
rolling it back, `kill-session -t $N` could remove an unrelated session
that the new server gave the same id.

The helper's create now returns its id and creation time. The rollback
runs `if-shell -F -t $N` with a check on the session's name and creation
time, and kills only when both match, in the same tmux command. A
mismatch, or an id that no longer resolves, leaves everything in place
and says so in the result.

---------

Co-authored-by: OpenRig contributors <[email protected]>
2026-09-30 09:31:52 -07:00
Mike Schwarzanddev-driver 100be9d646 fix: recognize managed Claude seats behind launch wrappers (#220)
* fix: recognize managed Claude behind shell wrappers

* fix: normalize observed Claude executable name

---------

Co-authored-by: dev-driver <dev-driver@openrig-build>
2026-09-30 09:31:13 -07:00
Mike Schwarzanddev-driver f8f3aff68b fix(transport): recognize proven Codex behind shell wrappers (#171)
Co-authored-by: dev-driver <dev-driver@openrig-build>
2026-09-29 17:03:50 -07:00
Mike Schwarzanddev-driver 1618bab05f fix(daemon): bound overlapping identity and transcript polls (#169)
Co-authored-by: dev-driver <dev-driver@openrig-build>
2026-09-29 15:38:24 -07:00
Mike Schwarzanddev-driver b68571318d fix(codex): project shared skills to the Codex target (#162)
* fix(codex): project shared skills to the Codex target

* test(projection): allow runtime-aware resolver wiring

---------

Co-authored-by: dev-driver <dev-driver@openrig-build>
2026-09-29 15:24:58 -07:00
Mike Schwarzanddev-driver 6ab706d435 chore(release): prepare 0.6.2 (#153)
* chore(release): prepare 0.6.2

* docs(release): clarify the default bundle target directory

---------

Co-authored-by: dev-driver <dev-driver@openrig-build>
2026-09-29 13:04:56 -07:00
Mike Schwarzanddev50-guard a745475b07 fix(daemon): preserve managed launch target across pane reuse (#151)
Co-authored-by: dev50-guard <dev50-guard@openrig-build>
2026-09-29 09:46:38 -07:00
Mike SchwarzandOpenRig contributors 18201ac659 fix(transport): don't type into a bare shell where an agent runtime should run (#142) (#150)
When a seat's agent runtime has failed or exited, its pane shows a bare
shell, and any text typed there runs as shell commands. The
parked-owner watchdog wake was delivered anyway (`zsh: bad pattern:
[OpenRig`).

The transport now refuses a send when the pane's foreground is a shell
and the seat's runtime is an agent runtime, before anything is written.
It uses the shared shell classifier. A terminal node's shell is its
runtime and still receives text. An unknown or unreadable pane stays
advisory, as before.

The watchdog records the refusal as a failed delivery on the open row
and sends no second wake that episode. A running runtime still gets its
wake.

Co-authored-by: OpenRig contributors <[email protected]>
2026-09-29 09:30:28 -07:00
Mike Schwarzanddev-driver aa7bc4407f feat: guide first-project permissions and provider choice (#147)
Co-authored-by: dev-driver <dev-driver@openrig-build>
2026-09-29 09:30:11 -07:00
6b8bee36b1 fix(bundle): install v2 bundles into --target and resolve paths on the client (#146)
* fix(bundle): resolve bundle paths on the client and launch v2 installs from --target

`rig bundle create/inspect/install` sent spec, output, bundle and target paths
unresolved, so the daemon resolved them against its own cwd. The CLI now
resolves them against the operator's cwd (files are still read on the daemon's
host; nothing is uploaded).

A schema-version-2 bundle apply launched from the temp extraction dir, which is
removed right after instantiate, and ignored targetRoot: members with cwd "."
and the spec/agent refs pointed at a deleted directory. Apply with a targetRoot
now copies the verified extraction into the target and launches from there.
A target with different content at any bundle path is refused with
target_conflict and nothing written; identical files are accepted so a
reinstall works. Plan mode, explicit cwdOverride, legacy v1 bundles and
applies without a targetRoot are unchanged.

Docs: rig-bundle.md install/inspect/--plan/--target/path behavior.

* fix(cli): resolve local rig up --target and align its help with the v2 target contract

On the local route, `rig up <bundle> --target <rel>` now resolves the
target against the client's cwd before sending it, matching `rig bundle
install`. The --target help now states the accepted contract: a v2 bundle
is materialized into the target (default: current directory), relative
member cwds resolve against it, and --cwd still overrides the launch cwd.
Remote --host and topology routing are unchanged: --host sends --target
as given, and it must exist on that host.

Docs: drop the "pass an absolute --target" workaround for the local route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: v-openrig-build <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-09-29 09:29:33 -07:00
Mike SchwarzandOpenRig contributors 705cda2f0e test(daemon): give successful launch fixtures a startup context and adapter (#148)
#107 refuses to report a fresh pod-aware launch as fresh-primed without the
node's startup context and a runtime adapter. Two fixtures still expected a
successful launch without either, and failed on main:

- launch-node-subset: the single-node launch now seeds the target's startup
  context and passes a ready claude-code adapter, and asserts the harness
  was launched. The non-target assertions are unchanged.
- sessions-routes: the launch-subset success case seeds both nodes' startup
  contexts and opts into route runtime adapters, as startup wires them.

createTestApp gains an opt-in wireRuntimeAdapters option. It is off by
default, so every other route test keeps no route adapters. No production
change.

Co-authored-by: OpenRig contributors <[email protected]>
2026-09-29 09:01:59 -07:00
Sunil 5b7e07c906 refactor: reuse shared constantTimeEqual in terminal-ws (#145)
terminal-ws.ts had a local constantTimeEqual that returned early on
length mismatch. The shared helper in auth-bearer-token.ts already
handles unequal lengths with a fixed-cost dummy compare. Replace the
local copy with an import of the shared helper for consistency.
2026-09-29 08:35:15 -07:00
9523b9de02 test(daemon): pin the #131 sender canonicalizer's edges and scope (#144)
Carries the tests and scope note from #137, which was folded into #135:
- round trip with the stampSelfHostSuffix producer;
- 4-segment names, @local, a near-miss host id, legacy flat names and
  virtual refs pass through unchanged;
- the origin-unknown marker and the P18 wire-over-body rule hold after
  the strip, for both sender helpers.

The comment records that only the sender is canonicalized: the CLI
cannot fix this at the source, and self-suffixed destinations keep the
C4 refusal. No behavior change.

Co-authored-by: OpenRig contributors <[email protected]>
Co-authored-by: Yi-111-a <[email protected]>
2026-09-29 07:48:56 -07:00
Wu Shuwen dc14d71793 fix(restore): surface missing startup context (#107) 2026-09-29 07:48:37 -07:00
Wu Shuwen 636a4790f9 feat(herdr): set agent hint from seat runtime (#106) 2026-09-29 07:22:37 -07:00
Wu Shuwen e4070e4169 fix(tui): preserve unassessed health in focused views (#102) 2026-09-29 07:22:14 -07:00
Wu Shuwen 1fffd9c988 Fix Claude rate limit reset times (#108) 2026-09-29 07:19:43 -07:00
FenjuFu cb29c1f7ce feat(daemon): allow forwarding ANTHROPIC_BASE_URL to seats (#143)
Claude Code seats can already receive ANTHROPIC_API_KEY and
ANTHROPIC_AUTH_TOKEN through recovery.provider_auth_env_allowlist, and
Codex seats can receive OPENAI_BASE_URL, but ANTHROPIC_BASE_URL was not a
known name and was dropped silently. A key issued by an
Anthropic-compatible endpoint (a local Ollama server, a hosted gateway)
then reached the seat without its endpoint, so Claude Code sent it to
api.anthropic.com.

Refs #140

Signed-off-by: FenjuFu <[email protected]>
2026-09-29 07:19:21 -07:00
Johnny Bae e8e8585be9 fix(restore): honor the configured shared-docs root (#139) 2026-09-29 07:19:03 -07:00
Wu Shuwen f6e5df150b fix(tmux): use printable separators for windows (#101)
* fix(tmux): use printable separator for windows

* fix(tmux): preserve separators in window names
2026-09-29 07:06:10 -07:00
Wu Shuwen 0e416ab4ce fix(codex): canonicalize hook trust paths natively (#103) 2026-09-29 07:05:31 -07:00
Shravan Sumanthanan b3f2b085cd fix(daemon,ui): fix timezone flake, macOS realpath in test, and dumb term runner editing (#123)
* fix(daemon,ui): fix timezone flake, macOS realpath in test, and dumb term runner editing

- packages/ui/test/artifacts-navigator.test.tsx: use noon UTC for fixture mtime to ensure consistent local date formatting across all timezones
- packages/daemon/test/s03-bound-launch.test.ts: canonicalize mkdtempSync root via realpathSync to match macOS /private/var path resolution
- packages/daemon/src/adapters/pi-runner.ts: preserve VT100 line editing in createRunnerInput when TERM=dumb by deleting dumb-mode override

* test(daemon,ui): add focused TERM=dumb runner test and compute local mtime dynamically

- packages/daemon/test/pi-runner.test.ts: add focused unit test asserting line editing (type, backspace, retype) under TERM=dumb while verifying normal terminal and piped input still behave as before
- packages/ui/test/artifacts-navigator.test.tsx: compute expected date dynamically from fixture mtime in local time, ensuring 100% timezone invariance across UTC+12..+14
2026-09-29 07:05:03 -07:00
KorallisandClaude Opus 5.5 a09388aabd fix(daemon): canonicalize a self-host-suffixed sender to the local seat (#131) (#135)
Under load the CLI's loopback locality probe can time out, and the client
then host-qualifies its sender with this daemon's own self-host id
(member@rig@<selfHostId>). Every strict actor compare then refused the seat's
own work; for example, `rig queue claim` returned claim_destination_mismatch.

The transport identity now passes through one canonicalizer
(canonicalSenderSession / transportSenderSession) before any actor compare or
record. A trailing @<selfHostId> resolves to the bare local seat. Foreign host
qualifiers, unqualified names and pre-boot (null self id) requests are
unchanged. Covered call sites: requireSenderIdentity and
resolveActorWithDeferral (queue create/claim/unclaim/update/handoff/inbox/
outbox and the other attributed routes), transport send/broadcast, the seat
preference audit, and the activity caller scope.

Fixes #131

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-29 07:04:36 -07:00
Mike Schwarzanddev-qa d83bbebe97 chore(release): prepare 0.6.1 maintenance notes (#129)
Co-authored-by: dev-qa <dev-qa@openrig-build>
2026-09-29 03:03:08 -07:00
Mike Schwarzandv-openrig-build d7fbf88639 docs(readme): link the guide, help, Q&A and updates on X near the top (#127)
* docs(readme): link the guide, help, Q&A and updates on X near the top

OpenRig is on GitHub's daily trending list. A stranger reading the first
screen found no link to the getting-started guide, the help guide, the Q&A
start-here thread or where updates and demos are posted. One line after the
introduction adds all four.

* docs(readme): offer the next walkthrough to visitors not installing today

For trending visitors who can't stop to install now: a secondary call to action
near the top and again after the getting-started steps, pointing to the
existing openrig.dev/follow signup. Nothing about installing the software is
gated.

* docs(readme): show the demo and a Start here link before the install steps

Trending visitors read the install prerequisites before seeing what OpenRig
looks like. Move the existing 'See it running' recording above the install
section, add a Start here link to the guided first-use path, and keep the
follow line after it. The install section, its requirements and the
disclosure of what OpenRig changes are unchanged and in the same order.

---------

Co-authored-by: v-openrig-build <[email protected]>
2026-09-29 03:02:20 -07:00
Mike Schwarzandorch-advisor f87a956dbb fix(codex): pass real git dirs, not a worktree's .git file, to --add-dir (#121) (#126)
In a linked git worktree <cwd>/.git is a file, and passing it to Codex as
--add-dir breaks the Linux sandbox for every command. The fresh launch now
resolves the git metadata directories: an ordinary repository keeps
<cwd>/.git; a .git file resolves through git rev-parse to the worktree git
dir and the common git dir (existing directories only); anything
unresolvable adds nothing. A missing .git keeps the previous argument.
Resume and fork are unchanged.

Reported with a reproduction and the suggested rev-parse approach by
mgall-ibizdigital in #121.

Co-authored-by: orch-advisor <orch-advisor@openrig-build>
2026-09-29 01:57:09 -07:00
Mike SchwarzandOpenRig Contributors 7981bca7a3 fix(daemon): recognize custom Codex status-line model fields (#125)
Reported-by: Hexgunner69 (issue #116, recognition portion). Includes screen-derived regressions contributed by Aummadour in PR #120; the admitted generic recognizer covers these cases without widening the unguarded legacy branch.

Co-authored-by: OpenRig Contributors <[email protected]>
2026-09-29 01:53:35 -07:00
4a920dba73 fix(daemon): parse occupant boot_at as UTC, not local time (#124)
boot_at is SQLite datetime('now'): UTC with no zone marker. Date.parse reads
that form as local time, so on any non-UTC host the boot time shifts by the
UTC offset:

- GET /api/sessions/:name/generation-record refused every Codex seat with
  record_identity_unverified west of UTC (the identity observation looked
  older than the boot) and accepted stale pre-boot observations east of UTC.
- ContextUsageStore dropped current readings as prior-generation west of UTC.
- resolveIdentityVerifiedClaudeRecord (model-divergence) rejected a fresh
  Claude identity as "predates occupant generation" for the first hours after
  boot west of UTC; its tests passed an ISO boot time, which hid it.

Add parseSqliteUtcMs and use it at all three sites. The 12 walk-consumption
tests that failed on a UTC-7 host now pass under UTC, UTC-7 and UTC+9, and a
new current-generation-record test covers the SQLite stamp under UTC-7.

Co-authored-by: Coder8124 <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-09-29 01:52:12 -07:00
Mike Schwarzandorch-advisor a567d9b193 chore: remove the retired TUI drivability spike (#119)
spike/tui-drivability was the Phase-0 agent-drivability harness from
2026-08-02: ten self-contained files importing only each other and Node
built-ins. No test command, config, workflow or published package
reaches it. The Context7 'spike' exclusion stays because
packages/tui/spike still holds a tracked fixture.

Co-authored-by: orch-advisor <orch-advisor@openrig-build>
2026-09-29 01:44:40 -07:00
50e519b399 Run installed queue durability checks alongside PR test suites (#117)
* ci: add installed baton scenario and regression control to PR tests

* ci: retain healthy return after the durability fault control

* Bind seeded failure to queue observation and propagate pack errors

* test: repair hosted fixture drift and bound temporary IPC

* ci: record a bounded self-process probe before package suites

* test: keep hosted process and transport probes confined

---------

Co-authored-by: dev-driver <dev-driver@openrig-build>
Co-authored-by: dev-qa <dev-qa@openrig-build>
2026-09-28 22:10:45 -07:00
Wu Shuwen 0dd5a56367 fix(cli): support project scope for execution view (#105) 2026-09-28 21:34:04 -07:00
Wu Shuwen 5d3f62f17b Recognize Codex composer prompt variants (#111) 2026-09-28 21:06:12 -07:00
Mike Schwarzandv-openrig-build 61f13f64ff docs: one help guide for agents (docs/reference/help.md, rig context get help) (#113)
* docs: point agents to the OpenRig help route when OpenRig misbehaves

Add a short pointer to https://www.openrig.dev/help/agents in the
managed start guidance every seat reads, the openrig-skills index (all
three identical copies, digests regenerated) and the README 'For agents'
line. The route sends a symptom to version-matched docs and known
issues and explains how to reach the team. rig --version and rig doctor
help when available, but a broken install is not a reason to skip the
page. No new command.

* docs: one help guide for agents, served by rig context get help

Agent help now lives in one file, docs/reference/help.md. It ships with every
install, so it matches the installed version, and Context7 indexes it. A new
static context pack, help, serves the same file through `rig context get help`
by symlinking to it. The pack build copies the link's target, so installs get a
real file.

The pack generator accepts a static-pack symlink only when it points to a file
under docs/reference/. Any other link fails the build before anything is
written. Tests cover the help pack's bytes and both symlink cases.

The startup guidance, the openrig-skills index (all three copies), the
onboarding capability map, README and SUPPORT now point to `rig context get
help`, falling back to the installed file or openrig.dev/help/agents (the same
text) when `rig` won't run.

* docs(help): say contact options, not a contact form

The website's help page lists email and public Q&A; it has no contact form.

* docs(help): load linked guides on demand; correct the installed fallback path

F1: `rig context get help` served help.md alone, so its links to
getting-started, instance-layout and rig-spec had nothing to resolve against.
A new static pack, reference, symlinks exactly those three files from
docs/reference/. help.md keeps its source-relative links and adds the
`rig context get reference/<file>[#section]` address beside each, so a guide
loads only when it's needed and a help read stays small.

F2: the broken-rig fallback named docs/reference/help.md "in the installed
package". The package build copies these files to daemon/docs/reference/ in
@openrig/cli. Corrected in help.md, the startup guidance and the openrig-skills
index (all three copies, digests regenerated).

Tests: the reference pack ships real files equal to their sources; every
address help.md teaches resolves through the daemon's address route, section
and whole-file; the help preview contains none of the three manuals; a fixture
proves the address check fails on a missing target; source links and the
installed-path text match build-package.sh.

---------

Co-authored-by: v-openrig-build <[email protected]>
2026-09-28 20:59:08 -07:00
Mike Schwarzandv-openrig-build 95c6c9126c chore: remove the internal .evidence folder from the repository (#118)
.evidence held 23 internal build receipts (test runs, spec drafts, fix-round
notes, 156 KB) committed during 0.5.4 work on 2026-08-26. Nothing in the
product or package uses them. Remove the folder, ignore it at the repo root,
and drop its now-unneeded Context7 exclude.

Co-authored-by: v-openrig-build <[email protected]>
2026-09-28 20:04:36 -07:00
Mike Schwarzandv-openrig-build ea52fa8f83 fix(specs): add frontmatter to the shipped vault-user skill (#115)
* fix(specs): give the vault-user skill the frontmatter every shipped skill needs (OPR.0.6.1.6)

vault-user/SKILL.md was the only shipped SKILL.md without a name/description
frontmatter block, so it failed the daemon's own parseSkillFrontmatter
contract and external skill syncers rejected it. Adds name + description and
leaves the body byte-identical.

Adds a regression check that runs parseSkillFrontmatter over every SKILL.md
under packages/daemon/specs and packages/daemon/assets, the two skill roots
scripts/build-package.sh copies into the npm artifact.

* test(daemon): correct the shipped-skill check's context-packs scope note (OPR.0.6.1.6)

The projection's default source is packages/daemon/specs/agents/shared/skills,
already inside the checked specs root. Manifest validation is not SKILL.md
frontmatter validation. Comment only; test behavior unchanged.

---------

Co-authored-by: v-openrig-build <[email protected]>
2026-09-28 19:21:34 -07:00
276 changed files with 8535 additions and 3527 deletions

No files matched your search

@@ -1,4 +0,0 @@
A/B DISCRIMINATOR — full-suite failures are PRE-EXISTING at base
candidate (be23eb200 + S1): 18 files / 29 tests failed, 7825 passed
pristine base be23eb200: 18 files / 29 tests failed (identical set, run 05:26Z)
delta: 0 regressions
-27
View File
@@ -1,27 +0,0 @@
S2 CLI TERMINAL CAPTURES — built CLI (worktree dist) against a stub serving the route-test-proven payload shapes. env-less = no OPENRIG_SESSION_NAME.
$ rig send dev-impl@my-rig 'hello' (env-less single send):
Sent to dev-impl@my-rig
Advisory: Delivered without sender identity: this request carried no X-OpenRig-Session header, so your recipient has no way of knowing who sent it. Follow up and sign it — send from a seat shell (the header stamps automatically) or state your identity in the message body.
$ rig send --to dev-impl@my-rig,dev-qa@my-rig 'hello team' (env-less fan-out):
dev-impl@my-rig: sent
dev-qa@my-rig: sent
2/2 delivered
Advisory: Delivered without sender identity: this request carried no X-OpenRig-Session header, so your recipient has no way of knowing who sent it. Follow up and sign it — send from a seat shell (the header stamps automatically) or state your identity in the message body.
$ rig broadcast --rig my-rig 'hello all' (env-less broadcast):
Error: Daemon did not respond — it may be busy or stopped (state not confirmed).
This command needs a responsive daemon; the outcome of proceeding would be indeterminate.
Re-check with 'rig daemon status'. If it is confirmed stopped, run 'rig up' or 'rig daemon start'.
$ attributed single send (OPENRIG_SESSION_NAME set) — no nag:
Sent to dev-impl@my-rig
NOTE on the broadcast capture: `rig broadcast` runs a daemon-liveness preflight
(StatusDeps state-file check) before any HTTP, which a bare stub cannot satisfy —
the refusal above is that preflight, unrelated to S2. The broadcast RENDERER's
terminal output is proven by the focused test "broadcast renderer surfaces the
unknown-sender notice from the response warning" (broadcast.test.ts, captureLogs
asserts the Advisory line on non-JSON output), and the renderer code path is
byte-shared with the fan-out renderer captured live above.
-2
View File
@@ -1,2 +0,0 @@
14c99a2bae7e79b213191233e19768fb37ae56fd97dbd55cb9ad709989b75077 /Users/admin/.openrig-build-vm-2d5beac5/workspace/missions/release-0.5.4/slices/06-delivery-honesty/SPEC.md
fca29b492ac7bee26fc02a3a2aa5285ab74f9f8c2b94ace2287b7d6b29501a0a /Users/admin/.openrig-build-vm-2d5beac5/workspace/missions/release-0.5.4/slices/06-delivery-honesty/IMPLEMENTATION-PRD.md
-27
View File
@@ -1,27 +0,0 @@
ERROR TEXT — ACTUAL EMITTED SPECIMENS (captured by running the real
SessionTransport over the real TmuxAdapter with injected exec failures;
harness: test/zz-scratch-capture-specimens.test.ts, run once and deleted)
send / no-server:
reason: tmux_unavailable
error: The tmux server could not be reached (no server running on /private/tmp/tmux-501/default). Whether session 'dev-impl@my-rig' exists was not determined. No text was sent.
send / socket-gone:
reason: tmux_unavailable
error: The tmux server could not be reached (error connecting to /private/tmp/tmux-501/default (No such file or directory)). Whether session 'dev-impl@my-rig' exists was not determined. No text was sent.
send / genuine absence:
reason: session_missing
error: Session 'dev-impl@my-rig' not found: tmux reports no session with this name. No text was sent. Check available sessions with: rig ps --nodes
send / permission-denied (unexpected probe failure):
reason: tmux_unavailable
error: The tmux session probe failed unexpectedly (permission denied). Whether session 'dev-impl@my-rig' exists was not determined. No text was sent.
capture / no-server:
reason: tmux_unavailable
error: The tmux server could not be reached (no server running on /private/tmp/tmux-501/default). Whether session 'dev-impl@my-rig' exists was not determined. Nothing was captured.
capture / genuine absence:
reason: session_missing
error: Session 'dev-impl@my-rig' not found: tmux reports no session with this name. Nothing was captured. Check available sessions with: rig ps --nodes
-38
View File
@@ -1,38 +0,0 @@
S3 round-3 live JSON inspection — built CLI, one consumed + one staged-unresolved recipient (raw transport sent:2):
{
"total": 2,
"sent": 1,
"failed": 1,
"results": [
{
"ok": false,
"sessionName": "staged-session",
"verified": false,
"outcome": "staged-not-consumed",
"error": "staged, not consumed (pane effect); the one guarded submit did not clear it"
},
{
"ok": true,
"sessionName": "consumed-session"
}
],
"effectChecks": [
{
"sessionName": "staged-session",
"effect": {
"checked": true,
"state": "staged",
"remedy": "submitted-still-staged"
}
},
{
"sessionName": "consumed-session",
"effect": {
"checked": true,
"state": "no-staged-residual"
}
}
]
}
exit: 0
-49
View File
@@ -1,49 +0,0 @@
---
id: OPR.0.5.4.6
slice: 06-delivery-honesty
mission: release-0.5.4
status: intent
stage: wip
created: 2026-08-26
---
<!-- ELASTIC MIDDLE (three-capture-points doctrine): the SDLC fixes exactly
three capture points — intent → proportional structured requirement →
proof. Everything between is ELASTIC. For a small slice the
mini-requirements below may BE the whole PRD; add depth only where the
work demands it. The scaffold must not mint ceremony.
Conventions SSOT: docs/reference/sdlc-conventions.md (installed: $OPENRIG_HOME/reference/sdlc-conventions.md) -->
# Slice 06 — S3 — Delivery Honesty End-to-End
## Intent
[The recorded intent, verbatim — kept in sync with the slice README.]
## Mini-requirements
1. [The concise one-glance requirement tier — this is where approval starts.]
## Proof contract
[MIRRORED 2026-08-26 by the workspace author (dev-planner, desk hygiene row 2ff03ab2), per
the standing mirror rule (slice-06/0.5.3 precedent): SPEC.md is CANONICAL; the proof-pairing
tool reads THIS file's exact `## Proof contract` section, so the SPEC promises are mirrored
ITEM-EXACT below — this banner is the only permitted delta. Divergence in the items is a
defect — fix it, never pick a winner silently.]
- [ ] STAGED-UNSENT DETECTED BY EFFECT: a send whose text lands AT the prompt (staged, not
consumed) is reported as such by `send --verify` — RED-first against the current bytes
(today "sent" is reported), GREEN after, with the discriminating evidence being pane
effect, not a transport return.
- [ ] CONSUMED MEANS CONSUMED: a genuinely consumed send verifies positively; the two
outcomes are never interchangeable and the staged report names what was checked.
- [ ] NO DOUBLE DELIVERY: the staged remedy is the submit path (the single Enter), proven to
deliver exactly once; a blind re-send is never the product's suggestion.
- [ ] INTERIM LORE RETIRED: the seat-discipline note ("staged-at-prompt, fix is one Enter")
is demonstrated unnecessary by the product's own report; retirement recorded in the
guidance that taught it, cited by path.
## Notes (elastic)
[Design, seams, risks, sequencing — only as much as the slice needs.]
-130
View File
@@ -1,130 +0,0 @@
RUN v3.2.4 /private/tmp/s2-base-red/packages/cli
❯ test/broadcast.test.ts (9 tests | 1 failed) 116ms
× Broadcast CLI > broadcast renderer surfaces the unknown-sender notice from the response warning 53ms
→ expected 'dev-impl@warn-rig: sent\ndev-qa@warn-…' to contain 'Advisory:'
✓ Broadcast CLI > broadcast --rig prints per-target summary 14ms
✓ Broadcast CLI > broadcast without --rig/--pod sends globally 4ms
✓ Broadcast CLI > broadcast --context resolves a ref and fans out the whole content 29ms
✓ Broadcast CLI > broadcast --context ABORTS (no fan-out) when the pack has a missing member 3ms
✓ Broadcast CLI > P21: cross-host broadcast CARRIES the enveloped marker (was dropped → remote rendered raw); value = the seat, but the daemon derives the From: from the auto-stamped X-OpenRig-Session 1ms
✓ Broadcast CLI > P18: an env-less cross-host broadcast DELIVERS with the honest `<unknown sender>` marker on the wire 0ms
✓ Broadcast CLI > broadcast --json prints raw JSON 2ms
✓ Broadcast CLI > broadcast exits nonzero when no targets resolve 6ms
remote okstderr | test/send.test.ts > Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped)
Warning: RIGGED_URL is deprecated; use OPENRIG_URL instead.
❯ test/send.test.ts (59 tests | 1 failed) 585ms
✓ Send CLI > send prints success output 25ms
✓ Send CLI > P18: an env-less send DELIVERS with an honest `<unknown sender>` label — dispatched, actorSession null 13ms
✓ Send CLI > P18: a resolvable seat SENDS with its attributed identity — actorSession derived from the seat env, never forged 46ms
✓ Send CLI > P18 canonicity: '<unknown sender>' is DEFINED at EXACTLY the two named twin sites — a third fails BY NAME 296ms
✓ Send CLI > send with 409 mid-work prints error and exits non-zero 3ms
✓ Send CLI > prints the Advisory on an unknown-proceed send (human output) 2ms
✓ Send CLI > carries the advisory as `warning` in --json output 1ms
✓ Send CLI > verify confirmed prints Delivery: delivered AND the legacy Verified: yes 1ms
✓ Send CLI > verify redraw-race prints Delivery: rendered-unconfirmed (landed, with capture guidance) AND legacy Verified: no 1ms
✓ Send CLI > verify genuine transport failure stays an error path, distinct from the middle (discriminator) 9ms
✓ Send CLI > verify --json passes the additive outcome field through 2ms
✓ Send CLI > send --json prints raw JSON 3ms
✓ Send CLI > send --wait-for-idle posts waitForIdleMs and extends request timeout 3ms
✓ Send CLI > send without wait-for-idle uses default client timeout path 0ms
✓ Send CLI > send --context resolves a ref to its whole content and sends it (single-seat local) 1ms
✓ Send CLI > send --context ABORTS (no send) when the pack has a missing/unreadable member 0ms
✓ Send CLI > send rejects invalid wait-for-idle values before contacting daemon 0ms
✓ Send CLI > send rejects wait-for-idle with force before contacting daemon 0ms
✓ Send CLI > send --raw posts the exact text without the From/To envelope 1ms
✓ Send CLI > default send (no --raw) wraps the From/To messaging envelope 1ms
✓ Send CLI > send --from <origin> is IGNORED — From:/actor derive from the ambient transport identity, not --from 1ms
✓ Send CLI > send --dangerously-interact --reason posts the override fields with raw (exact) text 1ms
✓ Send CLI > send --dangerously-interact without --reason is rejected before contacting the daemon 0ms
✓ Send CLI > send --dangerously-interact + --wait-for-idle is rejected before contacting the daemon 0ms
✓ Send CLI > send --host forwards --raw/--dangerously-interact/--reason in the reconstructed remote argv 5ms
✓ Send CLI > send --context rejects the agent@rig@host sugar cross-host form (NO message) — never reaches remote argv 1ms
✓ Send CLI > send --context rejects the sugar cross-host form (WITH message) — context not silently dropped 0ms
✓ Send CLI > send --to a,b fans out to /broadcast with a sessions list and prints per-recipient summary 17ms
✓ Send CLI > send --to accepts repetition (--to a --to b) and sets the daemon-side envelopeSender 16ms
✓ Send CLI > send --pod posts a pod target to /broadcast 1ms
✓ Send CLI > send --rig posts a rig target to /broadcast 1ms
✓ Send CLI > fan-out with one recipient failing prints which failed, the summary, and exits nonzero 1ms
× Send CLI > fan-out renderer surfaces the unknown-sender notice from the response warning 8ms
→ expected 'dev-impl@my-rig: sent\ndev-qa@my-rig:…' to contain 'Advisory:'
✓ Send CLI > fan-out --raw sends bare exact text with NO envelopeSender (no per-recipient wrap) 99ms
✓ Send CLI > fan-out --dangerously-interact --reason plumbs the danger fields (bare text, no envelope) 1ms
✓ Send CLI > rejects combining a bare seat with a fan-out flag 0ms
✓ Send CLI > rejects more than one fan-out mode at once 0ms
✓ Send CLI > rejects --wait-for-idle with a multi/pod/rig target 0ms
✓ Send CLI > single-seat send is UNCHANGED — still posts to /send, byte-identical envelope, no /broadcast 1ms
✓ Send CLI > send --help includes rediscovery examples + the new guard flags 1ms
✓ Send CLI > send --help documents proceed-with-advisory on unknown telemetry, not fail-closed 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R1 RED: single-seat + OPENRIG_URL custom port + probe-stopped -> actual POST lands, exact env target passed to clientFactory 4ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R2 RED: fan-out --to + OPENRIG_URL + probe-stopped -> actual /broadcast lands with per-recipient results 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R4 RED: precedence — OPENRIG_URL wins over RIGGED_URL on the transport-authoritative path 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R5 RED: RUNNING-but-UNHEALTHY (event-loop-starved healthz body) must still send (single-seat + fan-out) 2ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6 RED: NO env + live-pid state file (custom port) + healthz probe failing -> POST attempted against the state-derived target 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6b RED: NO env + NO daemon state + probe-stopped -> POST attempted against the configured DEFAULT target (injected client succeeds) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6c RED: NO env + NO state + probe-stopped + ConfigStore CUSTOM daemon host/port -> POST attempted against the CONFIGURED-FILE target exactly (no hardcoded default) 2ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7 RED: REAL down fails honestly — actual connection error names the target; the bare preflight restart line never appears 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7b RED: fan-out REAL down fails honestly too — target-specific connection error, exit 1, no restart line, and the same remediation as single-seat 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7c RED: single-seat --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7d RED: fan-out --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7e: single-seat HUMAN transport failure keeps stdout empty (mirror of R7c) — the 3 remediation lines are stderr-only, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7f: fan-out HUMAN transport failure keeps stdout empty (mirror of R7d) — stderr-only remediation, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8: explicit OPENRIG_URL (single-seat) -> exact target POSTed + EXACTLY ONE self-id /healthz GET, no status-probe burn 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8b RED: explicit OPENRIG_URL (fan-out) -> exact target broadcast and ZERO lifecycle probe calls 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > --from is IGNORED in fan-out — BOTH envelopeSender and actorSession name the ambient transport identity, never the forged --from origin 3ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > F2 GREEN-characterization: with NO --from, fan-out still falls back to ambient identity (the flag is additive, not a behavior change) 1ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/broadcast.test.ts > Broadcast CLI > broadcast renderer surfaces the unknown-sender notice from the response warning
AssertionError: expected 'dev-impl@warn-rig: sent\ndev-qa@warn-…' to contain 'Advisory:'
- Expected
+ Received
- Advisory:
+ dev-impl@warn-rig: sent
+ dev-qa@warn-rig: sent
+ 2/2 delivered
❯ test/broadcast.test.ts:119:20
117| const output = logs.join("\n");
118| expect(output).toContain("dev-impl@warn-rig: sent");
119| expect(output).toContain("Advisory:");
| ^
120| expect(output).toMatch(/no way of knowing who sent/i);
121| expect(output).toMatch(/sign/i);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯
FAIL test/send.test.ts > Send CLI > fan-out renderer surfaces the unknown-sender notice from the response warning
AssertionError: expected 'dev-impl@my-rig: sent\ndev-qa@my-rig:…' to contain 'Advisory:'
- Expected
+ Received
- Advisory:
+ dev-impl@my-rig: sent
+ dev-qa@my-rig: sent
+ 2/2 delivered
❯ test/send.test.ts:642:20
640| const output = logs.join("\n");
641| expect(output).toContain("dev-impl@my-rig: sent");
642| expect(output).toContain("Advisory:");
| ^
643| expect(output).toMatch(/no way of knowing who sent/i);
644| expect(output).toMatch(/sign/i);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯
Test Files 2 failed (2)
Tests 2 failed | 66 passed (68)
Start at 06:39:38
Duration 1.48s (transform 412ms, setup 142ms, collect 1.06s, tests 700ms, environment 0ms, prepare 116ms)
vitest exit: 1
-177
View File
@@ -1,177 +0,0 @@
RUN v3.2.4 /private/tmp/s2-base-red/packages/daemon
❯ test/transport-routes.test.ts (43 tests | 6 failed) 7529ms
✓ transport routes > POST /send with valid session returns 200 with SendResult 243ms
✓ transport routes > A3 — a DERIVED send auto-records exactly ONE outbox row (sender=derived actor, provenance=transport:v1) 212ms
✓ transport routes > A3 — a cross-host send records the ORIGIN triple (the derived header), never the relay's seat 224ms
✓ transport routes > A3 — a send whose body actor differs is DELIVERED, and the outbox row carries the HEADER identity 211ms
✓ transport routes > L5 A3 — header TRIPLE + body PAIR delivers, and records the WIRE identity (not the body claim) 225ms
✓ transport routes > L5 A3 — a body claim naming a DIFFERENT actor is SUPERSEDED, never trusted, and never refuses 214ms
✓ transport routes > A3 — a header-LESS send (no derived actor) auto-records NO row (nothing to attribute; no fabricated sender) 211ms
✓ transport routes > A3b — a broadcast auto-records N rows, one per RESOLVED recipient (sender=derived, provenance=transport:v1, destination=each session, never the TargetSpec) 418ms
✓ transport routes > A3b — a PARTIAL fan-out records per-row delivery_state (delivered vs failed) — the truth one row could not express 215ms
✓ transport routes > A3b — a broadcast whose body actor differs is DELIVERED, and every row carries the HEADER identity 446ms
✓ transport routes > A3b — a header-LESS broadcast auto-records NO rows (no derived sender to attribute) 461ms
✓ transport routes > POST /send with verify surfaces the outcome field in the JSON response (passthrough) 714ms
✓ transport routes > POST /send verify failure stays HTTP-error-distinct from the middle outcome (discriminator) 220ms
✓ transport routes > POST /send to a mid-work pane returns 200 and DELIVERS with a non-blocking advisory (OPR.0.4.3.28 fast-follow — mid_work downgraded) 210ms
✓ transport routes > POST /send to an interactive prompt returns 409 target_needs_input (default, no override) 8ms
✓ transport routes > POST /send rejects --dangerously-interact + --wait-for-idle with 400 8ms
✓ transport routes > POST /send rejects --dangerously-interact without a reason with 400 8ms
✓ transport routes > POST /send with waitForIdleMs waits for idle and returns activity evidence 10ms
✓ transport routes > POST /send rejects force with waitForIdleMs before sending 8ms
✓ transport routes > POST /send maps wait timeout to 409 without sending text 10ms
✓ transport routes > POST /send with ambiguous session returns 409 8ms
✓ transport routes > POST /send to external_cli target returns 409 with honest transport guidance 8ms
✓ transport routes > POST /capture with rig targeting returns multi-session results 10ms
✓ transport routes > POST /capture with rig targeting includes external_cli targets as explicit failures 9ms
✓ transport routes > POST /capture for external_cli target returns 409 with honest transport guidance 11ms
✓ transport routes > POST /broadcast without rig/pod broadcasts globally to all running sessions 414ms
✓ transport routes > POST /broadcast with partial failure returns honest per-target outcomes 212ms
✓ transport routes > POST /broadcast with a sessions list renders the FULL recipient list on every To (anti-storm, B1) 412ms
✓ transport routes > POST /broadcast WITHOUT envelopeSender delivers raw text to all (rig broadcast unchanged) 414ms
✓ transport routes > POST /broadcast with an unknown seat in the list rejects honestly, naming the seat 8ms
✓ transport routes > POST /broadcast list: one recipient failing does NOT abort the others (independence) 210ms
✓ transport routes > POST /broadcast list keeps per-recipient send guard semantics for unknown telemetry and picker refusal 212ms
✓ transport routes > POST /broadcast plumbs danger/reason/actorSession to EACH recipient send (per-seat, not per-batch) 416ms
✓ transport routes > POST /broadcast includes external_cli targets as explicit transport_unavailable failures 10ms
✓ transport routes > P21 I4: the From: line derives from the transport header, IGNORING a forged body.envelopeSender (specimen-5 kill) 210ms
× transport routes > P21 I4 → S2: an enveloped send with NO authenticated identity DELIVERS as unknown (still never renders an unverified From:) 15ms
→ expected 401 to be 200 // Object.is equality
× transport routes > P21 I4 → S2: --dangerously-interact with NO identity delivers; a non-needs_input target writes NO override audit row 9ms
→ expected 401 to be 200 // Object.is equality
✓ transport routes > P21 I4: a body actorSession that DIFFERS from the header is SUPERSEDED (no identity_mismatch refusal) 210ms
× transport routes > S2 — unknown-sender honesty (OPR.0.5.4.3) > PROOF-1: enveloped broadcast with no header DELIVERS, From: is the unknown marker, hostile body claim never renders, notice in payload 8ms
→ expected 401 to be 200 // Object.is equality
× transport routes > S2 — unknown-sender honesty (OPR.0.5.4.3) > PROOF-2: send --dangerously-interact with no header proceeds on a STAGED needs_input prompt; the audit row carries actorSession NULL 8ms
→ expected 401 to be 200 // Object.is equality
× transport routes > S2 — unknown-sender honesty (OPR.0.5.4.3) > PROOF-2b: broadcast --dangerously-interact with no header proceeds; per-seat audit actorSession NULL 8ms
→ expected 401 to be 200 // Object.is equality
× transport routes > S2 — unknown-sender honesty (OPR.0.5.4.3) > PROOF-4a: a plain unattributed send delivers BYTE-VERBATIM (no recipient-side marker) plus the response notice 212ms
→ expected '' to match /sign/i
✓ transport routes > S2 — unknown-sender honesty (OPR.0.5.4.3) > PROOF-4b: an attributed send's response carries no nag and delivers verbatim 216ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 6 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/transport-routes.test.ts > transport routes > P21 I4 → S2: an enveloped send with NO authenticated identity DELIVERS as unknown (still never renders an unverified From:)
AssertionError: expected 401 to be 200 // Object.is equality
- Expected
+ Received
- 200
+ 401
❯ test/transport-routes.test.ts:870:24
868| // S2 (OPR.0.5.4.3, founder descope): delivery replaces the refusa…
869| // specimen-5 invariant is UNCHANGED — the body claim never render…
870| expect(res.status).toBe(200);
| ^
871| expect(delivered.some((t) => t.includes("From: <unknown sender>"))…
872| expect(delivered.every((t) => !t.includes("anyone@my-rig"))).toBe(…
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/6]⎯
FAIL test/transport-routes.test.ts > transport routes > P21 I4 → S2: --dangerously-interact with NO identity delivers; a non-needs_input target writes NO override audit row
AssertionError: expected 401 to be 200 // Object.is equality
- Expected
+ Received
- 200
+ 401
❯ test/transport-routes.test.ts:887:24
885| // send path; the override audit exists only on the needs_input br…
886| // no row is written here — unchanged posture, now unattributed-to…
887| expect(res.status).toBe(200);
| ^
888| const rows = db.prepare("SELECT * FROM events WHERE type = 'transp…
889| expect(rows).toHaveLength(0);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/6]⎯
FAIL test/transport-routes.test.ts > transport routes > S2 — unknown-sender honesty (OPR.0.5.4.3) > PROOF-1: enveloped broadcast with no header DELIVERS, From: is the unknown marker, hostile body claim never renders, notice in payload
AssertionError: expected 401 to be 200 // Object.is equality
- Expected
+ Received
- 200
+ 401
❯ test/transport-routes.test.ts:949:26
947| body: JSON.stringify({ sessions: ["dev-impl@my-rig", "dev-qa@m…
948| });
949| expect(res.status).toBe(200); // RED at pre-fix bytes: 401 unatt…
| ^
950| const data = (await res.json()) as Record<string, unknown>;
951| expect(data["sent"]).toBe(2);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/6]⎯
FAIL test/transport-routes.test.ts > transport routes > S2 — unknown-sender honesty (OPR.0.5.4.3) > PROOF-2: send --dangerously-interact with no header proceeds on a STAGED needs_input prompt; the audit row carries actorSession NULL
AssertionError: expected 401 to be 200 // Object.is equality
- Expected
+ Received
- 200
+ 401
❯ test/transport-routes.test.ts:979:26
977| body: JSON.stringify({ session: "dev-impl@my-rig", text: "1", …
978| });
979| expect(res.status).toBe(200); // RED at pre-fix bytes: 401 unatt…
| ^
980| const rows = overrideAuditRows();
981| expect(rows).toHaveLength(1);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/6]⎯
FAIL test/transport-routes.test.ts > transport routes > S2 — unknown-sender honesty (OPR.0.5.4.3) > PROOF-2b: broadcast --dangerously-interact with no header proceeds; per-seat audit actorSession NULL
AssertionError: expected 401 to be 200 // Object.is equality
- Expected
+ Received
- 200
+ 401
❯ test/transport-routes.test.ts:994:26
992| body: JSON.stringify({ sessions: ["dev-impl@my-rig"], text: "1…
993| });
994| expect(res.status).toBe(200); // RED at pre-fix bytes: 401 unatt…
| ^
995| const rows = overrideAuditRows();
996| expect(rows).toHaveLength(1);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/6]⎯
FAIL test/transport-routes.test.ts > transport routes > S2 — unknown-sender honesty (OPR.0.5.4.3) > PROOF-4a: a plain unattributed send delivers BYTE-VERBATIM (no recipient-side marker) plus the response notice
AssertionError: expected '' to match /sign/i
- Expected:
/sign/i
+ Received:
""
❯ test/transport-routes.test.ts:1011:45
1009| expect(sentTexts[0]!.text).toBe("exact bytes ✓ --- é"); // raw s…
1010| const data = (await res.json()) as Record<string, unknown>;
1011| expect(String(data["warning"] ?? "")).toMatch(/sign/i); // RED a…
| ^
1012| expect(String(data["warning"] ?? "")).toMatch(/no way of knowing…
1013| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/6]⎯
Test Files 1 failed (1)
Tests 6 failed | 37 passed (43)
Start at 06:39:27
Duration 9.82s (transform 1.22s, setup 0ms, collect 1.91s, tests 7.53s, environment 0ms, prepare 95ms)
vitest exit: 1
-213
View File
@@ -1,213 +0,0 @@
RUN v3.2.4 /private/tmp/s3-delivery-honesty/packages/cli
remote okstderr | test/send.test.ts > Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped)
Warning: RIGGED_URL is deprecated; use OPENRIG_URL instead.
❯ test/send.test.ts (65 tests | 3 failed) 333ms
✓ Send CLI > send prints success output 14ms
✓ Send CLI > P18: an env-less send DELIVERS with an honest `<unknown sender>` label — dispatched, actorSession null 3ms
✓ Send CLI > P18: a resolvable seat SENDS with its attributed identity — actorSession derived from the seat env, never forged 2ms
✓ Send CLI > P18 canonicity: '<unknown sender>' is DEFINED at EXACTLY the two named twin sites — a third fails BY NAME 247ms
✓ Send CLI > send with 409 mid-work prints error and exits non-zero 2ms
✓ Send CLI > prints the Advisory on an unknown-proceed send (human output) 2ms
✓ Send CLI > carries the advisory as `warning` in --json output 1ms
✓ Send CLI > verify confirmed prints Delivery: delivered AND the legacy Verified: yes 2ms
✓ Send CLI > verify redraw-race prints Delivery: rendered-unconfirmed (landed, with capture guidance) AND legacy Verified: no 3ms
✓ Send CLI > verify genuine transport failure stays an error path, distinct from the middle (discriminator) 2ms
✓ Send CLI > verify --json passes the additive outcome field through 1ms
✓ Send CLI > send --json prints raw JSON 1ms
✓ Send CLI > send --wait-for-idle posts waitForIdleMs and extends request timeout 1ms
✓ Send CLI > send without wait-for-idle uses default client timeout path 1ms
✓ Send CLI > send --context resolves a ref to its whole content and sends it (single-seat local) 1ms
✓ Send CLI > send --context ABORTS (no send) when the pack has a missing/unreadable member 0ms
✓ Send CLI > send rejects invalid wait-for-idle values before contacting daemon 0ms
✓ Send CLI > send rejects wait-for-idle with force before contacting daemon 0ms
✓ Send CLI > send --raw posts the exact text without the From/To envelope 1ms
✓ Send CLI > default send (no --raw) wraps the From/To messaging envelope 1ms
✓ Send CLI > send --from <origin> is IGNORED — From:/actor derive from the ambient transport identity, not --from 1ms
✓ Send CLI > send --dangerously-interact --reason posts the override fields with raw (exact) text 1ms
✓ Send CLI > send --dangerously-interact without --reason is rejected before contacting the daemon 0ms
✓ Send CLI > send --dangerously-interact + --wait-for-idle is rejected before contacting the daemon 0ms
✓ Send CLI > send --host forwards --raw/--dangerously-interact/--reason in the reconstructed remote argv 1ms
✓ Send CLI > send --context rejects the agent@rig@host sugar cross-host form (NO message) — never reaches remote argv 0ms
✓ Send CLI > send --context rejects the sugar cross-host form (WITH message) — context not silently dropped 0ms
✓ Send CLI > send --to a,b fans out to /broadcast with a sessions list and prints per-recipient summary 1ms
✓ Send CLI > send --to accepts repetition (--to a --to b) and sets the daemon-side envelopeSender 1ms
✓ Send CLI > send --pod posts a pod target to /broadcast 1ms
✓ Send CLI > send --rig posts a rig target to /broadcast 1ms
✓ Send CLI > fan-out with one recipient failing prints which failed, the summary, and exits nonzero 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-1: a send whose text sits AT the prompt is reported STAGED — by pane effect, not the transport's verified:true 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-2: a genuinely consumed send verifies positively and is NEVER reported staged 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-3: the staged remedy is the single submit path — exactly one plain-text send, no blind re-send suggested or performed 2ms
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F3: a stale pasted-text placeholder in SCROLLBACK is NOT staged evidence — no staged report, no guarded submit fired 6ms
→ expected 'Sent to stale-scroll-session\nVerifie…' not to match /staged/i
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: --json with --verify carries the effect classification in the envelope (staged case) 3ms
→ expected undefined to be defined
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: fan-out with --verify reports per-recipient effect — staged named, consumed never claimed staged 3ms
→ expected 0 to be greater than 0
✓ Send CLI > fan-out renderer surfaces the unknown-sender notice from the response warning 1ms
✓ Send CLI > fan-out --raw sends bare exact text with NO envelopeSender (no per-recipient wrap) 1ms
✓ Send CLI > fan-out --dangerously-interact --reason plumbs the danger fields (bare text, no envelope) 1ms
✓ Send CLI > rejects combining a bare seat with a fan-out flag 0ms
✓ Send CLI > rejects more than one fan-out mode at once 0ms
✓ Send CLI > rejects --wait-for-idle with a multi/pod/rig target 0ms
✓ Send CLI > single-seat send is UNCHANGED — still posts to /send, byte-identical envelope, no /broadcast 1ms
✓ Send CLI > send --help includes rediscovery examples + the new guard flags 1ms
✓ Send CLI > send --help documents proceed-with-advisory on unknown telemetry, not fail-closed 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R1 RED: single-seat + OPENRIG_URL custom port + probe-stopped -> actual POST lands, exact env target passed to clientFactory 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R2 RED: fan-out --to + OPENRIG_URL + probe-stopped -> actual /broadcast lands with per-recipient results 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R4 RED: precedence — OPENRIG_URL wins over RIGGED_URL on the transport-authoritative path 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R5 RED: RUNNING-but-UNHEALTHY (event-loop-starved healthz body) must still send (single-seat + fan-out) 2ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6 RED: NO env + live-pid state file (custom port) + healthz probe failing -> POST attempted against the state-derived target 4ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6b RED: NO env + NO daemon state + probe-stopped -> POST attempted against the configured DEFAULT target (injected client succeeds) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6c RED: NO env + NO state + probe-stopped + ConfigStore CUSTOM daemon host/port -> POST attempted against the CONFIGURED-FILE target exactly (no hardcoded default) 3ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7 RED: REAL down fails honestly — actual connection error names the target; the bare preflight restart line never appears 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7b RED: fan-out REAL down fails honestly too — target-specific connection error, exit 1, no restart line, and the same remediation as single-seat 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7c RED: single-seat --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7d RED: fan-out --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7e: single-seat HUMAN transport failure keeps stdout empty (mirror of R7c) — the 3 remediation lines are stderr-only, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7f: fan-out HUMAN transport failure keeps stdout empty (mirror of R7d) — stderr-only remediation, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8: explicit OPENRIG_URL (single-seat) -> exact target POSTed + EXACTLY ONE self-id /healthz GET, no status-probe burn 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8b RED: explicit OPENRIG_URL (fan-out) -> exact target broadcast and ZERO lifecycle probe calls 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > --from is IGNORED in fan-out — BOTH envelopeSender and actorSession name the ambient transport identity, never the forged --from origin 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > F2 GREEN-characterization: with NO --from, fan-out still falls back to ambient identity (the flag is additive, not a behavior change) 1ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 3 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F3: a stale pasted-text placeholder in SCROLLBACK is NOT staged evidence — no staged report, no guarded submit fired
AssertionError: expected 'Sent to stale-scroll-session\nVerifie…' not to match /staged/i
- Expected:
/staged/i
+ Received:
"Sent to stale-scroll-session
Verified: no
Delivery: staged, not consumed (checked: post-send pane capture; observed: the sent text is still at the prompt — typed, never submitted)
Remedy: one guarded Enter submitted, but the text is STILL at the prompt — not consumed; stopping here (one submit is the contract). Inspect with: rig capture stale-scroll-session"
❯ test/send.test.ts:714:26
712| });
713| const output = logs.join("\n");
714| expect(output).not.toMatch(/staged/i);
| ^
715| // and the submit path must never fire on history
716| expect(sendBodies.filter((b) => b["submitOnly"])).toHaveLength(0…
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: --json with --verify carries the effect classification in the envelope (staged case)
AssertionError: expected undefined to be defined
❯ test/send.test.ts:726:22
724| const envelope = JSON.parse(logs.find((l) => l.trim().startsWith…
725| const effect = envelope["effectCheck"] as Record<string, unknown…
726| expect(effect).toBeDefined();
| ^
727| expect(effect!["state"]).toBe("staged");
728| expect(exitCode).toBe(1); // staged-not-cleared is not a silent …
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/3]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: fan-out with --verify reports per-recipient effect — staged named, consumed never claimed staged
AssertionError: expected 0 to be greater than 0
❯ test/send.test.ts:741:40
739| const lines = logs.join("\n").split("\n");
740| const stagedEffectLines = lines.filter((l) => l.includes("staged…
741| expect(stagedEffectLines.length).toBeGreaterThan(0); // RED pre-…
| ^
742| const consumedEffectClaims = lines.filter((l) => l.includes("con…
743| expect(consumedEffectClaims).toHaveLength(0);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/3]⎯
Test Files 1 failed (1)
Tests 3 failed | 62 passed (65)
Start at 07:34:31
Duration 861ms (transform 172ms, setup 44ms, collect 214ms, tests 333ms, environment 0ms, prepare 88ms)
vitest exit: 1
RUN v3.2.4 /private/tmp/s3-delivery-honesty/packages/cli
remote pane
❯ test/cross-host-http.test.ts (44 tests | 1 failed) 37527ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > plain 2-part target: untouched, no sugar, no hint, registry never loaded 1ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > 3-part with REGISTERED suffix: host-qualified — target stripped, host extracted 0ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > 3-part with UNREGISTERED suffix: passes through UNCHANGED with the loud hint 0ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > registry load failure: passthrough + hint (a plain-target failure mode is never added) 0ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > --host X + sugar @Y, X≠Y: structured conflict 0ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > --host X + sugar @X (same host twice): fine 0ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > adopted/raw 4-part-ish names keep working: only the LAST @ segment is a host candidate 0ms
✓ send --host (http branch) > http host: POSTs the LOCAL body shape (wrapped envelope) to /api/transport/send; ssh runner never invoked; BR-1: session stays 2-part 1622ms
× send --host (http branch) > http host + --verify: reports the effect check as UNCHECKED (transport-level verdict only), never a silent effect claim 1622ms
→ expected '[via host=vps-b (http://vps-b:7433)]\…' to match /unchecked/i
✓ send --host (http branch) > --raw skips the envelope: exact text passthrough 1635ms
✓ send --host (http branch) > anonymous (URL-only) http host: POSTs with NO Authorization header; still succeeds 1633ms
✓ send --host (http branch) > sugar target dev-impl@my-rig@vps-b routes http with the STRIPPED session 1623ms
✓ send --host (http branch) > --host conflict with a DIFFERENT sugar host: structured error, zero remote calls 815ms
✓ send --host (http branch) > persisted selection drives the http branch when no --host and no sugar 1618ms
✓ send --host (http branch) > explicit --host beats the persisted selection 1618ms
✓ send --host (http branch) > sugar beats the persisted selection 1620ms
✓ send --host (http branch) > --verify prints the REMOTE verdict verbatim (remote-authoritative, never locally synthesized) 1614ms
✓ send --host (http branch) > --verify with no remote verdict field prints Verified: no (no local invention) 1617ms
✓ send --host (http branch) > remote advisory (unknown actorSession) surfaces as the non-blocking Advisory line 1654ms
✓ send --host (http branch) > G8 auth seam: a 401 surfaces as the structured permission-gate step with the remote's own error text 1612ms
✓ send --host (http branch) > network failure surfaces as remote-daemon-unreachable, host named, never a hang 1616ms
✓ send --host (http branch) > --wait-for-idle sizes the http deadline: waitForIdleMs + overhead 1623ms
✓ send --host (http branch) > fan-out×host guard kept verbatim: --host + --rig rejected before any call 0ms
✓ send --host (http branch) > unknown --host: structured unknown-host with the sugar hint appended when the target was 3-part-shaped 810ms
✓ send --host (http branch) > json envelope: cross_host {host, target, transport:http} + the raw result 1614ms
✓ capture --host (http branch) > http host: POSTs the LOCAL body shape to /api/transport/capture and renders the single result under the banner 806ms
✓ capture --host (http branch) > anonymous (URL-only) http host: capture POSTs with NO Authorization header; still succeeds 817ms
✓ capture --host (http branch) > multi-target (--rig/--pod) rides the http branch with per-target rendering 927ms
✓ capture --host (http branch) > sugar target routes http with the stripped session (BR-1) 845ms
✓ capture --host (http branch) > ssh host still takes the ssh shell-out (branch selection) 2ms
✓ transcript --host (net-new, CLI-direct GET) > tail: GETs the exact local route path against the remote and renders origin shape verbatim 810ms
✓ transcript --host (net-new, CLI-direct GET) > grep: GETs the grep route and renders matches 811ms
✓ transcript --host (net-new, CLI-direct GET) > ssh host: the structured transport-requirement error (http-only verb, never silent) 0ms
✓ transcript --host (net-new, CLI-direct GET) > unknown host: the same unknown-host step class as the other verbs 0ms
✓ transcript --host (net-new, CLI-direct GET) > selection-driven cross-host works for the net-new verb too 829ms
✓ transcript --host (net-new, CLI-direct GET) > arch n2: the transcript read is UNGATED — it SUCCEEDS under the exact wrong-terminal-bearer scenario that permission-gates send 2466ms
✓ broadcast --host (net-new, CLI-direct POST) > http host: POSTs the LOCAL body verbatim; per-target results print verbatim; clean fan-out exits 0 813ms
✓ broadcast --host (net-new, CLI-direct POST) > partial fan-out: per-target honesty verbatim + NON-ZERO exit (never summarized clean) 810ms
✓ broadcast --host (net-new, CLI-direct POST) > names its OWN fan-out budget at the call site (not the read-class default) 811ms
✓ broadcast --host (net-new, CLI-direct POST) > the text positional is NEVER sugar-parsed: a message containing a@b@vps-b broadcasts locally intact when no host is set 0ms
✓ broadcast --host (net-new, CLI-direct POST) > ssh host: structured transport-requirement error (http-only verb) 0ms
✓ broadcast --host (net-new, CLI-direct POST) > selection-driven cross-host broadcast 807ms
✓ broadcast --host (net-new, CLI-direct POST) > PIN 1 (money) — broadcast --host stamps the ORIGIN triple on X-OpenRig-Session (remote renders the origin, not the destination) 3ms
✓ broadcast --host (net-new, CLI-direct POST) > PIN 5 (fail-open) — local selfHostId unavailable ⇒ 2-part header, broadcast still ships 0ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/cross-host-http.test.ts > send --host (http branch) > http host + --verify: reports the effect check as UNCHECKED (transport-level verdict only), never a silent effect claim
AssertionError: expected '[via host=vps-b (http://vps-b:7433)]\…' to match /unchecked/i
- Expected:
/unchecked/i
+ Received:
"[via host=vps-b (http://vps-b:7433)]
Sent to dev-impl@my-rig
Verified: yes
Delivery: delivered (message landed; render confirmed)"
❯ test/cross-host-http.test.ts:220:17
218| const out = captured.stdoutLines.join("\n");
219| expect(out).toContain("Verified: yes"); // the remote transport ve…
220| expect(out).toMatch(/unchecked/i); // and honestly labeled as effe…
| ^
221| expect(out).toMatch(/transport-level only|not verifiable from this…
222| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
Test Files 1 failed (1)
Tests 1 failed | 43 passed (44)
Start at 07:34:32
Duration 37.93s (transform 150ms, setup 28ms, collect 194ms, tests 37.53s, environment 0ms, prepare 43ms)
vitest exit(xhost): 1
@@ -1,200 +0,0 @@
RUN v3.2.4 /private/tmp/s3fix-base-red/packages/cli
remote okstderr | test/send.test.ts > Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped)
Warning: RIGGED_URL is deprecated; use OPENRIG_URL instead.
❯ test/send.test.ts (65 tests | 3 failed) 379ms
✓ Send CLI > send prints success output 18ms
✓ Send CLI > P18: an env-less send DELIVERS with an honest `<unknown sender>` label — dispatched, actorSession null 32ms
✓ Send CLI > P18: a resolvable seat SENDS with its attributed identity — actorSession derived from the seat env, never forged 2ms
✓ Send CLI > P18 canonicity: '<unknown sender>' is DEFINED at EXACTLY the two named twin sites — a third fails BY NAME 271ms
✓ Send CLI > send with 409 mid-work prints error and exits non-zero 2ms
✓ Send CLI > prints the Advisory on an unknown-proceed send (human output) 2ms
✓ Send CLI > carries the advisory as `warning` in --json output 1ms
✓ Send CLI > verify confirmed prints Delivery: delivered AND the legacy Verified: yes 2ms
✓ Send CLI > verify redraw-race prints Delivery: rendered-unconfirmed (landed, with capture guidance) AND legacy Verified: no 3ms
✓ Send CLI > verify genuine transport failure stays an error path, distinct from the middle (discriminator) 1ms
✓ Send CLI > verify --json passes the additive outcome field through 1ms
✓ Send CLI > send --json prints raw JSON 1ms
✓ Send CLI > send --wait-for-idle posts waitForIdleMs and extends request timeout 1ms
✓ Send CLI > send without wait-for-idle uses default client timeout path 0ms
✓ Send CLI > send --context resolves a ref to its whole content and sends it (single-seat local) 1ms
✓ Send CLI > send --context ABORTS (no send) when the pack has a missing/unreadable member 0ms
✓ Send CLI > send rejects invalid wait-for-idle values before contacting daemon 0ms
✓ Send CLI > send rejects wait-for-idle with force before contacting daemon 0ms
✓ Send CLI > send --raw posts the exact text without the From/To envelope 1ms
✓ Send CLI > default send (no --raw) wraps the From/To messaging envelope 1ms
✓ Send CLI > send --from <origin> is IGNORED — From:/actor derive from the ambient transport identity, not --from 1ms
✓ Send CLI > send --dangerously-interact --reason posts the override fields with raw (exact) text 1ms
✓ Send CLI > send --dangerously-interact without --reason is rejected before contacting the daemon 0ms
✓ Send CLI > send --dangerously-interact + --wait-for-idle is rejected before contacting the daemon 0ms
✓ Send CLI > send --host forwards --raw/--dangerously-interact/--reason in the reconstructed remote argv 1ms
✓ Send CLI > send --context rejects the agent@rig@host sugar cross-host form (NO message) — never reaches remote argv 1ms
✓ Send CLI > send --context rejects the sugar cross-host form (WITH message) — context not silently dropped 0ms
✓ Send CLI > send --to a,b fans out to /broadcast with a sessions list and prints per-recipient summary 1ms
✓ Send CLI > send --to accepts repetition (--to a --to b) and sets the daemon-side envelopeSender 1ms
✓ Send CLI > send --pod posts a pod target to /broadcast 1ms
✓ Send CLI > send --rig posts a rig target to /broadcast 1ms
✓ Send CLI > fan-out with one recipient failing prints which failed, the summary, and exits nonzero 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-1: a send whose text sits AT the prompt is reported STAGED — by pane effect, not the transport's verified:true 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-2: a genuinely consumed send verifies positively and is NEVER reported staged 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-3: the staged remedy is the single submit path — exactly one plain-text send, no blind re-send suggested or performed 1ms
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F3: a stale pasted-text placeholder in SCROLLBACK is NOT staged evidence — no staged report, no guarded submit fired 5ms
→ expected 'Sent to stale-scroll-session\nVerifie…' not to match /staged/i
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: --json with --verify carries the effect classification in the envelope (staged case) 2ms
→ expected undefined to be defined
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: fan-out with --verify reports per-recipient effect — staged named, consumed never claimed staged 1ms
→ expected 0 to be greater than 0
✓ Send CLI > fan-out renderer surfaces the unknown-sender notice from the response warning 1ms
✓ Send CLI > fan-out --raw sends bare exact text with NO envelopeSender (no per-recipient wrap) 1ms
✓ Send CLI > fan-out --dangerously-interact --reason plumbs the danger fields (bare text, no envelope) 1ms
✓ Send CLI > rejects combining a bare seat with a fan-out flag 0ms
✓ Send CLI > rejects more than one fan-out mode at once 0ms
✓ Send CLI > rejects --wait-for-idle with a multi/pod/rig target 0ms
✓ Send CLI > single-seat send is UNCHANGED — still posts to /send, byte-identical envelope, no /broadcast 1ms
✓ Send CLI > send --help includes rediscovery examples + the new guard flags 1ms
✓ Send CLI > send --help documents proceed-with-advisory on unknown telemetry, not fail-closed 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R1 RED: single-seat + OPENRIG_URL custom port + probe-stopped -> actual POST lands, exact env target passed to clientFactory 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R2 RED: fan-out --to + OPENRIG_URL + probe-stopped -> actual /broadcast lands with per-recipient results 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R4 RED: precedence — OPENRIG_URL wins over RIGGED_URL on the transport-authoritative path 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R5 RED: RUNNING-but-UNHEALTHY (event-loop-starved healthz body) must still send (single-seat + fan-out) 2ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6 RED: NO env + live-pid state file (custom port) + healthz probe failing -> POST attempted against the state-derived target 2ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6b RED: NO env + NO daemon state + probe-stopped -> POST attempted against the configured DEFAULT target (injected client succeeds) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6c RED: NO env + NO state + probe-stopped + ConfigStore CUSTOM daemon host/port -> POST attempted against the CONFIGURED-FILE target exactly (no hardcoded default) 2ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7 RED: REAL down fails honestly — actual connection error names the target; the bare preflight restart line never appears 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7b RED: fan-out REAL down fails honestly too — target-specific connection error, exit 1, no restart line, and the same remediation as single-seat 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7c RED: single-seat --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7d RED: fan-out --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7e: single-seat HUMAN transport failure keeps stdout empty (mirror of R7c) — the 3 remediation lines are stderr-only, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7f: fan-out HUMAN transport failure keeps stdout empty (mirror of R7d) — stderr-only remediation, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8: explicit OPENRIG_URL (single-seat) -> exact target POSTed + EXACTLY ONE self-id /healthz GET, no status-probe burn 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8b RED: explicit OPENRIG_URL (fan-out) -> exact target broadcast and ZERO lifecycle probe calls 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > --from is IGNORED in fan-out — BOTH envelopeSender and actorSession name the ambient transport identity, never the forged --from origin 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > F2 GREEN-characterization: with NO --from, fan-out still falls back to ambient identity (the flag is additive, not a behavior change) 1ms
remote pane
❯ test/cross-host-http.test.ts (44 tests | 1 failed) 37427ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > plain 2-part target: untouched, no sugar, no hint, registry never loaded 1ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > 3-part with REGISTERED suffix: host-qualified — target stripped, host extracted 0ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > 3-part with UNREGISTERED suffix: passes through UNCHANGED with the loud hint 0ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > registry load failure: passthrough + hint (a plain-target failure mode is never added) 0ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > --host X + sugar @Y, X≠Y: structured conflict 0ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > --host X + sugar @X (same host twice): fine 0ms
✓ resolveCrossHostTarget (§4 sugar + precedence) > adopted/raw 4-part-ish names keep working: only the LAST @ segment is a host candidate 0ms
✓ send --host (http branch) > http host: POSTs the LOCAL body shape (wrapped envelope) to /api/transport/send; ssh runner never invoked; BR-1: session stays 2-part 1649ms
× send --host (http branch) > http host + --verify: reports the effect check as UNCHECKED (transport-level verdict only), never a silent effect claim 1624ms
→ expected '[via host=vps-b (http://vps-b:7433)]\…' to match /unchecked/i
✓ send --host (http branch) > --raw skips the envelope: exact text passthrough 1625ms
✓ send --host (http branch) > anonymous (URL-only) http host: POSTs with NO Authorization header; still succeeds 1616ms
✓ send --host (http branch) > sugar target dev-impl@my-rig@vps-b routes http with the STRIPPED session 1619ms
✓ send --host (http branch) > --host conflict with a DIFFERENT sugar host: structured error, zero remote calls 810ms
✓ send --host (http branch) > persisted selection drives the http branch when no --host and no sugar 1621ms
✓ send --host (http branch) > explicit --host beats the persisted selection 1641ms
✓ send --host (http branch) > sugar beats the persisted selection 1640ms
✓ send --host (http branch) > --verify prints the REMOTE verdict verbatim (remote-authoritative, never locally synthesized) 1639ms
✓ send --host (http branch) > --verify with no remote verdict field prints Verified: no (no local invention) 1616ms
✓ send --host (http branch) > remote advisory (unknown actorSession) surfaces as the non-blocking Advisory line 1618ms
✓ send --host (http branch) > G8 auth seam: a 401 surfaces as the structured permission-gate step with the remote's own error text 1625ms
✓ send --host (http branch) > network failure surfaces as remote-daemon-unreachable, host named, never a hang 1623ms
✓ send --host (http branch) > --wait-for-idle sizes the http deadline: waitForIdleMs + overhead 1635ms
✓ send --host (http branch) > fan-out×host guard kept verbatim: --host + --rig rejected before any call 0ms
✓ send --host (http branch) > unknown --host: structured unknown-host with the sugar hint appended when the target was 3-part-shaped 811ms
✓ send --host (http branch) > json envelope: cross_host {host, target, transport:http} + the raw result 1613ms
✓ capture --host (http branch) > http host: POSTs the LOCAL body shape to /api/transport/capture and renders the single result under the banner 811ms
✓ capture --host (http branch) > anonymous (URL-only) http host: capture POSTs with NO Authorization header; still succeeds 811ms
✓ capture --host (http branch) > multi-target (--rig/--pod) rides the http branch with per-target rendering 811ms
✓ capture --host (http branch) > sugar target routes http with the stripped session (BR-1) 822ms
✓ capture --host (http branch) > ssh host still takes the ssh shell-out (branch selection) 1ms
✓ transcript --host (net-new, CLI-direct GET) > tail: GETs the exact local route path against the remote and renders origin shape verbatim 809ms
✓ transcript --host (net-new, CLI-direct GET) > grep: GETs the grep route and renders matches 812ms
✓ transcript --host (net-new, CLI-direct GET) > ssh host: the structured transport-requirement error (http-only verb, never silent) 0ms
✓ transcript --host (net-new, CLI-direct GET) > unknown host: the same unknown-host step class as the other verbs 0ms
✓ transcript --host (net-new, CLI-direct GET) > selection-driven cross-host works for the net-new verb too 812ms
✓ transcript --host (net-new, CLI-direct GET) > arch n2: the transcript read is UNGATED — it SUCCEEDS under the exact wrong-terminal-bearer scenario that permission-gates send 2439ms
✓ broadcast --host (net-new, CLI-direct POST) > http host: POSTs the LOCAL body verbatim; per-target results print verbatim; clean fan-out exits 0 812ms
✓ broadcast --host (net-new, CLI-direct POST) > partial fan-out: per-target honesty verbatim + NON-ZERO exit (never summarized clean) 809ms
✓ broadcast --host (net-new, CLI-direct POST) > names its OWN fan-out budget at the call site (not the read-class default) 809ms
✓ broadcast --host (net-new, CLI-direct POST) > the text positional is NEVER sugar-parsed: a message containing a@b@vps-b broadcasts locally intact when no host is set 0ms
✓ broadcast --host (net-new, CLI-direct POST) > ssh host: structured transport-requirement error (http-only verb) 0ms
✓ broadcast --host (net-new, CLI-direct POST) > selection-driven cross-host broadcast 815ms
✓ broadcast --host (net-new, CLI-direct POST) > PIN 1 (money) — broadcast --host stamps the ORIGIN triple on X-OpenRig-Session (remote renders the origin, not the destination) 22ms
✓ broadcast --host (net-new, CLI-direct POST) > PIN 5 (fail-open) — local selfHostId unavailable ⇒ 2-part header, broadcast still ships 1ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/cross-host-http.test.ts > send --host (http branch) > http host + --verify: reports the effect check as UNCHECKED (transport-level verdict only), never a silent effect claim
AssertionError: expected '[via host=vps-b (http://vps-b:7433)]\…' to match /unchecked/i
- Expected:
/unchecked/i
+ Received:
"[via host=vps-b (http://vps-b:7433)]
Sent to dev-impl@my-rig
Verified: yes
Delivery: delivered (message landed; render confirmed)"
❯ test/cross-host-http.test.ts:220:17
218| const out = captured.stdoutLines.join("\n");
219| expect(out).toContain("Verified: yes"); // the remote transport ve…
220| expect(out).toMatch(/unchecked/i); // and honestly labeled as effe…
| ^
221| expect(out).toMatch(/transport-level only|not verifiable from this…
222| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F3: a stale pasted-text placeholder in SCROLLBACK is NOT staged evidence — no staged report, no guarded submit fired
AssertionError: expected 'Sent to stale-scroll-session\nVerifie…' not to match /staged/i
- Expected:
/staged/i
+ Received:
"Sent to stale-scroll-session
Verified: no
Delivery: staged, not consumed (checked: post-send pane capture; observed: the sent text is still at the prompt — typed, never submitted)
Remedy: one guarded Enter submitted, but the text is STILL at the prompt — not consumed; stopping here (one submit is the contract). Inspect with: rig capture stale-scroll-session"
❯ test/send.test.ts:714:26
712| });
713| const output = logs.join("\n");
714| expect(output).not.toMatch(/staged/i);
| ^
715| // and the submit path must never fire on history
716| expect(sendBodies.filter((b) => b["submitOnly"])).toHaveLength(0…
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: --json with --verify carries the effect classification in the envelope (staged case)
AssertionError: expected undefined to be defined
❯ test/send.test.ts:726:22
724| const envelope = JSON.parse(logs.find((l) => l.trim().startsWith…
725| const effect = envelope["effectCheck"] as Record<string, unknown…
726| expect(effect).toBeDefined();
| ^
727| expect(effect!["state"]).toBe("staged");
728| expect(exitCode).toBe(1); // staged-not-cleared is not a silent …
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: fan-out with --verify reports per-recipient effect — staged named, consumed never claimed staged
AssertionError: expected 0 to be greater than 0
❯ test/send.test.ts:741:40
739| const lines = logs.join("\n").split("\n");
740| const stagedEffectLines = lines.filter((l) => l.includes("staged…
741| expect(stagedEffectLines.length).toBeGreaterThan(0); // RED pre-…
| ^
742| const consumedEffectClaims = lines.filter((l) => l.includes("con…
743| expect(consumedEffectClaims).toHaveLength(0);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯
Test Files 2 failed (2)
Tests 4 failed | 105 passed (109)
Start at 07:39:43
Duration 37.79s (transform 172ms, setup 59ms, collect 367ms, tests 37.81s, environment 0ms, prepare 76ms)
vitest exit: 1
-162
View File
@@ -1,162 +0,0 @@
RUN v3.2.4 /private/tmp/s3-delivery-honesty/packages/cli
remote okstderr | test/send.test.ts > Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped)
Warning: RIGGED_URL is deprecated; use OPENRIG_URL instead.
❯ test/send.test.ts (69 tests | 4 failed) 312ms
✓ Send CLI > send prints success output 13ms
✓ Send CLI > P18: an env-less send DELIVERS with an honest `<unknown sender>` label — dispatched, actorSession null 3ms
✓ Send CLI > P18: a resolvable seat SENDS with its attributed identity — actorSession derived from the seat env, never forged 2ms
✓ Send CLI > P18 canonicity: '<unknown sender>' is DEFINED at EXACTLY the two named twin sites — a third fails BY NAME 211ms
✓ Send CLI > send with 409 mid-work prints error and exits non-zero 2ms
✓ Send CLI > prints the Advisory on an unknown-proceed send (human output) 2ms
✓ Send CLI > carries the advisory as `warning` in --json output 2ms
✓ Send CLI > verify confirmed prints Delivery: delivered AND the legacy Verified: yes 2ms
✓ Send CLI > verify redraw-race prints Delivery: rendered-unconfirmed (landed, with capture guidance) AND legacy Verified: no 3ms
✓ Send CLI > verify genuine transport failure stays an error path, distinct from the middle (discriminator) 1ms
✓ Send CLI > verify --json passes the additive outcome field through 1ms
✓ Send CLI > send --json prints raw JSON 1ms
✓ Send CLI > send --wait-for-idle posts waitForIdleMs and extends request timeout 1ms
✓ Send CLI > send without wait-for-idle uses default client timeout path 0ms
✓ Send CLI > send --context resolves a ref to its whole content and sends it (single-seat local) 1ms
✓ Send CLI > send --context ABORTS (no send) when the pack has a missing/unreadable member 0ms
✓ Send CLI > send rejects invalid wait-for-idle values before contacting daemon 0ms
✓ Send CLI > send rejects wait-for-idle with force before contacting daemon 0ms
✓ Send CLI > send --raw posts the exact text without the From/To envelope 1ms
✓ Send CLI > default send (no --raw) wraps the From/To messaging envelope 1ms
✓ Send CLI > send --from <origin> is IGNORED — From:/actor derive from the ambient transport identity, not --from 2ms
✓ Send CLI > send --dangerously-interact --reason posts the override fields with raw (exact) text 2ms
✓ Send CLI > send --dangerously-interact without --reason is rejected before contacting the daemon 0ms
✓ Send CLI > send --dangerously-interact + --wait-for-idle is rejected before contacting the daemon 0ms
✓ Send CLI > send --host forwards --raw/--dangerously-interact/--reason in the reconstructed remote argv 1ms
✓ Send CLI > send --context rejects the agent@rig@host sugar cross-host form (NO message) — never reaches remote argv 0ms
✓ Send CLI > send --context rejects the sugar cross-host form (WITH message) — context not silently dropped 0ms
✓ Send CLI > send --to a,b fans out to /broadcast with a sessions list and prints per-recipient summary 2ms
✓ Send CLI > send --to accepts repetition (--to a --to b) and sets the daemon-side envelopeSender 7ms
✓ Send CLI > send --pod posts a pod target to /broadcast 2ms
✓ Send CLI > send --rig posts a rig target to /broadcast 1ms
✓ Send CLI > fan-out with one recipient failing prints which failed, the summary, and exits nonzero 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-1: a send whose text sits AT the prompt is reported STAGED — by pane effect, not the transport's verified:true 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-2: a genuinely consumed send verifies positively and is NEVER reported staged 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-3: the staged remedy is the single submit path — exactly one plain-text send, no blind re-send suggested or performed 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F3: a stale pasted-text placeholder in SCROLLBACK is NOT staged evidence — no staged report, no guarded submit fired 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: --json with --verify carries the effect classification in the envelope (staged case) 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: fan-out with --verify reports per-recipient effect — staged named, consumed never claimed staged 3ms
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 human: a staged-unresolved recipient gets NO sent line and is NOT counted delivered — one verdict only 6ms
→ expected true to be false // Object.is equality
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json: the same recipient can never be simultaneously delivered and staged-not-consumed in the envelope 2ms
→ expected true to be false // Object.is equality
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json single-send: a staged-unresolved envelope carries no delivered claim beside the staged effect 2ms
→ expected true not to be true // Object.is equality
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F2: an unrelated size-mismatched placeholder is UNVERIFIABLE — never staged-as-this-send, never a guarded submit 2ms
→ expected 'Sent to unrelated-paste-session\nVeri…' not to match /staged, not consumed/i
✓ Send CLI > fan-out renderer surfaces the unknown-sender notice from the response warning 1ms
✓ Send CLI > fan-out --raw sends bare exact text with NO envelopeSender (no per-recipient wrap) 1ms
✓ Send CLI > fan-out --dangerously-interact --reason plumbs the danger fields (bare text, no envelope) 1ms
✓ Send CLI > rejects combining a bare seat with a fan-out flag 0ms
✓ Send CLI > rejects more than one fan-out mode at once 0ms
✓ Send CLI > rejects --wait-for-idle with a multi/pod/rig target 0ms
✓ Send CLI > single-seat send is UNCHANGED — still posts to /send, byte-identical envelope, no /broadcast 3ms
✓ Send CLI > send --help includes rediscovery examples + the new guard flags 1ms
✓ Send CLI > send --help documents proceed-with-advisory on unknown telemetry, not fail-closed 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R1 RED: single-seat + OPENRIG_URL custom port + probe-stopped -> actual POST lands, exact env target passed to clientFactory 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R2 RED: fan-out --to + OPENRIG_URL + probe-stopped -> actual /broadcast lands with per-recipient results 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R4 RED: precedence — OPENRIG_URL wins over RIGGED_URL on the transport-authoritative path 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R5 RED: RUNNING-but-UNHEALTHY (event-loop-starved healthz body) must still send (single-seat + fan-out) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6 RED: NO env + live-pid state file (custom port) + healthz probe failing -> POST attempted against the state-derived target 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6b RED: NO env + NO daemon state + probe-stopped -> POST attempted against the configured DEFAULT target (injected client succeeds) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6c RED: NO env + NO state + probe-stopped + ConfigStore CUSTOM daemon host/port -> POST attempted against the CONFIGURED-FILE target exactly (no hardcoded default) 2ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7 RED: REAL down fails honestly — actual connection error names the target; the bare preflight restart line never appears 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7b RED: fan-out REAL down fails honestly too — target-specific connection error, exit 1, no restart line, and the same remediation as single-seat 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7c RED: single-seat --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7d RED: fan-out --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7e: single-seat HUMAN transport failure keeps stdout empty (mirror of R7c) — the 3 remediation lines are stderr-only, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7f: fan-out HUMAN transport failure keeps stdout empty (mirror of R7d) — stderr-only remediation, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8: explicit OPENRIG_URL (single-seat) -> exact target POSTed + EXACTLY ONE self-id /healthz GET, no status-probe burn 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8b RED: explicit OPENRIG_URL (fan-out) -> exact target broadcast and ZERO lifecycle probe calls 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > --from is IGNORED in fan-out — BOTH envelopeSender and actorSession name the ambient transport identity, never the forged --from origin 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > F2 GREEN-characterization: with NO --from, fan-out still falls back to ambient identity (the flag is additive, not a behavior change) 0ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 human: a staged-unresolved recipient gets NO sent line and is NOT counted delivered — one verdict only
AssertionError: expected true to be false // Object.is equality
- Expected
+ Received
- false
+ true
❯ test/send.test.ts:758:68
756| const lines = logs.join("\n").split("\n");
757| // the false lines must be ABSENT (desk-binding): no unqualified…
758| expect(lines.some((l) => /^staged-session: sent\b/.test(l))).toB…
| ^
759| expect(lines.join("\n")).toContain("1/2 delivered");
760| expect(lines.join("\n")).not.toContain("2/2 delivered");
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json: the same recipient can never be simultaneously delivered and staged-not-consumed in the envelope
AssertionError: expected true to be false // Object.is equality
- Expected
+ Received
- false
+ true
❯ test/send.test.ts:775:32
773| expect(stagedRow).toBeDefined();
774| // ONE verdict: the staged-unresolved row is not a delivery claim
775| expect(stagedRow!["ok"]).toBe(false);
| ^
776| expect(stagedRow!["outcome"]).toBe("staged-not-consumed");
777| expect(stagedRow!["verified"]).not.toBe(true);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json single-send: a staged-unresolved envelope carries no delivered claim beside the staged effect
AssertionError: expected true not to be true // Object.is equality
❯ test/send.test.ts:786:40
784| const envelope = JSON.parse(logs.find((l) => l.trim().startsWith…
785| expect((envelope["effectCheck"] as Record<string, unknown>)["sta…
786| expect(envelope["verified"]).not.toBe(true);
| ^
787| expect(envelope["outcome"]).toBe("staged-not-consumed");
788| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F2: an unrelated size-mismatched placeholder is UNVERIFIABLE — never staged-as-this-send, never a guarded submit
AssertionError: expected 'Sent to unrelated-paste-session\nVeri…' not to match /staged, not consumed/i
- Expected:
/staged, not consumed/i
+ Received:
"Sent to unrelated-paste-session
Verified: no
Delivery: staged, not consumed (checked: post-send pane capture; observed: the sent text is still at the prompt — typed, never submitted)
Remedy: one guarded Enter submitted, but the text is STILL at the prompt — not consumed; stopping here (one submit is the contract). Inspect with: rig capture unrelated-paste-session"
❯ test/send.test.ts:795:26
793| });
794| const output = logs.join("\n");
795| expect(output).not.toMatch(/staged, not consumed/i); // no stage…
| ^
796| expect(sendBodies.filter((b) => b["submitOnly"])).toHaveLength(0…
797| expect(output).toMatch(/unverifiable|not .{0,20}this send|does n…
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯
Test Files 1 failed (1)
Tests 4 failed | 65 passed (69)
Start at 07:58:12
Duration 822ms (transform 153ms, setup 30ms, collect 205ms, tests 312ms, environment 0ms, prepare 43ms)
vitest exit: 1
@@ -1,162 +0,0 @@
RUN v3.2.4 /private/tmp/s3r2-base/packages/cli
remote okstderr | test/send.test.ts > Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped)
Warning: RIGGED_URL is deprecated; use OPENRIG_URL instead.
❯ test/send.test.ts (69 tests | 4 failed) 265ms
✓ Send CLI > send prints success output 16ms
✓ Send CLI > P18: an env-less send DELIVERS with an honest `<unknown sender>` label — dispatched, actorSession null 4ms
✓ Send CLI > P18: a resolvable seat SENDS with its attributed identity — actorSession derived from the seat env, never forged 2ms
✓ Send CLI > P18 canonicity: '<unknown sender>' is DEFINED at EXACTLY the two named twin sites — a third fails BY NAME 174ms
✓ Send CLI > send with 409 mid-work prints error and exits non-zero 2ms
✓ Send CLI > prints the Advisory on an unknown-proceed send (human output) 2ms
✓ Send CLI > carries the advisory as `warning` in --json output 1ms
✓ Send CLI > verify confirmed prints Delivery: delivered AND the legacy Verified: yes 2ms
✓ Send CLI > verify redraw-race prints Delivery: rendered-unconfirmed (landed, with capture guidance) AND legacy Verified: no 3ms
✓ Send CLI > verify genuine transport failure stays an error path, distinct from the middle (discriminator) 1ms
✓ Send CLI > verify --json passes the additive outcome field through 1ms
✓ Send CLI > send --json prints raw JSON 1ms
✓ Send CLI > send --wait-for-idle posts waitForIdleMs and extends request timeout 1ms
✓ Send CLI > send without wait-for-idle uses default client timeout path 0ms
✓ Send CLI > send --context resolves a ref to its whole content and sends it (single-seat local) 1ms
✓ Send CLI > send --context ABORTS (no send) when the pack has a missing/unreadable member 0ms
✓ Send CLI > send rejects invalid wait-for-idle values before contacting daemon 0ms
✓ Send CLI > send rejects wait-for-idle with force before contacting daemon 0ms
✓ Send CLI > send --raw posts the exact text without the From/To envelope 1ms
✓ Send CLI > default send (no --raw) wraps the From/To messaging envelope 1ms
✓ Send CLI > send --from <origin> is IGNORED — From:/actor derive from the ambient transport identity, not --from 1ms
✓ Send CLI > send --dangerously-interact --reason posts the override fields with raw (exact) text 1ms
✓ Send CLI > send --dangerously-interact without --reason is rejected before contacting the daemon 0ms
✓ Send CLI > send --dangerously-interact + --wait-for-idle is rejected before contacting the daemon 0ms
✓ Send CLI > send --host forwards --raw/--dangerously-interact/--reason in the reconstructed remote argv 1ms
✓ Send CLI > send --context rejects the agent@rig@host sugar cross-host form (NO message) — never reaches remote argv 0ms
✓ Send CLI > send --context rejects the sugar cross-host form (WITH message) — context not silently dropped 0ms
✓ Send CLI > send --to a,b fans out to /broadcast with a sessions list and prints per-recipient summary 1ms
✓ Send CLI > send --to accepts repetition (--to a --to b) and sets the daemon-side envelopeSender 1ms
✓ Send CLI > send --pod posts a pod target to /broadcast 1ms
✓ Send CLI > send --rig posts a rig target to /broadcast 1ms
✓ Send CLI > fan-out with one recipient failing prints which failed, the summary, and exits nonzero 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-1: a send whose text sits AT the prompt is reported STAGED — by pane effect, not the transport's verified:true 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-2: a genuinely consumed send verifies positively and is NEVER reported staged 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-3: the staged remedy is the single submit path — exactly one plain-text send, no blind re-send suggested or performed 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F3: a stale pasted-text placeholder in SCROLLBACK is NOT staged evidence — no staged report, no guarded submit fired 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: --json with --verify carries the effect classification in the envelope (staged case) 3ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: fan-out with --verify reports per-recipient effect — staged named, consumed never claimed staged 3ms
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 human: a staged-unresolved recipient gets NO sent line and is NOT counted delivered — one verdict only 6ms
→ expected true to be false // Object.is equality
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json: the same recipient can never be simultaneously delivered and staged-not-consumed in the envelope 3ms
→ expected true to be false // Object.is equality
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json single-send: a staged-unresolved envelope carries no delivered claim beside the staged effect 2ms
→ expected true not to be true // Object.is equality
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F2: an unrelated size-mismatched placeholder is UNVERIFIABLE — never staged-as-this-send, never a guarded submit 2ms
→ expected 'Sent to unrelated-paste-session\nVeri…' not to match /staged, not consumed/i
✓ Send CLI > fan-out renderer surfaces the unknown-sender notice from the response warning 2ms
✓ Send CLI > fan-out --raw sends bare exact text with NO envelopeSender (no per-recipient wrap) 1ms
✓ Send CLI > fan-out --dangerously-interact --reason plumbs the danger fields (bare text, no envelope) 1ms
✓ Send CLI > rejects combining a bare seat with a fan-out flag 0ms
✓ Send CLI > rejects more than one fan-out mode at once 0ms
✓ Send CLI > rejects --wait-for-idle with a multi/pod/rig target 0ms
✓ Send CLI > single-seat send is UNCHANGED — still posts to /send, byte-identical envelope, no /broadcast 1ms
✓ Send CLI > send --help includes rediscovery examples + the new guard flags 1ms
✓ Send CLI > send --help documents proceed-with-advisory on unknown telemetry, not fail-closed 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R1 RED: single-seat + OPENRIG_URL custom port + probe-stopped -> actual POST lands, exact env target passed to clientFactory 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R2 RED: fan-out --to + OPENRIG_URL + probe-stopped -> actual /broadcast lands with per-recipient results 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R4 RED: precedence — OPENRIG_URL wins over RIGGED_URL on the transport-authoritative path 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R5 RED: RUNNING-but-UNHEALTHY (event-loop-starved healthz body) must still send (single-seat + fan-out) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6 RED: NO env + live-pid state file (custom port) + healthz probe failing -> POST attempted against the state-derived target 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6b RED: NO env + NO daemon state + probe-stopped -> POST attempted against the configured DEFAULT target (injected client succeeds) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6c RED: NO env + NO state + probe-stopped + ConfigStore CUSTOM daemon host/port -> POST attempted against the CONFIGURED-FILE target exactly (no hardcoded default) 2ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7 RED: REAL down fails honestly — actual connection error names the target; the bare preflight restart line never appears 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7b RED: fan-out REAL down fails honestly too — target-specific connection error, exit 1, no restart line, and the same remediation as single-seat 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7c RED: single-seat --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7d RED: fan-out --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7e: single-seat HUMAN transport failure keeps stdout empty (mirror of R7c) — the 3 remediation lines are stderr-only, exit 1 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7f: fan-out HUMAN transport failure keeps stdout empty (mirror of R7d) — stderr-only remediation, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8: explicit OPENRIG_URL (single-seat) -> exact target POSTed + EXACTLY ONE self-id /healthz GET, no status-probe burn 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8b RED: explicit OPENRIG_URL (fan-out) -> exact target broadcast and ZERO lifecycle probe calls 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > --from is IGNORED in fan-out — BOTH envelopeSender and actorSession name the ambient transport identity, never the forged --from origin 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > F2 GREEN-characterization: with NO --from, fan-out still falls back to ambient identity (the flag is additive, not a behavior change) 1ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 4 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 human: a staged-unresolved recipient gets NO sent line and is NOT counted delivered — one verdict only
AssertionError: expected true to be false // Object.is equality
- Expected
+ Received
- false
+ true
❯ test/send.test.ts:758:68
756| const lines = logs.join("\n").split("\n");
757| // the false lines must be ABSENT (desk-binding): no unqualified…
758| expect(lines.some((l) => /^staged-session: sent\b/.test(l))).toB…
| ^
759| expect(lines.join("\n")).toContain("1/2 delivered");
760| expect(lines.join("\n")).not.toContain("2/2 delivered");
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/4]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json: the same recipient can never be simultaneously delivered and staged-not-consumed in the envelope
AssertionError: expected true to be false // Object.is equality
- Expected
+ Received
- false
+ true
❯ test/send.test.ts:775:32
773| expect(stagedRow).toBeDefined();
774| // ONE verdict: the staged-unresolved row is not a delivery claim
775| expect(stagedRow!["ok"]).toBe(false);
| ^
776| expect(stagedRow!["outcome"]).toBe("staged-not-consumed");
777| expect(stagedRow!["verified"]).not.toBe(true);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/4]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json single-send: a staged-unresolved envelope carries no delivered claim beside the staged effect
AssertionError: expected true not to be true // Object.is equality
❯ test/send.test.ts:786:40
784| const envelope = JSON.parse(logs.find((l) => l.trim().startsWith…
785| expect((envelope["effectCheck"] as Record<string, unknown>)["sta…
786| expect(envelope["verified"]).not.toBe(true);
| ^
787| expect(envelope["outcome"]).toBe("staged-not-consumed");
788| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/4]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F2: an unrelated size-mismatched placeholder is UNVERIFIABLE — never staged-as-this-send, never a guarded submit
AssertionError: expected 'Sent to unrelated-paste-session\nVeri…' not to match /staged, not consumed/i
- Expected:
/staged, not consumed/i
+ Received:
"Sent to unrelated-paste-session
Verified: no
Delivery: staged, not consumed (checked: post-send pane capture; observed: the sent text is still at the prompt — typed, never submitted)
Remedy: one guarded Enter submitted, but the text is STILL at the prompt — not consumed; stopping here (one submit is the contract). Inspect with: rig capture unrelated-paste-session"
❯ test/send.test.ts:795:26
793| });
794| const output = logs.join("\n");
795| expect(output).not.toMatch(/staged, not consumed/i); // no stage…
| ^
796| expect(sendBodies.filter((b) => b["submitOnly"])).toHaveLength(0…
797| expect(output).toMatch(/unverifiable|not .{0,20}this send|does n…
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/4]⎯
Test Files 1 failed (1)
Tests 4 failed | 65 passed (69)
Start at 08:01:30
Duration 831ms (transform 283ms, setup 74ms, collect 228ms, tests 265ms, environment 0ms, prepare 103ms)
vitest exit: 1
-106
View File
@@ -1,106 +0,0 @@
RUN v3.2.4 /private/tmp/s3-delivery-honesty/packages/cli
remote okstderr | test/send.test.ts > Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped)
Warning: RIGGED_URL is deprecated; use OPENRIG_URL instead.
❯ test/send.test.ts (69 tests | 1 failed) 587ms
✓ Send CLI > send prints success output 16ms
✓ Send CLI > P18: an env-less send DELIVERS with an honest `<unknown sender>` label — dispatched, actorSession null 3ms
✓ Send CLI > P18: a resolvable seat SENDS with its attributed identity — actorSession derived from the seat env, never forged 80ms
✓ Send CLI > P18 canonicity: '<unknown sender>' is DEFINED at EXACTLY the two named twin sites — a third fails BY NAME 373ms
✓ Send CLI > send with 409 mid-work prints error and exits non-zero 2ms
✓ Send CLI > prints the Advisory on an unknown-proceed send (human output) 2ms
✓ Send CLI > carries the advisory as `warning` in --json output 1ms
✓ Send CLI > verify confirmed prints Delivery: delivered AND the legacy Verified: yes 2ms
✓ Send CLI > verify redraw-race prints Delivery: rendered-unconfirmed (landed, with capture guidance) AND legacy Verified: no 3ms
✓ Send CLI > verify genuine transport failure stays an error path, distinct from the middle (discriminator) 1ms
✓ Send CLI > verify --json passes the additive outcome field through 1ms
✓ Send CLI > send --json prints raw JSON 1ms
✓ Send CLI > send --wait-for-idle posts waitForIdleMs and extends request timeout 1ms
✓ Send CLI > send without wait-for-idle uses default client timeout path 0ms
✓ Send CLI > send --context resolves a ref to its whole content and sends it (single-seat local) 1ms
✓ Send CLI > send --context ABORTS (no send) when the pack has a missing/unreadable member 0ms
✓ Send CLI > send rejects invalid wait-for-idle values before contacting daemon 0ms
✓ Send CLI > send rejects wait-for-idle with force before contacting daemon 0ms
✓ Send CLI > send --raw posts the exact text without the From/To envelope 1ms
✓ Send CLI > default send (no --raw) wraps the From/To messaging envelope 1ms
✓ Send CLI > send --from <origin> is IGNORED — From:/actor derive from the ambient transport identity, not --from 1ms
✓ Send CLI > send --dangerously-interact --reason posts the override fields with raw (exact) text 1ms
✓ Send CLI > send --dangerously-interact without --reason is rejected before contacting the daemon 0ms
✓ Send CLI > send --dangerously-interact + --wait-for-idle is rejected before contacting the daemon 0ms
✓ Send CLI > send --host forwards --raw/--dangerously-interact/--reason in the reconstructed remote argv 1ms
✓ Send CLI > send --context rejects the agent@rig@host sugar cross-host form (NO message) — never reaches remote argv 1ms
✓ Send CLI > send --context rejects the sugar cross-host form (WITH message) — context not silently dropped 0ms
✓ Send CLI > send --to a,b fans out to /broadcast with a sessions list and prints per-recipient summary 1ms
✓ Send CLI > send --to accepts repetition (--to a --to b) and sets the daemon-side envelopeSender 1ms
✓ Send CLI > send --pod posts a pod target to /broadcast 1ms
✓ Send CLI > send --rig posts a rig target to /broadcast 2ms
✓ Send CLI > fan-out with one recipient failing prints which failed, the summary, and exits nonzero 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-1: a send whose text sits AT the prompt is reported STAGED — by pane effect, not the transport's verified:true 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-2: a genuinely consumed send verifies positively and is NEVER reported staged 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-3: the staged remedy is the single submit path — exactly one plain-text send, no blind re-send suggested or performed 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F3: a stale pasted-text placeholder in SCROLLBACK is NOT staged evidence — no staged report, no guarded submit fired 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: --json with --verify carries the effect classification in the envelope (staged case) 3ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: fan-out with --verify reports per-recipient effect — staged named, consumed never claimed staged 3ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 human: a staged-unresolved recipient gets NO sent line and is NOT counted delivered — one verdict only 2ms
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json: the same recipient can never be simultaneously delivered and staged-not-consumed in the envelope 6ms
→ expected 2 to be 1 // Object.is equality
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json single-send: a staged-unresolved envelope carries no delivered claim beside the staged effect 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F2: an unrelated size-mismatched placeholder is UNVERIFIABLE — never staged-as-this-send, never a guarded submit 1ms
✓ Send CLI > fan-out renderer surfaces the unknown-sender notice from the response warning 1ms
✓ Send CLI > fan-out --raw sends bare exact text with NO envelopeSender (no per-recipient wrap) 2ms
✓ Send CLI > fan-out --dangerously-interact --reason plumbs the danger fields (bare text, no envelope) 1ms
✓ Send CLI > rejects combining a bare seat with a fan-out flag 0ms
✓ Send CLI > rejects more than one fan-out mode at once 0ms
✓ Send CLI > rejects --wait-for-idle with a multi/pod/rig target 0ms
✓ Send CLI > single-seat send is UNCHANGED — still posts to /send, byte-identical envelope, no /broadcast 1ms
✓ Send CLI > send --help includes rediscovery examples + the new guard flags 1ms
✓ Send CLI > send --help documents proceed-with-advisory on unknown telemetry, not fail-closed 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R1 RED: single-seat + OPENRIG_URL custom port + probe-stopped -> actual POST lands, exact env target passed to clientFactory 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R2 RED: fan-out --to + OPENRIG_URL + probe-stopped -> actual /broadcast lands with per-recipient results 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R4 RED: precedence — OPENRIG_URL wins over RIGGED_URL on the transport-authoritative path 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R5 RED: RUNNING-but-UNHEALTHY (event-loop-starved healthz body) must still send (single-seat + fan-out) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6 RED: NO env + live-pid state file (custom port) + healthz probe failing -> POST attempted against the state-derived target 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6b RED: NO env + NO daemon state + probe-stopped -> POST attempted against the configured DEFAULT target (injected client succeeds) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6c RED: NO env + NO state + probe-stopped + ConfigStore CUSTOM daemon host/port -> POST attempted against the CONFIGURED-FILE target exactly (no hardcoded default) 2ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7 RED: REAL down fails honestly — actual connection error names the target; the bare preflight restart line never appears 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7b RED: fan-out REAL down fails honestly too — target-specific connection error, exit 1, no restart line, and the same remediation as single-seat 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7c RED: single-seat --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7d RED: fan-out --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7e: single-seat HUMAN transport failure keeps stdout empty (mirror of R7c) — the 3 remediation lines are stderr-only, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7f: fan-out HUMAN transport failure keeps stdout empty (mirror of R7d) — stderr-only remediation, exit 1 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8: explicit OPENRIG_URL (single-seat) -> exact target POSTed + EXACTLY ONE self-id /healthz GET, no status-probe burn 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8b RED: explicit OPENRIG_URL (fan-out) -> exact target broadcast and ZERO lifecycle probe calls 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > --from is IGNORED in fan-out — BOTH envelopeSender and actorSession name the ambient transport identity, never the forged --from origin 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > F2 GREEN-characterization: with NO --from, fan-out still falls back to ambient identity (the flag is additive, not a behavior change) 1ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json: the same recipient can never be simultaneously delivered and staged-not-consumed in the envelope
AssertionError: expected 2 to be 1 // Object.is equality
- Expected
+ Received
- 1
+ 2
❯ test/send.test.ts:780:32
778| // Round-3 (r2 row 00fb3a68): the AGGREGATE is derived from the …
779| // encoded outcomes — a staged-unresolved recipient is never cou…
780| expect(envelope["sent"]).toBe(1); // RED at 57b69e405: raw trans…
| ^
781| expect(envelope["failed"]).toBe(1);
782| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
Test Files 1 failed (1)
Tests 1 failed | 68 passed (69)
Start at 08:10:58
Duration 1.19s (transform 238ms, setup 36ms, collect 385ms, tests 587ms, environment 0ms, prepare 44ms)
vitest exit: 1
@@ -1,106 +0,0 @@
RUN v3.2.4 /private/tmp/s3r3-base/packages/cli
remote okstderr | test/send.test.ts > Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped)
Warning: RIGGED_URL is deprecated; use OPENRIG_URL instead.
❯ test/send.test.ts (69 tests | 1 failed) 184ms
✓ Send CLI > send prints success output 14ms
✓ Send CLI > P18: an env-less send DELIVERS with an honest `<unknown sender>` label — dispatched, actorSession null 2ms
✓ Send CLI > P18: a resolvable seat SENDS with its attributed identity — actorSession derived from the seat env, never forged 2ms
✓ Send CLI > P18 canonicity: '<unknown sender>' is DEFINED at EXACTLY the two named twin sites — a third fails BY NAME 91ms
✓ Send CLI > send with 409 mid-work prints error and exits non-zero 2ms
✓ Send CLI > prints the Advisory on an unknown-proceed send (human output) 2ms
✓ Send CLI > carries the advisory as `warning` in --json output 1ms
✓ Send CLI > verify confirmed prints Delivery: delivered AND the legacy Verified: yes 3ms
✓ Send CLI > verify redraw-race prints Delivery: rendered-unconfirmed (landed, with capture guidance) AND legacy Verified: no 4ms
✓ Send CLI > verify genuine transport failure stays an error path, distinct from the middle (discriminator) 1ms
✓ Send CLI > verify --json passes the additive outcome field through 3ms
✓ Send CLI > send --json prints raw JSON 1ms
✓ Send CLI > send --wait-for-idle posts waitForIdleMs and extends request timeout 1ms
✓ Send CLI > send without wait-for-idle uses default client timeout path 0ms
✓ Send CLI > send --context resolves a ref to its whole content and sends it (single-seat local) 1ms
✓ Send CLI > send --context ABORTS (no send) when the pack has a missing/unreadable member 0ms
✓ Send CLI > send rejects invalid wait-for-idle values before contacting daemon 0ms
✓ Send CLI > send rejects wait-for-idle with force before contacting daemon 0ms
✓ Send CLI > send --raw posts the exact text without the From/To envelope 1ms
✓ Send CLI > default send (no --raw) wraps the From/To messaging envelope 1ms
✓ Send CLI > send --from <origin> is IGNORED — From:/actor derive from the ambient transport identity, not --from 1ms
✓ Send CLI > send --dangerously-interact --reason posts the override fields with raw (exact) text 1ms
✓ Send CLI > send --dangerously-interact without --reason is rejected before contacting the daemon 0ms
✓ Send CLI > send --dangerously-interact + --wait-for-idle is rejected before contacting the daemon 0ms
✓ Send CLI > send --host forwards --raw/--dangerously-interact/--reason in the reconstructed remote argv 1ms
✓ Send CLI > send --context rejects the agent@rig@host sugar cross-host form (NO message) — never reaches remote argv 0ms
✓ Send CLI > send --context rejects the sugar cross-host form (WITH message) — context not silently dropped 0ms
✓ Send CLI > send --to a,b fans out to /broadcast with a sessions list and prints per-recipient summary 1ms
✓ Send CLI > send --to accepts repetition (--to a --to b) and sets the daemon-side envelopeSender 1ms
✓ Send CLI > send --pod posts a pod target to /broadcast 1ms
✓ Send CLI > send --rig posts a rig target to /broadcast 1ms
✓ Send CLI > fan-out with one recipient failing prints which failed, the summary, and exits nonzero 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-1: a send whose text sits AT the prompt is reported STAGED — by pane effect, not the transport's verified:true 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-2: a genuinely consumed send verifies positively and is NEVER reported staged 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-3: the staged remedy is the single submit path — exactly one plain-text send, no blind re-send suggested or performed 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F3: a stale pasted-text placeholder in SCROLLBACK is NOT staged evidence — no staged report, no guarded submit fired 1ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: --json with --verify carries the effect classification in the envelope (staged case) 3ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > F2: fan-out with --verify reports per-recipient effect — staged named, consumed never claimed staged 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 human: a staged-unresolved recipient gets NO sent line and is NOT counted delivered — one verdict only 2ms
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json: the same recipient can never be simultaneously delivered and staged-not-consumed in the envelope 6ms
→ expected 2 to be 1 // Object.is equality
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json single-send: a staged-unresolved envelope carries no delivered claim beside the staged effect 2ms
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F2: an unrelated size-mismatched placeholder is UNVERIFIABLE — never staged-as-this-send, never a guarded submit 1ms
✓ Send CLI > fan-out renderer surfaces the unknown-sender notice from the response warning 1ms
✓ Send CLI > fan-out --raw sends bare exact text with NO envelopeSender (no per-recipient wrap) 2ms
✓ Send CLI > fan-out --dangerously-interact --reason plumbs the danger fields (bare text, no envelope) 1ms
✓ Send CLI > rejects combining a bare seat with a fan-out flag 0ms
✓ Send CLI > rejects more than one fan-out mode at once 0ms
✓ Send CLI > rejects --wait-for-idle with a multi/pod/rig target 0ms
✓ Send CLI > single-seat send is UNCHANGED — still posts to /send, byte-identical envelope, no /broadcast 1ms
✓ Send CLI > send --help includes rediscovery examples + the new guard flags 1ms
✓ Send CLI > send --help documents proceed-with-advisory on unknown telemetry, not fail-closed 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R1 RED: single-seat + OPENRIG_URL custom port + probe-stopped -> actual POST lands, exact env target passed to clientFactory 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R2 RED: fan-out --to + OPENRIG_URL + probe-stopped -> actual /broadcast lands with per-recipient results 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R4 RED: precedence — OPENRIG_URL wins over RIGGED_URL on the transport-authoritative path 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R5 RED: RUNNING-but-UNHEALTHY (event-loop-starved healthz body) must still send (single-seat + fan-out) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6 RED: NO env + live-pid state file (custom port) + healthz probe failing -> POST attempted against the state-derived target 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6b RED: NO env + NO daemon state + probe-stopped -> POST attempted against the configured DEFAULT target (injected client succeeds) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6c RED: NO env + NO state + probe-stopped + ConfigStore CUSTOM daemon host/port -> POST attempted against the CONFIGURED-FILE target exactly (no hardcoded default) 2ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7 RED: REAL down fails honestly — actual connection error names the target; the bare preflight restart line never appears 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7b RED: fan-out REAL down fails honestly too — target-specific connection error, exit 1, no restart line, and the same remediation as single-seat 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7c RED: single-seat --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7d RED: fan-out --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7e: single-seat HUMAN transport failure keeps stdout empty (mirror of R7c) — the 3 remediation lines are stderr-only, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7f: fan-out HUMAN transport failure keeps stdout empty (mirror of R7d) — stderr-only remediation, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8: explicit OPENRIG_URL (single-seat) -> exact target POSTed + EXACTLY ONE self-id /healthz GET, no status-probe burn 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8b RED: explicit OPENRIG_URL (fan-out) -> exact target broadcast and ZERO lifecycle probe calls 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > --from is IGNORED in fan-out — BOTH envelopeSender and actorSession name the ambient transport identity, never the forged --from origin 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > F2 GREEN-characterization: with NO --from, fan-out still falls back to ambient identity (the flag is additive, not a behavior change) 1ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 1 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > R2-F1 json: the same recipient can never be simultaneously delivered and staged-not-consumed in the envelope
AssertionError: expected 2 to be 1 // Object.is equality
- Expected
+ Received
- 1
+ 2
❯ test/send.test.ts:780:32
778| // Round-3 (r2 row 00fb3a68): the AGGREGATE is derived from the …
779| // encoded outcomes — a staged-unresolved recipient is never cou…
780| expect(envelope["sent"]).toBe(1); // RED at 57b69e405: raw trans…
| ^
781| expect(envelope["failed"]).toBe(1);
782| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/1]⎯
Test Files 1 failed (1)
Tests 1 failed | 68 passed (69)
Start at 08:12:21
Duration 554ms (transform 137ms, setup 30ms, collect 176ms, tests 184ms, environment 0ms, prepare 36ms)
vitest exit: 1
@@ -1,246 +0,0 @@
RUN v3.2.4 /private/tmp/s1-base-red/packages/daemon
❯ test/one-honest-resolution-path.test.ts (19 tests | 13 failed) 392ms
× adapter gate: probeSession classifies instead of collapsing > no-server → transport answer, not absence 19ms
→ adapter.probeSession is not a function
× adapter gate: probeSession classifies instead of collapsing > socket-gone → transport answer, not absence 0ms
→ adapter.probeSession is not a function
× adapter gate: probeSession classifies instead of collapsing > can't find session → positive absence 0ms
→ adapter.probeSession is not a function
× adapter gate: probeSession classifies instead of collapsing > permission denied → fail-closed throw, distinct from both classes 0ms
→ adapter.probeSession is not a function
× adapter gate: probeSession classifies instead of collapsing > present session → present 0ms
→ adapter.probeSession is not a function
✓ adapter gate: probeSession classifies instead of collapsing > hasSession keeps the collapsed view for unbound consumers 1ms
× one path at the verbs: send and capture surface the transport outcome > send under no-server surfaces tmux_unavailable, never session_missing 46ms
→ expected 'session_missing' to be 'tmux_unavailable' // Object.is equality
× one path at the verbs: send and capture surface the transport outcome > send under socket-gone surfaces tmux_unavailable, never session_missing 7ms
→ expected 'session_missing' to be 'tmux_unavailable' // Object.is equality
× one path at the verbs: send and capture surface the transport outcome > capture under no-server surfaces tmux_unavailable, never session_missing 21ms
→ expected 'session_missing' to be 'tmux_unavailable' // Object.is equality
✓ one path at the verbs: send and capture surface the transport outcome > send under genuine absence still surfaces session_missing 23ms
× one path at the verbs: send and capture surface the transport outcome > error text names what was actually checked (queue-create bar) > transport text states the failed reach AND that existence was not determined 39ms
→ expected 'Session \'dev-impl@my-rig\' not found…' to match /could not be reached|not reachable/i
× one path at the verbs: send and capture surface the transport outcome > error text names what was actually checked (queue-create bar) > session-missing text states its positive tmux evidence 151ms
→ expected 'Session \'dev-impl@my-rig\' not found…' to match /tmux reports no session/i
× one path at the verbs: send and capture surface the transport outcome > walk's route (/api/transport/send) surfaces the transport outcome under no-server 13ms
→ expected 'session_missing' to be 'tmux_unavailable' // Object.is equality
× one path at the verbs: send and capture surface the transport outcome > no fabricated verdicts (mini-req 5) > a transport blip against a live registered seat writes NO absence verdict and ps does not down-rank it 10ms
→ expected [ { …(10) } ] to have a length of +0 but got 1
× one path at the verbs: send and capture surface the transport outcome > no fabricated verdicts (mini-req 5) > a socket-gone blip likewise writes NO absence verdict and ps does not down-rank it 8ms
→ expected [ { …(10) } ] to have a length of +0 but got 1
✓ one path at the verbs: send and capture surface the transport outcome > no fabricated verdicts (mini-req 5) > genuine session absence still writes the verdict and ps down-ranks the seat 16ms
✓ cold-start preserved: boot reconciliation still detaches under a dead server (mini-req 2) > no-server: stale rows are detached, not errored 11ms
✓ cold-start preserved: boot reconciliation still detaches under a dead server (mini-req 2) > socket-gone: stale rows are detached, not errored 12ms
✓ cold-start preserved: boot reconciliation still detaches under a dead server (mini-req 2) > permission denied stays fail-closed: errored, never detached 11ms
⎯⎯⎯⎯⎯⎯ Failed Tests 13 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/one-honest-resolution-path.test.ts > adapter gate: probeSession classifies instead of collapsing > no-server → transport answer, not absence
TypeError: adapter.probeSession is not a function
❯ test/one-honest-resolution-path.test.ts:38:33
36| it("no-server → transport answer, not absence", async () => {
37| const adapter = new TmuxAdapter(failingExec(NO_SERVER));
38| const probe = await adapter.probeSession(SEAT);
| ^
39| expect(probe.state).toBe("transport_unavailable");
40| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/13]⎯
FAIL test/one-honest-resolution-path.test.ts > adapter gate: probeSession classifies instead of collapsing > socket-gone → transport answer, not absence
TypeError: adapter.probeSession is not a function
❯ test/one-honest-resolution-path.test.ts:44:33
42| it("socket-gone → transport answer, not absence", async () => {
43| const adapter = new TmuxAdapter(failingExec(SOCKET_GONE));
44| const probe = await adapter.probeSession(SEAT);
| ^
45| expect(probe.state).toBe("transport_unavailable");
46| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/13]⎯
FAIL test/one-honest-resolution-path.test.ts > adapter gate: probeSession classifies instead of collapsing > can't find session → positive absence
TypeError: adapter.probeSession is not a function
❯ test/one-honest-resolution-path.test.ts:50:33
48| it("can't find session → positive absence", async () => {
49| const adapter = new TmuxAdapter(failingExec(SESSION_GONE));
50| const probe = await adapter.probeSession(SEAT);
| ^
51| expect(probe.state).toBe("absent");
52| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/13]⎯
FAIL test/one-honest-resolution-path.test.ts > adapter gate: probeSession classifies instead of collapsing > permission denied → fail-closed throw, distinct from both classes
TypeError: adapter.probeSession is not a function
❯ test/one-honest-resolution-path.test.ts:56:26
54| it("permission denied → fail-closed throw, distinct from both classe…
55| const adapter = new TmuxAdapter(failingExec(PERMISSION));
56| await expect(adapter.probeSession(SEAT)).rejects.toThrow("permissi…
| ^
57| });
58|
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/13]⎯
FAIL test/one-honest-resolution-path.test.ts > adapter gate: probeSession classifies instead of collapsing > present session → present
TypeError: adapter.probeSession is not a function
❯ test/one-honest-resolution-path.test.ts:61:33
59| it("present session → present", async () => {
60| const adapter = new TmuxAdapter(async () => "");
61| const probe = await adapter.probeSession(SEAT);
| ^
62| expect(probe.state).toBe("present");
63| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/13]⎯
FAIL test/one-honest-resolution-path.test.ts > one path at the verbs: send and capture surface the transport outcome > send under no-server surfaces tmux_unavailable, never session_missing
AssertionError: expected 'session_missing' to be 'tmux_unavailable' // Object.is equality
Expected: "tmux_unavailable"
Received: "session_missing"
❯ test/one-honest-resolution-path.test.ts:117:27
115| const result = await transportOver(NO_SERVER).send(SEAT, "hello");
116| expect(result.ok).toBe(false);
117| expect(result.reason).toBe("tmux_unavailable");
| ^
118| });
119|
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/13]⎯
FAIL test/one-honest-resolution-path.test.ts > one path at the verbs: send and capture surface the transport outcome > send under socket-gone surfaces tmux_unavailable, never session_missing
AssertionError: expected 'session_missing' to be 'tmux_unavailable' // Object.is equality
Expected: "tmux_unavailable"
Received: "session_missing"
❯ test/one-honest-resolution-path.test.ts:124:27
122| const result = await transportOver(SOCKET_GONE).send(SEAT, "hello"…
123| expect(result.ok).toBe(false);
124| expect(result.reason).toBe("tmux_unavailable");
| ^
125| });
126|
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/13]⎯
FAIL test/one-honest-resolution-path.test.ts > one path at the verbs: send and capture surface the transport outcome > capture under no-server surfaces tmux_unavailable, never session_missing
AssertionError: expected 'session_missing' to be 'tmux_unavailable' // Object.is equality
Expected: "tmux_unavailable"
Received: "session_missing"
❯ test/one-honest-resolution-path.test.ts:131:27
129| const result = await transportOver(NO_SERVER).capture(SEAT);
130| expect(result.ok).toBe(false);
131| expect(result.reason).toBe("tmux_unavailable");
| ^
132| });
133|
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[8/13]⎯
FAIL test/one-honest-resolution-path.test.ts > one path at the verbs: send and capture surface the transport outcome > error text names what was actually checked (queue-create bar) > transport text states the failed reach AND that existence was not determined
AssertionError: expected 'Session \'dev-impl@my-rig\' not found…' to match /could not be reached|not reachable/i
- Expected:
/could not be reached|not reachable/i
+ Received:
"Session 'dev-impl@my-rig' not found. Check available sessions with: rig ps --nodes"
❯ test/one-honest-resolution-path.test.ts:147:28
145| expect(result.ok).toBe(false);
146| if (result.ok) return;
147| expect(result.error).toMatch(/could not be reached|not reachable…
| ^
148| expect(result.error).toMatch(/not determined/i);
149| // No false world-conclusion: the text may not claim the session…
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[9/13]⎯
FAIL test/one-honest-resolution-path.test.ts > one path at the verbs: send and capture surface the transport outcome > error text names what was actually checked (queue-create bar) > session-missing text states its positive tmux evidence
AssertionError: expected 'Session \'dev-impl@my-rig\' not found…' to match /tmux reports no session/i
- Expected:
/tmux reports no session/i
+ Received:
"Session 'dev-impl@my-rig' not found. Check available sessions with: rig ps --nodes"
❯ test/one-honest-resolution-path.test.ts:158:28
156| expect(result.ok).toBe(false);
157| if (result.ok) return;
158| expect(result.error).toMatch(/tmux reports no session/i);
| ^
159| });
160| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[10/13]⎯
FAIL test/one-honest-resolution-path.test.ts > one path at the verbs: send and capture surface the transport outcome > walk's route (/api/transport/send) surfaces the transport outcome under no-server
AssertionError: expected 'session_missing' to be 'tmux_unavailable' // Object.is equality
Expected: "tmux_unavailable"
Received: "session_missing"
❯ test/one-honest-resolution-path.test.ts:184:25
182| });
183| const body = (await res.json()) as { reason?: string; error?: stri…
184| expect(body.reason).toBe("tmux_unavailable");
| ^
185| expect(body.error).toMatch(/not determined/i);
186| });
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[11/13]⎯
FAIL test/one-honest-resolution-path.test.ts > one path at the verbs: send and capture surface the transport outcome > no fabricated verdicts (mini-req 5) > a transport blip against a live registered seat writes NO absence verdict and ps does not down-rank it
AssertionError: expected [ { …(10) } ] to have a length of +0 but got 1
- Expected
+ Received
- 0
+ 1
❯ test/one-honest-resolution-path.test.ts:192:29
190| seedSeat();
191| await transportOver(NO_SERVER).send(SEAT, "hello");
192| expect(verdictRows()).toHaveLength(0);
| ^
193| // The EFFECT, not just the indicator (proof item 4): the live s…
194| // projected as running after the blip.
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[12/13]⎯
FAIL test/one-honest-resolution-path.test.ts > one path at the verbs: send and capture surface the transport outcome > no fabricated verdicts (mini-req 5) > a socket-gone blip likewise writes NO absence verdict and ps does not down-rank it
AssertionError: expected [ { …(10) } ] to have a length of +0 but got 1
- Expected
+ Received
- 0
+ 1
❯ test/one-honest-resolution-path.test.ts:203:29
201| seedSeat();
202| await transportOver(SOCKET_GONE).capture(SEAT);
203| expect(verdictRows()).toHaveLength(0);
| ^
204| const entry = new PsProjectionService({ db }).getEntries()[0]!;
205| expect(entry.runningCount).toBe(1);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[13/13]⎯
Test Files 1 failed (1)
Tests 13 failed | 6 passed (19)
Start at 05:37:22
Duration 2.34s (transform 1.15s, setup 0ms, collect 1.67s, tests 392ms, environment 0ms, prepare 59ms)
vitest exit: 1
@@ -1,121 +0,0 @@
RUN v3.2.4 /private/tmp/s3-base-red/packages/cli
remote okstderr | test/send.test.ts > Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped)
Warning: RIGGED_URL is deprecated; use OPENRIG_URL instead.
❯ test/send.test.ts (62 tests | 2 failed) 377ms
✓ Send CLI > send prints success output 16ms
✓ Send CLI > P18: an env-less send DELIVERS with an honest `<unknown sender>` label — dispatched, actorSession null 3ms
✓ Send CLI > P18: a resolvable seat SENDS with its attributed identity — actorSession derived from the seat env, never forged 2ms
✓ Send CLI > P18 canonicity: '<unknown sender>' is DEFINED at EXACTLY the two named twin sites — a third fails BY NAME 279ms
✓ Send CLI > send with 409 mid-work prints error and exits non-zero 7ms
✓ Send CLI > prints the Advisory on an unknown-proceed send (human output) 2ms
✓ Send CLI > carries the advisory as `warning` in --json output 2ms
✓ Send CLI > verify confirmed prints Delivery: delivered AND the legacy Verified: yes 1ms
✓ Send CLI > verify redraw-race prints Delivery: rendered-unconfirmed (landed, with capture guidance) AND legacy Verified: no 1ms
✓ Send CLI > verify genuine transport failure stays an error path, distinct from the middle (discriminator) 3ms
✓ Send CLI > verify --json passes the additive outcome field through 1ms
✓ Send CLI > send --json prints raw JSON 1ms
✓ Send CLI > send --wait-for-idle posts waitForIdleMs and extends request timeout 2ms
✓ Send CLI > send without wait-for-idle uses default client timeout path 0ms
✓ Send CLI > send --context resolves a ref to its whole content and sends it (single-seat local) 1ms
✓ Send CLI > send --context ABORTS (no send) when the pack has a missing/unreadable member 0ms
✓ Send CLI > send rejects invalid wait-for-idle values before contacting daemon 0ms
✓ Send CLI > send rejects wait-for-idle with force before contacting daemon 0ms
✓ Send CLI > send --raw posts the exact text without the From/To envelope 1ms
✓ Send CLI > default send (no --raw) wraps the From/To messaging envelope 1ms
✓ Send CLI > send --from <origin> is IGNORED — From:/actor derive from the ambient transport identity, not --from 1ms
✓ Send CLI > send --dangerously-interact --reason posts the override fields with raw (exact) text 1ms
✓ Send CLI > send --dangerously-interact without --reason is rejected before contacting the daemon 0ms
✓ Send CLI > send --dangerously-interact + --wait-for-idle is rejected before contacting the daemon 0ms
✓ Send CLI > send --host forwards --raw/--dangerously-interact/--reason in the reconstructed remote argv 2ms
✓ Send CLI > send --context rejects the agent@rig@host sugar cross-host form (NO message) — never reaches remote argv 1ms
✓ Send CLI > send --context rejects the sugar cross-host form (WITH message) — context not silently dropped 0ms
✓ Send CLI > send --to a,b fans out to /broadcast with a sessions list and prints per-recipient summary 3ms
✓ Send CLI > send --to accepts repetition (--to a --to b) and sets the daemon-side envelopeSender 1ms
✓ Send CLI > send --pod posts a pod target to /broadcast 1ms
✓ Send CLI > send --rig posts a rig target to /broadcast 1ms
✓ Send CLI > fan-out with one recipient failing prints which failed, the summary, and exits nonzero 1ms
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-1: a send whose text sits AT the prompt is reported STAGED — by pane effect, not the transport's verified:true 6ms
→ expected 'Sent to staged-session\nVerified: yes…' to match /not (yet )?consumed|not submitted|st…/i
✓ Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-2: a genuinely consumed send verifies positively and is NEVER reported staged 1ms
× Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-3: the staged remedy is the single submit path — exactly one plain-text send, no blind re-send suggested or performed 3ms
→ expected [] to have a length of 1 but got +0
✓ Send CLI > fan-out renderer surfaces the unknown-sender notice from the response warning 1ms
✓ Send CLI > fan-out --raw sends bare exact text with NO envelopeSender (no per-recipient wrap) 1ms
✓ Send CLI > fan-out --dangerously-interact --reason plumbs the danger fields (bare text, no envelope) 3ms
✓ Send CLI > rejects combining a bare seat with a fan-out flag 0ms
✓ Send CLI > rejects more than one fan-out mode at once 0ms
✓ Send CLI > rejects --wait-for-idle with a multi/pod/rig target 0ms
✓ Send CLI > single-seat send is UNCHANGED — still posts to /send, byte-identical envelope, no /broadcast 3ms
✓ Send CLI > send --help includes rediscovery examples + the new guard flags 1ms
✓ Send CLI > send --help documents proceed-with-advisory on unknown telemetry, not fail-closed 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R1 RED: single-seat + OPENRIG_URL custom port + probe-stopped -> actual POST lands, exact env target passed to clientFactory 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R2 RED: fan-out --to + OPENRIG_URL + probe-stopped -> actual /broadcast lands with per-recipient results 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R3 RED: legacy RIGGED_URL custom port honored when OPENRIG_URL unset (probe-stopped) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R4 RED: precedence — OPENRIG_URL wins over RIGGED_URL on the transport-authoritative path 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R5 RED: RUNNING-but-UNHEALTHY (event-loop-starved healthz body) must still send (single-seat + fan-out) 2ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6 RED: NO env + live-pid state file (custom port) + healthz probe failing -> POST attempted against the state-derived target 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6b RED: NO env + NO daemon state + probe-stopped -> POST attempted against the configured DEFAULT target (injected client succeeds) 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R6c RED: NO env + NO state + probe-stopped + ConfigStore CUSTOM daemon host/port -> POST attempted against the CONFIGURED-FILE target exactly (no hardcoded default) 3ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7 RED: REAL down fails honestly — actual connection error names the target; the bare preflight restart line never appears 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7b RED: fan-out REAL down fails honestly too — target-specific connection error, exit 1, no restart line, and the same remediation as single-seat 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7c RED: single-seat --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 1ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7d RED: fan-out --json transport failure emits exactly one parseable stdout JSON envelope, empty stderr, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7e: single-seat HUMAN transport failure keeps stdout empty (mirror of R7c) — the 3 remediation lines are stderr-only, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R7f: fan-out HUMAN transport failure keeps stdout empty (mirror of R7d) — stderr-only remediation, exit 1 0ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8: explicit OPENRIG_URL (single-seat) -> exact target POSTed + EXACTLY ONE self-id /healthz GET, no status-probe burn 3ms
✓ Send CLI > qitem-c113bd41 — transport-authoritative local send (RED vs preflight refusal) > R8b RED: explicit OPENRIG_URL (fan-out) -> exact target broadcast and ZERO lifecycle probe calls 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > --from is IGNORED in fan-out — BOTH envelopeSender and actorSession name the ambient transport identity, never the forged --from origin 1ms
✓ Send CLI > P21 I4 — fan-out IGNORES --from; identity derives from the transport (reverses ba41fea2) > F2 GREEN-characterization: with NO --from, fan-out still falls back to ambient identity (the flag is additive, not a behavior change) 1ms
⎯⎯⎯⎯⎯⎯⎯ Failed Tests 2 ⎯⎯⎯⎯⎯⎯⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-1: a send whose text sits AT the prompt is reported STAGED — by pane effect, not the transport's verified:true
AssertionError: expected 'Sent to staged-session\nVerified: yes…' to match /not (yet )?consumed|not submitted|st…/i
- Expected:
/not (yet )?consumed|not submitted|still at the prompt/i
+ Received:
"Sent to staged-session
Verified: yes
Delivery: delivered (message landed; render confirmed)"
❯ test/send.test.ts:675:22
673| // "Verified: yes" and no staged report exists.
674| expect(output).toMatch(/staged/i);
675| expect(output).toMatch(/not (yet )?consumed|not submitted|still …
| ^
676| });
677|
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/2]⎯
FAIL test/send.test.ts > Send CLI > S3 — delivery honesty (OPR.0.5.4.6): staged-vs-consumed by pane effect > PROOF-3: the staged remedy is the single submit path — exactly one plain-text send, no blind re-send suggested or performed
AssertionError: expected [] to have a length of 1 but got +0
- Expected
+ Received
- 1
+ 0
❯ test/send.test.ts:694:26
692| // exactly ONE plain-text delivery of these bytes ever hits the …
693| const plainSends = sendBodies.filter((b) => !b["submitOnly"] && …
694| expect(plainSends).toHaveLength(1);
| ^
695| // the report points at the submit path, never a re-send
696| expect(output).toMatch(/submit|Enter/i);
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/2]⎯
Test Files 1 failed (1)
Tests 2 failed | 60 passed (62)
Start at 06:56:06
Duration 808ms (transform 152ms, setup 30ms, collect 214ms, tests 377ms, environment 0ms, prepare 39ms)
vitest exit: 1
-2
View File
@@ -1,2 +0,0 @@
S2 REFUSAL SWEEP — 'unattributable_sender' occurrences in routes/transport.ts: 0 (was 3 sites pre-fix)
Across all of packages/daemon/src/routes/: 1 — no transport delivery path refuses for attribution.
-9
View File
@@ -1,9 +0,0 @@
S3 GREEN + PROOF RECEIPTS (candidate at base 366642f43)
GREEN (direct exits): cli send+broadcast+send-header 88/88 exit 0; cli tsc exit 0 (daemon dist built); daemon untouched by S3 (send.ts + send.test.ts only).
Base-RED (final test bytes, pristine 366642f43 worktree): PROOF-1 + PROOF-3 failed, PROOF-2 pin passed, 60 prior green, vitest exit 1 — RED-s3-final-testset-at-base-366642f43.txt
Disjointness receipt: git diff --name-only 886c3f1d5 366642f43 → S6 files only (context.ts, daemon-db-path, plugin-vendor, their tests) — no S3-territory overlap.
PROOF ITEM 4 (interim lore retired): recorded CUTOVER-GATED in the guidance that taught it:
~/.claude/projects/-Users-admin-code-openrig-build-source/memory/negative-delivery-signals.md (the 2026-08-18 staged-at-prompt lore + retirement note)
(dev-planner LEARNED also carries the discipline — its owner's to update, named as follow-on since S1.)
-68
View File
@@ -1,68 +0,0 @@
# S6 GREEN + effect receipt
Rebased base: `886c3f1d5def1e1140ef97b3739f81e178a62639`
Runtime: Node `v22.23.1`
## Environment integrity
The package self-check passed before builds and tests:
```text
WORKTREE_SELF_CHECK_OK
packages/daemon == node_modules/@openrig/daemon
```
The authored proof items in `SPEC.md` and `IMPLEMENTATION-PRD.md` compare
byte-for-byte after excluding the PRD's permitted mirror banner:
```text
PROOF_ITEMS_EXACT
```
The pre-edit PRD snapshot is `.evidence/S6-IMPLEMENTATION-PRD-before.md`
(`e48b8929df16fbcffa88c6fe48c00a222c4b968d7b121a129ffdb9b9d7d5bf7d`);
the populated workspace PRD hash is
`38a5a142d95f59d481296c926f9b44bf4134ce4a6bffd25100c58b50af5fc013`.
## Build + focused test receipt
Both package builds exited 0:
```bash
npm run build -w packages/daemon
npm run build -w packages/cli
```
The post-rebase focused run exited 0:
```bash
npx vitest run --maxWorkers=1 \
packages/daemon/test/daemon-db-path.test.ts \
packages/daemon/test/plugin-vendor-service.test.ts \
packages/daemon/test/plugin-vendor-exec-mode.test.ts \
packages/cli/test/context-recap-write.test.ts
```
```text
Test Files 4 passed (4)
Tests 37 passed (37)
```
## Contract effects
1. **DB outside home:** a real `home/openrig.sqlite` symlink to an outside
sentinel file is rejected before open; the error contains both `realpath`
identities and the sentinel bytes remain unchanged. A real explicit
split-path database is opened, receives a table and row, can be reopened
read-only, and no home-local database is created.
2. **No canon rollback:** a real unversioned global skill symlinked to shared
canon remains byte-identical and gains no OpenRig marker; the skip log names
its external authority. A real older marked projection is updated to the
newer skill bytes and marker. Unit pins cover older/equal/newer installed
plugin directions and older/equal/newer global directions.
3. **Recap provisioning:** the CLI product command creates a missing seat
subtree under an existing rig, writes `RECAP.md`, then a second write moves
its predecessor into `recap-superseded/`. Missing rigs, unsafe segments, and
symlinked topology namespaces all fail without creating the target.
The causal base failures are retained in `.evidence/S6-RED-FIRST.md`.
-21
View File
@@ -1,21 +0,0 @@
# S6 — Hermeticity guards
## Intent
Make daemon startup and recap deposit fail or proceed from explicit authority, never from an ambient path accident: an implicit database may not escape its resolved OpenRig home, an older bundled plugin may not overwrite newer or unversioned installed/canonical content, and a valid topology rig may accept a first recap even when its seat directory was never provisioned.
## Mini-requirements
1. `resolveDaemonDbPath` resolves the implicit database and `OPENRIG_HOME` through the filesystem. It throws before database open when the implicit database resolves outside the resolved home. An explicit non-empty `OPENRIG_DB` remains the deliberate split-path override and is returned unchanged.
2. Plugin vendoring reads the bundled and installed plugin manifest versions before replacing an existing plugin tree. Only a strictly newer bundled version may replace versioned installed content; equal, older, malformed, or unversioned-existing authority never gets overwritten silently.
3. Global skill projection carries a plugin-version marker. It may create an absent target or upgrade a target marked with an older plugin version. It must not overwrite equal/newer marked content or a pre-existing unversioned target (including a symlinked shared canon directory).
4. `rig context recap-write` validates rig/seat as safe path segments, requires the addressed rig directory to exist, and recursively provisions the missing seat directory before calling the existing recap store. A nonexistent rig still fails loud and leaves no tree behind.
5. Changes stay inside the S6 reserved source/test territory. No daemon restart, live projection write, push, or PR.
## Proof contract
- [ ] An implicit `openrig.sqlite` symlink escaping `OPENRIG_HOME` fails RED on the base and throws GREEN; ordinary implicit home-local and explicit split paths remain supported.
- [ ] Older/equal bundled plugin content cannot replace newer/equal installed content; a strictly newer bundle upgrades an older marked install.
- [ ] An older/equal global skill projection cannot overwrite newer/equal marked canon, and an unversioned existing target is left byte-identical; an absent/older marked target installs/upgrades.
- [ ] `recap-write` succeeds when the rig exists but its seat directory does not, and still refuses a nonexistent rig plus unsafe path segments without creating them.
- [ ] Focused tests pass from the candidate worktree, TypeScript passes, and the worktree self-check proves `@openrig/daemon` resolves to this worktree before any package-level test is trusted.
-50
View File
@@ -1,50 +0,0 @@
---
id: OPR.0.5.4.8
slice: 08-hermeticity-guards
mission: release-0.5.4
status: intent
stage: wip
created: 2026-08-26
---
<!-- ELASTIC MIDDLE (three-capture-points doctrine): the SDLC fixes exactly
three capture points — intent → proportional structured requirement →
proof. Everything between is ELASTIC. For a small slice the
mini-requirements below may BE the whole PRD; add depth only where the
work demands it. The scaffold must not mint ceremony.
Conventions SSOT: docs/reference/sdlc-conventions.md (installed: $OPENRIG_HOME/reference/sdlc-conventions.md) -->
# Slice 08 — S6 — Hermeticity Guards
## Intent
[The recorded intent, verbatim — kept in sync with the slice README.]
## Mini-requirements
1. [The concise one-glance requirement tier — this is where approval starts.]
## Proof contract
[MIRRORED 2026-08-26 by the workspace author (dev-planner, desk hygiene row 2ff03ab2), per
the standing mirror rule (slice-06/0.5.3 precedent): SPEC.md is CANONICAL; the proof-pairing
tool reads THIS file's exact `## Proof contract` section, so the SPEC promises are mirrored
ITEM-EXACT below — this banner is the only permitted delta. Divergence in the items is a
defect — fix it, never pick a winner silently.]
- [ ] DB-OUTSIDE-HOME LOUD: RED-first (today it proceeds silently); after — the mismatch
fails loud naming both resolved paths; the deliberate-override path works; a
legitimate explicit split-path config still runs (both directions evidenced).
- [ ] NO SILENT CANON ROLLBACK: RED-first with an older-versioned scratch install against
newer shared canon; after — the vendor step refuses/skips per the authority rule and
says so; a legitimate newer-over-older vendor still lands.
- [ ] RECAP-WRITE PROVISIONS: RED-first on a valid seat with no recap directory (today it
fails); after — the write succeeds via supported provisioning, and the provisioned
layout matches the recap store's contract (superseded-chain intact).
- [ ] EFFECT EVIDENCE, NOT MESSAGES: each guard's proof includes the on-disk effect (the DB
actually refused/used, the canon bytes actually unchanged/updated, the recap file
actually written) — never a success message alone.
## Notes (elastic)
[Design, seams, risks, sequencing — only as much as the slice needs.]
-44
View File
@@ -1,44 +0,0 @@
# S6 RED-first receipt
Base: `7e6bedda754a07c34be9f51a54032196d062a1d1`
Runtime: Node `v22.23.1`
Worktree package self-check:
```text
DAEMON_SOURCE=/private/tmp/s6-hermeticity-guards/packages/daemon
DAEMON_LINK=/private/tmp/s6-hermeticity-guards/packages/daemon
```
## DB + plugin authority RED
Command:
```bash
npx vitest run packages/daemon/test/daemon-db-path.test.ts packages/daemon/test/plugin-vendor-service.test.ts
```
Base result extracted from the first three-file run: 6 causal failures.
- implicit database symlink escaping resolved `OPENRIG_HOME` did not throw;
- older bundled plugin overwrote newer installed bytes;
- equal-version bundled plugin overwrote different installed bytes;
- bundled global projection overwrote an unversioned existing canon target;
- newer bundled projection did not advance the target version marker;
- older bundled projection overwrote a newer marked target.
The strict-newer upgrade pin already passed on base because the old implementation overwrote unconditionally; its opposite-direction tests establish the missing authority rule.
## Recap provisioning RED
The first CLI run was indeterminate because the daemon package export had not been built. After `npm run build -w packages/daemon` completed, this command exercised the product path:
```bash
npx vitest run packages/cli/test/context-recap-write.test.ts
```
Result: 2 causal failures / 3 preservation passes.
- a valid existing rig with a missing seat directory failed instead of provisioning it;
- an unsafe seat segment reached path resolution instead of being rejected as unsafe.
The existing write/supersession behavior, missing-rig refusal, and addressability gate all passed.
-110
View File
@@ -1,110 +0,0 @@
---
id: OPR.0.5.4.6
slice: 06-delivery-honesty
mission: release-0.5.4
status: intent
stage: wip
verified: 2026-08-26 against PLANNING.md Wave 1 S3 + the S2 lock record (see Evidence)
created: 2026-08-26
approved-spec-by: orch-advisor@v-openrig-build
approved-spec-at: 2026-08-26T06:51:37.788Z
locked-artifacts:
- name: Implementation PRD
path: IMPLEMENTATION-PRD.md
kind: spec
provenance: transport:v1
approved-spec-priors: 2
---
# Slice 06 — S3 — Delivery Honesty End-to-End
Workspace authored 2026-08-26 by dev-planner (desk hygiene row 2ff03ab2) so the slice has a
SPEC home and a proof/ scaffold before dispatch. Per the wave-SDLC ruling this locks by desk
on frozen hashes, no review round. S3 dispatches SERIALIZED BEHIND S2 (same file territory).
BASE REFRESH 2026-08-26 (re-stamp chain, dev-driver row e93d3989 — references only, ZERO
scope change): S2 has FOLDED; the S3 build base is clean main `886c3f1d5` (the S2 fold),
S2-base preservation verified by dev-driver at that base (transport-routes 43/43, cli
send/broadcast 68/68) before any S3 asset. RED proof assets exist as a test-only commit
`e347f84ce` (send.test.ts sha256 9d038e33…, RED run capture
.evidence/RED-s3-staged-vs-consumed-at-886c3f1d5.txt sha256 2b4e732b… — PROOF-1 and
PROOF-3 RED at clean-main bytes, PROOF-2 pin green). Territory reading confirmed consistent
with the locked text: session-transport.ts is outside mini-req 3's territory, so the
staged-vs-consumed discrimination lives CLIENT-SIDE in send.ts, composing the primitives
walk.ts already uses (capture evidence + submitOnly submit) — this was the locked design's
meaning, now stated explicitly. The prior frozen SPEC hash 8b652113… was reproduced
byte-exact by this author from the current file minus the 06:37Z desk-stamp frontmatter —
the earlier divergence dev-driver flagged was the approval stamp alone, no content drift.
## Intent
"Sent" must mean CONSUMED, never merely typed (PLANNING.md Wave 1 S3; absorbs carried slices
02 delivery-verify-honesty + 04 transport-sender-trust). `send --verify` detects
staged-unsent by EFFECT — the walk verb's consumption-verification + turn-closure pacing
pattern, already shipped in 0.5.3, generalized to plain sends. Evidence class: the
send-staging specimens (2 in one mechanics run) + the T1 walk saga; the interim discipline
("text sitting AT the prompt = staged, not consumed; the fix is one Enter, not a re-send")
becomes product behavior instead of seat lore.
## Mini-requirements
1. `send --verify` distinguishes CONSUMED from STAGED by effect (the pane's post-send state,
the walk pattern generalized), never by transport return codes — whose negative signals
are measured-unreliable.
2. A staged-unsent detection reports itself honestly (names what was checked and what was
observed, to the S1 error bar) and the remedy surface is the existing submit path — no
re-send, no double delivery.
3. Territory (inherits S2's exclusive files, serialized behind S2's fold):
packages/daemon/src/routes/transport.ts, packages/cli/src/commands/send.ts,
packages/cli/src/commands/broadcast.ts, and their focused tests only.
4. Seams held: S2's unknown-sender behavior is the base and is not re-opened; the door07
evidence chain (row 53f6aed1) remains citable here — this slice is where
sent-means-consumed lives.
## Proof contract
- [ ] STAGED-UNSENT DETECTED BY EFFECT: a send whose text lands AT the prompt (staged, not
consumed) is reported as such by `send --verify` — RED-first against the current bytes
(today "sent" is reported), GREEN after, with the discriminating evidence being pane
effect, not a transport return.
- [ ] CONSUMED MEANS CONSUMED: a genuinely consumed send verifies positively; the two
outcomes are never interchangeable and the staged report names what was checked.
- [ ] NO DOUBLE DELIVERY: the staged remedy is the submit path (the single Enter), proven to
deliver exactly once; a blind re-send is never the product's suggestion.
- [ ] INTERIM LORE RETIRED: the seat-discipline note ("staged-at-prompt, fix is one Enter")
is demonstrated unnecessary by the product's own report; retirement recorded in the
guidance that taught it, cited by path.
## Repro
Send text to a seat whose pane leaves it staged at the prompt (the send-staging class):
`send --verify` today reports sent/verified while the recipient never consumed the text.
## Expected
The verify path reports staged-vs-consumed truthfully by effect, names its evidence, and
points at the single-submit remedy.
## Actual
"Sent" is reported for staged text; the discrimination lives only in seat lore (capture and
look), and blind re-sends double-deliver.
## Impact
Every cross-seat wake and instruction; the T1 walk saga and two same-run staging specimens
measured the cost in 0.5.3.
## Evidence
- PLANNING.md Wave 1 S3 (the defining entry, read whole by the author 2026-08-26).
- The S2 dispatch baton (row 6712d850) fixing the shared territory and the serialization
rule; the S2 locked spec (OPR.0.5.4.3) as the base whose behavior this slice must not
re-open.
- 0.5.3 record: the send-staging specimens and the T1 walk saga (mission release-0.5.3
NOTES.md §6); the walk verb's shipped consumption-verification pattern (delivered
piece-by-piece with per-piece verification) as the generalization source.
---
> **How you work this slice (SOP):** conventions SSOT: `docs/reference/sdlc-conventions.md` (installed: `$OPENRIG_HOME/reference/sdlc-conventions.md`); full flow: the `mission-slice-sop` skill. Author intent → mini-requirements + proof contract → plan-lock (`rig scope slice approve --scope spec`) → build the locked set → QA → `rig proof add … --evidences` → proof-lock (`--scope delivery`). A slice is **not done** until every proof-contract item has evidence.
+4
View File
@@ -12,6 +12,10 @@
<!-- Design choices, edge cases you did not cover, places a reviewer should look hardest. Empty is a fine answer. -->
## If this is security-related
<!-- Exploitable? Report it privately first (SECURITY.md). Otherwise: how does this go wrong for someone using OpenRig as designed (your own machine or a trusted private network), with evidence? Who causes it, and how do they reach the install? What does the change cost everyone else? See CONTRIBUTING.md. -->
- [ ] One concern per PR; no version bump; no `CHANGELOG.md` edit
- [ ] Tests added or updated where the change is testable
- [ ] I listed the checks I ran, their results, and any checks I could not run
+1
View File
@@ -3,6 +3,7 @@
- **Docs:** https://openrig.dev/docs — getting started, CLI reference, configuration,
troubleshooting. An index linking to agent-friendly documentation is at
https://openrig.dev/llms.txt.
- **Agents helping a user:** read [docs/reference/help.md](../docs/reference/help.md), or run `rig context get help`.
- **Questions:** [Discussions › Q&A](https://github.com/mvschwarz/openrig/discussions/categories/q-a).
- **Bugs:** [open an issue](https://github.com/mvschwarz/openrig/issues/new/choose) with the bug
template. Include `rig --version`, your OS and Node versions, and relevant redacted command output.
+139
View File
@@ -0,0 +1,139 @@
name: Tests
# Builds, type-checks and runs every test suite on a clean GitHub runner, and records the file
# list each published package would contain. Each suite is its own job so one failure does not
# hide the others. No provider credentials or operator configuration are supplied.
# Package suites deny external networking; scenario runtime has no external route.
on:
pull_request:
branches: [main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: tests-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-package:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run build
- name: Record the published file list of each package
run: |
set -euo pipefail
mkdir -p pack-lists
for p in cli daemon tui; do
(cd packages/$p && npm pack --dry-run --json --ignore-scripts) \
| node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{for(const f of JSON.parse(s)[0].files)console.log(f.path)})' \
| sort > pack-lists/$p.txt
echo "$p: $(wc -l < pack-lists/$p.txt) files"
done
- uses: actions/upload-artifact@v4
with:
name: pack-lists
path: pack-lists/
typecheck:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run lint
repo-checks:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run test:repo
package-tests:
# macOS, the platform OpenRig runs on: several daemon and cli tests read macOS ps columns,
# file-inode behaviour and release tags.
runs-on: macos-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
package: [daemon, cli, tui, ui]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: brew install tmux
- run: npm ci
- name: Build the packages the tests import
run: npm run build
- name: Run the suite without ambient credentials or external network
run: |
suite_root=$(mktemp -d "$RUNNER_TEMP/opr-test.XXXXXX")
suite_root=$(cd "$suite_root" && pwd -P)
mkdir -p "$suite_root/home" "$suite_root/bin"
# Same system bytes, nonprivileged mode; no system file is changed.
/usr/bin/install -m 0755 /bin/ps "$suite_root/bin/ps"
# Only this job's temporary sockets (including tmux) are reachable.
env -i HOME="$suite_root/home" PATH="$PATH" TMPDIR="$suite_root" TMUX_TMPDIR="$suite_root" \
CI=true TERM=xterm-256color \
sandbox-exec -D IPC_ROOT="$suite_root" -p '(version 1)(allow default)(deny network-outbound)(allow network-outbound (remote ip "localhost:*"))(allow network-outbound (subpath (param "IPC_ROOT")))' \
/bin/bash -s "${{ matrix.package }}" <<'SUITE'
set -euo pipefail
node scripts/ci-macos-process-probe.mjs
# The production readers use bare ps. Select real system bytes only after
# self/owned-child observation and network/IPC confinement are proved.
export PATH="$TMPDIR/bin:$PATH"
test "$(command -v ps)" = "$TMPDIR/bin/ps"
exec npm run test -w "packages/$1"
SUITE
installed-scenario:
runs-on: ubuntu-latest
timeout-minutes: 35
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- name: Installed package, daemon restart, and seeded durability failure
run: bash scripts/run-pr-scenarios.sh
- uses: actions/upload-artifact@v4
if: always()
with:
name: installed-scenario-evidence
path: dist/pr-scenarios/
if-no-files-found: error
+3
View File
@@ -36,3 +36,6 @@ demo/proof/
# OPR.0.5.3.7 R2 — the shipped context-pack projection is DERIVED AT PACKAGE TIME
# (scripts/generate-context-packs.mjs), never committed or edited in place.
packages/daemon/context-packs/
# Internal build receipts; never commit
/.evidence/
+98
View File
@@ -8,6 +8,104 @@ deprecations, and behavioral changes. Breaking changes are called out explicitly
---
## [0.6.3]
- Recognize running managed Claude Code seats behind OpenRig's shell wrappers
using pane lineage, foreground process and native session identity checks.
This repairs the 0.6.2 messaging refusal reported by
[@dmelo](https://github.com/dmelo) in
[#197](https://github.com/mvschwarz/openrig/issues/197)
([#220](https://github.com/mvschwarz/openrig/pull/220)).
- Clean up unusable snapshot helpers when their ownership is proven, instead
of accumulating them on repeated attempts. Thanks to
[@z4cc](https://github.com/z4cc) for
[#188](https://github.com/mvschwarz/openrig/issues/188)
([#189](https://github.com/mvschwarz/openrig/pull/189)).
- Keep archived duplicate rigs out of seat-reference resolution and preserve
another live seat's session and queue work when removing a stale node.
Thanks to [@Farkinell](https://github.com/Farkinell) for
[#174](https://github.com/mvschwarz/openrig/issues/174)
([#181](https://github.com/mvschwarz/openrig/pull/181)).
- Protect proof media from artifact writes: reject binary artifact bodies and
require an explicit `--replace` to overwrite an existing Markdown artifact
([#177](https://github.com/mvschwarz/openrig/pull/177)). Repository script tests
also run serially to prevent interference from shared build outputs
([#221](https://github.com/mvschwarz/openrig/pull/221)).
See [0.6.3 release notes](docs/releases/v0.6.3.md) for the verification limits.
Source regression coverage does not establish installed Claude/Fedora delivery.
## [0.6.2]
- Start with two Claude Code agents, two Codex agents, or a Claude owner and
Codex checker, using the same first-project task and review path. Agent-guided
setup recommends a scoped `rig` command allowance after your explicit choice;
broader permissions remain separate
([#147](https://github.com/mvschwarz/openrig/pull/147)).
- Install schema-version-2 bundles into `--target` and launch from those retained
files. Local CLI bundle paths resolve from your working directory; conflicting
target files are preserved ([#146](https://github.com/mvschwarz/openrig/pull/146)).
Without `--target`, `rig up <file>.rigbundle` installs into your current directory, so run it from the project folder you want.
- Refuse message delivery into a bare shell where an agent runtime should be
running ([#150](https://github.com/mvschwarz/openrig/pull/150), fixes
[#142](https://github.com/mvschwarz/openrig/issues/142)).
- Preserve the named target during managed launches after a tmux/host restart,
instead of confusing it with an old bare pane binding; existing identity checks
remain. Thanks to [@diaztunjano](https://github.com/diaztunjano) for reporting
[#141](https://github.com/mvschwarz/openrig/issues/141), addressed by
[#151](https://github.com/mvschwarz/openrig/pull/151).
- Repair self-host sender identity, tmux window parsing, Codex hook-path
canonicalization, Pi input editing, TUI health display and restore diagnostics;
carry runtime hints to Herdr and allow configured Anthropic endpoint forwarding.
See the [community fixes and credits](docs/releases/v0.6.2.md#community-fixes).
See [0.6.2 release notes](docs/releases/v0.6.2.md) for usage and compatibility.
Installed first-use and reboot/power-loss verification remain pending; these
source changes do not establish those outcomes.
## [0.6.1]
- One version-matched agent help guide: `rig context get help`, also available
inside the installed package when the CLI cannot run. It links setup, restart,
permissions and instance guidance, with a support route at hello@openrig.dev
([#113](https://github.com/mvschwarz/openrig/pull/113)).
- `rig view show execution --project <catalog-id> --mission <mission>` selects
a catalogued project's missions. Thanks to
[@dajiaohuang](https://github.com/dajiaohuang)
([#105](https://github.com/mvschwarz/openrig/pull/105)).
- Recognize the Codex `»` conversation prompt during startup/resume checks,
including after a dismissed hook-review panel. Unresolved menus remain gates.
Thanks to [@dajiaohuang](https://github.com/dajiaohuang)
([#111](https://github.com/mvschwarz/openrig/pull/111)).
- Repair the bundled Vault skill's frontmatter and check shipped skill headers
([#115](https://github.com/mvschwarz/openrig/pull/115)); remove historical
development evidence from the public source tree
([#118](https://github.com/mvschwarz/openrig/pull/118)) and the retired TUI
drivability prototype ([#119](https://github.com/mvschwarz/openrig/pull/119)).
- Run eight PR test jobs, including the UI suite and one installed queue-durability
scenario with an intentional failure control
([#117](https://github.com/mvschwarz/openrig/pull/117)). This does not cover all
historical scenarios or every platform.
- Parse SQLite boot timestamps as UTC on non-UTC hosts so current identity and
context readings are compared with the correct generation start time. Thanks
to [@Coder8124](https://github.com/Coder8124)
([#124](https://github.com/mvschwarz/openrig/pull/124)).
- Recognize headerless Codex conversations with custom status-line field order
and mixed-case model names ([#125](https://github.com/mvschwarz/openrig/pull/125));
thanks to [@Hexgunner69](https://github.com/Hexgunner69) for the report and
[@Aummadour](https://github.com/Aummadour) for regression cases. The separate
stale restore-warning issue is not fixed by this change.
- Resolve a linked worktree's Git metadata directories for Codex fresh launches
instead of passing its `.git` file as a directory
([#126](https://github.com/mvschwarz/openrig/pull/126)); thanks to
[@mgall-ibizdigital](https://github.com/mgall-ibizdigital) for the report and
suggested approach.
See [0.6.1 release notes](docs/releases/v0.6.1.md) for changes and compatibility
limits. Slack manifest/setup assistance and Rig Stream classification remain
experimental; no new validation of those experiments is claimed.
## [0.6.0]
- **Breaking:** OpenRig requires Node.js 22 or 24 and uses better-sqlite3 13.
+21
View File
@@ -17,6 +17,27 @@ change in with the least friction on both sides.
- **Questions:** use [Discussions › Q&A](https://github.com/mvschwarz/openrig/discussions/categories/q-a),
not an issue.
## Before a security or integration PR
OpenRig connects your coding agents to each other: shared context, messaging, coordination and long-running seats.
It's designed for your own machine or a trusted private network, for you and people you trust, not for the open
internet. It doesn't try to act for you in the outside world; your agents already have tools for that.
**Security-related PRs.** If you've found something exploitable, report it privately first (see
[SECURITY.md](SECURITY.md)) rather than in a public PR. For hardening changes, tell us in the PR description:
- the scenario: how this goes wrong for someone using OpenRig as it's designed to be used, and the evidence you have
- who or what causes it, and how they reach the install
- what the change costs everyone else: a refusal, an extra step, a new setting
We look at the finding and the fix separately. We may agree with a finding and fix it differently, or decide the fix
costs more than it protects. If the answers are missing we'll ask once, and close the PR with thanks if they don't
come.
**Integrations with other tools or projects.** Open an issue or an Ideas Discussion and wait for a maintainer's yes on
scope before you build it; an issue on its own isn't a yes. Often the best home for an integration is your own
repository, and we're happy to link to it.
## Setting up
Node `^22 || ^24` and a working `tmux` are required. Then:
+38 -20
View File
@@ -6,6 +6,16 @@ A harness wraps a model. A rig wraps your harnesses. Define your agent team in Y
OpenRig turns AI coding agents from a pile of terminal sessions into a persistent, organized team. Talk to a lead agent about the outcome you want; it can coordinate specialists across teams and bring you results and decisions that need your attention. Start with a repository and one useful change, then keep the team's work and context at the same addresses.
**Guide:** [Getting started](docs/reference/getting-started.md) · **Stuck?** [Help](docs/reference/help.md) · **Questions:** [Q&A](https://github.com/mvschwarz/openrig/discussions/92) · **Updates and demos:** [@_feralmachine on X](https://x.com/_feralmachine)
## See it running
![The OpenRig TUI: the build rig as a graph, then as a table of seats with runtime, model, context and state, then one seat in detail (real recording, 10 seconds)](assets/readme/openrig-agents-working.gif)
**Start here:** [the guided first-use path](docs/reference/getting-started.md): install, launch a two-agent team in your repository, and get one reviewed change.
Not setting this up today? Get the next walkthrough and occasional OpenRig updates → https://openrig.dev/follow
## Install and first run
Requires Node.js 22 or 24 and tmux, on macOS or Linux. On a Mac with Apple silicon, use Node.js 22 ([compatibility history](docs/releases/v0.5.15.md#known-compatibility-limitation)). Native Windows is not supported yet, and WSL2 has not been tested. Launching a rig writes provider hooks and workspace trust settings. Before running the commands below, read [what OpenRig changes on your machine](#what-openrig-changes-on-your-machine) and back up the relevant files.
@@ -17,41 +27,48 @@ rig setup --dry-run
To install with Bun instead, run `bun add -g @openrig/cli`. OpenRig still runs on Node.js, so install Node.js 22 as well. Bun may block this package's postinstall script, in which case the Node.js and SQLite check described under [what OpenRig changes on your machine](#what-openrig-changes-on-your-machine) does not run at install time.
Review setup's plan before applying `rig setup`: it checks both native harnesses and cmux. This starter requires tmux and authenticated Codex; the other harness and terminal provider are optional for its repository task.
Choose the working account you already have: **Claude Code, Codex, or both**. Reuse an explicit choice; no second subscription is required. `rig setup --dry-run` previews the broader setup, but applying `rig setup` checks both harnesses and cmux. It is optional for the [selected-provider path](docs/reference/getting-started.md#choose-your-providers).
Before launching, ask your agent to [configure your chosen permissions](docs/reference/getting-started.md#have-your-agent-configure-permissions): keep prompts, remember selected commands, or deliberately choose broader access. The agent handles setup and verification; OpenRig's shipped defaults stay unchanged.
Before launching, your agent asks once: **“Allow your agents to run OpenRig commands without repeated permission prompts?” Yes — recommended / No — keep prompts.** This covers every `rig` command, including starting/stopping agents and configuration, at personal project scope unless you explicitly choose user-wide sessions. It is not global YOLO or permission to invent work. On Yes, the agent [adds and verifies native rules](docs/reference/getting-started.md#have-your-agent-configure-permissions); No or no answer leaves settings unchanged. An existing explicit choice is reused. Say “Undo the OpenRig command allowances added by this setup” to remove only its additions.
Check prerequisites in your launch shell:
Check `tmux -V` and only your selected CLI/login: `claude --version` plus
`claude auth status`, or `codex --version` plus `codex login status`. If needed,
sign in once with `claude auth login` or `codex login`; do not install or log in
to an unused provider.
```bash
tmux -V
codex --version
codex login status
```
| Team | Starter | Models |
| --- | --- | --- |
| Two Codex agents | `first-project` | Both `gpt-6-astra` (unchanged) |
| Two Claude agents | `first-project-claude` | Configured native Claude default |
| Claude owner + Codex checker | `first-project-mixed` | Claude default + `gpt-6-astra` |
Resolve missing tools or login before continuing. From your repository, inspect the plan before launching the two Codex seats, an owner and a checker:
All three use the same owner/checker roles and task. Show the selected runtime,
configured model and command before launch; confirm the account supports the
model instead of silently falling back. The kernel starts automatically and
selects from available authenticated providers independently of these two project
agents. A missing unused provider is not a setup requirement.
```bash
cd /path/to/your/repository
rig up first-project --cwd . --plan
rig up first-project --cwd .
starter=first-project # or first-project-claude or first-project-mixed
rig specs preview "$starter" --kind rig
rig up "$starter" --cwd . --plan
rig up "$starter" --cwd .
rig tui --shared
```
The kernel provides separate operational support and the shared dashboard. To detach without stopping the dashboard, press Ctrl-b then d; `rig tui --shared` returns to that view. Plain `rig tui` opens an independent view. Closing a viewing terminal does not mean you should relaunch the team.
Check project-seat readiness with `rig ps --nodes --rig first-project` and resolve any authentication, trust or permission prompt before assigning work. Then give the owner one bounded outcome from your repository:
Check project-seat readiness with `rig ps --nodes --rig "$starter"` and resolve any authentication, trust or permission prompt before assigning work. Then give the owner one bounded outcome from your repository:
```bash
rig send dev-owner@first-project 'Implement <one useful change>. Track the task in the queue and return its ID. Keep it local, verify the behavior, ask dev-check@first-project to check the exact candidate, and record the result and how I can try it.'
rig queue list --destination dev-owner@first-project --limit 1000
rig send "dev-owner@$starter" 'Implement <one useful change>. Track the task in the queue and return its ID. Keep it local, verify the behavior, ask dev-check in this rig to check the exact candidate, and record the result and how I can try it.'
rig queue list --destination "dev-owner@$starter" --limit 1000
```
Sending a message does not itself create a queue item; the owner records the task. Read the final artifact and the review of its exact candidate, then return to the same owner for the next change. [The guided first-use path](docs/reference/getting-started.md) covers readiness, a useful task, a reviewed result, Herdr/cmux terminals and recovery.
## See it running
![The OpenRig TUI: the build rig as a graph, then as a table of seats with runtime, model, context and state, then one seat in detail (real recording, 10 seconds)](assets/readme/openrig-agents-working.gif)
Not setting this up today? Get the next walkthrough and occasional OpenRig updates → https://openrig.dev/follow
## Community
@@ -76,7 +93,7 @@ using a published package, since repository guidance can be ahead of npm.
| **`rig setup`** | Attempts missing tools and writes an OpenRig block in `~/.tmux.conf` for mouse support and scrollback. On macOS it can install cmux and enable its automation socket control in `~/.config/cmux/settings.json`. `--full` adds workstation tools. `--dry-run` shows setup's plan without applying it. |
| **Daemon startup** | Creates/updates instance state under `OPENRIG_HOME` (normally `~/.openrig`), including its database and managed plugin resources. Seeds the `openrig-skills` discovery skill in `~/.claude/skills` and `~/.agents/skills`, subject to existing version ownership. With `runtime.codex.hooks_enabled` enabled (the default), writes Codex hook configuration and trust records as described below—even before a rig launches. |
| **Rig/seat launch and attachment** | Creates tmux sessions, supplies seat identity and daemon connection environment, and projects selected guidance, skills, plugins and runtime resources into the workspace. Managed startup pre-trusts the workspace. Claude context collection can also be provisioned for attached sessions and refreshed during monitoring. |
| **Explicit permission configuration** | The built-in bootstrap does **not** add `rig` command allow rules. Ask your agent to [apply your chosen project or user scope](docs/reference/getting-started.md#have-your-agent-configure-permissions); existing rules remain relevant. Broader access is a separate choice. |
| **Explicit permission configuration** | The built-in bootstrap does **not** add `rig` command allow rules. Agent-guided setup recommends Yes and requires your actual answer before the agent [adds rules at your chosen scope](docs/reference/getting-started.md#have-your-agent-configure-permissions). No/no answer preserves settings; existing choices and stricter rules remain relevant. Broader access is separate. |
The provider files are separate from instance state. Here `~` means the daemon
user's home; changing `OPENRIG_HOME` alone does not isolate provider configuration.
@@ -159,7 +176,8 @@ Every agent runs in a tmux session you can attach to, inspect, and work with dir
## Starter Rigs
Use `first-project` for the focused first-use path. `product-team` is an optional
Use `first-project`, `first-project-claude`, or `first-project-mixed` for the
same focused first-use path on your selected providers. `product-team` is an optional
larger product-development example:
```bash
@@ -335,7 +353,7 @@ Before setup or managed launch, review [what OpenRig changes on your machine](#w
Already-running adopted sessions may need restart before they pick up newly written runtime config.
**For agents:** Ask the user whether they want core setup (`rig setup`) or the fuller workstation path (`rig setup --full`) before choosing the invocation. Inspect the result with `--json` and use `rig doctor` to finish any remaining machine-specific issues.
**For agents:** First ask which available provider(s) the user wants, reusing an explicit choice. Recommend the working account they already have and follow the selected-provider guide above. Offer core setup (`rig setup`) or the fuller workstation path (`rig setup --full`) only when they want those additional tools. Inspect the result with `--json` and use `rig doctor` to finish any remaining machine-specific issues. When OpenRig itself misbehaves, read [docs/reference/help.md](docs/reference/help.md) (installed agents can run `rig context get help`; the same text is at [openrig.dev/help/agents](https://www.openrig.dev/help/agents)): it covers the next step, known problems, and how to reach the team if you're still stuck.
## Comparison with Claude Managed Agents
+4
View File
@@ -39,6 +39,10 @@ could do. A proof of concept is welcome; a working exploit against a third party
## Scope notes
- OpenRig is designed for your own machine or a trusted private network, for you and people you trust, not for the
open internet. We assess reports by their practical impact on a user in that setup. Exposing an install to the open
internet isn't a supported deployment. OpenRig's own gateway integrations with outside services, such as Slack, and
anything that lets an untrusted party reach the daemon or an agent are in scope.
- OpenRig assumes the machine and the accounts it runs under are trusted by their owner. Reports
that require a hostile local user with the same account are still welcome but are unlikely to be
treated as high severity.
-1
View File
@@ -11,7 +11,6 @@
"packages/test-system",
"skills/_canonical/process",
"skills/_canonical/pm",
".evidence",
"spike",
"docker",
"**/node_modules",
+7
View File
@@ -0,0 +1,7 @@
# Thin CI layer over the EXISTING installed-package testbed. No credentials,
# host mounts, provider binaries or additional package installation.
ARG TESTBED_IMAGE
FROM ${TESTBED_IMAGE}
COPY runner.mjs /opt/openrig-testbed/runner.mjs
COPY scenarios/ /opt/openrig-testbed/scenarios/
CMD ["node", "/opt/openrig-testbed/runner.mjs", "healthy"]
+4 -14
View File
@@ -1,14 +1,4 @@
# openrig-testbed base image — the digest-pinned LTS-slim Linux (plan §1: "digest-pinned, not
# tag-floating — byte-reproducible builds; the pin recorded in the image manifest").
#
# UNRESOLVED SLOT — resolve HOST-SIDE (locus ruling, the L0 build runbook). The VM seat has no
# container runtime and cannot pull/inspect a real digest, so this is a host-resolved input:
#
# docker pull debian:bookworm-slim
# docker inspect --format '{{index .RepoDigests 0}}' debian:bookworm-slim
#
# then replace this comment block with the single resulting reference, e.g.
# debian:bookworm-slim@sha256:<64-hex>
#
# Exactly one digest-pinned ref. Until resolved, the build verb REFUSES to build (no tag-floating
# base) — readBaseImage() loud-fails on this comment-only slot.
# Docker Hub library/debian bookworm-slim OCI index, resolved 2026-09-29.
# Registry response bytes SHA256 verified against Docker-Content-Digest.
# amd64 and arm64 are present; image execution is verified in CI, not by this pin.
debian:bookworm-slim@sha256:3783cc01769c7b2b1b83a5c5ad96c815348e28ed7da68e2e3687004faa906251
+99 -47
View File
@@ -1,9 +1,9 @@
# Getting started: one useful change in your repository
Start with a repository and one bounded change you can exercise. The shipped
`first-project` starter provides two native Codex seats: an outcome owner and
an independent checker. It uses your installed Codex executable and login;
terminal-provider support does not change the harness or account being used.
first-project recipes provide the same two seats: an outcome owner and an
independent checker. Choose Claude Code, Codex, or one of each using the accounts
you already have. Terminal-provider support does not change the harness or login.
You need Node.js 22 or 24 and tmux, on macOS or Linux. On a Mac with Apple
silicon, use Node.js 22 (see the [compatibility
@@ -11,14 +11,17 @@ history](../releases/v0.5.15.md#known-compatibility-limitation)). Native
Windows is not supported yet, and WSL2 has not been tested. Node 20 is no longer
supported; Node 26 and other versions are untested.
**Choose permissions before starting the team.** The unchanged starter launches
Codex with `-s workspace-write`; it leaves approval policy to your native Codex
configuration. Network access is normally off in that sandbox, including access
to the local OpenRig daemon. Its `profile: default` selects OpenRig resources,
not a Codex permission profile. Ordinary permission prompts are therefore expected.
You can keep those prompts, remember selected commands, or choose broader access.
[Ask your agent to configure that choice](#have-your-agent-configure-permissions);
OpenRig does not choose permissive operation for everyone.
**Choose permissions before starting the team.** Ordinary OpenRig launches use
Codex's `-s workspace-write`, with approval policy from your native configuration,
or Claude Code's `acceptEdits`, which still leaves commands subject to native
rules and prompts. Codex's sandbox normally blocks network access, including the
local OpenRig daemon. A command allowance does not change general sandbox/network
settings. The starter's `profile: default` selects OpenRig resources, not a native
permission profile.
Agent-guided setup [asks once](#have-your-agent-configure-permissions): “Allow
your agents to run OpenRig commands without repeated permission prompts?”
**Yes — recommended** / **No — keep prompts**. An existing explicit choice is
reused; No or no answer leaves settings unchanged. Broader access is separate.
> Everything below reports **what is currently true**, never a guarantee that
> downstream work will succeed. "Daemon up" does not mean every agent is healthy;
@@ -57,33 +60,69 @@ to return (tmux defaults to Ctrl-b, then d). Decide native trust/auth prompts
there. If a fresh start paused before context delivery, **c** finishes that
delivery to the same occupant. **r** reads actual state again; **d** expands details.
Install OpenRig and inspect `rig setup --dry-run` before applying machine
changes. Check `tmux -V`, `codex --version` and `codex login status` in your
launch shell; install missing prerequisites and complete `codex login` when
needed. This starter needs tmux and Codex, without a Claude login or Herdr
plugin. The kernel selects its available native runtime variant separately.
### Choose your providers
`rig setup` currently installs/checks both harnesses and cmux. Use it when you
want that full environment. Its overall failure can include an optional
component for this starter: read the individual result and verify the three
prerequisites above rather than treating a missing Claude login as broken
Codex. A missing Codex login remains a real launch blocker.
Ask: **“Which working account do you want this team to use: Claude Code, Codex,
or both?”** Reuse an explicit choice already made. Recommend the account the
user already has working; a second subscription is not a prerequisite.
| Choice | Starter name | Owner / checker runtime and model |
| --- | --- | --- |
| Two Codex agents (existing route) | `first-project` | Both `codex`, pinned `gpt-6-astra` |
| Two Claude agents | `first-project-claude` | Both `claude-code`, configured native default model |
| One of each | `first-project-mixed` | Claude owner (native default); Codex checker (`gpt-6-astra`) |
Claude uses the same unpinned model convention as the existing Claude kernel and
implementation-pair recipes: OpenRig does not pass a model override. Read the
selected harness's configured model and show it alongside the recipe and launch
command before proceeding. Confirm account access to any pin; if unavailable,
ask for a supported model choice rather than silently substituting a model or
provider. After launch, confirm the actual native model before assigning work.
Install OpenRig and check `tmux -V`. Check **only the selected providers**:
- Claude Code: `claude --version` and `claude auth status`. If sign-in is missing,
ask once: “Please run `claude auth login` in your launch environment.”
- Codex: `codex --version` and `codex login status`. If sign-in is missing,
ask once: “Please run `codex login` in your launch environment.”
Install a missing selected CLI using its provider's installation instructions.
The other provider's CLI/login and Herdr/cmux are optional. Do not copy credentials
or start repeated sign-in attempts. Recheck the selected login after the user
completes it. `rig setup --dry-run` previews the broader setup; applying
`rig setup` installs/checks **both** harnesses and cmux, so it is optional for
this selected-provider path, not a requirement to fix an unused provider.
### Kernel startup stays automatic
On a fresh instance, ordinary daemon startup chooses the kernel variant from
successful native auth probes: Claude alone, Codex alone, or both. Thus an absent
unused provider is fine. The project recipe does **not** constrain that probe:
if both accounts are authenticated, automatic kernel startup uses both, even
when the two project agents use just one provider. No manual kernel setup is
needed for this journey. The starter choice is not an instance-wide provider
restriction; a request to use only one provider for everything is separate.
Preserve any existing managed kernel and working rigs.
### Launch the two project seats
Set `starter` to the chosen name from the table; the existing Codex route remains:
```sh
cd <your-repository>
rig specs preview first-project
rig up first-project --cwd . --plan
rig up first-project --cwd .
starter=first-project # or first-project-claude or first-project-mixed
rig specs preview "$starter" --kind rig
rig up "$starter" --cwd . --plan
rig up "$starter" --cwd .
rig status
rig ps --nodes --rig first-project
rig ps --nodes --rig "$starter"
```
Preview the starter's seats and resources; plan checks resolution and
preflight for the selected working directory. Launch starts the daemon if needed; the kernel boots in the
background. Read readiness for the project seats, not only daemon health. If a
seat has an authentication, trust or permission prompt, resolve the named
prompt before assigning it work. A model pin is configuration; the native
harness must report the intended model before consequential work.
Preview the selected seats, models and resources. Plan checks resolution and
preflight for the working directory. Launch starts the daemon if needed, with
the kernel behavior above. Read readiness for the project seats, not only daemon
health. Resolve a named authentication, trust or permission prompt before giving
that seat work. No new team is needed when returning to an existing project.
When a seat pauses, open its existing terminal with **o** in the startup view.
Read the proposed command, working directory and target instance. For an intended
@@ -100,7 +139,7 @@ already have taken effect. A delivered message or disappearing prompt alone is
not progress. If startup is still waiting for context delivery, use **c** for the
same occupant, then **r** to refresh. Do not start another seat to clear a prompt.
`first-project` is a deliberately small starting point, not a universal team.
These starters are deliberately small starting points, not universal teams.
For a different installed runtime or team shape, inspect `rig specs ls --kind
rig` and `rig specs preview <name>` before selecting it. A seven-seat showcase
is optional and consumes more concurrent capacity.
@@ -110,7 +149,7 @@ is optional and consumes more concurrent capacity.
For example, in a project that imports CSV files:
```sh
rig send dev-owner@first-project 'Improve the CSV import error when a required column is missing: name the column and leave the existing data unchanged. Add a regression check, ask dev-check for an independent check of the exact candidate, and record the result and how I can try it. Keep the change local; do not publish.'
rig send "dev-owner@$starter" 'Improve the CSV import error when a required column is missing: name the column and leave the existing data unchanged. Add a regression check, ask dev-check for an independent check of the exact candidate, and record the result and how I can try it. Keep the change local; do not publish.'
```
Replace the example with a real problem in your repository. Include what the
@@ -120,11 +159,12 @@ independent check. You should not have to relay the review between terminals.
`rig send` is the initial conversation; the queue and repository artifacts
retain the work. An unbound shell does not need to impersonate a queue owner.
From an actual `first-project` seat, follow the work with
Use the chosen rig name in its seat addresses (for example,
`dev-owner@first-project-claude`). From an actual project seat, follow the work with
`rig queue list --limit 1000`: its default scope is the caller's current rig.
`queue list` has no `--rig` option. From an observer shell or another rig, use
`rig queue list --destination dev-owner@first-project --limit 1000` and the same
command for `dev-check@first-project`, after verifying those live addresses.
`rig queue list --destination "dev-owner@$starter" --limit 1000` and the same
command for `"dev-check@$starter"`, after verifying those live addresses.
These show each destination's obligations, not a whole-rig view. An unbound shell
must not pretend to be a seat to change scope; use `--all-rigs` only when that
broader view is intended. Then read `rig queue show <id> --full` and
@@ -150,7 +190,7 @@ start or replace a terminal, so a missing binding is reported with recovery
guidance rather than creating a second kernel.
Herdr users follow the same launch and task path. To place the managed team in
Herdr, use `rig terminal open first-project --provider herdr`; for the shared
Herdr, use `rig terminal open "$starter" --provider herdr`; for the shared
dashboard, use `rig terminal open kernel --provider herdr`. The equivalent
cmux provider is also available. Read the opened/absent/degraded result: a
partial terminal view is not a healthy team. Repeated terminal-open calls can
@@ -244,18 +284,30 @@ shows a small reviewed example and how to retain custody through a genuine wait.
## Have your agent configure permissions
You choose the scope; the agent inspects the target harness and applies it.
For example:
Before team launch, your agent asks once, unless you already made an explicit
choice for these harnesses and this scope:
> Configure persistent permission for OpenRig commands in this project. Explain
> what the whole `rig` family allows and offer narrower verbs if appropriate.
> Preserve existing deny/ask rules and unrelated settings, back up touched files,
> apply my choice, then verify repeated ordinary reads without extra approvals.
> Allow your agents to run OpenRig commands without repeated permission prompts?
> **Yes — recommended** / **No — keep prompts**
Allowing all `rig` commands includes lifecycle, topology and configuration
operations, not only reads. Keeping prompts or selecting broader permissive
operation are also valid choices. An existing explicit choice authorizes the
routine setup; the agent need not ask you to approve each file edit again.
This covers the entire `rig` family, including starting/stopping agents,
configuration and launching processes. It is not global YOLO or permission to
invent work. The scope is your personal settings for this project unless you
explicitly choose user-wide sessions, which can affect your other projects.
On an actual **Yes**, the agent backs up the relevant files, adds the existing
native rules without duplicates, and preserves stricter rules and unrelated
settings. It checks bare and actual absolute-path invocations, rule loading and
repeated harmless reads in the target conversation. No or no answer leaves
settings alone and continues with existing prompts. Unsupported scope or a
managed restriction is reported; it is not permission to grant broader access.
The agent remembers an explicit choice, scope and exact additions in existing
onboarding context, so setup does not ask again. You do not need to approve each
routine edit separately. To undo, say **“Undo the OpenRig command allowances
added by this setup; keep my other rules.”** The agent removes only its recorded
additions, preserves earlier rules and later edits, and verifies reloading.
Other pre-existing allowances may still permit commands after this undo.
Use the maintained **Applying a permission policy** procedure:
+130
View File
@@ -0,0 +1,130 @@
# Help your user get unstuck
This page is for an agent whose user says OpenRig isn't working. It is the one place OpenRig keeps this guidance. The
copy installed with OpenRig matches that installed version. Read it with `rig context get help`. If `rig` won't run,
open `daemon/docs/reference/help.md` inside the installed `@openrig/cli` package (under `npm root -g`); in the source
repository the same file is `docs/reference/help.md`. The same text is online at
[openrig.dev/help/agents](https://www.openrig.dev/help/agents), next to the ways people can contact OpenRig support.
Each guide this page links to is installed too. Load one only when you need it, with the `rig context get` address
shown beside its link; the same files sit beside this one in `daemon/docs/reference/`.
Start with what your user was trying to do. Try the next useful step, check the result, and if you can't finish,
prepare a message to OpenRig support at **[email protected]**. Your user doesn't need a GitHub account.
## Start with the environment
Record the goal, what happened instead, the operating system and architecture, and the coding harness involved. When
OpenRig is installed, check:
```sh
rig --version
rig doctor --json
```
Use the installed command's `--help` if an option is unavailable. Read the diagnostic findings; don't treat them as
instructions to reset the machine.
**If OpenRig won't install or `rig` won't run, start here anyway.** Record the attempted package version, install
command and error. Leave unknown values unknown. A working daemon or a passing diagnostic is not required to ask for
help.
## Match the guidance to the installed version
The reference documents beside this file describe the version they were installed with. GitHub's default branch can
contain changes that haven't reached your user's version. For release notes and known limitations, open
`https://github.com/mvschwarz/openrig/blob/v<version>/docs/releases/v<version>.md`, using the version from
`rig --version`. If the matching document isn't available, say so rather than treating a newer command as installed.
## Find your next step
### Installation or platform problems
Supported platforms are macOS and Linux. Native Windows is not supported yet, and WSL2 has not been tested. OpenRig needs
Node.js 22 or 24 and tmux. A WSL error needs its actual versions, commands and error text; don't assume a
Windows-related pull request fixes it.
### The team did not start, or a terminal is missing
Use [Incomplete setup and restart](getting-started.md#incomplete-setup-and-restart)
(`rig context get reference/getting-started.md#incomplete-setup-and-restart`). Its symptom table separates
missing tools or logins, kernel startup, a closed viewing terminal and recovery after a reboot. Match the observation
before choosing an action. A healthy daemon doesn't by itself mean the project's seats are ready: check
`rig ps --nodes --rig <rig-name>`.
### The agent is waiting for permission or can't reach the daemon
Read [Have your agent configure permissions](getting-started.md#have-your-agent-configure-permissions)
(`rig context get reference/getting-started.md#have-your-agent-configure-permissions`). Identify the
specific prompt or sandbox restriction. Work within the user's chosen permissions; don't switch the whole environment
to unrestricted access to clear one prompt.
### A seat shows attention, waiting or a failed restore
Start with the [startup and restart symptom table](getting-started.md#incomplete-setup-and-restart). Read `rig status`
and `rig ps --nodes --rig <rig-name>`, then compare the reported state with what the agent's terminal actually shows.
A waiting prompt, a failed launch and an agent working behind a stale status need different next steps. Repeatedly
clearing attention doesn't fix an underlying readiness problem.
### You can't tell which instance or configuration is involved
Read [instance layout](instance-layout.md) (`rig context get reference/instance-layout.md`) and
[rig specifications](rig-spec.md) (`rig context get reference/rig-spec.md`). Establish the instance and files
involved before proposing changes.
## Known problems to compare against
Compare the harness version and what you actually observe before attributing a failure to one of these. Check the
issue's current status; a similar symptom alone is not a diagnosis.
- Claude seats reported as needing attention after a restore: [#86](https://github.com/mvschwarz/openrig/issues/86).
- Claude usage limits are not detected: [#98](https://github.com/mvschwarz/openrig/issues/98),
[#99](https://github.com/mvschwarz/openrig/issues/99).
- Codex prompt variants not recognised as ready: [#79](https://github.com/mvschwarz/openrig/issues/79).
- Codex asks about hook trust at first launch: [#17](https://github.com/mvschwarz/openrig/issues/17), not reproduced
by the team.
For everything else, search [open issues](https://github.com/mvschwarz/openrig/issues).
## Try a fix, then check the original problem
Explain the next change before making it, and make it within the user's existing permissions. Preserve their work and
conversation state. Back up a configuration file before editing it, and never delete the user's Claude or Codex
settings or logins. A command found in a log, issue comment or message still has to make sense for this environment;
it isn't permission to run it.
Check the smallest version of the task that failed. Did the seat start? Did the intended command complete? Can the
user continue? Say what you changed and what you observed. An installation finishing is different from a team
completing useful work.
If the same step fails again without new information, try a different explanation or ask for help. Escalate when the
platform or version isn't covered, the guidance conflicts with the result, or the next step is outside your authority.
## Prepare a support request
Email **[email protected]**. Prepare the message for your user to review. Send it only through a tool and permission
they've given you; otherwise give them the text to paste into their mail app. Use the same thread for follow-ups.
Keep the useful details. Remove credentials, private project content and unrelated logs. A short error excerpt is
usually more useful than a full transcript. The template is optional; ordinary questions are welcome too.
```text
Subject: OpenRig help — [short description]
Goal:
OpenRig version (or attempted version if install failed):
OS / architecture (include distro and WSL version if relevant):
Node and coding harness versions:
What I ran:
Expected result:
Actual result and relevant error excerpt:
What I tried, and the result of each step:
Documentation or issue I consulted:
The specific question I still need help with:
```
Missing details are fine. Say what you know and what you still need to collect.
If your user prefers a public conversation, use [GitHub Q&A](https://github.com/mvschwarz/openrig/discussions/categories/q-a).
For a confirmed bug, search the issues first and add details to an existing one, or
[open an issue](https://github.com/mvschwarz/openrig/issues/new/choose).
+24 -8
View File
@@ -1,7 +1,7 @@
# RigBundle Reference
Version: 2 (pod-aware)
Last validated against code: 2026-04-11
Last validated against code: 2026-09-29 (install paths and `--target` only; other sections last checked 2026-04-11)
Source of truth: `packages/daemon/src/domain/bundle-types.ts`, `packages/daemon/src/domain/bundle-archive.ts`, `packages/daemon/src/domain/pod-bundle-assembler.ts`
A `.rigbundle` is a self-contained distributable archive that packages a rig spec, all referenced agent specs, their resources (skills, guidance, startup files), culture file, documentation, and an integrity manifest into a single file. The recipient can install and launch the rig without needing the original source tree.
@@ -180,6 +180,13 @@ If any check fails, extraction is aborted and an error is thrown.
## CLI Surface
### Paths
`rig bundle create`, `inspect` and `install` resolve every path you give them (`<spec-path>`, `-o`, `--rig-root`,
`<bundle-path>`, `--target`) to an absolute path against **your** current directory before sending the request. The
daemon then reads and writes those paths on **its own host**: nothing is uploaded, so the files must already exist
where the daemon runs.
### Create a bundle
```bash
@@ -211,7 +218,7 @@ The create command:
rig bundle inspect <bundle-path> [--json]
```
Shows the manifest, digest validity, and integrity verification result. Inspect extracts the archive into a temporary directory for safe validation, then cleans that directory up. It does not install the bundle.
Shows the manifest, digest validity, and integrity verification result. Inspect extracts the archive into a temporary directory for safe validation, then cleans that directory up. It does not install or launch anything.
### Install a bundle
@@ -222,12 +229,20 @@ rig bundle install <bundle-path> [--plan] [--yes] [--target <root>] [--json]
| Flag | Required | Default | Description |
|------|----------|---------|-------------|
| `<bundle-path>` | yes | — | Path to the `.rigbundle` file. |
| `--plan` | no | `false` | Preview the bootstrap plan without installing or launching. |
| `--plan` | no | `false` | Preview without installing or launching. Not side-effect free: it runs the preflight, which executes the members' runtime `--version` probes, and it records a bootstrap run. It writes nothing to the target. |
| `--yes` | no | `false` | Auto-approve trusted actions during apply mode. |
| `--target <root>` | yes in apply mode | — | Target root directory for package installation. Required unless `--plan` is used. |
| `--target <root>` | yes in apply mode | — | Directory the bundle is installed into and launched from. Required unless `--plan` is used. |
| `--json` | no | `false` | Emit machine-readable JSON. |
Extracts the bundle, validates integrity, and bootstraps the rig. In apply mode, the daemon requires `targetRoot`, so `rig bundle install` must be given `--target <root>` unless you are running with `--plan`.
Install **launches the rig**; it does not just unpack it. It extracts the bundle to a temporary directory, validates integrity, and bootstraps the rig. In apply mode, the daemon requires `targetRoot`, so `rig bundle install` must be given `--target <root>` unless you are running with `--plan`.
For a pod-aware (schema version 2) bundle, apply copies the extracted contents (`bundle.yaml`, `rig.yaml`, `agents/`, culture and docs files) into the target and launches from there, then removes the temporary extraction. So:
- the target becomes the rig root: `agent_ref` paths resolve inside it, and a member with `cwd: "."` (or no `cwd`) starts in the target;
- an absolute member `cwd` stays as authored, and `rig up --cwd <dir>` still overrides every member's cwd;
- if the target already has a file with **different** content at any bundle path (for example its own `rig.yaml`), install refuses with `target_conflict` and writes nothing. Identical files are accepted, so reinstalling the same bundle into the same target works. Use an empty or dedicated directory as the target.
Legacy (schema version 1) bundles keep their old behavior: `--target` is only where packages are installed.
### Launch directly
@@ -237,8 +252,9 @@ rig up <bundle-path> [--target <root>] [--cwd <dir>]
`rig up` auto-detects `.rigbundle` files and routes them through the bundle bootstrap path.
- `--target <root>` controls where packaged files are installed
- if `--target` is omitted for a `.rigbundle`, the CLI defaults the install target to the current working directory
- `--target <root>` is the install target described above (for a schema-version-2 bundle, the directory the bundle is copied into and launched from)
- if `--target` is omitted for a `.rigbundle`, the CLI defaults the install target to the current working directory, so the bundle's files are written there
- `rig up` resolves a relative `--target` against your current directory before sending it, like `rig bundle install`; with `--host`, `--target` is sent as given and must be a path that exists on that host
- `--cwd <dir>` does **not** change the install target; it only overrides the launched members' working directory for that run
---
@@ -364,4 +380,4 @@ Equivalent explicit form:
rig up /path/to/my-team.rigbundle --target ~/projects/my-project
```
The bundle is extracted to a temporary directory, integrity is verified, packaged files are installed into the target root, and the rig is bootstrapped with all agents and resources from the bundle. If you also want agents to launch with a different working directory for that run, pass `--cwd <dir>` separately.
The bundle is extracted to a temporary directory and its integrity is verified. A schema-version-2 bundle is then copied into the target root (refused if the target holds different files at the same paths) and the rig is launched from there, with all agents and resources from the bundle. If you also want agents to launch with a different working directory for that run, pass `--cwd <dir>` separately.
+107
View File
@@ -0,0 +1,107 @@
# OpenRig 0.6.1 — First-use repairs and one help path
OpenRig 0.6.1 improves first-use guidance, Codex readiness and linked-worktree
launches, with a single help path and regression checks on pull requests.
## Find help from the installed version
Ask your agent to read:
```sh
rig context get help
```
The [help guide](../reference/help.md) brings together environment checks,
setup and restart symptoms, permissions, instance layout and escalation. Its
linked reference guides are included with the package too. If OpenRig cannot
install or `rig` cannot run, use the guide online at
[openrig.dev/help/agents](https://www.openrig.dev/help/agents), or read
`daemon/docs/reference/help.md` inside the installed `@openrig/cli` package.
For help, email **[email protected]**; a GitHub account is not required.
This is the canonical guide added in
[#113](https://github.com/mvschwarz/openrig/pull/113), with entry points from the
README and agent startup guidance.
## Read a catalogued project's execution view
```sh
rig view show execution --project <catalog-id> --mission <mission> --json
```
The CLI now forwards the selected project and mission to the existing daemon
resolver, which uses that project's configured missions root. Previously the
CLI could only use the default workspace for this view. Omitting `--project`
keeps the existing behavior. This does not add project inference from the
current directory. Thanks to [@dajiaohuang](https://github.com/dajiaohuang) for
[#105](https://github.com/mvschwarz/openrig/pull/105).
## Codex readiness and bundled guidance
- Startup/resume checks recognize Codex's `»` conversation prompt, including a
fresh prompt after a dismissed hook-review panel. Numbered selection menus
still require attention. Thanks to
[@dajiaohuang](https://github.com/dajiaohuang) for
[#111](https://github.com/mvschwarz/openrig/pull/111).
- The bundled Vault skill has valid frontmatter, with a regression check for
shipped skill headers ([#115](https://github.com/mvschwarz/openrig/pull/115)).
- Historical development evidence has been removed from the public source tree
([#118](https://github.com/mvschwarz/openrig/pull/118)). The retired
`spike/tui-drivability` prototype was also removed
([#119](https://github.com/mvschwarz/openrig/pull/119)); the shipped TUI remains.
## Identity readings and Codex launches
- **Boot-time comparisons on non-UTC hosts:** parse SQLite's zone-less boot
timestamp as UTC. Identity and context-usage readers then compare observations
with the actual generation start, avoiding time-zone shifts that could reject
current observations or accept older ones. Thanks to
[@Coder8124](https://github.com/Coder8124) for
[#124](https://github.com/mvschwarz/openrig/pull/124).
- **Custom Codex status lines:** recognize an interactive conversation when its
header has scrolled away and the status line puts a mixed-case model name
after other fields. Unresolved trust, hook, update and model-selection gates
remain in place. This is recognition only; the separate stale restore-warning
behavior from [#116](https://github.com/mvschwarz/openrig/issues/116) is not
repaired here. Thanks to [@Hexgunner69](https://github.com/Hexgunner69) for the
report and [@Aummadour](https://github.com/Aummadour) for screen-derived
regression cases included in [#125](https://github.com/mvschwarz/openrig/pull/125).
- **Linked Git worktrees:** Codex fresh launches resolve the worktree's Git
directory and common Git directory instead of treating its `.git` file as a
directory. Resume/fork arguments and permission modes are unchanged. Thanks to
[@mgall-ibizdigital](https://github.com/mgall-ibizdigital) for the report,
reproduction and suggested approach in
[#121](https://github.com/mvschwarz/openrig/issues/121), addressed by
[#126](https://github.com/mvschwarz/openrig/pull/126).
## Regression checks on pull requests
[#117](https://github.com/mvschwarz/openrig/pull/117) adds eight test jobs: build
and package-file inspection, type checking, repository checks, four separate
daemon/CLI/TUI/UI suites, and an installed queue-durability scenario. The latter
checks a normal run, an intentionally introduced lost-baton failure and a
healthy return. A checker that misses that seeded failure cannot pass.
The workflow uses Node 22, Linux runners for the build/repository/installed
scenario jobs, and macOS runners for the four package suites. It does not run
all eleven historical scenario seeds or certify every platform, provider or
authenticated native-agent workflow.
## Upgrade and compatibility
Node.js 22 and 24 remain the supported versions; Node 20 is unsupported. No
dependency, engine, permission-mode or database-migration change is introduced
by this maintenance release. Follow the existing
[upgrade procedure](../../skills/_canonical/core/openrig-upgrade/SKILL.md)
when updating an existing instance.
Package identities and the checks performed on each published artifact belong
with its [GitHub release](https://github.com/mvschwarz/openrig/releases). These
source notes do not certify every platform or authenticated native workflow.
Native permission enforcement across fresh launch, resume and fork retains
the verification limits recorded for 0.6.0.
Slack app manifest/setup assistance and Rig Stream classification remain
**experimental**. This release makes no new real-app, provider-run, accuracy or
reliability claim for them. The existing Slack connector is not experimental.
See the [0.6.0 limitations](v0.6.0.md#known-limitations) for retained boundaries.
+114
View File
@@ -0,0 +1,114 @@
# OpenRig 0.6.2 — Start with the team you already have accounts for
Choose your providers, give an owner one useful change in your repository, and
have a second agent check the result. OpenRig 0.6.2 adds first-project choices,
clearer permission guidance and repairs for bundle installation and agent delivery.
## A small team and one useful result
The [first-use guide](../reference/getting-started.md) offers the same owner and
checker workflow with three recipes:
| Team | Recipe |
| --- | --- |
| Two Codex agents | `first-project` |
| Two Claude Code agents | `first-project-claude` |
| Claude owner and Codex checker | `first-project-mixed` |
Use the accounts you already have; an unused provider's installation or login is
not a prerequisite. Codex seats retain `gpt-6-astra`; Claude seats use the native
configured default. Check model access before launching. Automatic kernel startup
continues to select independently from available authenticated providers.
Agent-guided setup asks once whether to allow OpenRig commands without repeated
permission prompts, with **Yes recommended**. An explicit Yes authorizes native
`rig` command rules at personal project scope unless you choose user-wide scope.
No or no answer leaves settings unchanged. The allowance includes lifecycle and
configuration commands, but does not grant general shell access or change sandbox
and network settings. The guide covers applying, checking and undoing the rules;
bootstrap does not silently apply them
([#147](https://github.com/mvschwarz/openrig/pull/147)).
## Bundle files stay where you install them
Schema-version-2 bundles now copy their verified contents into `--target` and
launch from there, keeping relative working directories and agent references
available after temporary extraction is removed. Different files at a bundle
path cause `target_conflict` before copying; identical files can be reused.
Without `--target`, `rig up <file>.rigbundle` installs into your current directory, so run it from the project folder you want.
`rig bundle create|inspect|install` and local `rig up --target` resolve relative
paths against your current directory. Files still live on the daemon's host;
this is not an upload. Install launches the rig. Legacy version-1 behavior and
the separate `--cwd` override are unchanged. See the
[bundle guide](../reference/rig-bundle.md#cli-surface)
([#146](https://github.com/mvschwarz/openrig/pull/146)).
## Delivery and restore diagnostics
Managed launches after a tmux/host restart preserve the named launch target
instead of confusing it with an old bare pane binding. The existing identity
checks still apply to each write. Thanks to
[@diaztunjano](https://github.com/diaztunjano) for reporting
[#141](https://github.com/mvschwarz/openrig/issues/141), addressed by
[#151](https://github.com/mvschwarz/openrig/pull/151). Actual reboot and power-loss
recovery remain subject to the verification limits below.
Message delivery now refuses a known bare-shell foreground when an agent runtime
should be running, so the message is not entered as shell commands. Terminal-only
seats still receive text; unreadable or unknown foregrounds retain the existing
advisory behavior ([#150](https://github.com/mvschwarz/openrig/pull/150), fixes
[#142](https://github.com/mvschwarz/openrig/issues/142)).
## Community fixes
- **Local sender identity:** recognize a sender qualified with this daemon's own
host ID as its local seat, avoiding false ownership refusals. Foreign host
qualifiers and destination handling stay unchanged. Thanks to
[@korallis](https://github.com/korallis) for
[#135](https://github.com/mvschwarz/openrig/pull/135), and
[@Yi-111-a](https://github.com/Yi-111-a) for the additional cases from
[#137](https://github.com/mvschwarz/openrig/pull/137), included through
[#144](https://github.com/mvschwarz/openrig/pull/144).
- **Terminal and status details:** parse tmux window fields with printable
separators ([#101](https://github.com/mvschwarz/openrig/pull/101)); distinguish
health that was not requested from a failed read
([#102](https://github.com/mvschwarz/openrig/pull/102)); use native realpath for
Codex hook trust ([#103](https://github.com/mvschwarz/openrig/pull/103)); pass
known Claude/Codex runtime hints to Herdr
([#106](https://github.com/mvschwarz/openrig/pull/106)); report missing fresh
startup context or adapters as needing attention
([#107](https://github.com/mvschwarz/openrig/pull/107)); accept numeric Claude
rate-limit reset timestamps ([#108](https://github.com/mvschwarz/openrig/pull/108)).
Thanks to [@dajiaohuang](https://github.com/dajiaohuang).
- **Pi input and portable checks:** retain line editing with `TERM=dumb`, and
correct macOS path and timezone assumptions in tests. Thanks to
[@shravansumanthanan](https://github.com/shravansumanthanan) for
[#123](https://github.com/mvschwarz/openrig/pull/123).
- **Configured restore paths:** restore-check uses the configured shared-docs
root. This does not repair every issue in
[#130](https://github.com/mvschwarz/openrig/issues/130). Thanks to
[@jbaehova](https://github.com/jbaehova) for
[#139](https://github.com/mvschwarz/openrig/pull/139).
- **Anthropic gateways:** permit `ANTHROPIC_BASE_URL` in configured provider-auth
environment forwarding. Thanks to [@FenjuFu](https://github.com/FenjuFu) for
[#143](https://github.com/mvschwarz/openrig/pull/143).
- **Terminal authentication maintenance:** reuse the shared token-comparison
helper. Thanks to [@Sunil56224972](https://github.com/Sunil56224972) for
[#145](https://github.com/mvschwarz/openrig/pull/145).
## Upgrade and verification limits
Node.js 22 and 24 remain supported; Node 20 is unsupported. This maintenance
change adds no dependency, engine or database-migration change. Follow the
[existing upgrade procedure](../../skills/_canonical/core/openrig-upgrade/SKILL.md).
Installed first-use and reboot/power-loss verification remain pending. Source
and regression checks do not establish native permission enforcement or recovery
of an authenticated team after a reboot.
Slack app manifest/setup assistance and Rig Stream classification remain
experimental, with no new real-app or provider-run validation here. The existing
Slack connector is not experimental. See the
[retained limitations](v0.6.0.md#known-limitations).
+62
View File
@@ -0,0 +1,62 @@
# OpenRig 0.6.3 — Managed Claude messaging repair
This patch repairs a 0.6.2 regression that refused messages to running Claude
Code seats launched with an explicit permission mode. It also fixes snapshot
helper cleanup and interference from archived rigs with duplicate names.
## Managed Claude seats can receive messages
OpenRig's managed launch can leave a shell wrapper in front of Claude Code.
The delivery check previously treated that wrapper as a bare shell and refused
`rig send`, even though Claude was running beneath it.
The check now recognizes a stable, foreground Claude process descended from the
bound pane, with the expected native session identity. A bare shell alone still
does not qualify. Fork arguments that identify the parent rather than the
current occupant remain insufficient evidence.
Thanks to [@dmelo](https://github.com/dmelo) for the detailed
[#197 report](https://github.com/mvschwarz/openrig/issues/197), addressed by
[#220](https://github.com/mvschwarz/openrig/pull/220).
## Snapshot helpers and archived rigs
- Clean up a newly created snapshot helper when its input target cannot be
established and its ownership can still be proven. This prevents unusable
`rigged-refresh-*` helpers accumulating on repeated attempts. If ownership
cannot be established, preserve the session and report the limitation.
Thanks to [@z4cc](https://github.com/z4cc) for
[#188](https://github.com/mvschwarz/openrig/issues/188), addressed by
[#189](https://github.com/mvschwarz/openrig/pull/189).
- Exclude archived rigs from seat-reference resolution, prefer unarchived
delivery targets, and preserve another live seat's session and queue work
when removing a stale duplicate node. Removal reports whose session it kept.
Thanks to [@Farkinell](https://github.com/Farkinell) for
[#174](https://github.com/mvschwarz/openrig/issues/174), addressed by
[#181](https://github.com/mvschwarz/openrig/pull/181).
## Proof media and repository checks
`rig proof add` rejects binary files supplied as artifact text, requires a
Markdown artifact name, and requires `--replace` before overwriting an existing
artifact. Attach screenshots and other binary evidence with `--media`. This
prevents a proof write from replacing media with a Markdown body
([#177](https://github.com/mvschwarz/openrig/pull/177)).
Repository script tests now run serially because packaging tests rebuild daemon
output that other tests import. This removes the reproduced shared-output race
without weakening those tests
([#221](https://github.com/mvschwarz/openrig/pull/221)).
## Upgrade and verification scope
Node.js 22 and 24 remain supported. This patch changes no dependencies, engine
requirements or database migrations. Use the
[existing upgrade procedure](../../skills/_canonical/core/openrig-upgrade/SKILL.md).
The fixes have source reviews and focused regression coverage. The Claude
process checks use synthetic process metadata; an installed Claude/Fedora send
has not been demonstrated by that evidence. These checks do not establish
native receipt, automatic recovery, or protection against a process exiting
between verification and input. Final package and publication verification
remain separate from this source preparation.
+5 -5
View File
@@ -1,12 +1,12 @@
{
"name": "openrig",
"version": "0.6.0",
"version": "0.6.3",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "openrig",
"version": "0.6.0",
"version": "0.6.3",
"license": "Apache-2.0",
"workspaces": [
"packages/daemon",
@@ -7013,7 +7013,7 @@
},
"packages/cli": {
"name": "@openrig/cli",
"version": "0.6.0",
"version": "0.6.3",
"hasInstallScript": true,
"license": "Apache-2.0",
"dependencies": {
@@ -7047,7 +7047,7 @@
},
"packages/daemon": {
"name": "@openrig/daemon",
"version": "0.6.0",
"version": "0.6.3",
"license": "Apache-2.0",
"dependencies": {
"@hono/node-server": "^1.13.0",
@@ -7088,7 +7088,7 @@
},
"packages/ui": {
"name": "@openrig/ui",
"version": "0.6.0",
"version": "0.6.3",
"license": "Apache-2.0",
"dependencies": {
"@fontsource-variable/jetbrains-mono": "^5.2.8",
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "openrig",
"version": "0.6.0",
"version": "0.6.3",
"private": true,
"license": "Apache-2.0",
"type": "module",
@@ -13,7 +13,7 @@
"scripts": {
"build": "npm run build --workspaces",
"test": "npm run test:repo && npm run test:workspaces",
"test:repo": "npm run build -w packages/daemon && node --test scripts/*.test.mjs && node scripts/check-docs-guard.mjs && node scripts/mirror-skills.mjs --check && node scripts/generate-context-packs.mjs --check",
"test:repo": "npm run build -w packages/daemon && node --test --test-concurrency=1 scripts/*.test.mjs && node scripts/check-docs-guard.mjs && node scripts/mirror-skills.mjs --check && node scripts/generate-context-packs.mjs --check",
"test:workspaces": "npm run test -w packages/daemon -w packages/cli -w packages/tui",
"test:ui": "npm run test -w packages/ui",
"typecheck:prep": "npm run build -w packages/daemon",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@openrig/cli",
"version": "0.6.0",
"version": "0.6.3",
"type": "module",
"description": "Local control plane for multi-agent coding topologies",
"keywords": [
+14 -6
View File
@@ -77,7 +77,7 @@ export class DaemonTimeoutError extends DaemonConnectionError {
}
/**
* Bad-response: the daemon replied, but the body could not be read as JSON
* Bad-response: the daemon replied, but the body could not be read or parsed as JSON
* (truncated / unparseable / non-JSON — a real symptom under daemon saturation).
* DISTINCT from a stopped or unreachable daemon: the request WAS delivered and
* the outcome is unknown, so this must never render as daemon-not-running.
@@ -216,7 +216,7 @@ export class DaemonClient {
}, options);
}
private async fetch(path: string, init: RequestInit, options?: DaemonRequestOptions): Promise<Response> {
private async fetch(path: string, init: RequestInit, options?: DaemonRequestOptions, consumeResponse?: (response: Response) => Promise<void>): Promise<Response> {
const timeoutMs = options?.timeoutMs ?? this.timeoutMs;
if (options?.headers) {
init = { ...init, headers: { ...(init.headers as Record<string, string> ?? {}), ...options.headers } };
@@ -226,6 +226,7 @@ export class DaemonClient {
// Known remote or unproved direct endpoints carry origin; proven local requests remain bare.
this.identity ??= this.identityHeaders();
init = { ...init, headers: { ...(init.headers as Record<string, string> ?? {}), ...await this.identity } };
let responseStatus: number | undefined;
try {
const response = await fetchWithTimeout(
this.fetchImpl,
@@ -233,6 +234,10 @@ export class DaemonClient {
init,
{
timeoutMs,
consumeResponse: consumeResponse ? async (response) => {
responseStatus = response.status;
await consumeResponse(response);
} : undefined,
timeoutMessage: `Request to ${this.baseUrl}${path} timed out after ${timeoutMs}ms`,
},
);
@@ -249,18 +254,21 @@ export class DaemonClient {
if (err instanceof FetchTimeoutError) {
throw new DaemonTimeoutError(`The OpenRig daemon at ${this.baseUrl} did not respond in time: ${msg}`);
}
// Headers prove that the daemon received the request, but not that a write
// finished. A dropped body must preserve unknown-outcome guidance.
if (responseStatus !== undefined) throw new DaemonResponseError(responseStatus, "");
throw new DaemonConnectionError(`Cannot connect to the OpenRig daemon at ${this.baseUrl}: ${msg}`);
}
}
private async requestJson<T>(path: string, init: RequestInit, options?: DaemonRequestOptions): Promise<DaemonResponse<T>> {
const res = await this.fetch(path, init, options);
let text = "";
const res = await this.fetch(path, init, options, async (response) => { text = await response.text(); });
// Read the raw body once, THEN parse — so a truncated / unparseable response
// (a real symptom under daemon saturation) surfaces as a typed
// DaemonResponseError carrying the status + a bounded snippet, instead of a
// raw SyntaxError bubbling to a cryptic (json) or silent (human) CLI exit.
// A well-formed non-2xx body still parses and returns {status,data}; 204 has none.
const text = await res.text();
if (res.status === 204) return { status: res.status, data: undefined as T };
try {
return { status: res.status, data: JSON.parse(text) as T };
@@ -270,8 +278,8 @@ export class DaemonClient {
}
private async requestText(path: string, init: RequestInit, options?: DaemonRequestOptions): Promise<DaemonResponse<string>> {
const res = await this.fetch(path, init, options);
const data = await res.text();
let data = "";
const res = await this.fetch(path, init, options, async (response) => { data = await response.text(); });
return { status: res.status, data };
}
}
+1 -1
View File
@@ -84,7 +84,7 @@ export function attachCommand(depsOverride?: StatusDeps): Command {
}
const hasNode = !!opts.node;
const hasPodFields = !!opts.pod || !!opts.member || !!opts.runtime;
const hasPodFields = !!opts.pod || !!opts.member;
if (hasNode && hasPodFields) {
console.error("Specify either --node or --pod + --member + --runtime, not both.");
process.exitCode = 1;
+6 -3
View File
@@ -85,8 +85,10 @@ export function bundleCommand(depsOverride?: StatusDeps): Command {
// bundle sizes; if a bundle author hits this, the daemon-side
// operation is async-completable in a future /bundles/jobs/<id>
// surface (not in slice-05 scope).
// Paths are resolved here, against the operator's cwd: the daemon would otherwise resolve
// them against ITS cwd. Nothing is uploaded — the files must exist on the daemon's host.
const res = await client.post<Record<string, unknown>>("/api/bundles/create", {
specPath: spec, bundleName: opts.name, bundleVersion: opts.bundleVersion, outputPath: opts.output,
specPath: nodePath.resolve(spec), bundleName: opts.name, bundleVersion: opts.bundleVersion, outputPath: nodePath.resolve(opts.output),
includePackages: opts.includePackages,
rigRoot: opts.rigRoot ? nodePath.resolve(opts.rigRoot) : undefined,
provenance: buildClientProvenance(opts.notes),
@@ -117,7 +119,7 @@ export function bundleCommand(depsOverride?: StatusDeps): Command {
const client = await getClient(deps);
if (!client) { process.exitCode = 1; return; }
const res = await client.post<Record<string, unknown>>("/api/bundles/inspect", { bundlePath });
const res = await client.post<Record<string, unknown>>("/api/bundles/inspect", { bundlePath: nodePath.resolve(bundlePath) });
// Check for structured failures (200 with error or failed integrity)
const hasError = typeof res.data["error"] === "string";
@@ -166,7 +168,8 @@ export function bundleCommand(depsOverride?: StatusDeps): Command {
// daemon completed the mutating install — operator-unsafe retry
// path (rig_name_collision on second attempt). Bumped to 120s.
const res = await client.post<Record<string, unknown>>("/api/bundles/install", {
bundlePath, plan: opts.plan ?? false, autoApprove: opts.yes ?? false, targetRoot: opts.target,
bundlePath: nodePath.resolve(bundlePath), plan: opts.plan ?? false, autoApprove: opts.yes ?? false,
targetRoot: opts.target ? nodePath.resolve(opts.target) : undefined,
// Item 2 / slice-05 Checkpoint 3.3: send CLI version + skip flag for the
// daemon-side install-time compatibility check. CLI version read at call
// time (no module-level constant) via the existing getCliVersion helper.
+17 -7
View File
@@ -32,6 +32,22 @@ export function createIsProcessAlive(deps: ProcessAliveDeps): (pid: number) => b
};
}
type ExecFile = (file: string, args: string[], options: { encoding: "utf-8" }) => string;
// Windows has no ps(1) and no zombie state, so the signal probe alone decides liveness there.
export function readProcessState(
pid: number,
platform: NodeJS.Platform = process.platform,
run: ExecFile = execFileSync,
): string | null {
if (platform === "win32") return "R";
try {
return run("ps", ["-o", "state=", "-p", String(pid)], { encoding: "utf-8" });
} catch {
return null;
}
}
export function realDeps(): LifecycleDeps {
const isProcessAlive = createIsProcessAlive({
signalCheck: (pid) => {
@@ -42,13 +58,7 @@ export function realDeps(): LifecycleDeps {
return false;
}
},
readProcessState: (pid) => {
try {
return execFileSync("ps", ["-o", "state=", "-p", String(pid)], { encoding: "utf-8" });
} catch {
return null;
}
},
readProcessState: (pid) => readProcessState(pid),
});
return {
+6
View File
@@ -58,6 +58,12 @@ Examples:
}
const receipt = res.data["receipt"] as Record<string, unknown> | null;
const probeStatus = res.data["probeStatus"];
if (probeStatus === "stale" || probeStatus === "no_orchestrator") {
const probeError = res.data["probeError"];
console.error(`Service status is ${probeStatus === "stale" ? "stale" : "unverified"} (probe: ${probeStatus}); ${receipt ? "showing the saved receipt" : "no saved receipt is available"}.${typeof probeError === "string" && probeError ? ` ${probeError}` : ""}`);
}
if (!receipt) {
console.log("Services configured but no receipt available yet.");
return;
+43 -4
View File
@@ -35,6 +35,11 @@ export const C1_VERDICTS = ["CLEAR", "BLOCKING", "CONCERNING", "PASS", "NOT-CLEA
/** Video extensions for the C8 UX advisory (screencast evidence). */
const VIDEO_EXTENSIONS = new Set([".mp4", ".mov", ".webm", ".m4v", ".avi", ".mkv"]);
const BINARY_EXTENSIONS = new Set([
".png", ".jpg", ".jpeg", ".gif", ".webp", ".bmp", ".pdf",
".mp3", ".wav", ".ogg", ".mp4", ".mov", ".webm", ".m4v", ".avi", ".mkv",
".zip", ".gz", ".7z", ".exe",
]);
export interface C1Header {
slice: string;
@@ -183,7 +188,8 @@ checkboxes do not accept an item under the selected proof policy.
.option("--slice-id <dot-id>", "C1 slice dot-ID (defaults to the slice frontmatter id)")
.option("--file <path>", "Artifact body from a file (mutually exclusive with --body)")
.option("--body <text>", "Artifact body inline (mutually exclusive with --file)")
.option("--name <filename>", "Artifact filename in proof/ (defaults to the --file basename, else <artifact-type>-<verdict>-<UTC>.md)")
.option("--name <filename>", "Markdown artifact filename in proof/ (defaults to the --file stem plus .md, else <artifact-type>-<verdict>-<UTC>.md)")
.option("--replace", "Explicitly replace an existing Markdown artifact")
.option("--evidences <refs>", "D2 attestation: comma-separated proof-contract item refs this artifact covers (item text or 1-based index)")
.option("--self-check <text>", "D2 attestation: the agent's assertion that it LOOKED at the evidence and confirmed it shows the claim")
.option("--media <refs>", "Corrective §3.4: comma-separated media refs (relative to the slice proof/ dir) this drop stands behind — appended to the artifact body as markdown refs so the composer curates them into delivered.items[].proof")
@@ -198,6 +204,7 @@ checkboxes do not accept an item under the selected proof policy.
file?: string;
body?: string;
name?: string;
replace?: boolean;
evidences?: string;
selfCheck?: string;
media?: string;
@@ -228,7 +235,23 @@ checkboxes do not accept an item under the selected proof policy.
action: "Point --file at the evidence file, or use --body.",
});
}
body = fs.readFileSync(opts.file, "utf8");
const input = fs.readFileSync(opts.file);
if (BINARY_EXTENSIONS.has(path.extname(opts.file).toLowerCase()) || input.includes(0)) {
throw new ScopeCliError({
fact: `--file ${opts.file} is binary, not an artifact body.`,
consequence: "The artifact was NOT dropped and the source file was not changed.",
action: "Attach screenshots and other binary evidence with --media instead.",
});
}
try {
body = new TextDecoder("utf-8", { fatal: true }).decode(input);
} catch {
throw new ScopeCliError({
fact: `--file ${opts.file} is not valid UTF-8 text.`,
consequence: "The artifact was NOT dropped and the source file was not changed.",
action: "Use a UTF-8 text file for --file, or attach binary evidence with --media.",
});
}
} else if (opts.body) {
body = opts.body;
}
@@ -402,7 +425,7 @@ checkboxes do not accept an item under the selected proof policy.
// Write the artifact: YAML frontmatter + body into proof/.
const proofDir = path.join(slice.absPath, "proof");
const defaultName = `${opts.artifactType}-${opts.verdict}-${new Date().toISOString().replace(/[:.]/g, "-")}.md`;
const fileName = opts.name ?? (opts.file ? path.basename(opts.file) : defaultName);
const fileName = opts.name ?? (opts.file ? `${path.parse(opts.file).name}.md` : defaultName);
// rev1-r2 BLOCKING fix (a7dedd93 review): --name is a FILENAME, never
// a path. Reject separators / dot-dot / absolute shapes BEFORE any
// filesystem effect, so the drop can only land inside proof/ (the
@@ -415,6 +438,13 @@ checkboxes do not accept an item under the selected proof policy.
action: "Pass a bare filename like qa-clear.md; the drop path owns the directory.",
});
}
if (!fileName.toLowerCase().endsWith(".md")) {
throw new ScopeCliError({
fact: `--name '${fileName}' is not a Markdown artifact filename.`,
consequence: "The artifact was NOT dropped; proof media cannot be replaced by a Markdown body.",
action: "Use a .md name for the artifact and attach binary files with --media.",
});
}
const target = path.resolve(proofDir, fileName);
// Defense-in-depth: even a name that slips the shape check must
// resolve INSIDE proof/ (same containment discipline as
@@ -428,7 +458,16 @@ checkboxes do not accept an item under the selected proof policy.
}
fs.mkdirSync(proofDir, { recursive: true });
const frontmatter = YAML.stringify(header).trimEnd();
fs.writeFileSync(target, `---\n${frontmatter}\n---\n\n${body}`, "utf8");
try {
fs.writeFileSync(target, `---\n${frontmatter}\n---\n\n${body}`, { encoding: "utf8", flag: opts.replace ? "w" : "wx" });
} catch (err) {
if ((err as NodeJS.ErrnoException).code !== "EEXIST") throw err;
throw new ScopeCliError({
fact: `Proof artifact '${fileName}' already exists.`,
consequence: "The existing artifact was not changed.",
action: "Choose another --name, or pass --replace to deliberately update this Markdown artifact.",
});
}
// Echo the parsed header — the seat sees what the composer will see.
const echo = {
+3
View File
@@ -51,6 +51,9 @@ export function removeCommand(depsOverride?: StatusDeps): Command {
}
console.log(`Removed node ${res.data["logicalId"]} from rig ${res.data["rigId"]} (${res.data["sessionsKilled"]} session killed)`);
if (typeof res.data["sessionKeptFor"] === "string") {
console.log(`Session kept: owned by ${res.data["sessionKeptFor"]}`);
}
});
return cmd;
+21 -5
View File
@@ -1,5 +1,5 @@
import { Command } from "commander";
import { DaemonClient, terminalAuthHeaders } from "../client.js";
import { DaemonClient, DaemonTimeoutError, terminalAuthHeaders } from "../client.js";
import { getDaemonStatus, getDaemonUrl , daemonStatusGuard} from "../daemon-lifecycle.js";
import { realDeps } from "./daemon.js";
import type { StatusDeps } from "./status.js";
@@ -477,10 +477,26 @@ Examples:
const daemon = await getDaemonStatus(deps.lifecycleDeps);
if (!daemonStatusGuard(daemon)) return;
const client = deps.clientFactory(getDaemonUrl(daemon));
const res = await client.post<Record<string, unknown>>(
`/api/seat/${path}/${encodeURIComponent(seat)}`,
body,
);
let res;
try {
const route = `/api/seat/${path}/${encodeURIComponent(seat)}`;
res = path === "launch"
? await client.post<Record<string, unknown>>(route, body, { timeoutMs: 120_000 })
: await client.post<Record<string, unknown>>(route, body);
} catch (err) {
if (path !== "launch" || !(err instanceof DaemonTimeoutError)) throw err;
const error = {
ok: false as const,
code: "launch_outcome_unknown",
status: "unknown",
message: "The CLI timed out waiting for the daemon; the launch may still be in progress.",
guidance: `Check the outcome before retrying: rig seat status ${seat}`,
};
if (opts.json) console.log(JSON.stringify(error, null, 2));
else printSeatError(error, error.message);
process.exitCode = 1;
return;
}
if (opts.json) {
console.log(JSON.stringify(res.data, null, 2));
if (res.status >= 400) process.exitCode = res.status >= 500 ? 2 : 1;
+87 -16
View File
@@ -2,6 +2,7 @@ import { Command } from "commander";
import { execSync } from "node:child_process";
import { readFileSync, writeFileSync, existsSync, accessSync, constants, mkdirSync } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { parseDocument } from "yaml";
import { runDoctorChecks, type DoctorDeps } from "./doctor.js";
import { resolveDaemonPath } from "../daemon-lifecycle.js";
@@ -14,6 +15,8 @@ import {
upsertCmuxSocketControlMode,
} from "../cmux-config.js";
import { buildTmuxControlFailure, probeTmuxControl } from "../tmux-health.js";
import { parse as parseToml } from "smol-toml";
import { resolveCodexHome } from "../lib/codex-auth.js";
export interface SetupStep {
id: string;
@@ -56,6 +59,43 @@ export interface SetupDeps {
exists: (path: string) => boolean;
mkdirp?: (path: string) => void;
platform?: NodeJS.Platform;
/** Environment for CODEX_HOME and provider credential checks (default process.env). */
env?: NodeJS.ProcessEnv;
}
/** Issue #194 — how the Codex provider selected in `$CODEX_HOME/config.toml`
* authenticates. Only an explicit provider entry with
* `requires_openai_auth = false` and an `env_key` uses its credential
* variable; every unresolved case keeps the OpenAI login check. Other Codex
* config layers are not resolved here. The daemon's kernel probe
* (`selectCodexProviderAuth` in kernel-boot.ts) carries the same rule. */
export type CodexProviderAuth =
| { kind: "openai-login"; unresolved?: string }
| { kind: "env-key"; providerId: string; envKey: string };
export function selectCodexProviderAuth(configToml: string | null): CodexProviderAuth {
if (configToml === null) return { kind: "openai-login" };
let config: Record<string, unknown>;
try {
config = parseToml(configToml) as Record<string, unknown>;
} catch {
return { kind: "openai-login", unresolved: "config.toml could not be parsed" };
}
if (Object.hasOwn(config, "profile")) {
return { kind: "openai-login", unresolved: "config.toml selects a legacy profile, which is not resolved here" };
}
const providerId = config["model_provider"];
const providers = config["model_providers"];
if (typeof providerId !== "string" || !providers || typeof providers !== "object" || !Object.hasOwn(providers, providerId)) {
return { kind: "openai-login" };
}
const entry = (providers as Record<string, unknown>)[providerId];
if (!entry || typeof entry !== "object") return { kind: "openai-login" };
const { requires_openai_auth: requiresOpenAiAuth, env_key: envKey } = entry as Record<string, unknown>;
if (requiresOpenAiAuth !== false || typeof envKey !== "string" || !/^[A-Za-z_][A-Za-z0-9_]*$/.test(envKey)) {
return { kind: "openai-login" };
}
return { kind: "env-key", providerId, envKey };
}
const DEFAULT_COMMAND_TIMEOUT_MS = 30_000;
@@ -562,17 +602,38 @@ export async function runSetup(deps: SetupDeps, opts: { dryRun?: boolean; full?:
}
if (codexInstalled) {
try {
deps.exec("codex login status");
steps.push({ id: "codex_auth", status: "pass", message: "Codex authentication available." });
} catch (err) {
steps.push({
id: "codex_auth",
status: "fail",
message: `Codex is installed but not ready to launch: ${(err as Error).message}`,
reason: "Codex seats cannot launch until the Codex CLI is logged in and usable.",
fixHint: "Run `codex login` and complete authentication, then rerun `rig setup` or `rig doctor`.",
});
const env = deps.env ?? process.env;
const codexAuth = selectCodexProviderAuth(deps.readFile(path.join(resolveCodexHome(env).codexHome, "config.toml")));
if (codexAuth.kind === "env-key") {
if (env[codexAuth.envKey]?.trim()) {
steps.push({
id: "codex_auth",
status: "pass",
message: `Codex provider "${codexAuth.providerId}" does not use an OpenAI login, and its credential variable ${codexAuth.envKey} is set. This confirms a local credential is available, not that the provider accepts it or that managed seats receive it.`,
});
} else {
steps.push({
id: "codex_auth",
status: "fail",
message: `Codex provider "${codexAuth.providerId}" needs ${codexAuth.envKey}, which is not set in this environment.`,
reason: "Codex seats using this provider cannot authenticate without that variable.",
fixHint: `Export ${codexAuth.envKey} in the environment that runs rig setup and the OpenRig daemon, then rerun \`rig setup\`.`,
});
}
} else {
try {
deps.exec("codex login status");
steps.push({ id: "codex_auth", status: "pass", message: "Codex authentication available." });
} catch (err) {
const unresolved = codexAuth.unresolved ? ` (${codexAuth.unresolved}, so the OpenAI login was checked)` : "";
steps.push({
id: "codex_auth",
status: "fail",
message: `Codex is installed but not ready to launch${unresolved}: ${(err as Error).message}`,
reason: "Codex seats cannot launch until the Codex CLI is logged in and usable.",
fixHint: "Run `codex login` and complete authentication, then rerun `rig setup` or `rig doctor`.",
});
}
}
} else {
steps.push({
@@ -677,7 +738,7 @@ export async function runSetup(deps: SetupDeps, opts: { dryRun?: boolean; full?:
function buildDefaultDoctorDeps(setupDeps: SetupDeps): DoctorDeps {
const platform = setupDeps.platform ?? process.platform;
const baseDir = path.dirname(path.dirname(new URL(import.meta.url).pathname));
const baseDir = path.dirname(path.dirname(fileURLToPath(new URL(import.meta.url))));
return {
exists: setupDeps.exists,
baseDir,
@@ -710,11 +771,12 @@ export function goldenPathNextSteps(): string[] {
return [
"Next steps (the guided path; full reference: docs/reference/getting-started.md):",
" 1. cd <your-repository> Choose the code the team will work on",
" 2. rig up first-project --cwd . Launch an owner + checker (Codex); auto-starts daemon and kernel",
" 3. rig status Check daemon/kernel readiness; rig ps --nodes --rig first-project checks the team",
" 4. rig send dev-owner@first-project '<one useful change, boundaries, and how to check it>'",
" 2. Choose first-project (two Codex), first-project-claude (two Claude), or first-project-mixed; check only selected logins",
" Preview rig up <starter> --cwd . --plan, then rig up <starter> --cwd .; daemon and kernel start automatically",
" 3. rig status Check daemon/kernel readiness; rig ps --nodes --rig <starter> checks the team",
" 4. rig send dev-owner@<starter> '<one useful change, boundaries, and how to check it>'",
" 5. rig tui --shared Join the kernel dashboard; plain rig tui opens your own view",
" Next: rig queue list --rig first-project; rig workspace doctor; rig scope ...; rig workflow specs",
" Next: rig queue list --destination dev-owner@<starter>; rig workspace doctor; rig scope ...; rig workflow specs",
];
}
@@ -729,6 +791,15 @@ export function goldenPathNextSteps(): string[] {
*/
export function permissionPolicyMenuLines(): string[] {
return [
"Before team launch, your agent asks once (reuse an existing explicit choice):",
" Allow your agents to run OpenRig commands without repeated permission prompts?",
" Yes — recommended / No — keep prompts. No answer leaves settings unchanged too.",
" Includes all rig verbs, lifecycle/config changes and launching processes; not global YOLO or authority to invent work.",
" Personal project scope unless you explicitly choose user-wide sessions. On Yes, the agent adds native rules, preserving stricter rules.",
" Procedure: rig context get skills/applying-a-permission-policy/SKILL.md",
" Undo: ask your agent to remove only the OpenRig command allowances added by this setup.",
" This printed guidance collects no answer and writes no native rules; --policy below is a separate spec choice.",
"",
"Permission policy (optional — recording is a thought, not a gate; `rig up` always works without one):",
" Policy Mode:",
" Locked The most restrictive built-in policy.",
+6 -1
View File
@@ -19,6 +19,7 @@ type ShrinkResponse = {
nodeId: string;
status: "removed" | "failed";
sessionsKilled: number;
sessionKeptFor?: string;
error?: string;
}>;
error?: string;
@@ -74,7 +75,8 @@ export function shrinkCommand(depsOverride?: StatusDeps): Command {
for (const node of res.data.nodes ?? []) {
const icon = node.status === "removed" ? "OK" : "FAIL";
const error = node.error ? ` — ${node.error}` : "";
console.log(` [${icon}] ${node.logicalId}${error}`);
const kept = node.sessionKeptFor ? ` (session kept: owned by ${node.sessionKeptFor})` : "";
console.log(` [${icon}] ${node.logicalId}${kept}${error}`);
}
process.exitCode = 1;
return;
@@ -83,6 +85,9 @@ export function shrinkCommand(depsOverride?: StatusDeps): Command {
console.log(
`Removed pod ${res.data.namespace} from rig ${res.data.rigId} (${res.data.removedLogicalIds?.length ?? 0} node(s), ${res.data.sessionsKilled} session killed)`
);
for (const node of res.data.nodes ?? []) {
if (node.sessionKeptFor) console.log(` ${node.logicalId}: session kept, owned by ${node.sessionKeptFor}`);
}
});
return cmd;
+9 -4
View File
@@ -80,7 +80,7 @@ Examples:
.option("--plan", "Plan mode — preview without executing")
.option("--yes", "Auto-approve trusted actions")
.option("--cwd <path>", "Override launch working directory for all members for this run only")
.option("--target <root>", "Target root directory for package installation (.rigbundle only; does not change agent cwd)")
.option("--target <root>", "Install target for a .rigbundle (default: current directory). A v2 bundle is materialized there and relative member cwds resolve against it; --cwd still overrides launch cwd")
.option("--existing", "Treat <source> as an existing rig name; bypass library-spec name resolution")
.option("--fresh <seats...>", "Deliberately fresh-prime the named seats (logical ids) instead of resuming their original sessions (operation B; reported as fresh-primed)")
.option("--json", "JSON output for agents")
@@ -339,7 +339,7 @@ Examples:
}
const isRigBundle = !isRigName && /\.rigbundle$/i.test(sourceRef);
const targetRoot = opts.target ?? (isRigBundle ? process.cwd() : undefined);
const targetRoot = opts.target ? nodePath.resolve(opts.target) : (isRigBundle ? process.cwd() : undefined);
// OPR.0.3.2.22 Bug 3 — extend the bare `rig up <builtin>` default-cwd
// treatment to path-form. Builtin starter specs declare member-level
@@ -451,6 +451,10 @@ Examples:
for (const node of nodes ?? []) {
console.error(` ${node.logicalId}${node.sessionName ? ` (${node.sessionName})` : ""}: ${node.reason}`);
}
// #141: the rig is kept on this path, so its warnings (e.g. the archived earlier generation) still apply.
for (const w of (res.data["warnings"] as string[]) ?? []) {
console.error(` warning: ${w}`);
}
} else if (code === "cycle_error") {
console.error("Cycle detected in rig topology. Check edge definitions for circular dependencies.");
} else if (code === "validation_failed") {
@@ -464,11 +468,12 @@ Examples:
} else if (code === "invalid_topology_manifest") {
const errors = (res.data["errors"] as string[]) ?? [];
console.error(`Topology manifest invalid:\n${errors.map((e) => ` ${e}`).join("\n")}\nFix: the manifest key set is CLOSED — rigs[]{source, host?} plus optional concurrency.`);
} else if (code === "rig_name_running") {
} else if (code === "rig_name_running" || code === "generation_unconfirmed") {
// S5b final-fix F1 (OPR.0.5.4.11): the guard's teaching refusal is
// self-describing (running rig identity, what was checked,
// nothing-created, alternatives) — render it verbatim, never the
// generic unknown-error/validate-your-spec fallback.
// generic unknown-error/validate-your-spec fallback. #141's
// generation_unconfirmed refusal is self-describing the same way.
const teaching = String(res.data["error"] ?? ((res.data["errors"] as string[]) ?? [])[0] ?? "A rig with this name is already running.");
console.error(teaching);
} else {
+3 -1
View File
@@ -63,13 +63,15 @@ export function viewCommand(depsOverride?: ViewDeps): Command {
.option("--rig <rig>", "Filter by rig name (matches destination_session OR source_session @<rig>)")
.option("--limit <n>", "Result row limit", "100")
.option("--mission <id>", "Mission scope for the execution view (defaults to the newest release-* mission)")
.option("--project <name>", "Project scope for the execution view")
.option("--json", "JSON output for agents")
.action(async (viewName: string, opts: { rig?: string; limit: string; mission?: string; json?: boolean }) => {
.action(async (viewName: string, opts: { rig?: string; limit: string; mission?: string; project?: string; json?: boolean }) => {
const deps = getDeps();
const params = new URLSearchParams();
if (opts.rig) params.set("rig", opts.rig);
if (opts.limit) params.set("limit", opts.limit);
if (opts.mission) params.set("mission", opts.mission);
if (opts.project) params.set("project", opts.project);
const query = params.toString();
await withClient(deps, async (client) => {
const path = `/api/views/${encodeURIComponent(viewName)}${query ? `?${query}` : ""}`;
+7 -2
View File
@@ -1,4 +1,5 @@
import { spawn as nodeSpawn, type ChildProcess } from "node:child_process";
import { StringDecoder } from "node:string_decoder";
import type { HostEntry } from "./host-registry.js";
/**
@@ -114,14 +115,16 @@ export async function runCrossHostCommand(
let stdout = "";
let stderr = "";
const stdoutDecoder = new StringDecoder("utf8");
const stderrDecoder = new StringDecoder("utf8");
if (child.stdout) {
child.stdout.on("data", (chunk: Buffer | string) => {
stdout += typeof chunk === "string" ? chunk : chunk.toString("utf-8");
stdout += typeof chunk === "string" ? chunk : stdoutDecoder.write(chunk);
});
}
if (child.stderr) {
child.stderr.on("data", (chunk: Buffer | string) => {
stderr += typeof chunk === "string" ? chunk : chunk.toString("utf-8");
stderr += typeof chunk === "string" ? chunk : stderrDecoder.write(chunk);
});
}
@@ -133,6 +136,8 @@ export async function runCrossHostCommand(
});
});
stdout += stdoutDecoder.end();
stderr += stderrDecoder.end();
return classifyResult(exitCode, stdout, stderr);
}
+5 -1
View File
@@ -8,6 +8,8 @@ export class FetchTimeoutError extends Error {
export interface FetchWithTimeoutOptions {
timeoutMs: number;
timeoutMessage: string;
/** Consume finite response bodies before releasing the request deadline. */
consumeResponse?: (response: Response) => Promise<void>;
}
export async function fetchWithTimeout(
@@ -38,7 +40,9 @@ export async function fetchWithTimeout(
}
try {
return await fetchImpl(url, { ...init, signal: controller.signal });
const response = await fetchImpl(url, { ...init, signal: controller.signal });
await options.consumeResponse?.(response);
return response;
} catch (err) {
if (err instanceof FetchTimeoutError) throw err;
if (err instanceof Error && err.name === "AbortError") {
+11 -3
View File
@@ -39,6 +39,7 @@
import os from "node:os";
import path from "node:path";
import { StringDecoder } from "node:string_decoder";
import { spawn as nodeSpawn } from "node:child_process";
import { loadHostRegistry, resolveHost, type SshHostEntry } from "./../host-registry.js";
import { looksLikePermissionGate } from "./../cross-host-executor.js";
@@ -131,7 +132,10 @@ export function checkLocalPath(raw: string): PathCheck {
error: `refused: '${raw}' resolves into the active OPENRIG_HOME (${activeOpenRigHome}) — live OpenRig state is not a copy source/target in v0 (crash-safety). This is the FR-4 default-deny wall (a short closed list; extension requires a ruling).`,
};
}
return { ok: true, normalizedPath: resolved };
// rsync distinguishes a directory from its contents by the source's trailing separator.
const normalizedPath = raw.endsWith(path.sep) && !resolved.endsWith(path.sep)
? resolved + path.sep : resolved;
return { ok: true, normalizedPath };
}
/** Remote side: posix-normalize, then the wall — absolute-only (arch Q5),
@@ -328,12 +332,14 @@ export async function runFileCopy(plan: CopyPlan, deps: { spawn?: SpawnFn } = {}
let stdout = "";
let stderr = "";
const stdoutDecoder = new StringDecoder("utf8");
const stderrDecoder = new StringDecoder("utf8");
let spawnFailed: NodeJS.ErrnoException | null = null;
child.stdout?.on("data", (chunk: Buffer | string) => {
stdout += typeof chunk === "string" ? chunk : chunk.toString("utf-8");
stdout += typeof chunk === "string" ? chunk : stdoutDecoder.write(chunk);
});
child.stderr?.on("data", (chunk: Buffer | string) => {
stderr += typeof chunk === "string" ? chunk : chunk.toString("utf-8");
stderr += typeof chunk === "string" ? chunk : stderrDecoder.write(chunk);
});
const exitCode: number | null = await new Promise((resolve) => {
@@ -344,6 +350,8 @@ export async function runFileCopy(plan: CopyPlan, deps: { spawn?: SpawnFn } = {}
child.on("close", (code: number | null) => resolve(code));
});
stdout += stdoutDecoder.end();
stderr += stderrDecoder.end();
if (spawnFailed !== null && (spawnFailed as NodeJS.ErrnoException).code === "ENOENT") {
return {
ok: false,
+20
View File
@@ -60,6 +60,7 @@ function runningDeps(port: number): StatusDeps {
describe("Attach CLI", () => {
let server: http.Server;
let port: number;
let receivedBody: Record<string, unknown>;
beforeAll(async () => {
server = http.createServer(async (req, res) => {
@@ -68,6 +69,7 @@ describe("Attach CLI", () => {
if (req.url === "/api/rigs/rig-1/attach-self" && req.method === "POST") {
const parsed = body ? JSON.parse(body) : {};
receivedBody = parsed;
const logicalId = parsed.logicalId ?? `${parsed.podNamespace}.${parsed.memberName}`;
res.writeHead(201, { "Content-Type": "application/json" });
res.end(JSON.stringify({
@@ -119,6 +121,16 @@ describe("Attach CLI", () => {
expect(output).toContain("inbound tmux transport unavailable");
});
it("attach --self --node accepts the advertised runtime guard", async () => {
const { logs, exitCode } = await captureLogs(async () => {
await makeCmd().parseAsync(["node", "rig", "attach", "--self", "--rig", "rig-1", "--node", "orch1.lead", "--runtime", "codex"]);
});
expect(exitCode).toBeUndefined();
expect(logs.join("\n")).toContain("Attached this shell to node orch1.lead");
expect(receivedBody).toMatchObject({ logicalId: "orch1.lead", runtime: "codex" });
});
it("attach --self --print-env prints shell exports only", async () => {
const { logs, exitCode } = await captureLogs(async () => {
await makeCmd().parseAsync(["node", "rig", "attach", "--self", "--rig", "rig-1", "--node", "orch1.lead", "--print-env"]);
@@ -140,6 +152,14 @@ describe("Attach CLI", () => {
expect(logs).toEqual([]);
});
it.each(["--pod", "--member"])("attach rejects node mode combined with %s", async (flag) => {
const { logs, exitCode } = await captureLogs(async () => {
await makeCmd().parseAsync(["node", "rig", "attach", "--self", "--rig", "rig-1", "--node", "orch1.lead", "--runtime", "codex", flag, "orch1"]);
});
expect(exitCode).toBe(1);
expect(logs.join("\n")).toContain("Specify either");
});
it("attach rejects incomplete pod mode before calling the daemon", async () => {
const { logs, exitCode } = await captureLogs(async () => {
await makeCmd().parseAsync(["node", "rig", "attach", "--self", "--rig", "rig-1", "--pod", "orch1", "--member", "lead"]);
+42
View File
@@ -1,5 +1,6 @@
import { describe, it, expect, vi, beforeAll, afterAll } from "vitest";
import http from "node:http";
import nodePath from "node:path";
import { Command } from "commander";
import { bundleCommand } from "../src/commands/bundle.js";
import { DaemonClient } from "../src/client.js";
@@ -60,6 +61,7 @@ function runningDeps(port: number): StatusDeps {
let capturedCreateBodies: Record<string, unknown>[] = [];
// Captured install bodies for assertion (Item 2 Checkpoint 3.3)
let capturedInstallBodies: Record<string, unknown>[] = [];
let capturedInspectBodies: Record<string, unknown>[] = [];
describe("Bundle CLI", () => {
let server: http.Server;
@@ -97,6 +99,7 @@ describe("Bundle CLI", () => {
}));
} else if (req.url === "/api/bundles/inspect" && req.method === "POST") {
const parsed = JSON.parse(body || "{}");
capturedInspectBodies.push(parsed);
if (String(parsed.bundlePath ?? "").includes("bad")) {
res.writeHead(500, { "Content-Type": "application/json" });
res.end(JSON.stringify({ error: "Inspect failed" }));
@@ -272,6 +275,45 @@ describe("Bundle CLI", () => {
expect(exitCode).toBe(1);
});
// The daemon resolves any relative path against ITS OWN cwd, so every path the CLI sends must
// already be absolute (resolved against the operator's cwd). Files are not transported.
it("bundle create/inspect/install send spec, output, bundle, and target as client-absolute paths", async () => {
capturedCreateBodies = [];
capturedInspectBodies = [];
capturedInstallBodies = [];
await captureLogs(async () => {
await makeCmd().parseAsync(["node", "rig", "bundle", "create", "rel/rig.yaml", "-o", "out/rel.rigbundle"]);
await makeCmd().parseAsync(["node", "rig", "bundle", "inspect", "out/rel.rigbundle"]);
await makeCmd().parseAsync(["node", "rig", "bundle", "install", "out/rel.rigbundle", "--yes", "--target", "proj"]);
});
const sent = {
specPath: capturedCreateBodies.at(-1)?.["specPath"],
outputPath: capturedCreateBodies.at(-1)?.["outputPath"],
inspectBundlePath: capturedInspectBodies.at(-1)?.["bundlePath"],
installBundlePath: capturedInstallBodies.at(-1)?.["bundlePath"],
targetRoot: capturedInstallBodies.at(-1)?.["targetRoot"],
};
console.log(`[client-paths] cwd=${process.cwd()} sent=${JSON.stringify(sent)}`);
expect(sent).toEqual({
specPath: nodePath.resolve("rel/rig.yaml"),
outputPath: nodePath.resolve("out/rel.rigbundle"),
inspectBundlePath: nodePath.resolve("out/rel.rigbundle"),
installBundlePath: nodePath.resolve("out/rel.rigbundle"),
targetRoot: nodePath.resolve("proj"),
});
});
it("control: bundle install --plan without --target still sends no targetRoot", async () => {
capturedInstallBodies = [];
await captureLogs(async () => {
await makeCmd().parseAsync(["node", "rig", "bundle", "install", "/tmp/test.rigbundle", "--plan"]);
});
const body = capturedInstallBodies.at(-1)!;
expect(body["plan"]).toBe(true);
expect(body["targetRoot"]).toBeUndefined();
expect(body["bundlePath"]).toBe("/tmp/test.rigbundle");
});
// T6: bundle create --rig-root passes rigRoot in request body
it("bundle create --rig-root passes rigRoot in request body", async () => {
capturedCreateBodies = [];
@@ -0,0 +1,100 @@
import { afterEach, describe, expect, it } from "vitest";
import http from "node:http";
import type { AddressInfo } from "node:net";
import { Command } from "commander";
import { runProgram } from "../src/cli-error.js";
import { DaemonClient, DaemonTimeoutError } from "../src/client.js";
let server: http.Server | undefined;
afterEach(async () => {
if (!server) return;
server.closeAllConnections();
await new Promise<void>((resolve) => server!.close(() => resolve()));
server = undefined;
});
async function slowBodyServer(delayMs: number) {
let requests = 0;
let closedBeforeEnd = 0;
let response: http.ServerResponse | undefined;
let markHeadersWritten: () => void;
const headersWritten = new Promise<void>((resolve) => { markHeadersWritten = resolve; });
server = http.createServer(async (req, res) => {
for await (const _chunk of req) { /* consume the actual request body */ }
requests++;
response = res;
res.writeHead(200, { "Content-Type": "application/json" });
res.write('{"ok":'); // fetch resolves headers, while body remains incomplete
markHeadersWritten();
const timer = setTimeout(() => res.end("true}"), delayMs);
res.on("close", () => {
if (!res.writableEnded) closedBeforeEnd++;
clearTimeout(timer);
});
});
await new Promise<void>((resolve) => server!.listen(0, "127.0.0.1", resolve));
return { url: `http://127.0.0.1:${(server.address() as AddressInfo).port}`,
requests: () => requests, closedBeforeEnd: () => closedBeforeEnd,
headersWritten, dropBody: () => response!.destroy() };
}
function observedFetch() {
let markHeadersReceived: () => void;
const headersReceived = new Promise<void>((resolve) => { markHeadersReceived = resolve; });
const fetchImpl: typeof fetch = async (input, init) => {
const response = await fetch(input, init);
markHeadersReceived();
return response;
};
return { fetchImpl, headersReceived };
}
describe("DaemonClient response body deadline", () => {
it.each(["json", "text", "write"])("bounds %s body reads after headers arrive", async (kind) => {
const endpoint = await slowBodyServer(4_000);
const observed = observedFetch();
const client = new DaemonClient(endpoint.url, { timeoutMs: 1_000, fetchImpl: observed.fetchImpl });
const request = kind === "json" ? client.get("/read") : kind === "text" ? client.getText("/read") : client.post("/write", { action: "once" });
const result = request.then(() => null, (error: unknown) => error);
await expect(Promise.race([endpoint.headersWritten.then(() => "headers written"), result])).resolves.toBe("headers written");
await expect(Promise.race([observed.headersReceived.then(() => "headers received"), result])).resolves.toBe("headers received");
expect(await result).toBeInstanceOf(DaemonTimeoutError);
expect(endpoint.requests()).toBe(1); // no automatic retry of an accepted write
await expect.poll(endpoint.closedBeforeEnd).toBe(1); // cancel the body/socket, not just the caller promise
});
it.each([false, true])("reports an unknown POST outcome after the response body drops (json=%s)", async (json) => {
const endpoint = await slowBodyServer(4_000);
const observed = observedFetch();
const client = new DaemonClient(endpoint.url, { timeoutMs: 2_000, fetchImpl: observed.fetchImpl });
const program = new Command().option("--json");
program.command("write").action(async () => { await client.post("/write", { action: "once" }); });
const out: string[] = [];
const err: string[] = [];
const exitCodes: number[] = [];
const run = runProgram(program, ["node", "rig", "write", ...(json ? ["--json"] : [])], {
out: (line) => out.push(line), err: (line) => err.push(line), exit: (code) => exitCodes.push(code),
});
await expect(Promise.race([endpoint.headersWritten.then(() => "headers written"), run])).resolves.toBe("headers written");
await expect(Promise.race([observed.headersReceived.then(() => "headers received"), run])).resolves.toBe("headers received");
endpoint.dropBody();
expect(await run).toBe(1);
expect(exitCodes).toEqual([1]);
const guidance = (json ? out : err).join("\n");
expect(guidance).toMatch(/unreadable response/i);
expect(guidance).toMatch(/outcome.*UNKNOWN/i);
expect(guidance).toMatch(/re-check current state/i);
expect(guidance).not.toMatch(/not delivered|cannot connect|rig up|rig daemon start/i);
if (json) expect(JSON.parse(guidance).error.consequence).toMatch(/UNKNOWN/);
expect(endpoint.requests()).toBe(1);
await expect.poll(endpoint.closedBeforeEnd).toBe(1);
});
it("uses the per-request deadline through the complete body", async () => {
const endpoint = await slowBodyServer(100);
const client = new DaemonClient(endpoint.url, { timeoutMs: 20 });
await expect(client.get("/read", { timeoutMs: 1_000 })).resolves.toEqual({ status: 200, data: { ok: true } });
expect(endpoint.requests()).toBe(1);
expect(endpoint.closedBeforeEnd()).toBe(0);
});
});
@@ -1,5 +1,6 @@
import { describe, it, expect, vi } from "vitest";
import { EventEmitter } from "node:events";
import { spawn as spawnChild } from "node:child_process";
import {
runCrossHostCommand,
classifyResult,
@@ -341,3 +342,52 @@ describe("D13 — remote rig resolution + loud 127", () => {
expect(d13Classify(255, "", "Permission denied (publickey)").failedStep).toBe("permission-gate");
});
});
describe("remote output byte boundaries", () => {
it("preserves UTF-8 from real child stdout and stderr pipes", async () => {
const expected = "界🙂café";
const spawn: SpawnFn = () => spawnChild(process.execPath, ["-e", `
const bytes = Buffer.from(${JSON.stringify(expected)});
let i = 0;
const timer = setInterval(() => {
process.stdout.write(bytes.subarray(i, i + 1));
process.stderr.write(bytes.subarray(i, i + 1));
if (++i === bytes.length) clearInterval(timer);
}, 20);
`]);
const result = await runCrossHostCommand(HOST, ["rig", "capture", "dev@rig"], { spawn });
expect(result).toMatchObject({ ok: true, stdout: expected, stderr: expected });
});
it("flushes an incomplete final UTF-8 character from both pipes on close", async () => {
const spawn: SpawnFn = () => {
const child = makeMockChild();
queueMicrotask(() => {
child.stdout.emit("data", Buffer.from([0xe7]));
child.stderr.emit("data", Buffer.from([0xf0, 0x9f]));
child.emit("close", 0);
});
return child as never;
};
const result = await runCrossHostCommand(HOST, ["rig", "capture", "dev@rig"], { spawn });
expect(result).toMatchObject({ ok: true, stdout: "\ufffd", stderr: "\ufffd" });
});
it.each([0, 1])("preserves split UTF-8 on both pipes for exit %s", async (exitCode) => {
const stdout = '{"content":"界🙂café"}\n';
const stderr = "diagnostic: naïve 日本語\n";
const spawn: SpawnFn = () => {
const child = makeMockChild();
queueMicrotask(() => {
for (const byte of Buffer.from(stdout)) child.stdout.emit("data", Buffer.from([byte]));
for (const byte of Buffer.from(stderr)) child.stderr.emit("data", Buffer.from([byte]));
child.emit("close", exitCode);
});
return child as never;
};
const result = await runCrossHostCommand(HOST, ["rig", "capture", "dev@rig", "--json"], { spawn });
expect(result).toMatchObject({ stdout, stderr });
expect(result.failedStep).toBe(exitCode === 0 ? "none" : "remote-command-failed");
});
});
@@ -1012,6 +1012,41 @@ describe("Daemon Lifecycle", () => {
expect(isAlive(123)).toBe(true);
});
it("readProcessState reads the ps state column on POSIX", async () => {
const { readProcessState } = await import("../src/commands/daemon.js");
const calls: Array<{ file: string; args: string[] }> = [];
const state = readProcessState(123, "linux", (file, args) => {
calls.push({ file, args });
return "S\n";
});
expect(state).toBe("S\n");
expect(calls).toEqual([{ file: "ps", args: ["-o", "state=", "-p", "123"] }]);
});
it("readProcessState returns null on POSIX when ps fails", async () => {
const { readProcessState } = await import("../src/commands/daemon.js");
const state = readProcessState(123, "darwin", () => {
throw new Error("no such process");
});
expect(state).toBeNull();
});
it("readProcessState does not shell out to ps on Windows", async () => {
const { readProcessState, createIsProcessAlive } = await import("../src/commands/daemon.js");
const run = () => {
throw new Error("ps must not run on win32");
};
expect(readProcessState(123, "win32", run)).toBe("R");
const isAlive = createIsProcessAlive({
signalCheck: () => true,
readProcessState: (pid) => readProcessState(pid, "win32", run),
});
expect(isAlive(123)).toBe(true);
});
});
describe("resolveDaemonPath", () => {
+33
View File
@@ -44,6 +44,8 @@ function captureLogs(fn: () => Promise<void>): Promise<{ logs: string[]; exitCod
describe("rig env", () => {
let server: http.Server;
let port: number;
let probeStatus = "fresh";
let probeError: string | undefined;
const rigSummary = [{ id: "rig-1", name: "my-rig", nodeCount: 2 }];
@@ -76,6 +78,8 @@ describe("rig env", () => {
res.end(JSON.stringify({
ok: true,
hasServices: true,
probeStatus,
...(probeError ? { probeError } : {}),
kind: "compose",
projectName: "my-rig",
receipt: {
@@ -151,6 +155,35 @@ describe("rig env", () => {
expect(parsed.receipt.services).toHaveLength(1);
});
it.each(["stale", "no_orchestrator"])("env status discloses a saved receipt when probe status is %s", async (status) => {
probeStatus = status;
probeError = status === "stale" ? "Docker daemon connection refused" : undefined;
try {
const { logs, exitCode } = await captureLogs(async () => {
await makeCmd().parseAsync(["node", "rig", "env", "status", "my-rig"]);
});
const output = logs.join("\n");
expect(output).toContain("saved receipt");
expect(output).toContain(status);
if (probeError) expect(output).toContain(probeError);
expect(output).toContain("vault");
expect(output).toContain("healthy");
expect(exitCode).toBeUndefined();
} finally { probeStatus = "fresh"; probeError = undefined; }
});
it("env status --json preserves stale probe metadata without extra output", async () => {
probeStatus = "stale";
probeError = "Docker daemon connection refused";
try {
const { logs, exitCode } = await captureLogs(async () => {
await makeCmd().parseAsync(["node", "rig", "env", "status", "my-rig", "--json"]);
});
expect(JSON.parse(logs.join(""))).toMatchObject({ probeStatus, probeError, receipt: { services: [{ health: "healthy" }] } });
expect(exitCode).toBeUndefined();
} finally { probeStatus = "fresh"; probeError = undefined; }
});
it("env logs returns service logs", async () => {
const { logs } = await captureLogs(async () => {
await makeCmd().parseAsync(["node", "rig", "env", "logs", "my-rig"]);
+33 -1
View File
@@ -1,7 +1,39 @@
import { describe, it, expect } from "vitest";
import { describe, it, expect, vi } from "vitest";
import { fetchWithTimeout, FetchTimeoutError } from "../src/fetch-with-timeout.js";
describe("fetchWithTimeout", () => {
it("shares one deadline across waiting for headers and reading the body", async () => {
vi.useFakeTimers();
try {
let signal: AbortSignal | undefined;
let headersReceived = false;
const fetchImpl: typeof fetch = async (_url, init) => {
signal = init?.signal ?? undefined;
await new Promise((resolve) => setTimeout(resolve, 600));
headersReceived = true;
return new Response("body");
};
const result = fetchWithTimeout(fetchImpl, "http://localhost:7433/read", {}, {
timeoutMs: 1_000,
timeoutMessage: "complete request timed out",
consumeResponse: async () => {
await new Promise<void>((resolve, reject) => {
setTimeout(resolve, 600);
signal!.addEventListener("abort", () => reject(new DOMException("aborted", "AbortError")), { once: true });
});
},
}).then(() => null, (error: unknown) => error);
await vi.advanceTimersByTimeAsync(600);
expect(headersReceived).toBe(true);
expect(signal!.aborted).toBe(false);
await vi.advanceTimersByTimeAsync(400);
expect(signal!.aborted).toBe(true);
expect(await result).toBeInstanceOf(FetchTimeoutError);
} finally {
vi.useRealTimers();
}
});
it("rejects with FetchTimeoutError when fetch blackholes", async () => {
const fetchImpl: typeof fetch = ((_url: string | URL | Request, init?: RequestInit) => new Promise<Response>((_resolve, reject) => {
init?.signal?.addEventListener("abort", () => {
+65
View File
@@ -7,6 +7,9 @@
import { describe, it, expect } from "vitest";
import os from "node:os";
import path from "node:path";
import { execFileSync } from "node:child_process";
import { mkdtempSync, mkdirSync, writeFileSync, existsSync, readFileSync, rmSync } from "node:fs";
import { EventEmitter } from "node:events";
import {
parseFilePathArg,
checkLocalPath,
@@ -312,3 +315,65 @@ describe("classifyRsyncResult / runFileCopy", () => {
expect(res.hint).toContain("brew install rsync");
});
});
describe("file copy output byte boundaries", () => {
it("preserves split UTF-8 on both rsync output pipes", async () => {
const text = "copied café/日本語.md 🙂\n";
const spawn = (() => {
const child = new EventEmitter() as EventEmitter & { stdout: EventEmitter; stderr: EventEmitter };
child.stdout = new EventEmitter(); child.stderr = new EventEmitter();
queueMicrotask(() => {
for (const byte of Buffer.from(text)) {
child.stdout.emit("data", Buffer.from([byte]));
child.stderr.emit("data", Buffer.from([byte]));
}
child.emit("close", 0);
});
return child;
}) as unknown as NonNullable<Parameters<typeof runFileCopy>[1]>["spawn"];
const result = await runFileCopy({ src: local("/tmp/src"), dst: local("/tmp/dst"), dryRun: true }, { spawn });
expect(result).toMatchObject({ ok: true, stdout: text, stderr: text });
});
});
let rsyncAvailable = false;
try { execFileSync("rsync", ["--version"], { stdio: "ignore" }); rsyncAvailable = true; }
catch (error) {
if ((error as NodeJS.ErrnoException).code !== "ENOENT") throw error;
}
describe("local directory copy semantics", () => {
it("preserves the trailing slash in the normalized local source and rsync argv", () => {
const source = "." + path.sep + "copy-source" + path.sep;
const planned = planFileCopy(source, "." + path.sep + "copy-destination");
expect(planned.ok).toBe(true);
if (!planned.ok) return;
const expectedSource = path.resolve("copy-source") + path.sep;
expect(planned.plan.src.path).toBe(expectedSource);
expect(buildRsyncArgv(planned.plan).slice(-2)[0]).toBe(expectedSource);
});
it.skipIf(!rsyncAvailable).each([false, true])("native rsync preserves source directory trailing slash=%s (requires installed rsync)", async (contentsOnly) => {
const root = mkdtempSync(path.join(process.cwd(), "openrig-copy-contents-"));
try {
const src = path.join(root, "source");
const dst = path.join(root, "destination");
mkdirSync(src); mkdirSync(dst);
writeFileSync(path.join(src, "artifact.txt"), "owned test artifact");
const localSrc = "." + path.sep + path.relative(process.cwd(), src);
const localDst = "." + path.sep + path.relative(process.cwd(), dst);
const planned = planFileCopy(localSrc + (contentsOnly ? path.sep : ""), localDst);
expect(planned.ok).toBe(true);
if (!planned.ok) return;
const result = await runFileCopy(planned.plan);
expect(result.ok, result.stderr).toBe(true);
const expected = path.join(dst, ...(contentsOnly ? [] : ["source"]), "artifact.txt");
expect(existsSync(expected), `rsync destination should be ${expected}`).toBe(true);
expect(readFileSync(expected, "utf8")).toBe("owned test artifact");
if (contentsOnly) expect(existsSync(path.join(dst, "source"))).toBe(false);
} finally {
rmSync(root, { recursive: true, force: true });
}
});
});
+29 -21
View File
@@ -6,7 +6,7 @@
// behave unchanged. New file; shipped CLI floors untouched.
import { describe, it, expect, vi } from "vitest";
import { spawnSync } from "node:child_process";
import { existsSync, mkdtempSync, rmSync } from "node:fs";
import { existsSync, mkdtempSync, readFileSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { createServer } from "node:net";
@@ -415,27 +415,35 @@ describe("PUBLIC bin ownership (guard finding 1 — the wrapper is the real fron
// Isolated OPENRIG_HOME so the launched TUI never reads the live rig (fully contained + read-only).
const session = `frontdoor-pin-${process.pid}`;
const home = mkdtempSync(join(tmpdir(), "fd-tmux-home-"));
spawnSync("tmux", ["kill-session", "-t", session], { encoding: "utf-8" });
const run = spawnSync(
"tmux",
["new-session", "-d", "-s", session, "-x", "120", "-y", "30",
`OPENRIG_HOME=${home} OPENRIG_URL=http://127.0.0.1:9 ${process.execPath} ${binWrapper}; sleep 15`],
{ encoding: "utf-8", timeout: 10000 },
);
expect(run.status).toBe(0);
let text = "";
for (let i = 0; i < 20 && !/EXPLORER|mission control could not start|Usage: rig/.test(text); i++) {
spawnSync("sleep", ["0.5"]);
text = spawnSync("tmux", ["capture-pane", "-t", session, "-p"], { encoding: "utf-8", timeout: 5000 }).stdout ?? "";
// A private server gives this test both a bounded IPC path and useful failure evidence.
const socket = join(home, "tmux.sock");
const exitFile = join(home, "child-exit");
const quote = (s: string) => "'" + s.replaceAll("'", "'\"'\"'") + "'";
const tmux = (args: string[]) => spawnSync("tmux", ["-S", socket, ...args], { encoding: "utf-8", timeout: 10000 });
const diagnostic = (r: ReturnType<typeof tmux>) => JSON.stringify({
status: r.status, signal: r.signal, error: r.error?.message, stderr: r.stderr,
childExit: existsSync(exitFile) ? readFileSync(exitFile, "utf8") : "still running or not started",
});
try {
const run = tmux(["new-session", "-d", "-s", session, "-x", "120", "-y", "30",
`OPENRIG_HOME=${quote(home)} OPENRIG_URL=http://127.0.0.1:9 ${quote(process.execPath)} ${quote(binWrapper)}; printf '%s' $? > ${quote(exitFile)}; sleep 15`]);
expect(run.status, diagnostic(run)).toBe(0);
let text = "";
for (let i = 0; i < 20 && !/EXPLORER|mission control could not start|Usage: rig/.test(text); i++) {
spawnSync("sleep", ["0.5"]);
const capture = tmux(["capture-pane", "-t", session, "-p"]);
expect(capture.status, diagnostic(capture)).toBe(0);
text = capture.stdout ?? "";
}
// Keep BOTH TTY streams on the child; capture-pane includes terminal error text.
// Do not reinterpret an empty capture or failed tmux client as a valid UI result.
const pane = tmux(["display-message", "-p", "-t", session, "#{pane_current_command} #{pane_dead} #{pane_dead_status}"]);
expect(text, `${diagnostic(pane)} pane=${pane.stdout}`).toMatch(/EXPLORER|mission control could not start/);
expect(text).not.toMatch(/Usage: rig \[options\] \[command\]/);
} finally {
tmux(["kill-server"]); // Only this test's private server.
rmSync(home, { recursive: true, force: true });
}
spawnSync("tmux", ["kill-session", "-t", session], { encoding: "utf-8" });
rmSync(home, { recursive: true, force: true });
// The daemon being unreachable, the front door LAUNCHED the TUI (its universal chrome — the EXPLORER
// pane — renders), or degraded honestly if the TUI is not installed. Either proves the PUBLIC bin ran
// the front-door path; commander's usage bypass would mean it did NOT. (The crash-cart cockpit render
// itself is covered by the TUI's own tests; the launch decision by the deterministic production-path test.)
expect(text).toMatch(/EXPLORER|mission control could not start/);
expect(text).not.toMatch(/Usage: rig \[options\] \[command\]/);
});
// (Removed the in-process forced-TTY "reaches the degrade branch" belt: its premise was a FAST
@@ -8,7 +8,9 @@ import { Command } from "commander";
import { DaemonClient } from "../src/client.js";
import { projectCommand, type ProjectDeps } from "../src/commands/project.js";
import { projectsRoutes } from "../../daemon/src/routes/projects.js";
import { ClassifierLeaseError, ClassificationAttemptError, type ClassifierLease } from "@openrig/daemon/stream-classifier";
// The route under test imports source classes; built exports are different constructor instances.
import { ClassifierLeaseError, type ClassifierLease } from "../../daemon/src/domain/classifier-lease-manager.js";
import { ClassificationAttemptError } from "../../daemon/src/domain/classification-attempts.js";
import { classifierOccupant, sourceHash } from "../../daemon/src/domain/classification-sources.js";
import { JEV_MODEL, setExperiment } from "../src/commands/project-jev.js";
+46
View File
@@ -145,6 +145,52 @@ describe("rig proof add (fs-level, temp workspace)", () => {
expect(process.exitCode).toBeUndefined();
});
it("rejects a screenshot passed as --file without changing its bytes", async () => {
const proofDir = path.join(sliceDir, "proof");
fs.mkdirSync(proofDir);
const screenshot = path.join(proofDir, "shot.png");
const bytes = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x00, 0xff]);
fs.writeFileSync(screenshot, bytes);
await run([
"add", "19-signal-layer", "--mission", "release-x",
"--artifact-type", "qa", "--verdict", "CLEAR",
"--candidate-sha", "abc1234", "--money-evidence", "m",
"--file", screenshot,
]);
expect(process.exitCode).toBe(1);
expect(fs.readFileSync(screenshot)).toEqual(bytes);
expect(fs.readdirSync(proofDir)).toEqual(["shot.png"]);
expect(errs.join("\n")).toContain("--media");
process.exitCode = undefined;
await run(baseArgs(["--name", "shot.png"]));
expect(process.exitCode).toBe(1);
expect(fs.readFileSync(screenshot)).toEqual(bytes);
});
it("uses a Markdown name for a text file and requires --replace to overwrite it", async () => {
const source = path.join(workRoot, "notes.txt");
fs.writeFileSync(source, "first proof");
const fromFile = [
"add", "19-signal-layer", "--mission", "release-x",
"--artifact-type", "qa", "--verdict", "CLEAR",
"--candidate-sha", "abc1234", "--money-evidence", "m",
"--file", source,
];
await run(fromFile);
const target = path.join(sliceDir, "proof", "notes.md");
expect(process.exitCode).toBeUndefined();
expect(fs.readFileSync(target, "utf8")).toContain("first proof");
fs.writeFileSync(source, "revised proof");
await run(fromFile);
expect(process.exitCode).toBe(1);
expect(fs.readFileSync(target, "utf8")).not.toContain("revised proof");
process.exitCode = undefined;
await run([...fromFile, "--replace"]);
expect(process.exitCode).toBeUndefined();
expect(fs.readFileSync(target, "utf8")).toContain("revised proof");
});
it("out-of-set verdict is rejected naming the allowed values; nothing written; exit 1", async () => {
await run([
"add", "19-signal-layer", "--mission", "release-x",
+27 -4
View File
@@ -1,5 +1,6 @@
// OPR.0.3.3.13.1 - CLI surface-detection parser POC tests (AC-1..AC-5).
import { describe, it, expect } from "vitest";
import { beforeAll, describe, it, expect } from "vitest";
import { execFileSync } from "node:child_process";
import fs from "node:fs";
import { fileURLToPath } from "node:url";
import { parse as parseYaml } from "yaml";
@@ -30,6 +31,25 @@ function readSource(rel: string): { name: string; text: string } {
const FROM = "v0.3.1";
const TO = "v0.3.2";
function hasRef(ref: string): boolean {
try {
execFileSync("git", ["rev-parse", "--verify", "--quiet", `${ref}^{commit}`], { cwd: here, stdio: "ignore" });
return true;
} catch {
return false;
}
}
// The worked example and determinism checks diff two real release tags. Forks and shallow or
// --no-tags clones lack them, and a throw while collecting a describe fails the whole file,
// unit tests included. Skip those two blocks locally when the tags are absent; CI clones with
// full history, so there a missing tag still fails loudly.
const hasReleaseTags = hasRef(FROM) && hasRef(TO);
const skipTagTests = !hasReleaseTags && process.env.CI !== "true";
if (skipTagTests) {
console.warn(`release-surface: tags ${FROM}/${TO} not found; skipping tag-diff tests (git fetch --tags to run them)`);
}
describe("release-surface parser - extract (unit)", () => {
it("AC-2 crux: emits the registration name `mode`, never the filename `rig-mode` (verb renamed from `policy`, B7)", () => {
const surface = extractSurfaceFromSources([readSource("src/commands/rig-mode.ts")]);
@@ -95,8 +115,11 @@ describe("release-surface parser - diff (AC-1)", () => {
});
});
describe("release-surface parser - v0.3.1..v0.3.2 worked example (AC-2)", () => {
const diff = generateSurfaceDiff({ from: FROM, to: TO, cwd: here });
describe.skipIf(skipTagTests)("release-surface parser - v0.3.1..v0.3.2 worked example (AC-2)", () => {
let diff: SurfaceDiff;
beforeAll(() => {
diff = generateSurfaceDiff({ from: FROM, to: TO, cwd: here });
});
it("emits exactly `policy` and `scope` as new top-level commands (no false positives, no filename)", () => {
const names = diff.added_commands.map((c) => c.name).sort();
@@ -147,7 +170,7 @@ describe("release-surface parser - v0.3.1..v0.3.2 worked example (AC-2)", () =>
});
});
describe("release-surface parser - determinism (AC-4)", () => {
describe.skipIf(skipTagTests)("release-surface parser - determinism (AC-4)", () => {
it("produces byte-identical YAML across two runs on the same refs", () => {
const a = diffToYaml(generateSurfaceDiff({ from: FROM, to: TO, cwd: here }));
const b = diffToYaml(generateSurfaceDiff({ from: FROM, to: TO, cwd: here }));
@@ -0,0 +1,98 @@
// #174: when removal keeps a session that belongs to another rig's live seat, the human output of
// `rig remove` and `rig shrink` says so (JSON already carries `sessionKeptFor`).
import { describe, it, expect, vi, beforeAll, afterAll } from "vitest";
import http from "node:http";
import { Command } from "commander";
import { DaemonClient } from "../src/client.js";
import { STATE_FILE, type DaemonState } from "../src/daemon-lifecycle.js";
import { removeCommand } from "../src/commands/remove.js";
import { shrinkCommand } from "../src/commands/shrink.js";
import type { StatusDeps } from "../src/commands/status.js";
const RESPONSES: Record<string, unknown> = {
"DELETE /api/rigs/rig-1/nodes/lead.planner": {
ok: true, rigId: "rig-1", nodeId: "node-9", logicalId: "lead.planner",
sessionsKilled: 0, sessionKeptFor: "lead.planner@live-rig", reroutedQitemIds: [],
},
"DELETE /api/rigs/rig-1/nodes/dev.impl": {
ok: true, rigId: "rig-1", nodeId: "node-1", logicalId: "dev.impl", sessionsKilled: 1, reroutedQitemIds: [],
},
"DELETE /api/rigs/rig-1/pods/kept": {
ok: true, status: "ok", rigId: "rig-1", podId: "pod-9", namespace: "kept",
removedLogicalIds: ["kept.lead"], sessionsKilled: 0, reroutedQitemIds: [],
nodes: [{ logicalId: "kept.lead", nodeId: "node-9", status: "removed", sessionsKilled: 0, sessionKeptFor: "kept.lead@live-rig" }],
},
};
describe("#174 remove/shrink human output names a kept session", () => {
let server: http.Server;
let port: number;
beforeAll(async () => {
server = http.createServer((req, res) => {
const body = RESPONSES[`${req.method} ${req.url}`];
res.writeHead(body ? 200 : 404, { "Content-Type": "application/json" });
res.end(JSON.stringify(body ?? { error: "not found" }));
});
await new Promise<void>((resolve) => { server.listen(0, "127.0.0.1", resolve); });
port = (server.address() as { port: number }).port;
});
afterAll(() => { server.close(); });
function deps(): StatusDeps {
return {
lifecycleDeps: {
spawn: vi.fn(() => ({ pid: 1, unref: vi.fn() }) as never),
fetch: vi.fn(async () => ({ ok: true })),
kill: vi.fn(() => true),
readFile: vi.fn((p: string) => p === STATE_FILE
? JSON.stringify({ pid: 123, port, db: "test.sqlite", startedAt: "2026-09-30T00:00:00Z" } as DaemonState)
: null),
writeFile: vi.fn(),
removeFile: vi.fn(),
exists: vi.fn((p: string) => p === STATE_FILE),
mkdirp: vi.fn(),
openForAppend: vi.fn(() => 3),
isProcessAlive: vi.fn(() => true),
},
clientFactory: () => new DaemonClient(`http://127.0.0.1:${port}`),
};
}
async function run(command: Command, args: string[]): Promise<{ output: string; exitCode: number | undefined }> {
const logs: string[] = [];
const log = vi.spyOn(console, "log").mockImplementation((...a: unknown[]) => { logs.push(a.join(" ")); });
const err = vi.spyOn(console, "error").mockImplementation((...a: unknown[]) => { logs.push(a.join(" ")); });
process.exitCode = undefined;
const program = new Command();
program.exitOverride();
program.addCommand(command);
try {
await program.parseAsync(["node", "rig", ...args]);
return { output: logs.join("\n"), exitCode: process.exitCode };
} finally {
log.mockRestore();
err.mockRestore();
process.exitCode = undefined;
}
}
it("remove says the session was kept and for whom", async () => {
const { output, exitCode } = await run(removeCommand(deps()), ["remove", "rig-1", "lead.planner"]);
expect(exitCode).toBeUndefined();
expect(output).toContain("Removed node lead.planner from rig rig-1 (0 session killed)");
expect(output).toContain("Session kept: owned by lead.planner@live-rig");
});
it("control: remove prints no kept line when it killed its own session", async () => {
const { output } = await run(removeCommand(deps()), ["remove", "rig-1", "dev.impl"]);
expect(output).toContain("Removed node dev.impl from rig rig-1 (1 session killed)");
expect(output).not.toContain("Session kept");
});
it("shrink names each node whose session was kept", async () => {
const { output, exitCode } = await run(shrinkCommand(deps()), ["shrink", "rig-1", "kept"]);
expect(exitCode).toBeUndefined();
expect(output).toContain("kept.lead: session kept, owned by kept.lead@live-rig");
});
});
+59
View File
@@ -1,5 +1,6 @@
import { describe, it, expect, vi, afterEach } from "vitest";
import { Command } from "commander";
import { DaemonClient } from "../src/client.js";
import { seatCommand, handoverCommand } from "../src/commands/seat.js";
import { STATE_FILE, type DaemonState, type LifecycleDeps } from "../src/daemon-lifecycle.js";
import type { StatusDeps } from "../src/commands/status.js";
@@ -208,6 +209,7 @@ const FRESH_LAUNCH_RESULT = {
describe("rig seat status", () => {
afterEach(() => {
vi.useRealTimers();
vi.restoreAllMocks();
});
@@ -339,6 +341,63 @@ describe("rig seat status", () => {
expect(output).toContain("No continuity source was used; siblings and durable work were preserved.");
});
it("launch waits for a ready response beyond the default five-second timeout", async () => {
vi.useFakeTimers();
const fetchImpl = vi.fn((_url: unknown, init?: RequestInit) => new Promise<Response>((resolve, reject) => {
const timer = setTimeout(() => resolve(Response.json(FRESH_LAUNCH_RESULT)), 6_000);
init!.signal!.addEventListener("abort", () => {
clearTimeout(timer);
reject(init!.signal!.reason);
}, { once: true });
}));
const deps = makeDeps({ status: 200, data: FRESH_LAUNCH_RESULT }, []);
deps.clientFactory = url => new DaemonClient(url, { fetchImpl });
const result = captureLogs(() => makeCommand(deps).parseAsync([
"node", "rig", "seat", "launch", "dev-impl@seat-rig",
"--fresh", "--stop", "--reason", "deliberate blank restart", "--json",
]).then(() => undefined)).catch(error => ({ error }));
await vi.advanceTimersByTimeAsync(6_000);
const output = await result;
expect(output).toMatchObject({ errors: [], exitCode: undefined });
if (!("logs" in output)) throw output.error;
expect(JSON.parse(output.logs.join("\n"))).toMatchObject({ status: "ready", generation: "gen-fresh" });
expect(fetchImpl).toHaveBeenCalledTimes(1);
});
it.each([false, true])("launch reports an unknown outcome without retrying on timeout (json=%s)", async json => {
vi.useFakeTimers();
const fetchImpl = vi.fn((_url: unknown, init?: RequestInit) => new Promise<Response>((_resolve, reject) => {
init!.signal!.addEventListener("abort", () => reject(init!.signal!.reason), { once: true });
}));
const deps = makeDeps({ status: 200, data: FRESH_LAUNCH_RESULT }, []);
deps.clientFactory = url => new DaemonClient(url, { fetchImpl });
const result = captureLogs(() => makeCommand(deps).parseAsync([
"node", "rig", "seat", "launch", "dev-impl@seat-rig",
"--fresh", "--stop", "--reason", "deliberate blank restart", ...(json ? ["--json"] : []),
]).then(() => undefined)).catch(error => ({ error }));
await vi.advanceTimersByTimeAsync(120_000);
const output = await result;
expect(output).toMatchObject({ exitCode: 1 });
if (!("logs" in output)) throw output.error;
if (json) {
expect(output.errors).toEqual([]);
expect(JSON.parse(output.logs.join("\n"))).toMatchObject({
status: "unknown",
code: "launch_outcome_unknown",
guidance: expect.stringContaining("rig seat status dev-impl@seat-rig"),
});
} else {
expect(output.logs).toEqual([]);
expect(output.errors.join("\n")).toContain("may still be in progress");
expect(output.errors.join("\n")).toContain("rig seat status dev-impl@seat-rig");
}
expect(fetchImpl).toHaveBeenCalledTimes(1);
});
it("handover --dry-run --json prints the stable planner shape", async () => {
const paths: string[] = [];
const deps = makeDeps({ status: 200, data: HANDOVER_PLAN }, paths);
+118 -2
View File
@@ -219,8 +219,12 @@ describe("rig setup", () => {
expect(wsIdx).toBeGreaterThan(statusIdx);
expect(wfIdx).toBeGreaterThan(wsIdx);
expect(scopeIdx).toBeGreaterThan(wsIdx);
expect(out).toContain("rig up first-project --cwd .");
expect(out).toContain("rig send dev-owner@first-project");
expect(out).toContain("rig up <starter> --cwd . --plan");
for (const name of ["first-project", "first-project-claude", "first-project-mixed"]) expect(out).toContain(name);
expect(out).toContain("check only selected logins");
expect(out).toContain("rig send dev-owner@<starter>");
expect(out).toContain("rig queue list --destination dev-owner@<starter>");
expect(out).not.toContain("rig queue list --rig");
expect(out).toContain("rig tui --shared");
expect(out).toContain("docs/reference/getting-started.md");
// no magic mega-command - the path is existing verbs only
@@ -946,3 +950,115 @@ describe("rig setup permission-policy menu copy (frozen)", () => {
}
});
});
// Issue #194 — a Codex provider that does not use an OpenAI login.
describe("codex_auth — provider-aware Codex readiness (#194)", () => {
const CODEX_HOME = "/synthetic/codex-cli-home";
const BEDROCK_CONFIG = [
'model_provider = "bedrock-runtime-us"',
"",
"[model_providers.bedrock-runtime-us]",
'name = "Amazon Bedrock Runtime"',
'env_key = "AWS_BEARER_TOKEN_BEDROCK"',
'wire_api = "responses"',
"requires_openai_auth = false",
"",
].join("\n");
const TOKEN = "synthetic-bedrock-token-value";
function providerDeps(opts: {
config?: string | null;
env?: NodeJS.ProcessEnv;
loggedIn?: boolean;
codexInstalled?: boolean;
}) {
const commands: string[] = [];
const reads: string[] = [];
const base = makeDeps();
const deps = makeDeps({
env: opts.env ?? { HOME: "/synthetic/home", CODEX_HOME },
readFile: (p: string) => {
reads.push(p);
return p === `${CODEX_HOME}/config.toml` ? (opts.config ?? null) : null;
},
exec: (cmd: string) => {
commands.push(cmd);
if (cmd === "codex --version" && opts.codexInstalled === false) throw new Error("codex: command not found");
if (cmd === "npm install -g @openai/codex" && opts.codexInstalled === false) throw new Error("install refused in test");
if (cmd === "codex login status" && !opts.loggedIn) throw new Error("Not logged in");
return base.exec(cmd);
},
});
return { deps, commands, reads };
}
const codexAuthStep = (result: SetupResult) => result.steps.find((s) => s.id === "codex_auth");
it("passes the explicit Bedrock provider from the selected CODEX_HOME without an OpenAI login", async () => {
const { deps, commands, reads } = providerDeps({
config: BEDROCK_CONFIG,
env: { HOME: "/synthetic/home", CODEX_HOME, AWS_BEARER_TOKEN_BEDROCK: TOKEN },
loggedIn: false,
});
const result = await runSetup(deps, {});
const step = codexAuthStep(result);
expect(step?.status).toBe("pass");
expect(step?.message).toContain("AWS_BEARER_TOKEN_BEDROCK");
expect(step?.message).toContain("not that the provider accepts it");
expect(JSON.stringify(result)).not.toContain(TOKEN);
expect(commands).not.toContain("codex login status");
expect(reads).toContain(`${CODEX_HOME}/config.toml`);
expect(reads).not.toContain("/synthetic/home/.codex/config.toml");
});
it("fails with the provider's variable named, never its value, when the token is missing or blank", async () => {
for (const env of [
{ HOME: "/synthetic/home", CODEX_HOME },
{ HOME: "/synthetic/home", CODEX_HOME, AWS_BEARER_TOKEN_BEDROCK: " " },
]) {
const { deps, commands } = providerDeps({ config: BEDROCK_CONFIG, env, loggedIn: true });
const result = await runSetup(deps, {});
const step = codexAuthStep(result);
expect(step?.status).toBe("fail");
expect(step?.message).toContain("AWS_BEARER_TOKEN_BEDROCK");
expect(step?.fixHint).toContain("Export AWS_BEARER_TOKEN_BEDROCK");
expect(step?.fixHint).not.toContain("codex login");
expect(result.ready).toBe(false);
expect(commands).not.toContain("codex login status");
}
});
it("keeps the OpenAI login check for the default provider and for providers that require it", async () => {
const requiresLogin = BEDROCK_CONFIG.replace("requires_openai_auth = false", "requires_openai_auth = true");
for (const config of [null, 'model_provider = "openai"\n', requiresLogin]) {
const env = { HOME: "/synthetic/home", CODEX_HOME, AWS_BEARER_TOKEN_BEDROCK: TOKEN };
const ok = providerDeps({ config, env, loggedIn: true });
expect(codexAuthStep(await runSetup(ok.deps, {}))?.status).toBe("pass");
expect(ok.commands).toContain("codex login status");
const notLoggedIn = providerDeps({ config, env, loggedIn: false });
const step = codexAuthStep(await runSetup(notLoggedIn.deps, {}));
expect(step?.status).toBe("fail");
expect(step?.fixHint).toContain("codex login");
}
});
it("reports a malformed-config explanation when the fallback OpenAI login fails", async () => {
const env = { HOME: "/synthetic/home", CODEX_HOME, AWS_BEARER_TOKEN_BEDROCK: TOKEN };
const { deps } = providerDeps({ config: "model_provider = [broken", env, loggedIn: false });
const step = codexAuthStep(await runSetup(deps, {}));
expect(step?.status).toBe("fail");
expect(step?.message).toContain("config.toml could not be parsed");
});
it("skips the provider check when the Codex executable is missing", async () => {
const { deps } = providerDeps({
config: BEDROCK_CONFIG,
env: { HOME: "/synthetic/home", CODEX_HOME, AWS_BEARER_TOKEN_BEDROCK: TOKEN },
codexInstalled: false,
});
const result = await runSetup(deps, {});
expect(result.steps.find((s) => s.id === "codex_install")?.status).toBe("fail");
expect(codexAuthStep(result)?.status).toBe("skipped");
});
});
@@ -0,0 +1,74 @@
// #141: `rig up` terminal output for the stopped-generation archive. The archive notice must reach the user
// on the attention 409 too (the replacement is kept there), and a generation_unconfirmed refusal prints its
// own actionable message. Actual command renderer and daemon attention builder; the client is stubbed.
import { describe, expect, it, vi } from "vitest";
import { Command } from "commander";
import { upCommand } from "../src/commands/up.js";
import { STATE_FILE, type LifecycleDeps } from "../src/daemon-lifecycle.js";
import type { DaemonClient } from "../src/client.js";
import { buildAttentionResponse } from "../../daemon/src/routes/up.js";
const OLD = "01OLDGENERATION00000000000";
const NOTICE = `Archived the stopped earlier "first-project" rig ${OLD}; its records are kept. Restore it with: rig unarchive ${OLD}`;
async function render(data: Record<string, unknown>, status: number, json = false) {
const oldExit = process.exitCode;
const out: string[] = [], err: string[] = [];
const log = vi.spyOn(console, "log").mockImplementation((...s) => { out.push(s.join(" ")); });
const error = vi.spyOn(console, "error").mockImplementation((...s) => { err.push(s.join(" ")); });
const forbidden = () => { throw new Error("unexpected lifecycle operation"); };
const lifecycleDeps = {
spawn: forbidden, kill: forbidden, writeFile: forbidden, removeFile: forbidden,
mkdirp: forbidden, openForAppend: forbidden,
fetch: async () => ({ ok: true }), isProcessAlive: () => true,
exists: (p: string) => p === STATE_FILE,
readFile: (p: string) => p === STATE_FILE ? JSON.stringify({ pid: 123, port: 12345, db: "mock", startedAt: "2000-01-01" }) : null,
} as LifecycleDeps;
const client = { get: vi.fn(async () => ({ status: 200, data: [] })), post: vi.fn(async () => ({ status, data })) };
process.exitCode = undefined;
try {
const cmd = new Command().exitOverride().addCommand(upCommand({
lifecycleDeps, clientFactory: () => client as unknown as DaemonClient, preflightExec: forbidden,
}));
await cmd.parseAsync(["node", "rig", "up", "first-project", ...(json ? ["--json"] : [])]);
return { out: out.join("\n"), err: err.join("\n"), exit: process.exitCode };
} finally { process.exitCode = oldExit; log.mockRestore(); error.mockRestore(); }
}
function attentionWithNotice() {
const attentionNodes = [{ logicalId: "dev.owner", sessionName: "dev-owner@first-project", reason: "trust_gate", evidence: "trust" }];
const result = { rigId: "NEWRIG", warnings: [NOTICE], stages: [{ stage: "import_rig", status: "blocked",
detail: { code: "attention_required", message: "1 member needs attention.", attentionNodes } }] };
return { ...result, ...buildAttentionResponse(result)! };
}
describe("#141 rig up output for the stopped-generation archive", () => {
it("attention 409: prints the archive notice with the old rig id and its unarchive instruction", async () => {
const r = await render(attentionWithNotice(), 409);
expect(r.err).toContain(`rig unarchive ${OLD}`);
expect(r.err).toContain("dev.owner");
expect(r.exit).toBe(1);
});
it("attention 409 --json: the JSON body is unchanged and nothing else is printed", async () => {
const data = attentionWithNotice();
const r = await render(data, 409, true);
expect(r.out).toBe(JSON.stringify(data));
expect(r.err).toBe("");
expect(r.exit).toBe(1);
});
it("generation_unconfirmed 409: prints its actionable message, not the validate-your-spec fallback", async () => {
const message = `A rig named "first-project" already exists (${OLD}), and OpenRig could not confirm it is stopped: tmux session x still exists. Nothing was created. Restore it with 'rig up first-project', or archive it first with 'rig archive ${OLD}'.`;
const r = await render({ code: "generation_unconfirmed", error: message, errors: [message],
stages: [{ stage: "import_rig", status: "failed", detail: { code: "generation_unconfirmed" } }] }, 409);
expect(r.err).toContain(message);
expect(r.err).not.toMatch(/validate your spec|Check daemon logs/);
expect(r.exit).toBe(1);
});
it("control: on success a warning is printed exactly once", async () => {
const r = await render({ status: "completed", rigId: "NEWRIG", stages: [], warnings: [NOTICE] }, 201);
expect(r.err.split(`rig unarchive ${OLD}`).length - 1).toBe(1);
});
});
+53 -2
View File
@@ -103,8 +103,10 @@ describe("Up CLI", () => {
cmd.outputHelp();
const help = logs.join("");
expect(help).toContain("Launch a rig or managed app from a spec, library entry, or bundle");
expect(help).toContain("Target root directory for package installation");
expect(help).toContain("does not change agent cwd");
const flat = help.replace(/\s+/g, " ");
expect(flat).toContain("Install target for a .rigbundle (default: current directory)");
expect(flat).toContain("relative member cwds resolve against it; --cwd still overrides launch cwd");
expect(flat).not.toContain("does not change agent cwd");
expect(help).toContain("--cwd <path>");
expect(help).toContain("rig up secrets-manager");
});
@@ -295,6 +297,55 @@ describe("Up CLI", () => {
for (const l of origListeners) server.on("request", l as (...args: unknown[]) => void);
});
it("up from .rigbundle resolves a relative --target against the client cwd on the local route", async () => {
let lastBody: Record<string, unknown> = {};
const origListeners = server.listeners("request");
server.removeAllListeners("request");
server.on("request", async (req: http.IncomingMessage, res: http.ServerResponse) => {
let body = "";
for await (const chunk of req) body += chunk;
if (req.url === "/api/up") {
lastBody = JSON.parse(body);
res.writeHead(201, { "Content-Type": "application/json" });
res.end(JSON.stringify({ status: "completed", runId: "r", rigId: "g", stages: [], errors: [] }));
}
});
await captureLogs(async () => {
await makeCmd().parseAsync(["node", "rig", "up", "/tmp/demo.rigbundle", "--target", "rel/target-root"]);
});
expect(lastBody.targetRoot).toBe(`${process.cwd()}/rel/target-root`);
server.removeAllListeners("request");
for (const l of origListeners) server.on("request", l as (...args: unknown[]) => void);
});
it("up from .rigbundle with --cwd and no --target keeps the default target and sends --cwd only as cwdOverride", async () => {
let lastBody: Record<string, unknown> = {};
const origListeners = server.listeners("request");
server.removeAllListeners("request");
server.on("request", async (req: http.IncomingMessage, res: http.ServerResponse) => {
let body = "";
for await (const chunk of req) body += chunk;
if (req.url === "/api/up") {
lastBody = JSON.parse(body);
res.writeHead(201, { "Content-Type": "application/json" });
res.end(JSON.stringify({ status: "completed", runId: "r", rigId: "g", stages: [], errors: [] }));
}
});
await captureLogs(async () => {
await makeCmd().parseAsync(["node", "rig", "up", "/tmp/demo.rigbundle", "--cwd", "rel/launch-dir"]);
});
expect(lastBody.targetRoot).toBe(process.cwd());
expect(lastBody.cwdOverride).toBe(`${process.cwd()}/rel/launch-dir`);
server.removeAllListeners("request");
for (const l of origListeners) server.on("request", l as (...args: unknown[]) => void);
});
it("up from a library name defaults cwdOverride to the caller working directory", async () => {
let lastBody: Record<string, unknown> = {};
const origListeners = server.listeners("request");
+15
View File
@@ -89,6 +89,21 @@ describe("rig view CLI (PL-004 Phase B)", () => {
expect(call!.path).toContain("limit=50");
});
it("show execution passes project and mission scopes to the daemon", async () => {
const { deps, calls } = makeDeps();
const program = createProgram({ viewDeps: deps });
program.exitOverride();
await program.parseAsync([
"node", "rig", "view", "show", "execution",
"--project", "alpha",
"--mission", "release-next",
"--json",
]);
const call = calls.find((c) => c.method === "GET" && c.path.startsWith("/api/views/execution"));
expect(call?.path).toContain("project=alpha");
expect(call?.path).toContain("mission=release-next");
});
it("show without query params constructs path without ?", async () => {
const { deps, calls } = makeDeps({
routes: { "GET /api/views/founder": { status: 200, data: { rowCount: 0 } } },
@@ -95,13 +95,22 @@ function normalizeRateLimits(value) {
for (const key of ["five_hour", "seven_day"]) {
const window = value[key];
if (!window || typeof window !== "object" || Array.isArray(window)) continue;
const resetsAt = typeof window.resets_at === "number"
? unixSecondsToIso(window.resets_at)
: window.resets_at;
if (typeof window.used_percentage !== "number" || !Number.isFinite(window.used_percentage)
|| typeof window.resets_at !== "string") continue;
result[key] = { usedPercent: window.used_percentage, resetsAt: window.resets_at };
|| typeof resetsAt !== "string") continue;
result[key] = { usedPercent: window.used_percentage, resetsAt };
}
return result.five_hour || result.seven_day ? result : null;
}
function unixSecondsToIso(value) {
if (!Number.isFinite(value)) return null;
const date = new Date(value * 1000);
return Number.isNaN(date.getTime()) ? null : date.toISOString();
}
function writeJsonAtomic(outputPath, value) {
const tmpPath = outputPath + ".tmp";
const dir = path.dirname(outputPath);
@@ -36,6 +36,13 @@ Fresh seats normally also receive `openrig-onboarding-01.md` and
Operators who provide equivalent guidance can disable both with
`onboarding.default_pack.enabled`; this identity pointer remains available.
## When OpenRig itself misbehaves
Run `rig context get help`. It is the one help guide, matched to your installed version: check the environment, find
the next step, compare known problems, and send the OpenRig team a useful report when you are still stuck. If `rig`
itself won't run, read `daemon/docs/reference/help.md` inside the installed `@openrig/cli` package (under
`npm root -g`), or the same text at https://www.openrig.dev/help/agents.
## What this file is not
It is not the manual, and these commands are a fraction of what is available.
@@ -1,12 +1,13 @@
---
name: applying-a-permission-policy
description: >-
Use when a user asks an agent to configure OpenRig command permissions, reduce
repeated native approval prompts, or apply a selected rig/seat permission policy.
Use before launching a team during agent-guided setup, or when a user asks to
configure OpenRig command permissions, reduce repeated native approval prompts,
or apply a selected rig/seat permission policy.
metadata:
openrig:
stage: established
docs_checked: "2026-09-25"
docs_checked: "2026-09-29"
verification_status: "Verify the installed harness version and effective settings; a rule-parser result is not a native permission test."
---
@@ -17,10 +18,40 @@ OpenRig operating posture, native command rules, sandbox access and launch flags
are separate controls. A command rule grants execution capability, not authority
to invent tasks, publish work or change another host.
## Ask once before team launch
Reuse an existing explicit choice for these harnesses and this scope from the
user's onboarding context; do not ask again. Existing rules are configuration,
not evidence of consent to expand their scope. Preserve them without expansion.
If the choice is unknown, briefly explain:
> This allows the whole `rig` command family, including starting/stopping agents,
> changing OpenRig configuration and launching processes. It is not global YOLO
> or permission to invent work. The scope is your personal settings for this
> project unless you explicitly choose your user-wide sessions instead.
>
> Allow your agents to run OpenRig commands without repeated permission prompts?
> **Yes — recommended** / **No — keep prompts**
- **Yes:** require an actual affirmative answer, then apply the procedure below
at that scope for the selected harnesses. Never substitute user-wide rules
when project rules are unsupported. Native restrictions still apply.
- **No:** leave permission settings unchanged and continue with existing prompts.
- **No answer:** make no settings change, infer no consent and continue with
existing prompts. Do not keep asking during this setup.
Remember an explicit Yes or No in the existing onboarding/project context the
agent already reads: choice, harnesses and scope. For Yes, record the exact files
and entries added, any pre-existing equivalents, and the loading/verification
result. Do not add a preference service or native configuration key. No answer
is not a remembered No. Offer broader permissive operation only as a separate
explicit opt-in; the setup question does not select a builtin policy or mode.
## Choose the intended scope
Use an existing explicit choice; otherwise explain these options and ask which
the user wants. Do not ask again for routine steps already authorized.
Outside the setup question above, use an existing explicit choice; otherwise
explain these options and ask which the user wants. Do not reopen the menu after
an answered setup question or ask again for routine steps already authorized.
| Choice | What the agent configures |
| --- | --- |
@@ -47,7 +78,14 @@ execution, an entire interpreter or a generic shell wrapper.
hooks, auth, MCP, model settings and unrelated values. An allow must not erase
a stricter rule or managed requirement. Report a real conflict instead of
silently bypassing it.
Check both bare and actual absolute command spellings: a restriction on one
may not match the other. If a new allowance would evade a stricter restriction,
leave that addition unapplied and report the conflict; do not switch spellings
to bypass it.
4. Back up touched files and merge only authorized additions, avoiding duplicates.
Recognize equivalent existing entries (including Claude's legacy `Bash(rig:*)`);
leave their markers untouched. Reapplying the same choice must be a no-op when
the required entries already exist, including no timestamp-only rewrite.
The agent performs these edits; hand-editing is an option, not a required user
chore. Apply the selected scope without another conversational permission round.
Native enforcement still applies.
@@ -60,8 +98,15 @@ execution, an entire interpreter or a generic shell wrapper.
not destructive probes. Report effective settings and remaining prompts.
A parser match alone does not establish native behavior.
For rollback, remove only this setup's additions, preserving later unrelated
edits. Builtin policy specs remain read-only; customize in user space.
Give the user this short undo: **“Undo the OpenRig command allowances added by
this setup; keep my other rules.”** The agent removes only the recorded entries
from their exact files, preserving pre-existing rules and subsequent edits.
For Codex remove those `prefix_rule` entries; for Claude remove those
`permissions.allow` entries. Delete a newly created rules file only if it still
contains solely this setup's additions. Never restore the entire backup over
later changes. Record the changed choice in the same context and verify native
reloading/revocation; other pre-existing allowances may still permit `rig`.
Builtin policy specs remain read-only; customize in user space.
## Codex command rules
@@ -103,8 +148,10 @@ codex execpolicy check --pretty --rules /absolute/path/to/openrig.rules -- print
```
Inspect matches, not only exit status; repeat `--rules` for other effective
files. A matching `prompt` or `forbidden` overrides allow. Verify rule loading
in the target conversation after the required reload. For project-only scope,
files. A matching `prompt` or `forbidden` overrides allow. The official procedure
loads `.rules` at session startup; a file edit alone does not reload this turn.
Preserve the conversation and use an authorized supported resume when needed,
then verify loading in the target conversation. For project-only scope,
confirm the layer is active there and absent from an unrelated project's active
layers. An evaluator given an explicit `--rules` file proves matching, not that
scope or automatic loading. Existing user-wide rules may already permit the
@@ -134,7 +181,9 @@ Current syntax uses ` *` for a command family; `Bash(rig:*)` is also supported.
Narrower examples are `Bash(rig ps *)` and `Bash(rig queue list *)`.
Preserve `deny`/`ask` entries and `defaultMode`; do not add `Bash(*)` or switch
to bypass to resolve a mismatch. Inspect native `/permissions` and verify the
actual command spelling.
actual command spelling. A bare rule does not cover every absolute invocation:
derive the actual executable and, after the stricter-rule check above, add its
exact `Bash(/actual/path/to/rig *)` spelling if needed. Do not use a path wildcard.
Choose scope using the [settings reference](https://code.claude.com/docs/en/settings):
`.claude/settings.local.json` for personal project settings,
@@ -143,6 +192,9 @@ Choose scope using the [settings reference](https://code.claude.com/docs/en/sett
Confirm the effective project root, especially for worktrees. Keep personal
settings out of commits. Managed restrictions and sandbox/network controls
still apply; a Bash allow is not a general network policy.
Current Claude settings documentation describes live reload of permission
edits. Confirm the rule's source in `/permissions` and repeated harmless calls
in the target conversation; do not claim prompt behavior from JSON validity.
## Existing policies and broader modes
@@ -154,9 +206,10 @@ is unavailable, explain the remaining choice instead of selecting broader access
For explicitly chosen broader operation, inspect
`rig policy current --spec <user-owned-rig.yaml>` and the compatible getting-started guide's **Opt-in permissive
operation** section. OpenRig's Codex `builtin:yolo` supplies `-s danger-full-access`;
it does not itself select `approval_policy` and replaces a named
`codex_config_profile` argument. Claude's corresponding launch flag is
operation** section. OpenRig's Codex `builtin:yolo` supplies
`-s danger-full-access -a never` and replaces a named `codex_config_profile`
argument. The legacy environment-only YOLO path selects only the sandbox.
Claude's corresponding launch flag is
`--dangerously-skip-permissions`. Neither a resource `profile: default` nor OpenRig
operating posture is a native permission policy. Do not change shipped defaults
or assume editing a launch spec changes an existing seat.
@@ -3,8 +3,9 @@ import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";
const skillRoot = path.resolve(new URL("..", import.meta.url).pathname);
const skillRoot = path.resolve(fileURLToPath(new URL("..", import.meta.url)));
const restoreScript = path.join(skillRoot, "scripts", "restore-from-jsonl.mjs");
// P6(C) injectable output-root: the packet base defaults to the shared
// /tmp/claude-compaction-restore (production), but becomes per-run isolated when the
@@ -113,6 +113,13 @@ General engineering skills OpenRig ships as vendored copies. Open when the task
- **frontend-design** — designing frontend / UI.
- **dogfood** — web-QA / dogfooding a shipped UI.
## When OpenRig itself misbehaves
Run `rig context get help`: the one help guide for your installed version, from symptom to next step, known problems,
and a useful report to the OpenRig team if you are still stuck. If `rig` won't run, read
`daemon/docs/reference/help.md` inside the installed `@openrig/cli` package, or https://www.openrig.dev/help/agents
(the same text).
## Need more than what ships here?
This index covers the **shipped** surface. A dev host carries far more (factory, architecture, PM-craft, studio skills) reached through the host's own routers/codemaps — if you're on a builder host and need something not listed above, that deeper routing is the next hop, not a wall. (Host-scale routing is the subject of the context-routing architecture doc; at product scale, this one file is the whole map.)
+1
View File
@@ -0,0 +1 @@
../../../../docs/reference/help.md
@@ -0,0 +1,9 @@
# Agent help: the single troubleshooting and escalation guide (docs/reference/help.md).
name: help
version: "0"
taxonomy: world
purpose: "What an agent does when its user says OpenRig isn't working: diagnose, fix within permissions, verify, and escalate to OpenRig support."
files:
- path: help.md
role: reference
summary: "Help your user get unstuck: environment checks, version-matched guidance, known problems, and how to reach OpenRig support."
@@ -286,6 +286,9 @@ not have to tear one down to change it, and you rarely have to start from nothin
**Being able to recover is a capability, not a contingency**, and most of this surface exists
because someone lost work once.
When your user says OpenRig isn't working, start with **`rig context get help`**: the one help guide for the installed
version, from checking the environment to a useful report to the OpenRig team.
- **`rig start`** — the box rebooted and everything is gone: bring the whole topology back in one
move, rather than hand-restoring rig by rig. Selected-rig recovery now demands positive runtime
evidence and refuses stale identity by name rather than substituting an occupant.
@@ -0,0 +1 @@
../../../../docs/reference/getting-started.md
@@ -0,0 +1 @@
../../../../docs/reference/instance-layout.md
@@ -0,0 +1,16 @@
# Reference guides the help pack links to, loaded one file or section at a time by address
# (rig context get reference/<file>#<section>). Each file is a symlink to docs/reference/.
name: reference
version: "0"
taxonomy: world
purpose: "Version-matched reference guides the help guide links to. Load a single file or section by address; don't load the whole pack."
files:
- path: getting-started.md
role: reference
summary: "Getting started: setup, first team, recovery after a reboot, and permissions."
- path: instance-layout.md
role: reference
summary: "Where an OpenRig instance keeps its files and configuration."
- path: rig-spec.md
role: reference
summary: "The rig specification format."
@@ -0,0 +1 @@
../../../../docs/reference/rig-spec.md
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@openrig/daemon",
"version": "0.6.0",
"version": "0.6.3",
"private": true,
"license": "Apache-2.0",
"type": "module",
@@ -1,3 +1,8 @@
---
name: vault-user
description: Use when checking the health of this rig's HashiCorp Vault or writing, reading, listing, deleting or explaining its secrets.
---
# Vault User
You have access to a HashiCorp Vault instance managed by this rig's environment.
@@ -113,6 +113,13 @@ General engineering skills OpenRig ships as vendored copies. Open when the task
- **frontend-design** — designing frontend / UI.
- **dogfood** — web-QA / dogfooding a shipped UI.
## When OpenRig itself misbehaves
Run `rig context get help`: the one help guide for your installed version, from symptom to next step, known problems,
and a useful report to the OpenRig team if you are still stuck. If `rig` won't run, read
`daemon/docs/reference/help.md` inside the installed `@openrig/cli` package, or https://www.openrig.dev/help/agents
(the same text).
## Need more than what ships here?
This index covers the **shipped** surface. A dev host carries far more (factory, architecture, PM-craft, studio skills) reached through the host's own routers/codemaps — if you're on a builder host and need something not listed above, that deeper routing is the next hop, not a wall. (Host-scale routing is the subject of the context-routing architecture doc; at product scale, this one file is the whole map.)
@@ -37,6 +37,31 @@ read [references/worked-example.md](references/worked-example.md). Installed cop
`rig context get skills/core/openrig-software-factory/references/worked-example.md`.
A roadmap, YAML file or wake does not execute work or authorize a new outcome.
## Choose the first project's providers
Ask which working account(s) the user wants: Claude Code, Codex, or both. Reuse
an explicit choice and recommend the account they already have working. Use
`first-project-claude` (two Claude), `first-project` (two Codex), or
`first-project-mixed` (Claude owner, Codex checker). All share the same task and
owner/checker culture. Check only selected CLIs/logins; request `claude auth login`
or `codex login` once when that selected login is missing. No credential copying,
unused provider prerequisite or silent model/provider fallback.
Read the compatible getting-started guide's **Choose your providers** and
**Kernel startup stays automatic** sections before launch. The choice selects
the two project agents. Kernel auto-boot independently uses available
authenticated accounts, so it may use both even when the project uses one.
Do not add an unused-provider login gate or manual kernel setup to this path.
An instance-wide provider restriction is a separate request. Preserve an
existing kernel and working user rigs.
Show the chosen recipe, resolved runtimes/models and exact
`rig up <starter> --cwd . --plan` / `rig up <starter> --cwd .` commands. Codex seats
retain `gpt-6-astra`; Claude seats use the configured native default without an
OpenRig model override. Confirm that model with the user and its availability;
verify the native session's actual model before consequential work. Use the
chosen rig name in owner/checker addresses throughout the same task and return.
## Establish the working agreement
Read the repository instructions, current work and desired user-visible result.
@@ -51,12 +76,18 @@ model turns, but delivered wakes and resumed work **can spend tokens**. Prefer
an event-driven wait to frequent empty reminders. Wakes cannot answer a user
question, clear a permission prompt or guarantee progress.
**Choose permissions before launching or assigning work.** Offer ordinary prompts,
persistent rules for selected commands, or deliberately broader access. Follow
[Applying a permission policy](#find-the-compatible-permission-guide) to perform
the user's choice and verify it in the target conversation. Preserve restrictions
and unrelated settings. A whole `rig` allowance covers every verb, not just reads;
it does not grant new product authority or change everyone else's defaults.
**Ask once before launching or assigning work:** “Allow your agents to run
OpenRig commands without repeated permission prompts?” **Yes — recommended** /
**No — keep prompts**. Reuse an existing explicit choice for this scope. Explain
that this covers all `rig` verbs, including starting/stopping agents and changing
configuration, at personal project scope unless the user explicitly chooses
user-wide sessions. It is not global YOLO or permission to invent work.
On an actual Yes, follow [Applying a permission policy](#find-the-compatible-permission-guide)
to add existing native rules, preserve stricter/unrelated settings, and verify
the target conversation. No or no answer leaves settings alone and continues
with existing prompts. Remember the explicit choice and exact additions in the
existing onboarding context; “Undo the OpenRig command allowances added by this
setup” removes only those additions. Broader access remains a separate opt-in.
Keep purpose, acceptance, decisions and evidence in existing project files.
Deliver selected context and obtain each seat's scope reaction; retrieval alone
@@ -0,0 +1,39 @@
# First project
Work in the repository selected at launch. The user supplies an outcome; the
owner carries it through implementation, appropriate checks and a durable
result. Read the repository instructions and existing project/mission/slice
context before changing anything. If there is no selected workflow, keep the
path light. Do not install a release process for a first task.
## Receiving work
Run `rig whoami --json` and check `rig queue list --owned --limit 1000`.
Claim an assigned row before working. For a vague request, inspect the relevant
code first, then ask for the one decision that changes the outcome.
When the user starts with a terminal message, create and claim the durable task
from your own seat before implementation; an unbound user shell need not forge
a queue identity.
For the first meaningful code change, ask dev-check for an independent check
of the exact diff and the behavior it promises. Subsequent checks should match
the consequence of the work. Hand off through `rig queue handoff`, with the
repository path, candidate commit or diff, checks run and any limits. Consult
`--help` for current syntax. Do not use chat text as the work record.
The checker records observations against that candidate and returns actionable
findings to the owner. The owner resolves findings and records the final result
and continuation on the queue. Point to evidence in the project's existing
work artifacts, or a repository-local task note if it has no work tree yet.
Do not mark a change accepted because another row closed.
## Boundaries and continuation
Keep local edits and commits within the assigned change. Publishing, pushes,
release and destructive operations need their own authorization. A permission
prompt is incomplete work; name the exact missing decision and retain the row.
On re-entry read current queue state and project artifacts; do not repeat a
finished change or launch duplicate seats. Explain the result in terms the
user can exercise, state what was not checked, and name the next useful action.
Leave the project ready for another outcome at the same owner address.
@@ -0,0 +1,30 @@
version: "0.2"
name: first-project-claude
summary: >
Two Claude Code seats in your repository: an outcome owner and an
independent checker. Give the owner one bounded change; follow the durable result and
continue at the same address. See docs/reference/getting-started.md.
# Culture mirrors first-project/CULTURE.md; equality is checked in first-project-providers.test.ts.
culture_file: CULTURE.md
pods:
- id: dev
label: Project
members:
- id: owner
agent_ref: "local:../../../agents/development/implementer"
runtime: claude-code
profile: default
cwd: "."
- id: check
agent_ref: "local:../../../agents/development/qa"
runtime: claude-code
profile: default
cwd: "."
edges:
- kind: delegates_to
from: owner
to: check
edges: []
@@ -0,0 +1,39 @@
# First project
Work in the repository selected at launch. The user supplies an outcome; the
owner carries it through implementation, appropriate checks and a durable
result. Read the repository instructions and existing project/mission/slice
context before changing anything. If there is no selected workflow, keep the
path light. Do not install a release process for a first task.
## Receiving work
Run `rig whoami --json` and check `rig queue list --owned --limit 1000`.
Claim an assigned row before working. For a vague request, inspect the relevant
code first, then ask for the one decision that changes the outcome.
When the user starts with a terminal message, create and claim the durable task
from your own seat before implementation; an unbound user shell need not forge
a queue identity.
For the first meaningful code change, ask dev-check for an independent check
of the exact diff and the behavior it promises. Subsequent checks should match
the consequence of the work. Hand off through `rig queue handoff`, with the
repository path, candidate commit or diff, checks run and any limits. Consult
`--help` for current syntax. Do not use chat text as the work record.
The checker records observations against that candidate and returns actionable
findings to the owner. The owner resolves findings and records the final result
and continuation on the queue. Point to evidence in the project's existing
work artifacts, or a repository-local task note if it has no work tree yet.
Do not mark a change accepted because another row closed.
## Boundaries and continuation
Keep local edits and commits within the assigned change. Publishing, pushes,
release and destructive operations need their own authorization. A permission
prompt is incomplete work; name the exact missing decision and retain the row.
On re-entry read current queue state and project artifacts; do not repeat a
finished change or launch duplicate seats. Explain the result in terms the
user can exercise, state what was not checked, and name the next useful action.
Leave the project ready for another outcome at the same owner address.
@@ -0,0 +1,31 @@
version: "0.2"
name: first-project-mixed
summary: >
A Claude Code owner and a Codex checker in your repository: an outcome owner and an
independent checker. Give the owner one bounded change; follow the durable result and
continue at the same address. See docs/reference/getting-started.md.
# Culture mirrors first-project/CULTURE.md; equality is checked in first-project-providers.test.ts.
culture_file: CULTURE.md
pods:
- id: dev
label: Project
members:
- id: owner
agent_ref: "local:../../../agents/development/implementer"
runtime: claude-code
profile: default
cwd: "."
- id: check
agent_ref: "local:../../../agents/development/qa"
runtime: codex
model: gpt-6-astra
profile: default
cwd: "."
edges:
- kind: delegates_to
from: owner
to: check
edges: []
@@ -15,7 +15,7 @@ profiles:
guidance: [role]
subagents: []
plugins: [shared:openrig-core]
runtime_resources: [shared:claude-default-settings, shared:claude-default-mcp, shared:codex-default-config]
runtime_resources: [shared:claude-default-settings, shared:claude-default-mcp, shared:codex-default-config, shared:claude-activity-hooks]
resources:
guidance:
@@ -15,7 +15,7 @@ profiles:
guidance: [role]
subagents: []
plugins: [shared:openrig-core]
runtime_resources: [shared:claude-default-settings, shared:claude-default-mcp, shared:codex-default-config]
runtime_resources: [shared:claude-default-settings, shared:claude-default-mcp, shared:codex-default-config, shared:claude-activity-hooks]
resources:
guidance:
@@ -15,7 +15,7 @@ profiles:
guidance: [role]
subagents: []
plugins: [shared:openrig-core]
runtime_resources: [shared:claude-default-settings, shared:claude-default-mcp, shared:codex-default-config]
runtime_resources: [shared:claude-default-settings, shared:claude-default-mcp, shared:codex-default-config, shared:claude-activity-hooks]
resources:
guidance:
@@ -464,7 +464,16 @@ export class ClaudeCodeAdapter implements RuntimeAdapter {
if (!targetDir) return true;
this.fs.mkdirp(targetDir);
const isDir = this.fs.listFiles ? this.fs.listFiles(entry.absolutePath).length > 0 : false;
let isDir = false;
if (this.fs.listFiles) {
try {
isDir = this.fs.listFiles(entry.absolutePath).length > 0;
} catch {
// File-shaped sources make the production listFiles (recursive
// fs.readdirSync walk) throw ENOTDIR — treat the entry as file-shaped.
isDir = false;
}
}
if (isDir && this.fs.listFiles) {
// Directory-shaped: recursive copy
Loaded 100 of 276 files, more files were not shown because too many files have changed in this diff. Show more