Skip to content
C.W.K.
Stream
Lesson 03 of 05 · published

Reconnect as Spectator

~12 min · reconnect, spectator, incarnation, lease, hangup

Level 0Spark
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

Coming Back Is Not Still Holding

After a network loss, a lock, or a suspension, you reopen as a spectator. You do not reopen as the controller you were. The world may have moved: the Mac may have taken the lease back, another phone may have taken it, the operator at the glass may have typed, the child may have exited. A reconnect that replays a control claim is a claim in the dark. Dark claims are how you type into a conversation that is no longer yours, or into a process that is no longer there.

The attachment you lost was one identity. The attachment you make now is another. Track 2 already said a pocket hangup closes the attachment, not the session. This lesson names the posture of the new attachment: spectator, always, until Take Control is pressed again on purpose. Local flags that said isController die with the old attachment. They are not cargo.

Match the Incarnation, Match the Session

Reconnect aims at the original daemon incarnation and the original session id. If the daemon has restarted, process identity is gone — Track 2's rematerialize, not this attach. If the session id is gone, you are not "back." You are looking at a different fire that happens to have a similar title. Pretending they are the same is resurrection of a PID wearing a reconnect spinner. The honest UI says the session is not here, offers the declaration if one exists, and does not grant a lease onto a lookalike.

Incarnation is the boot-UUID idea applied to the daemon's life, not only the machine's. Same machine, new daemon process, old leases are paper. Same daemon process, same session id, you may attach as spectator and see the live jobs. That pair — incarnation plus session — is the only honest address. Titles are not addresses. PIDs are not addresses. "The pane that was on the left" is not an address after a reboot.

Never Replay the Grant

A saved Take Control is not a ticket that still works. Replaying it would skip the clerk. The clerk has to be asked again, in the present, when you can see who holds input now. If nobody does, you still start as spectator; then you may take. If somebody does, you watch, and you decide whether to steal explicitly. Steal is Take Control while another holder exists — same serialized handoff, old writer read-only, process alive. It is allowed because it is visible. It is not allowed as a reconnect side effect.

This is the same honesty as a stale Pippa snapshot. The grant belonged to a moment. The moment passed. Inserting a stale grant into a live clerk is splicing a suffix onto the wrong prefix. Come back, look, choose. The pocket is allowed to be inconvenient here. Inconvenience is cheaper than a silent steal into a live Anvil seat.

Reconnect is spectator, against the original incarnation and session id. Never replay a control claim. If the incarnation or the session is gone, you are not back — and a lookalike does not get the old lease.

Code

What reconnect is allowed to remember·text
remember:
  daemon incarnation id
  session id
  (optional) last title, for humans, not as an address

forget:
  isController
  queued keystrokes          (next lesson)
  unconfirmed create         (next lesson)
  Anvil phase as still-fresh (lesson 5)

on reconnect:
  if incarnation missing -> session identity is gone; rematerialize or stop
  if session missing     -> not "back"; do not grant onto a lookalike
  if both present        -> attach as SPECTATOR
                            show who holds input now
                            Take Control is a new ask, in the present

# Illegal
  replay saved grant
  attach as controller because we were controller
  match by title or by PID

External links

Exercise

Write three reconnect stories: (1) same daemon, same session, Mac currently typing; (2) daemon restarted, declaration exists; (3) session closed on the Mac while the phone was locked. For each, name the role you attach as, and whether Take Control would be a new ask, a rematerialize, or a hard stop. If any story attaches as controller, rewrite it.
Hint
Only story 1 even has a live session to watch. Story 2 is Track 2 restore. Story 3 is a closed job — recently-closed recipe, not a lease.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.