Skip to content

fix(cli): foreground spawn provisions the durable backstop by default#245

Open
davidfarah2003 wants to merge 2 commits into
mainfrom
fix/foreground-durable-spawn
Open

fix(cli): foreground spawn provisions the durable backstop by default#245
davidfarah2003 wants to merge 2 commits into
mainfrom
fix/foreground-durable-spawn

Conversation

@davidfarah2003

Copy link
Copy Markdown
Contributor

Problem

Foreground cotal spawn hardcoded durableMembership: false, so every foreground agent silently ran live-only on durable-class channels: no read-ACL row → the delivery daemon refused its durable joins → no per-member DLV queue. Because a reconnect deliberately re-opens the core-subs without re-backfill, any channel message posted while the agent's connection blipped was permanently lost to auto-injection — the default config walks users straight into this.

Reproduced live (released 0.11.6, isolated mesh): a foreground agent's connection was severed while 3 messages were posted; after reconnect they were absent from its context and its inbox, unrecoverable by any push. The same sever against a durable-provisioned twin delivered all 3 on its next turn via DLV redelivery.

Why the old guard was stale

Its comment claimed a durable boot membership "could be neither authorized for reader delivery nor leaved via self-service" without a managing host. Neither holds in the v3 Plane-3 design: the daemon authorizes durableJoin off the ACL row (commitAcl), and leave is agent self-service — no manager involvement anywhere.

Change

  • Foreground cotal spawn (static and user-auth mode) provisions the same durable footprint as --detach, ACL row included. Join now reports "durable backstop active".
  • New --live-only flag restores the old behavior explicitly (no ACL row).
  • Foreground exit retires the agent's creds + broker footprint (DM/DLV durables + ACL row), mirroring the manager's despawn — previously every foreground exit leaked them. Crash residue remains the same class a crashed manager leaves; complete lifecycle-scoped retirement stays with the control-surface work.
  • Stale rationale comments rewritten; docs/cli.md corrected; docs bundle regenerated; flag-inventory snapshot updated.

Verification

  • Live A/B on an isolated mesh: pre-fix sever → 3/3 lost; post-fix identical sever → durable backstop active at join, 3/3 delivered next turn, ↩ retired creds on exit with the creds file gone.
  • pnpm typecheck green; pnpm smoke:ci green (incl. plane3-activation-auth, which still covers the explicit opt-out path).

A foreground `cotal spawn` hardcoded durableMembership:false, so every
foreground agent silently ran live-only on durable-class channels: no
read-ACL row, so the delivery daemon refused its durable joins, and any
channel message posted while its connection blipped was permanently lost
to auto-injection (reconnect deliberately re-opens the core-subs without
re-backfill, and there is no per-member queue to catch up from).
Reproduced live: a severed live-only agent lost 3/3 messages posted in
the gap; the same sever against a durable-provisioned agent delivered
3/3 on its next turn via DLV redelivery.

The old guard's rationale was stale: the daemon authorizes durableJoin
off the ACL row and leave is agent self-service, so no managing host is
required. Foreground now provisions the same footprint as --detach; a
new --live-only flag restores the old behavior explicitly.

A foreground exit also retires the agent's creds and broker footprint
(DM/DLV durables + ACL row) — each spawn mints a fresh identity, so an
exited agent's footprint was dead weight; previously every foreground
exit leaked it. Mirrors the manager's despawn deprovision, including in
user mode. Crash residue remains the same class a crashed manager
leaves; the lifecycle-scoped retirement in the control-surface work
remains the complete answer.
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