fix: PR #148 - make negative control deterministic
PR Pipeline — Authorize → Validate → Review → Merge / auth (pull_request) Successful in 5s
PR Pipeline — Authorize → Validate → Review → Merge / validate (pull_request) Successful in 7s
PR Pipeline — Authorize → Validate → Review → Merge / lint (pull_request) Failing after 4s
PR Pipeline — Authorize → Validate → Review → Merge / ai-review (pull_request) Successful in 6s
PR Pipeline — Authorize → Validate → Review → Merge / gate (pull_request) Skipped

- Replace grep-based timeout control with sleep 5s command that cannot
  finish in time, guaranteeing exit=124 (timeout)
- Run the control TWICE to prove determinism (exit=124 both times)
- Remove stale 0.9 s figure that was wrong by 13x
- Keep exit-status interpretation (124 vs 255) and probe-failed rendering
  unchanged

Correlation: corr=bf05539bfb04f1ff
This commit is contained in:
root
2026-10-02 12:17:48 +00:00
parent 2512c5e85f
commit f4dc7e23b4
+9 -6
View File
@@ -225,16 +225,19 @@ timeout 15 ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no root@<ip> \
If any output from step 2 — **critical violation** (master key leaked). Fix immediately.
### Negative control (probe-failed vs unreachable)
### Negative control (probe-failed vs unreachable) — deterministic
To prove the distinction between a scan timeout and a connection failure, run with a deliberately tiny timeout:
To prove the distinction between a scan timeout and a connection failure, run a command that CANNOT finish in time (sleep 5s) with a 1-second timeout:
```bash
# Negative control: 1-second timeout on koby (scan takes 0.9 s, so this will time out)
timeout 1 ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no root@192.168.68.129 \
"grep -rn 'api_key: sk-' /root/.hermes/ --exclude-dir=state-snapshots --include='config.yaml'" 2>/dev/null
# Expected: exit status 124 (timeout) → render as "probe-failed: koby 192.168.68.129 (timeout after 1s)"
# Negative control: 1-second timeout on koby — sleep 5s guarantees timeout
timeout 1 ssh -o ConnectTimeout=10 -o StrictHostKeyChecking=no root@192.168.68.129 "sleep 5"; echo "exit=$?"
# Expected: exit=124 (timeout) → render as "probe-failed: koby 192.168.68.129 (timeout after 1s)"
# NOT: "unreachable" or "may be down"
# Run TWICE to prove determinism:
# Run 1: timeout 1 ssh ... "sleep 5"; echo "exit=$?" → exit=124
# Run 2: timeout 1 ssh ... "sleep 5"; echo "exit=$?" → exit=124
```
## Rotation Procedure