masked_exit trips on a chunk-split log line — a successful activation failed on the fragment '[gateway] Failed to' #549
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#549
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
2026-08-14 cold proof drive, Activate the gateway system leg: the drive faulted with
The tripping "proof" line ends mid-sentence —
[gateway] Failed to— and the deploy it failed was in fact SUCCESSFUL: the guest journal (live-tailed during the drive) shows switch-to-configuration completing cleanly, the post-activation hardening closed the root-SSH door on schedule, and all four forwarded service ports (22/8080/8443/443) came up and answered. The gateway converged; the detector failed the drive.Cause
internal/clan/errors.gologSaysFailedscans the captured log per line and deliberately exempts"failed to reload"(switch-to-configuration printsFailed to reload <unit>warnings over SSH on genuinely successful updates — the 2026-08-05 Phase A false positive). But the scan runs over stream-chunked text: a chunk boundary that splits a line mid-sentence —[gateway] Failed to⏎reload dbus-broker.service …— leaves a fragment that the exemption cannot match while the generic"failed to"marker still does. The truncated proof line persisted in the fault is the smoking gun:logSaysFailedreturns the exact line it scanned, and the line it scanned was a fragment.Rule
Reassemble the stream into complete lines before
logSaysFailedscans (buffer a trailing partial line until its newline arrives; flush at process exit). A proof line that ends exactly at a marker phrase (…Failed to,…error:,…cannot) with nothing after it should be treated as suspect — at minimum, never classify masked_exit on a fragment that a known exemption could complete.Proof
Unit test: feed the captured-log scanner the same content twice — once whole-lined, once chunk-split mid-line inside an exempted phrase (
Failed to/reload dbus…) — the classification must be identical (clean) for both. The existing clan_test.go masked-exit table is the home.Relates to #451 (evidence-free masked_exit) and #456 (benign-line false positives) — same detector, new false-positive class. Found on the 2026-08-14 cold-machine proof drive; the drive itself is otherwise the furthest cold run yet (mesh/public-entry/control-plane all green before this trip).
Second occurrence + root-cause refinement (2026-08-14, same drive, recover-then-redrive)
The recover path (delete VM → fresh stand-up) reproduced the trip EXACTLY — same fragment
[gateway] Failed toat the same leg. This is deterministic, not a chunking race, and the mechanism is now clear:Activating the hardened gateway config kills the guest sshd mid-output. The activation succeeds and applies the no-root-ssh hardening, which tears down the SSH session clan is streaming its log through — so the stream truncates mid-line at the same byte-ish point every run. Clan exits 0 (the activation genuinely completed); the masked-exit scanner then reads the truncated tail, the
"failed to reload"exemption cannot match the fragment, the generic"failed to"marker does. The line being chopped is almost certainly switch-to-configuration's benignFailed to reload <unit>warning — the exact class the exemption exists for.Verified live: the guest journal (tailed during the drive) shows the switch completing cleanly; the SSH door closed immediately after (hardening on schedule); all four forwarded service ports came up and answered. Two independent runs, both genuinely-successful activations failed by the fragment.
Fix implication beyond line reassembly: a stream that ENDS mid-line because the remote side hung up is the expected shape of this leg (activation kills the transport it streams over). The scanner must treat an unterminated trailing fragment as unscannable/suspect — reassembly alone cannot complete a line whose remainder never arrives.
This blocks the cold-machine proof drive (ADR 0110/0171 trial-proof, #425 sign-off ride): every fresh drive trips here, and the retry path then hits the post-activation transport wall (filed separately). Prioritised accordingly; ruling recorded by Ben in-session — fix per the Rule in the body + this refinement.
close-report for #549 — status
success✅ close-report gates passed — every claim verified against main; closing.
envelope