Repository navigation
docs(checklist): three rules on what a reading actually measures - #1916
Merged
Merged
Conversation
Rules 38-40, each earned by an incident in this session's TASK-069 and TASK-129 arcs: - 38: a read of the installed artifact is not a read of the running process; verify enforcement at the process (start time vs mtime, at second resolution; lsof holds no handle on a loaded module; count the importers before writing the blast radius). - 39: a test run's summary line is not its verdict; a run piped through grep hides the exit code, and Tests: 0 total is never a pass. - 40: a mutation's magnitude is machine-local; report the sweep and a margin-chosen arm, not a single point. Appended at the end of the file per its own numbering convention (ascending in document order; no existing rule renumbered).
…symptom The gate's own correction: `cmd | grep …` reports the pipeline's status, which is grep's, so a matched filter line makes the visible outcome a success whatever the command returned. Records the mechanism (the part that transfers) and keeps the measurement (both npx forms exit 1; the control exits 0 with modules installed).
…to the measured points
Three corrections from review of this PR, each verified before folding:
- 38(a): quote `stat -t '%F %T' -f '%Sm' <file>`; the shorter
`stat -f '%F %T'` exits 1 with `stat: %F : bad format` on macOS, so a
rule cannot quote an invocation that does not run.
- 38(c): count the processes that REACH the call, not the files that
import the module -- every `commonly` process evaluates the guard
(index.js:19 -> commands/daemon.js:21 -> daemon-supervisor.js:4) while
only `daemon run` reaches the audit (daemon-supervisor.js:160 from
:204/:303). Adds the blast-radius rider: a daemon restart also SIGTERMs
its supervised seats (daemon.js:403; kill('SIGTERM') at
daemon-supervisor.js:126), 2 of the 15 here.
- 40: the reviewer's box was green at 5 ms and red at 50 ms; nothing
between was measured there.
- 39: wording aligned to the clause as its author wrote it.
"15 agent run seats never load the guard" was wrong and is gone.
…ain the answer A zero from a scoped listing is not a zero: bare `ps` lists only the caller's session, so `ps -o pid=,ppid=,args= | awk '$2==<pid>'` reported 0 supervised children on a host that has two, while `pgrep -P <pid>` (and `ps -eo ppid=`) report 2 -- reproduced here, with the two confirmed at ppid=37760 by a direct `ps -p`. Also records that this correction, like the `stat` form and the import-versus-call distinction, came from the gate.
…thor The 0-then-2 child count was the reviewer's (74394), not the gate's catch; the earned line now says so in the gate's own suggested wording.
…le is read Swap 2: a bare `ps` is not session-scoped -- it lists only processes attached to a terminal, and a daemon's seats are attached to none (reproduced: bare `ps` lists 18 processes across ttys000-007; the daemon and both seats show `??` in `ps -e` and are absent from it). Swap 3: `stat -t '%F %T' -f '%Sm'` is BSD-only, but `daemon install` registers under systemd as well as launchd (commands/daemon.js:272), so the rule is read by Linux operators too. `date -r <file> '+%F %T'` is the portable form and printed the same 2026-09-25 01:01:06 here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Three rules appended to
docs/development/review-checklist.md(38–40), all of them about the same shape: the number you read is one step away from the fact you think it measures. Append-only — 8 added lines, 0 removed, no existing rule renumbered, placed at the end of the file per its own numbering convention.38 — a read of the installed artifact is not a read of the running process. An
importof the installed module reads bytes; a process started before those bytes changed keeps the module it loaded. Necessary check: process start time later than the installed file's mtime. Sufficient check: the refusal line in the daemon's own log from a real declared entry. Three measured operator facts: compare seconds (mtime…01:01:06vs start…01:01:11— five seconds apart, both printing as01:01, so a minute-resolution comparison is a coin flip on the host it is meant to protect);lsof -p <pid>shows no handle on the module, so start-time-vs-mtime is the only cheap signal rather than a proxy for a direct read; and count the processes that reach the call, not the files that import the module — everycommonlyprocess evaluates the guard at boot (index.js:19→commands/daemon.js:21→lib/daemon-supervisor.js:4) while onlydaemon runreaches the audit (lib/daemon-supervisor.js:160, from:204/:303). The instrument line is also the one that runs where it is read:date -r <file> '+%F %T'works on both platforms (measured2026-09-25 01:01:06),stat -t '%F %T' -f '%Sm' <file>is BSD-only thoughdaemon installregisters under systemd too (commands/daemon.js:272), and the shorter-lookingstat -f '%F %T'is not a command on macOS at all — exit 1,stat: %F : bad format. Rider for the blast radius: a daemon restart SIGTERMs the seats it supervises (commands/daemon.js:403;kill('SIGTERM')atlib/daemon-supervisor.js:126) — 2 of the 15 running here, counted with an instrument whose set can contain the answer:ps -o pid=,ppid=,args= | awk '$2==<pid>'returns 0 on this host whilepgrep -P <pid>andps -eo ppid=return 2, because a barepslists only processes attached to a terminal, and a daemon's seats are attached to none (bareps: 18 processes across ttys000–007; the daemon and both seats show??inps -e).39 — a test run's summary line is not its verdict: read the suite count before the colour, and never read a status through a pipe. Two halves, the second being the mechanism rather than a second symptom. A status read through a pipe is the pipeline's status, not the command's —
cmd | grep …reports grep's exit, so a filter line that matches makes the visible outcome a success whatever the command returned:npx jest <file> 2>&1 | grep -E "Tests:|✕"matched theTests:line, so the shell saw 0 and a pass was read that jest had never given. Run unpiped, or take$?from the command itself. And read the count rather than the colour, because the count is the part a filter cannot flatter: measured in a worktree with nocli/node_modules, bothnpx --yes jestand plainnpx jest </dev/nullprintTest Suites: 49 failed, 49 total/Tests: 0 totaland exit 1, while the control in a tree with modules prints1 passed, 15 passedand exits 0. (This clause is the gate's own correction of its record, and it leads the rule because it is the part that transfers: grepping a suite's output for the summary line is the natural thing to do and it disarms the one signal that cannot be misread.)40 — a mutation's magnitude is machine-local. Report the sweep and a margin-chosen arm. The first published arm in TASK-129 ("5 ms reddens it 3/3") did not reproduce on the reviewer's box — green there at 5 ms and red at 50 ms, with nothing between measured on that box — and read as a bad arm; the sweep (0–1 ms green, 2–5 ms 1 failed, 10–100 ms 3 failed) plus a 50 ms margin arm reproduced in both environments.
Each rule names the incident that earned it in the existing
*(Earned: …)*form, including the two corrections that came from the gate correcting its own record rather than the author's.Why these three, now
All three surfaced in this session's TASK-069 and TASK-129 arcs and none of them is covered by an existing rule: 27–28 cover artifacts that cannot see the hole, 31 covers how to prove a flake fix, 32 covers the merge/consumer gap one layer in. This is the stale-base error and the "verify at the consumer" norm extended to a process and to a test invocation.
Risk
Docs only, no code and no test changes:
docs/prose is deliberately outside the doc-reference guard's scan roots and there is no markdown linter, so the only checks that matter are the version guard (nosrcmoved, so no bump) and the base freshness guard.Review corrections folded (head
1b6c9348)Six flags folded from review of
78deaf9c, each verified before folding: three from the gate's read — thestatinvocation (reproduced: exit 1,bad format), the import-versus-call premise (the chain measured, the false "seats never load the guard" clause removed), rule 40's measured points, — and the child-count instrument (a scoped listing's zero is not a zero), its mechanism (a barepslists only terminal-attached processes) and its portable mtime form (date -r) from the reviewer who wrote the drift line, whose own first count was0beforepgrep -Preturned2. Each correction carries its provenance in the rule's own*(Earned: …)*line rather than being silently smoothed.Gate
@wren — docs/shape, one gate.