Skip to content

promote: rust-rewrite → canary (Rust rewrite + fresh-user setup hardening) - #1173

Merged
joelteply merged 477 commits into
canaryfrom
rust-rewrite
Jun 13, 2026
Merged

joelteply merged 477 commits into
canaryfrom
rust-rewrite

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Promotes the full rust-rewrite trunk to the canary release channel so other operators/agents can install and airc update from canary (per the rust-rewrite → canary → main path).

canary is a strict ancestor of rust-rewrite (was 476 behind, 0 unique commits), so this is a clean integration — canary's prior tip aaafc0c (#684) is the revert point.

Includes this session's fresh-user setup hardening (validated live on a clean Windows Git Bash box):

After merge, the others install from canary: AIRC_CHANNEL=canary install path.

🤖 Generated with Claude Code

joelteply and others added 30 commits May 22, 2026 13:20
Phase 3.5 continuation. Two more JSON sidecars eliminated:

1. The per-mesh-identity registry document used to live at
   `<root>/<mesh-identity>/registry.json`. Now backed by an
   `account_registry` table keyed by mesh_identity, with
   schema_version + generated_at + the document body as opaque
   JSON (treated as wire-payload encoding per non-neg #9 — the
   document is a published snapshot for cross-machine sync; live
   peer/subscription state lives in their own dedicated tables).

2. The gh-gist sentinel `<sentinel_root>/account-registry-gist-id`
   used a one-per-machine file (no mesh-identity scoping). Now a
   row in `account_registry_gist_sentinel` keyed by mesh_identity,
   so a single machine can carry multiple mesh identities (work +
   personal gh accounts) without their gist ids colliding.

Changes:

- New entity module `entities::account_registry` with two
  submodules (document, gist_sentinel) sharing one migration.
- Migration #7 `m20260522_000007_create_account_registry` (strictly
  additive; both tables in one file because they're the same
  feature surface).
- DTOs `StoredAccountRegistry`, `StoredAccountRegistryGistSentinel`
  in a small `account_registry` module on airc-store.
- `SqliteEventStore`:
    - `load_account_registry(mesh_identity)`
    - `save_account_registry(StoredAccountRegistry)` (upsert by
      mesh_identity)
    - `load_account_registry_gist_sentinel(mesh_identity)`
    - `save_account_registry_gist_sentinel(...)` (upsert)
    - `clear_account_registry_gist_sentinel(mesh_identity)` for the
      out-of-band gist-deleted case
- airc-lib:
    - `FileAccountRegistryStore` → `SqliteAccountRegistryStore`
      (re-exported with the new name; no `pub use
      FileAccountRegistryStore` callers existed outside tests).
      Wraps an `Arc<SqliteEventStore>`; serializes the document to
      JSON text and writes via the store. `refresh()` reads via
      the store and validates the document.
    - `GhAccountRegistryStore` now takes `Arc<SqliteEventStore>`
      instead of `sentinel_root: PathBuf`. Sentinel load/save/clear
      go through the store; no more `std::fs::read_to_string` /
      `std::fs::write` / `std::fs::remove_file` on the sentinel
      path.
    - Tests updated: `file_registry_*` → `sqlite_registry_*`
      using a temp `SqliteEventStore::open_path`. Gh sentinel test
      becomes async + round-trips through the store.

Doctrine alignment: non-negotiable #9 ("Durable substrate data
uses the store/ORM boundary"). The document body remains JSON
because it's wire-payload encoding for cross-machine sync — the
allowance the non-negotiable carves out for "wire payload
encoding ... external invite documents." Per-row identifiers
(mesh_identity, gist_id, schema_version) are typed columns with
indexes, not JSON-buried fields.

Verification:
- `cargo test --workspace`: all suites green.
- `cargo clippy --workspace --all-targets -- -D warnings` clean.
- `cargo fmt --check` clean.

Remaining Phase 3.5: coordinator beacons (the local `accounts/`
beacon directory under wire_root), plus any residual sidecar
cleanup.

Co-authored-by: Claude Opus 4.7 <[email protected]>
* fix(store): persist coordinator beacons through ORM

* test(lib): assert registry imports against coordinator store
cleanup(cli): remove config json command shim
Regression hit live by Claude Code's Monitor after #882 introduced
the `if !stdout_is_tty { return false; }` short-circuit. Monitor
captures the child's stdout via a pipe, so `IsTerminal` is false
even though we ARE in an agent runtime that wants the live stream.
The old priority order classified Monitor as a "noninteractive
script" and exited `airc join` immediately.

Reorder the decision so agent markers and the runtime-client
detector win over the piped-stdout check:

  1. `AIRC_NO_ATTACH=1` — explicit operator opt-out.
  2. Cargo context (`CARGO_BIN_EXE_*` / `CARGO_PKG_NAME`) — wins
     over agent markers so install proofs / tests don't hang.
  3. Agent markers OR detected runtime client — wins over the TTY
     check; this is the Monitor/hook host path.
  4. TTY — fall-through for direct interactive users.
  5. Otherwise — script context, exit after setup.

The existing `join_attach_decision_exits_for_redirected_agent_script`
test was modeling the bug as the intended behavior; renamed to
`join_attach_decision_streams_for_monitor_piped_stdout` and flipped
the assertion to assert streaming, with a paired
`join_attach_decision_exits_for_plain_pipe_with_no_agent_context`
that pins the genuine script-context exit.

Verification:
- Workspace tests green (9 attach-decision tests pass).
- `cargo clippy --workspace --all-targets -- -D warnings` clean.
- `cargo fmt --check` clean.
- Manually reinstalled + restarted Monitor: attach loop engages on
  the new binary; subsequent unrelated frame-verification bug
  (historical peer not in registry) caught and filed separately.

Co-authored-by: Claude Opus 4.7 <[email protected]>
…905)

`replay_wire_once` was failing-closed when a single frame in the
wire couldn't be verified — most commonly a frame signed by a
peer who's no longer enrolled (orphan identity from a previous
install on the same shared wire). That single bad frame aborted
the entire replay, which broke `airc inbox`, `airc join`'s
attach loop, and any other call site that opens the wire.

Now matches the policy already used by `spawn_frame_ingest` in
transport.rs:91-100: log the failure and continue, so legitimate
later frames still flow through.

Both error branches in `replay_wire_once` now skip-and-warn:

1. Malformed JSON on a single line — wire files can carry frames
   from older builds or ad-hoc test fixtures; refusing to read
   past one means losing every later real event too.
2. Verification failure (signer not in registry, signature
   mismatch, etc.) — same fail-open policy as the live ingest
   task.

Concrete repro live-debugged today: my Claude scope's old
peer_id 55c30b28 wrote frames to ~/.airc/wires/cambriantech/
yesterday. After today's identity reset, my new install's peer
registry no longer trusts that orphan id. `airc inbox` (and
`airc join`'s attach replay) failed with:

  airc: crypto: signer 55c30b28-...-c0279bbe7ef is not in the
  peer key registry

…aborting the whole replay so I couldn't read ANY cambriantech
frames, including new legitimate ones from Codex. With this fix
the unverifiable frame is logged + skipped and the rest of the
wire reads cleanly.

Co-authored-by: Claude Opus 4.7 <[email protected]>
* docs: add data-model reference + Phase 3.5 migration playbook

Two factual references covering the Phase 3.5 ORM-end-to-end work:

- `docs/DATA-MODEL-REFERENCE.md` — authoritative schema for every
  persistent table in the airc substrate (events, runtime_cursors,
  peer_trust, peer_rotation_audit, subscriptions, local_identity,
  mesh_identity, account_registry, account_registry_gist_sentinel,
  beacons, beacon_channels). One row per table with columns,
  ownership/readers, retention, indexes, and cross-table
  invariants. Explicitly calls out what is NOT in the database
  (wire transcript files, refresh-lock sentinels, Ed25519 secret)
  and the doctrine for adding new tables.

- `docs/PHASE-3.5-MIGRATION.md` — operator playbook for production
  installs upgrading off the sidecar JSON files. Quick-reference
  table of which JSONs migrate automatically (only identity.json
  via #902) vs which are wiped + rebuilt by re-join (subscriptions,
  beacons, mesh_identity cache, etc.). Recovery procedures for
  half-initialised states (partial-state errors, orphan signer,
  '0 paired remote peers'). Hand-cleanup list for dead sidecars
  after a successful upgrade.

Companion docs (AR-LATENCY-CONTRACT, CAMBRIAN-CONSUMER-INTEGRATION-MATRIX,
PEER-DISCOVERY-SCALABILITY, AIRC-RUST-SUBSTRATE/README framing
updates) pending framing approval — AR-first vs Continuum-first
ordering needs Joel's call.

Part of the docs-audit follow-up to GRID-SUBSTRATE-AUDIT.md.

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

* docs: AR/Cambrian/grid framing + 3 new architecture docs

Widens the doctrine docs from agent-chat-only framing to the
backbone bus reality Joel defined: airc carries AR pose streams
(60–90Hz, sub-25ms p99), all Cambrian internal coordination
(Continuum, OpenClaw, Hermes, agent-relay, forge-alloy,
sentinel-ai, AI agents), and the p2p grid Continuum is building.
IRC-shaped chat is one consumer profile among many, not the
substrate's center.

New docs:

- `docs/PEER-DISCOVERY-SCALABILITY.md` — current three-layer
  discovery model (same-machine via shared HOME, per-operator-fleet
  via account-registry gist, grid-to-grid pending). Beacon TTL
  strategy, refresh policy. Open questions for scaling past the
  100-gist discovery window + cross-operator pairing primitive.

- `docs/architecture/AR-LATENCY-CONTRACT.md` — first-cut AR consumer
  contract. Profile A (60–90Hz pose), Profile B (5–20Hz shared
  anchors), Profile C (sparse commands). Targets for cadence,
  payload, e2e latency. What airc provides today vs what AR
  consumers still need (latency-class headers, per-stream priority,
  payload-size budget enforcement, ephemeral kind for non-durable
  high-rate streams). Lists measurement requirements before
  numbers lock down. Marks TBD-pending-Continuum-measurement.

- `docs/architecture/CAMBRIAN-CONSUMER-INTEGRATION-MATRIX.md` —
  canonical roster of consumers + headers + table-access. Covers
  Continuum, OpenClaw, Hermes, Claude Code, OpenAI Codex, Cursor,
  opencode, Windsurf, agent-relay (TBD), forge-alloy (TBD),
  sentinel-ai (TBD), Generic. Headers convention
  (`airc.client`, `airc.correlation_id`, `airc.route_class`).
  Onboarding checklist for new consumers.

Framing updates:

- `docs/architecture/AIRC-RUST-SUBSTRATE.md` — title changed to
  "Backbone Bus for Cambrian AR, Continuum/OpenClaw/Hermes, and
  the p2p Grid"; opening rewritten to lead with three
  consumer-classes (AR / Cambrian internal / grid) in decreasing
  latency-sensitivity. The three roles section adds command plane
  (Phase 4) alongside network substrate + event bus, drops the
  "messaging layer" framing.

- `README.md` — title changed to "Cambrian's Backbone Bus";
  opening rewritten to lead with AR pose streams + non-chat
  consumers; clarifies routing primitives are (1) header-filtered
  subscription delivery + (2) the route resolver (LAN / Tailscale
  / relay / WebRTC / Reticulum) with optional `airc.route_class`
  hint; the IRC-shaped model section reframed as one consumer
  profile rather than the substrate's center.

Companion follow-ups still pending:

- GRID-SUBSTRATE-AUDIT.md Phase 3.5 closure markers
- ROBUSTNESS-INTEGRATION-PLAN.md shipped vs aspirational partition
- crates/airc-lib/src/lib.rs module doc cleanup
- REFCONTRACT.md "legacy" header

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

* docs: Phase 3.5 closure markers + lib.rs facade doc + legacy REFCONTRACT label

Smaller follow-ups completing the docs audit batch:

- `docs/architecture/GRID-SUBSTRATE-AUDIT.md` — Phase 3.6 "Layering
  rot" section now distinguishes which findings have been softened
  by Phase 3.5 work (peers_store became a shim post-#883/#885/#902)
  vs which are still OPEN (lib naming daemon types,
  transport-owns-crypto-state, line-delimited JSON IPC). The audit
  was painting all three as untouched after Phase 3.5 landed.

- `crates/airc-lib/src/lib.rs` — module doc updated to reflect
  reality: in-process AND daemon-attached modes both ship. The
  previous doc said daemon mode was "queued for slice 6b" but the
  Airc::attach surface has been live for months. Links to the
  doctrine + consumer matrix + data-model docs.

- `REFCONTRACT.md` — labeled LEGACY HISTORICAL SPEC ONLY at the
  top. Bearer/gist-as-data-plane code referenced inside was deleted
  in #899/#900; current substrate specs live in
  docs/architecture/*. Readers landing on REFCONTRACT first were
  getting the pre-rewrite picture without realizing it.

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

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
)

* feat(cli): airc doctor — install + identity + scope self-diagnosis

Skill `skills/doctor/SKILL.md` documented agents calling
`airc doctor` / `--health` / `--fix`. None of those subcommands
actually existed on the Rust binary. This PR makes the skill
contract real.

`airc doctor` walks four checks:

1. **Identity** — `identity.key` + `local_identity` row pairing.
   Reports the partial-state cases I (claude) lived through this
   weekend:
   - key + row + (json optional) → `[ok]`
   - nothing → `[info]` "fresh scope"
   - key only → `[BLOCKED]` "orphan key, no recovery without backup"
   - row only → `[BLOCKED]` "key file missing, can't sign"
   - key + legacy json + no row → `[WARN]` "pre-#902 install, join
     will auto-migrate"
   - legacy json without key → `[WARN]` "orphan metadata"
   Each non-ok finding carries the exact one-liner fix the
   operator (or agent) should run.

2. **Daemon liveness** — pings the IPC socket for the scope.
   Distinguishes "not running (`airc join` will spawn)" from
   "stale socket file from prior crash, `airc join` will fail
   until cleaned." On `--fix`, stale sockets are removed.

3. **Binary freshness** — surfaces the install dir so operators
   notice old-binary-on-PATH symptoms. Build-metadata-derived
   stale detection is a follow-up (needs `build.rs`).

4. **Route + transport health** (with `--health`) — calls into
   `Airc::refresh_route_discovery` and renders the typed
   `TransportHealthSample` snapshot. Same source as `airc transport
   health`, surfaced inside the doctor walk.

`--fix` applies only safe auto-recoveries (stale socket removal
today). Identity partial-state is intentionally NOT auto-recovered
— wiping a peer_id discards remote-peer trust enrolled on the
orphan id; the manual one-liner (`airc teardown --flush`) is the
right call there.

Status labels use the literal `[ok]` `[info]` `[WARN]` `[BLOCKED]`
strings from the skill markdown so the AI narration layer stays
aligned with the binary output (regression-guarded by
`status_labels_match_skill_doc`).

New module `crates/airc-cli/src/doctor.rs`; `Command::Doctor` arm
in `cli.rs`; dispatch in `main.rs`. 4 tests:
- `status_labels_match_skill_doc`
- `fresh_scope_reports_no_identity_material`
- `key_without_row_is_blocked_with_clear_fix`
- `key_plus_legacy_json_reports_pre_902_install`

Verification: workspace clippy (-D warnings) clean, fmt clean, all
4 doctor tests + workspace test suite green. Live-tested on the
HOME scope: identity ok, daemon not running, binary install dir
surfaced.

Onboarding-friction PR: this is the diagnostic floor for new
machines coming online (M1, Intel Mac 2017, Windows boxes). When
something doesn't work post-install, `airc doctor` gives the
operator (or the AI agent on their behalf) the exact fix instead
of a generic error.

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

* docs(cli): clarify doctor fix scope

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
* feat(lib): expose subscription query API

* test(lib): make subscription cursor proof deterministic

* test(cli): keep join e2e setup non-streaming
#912)

* feat(lib): command-bus primitive (Airc::request / reply / await_reply)

Phase 4 of GRID-SUBSTRATE-AUDIT. Typed request/reply on top of the
substrate's event model with correlation + deadline + cancellation.
Serves three use cases on the same primitive (named "command"
deliberately, not "tool", because the use cases go beyond agent
tools):

  1. Tool integration for AI agent runtimes — an agent's tool call
     (Claude/Codex/OpenClaw/Hermes invoking a remote capability)
     becomes `Airc::request(headers, body, deadline)`; the agent's
     tool returns when `await_reply` resolves. Maps cleanly onto
     each runtime's native promise/future/await.

  2. Continuum's event + promise-based command bus — distributed
     compute / model serving / capability leasing. Same
     correlation_id semantics, same deadline + cancellation
     contract.

  3. Cross-runtime workflows — OpenClaw thread emits a command
     Hermes handles; sentinel-ai alerts an operator dashboard
     replies to; AR command planes route the same way.

A command is conceptually an async task. The substrate carries
both the request and the reply as plain events with paired
`airc.correlation_id`. Forge-alloy contracts (the typed-payload
layer) ride alongside: typically `forge.body_hint=<contract>` for
the body schema, `airc.command_kind=<contract>` for the
substrate's routing/dispatch view.

Changes:

- `crates/airc-protocol/src/headers_keys.rs` — two new header
  constants: `HEADER_AIRC_CORRELATION_ID`, `HEADER_AIRC_COMMAND_KIND`
  (re-exported from `airc_protocol`). Existing `HEADER_AIRC_REPLY_TO`
  and `HEADER_AIRC_DEADLINE` are reused.

- `crates/airc-lib/src/command_bus.rs` (new) —
  `PendingCommand { correlation_id, deadline_at_ms }`,
  `Airc::request(target, headers, body, deadline)`,
  `Airc::reply(reply_to, correlation_id, headers, body)`,
  `Airc::await_reply(pending) -> Result<TranscriptEvent, AircError>`.
  Filter-on-subscribe pattern: await_reply subscribes to the live
  broadcast and matches by `airc.correlation_id` until match or
  deadline elapse.

- `crates/airc-lib/src/error.rs` — new variant
  `AircError::CommandDeadline { correlation_id }` for the timeout
  case. Consumers retry with a fresh correlation id; the substrate
  doesn't reuse timed-out ids.

- `crates/airc-lib/tests/command_bus_round_trip.rs` (new) — two
  integration tests using temp_env to set HOME so two scopes share
  the same machine-account wire:
  - `request_and_reply_round_trip_via_shared_wire` proves Alice
    issues a request, Bob's handler replies, Alice's `await_reply`
    resolves with the matching reply (correlation_id round-trips,
    body content survives).
  - `await_reply_returns_command_deadline_when_no_reply` proves
    the deadline path returns the typed error rather than hanging.

Verification:
- `cargo test --workspace` green (all suites)
- `cargo clippy --workspace --all-targets -- -D warnings` clean
- `cargo fmt --check` clean

Phase 4 doctrine: airc routes by correlation_id + delivers the
event; forge contracts define the payload semantics; consumers
own the command_kind vocabulary. The substrate stays
consumer-neutral.

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

* fix(lib): honor command bus envelope targets

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
docs: CI fidelity as substrate non-negotiable (audit #10)

Joel's principle: CI proves the production path; it does not
substitute around it. A test that disables a behavior the
production path enables is blind to the bugs that behavior
creates. Emulate the production shape; reach for disable-flags
only when the test is explicitly proving the disabled path.

Triggered by Codex's #911 Windows fix that set `AIRC_NO_ATTACH=1`
on setup-only join subprocesses to prevent streaming hang. The
fix is correct for that specific test but it tests setup-only;
a future regression on the stream path wouldn't fire.

Adds two pieces to GRID-SUBSTRATE-AUDIT.md:

1. Non-negotiable #10 — codifies the principle. Emulation
   beats disable-flag; "we can't emulate it cheaply" is a
   substrate gap to fix, not a license to disable.

2. Phase 5 follow-ups under a new "Known emulation gaps"
   subsection — catalogues current disable-flag sites
   (`AIRC_NO_ATTACH` in e2e setup; cross-machine fixture not
   yet emulated under CI) as filed substrate work, not test
   patches.

Doc-only.

Co-authored-by: Claude Opus 4.7 <[email protected]>
* feat(lib): typed lifecycle events (Phase 2)

Phase 2 of GRID-SUBSTRATE-AUDIT. The substrate now emits typed
events for state transitions consumers used to have to poll for.
Same envelope shape as chat-shaped events; same subscription
filter; same cursor-replayable persistence. Consumers
(Continuum, OpenClaw, Hermes, AR runtimes) subscribe via the
existing stream APIs and filter by `TranscriptKind`.

Variants added (`airc_core::TranscriptKind`):

- `PeerArrived` — body: `{peer_id, via}` where via is
  invite/account_registry/manual/local_scope.
- `PeerDeparted` — body: `{peer_id, reason}`.
- `WireEstablished` — body: `{wire, channel_name}`.
- `WireLost` — body: `{wire, reason}`.
- `RoomJoined` — body: `{channel_name, room_id, wire, is_default}`.
- `RoomParted` — body: `{channel_name, room_id}`.
- `SubscriptionAdvanced` — body: `{consumer_id, lamport, event_id}`.

Plus `TranscriptKind::is_lifecycle()` helper that classifies the
seven new variants distinctly from chat-shaped ones. Consumers
that want only chat filter via `EventFilter::kinds`.

Plumbing:

- `airc_core::transcript` — variant declarations + classification
  helper + per-variant body schema docs.
- `airc_store::sqlite` — both `to_active_model` and `from_model`
  extended to map the seven new kinds to/from their snake_case
  table strings. Round-trip preserved.
- `airc_lib::lifecycle` (new) — typed body structs
  (`RoomJoinedBody`, `PeerArrivedBody`, etc.) plus the
  pub(crate) `Airc::emit_lifecycle` helper that constructs the
  event, persists it via the store, fans it out via `live_tx`.
- `airc_lib::airc` — `Airc::join` now emits the RoomJoined event
  after the subscription is durable and the wire subscriber is
  up. Failures are non-fatal but logged (the room is genuinely
  joined regardless of whether subscribers are notified).

Emit points wired in this PR: RoomJoined (one canonical example).
The other six variants have stable body schemas defined and
documented; their emit points (PeerArrived/Departed on
peer_trust mutation, Wire* on subscriber lifecycle, etc.) are
queued for follow-up PRs per Phase 2's slice-by-slice cadence.

Integration tests
(`crates/airc-lib/tests/lifecycle_events.rs`):

- `join_emits_room_joined_lifecycle_event` — subscribe BEFORE
  join, then call join in a spawned task, assert the RoomJoined
  event surfaces on the stream with the expected body.
- `lifecycle_event_is_persisted_for_cursor_replay` — proves the
  event is durable in the store so cursor-replay surfaces it for
  consumers that reconnect.

Phase 2 acceptance gate: Continuum can subscribe to lifecycle
events through airc-lib without shelling out — this PR makes
that true for RoomJoined; the same emit pattern carries forward
to the remaining variants.

Verification:
- `cargo test --workspace` green (all suites)
- `cargo clippy --workspace --all-targets -- -D warnings` clean
- `cargo fmt --check` clean

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

* test(lib): account for lifecycle cursor events

* test(lib): filter message events after lifecycle joins

---------

Co-authored-by: Claude Opus 4.7 <[email protected]>
joelteply and others added 16 commits June 12, 2026 21:57
…ore-split visibility (card 4132f48c) (#1156)

* fix(daemon): route inbound LAN frames into the owner-core router - store-split visibility (card 4132f48c)

Inbound cross-machine frames were persisted by the daemon's LAN-receiving
handle into the machine store's SDK events table, while every operator
surface (inbox/msg/monitors) reads the daemon's EventRouter (hot ring +
bus_events durable tier). Delivered, acked, visible to nobody.

Fix mirrors local delivery: the daemon installs a RouterInboundBridge as
the InboundFrameSink of its transport-owning handles, so every inbound
frame is published into the router via the new idempotent
EventRouter::publish_if_new (recent-ids window + DurableSink::contains).
Delivered acks (card 39d37629) now mean visible-to-subscribed-scopes:
the bridge checks presence beacons in the coordinator store; no
subscribed scope means undeliverable{unknown_channel} + loud diagnostic,
frame kept durable for late joiners.

Co-Authored-By: Claude Fable 5 <[email protected]>

* fix(bus): failed publish_if_new must not poison the idempotency window (sentinel audit)

The id was marked optimistically before the durable probe/publish; a
transient sink error or write-behind saturation left it in the
recent-ids window, so a legitimate retry of the same frame reported
Duplicate (and the receiver acked delivered) for an event the router
never took. Unmark on every failure path; mutation-verified
(failed_publish_does_not_poison_the_window_for_a_retry fails with the
unmark removed).

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
… acks for ordinary room sends (card 1998f6cb) (#1158)

* feat(transport): routed-ack — daemon route-layer traversal for ordinary room sends (card 1998f6cb)

The outbound mirror of #1156's RouterInboundBridge: every durable
envelope the daemon's EventRouter accepts is offered to a bounded
forward sink; the new RoutedForwarder projects it back onto the wire
Frame shape, re-signs with the forwarding handle's key, and unicasts
it over EXISTING lan-tcp connections with #1155 delivery acks —
delivered/undeliverable/no-ack per attempt, same-event-id retries
(remote dedups via publish_if_new), loop prevention by verified
signer origin, loud bounded-queue drops, per-peer ordered queues.

Acks for inbound frames now return to the link origin (verified
signer) instead of envelope.sender, so routed forwards get their
receipts; point-to-point sends are unchanged (signer == sender).

closes the final keystone leg: ordinary room messages now traverse
LAN routes both directions.

Co-Authored-By: Claude Fable 5 <[email protected]>

* test: poll for ack confirmation instead of racing the ack return leg (CI flake on shared runners)

Remote visibility (bridge publish) precedes the ack's travel back to
the forwarder; asserting confirmed_count immediately after observing
visibility lost that race on ubuntu-latest + macos-latest.

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>
…-exit + home-derived sockets (card f122b5b5) (#1159)

fix(test-harness): RAII teardown + self-exit + home-derived sockets — stop temp-home daemon leaks (card f122b5b5)

cargo test --workspace leaked airc daemon processes with --home under
the OS temp dir — ~40/131/405+86/154 per run this session, 800+ killed
by hand. Each held RAM + an event loop on the coordination Mac. Fixed
in depth.

Spawn-site inventory (CLI integration tests):
- IMPLICIT (the bulk): every `airc <verb>` run against a tempdir home
  spawn-or-connects a DETACHED daemon via ensure_daemon_running
  (setsid / DETACHED_PROCESS), which outlives the test by design. No
  guard tracked these — the main leak.
- EXPLICIT subprocess: daemon_route_refresh.rs, registry_hermetic.rs
  (each already had a kill-on-Drop DaemonGuard).
- IN-PROCESS: airc-lib tests/common DaemonFixture (already aborts its
  JoinHandle on Drop).

Layer 1 — RAII teardown: tests now hold a DaemonTempDir (tests/common)
instead of a raw TempDir; the helper ONLY returns the guarded form, so
teardown cannot be forgotten. Its Drop walks the tree for the
daemon.pid each daemon now writes and reaps them
(SIGTERM -> poll-gone -> SIGKILL). Every CLI test file migrated.

Layer 2 — belt-and-braces self-exit: a daemon whose home is temp-rooted
(reuses #1150 detection, hoisted to airc-core::temp_home so airc-daemon
can use it without depending on airc-lib) exits BY ITSELF after an idle
window with no connected client (loud one-line log). Catches SIGKILLed
runners whose Drop guards never ran. Production homes never arm it.
Window overridable via AIRC_TEMP_HOME_IDLE_EXIT_MS (tests use ~800ms).

Layer 3 — socket-path bug: an explicit temp home no longer places its
socket under the user ~/.airc/runtime. The isolated-scope branch of
resolve_socket_path derived the socket NAME from the project-root hash
but placed the FILE in runtime_dir (= ~/.airc/runtime) — how the stale
airc-10e8167b5d5b936d-v5.sock landed in production. Now the socket
derives from the daemon own home. Pinned by a unit test + the
end-to-end witness; mutation reverts -> fail.

Layer 4 — CI zero-leak guard: a ps-based step after cargo test
(rust.yml, ubuntu+macos) FAILS the leg if any airc daemon with a
temp-rooted --home survives. Plus tests/daemon_teardown.rs pins all
four layers with mutation-keyed assertions.

card f122b5b5

Co-authored-by: Claude Fable 5 <[email protected]>
…rom #1159 (card f122b5b5) (#1160)

fix(cli): isolated-scope socket keys off project root so sibling tabs share one daemon (card f122b5b5)

The macOS CI zero-leak guard caught a residual leak my own change
introduced: I keyed the isolated-scope (temp/CI home) socket off the
FULL scope home, but the integration suite runs sibling tabs
(<tmp>/claude, <tmp>/codex) under a shared HOME=<tmp> that must
converge on ONE daemon — the "one daemon per account" model
daemon_lifecycle asserts and `airc stop` relies on. Per-scope-home
keying gave each tab its own daemon, so a single `airc stop` left the
siblings running (survivor on the macOS leg:
--home <tmp>/.tmpXXX/codex daemon ... --socket <tmp>/.tmpXXX/codex/daemon-v5.sock).

Fix: key the isolated socket off the PROJECT ROOT (home.parent()) —
the shared account root — so sibling scopes compute the same path and
share one daemon, while still placing the file UNDER the home tree
(<project-root>/daemon-v<N>.sock) so nothing lands in the production
~/.airc/runtime (the original bug). SUN_LEN fallback hashes the project
root, not the scope home, so siblings still collide on the short path.

Tests: updated the isolated/temp-home socket unit tests to the
project-root derivation, added a regression pin
(sibling_isolated_scopes_under_one_account_share_a_socket — mutation:
key off `home` not `home.parent()` => diverge => fail). Verified
daemon_lifecycle + codex_hook_commands + daemon_teardown leave ZERO
temp-home daemons locally.

card f122b5b5

Co-authored-by: Claude Fable 5 <[email protected]>
…leak from #1159/#1160 (card f122b5b5) (#1161)

fix(test-harness): ps-scan + multi-sweep daemon reaper — close the macOS leak the CI guard caught (card f122b5b5)

#1159's zero-leak guard did its job: it caught a temp-home daemon
surviving the suite on macOS-latest (a daemon with
--home <tmp>/.tmpXXX/codex). #1160 fixed the sibling-share half but one
daemon still leaked, so rust-rewrite's macOS test leg stayed red. This
closes it.

Two root causes, both in the test reaper (tests/common):

1. pidfile location. A daemon's `daemon.pid` lands in
   `machine_account_home(home)`, which — depending on whether the
   spawning process had HOME pointed at the tempdir — can be
   `<root>/.airc`, `<scope>/.airc`, or the isolated scope itself. The
   pidfile tree-walk missed the macOS isolated-scope case (HOME not
   temp-rooted on the runner → the temp carve-out fires → pidfile lands
   outside the walked subtree). Fix: union the pidfile walk with a
   `ps`-scan for any `airc … daemon` whose `--home`/`--socket` argument
   lives under `root`. Unix-only; Windows keeps the pidfile walk + the
   daemon's own temp-home self-exit.

2. detached-spawn race. A daemon spawned by a DETACHED grandchild
   (`ensure_daemon_running` → `setsid`) can appear a beat AFTER the test
   body returns; on a loaded CI runner it may not exist yet at the first
   reap sweep. Fix: `reap_daemons_under` now does a few bounded sweeps
   with a short settle, stopping early once a sweep is clean, so a
   late-arriving daemon is still reaped.

Test: `reaper_ps_scan_kills_daemon_with_no_discoverable_pidfile` pins
the ps-scan layer — spawns a daemon, removes its pidfile so tree-walk
discovery returns None, and asserts the reaper still kills it via the
`--home` ps-scan. Mutation: drop `pids_from_process_scan` → the daemon
survives → fail.

Verified: full `airc-cli` integration suite under CI-like env (HOME
non-temp, TMPDIR temp — the condition that triggers the carve-out)
leaves ZERO temp-home daemons; all 5 daemon_teardown tests pass; fmt +
production clippy gate clean.

card f122b5b5

Co-authored-by: Claude Fable 5 <[email protected]>
…BIN end-to-end, stale-token re-resolve (card 1f2cbffa) (#1162)

fix(gh-auth): harden the gate — stub-gh tests, named timeout, AIRC_GH_BIN end-to-end, stale-token re-resolve (card 1f2cbffa)

The four post-merge-audit residuals from #1145 (audit comment
4686386364), all in the gh-auth gate area:

1. Upstream the audit's stub-gh tests (cfg(unix), precedent #1150):
   slow-but-authed ~1s gh passes the gate (the measured 881-950ms
   Windows class); unauthed gh fails fast without burning the budget;
   hung gh is killed at the deadline. Mutation-verified: shrinking the
   budget back to 750ms fails the slow-authed test in 0.76s — exactly
   the #1145 bug reproduced.

2. Name the timeout: GH_AUTH_READY_TIMEOUT = 5s, doc comment carries
   the measured-on-bigmama rationale that previously lived inline.

3. Honor AIRC_GH_BIN end-to-end: resolve_gh_bin returns the operator
   override unconditionally (loud stderr if the path is missing, NO
   silent fallback to PATH), resolve_gh_token consults only the
   override when set, and the manual `registry sync` gate now probes
   the overridden binary instead of bare `gh`. run_daemon's
   .with_bin() therefore carries the override instead of clobbering
   the store's env-honoring default. Pinned via env-free _with()
   bodies (no racy process-env mutation in tests).

4. Stale-token re-resolve for the daemon's gh transport, mirroring
   ReqwestGhClient's #1147 401-refresh: GH_TOKEN is injected at spawn
   and tokens rotate mid-session, so on a failed auth probe the gate
   makes ONE recovery attempt per tick — `gh auth token` with the
   stale GH_TOKEN/GITHUB_TOKEN stripped from the child env (gh would
   otherwise echo the stale env token back instead of reading its
   keyring copy). A recovered token lands in a shared GhTokenOverride
   slot used by both the gate's probe and the store's gh spawns. If
   the daemon lacks keychain access (the reason injection exists) the
   attempt fails and the existing loud GhNotReady skip fires — no new
   failure modes. The env re-read leg of #1147's chain is deliberately
   absent: gh children already inherit the daemon's env token, so
   re-reading our own immutable env can never change the outcome.

Co-authored-by: Claude Fable 5 <[email protected]>
… cursor reads (card 8428ae8c) (#1163)

perf(daemon): reverse-paged Inbox{since:None} + daemon-routed cursor reads (card 8428ae8c)

Item 1: "most recent N" inbox no longer materializes the whole room.
New required DurableSink::page_tail (no scan default -- a sink that
cannot reverse-page is a compile error), SQLite ORDER BY DESC LIMIT N
on the existing composite index reversed in memory, and
EventRouter::durable_tail merging ring durables with one bounded
reverse page. handle_inbox since:None answers from it; no IPC change.
Measured on a 5,000-event room: 105,820 us/op -> 6,204 us/op (~17x)
for limit:50; full-tail floor unchanged.

Item 2: Airc::latest_cursor / subscription_cursor read the daemon
(room_tip, #1144) when attached instead of the possibly-empty local
store; shared channel_latest_cursor helper, work-board probe deduped
onto it. Local instances unchanged. No new IPC op needed: a
subscription cursor IS its room's tip.

Residual of #1144 (card a1562dbc). Mutation-verified: scan-shape
revert, handler-only revert, local-read revert, missing reverse --
each fails its pin.

Co-authored-by: Claude Fable 5 <[email protected]>
…e) (#1166)

The merge queue refuses to ingest a PR whose required checks never ran —
the enqueue API returns "N of N required status checks are expected".
`cargo clippy (deny warnings)` and `cargo test (ubuntu-latest)` are
required, but rust.yml's `pull_request` trigger was `paths`-filtered to
Rust files, so they never triggered on docs/scripts/skills PRs. Net
effect: EVERY non-Rust PR was unmergeable through the queue — not even
`--admin` (the ruleset enforces "changes must go through the queue").
Caught live 2026-06-13: install-fix PRs #1164/#1165 stuck with no path in.

The old rust.yml comment assumed the `merge_group` trigger alone covered
this; it doesn't — merge_group only re-validates INSIDE the queue, you
can't ENTER without the contexts on the PR head.

Fix: drop the `paths` filter on `pull_request` so the workflow always
triggers, and add a `changes` job that detects Rust-relevant edits.
fmt/clippy/quality/test gain `needs: changes` + an `if` that runs the
real legs on merge_group/push always, and on a PR only when Rust changed.
Non-Rust PRs SKIP the heavy jobs — a skipped required check counts as
satisfied, so the queue can ingest the PR, and merge_group still runs the
real matrix on the queued candidate (preserving the merge-race guard).
Keeps the contended self-hosted Windows leg free on docs PRs.

`changes` uses `gh api .../files` + grep (no third-party action, no extra
supply-chain surface). This PR touches rust.yml, so it self-validates:
the real clippy+test legs run on it and it merges through the queue.

Co-authored-by: Claude Opus 4.8 <[email protected]>
… enqueue (#1168)

fix(ci): dedicated cargo test (ubuntu-latest) job so non-Rust PRs enqueue

Follow-up to #1166. Empirically, a SKIPPED matrix job reports a single
check named with the UNEXPANDED template `cargo test (${{ matrix.display
}})` — so the required context `cargo test (ubuntu-latest)` never
appeared on a skipped non-Rust PR, and the merge queue still refused to
ingest it ("Required status check cargo test (ubuntu-latest) is
expected" — observed on #1164 after #1166 landed). clippy was fine
(non-matrix → keeps its literal name when skipped).

Pull the ubuntu leg into a dedicated NON-matrix `test-ubuntu` job named
exactly `cargo test (ubuntu-latest)`. A non-matrix job keeps its literal
name when skipped, so the required context is always satisfied: skipped
(=passing) on non-Rust PRs, real result on Rust PRs / merge_group. The
matrix job keeps macOS + self-hosted Windows (non-required), so its
template-named skip is harmless; merge_group still runs the full matrix
on the queued candidate (cross-platform merge-race guard preserved).

Co-authored-by: Claude Opus 4.8 <[email protected]>
… git identity (#1164)

* fix(setup): fresh Windows/new-user install leaves airc on PATH + wires gh

Three new-user setup bugs caught live driving install.sh on a clean
Windows Git Bash box (no prior shell rc files, gh unauthed at install):

1. install.sh _add_path_entry wrote the PATH line to NOTHING when no
   ~/.zshrc or ~/.bashrc existed. The `[ -f "$rc" ] || continue` loop
   skipped every candidate on a fresh Git Bash box (which ships no rc
   files), so `airc` landed on PATH in NO shell — current or future.
   Now: create the rc matching $SHELL (zsh -> ~/.zshrc, else ~/.bashrc)
   when none exists, plus a ~/.bash_profile shim so login bash actually
   sources ~/.bashrc. Also hardened the stale-line strip with `|| true`
   — when the rc holds only airc-managed lines, grep -v emits nothing
   and exits 1, which under `&&` skipped the mv and duplicated the
   entry on rerun. Verified idempotent (3 reruns -> 1 line), zsh path,
   and that user rc content is preserved.

2. bootstrap-airc.sh pre-flight called `airc doctor --connect`, a flag
   the rust-rewrite binary doesn't implement — hard-failing every fresh
   bootstrap at the gate. Switched to `airc doctor --health` (the live
   route/process check that exists).

3. gh auth done AFTER install left git's credential helper unwired
   (install.sh only runs `gh auth setup-git` when gh is authed at
   install time), causing GUI password popups on gist ops. bootstrap
   now pins `-h github.com` to match install.sh and runs setup-git
   (idempotent) after login.

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

* fix(setup): derive git author identity from gh when unset

Fresh-box finding #4: a clean machine has no global git user.name /
user.email, so the first agent commit dies with "Author identity
unknown". Since airc is multi-tenant — every operator coordinates their
OWN grid from their OWN gh account — identity must be derived from
whoever runs the installer, never hardcoded. install.sh now, when gh is
authenticated and git identity is unset, sets user.name/user.email from
`gh api user` (public email, else the <id>+<login> noreply alias).
Never clobbers an identity the user already configured.

Verified with a stubbed gh: derives for a fresh account, preserves an
existing identity.

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

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
…dentity (#1165)

* fix(setup): PowerShell install parity — doctor flag, gh wiring, git identity

Mirrors the bash-side fresh-user fixes (PR #1164) onto the native-Windows
PowerShell install path, validated on a clean box:

- bootstrap-airc.ps1 preflight called `airc doctor --connect` (removed in
  rust-rewrite) → `airc doctor --health`.
- bootstrap-airc.ps1 gh auth pinned `-h github.com` (matches install.sh)
  and now runs `gh auth setup-git` after login so gist ops don't pop a
  credential prompt.
- Git author identity derived from `gh api user` when unset, in BOTH
  bootstrap-airc.ps1 (post-auth, the fresh path) and install.ps1 (guarded
  on gh already authed). Never clobbers an existing identity; public
  email else the <id>+<login> noreply alias. No hardcoded identity.

PATH is NOT affected on PowerShell: install.ps1 writes the registry User
PATH (picked up by new shells), so the bash rc-file trap doesn't apply.

Verified: both scripts AST-parse clean; stubbed-gh test derives identity
for a fresh account and preserves an existing one.

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

* fix(setup): scalar-join gh credential-helper check before -notmatch (PS)

Sentinel review nit on #1165: `git config --get-all ...helper` can return
multiple values (array), and PowerShell `-notmatch` on an array filters
rather than returning a strict boolean — so the credential-helper-wired
check could mis-evaluate in the rare multi-helper case (harmless: a
redundant idempotent `gh auth setup-git`). Join to a scalar first in both
bootstrap-airc.ps1 and install.ps1.

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

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
…urface (#1167)

fix(skills/docs): reconcile skills + README to the rust-rewrite surface

The installed Claude/Codex skills and README were written for the old
`main` airc CLI; ~12 referenced commands don't exist in rust-rewrite, so
agents invoking /teardown, /list, /quit, /nick, /away, etc. hit "unknown
subcommand". Every command was re-verified against `airc <cmd> --help`.

Mechanical remaps (real equivalent exists):
- away/back  -> airc identity set --status "<msg>" / --status ""
- teardown   -> airc stop (note: no flush/state-wipe verb in rust-rewrite)
- repair     -> airc stop && airc join
- doctor     -> drop --connect/--tests/--join; keep --health/--fix
- msg --room -> airc room <name> + airc msg, or airc publish --room
- quit       -> airc part (leave room, keep identity); airc stop = daemon
- join/update/resume -> fixed embedded dead flags (msg --channel ->
  publish --room; teardown --flush -> stop && join; status --probe ->
  status)

Genuinely gone (no equivalent) — skill kept with a "⚠️ not in
rust-rewrite (TODO)" note + nearest real alternative, for review:
- nick (identity set has no --name), list, canary (no update --channel),
  kick (~peer remove), invite (~airc init spec), send-file
  (~publish --body-json), reminder (none), uninstall (manual)

README: dropped dead IRC-table rows + Core Commands; codex-poll ->
codex-hook poll; added an explicit "not in rust-rewrite" note.

No hardcoded identity/paths. Frontmatter preserved on every skill.
Gone-verb remove-vs-port calls flagged for maintainer review.

Co-authored-by: Claude Opus 4.8 <[email protected]>
…#1169)

Completes the fresh-box identity fix. install.sh derives git
user.name/user.email from gh, but on the bootstrap "one command" path
install.sh runs BEFORE gh auth (non-TTY curl|bash), so its identity
block is skipped — then bootstrap auths but never set the identity, and
the first agent commit dies with "Author identity unknown". Add the same
gh-derived, never-clobber identity block right after bootstrap's gh auth
+ setup-git step. Mirrors install.sh and bootstrap-airc.ps1. No
hardcoded values.

Co-authored-by: Claude Opus 4.8 <[email protected]>
…outs (#1170)

* fix(setup): derive git identity in bootstrap-airc.sh (post-auth path)

Completes the fresh-box identity fix. install.sh derives git
user.name/user.email from gh, but on the bootstrap "one command" path
install.sh runs BEFORE gh auth (non-TTY curl|bash), so its identity
block is skipped — then bootstrap auths but never set the identity, and
the first agent commit dies with "Author identity unknown". Add the same
gh-derived, never-clobber identity block right after bootstrap's gh auth
+ setup-git step. Mirrors install.sh and bootstrap-airc.ps1. No
hardcoded values.

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

* fix(update): record install source so airc update works for dev checkouts

`airc update` resolved the source as $AIRC_DIR or hardcoded ~/.airc/src,
but install.sh's _default_clone_dir installs FROM a dev checkout (the
cwd) when run inside one — and rust-rewrite currently ships ONLY as a
dev checkout (no release channel yet). So on every dev-checkout install,
`airc update` died with "No git checkout at ~/.airc/src" (caught live
2026-06-13). Since all current operators are on rust-rewrite dev
checkouts, this blocked the whole team from pulling fixes via update.

Fix: install.sh + install.ps1 record the dir they installed from in
~/.airc/install-source; install_source_dir() honors it (AIRC_DIR env >
marker > ~/.airc/src default). The marker MUST be a native path — the
binary's std::fs / git -C can't resolve an MSYS /c/... path on Windows,
so install.sh converts via _to_win_path on MINGW/MSYS/CYGWIN only
(Unix paths are written as-is); install.ps1's $CLONE_DIR is already
native.

Tests: marker honored when no env; AIRC_DIR still wins; blank marker
falls back to default. cargo fmt + clippy (incl. production no-unwrap
gate) + update_commands tests pass locally.

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

---------

Co-authored-by: Claude Opus 4.8 <[email protected]>
…1171)

`airc update` runs install.sh via `Command::new("bash")`. On Windows
that resolves to C:\Windows\System32\bash.exe — the WSL launcher — which
fails with "Windows Subsystem for Linux has no installed distributions"
when no distro is present. So after the source-marker fix (#1170) let
update get past source resolution, it then died at the reinstall step
on Windows (caught live 2026-06-13). Macs/Linux are unaffected (real
bash).

Fix: derive the Git-for-Windows bash from `git --exec-path` (git is an
airc prereq) by walking up to a bundled bin/bash.exe / usr/bin/bash.exe;
fall back to plain `bash` when none is found (the Unix path — unchanged).
Pure path logic in bash_in_git_root, tested cross-platform (found /
not-found). clippy production gate + update_commands tests green.

Co-authored-by: Claude Opus 4.8 <[email protected]>
)

The stale-binary banner told users to run
`cargo install --path crates/airc-cli --force` — which installs to
~/.cargo/bin/airc, a SECOND binary that shadows the install.sh-managed
~/.local/bin/airc. This file's own doc records that exact split breaking
`airc join` (a stale ~/.local/bin airc shadowed the fresh ~/.cargo/bin
one). Now that `airc update` works for dev-checkout installs (#1170 +
#1171), point the banner at it: it rebuilds and reinstalls IN PLACE
(same location + marker + skills), so it can't create a dual-binary
split. clippy gate + staleness tests green.

Co-authored-by: Claude Opus 4.8 <[email protected]>
@joelteply
joelteply merged commit c088198 into canary Jun 13, 2026
22 of 28 checks passed
@joelteply
joelteply deleted the rust-rewrite branch June 13, 2026 19:59
joelteply added a commit that referenced this pull request Jun 14, 2026
…rs (Mac-found) (#1185)

fix(git-hooks): airc-fetch-base — canary-first base + braced color vars (Mac-found, PR #1183)

Two bugs the Intel-Mac Claude hit filing PR #1183, both in the
fetch-before-commit/push staleness hook:

1. Stale-base selection: the candidate loop tried `rust-rewrite` FIRST and
   accepted it via `show-ref` on a STALE local `origin/rust-rewrite`
   tracking ref — whose remote branch was DELETED post-#1173 promotion. So
   fresh branches measured staleness against a dead base. Fix: try
   canary/main (current trunk) first via local-or-remote; fall back to
   rust-rewrite ONLY if confirmed on the REMOTE (ls-remote), never on a
   stale local ref alone.

2. `set -u` crash on macOS: unbraced `$YEL`/`$RST` immediately followed by
   a multibyte box-drawing char (┌│└) is parsed as the variable name
   `YEL┌…` → "YEL?: unbound variable" under bash 3.2 + a multibyte locale
   (the macOS default shell). Brace every color var (`${YEL}`/`${RST}`).

bash -n clean; braced form verified under `set -u`. Surfaced via the
two-Claude solidification work (tracker #7 in docs PR #1184).

Co-authored-by: Claude Opus 4.8 <[email protected]>
joelteply added a commit that referenced this pull request Jun 14, 2026
fix(merger): baseline-failures base is canary, not deleted rust-rewrite

`fetch_baseline_failures` hardcoded `rust-rewrite` as the integration
branch, but the rust-rewrite→canary promotion (#1173) DELETED
origin/rust-rewrite. Every merger tick 422'd ("No commit found for SHA:
rust-rewrite") and silently degraded the baseline-allowance gate to
all-green-required. Same stale-base class as the airc-fetch-base hook bug
(#1185). Surfaced live by running `airc work merger run` against the
shared board today. Point it at canary + fix the now-stale comment/log.

Co-authored-by: Claude Opus 4.8 <[email protected]>
joelteply added a commit that referenced this pull request Jun 17, 2026
…ite job (#1228)

fix(ci): green canary — update stale send-receipt test + remove dead integration-suite job

Two real failures that have been red on every canary push since the
Rust cutover, surfaced while triaging #1224's CI:

1. `events_commands::send_receipt_distinguishes_zero_paired_peers…`
   asserted the OLD receipt contract ("sent to" / "0 paired remote
   peers"). The receipt wording was deliberately changed to the honest
   form ("queued to … 0 enrolled remote peer(s); any scope tailing this
   channel on this machine will receive it") because "sent to N peers"
   falsely implied confirmed delivery. The unit tests in commands.rs
   were updated; this integration test was missed. Realign it with the
   canonical `format_send_receipt` invariants (verb is "queued to", not
   "sent to"; count is "enrolled", not "paired"; local-tailer fan-out is
   surfaced) and rename it to the "enrolled" vocabulary.

2. The `integration-suite` CI job runs `bash test/integration.sh`, but
   that 5269-line bash suite was DELETED in the Rust cutover (#1173,
   demolition #864). The job has failed with exit 127 (no such file) on
   every canary/main push since. Integration coverage now lives in the
   per-crate `crates/*/tests/` suites under the `cargo test` jobs (which
   is exactly where the test in #1 runs), so the job provided zero
   unique coverage. Remove it and fix the stale header comment.

Validated: cargo fmt --check, clippy --tests -D warnings, and the full
events_commands suite (3/3) pass locally.

Co-authored-by: Claude Opus 4.8 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant