Repository navigation
CONDITIONS
Baseline. This re-reviews a8e3fe71 against the CONDITIONS on 3f855331 (this PR). I checked these facts. since.diff equals git diff 3f855331 a8e3fe71. pr.diff equals git diff 853df318 a8e3fe71. The compare is a clean merge of main (beab00d3, git diff-tree --cc empty: #2870, #2763, #2825) plus one branch commit, a8e3fe71, which makes the exec_enabled gate fail closed. The arch checkout 7a86ec7b has no arch-map.md, and no findings.json was staged. The ledger keeps only the first 400 characters of the prior ruling, so I could not read its conditions. I re-derived every requirement from the design, and I did not depend on the earlier list.
Governs: architecture.md line 497 (min box exec), the command reference (line 478), the [io] exec_enabled default (lines 879–882) and exit code 5 (line 366). Line 497 says that a detached or -t exec outlives its client, and that any exec ends on min box stop <box> --exec <id>. A stop ends "its process group — the command and the children it did not detach into their own session". A process that the command put in its own session survives. minimald enforces exec_enabled from the stored spec and refuses with exit 5, naming the key. exec_started carries principal, argv and PTY flag, and exec_exited carries the exit code or reason timeout.
Ruling. BOX-150, BOX-152 and BOX-153 conform. With the compare, the gate refuses a spec that it cannot read or parse (rule 7). BOX-151 deviates in two places. First, the change makes a tty exec lead a session that owns its PTY. An interactive shell then turns on job control and puts jobs in other process groups of that session, but the shim still kills only -pgid (C1). Before this change the exec had no controlling terminal, so job control was off and the group kill reached every child. Second, only managed execs register for a stop. A plain exec has an id but cannot be stopped, and the RPC says that it does not exist (C2). C3 asks for issues for the two pieces of work that the body leaves undone: the minimald-rpc and min client path, and the mfile field without which a real spec cannot set the key (rule 6).
Placement and boundaries. StopExec sits in minimald/src/rpc.rs and is dispatched like StopBox, with the same per-connection authorization and no new check. The design does not name the crate that owns RPC types, so the move to minimald-rpc is a residual (C3), not a deviation.
Not checked. I did not build or run anything. That an interactive shell on the new controlling terminal turns on job control is standard shell behaviour, not something observed here. exec_disabled_refuses_exit5 covers the shell, argv, attached and detached forms but not the tty form, which goes through the same gate before the mode branch.
Conditions
- C1:
crates/minimald/src/nsenter.rsshim_main: whentake_terminalis set, the exec leads a session, so its end must reach every process group of that session, not only-pgid. In the main flow (not in a signal handler), at the group SIGTERM and again at the SIGKILL afterGROUP_GRACE, signal each process group whose session id (field 6 of/proc/<pid>/statin the box's PID namespace) equals the publishedCHILD_PGID. A process that calledsetsidhas another session id and stays alive. Update theCHILD_PGIDdoc comment and the publish comment, which still saysetpgid(0, 0). Add a test: a process underlead_session_on_terminalstarts a child that callssetpgid(0, 0)into a new group of the same session, and a stop of the exec ends that child. - C2: Make a plain (attached) exec stoppable by its id. In
crates/minimald/src/exec.rsrun_attached_exec, register a stop forexec_idtogether with its box id. Incrates/minimald/src/exec/process.rs,TimedBoxExeccarries thatCancellationTokenandTimedProcess::waitselects on it, then ends the command withstart_killandwait_after_stop, aswait_or_stopdoes.stop_execfinds an attached exec through that registration and answers with itsExecExit, sorpc.rsstop_exec_answerno longer answers "box has no exec ." for a live exec. Remove the registration when the exec ends. Add a test: a stop of an attached exec ends it, writes itsexec_exitedevent, and leaves the box running. - C3: File two issues and link them as residuals in the PR body. (a) Move
StopExec,StopExecRequestandStopExecResponsefromcrates/minimald/src/rpc.rsintominimald-rpc, and addmin box stop <box> --exec <id>. Until then no client can call the RPC. (b) Addio.exec_enabled(defaulttrue) tomfile::spec::BoxSpec. Until then a spec that sets the key fails the parse at launch, so the gate takes effect only on a hand-writtenspec.json.
Ruled at a8e3fe7 against gominimal/arch@7a86ec7bb3c0 by claude-opus-5-5; arch_rulings 792, job 6d28916b-4b48-4dab-9151-d8885776bf28.