roadmap BUILT

235. A command that faults hangs the prompt, because nothing has a word for it

Built. Milestones 231 (nothing counts how many capability slots a boot actually uses) and 233 (login dies on every boot) found it. They were proving their own gate could fail.

In brief. A spawned command that traps hangs the prompt. swish waits on the job's result endpoint and a killed thread never sends, so the shell waits forever. An ordinary non-zero exit is handled correctly; it is specifically a fault that has no path back.

Found by deliberate experiment rather than by accident: milestone 233's lane patched worker to trap in order to prove its new no-thread-killed assertion could actually go red, and the prompt hung.

Why it is worth its own block

The pieces already exist. DECISIONS §26 (the fault endpoint: thread death becomes a message a supervisor holds) means somebody already learns that the thread died. What is missing is a word: grant_plan::spawnproto has no way to say this job faulted as distinct from this job has not answered yet, so the knowledge cannot travel from the supervisor to the shell that is waiting.

That makes this a protocol gap rather than a bug in swish, and it is the kind that gets patched locally by whoever meets it next unless it is written down.

What was built

grant_plan::spawnproto::JOB_FAULTED, a third value on a read that already carried two. job_undertaker gained one capability (WRITE, no GRANT, on init's result endpoint) and sends that word once, after collecting the corpse and only for abi::fault::EVENT_FAULT. swish recognizes it in the four places it reads that endpoint (an answer, a byte stream being printed, a byte stream going into a file, a pipeline stage's ack). It prints swish::FAULTED_SENTENCE and sets Status::Failed; $? reads 1 and && stops.

The design question this block left open was which of three couplings, and the answer is the middle one: the supervisor tells. The other two lose on properties this tree already recorded, and the argument is at JOB_FAULTED itself, in notes/supervision.md, and in one line each here. The shell asking needs a poll interval, because the ABI has no non-blocking receive, and a poll interval cannot tell a slow job from a dead one. The endpoint carrying the death works for the fault and breaks the ordinary path. DECISIONS §26 (the fault endpoint: thread death becomes a message a supervisor holds) flows clean exits down the same endpoint. Every ordinary job would leave a second message behind its answer, and every job would leave init's supervision domain, which is what ps and pgrep read.

Nothing here touches the system call surface. No new system call, no new method, no new argument: one userspace constant, one capability in an endowment, and four call sites.

Proven the way the defect was found, on both architectures. components/src/least_authority_demo.rs was patched to trap on argument 6 and script/swish-check run against it. Before: worker 6 killed the thread and "the prompt never came back to take worker 7". After, on aarch64 and riscv64 alike, the transcript reads the kernel's own report of the killed thread, then that command faulted and was killed before it answered, then echo $? answering 1, then worker 7 answering 7*7 = 49 and the rest of the script running to its end. The scaffold was then removed and script/swish-check is green on both legs.

BUGS

Follow-on

Index row

spawnproto::JOB_FAULTED: job_undertaker already held the death, and now has one word and one WRITE to say it with