docs: address review nits from #29 - #30
Conversation
Three P3 items from the review of #29, no behaviour change. - docs/docker.md opened by saying spacebot runs as PID 1, which the same section then contradicts by making tini the entrypoint. Lead with the actual arrangement (tini is PID 1, spacebot is its child) and say why the distinction matters, since that is the whole reason the reaper is conditional. - The SAFETY comment on waitpid justified WNOHANG but not the pointer. State the invariant that actually makes the call sound: `status` is a valid, aligned c_int local that outlives the call and is the only thing libc writes through. - `_owned` in run_streaming said what the binding was, not what it was for. `_reaper_claim` names the reason it must stay alive.
1. SummaryDocumentation-only / comment-only changes following review feedback from #29. The docs now state that 2. FindingsP3 — Doc/comment claim about the claim guard's Drop behaviour changed meaning The previous wording said dropping the guard "also sweeps" (i.e. a general orphan sweep); the new wording says it "reaps the PID" (i.e. a targeted P3 — Narrowed condition in This replaces "bare P3 — Line exceeds the file's ~80-col wrap ~82 chars, while surrounding prose in the same paragraph wraps at 80. Trivial re-wrap. Nothing blocking. The expanded 3. SecurityNo security impact. No changes to command construction, argument passing, authentication, or secret handling; 4. VerdictAPPROVE — documentation and comment accuracy improvements with no behavioral risk. The P3 items are optional follow-ups. AI Review · Verdict: APPROVE · Diff-Score: 0.83 |
Follow-up to #29 (merged). Addresses the three P3 nits from that review. No behaviour change — docs and comments only, plus one binding rename.
Changes
docs/docker.md— stale PID 1 claimThe section opened with "Spacebot runs as PID 1" and then, a few lines later, explained that
tiniis the entrypoint. Straightforwardly self-contradictory. Now leads with the actual arrangement —tiniis PID 1, spacebot is its direct child — and says why the distinction matters, since whichever process holds PID 1 is the one that inherits orphans. That is the whole reason spacebot's own reaper is conditional, so it's worth a sentence rather than a correction in passing.src/process/reaper.rs— incomplete SAFETY commentThe comment justified
WNOHANG(non-blocking, doesn't stall the runtime) but said nothing about the pointer, which is the part that actually needs justifying. Now states the invariant:statusis a valid, properly alignedc_intstack local that outlives the call, andwaitpidwrites at most onec_intthrough it.src/tools/shell.rs—_owned→_reaper_claimThe old name described what the binding was; the new one describes what it is for. The underscore still marks it as intentionally unused — it exists to be held, and dropping it early would reintroduce the leak.
Verification
Unit tests 10/10, clippy clean under
-D warnings, rustfmt clean.Staged only the three files above; the unrelated modified files in the shared checkout belong to a concurrent worker (spacedriveapp#224).