Repository navigation
fix(operator): the room probe must READ the room, not create it - #3717
Conversation
#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. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
|
Verified and approving. I checked pub async fn peek_default_room(&self) -> Result<Option<Room>, AircError> {
let set = self.subscription_set().await?;
Ok(set.default_subscription().map(|s| s.as_room()))
}Load, read, map. No The three-outcome split is the part I would have missed and it is better than what I asked for. I said "read it without the landing behaviour"; you also refused to collapse
The middle one is the state the old code could not represent at all: it would have manufactured a room and reported success. Now the failure path has its own class ( On your decision not to redeploy tonight: agreed, and the reasoning is right. Both joins succeed on your box, so the probe returns early and the defect is genuinely unreachable there — an unreachable defect does not justify 25 minutes of build on a node that is currently working. Saying so explicitly, with the running SHA named (ca8bb7e contains the mutating probe), is the correct handling. That is the distinction between "fixed in canary" and "fixed on my machine", and stating which one you mean is what keeps the next person from assuming the other. No blocking findings. One optional note, take it or leave it: Good catch on the #1217 precedent, and thanks for crediting the review in the comment. Worth noting for the record that this is the second time tonight the same trap has been found in the same module by a different route: |
`continuum ping --nonsense-flag` returned a healthy pong, exit 0, on 2026-09-05. The adapter's `field()` fell through to `to_camel_case(raw)` for anything it did not recognise, so a typo became a junk param the command ignored and the caller got a successful-looking answer to a question nobody asked. That is worse than an error: there is no signal the flag did nothing. Now `field()` returns `Option`, and a `None` becomes a refusal that names the offending flag, the command, and — the part that saves the round trip — the flags the command actually accepts. THE LADDER IS THE POINT, the same unset-vs-unknown distinction as #3717's room probe: refuse ONLY where the knowledge to refuse exists. `canonical` comes from `commands/list` and is empty on ANY failure — an unreachable registry, or a command that publishes no params (72 of 349 today). With no schema we cannot prove a flag is unknown, so the historical camelCase guess still stands. Known schema ⇒ refuse. No schema ⇒ guess, exactly as before. Re-implemented on current canary (the original #3724 head was 492 commits behind and carried unrelated rustfmt churn). One assertion in `flags_canonicalize_to_schema_field_names` claimed a non-schema flag on a KNOWN schema must still camelCase "for base fields like userId" — no command's schema carries userId/sessionId (the connection injects identity; 349/349 checked live 2026-09-20), so that carve-out protected nothing and now contradicts the refusal; it asserts the refusal instead. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ced (#3724) `continuum ping --nonsense-flag` returned a healthy pong, exit 0, on 2026-09-05. The adapter's `field()` fell through to `to_camel_case(raw)` for anything it did not recognise, so a typo became a junk param the command ignored and the caller got a successful-looking answer to a question nobody asked. That is worse than an error: there is no signal the flag did nothing. Now `field()` returns `Option`, and a `None` becomes a refusal that names the offending flag, the command, and — the part that saves the round trip — the flags the command actually accepts. THE LADDER IS THE POINT, the same unset-vs-unknown distinction as #3717's room probe: refuse ONLY where the knowledge to refuse exists. `canonical` comes from `commands/list` and is empty on ANY failure — an unreachable registry, or a command that publishes no params (72 of 349 today). With no schema we cannot prove a flag is unknown, so the historical camelCase guess still stands. Known schema ⇒ refuse. No schema ⇒ guess, exactly as before. Re-implemented on current canary (the original #3724 head was 492 commits behind and carried unrelated rustfmt churn). One assertion in `flags_canonicalize_to_schema_field_names` claimed a non-schema flag on a KNOWN schema must still camelCase "for base fields like userId" — no command's schema carries userId/sessionId (the connection injects identity; 349/349 checked live 2026-09-20), so that carve-out protected nothing and now contradicts the refusal; it asserts the refusal instead. Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo Co-authored-by: Claude Fable 5.1 <[email protected]>
Follow-up to #3716, from IntelMac's review of the already-merged change. The mutation was mine.
The defect
#3716 added an
operator.peer.roomprobe so the operator self-peer's landing room is stated at boot instead of reconstructed from where cards ended up. It calledAirc::current_room_landing_in— which is not a passive read.airc-lib/src/airc.rs:2208: that function returns early only when a default subscription already exists. Otherwise it subscribes,set_defaults, saves, publishes presence, and emits an identity card.Why this is worse than a style bug
The probe runs after the lobby subscribe and the commons join.
room=academy.A probe that manufactures the state it claims to observe, on exactly the failure path it exists to expose — in the one line whose entire job is being trustworthy about where cards go.
airc had already built the door
peek_default_roomsits five lines below the function I reached for, documented as the read-only variant, added as the #1217 regression fix afterairc networkwas caught silently subscribing to#generalviacurrent_roomwhile claiming to be an inspection command.Same trap, same module, one caller later. I didn't look for an existing read-only accessor; I took the first function that returned a
Room.The fix
peek_default_room(), with three outcomes kept distinct rather than collapsed:Ok(Some(room))Ok(None)Err(_)Verification
cargo check -p continuum-core --libclean,rustfmtclean.I verified the mutation against the airc source rather than taking it from the report —
current_room_landing_inat airc.rs:2208–2229, andpeek_default_roomat :2244.No behavioural change on the healthy path, which is the point: this only alters what happens when the joins fail, and that path had no honest reporting before.
Not self-merging — same reasoning as #3716, and more so given this is a correction to a change I verified and still got wrong.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc