222. Who holds a user's schedule, and how it is changed while their session lives
Raised 2026-09-26 by the maintainer, from the proposal the lane for milestone 129 (scheduled execution) wrote in notes/scheduled-execution/registration.md on pull request #1345. The note is the lane's argument and holds the detail; this file is the ask to calef, and it links to the note rather than restating it. (Section number provisional until the merge queue lands it. It was the next free number on 2026-09-26, after §221 (the boot prompt is the owner's console), claimed by #1340.)
The ruling
calef, 2026-09-26 (recorded 16:37 UTC): "Yes, C with all five." A user's schedule is held by a timetable their durable session spawns and supervises, and it is changed by replacing the whole document; removing an entry is a replace without that line. The five sub-rulings hold as recommended below:
- The document travels in one shared page, and the reply is one word of verdicts.
- A replace is parsed and planned whole, or it leaves the old schedule running.
- A byte-identical entry keeps its phase.
- A job from a removed entry runs to completion.
- The session writes the store, and the timetable holds no directory.
Options A and B are refused for the reasons in
the table. REPLACE is still a provisional name.
The handler can be built now, with the kernel test harness standing in as registrar. Connecting a real session still waits on milestone 152 (durable delegation).
Amended 2026-09-26: a per-user session process supervises the timetable
calef, 2026-09-26 (recorded 16:56 UTC): "152: S1, the per-user session process."
The ruling above has the durable session spawn and supervise the timetable, and assumes a running
thing to do it. The lane for milestone 152 (durable delegation) found none exists. Supervising means
holding the timetable's supervision endpoint and blocking on it, and a process has one wait point.
Its options are in notes/durable-delegation.md on pull request #1347.
The ruling, S1: login builds a per-user session process from the session budget. That process
builds the timetable, hands out its REPLACE endpoint, and blocks on the supervision endpoint.
login keeps two capabilities per durable identity:
- the budget, for the reattach probe and for the cascade of §108 (disabling a user's login credentials kills their durable session);
- the
REPLACEendpoint, handed back to a client that reattaches.
The cost is one more process per scheduling user, beside its timetable. It blocks rather than yields, so it costs memory and no CPU.
Refused:
- S2,
loginsupervises. It blocks on its front door and would never read a report. - S3, the client or the shell supervises. It exits at disconnect, which is the problem being solved.
- S4, nobody supervises live. A dead timetable would silently stop the user's jobs.
When login builds it
calef, 2026-09-26 (recorded 17:41 UTC): "L2". The session process is built only on request,
and login is unchanged for a session without a schedule. A session with one outlives logout,
because the session process is a live child of its budget and §16 (object revocation) refuses to
destroy a parent with a live child.
The build deviates from the wording calef was shown, which had a new request word on login's
private channel after OK. login cannot wait for a word after OK unless every existing client
sends one. So the lane made the request the login itself: SCHEDULE is a login request that also
builds the session process, and its reply announces the REPLACE endpoint as a following
capability (SCHEDULE_FOLLOWS), the way RUN_UNVOUCHED_FOLLOWS announces one in
crates/login_contract. The substance of the ruling is unchanged. The build is draft pull request
#1377 (milestone/152-session).
Refused:
- L1, build it at every login. Every past user keeps a session process and an empty timetable alive, logout becomes a detach, and ending a session needs a new request of its own.
- L3, build it when the stored schedule is non-empty. The first registration still needs L2's request, so L3 is L2 plus a special case.
SCHEDULE and SCHEDULE_FOLLOWS are provisional wire values, and their names are not ratified.
The program's name is not ratified, and whatever a lane ships is provisional. The REPLACE handler
does not wait on this program; connecting a real session does.
The rest of this file is the section as it stood before the ruling.
What is being decided
components/timetable.conf is compiled into the scheduler, so the right to register a scheduled job
is the right to rebuild the image. A person who has logged in should be able to schedule a job on
their own authority, change it, and remove one entry of it. Two things here are an architect's call
under AGENTS.md, because two programs will agree on them and because they decide where authority
pools:
- Which process holds a user's schedule.
- What crosses the wire to change it, including how one entry is removed.
Five smaller rulings sit inside the recommended answer and are listed below it. Each can be answered on its own.
The options
| shape | why it loses | |
|---|---|---|
| A | One system timetable, a separate registration endpoint and document per session | The scheduler must back every entry it fires, so it holds the union of every user's delegated authority. A compromise reaches all of it, which is the sum milestone 129 exists to bound, now taken across users. Revoking one user under §108 (disabling a user's login credentials kills their durable session) becomes a message the scheduler must act on instead of a subtree dying. |
| B | One system timetable, ADD returns a handle, REMOVE takes one |
A's union problem, plus two of its own. A capability handle names nothing after a reboot, once session_reviver has re-derived the schedule. A numeric handle is an ambient name the scheduler has to check against its caller. And §122 (the on-disk, per-user schedule store) stores one whole document per identity, so every per-entry call would be folded back into a document before it could be written. |
| C | One timetable per durable session, changed by replacing the whole document | Recommended. Its cost is the yield loop below. |
The recommendation: C
The session spawns its own timetable from its own budget and supervises it. The authority it passes
in is exactly what it lets its jobs hold. The endpoint to that timetable is the registration right,
so there is no badge and no table of registrars. There is one operation, REPLACE (a provisional
name), which carries a whole document, and the reply carries the plan. Removing an entry is a
replace without that line; removing all of them is an empty document, or the session destroying its
timetable.
The reasons, in the order they carry weight:
- A compromise reaches one user's delegated authority, so the milestone's claim holds per user.
- Revocation is free. §108's cascade kills the session, and §40 (a supervisor's death is its subtree's death) takes the timetable and every job with it. Nothing new has to be written.
- The store is already this shape. §122 keeps one document per identity, so registering becomes "write the file, then replace", and boot becomes "spawn a timetable with the file".
The five smaller rulings inside C
Each is cheap to reverse until a second program speaks the protocol. The note has the reasoning for each; the recommendation is:
- Transport. The document goes in one shared 4096-byte page, as
filesystem_protocolalready passes names and file bytes.MAX_ENTRIESis 8 and the shipped document is about 200 bytes. The reply is one word of verdicts, eight bits per entry, with the printed plan in the page. - Atomicity. The new document is parsed and planned whole before it replaces the old. A parse error leaves the old schedule running and returns the line number.
- Phase. An entry whose text is byte-identical keeps its beat; a new or changed one arms fresh. Otherwise editing one line shifts every other schedule.
- In-flight jobs. A job from a removed entry runs to completion and is reaped normally.
- Who writes the store. The session writes the file and then sends the replace. The timetable keeps holding no directory, because its four-capability list is the milestone's demonstration.
The seven questions
- What else was considered. A and B, each refused in the table above for a stated reason.
- What the tree already does.
components/src/login.rsbuilds a fresh budget and directory for every login, and §109 (attribution is a property of a channel, not of a capability) already chose a fresh object per principal over a shared view. C applies the same rule once more.Registry::register(doc, held)needs no change, sinceheldbecomes whatever the session gives. - Prior art, read by the lane on 2026-09-26. crontab(1) is whole-file: install replaces the table,
-eedits and reinstalls,-rremoves. systemd-run(1) makes one transient timer unit per call, which is B's shape. Stopping one by unit name throughsystemctlis recalled rather than read. - Is the premise true. The lane checked four claims against
256815e56, and the maintainer rechecked the two that matter at18dab9c6aon 2026-09-26.MAX_ENTRIESis 8 incrates/timetable/src/lib.rs. No durable session type exists:components/src/session_reviver.rsnames one only in comments, so the registrar waits on milestone 152 (durable delegation).crates/system_initializerdoes not name the timetable, so C adds no process to a real boot until a session schedules something. - What each costs. Memory: the kernel test sizes one timetable at a 768-page budget and a 32-page stack, and a one-entry document needs one 48-page instance at a time. CPU: there is no timed wait, so every running timetable yields in a loop. C pays that once per scheduling user where A pays it once. That cost is not measured, because no boot runs two timetables, and it ends when milestone 106 (a wait that ends on either the interrupt or the deadline) lands. This is the best argument for A. Code: C is the smallest build, and that is not the reason.
- How reversible. The operation number and page layout are a wire format, expensive once a second program speaks them. Today none does. Which process holds the schedule is cheap to change while no user has registered anything. The on-disk store does not depend on the choice, since every option reads §122's document. Nobody has acted on any of it.
- At equal cost, C still wins, on compromise radius and the free cascade. It also narrows the one-image-per-entry gap, since a compromised timetable reaches one user's plan rather than the machine's.
What is blocked until this is answered
- A
REPLACEhandler incomponents/src/timetable.rsand its constant incrates/timetable, on all three architectures. - Wiring
crates/schedule_storeinto a running scheduler rather than only intosession_reviver. - Milestone 129's removal item, which has had no answer since #387.
Connecting a real session also waits on milestone 152, whatever the answer. The handler does not: a lane can build it with the kernel test harness standing in as registrar.
What each answer means
- Yes to C and the five rulings: a lane builds the handler as above.
- A instead: the same handler plus a per-registrar table, and a
BUGSentry at the scheduler's authority list recording the cross-user union. - Refuse all three: the document stays compiled in, and milestone 129 stays PARTIAL on this item.