roadmap BUILT

129. Scheduled execution: a cron whose every entry is a grant

Minted 2026-08-15 at calef's request. A backup server owes housekeeping on a schedule (snapshot thinning, scrub passes, log rotation) even though the Mac initiates the backups themselves, and nothing else on the roadmap ran anything on a schedule. The interval scheduler, a narrowed archive, a backable --mem grant and runtime replacement under §222 (who holds a user's schedule) are built, and so are calendar entries (G5) on a granted clock. One image per entry was refused on 2026-09-26. The last item, connecting a real session, was built by milestone 152 (durable delegation): components/src/user_timetable_keeper.rs builds the timetable and components/src/login.rs sends REPLACE (verified 2026-10-03, UTC).

The REPLACE handler and the spawn contract are built and tested, with the kernel test as registrar and with a real user's durable session as registrar since milestone 152 (durable delegation).

In brief

Unix cron is ambient authority made periodic: whatever root's crontab says happens, and the crontab is the attack surface. The capability shape inverts it. An entry is a grant expression plus a schedule, checked at registration by grant_plan::plan, the same function the shell checks a prompt line with; milestone 31 (a capability shell) built that check. An entry cannot name what its manifest does not declare, and compromising the scheduler yields the entries' summed endowments rather than the system. The schedule vocabulary is deliberately small: every <interval> and at-boot. The full account is notes/scheduled-execution.md.

Built: the interval scheduler, 2026-08-18

The demonstration is the refusals. A crontab has one answer; registration here has four, and the split that matters is "the line is wrong" against "this scheduler holds nothing to back it". every 1s date runs in any crontab, because there the clock is ambient. Here it is refused in writing, before the first tick, because the wall clock is a capability under §43 (reading the clock is a page) and this scheduler holds none. The cross-ISA test asserts the refusal and that the entry never runs.

The block's first sketch said the service would hold one clock capability. It holds none and needs none: monotonic time is ambient (user_rt::monotonic_ns), and the wall clock is the thing §43 made a capability. That is why a scheduled entry can be refused a clock at all.

Built: the archive narrowed to the plan, 2026-08-18

The scheduler holds exactly the programs its plan builds, not the whole initrd, because Registry::programs is known before the first tick. The set is a written list at the spawn site, kept honest by a host test. script/stack-frame-check refuses computing it in the kernel, since Registry::register carries a 21,632-byte frame against a 4,096-byte guard page. The program also audits what it was handed and prints one of two sentences, and the test asserts the narrow one.

Built: a backable --mem grant, 2026-08-22

timetable::SHIPPED_HELD.mem_pages is 4, and at-boot memory_grant_depleter --mem 4 is planned, backed and fires. The grant nests inside its instance's region, because regions::destroy_outcome refuses a region with a live child. A supervisor learns a dead child's tid and nothing else, so at most one --mem instance may be outstanding: that is what pairs a death with its grant. Every other entry pays by firing late while it runs. components/src/timetable.rs's BUGS has the whole cost.

Built: a designation it cannot back is unbacked, 2026-09-26

admit planned each entry against the scheduler's own directory bit, so rm -r logs in a timetable holding no directory came back Refused, which tells a reader to edit a line with nothing wrong in it. Mutants from milestone 326 (turn a mutation score upward) found Unbacked::File and Unbacked::Directory unreachable. The planner is now lent a directory and unbacked alone decides, including for a streamed operand such as wc report.txt. Host test: a_designation_the_scheduler_cannot_back_is_unbacked_rather_than_refused.

Built: replacing a running document, 2026-09-26

§222 ruled one timetable per durable session, changed by replacing the whole document. Built:

Built: calendar entries, 2026-09-26

calef ruled G5 on 2026-09-26 (notes/scheduled-execution/calendar-grammar-g5.md), with S3 and a SET fix for a clock that steps.

The finding: milestone 106's fifth consumer

There is no timed wait in this kernel, so a program whose whole purpose is to act at a time can only yield and re-read the counter. A running timetable costs a core's worth of yields, and it reaps dead children lazily, because a process has one wait point. Registry::next_deadline already computes the instant a timed wait would block until, so the loop changes by one line when one exists. The registration note says which milestone moves the timetable onto a timed wait.

What was left, and is now built

Connecting a real session. components/src/user_timetable_keeper.rs (milestone 152) spawns the timetable to timetable::contract, login writes the store and sends REPLACE (components/src/login.rs), and the boot-time pass lives in login too (session_reviver is retired). The kernel test a_users_schedule_outlives_their_login_and_ends_when_they_empty_it runs it on all three ISAs.

Scope note

Sequenced by need. The first real customer is the housekeeping of milestone 55 (Time Machine), which does not exist, so the shipped document is a demonstration written to show every answer registration can give.

BUGS

Follow-on

Index row

The backup server owes housekeeping on a schedule; Unix cron is ambient authority made periodic, and the capability shape inverts it: an entry is a grant expression plus a schedule, checked at registration like a command line at the prompt. Built: the interval scheduler with four registration answers (2026-08-18), the archive narrowed to the plan (2026-08-18), a backable --mem grant (2026-08-22), and, on 2026-09-26, designations reported as unbacked, whole-document replacement under §222, and calendar entries (G5) on a granted clock. One image per entry was refused. Built 2026-10-03: the real session, from milestone 152.