docs(althing): the fast outage probe never touched the timeout it claimed to test
My smoke test used a refused port on a live host and presented it as the check for the 2 s budget. Measured: it returns in 79 ms, because a refused port answers instantly with an RST. It verifies the glyph and nothing about the deadline. An address that black-holes — an unrouted LAN host — takes 2.065 s and is the one that exercises it. Both are now in the page with what each actually proves, because letting the fast case imply the slow one is how a status line that hangs the prompt ships with a green test beside it. Found by forseti in their own copy of the same probe and confirmed here rather than adopted. The smoke test also moves from expected-values-in-trailing-comments to printing `got [x] wanted [y]` on one line. The comment form is the shape that produced the false pass that caught two agents inside an hour, and the expected-value column is what caught it — so the page should use the thing it recommends.
This commit is contained in:
@@ -337,11 +337,37 @@ way. **Write code that does not depend on the environment being present**, which
|
||||
a seat started outside `dev-launch` has no handle in either place. Test with the
|
||||
variables stripped regardless, because that is the harder case:
|
||||
|
||||
printf '{"workspace":{"current_dir":"/tmp"}}' \
|
||||
| env -u ALTHING_HANDLE -u ALTHING_POST_OFFICE bash scripts/claude-statusline-command.sh
|
||||
probe() { # $1 = cwd, $2 = what you expect
|
||||
got=$(printf '{"workspace":{"current_dir":"%s"}}' "$1" \
|
||||
| env -u ALTHING_HANDLE -u ALTHING_POST_OFFICE \
|
||||
bash scripts/claude-statusline-command.sh)
|
||||
printf 'got [%s] wanted [%s]\n' "$got" "$2"
|
||||
}
|
||||
probe /tmp '' # no althing identity
|
||||
probe /home/lkraven/development/eshpfi-management '🔔 …'
|
||||
|
||||
Want: empty althing segment for a directory with no identity, `🔔` in a seat's
|
||||
own directory, `📵` against an unreachable address.
|
||||
⚠ **Print what you got beside what you wanted, on the same line.** Expected
|
||||
values in trailing comments are what produced the false pass that caught two
|
||||
agents inside an hour on 2026-09-02: `/tmp` rendered `🔔` and both of us read it
|
||||
as "fine" rather than "that directory has no identity and should be empty." A
|
||||
plausible value in the right shape is the hardest kind of wrong to see, and the
|
||||
only thing that reliably catches it is the wanted value sitting on the same line
|
||||
as the got value.
|
||||
|
||||
### ⚠ The outage probe: a refused port does NOT test the timeout
|
||||
|
||||
`📵` has two causes and they take different paths. Measured 2026-09-02 on
|
||||
nh3-dev:
|
||||
|
||||
| address | elapsed | what it proves |
|
||||
|---|---|---|
|
||||
| `http://10.100.50.40:9999` — refused port on a **live** host | **0.079 s** | the glyph, and nothing about the deadline |
|
||||
| `http://10.100.50.199:8390` — **unrouted** host, black-holes | **2.065 s** | the 2 s budget actually fires |
|
||||
|
||||
A refused port answers instantly with an RST, so the fast probe returns `📵`
|
||||
without ever approaching the timeout. Use **both**, and know which is which —
|
||||
letting the fast case imply the slow one is how a status line that hangs the
|
||||
prompt ships with a green test beside it.
|
||||
|
||||
## Rollback
|
||||
|
||||
|
||||
Reference in New Issue
Block a user