Skip to content

RAL-199 part 2: Rally sends through Marshal's daemon as its own service session - #289

Merged
Castor-o7 merged 1 commit into
mainfrom
ral-199-part2
Nov 17, 2026
Merged

Castor-o7 merged 1 commit into
mainfrom
ral-199-part2

Conversation

@Castor-o7

Copy link
Copy Markdown
Owner

RAL-199 part 2 of 3: direct messages through Marshal's daemon, and a digest routed to the watchman's Marshal session.

Why: upstream marshal-shim 0.60.2 has no tell, so rally digest and rally wake couldn't send anything after Muster retired.

Sending (marshal::send), as the watchman agreed:

  • Rally registers its own Session: kind service, project rally, cwd its state dir, and a stable id per machine and command (rally-digest@<machine>, rally-wake@<machine>).
  • It waits until the daemon binds that session to the connection, then sends with SendMessage. It never uses asSession, so it never sends as an agent.
  • When the send is done, it deletes its session.
  • The digest body opens with <rally_digest>, so it says it's from Rally's digest.

Who a message can go to:

  • A recipient is an exact session id, or the one team session with that nickname. A nickname two sessions hold is refused, and service rows are never recipients.
  • "Not on the roster" and "unreachable" let the next source be tried. A refusal, or a lost answer after sending, stops there, so no second copy can go out.

Service rows aren't teams: they're left out of the roster Rally shows and counted as service_sessions. So the viewer, stalls, wake, brief and rally membership never take one for a team.

Finding the watchman (marshal::route):

  • It goes only through the open rally's session records. If the designated name is live, that's the target. Otherwise it follows the latest rally-session --succeeds successor, step by step, and refuses a loop.
  • The digest row's routed names the chain and its record numbers, and a report-only run shows it too, beside its own decision.
  • It's routing only: the designation is unchanged.
  • With no chain to a live session, the digest says the watchman can't be found on Marshal and sends nothing. It never guesses by cwd or project.

Tests:

  • fmt and clippy -D warnings are clean, the full cargo test passes (581 lib tests plus every integration suite), and cargo deny check is ok.
  • New unit tests cover routing (direct, one step, a removal, no record, a successor that isn't live, a loop) and recipient rules (an id, a nickname match ignoring case, an ambiguous nickname, service rows refused, service rows left out of the roster).
  • The e2e is cargo test --test marshal -- --ignored --nocapture against a throwaway ephemeral daemon and a real marshal-shim. A send to an absent team gives NotHere. A send to the shim's nickname is Delivered, the daemon holds the message from rally-digest@test with the body intact, and afterwards the roster has only the shim's row and service_sessions: 0.
  • Live, read-only: rally digest --report-only on a rewound copy of the state file shows routed: mellow-weevil → mega-jackdaw, records [5454]. Nothing was sent.

Part 3 (wake and stalls end to end, and nothing left on shim roster/tell by default) follows.

🤖 Generated with Claude Code

…ce session

Upstream marshal-shim 0.60.2 has no `tell`, so `rally digest` and `rally
wake` couldn't send. Rally now sends itself (marshal::send):

- It registers its own Session (kind "service", project "rally", cwd its
  state dir, a stable id per machine and command, rally-digest@<machine>
  or rally-wake@<machine>), waits until the daemon binds it to the
  connection, sends with SendMessage (never asSession), and deletes the
  session. The digest body opens with <rally_digest>, so it says it's
  from Rally's digest.
- A recipient is an exact session id or one team's nickname. A name
  held by two sessions is refused, and service rows are never
  recipients. "Not on the roster" and "unreachable" let the next source
  be tried; a refusal or a lost answer after sending stops there.
- Service rows are left out of the roster Rally shows (and counted as
  service_sessions), so the viewer, stalls, wake, brief and rally
  membership never take one for a team.
- The digest finds its watchman on Marshal only through the open
  rally's session records (marshal::route): the designated name if it's
  live, otherwise the latest `rally-session --succeeds` successor, and
  so on, with loops refused. The row's `routed` names the chain and the
  record numbers, and a report-only run shows it too. This is routing
  only. With no chain it says the watchman can't be found on Marshal and
  sends nothing, and it never guesses by cwd or project.
- An #[ignore]d e2e against a throwaway daemon and a real shim sends to
  the shim's nickname, checks the daemon stores the message from
  rally-digest@test, and checks no service row is left behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Castor-o7
Castor-o7 merged commit 57b7088 into main Nov 17, 2026
5 checks passed
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