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

The App Is a Projection

~12 min · daemon, pty, ownership, projection

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

Quit Must Not Mean Die

A normal GUI terminal is a process factory with a drawing surface glued on. Quit the app and the factory dies, so the shells die, so the editors die, so the four seats you were in the middle of die. That is reasonable for a text editor. It is hostile for a daily driver you walk away from twenty times a day.

Smolder splits the factory from the drawing. A small session daemon owns the PTYs, a bounded journal, and request receipts. The Mac app is a projection: it attaches, it draws, it may crash, it may quit with preservation on. The phone, later, is another projection. Neither projection is allowed to confuse its own lifetime with the lifetime of the jobs.

Small on Purpose

The daemon renders nothing. It calls no model. It loads no plugin. It holds no provider credential and no SSH credential. Those refusals are what keep it restartable and what keep a crash in the chrome from becoming a massacre in the jobs. A daemon that also draws is just the old glued-together app wearing a background-service costume.

Attachment is a private, versioned conversation between the app and the daemon — not a network API, not a prompt. The sibling door and the mobile gateway are different doors, later tracks, with different audiences. The daemon is the owner they all attach to. If you find yourself wanting the daemon to "just draw a little," you are gluing the factory back on.

Two Surfaces Already Depend on This

The Mac half of this quest will spend three more lessons on close, journal, and restore. The iOS half will spend a whole track on not treating a locked phone as a kill. Both of those sentences are false if the window still owns the process. Read this lesson as the load-bearing wall, not as Mac trivia.

The daemon owns the fire. The app is a projection. A projection may vanish. The fire must not take that personally.

Code

Ownership, drawn as two processes·text
Smolder.app (projection)
  - windows, tabs, panes, chrome, menus
  - attaches over a private socket
  - may quit, crash, or lose a window

SmolderDaemon (owner)
  - PTYs
  - bounded journal of output
  - receipts for family requests
  - no pixels, no model, no plugins, no SSH keys

# Quit with preservation = detach. Jobs keep running.
# Crash of the app = same, if the daemon is still up.
# Crash of the daemon = process identity is gone.
# Reboot = declarations restore, live processes do not.

External links

Exercise

Draw two boxes, app and owner, and put each of these in one box: pixels, PTY, menu bar, journal, SSH keys, model calls, crash of the window, reboot of the machine. If SSH keys or model calls landed in the owner box, move them out and write one sentence about what would happen to jobs when the chrome crashed if you had left them there.
Hint
Anything that is allowed to vanish belongs in the app box. Anything whose vanishing should kill jobs belongs in the owner box — that is the PTY. A journal that cannot write must not kill the job.

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.