Skip to content

ci(test): name soldr daemon deaths as infra so red main is not read as a code failure - #2186

Merged
zackees merged 4 commits into
mainfrom
agent/2178-daemon-infra
Nov 26, 2026
Merged

zackees merged 4 commits into
mainfrom
agent/2178-daemon-infra

Conversation

@zackees

@zackees zackees commented Nov 25, 2026

Copy link
Copy Markdown
Member

Why

main is red (run 45665615665 on 9d94ad24)
and the failure is not a diff: linux / Check died in tree-sitter-cpp's build script after four
soldr#3377 relay resets and lost the connection to the soldr daemon (route soldr-daemon-7f93f978…)
— #2178's signature. Every hour that costs someone a job log read, and the reflex repair
(gh run rerun --failed) is 2/2 dead on this SHA.

ci/test_cache_status.py already streams every line of that output to decide cache saves, but it
records nothing when the daemon is what failed. So a red trunk reads exactly like a red test run.

What changes

Purely additive, and the exit status is untouched:

  • DaemonDeath classifies soldr#3377 relay resets and lost the connection to the soldr daemon
    lines, extracting the shared daemon's route id. Identical lines count once; cargo:warning=
    forwarded twins are recognized.
  • emit_daemon_verdict prints a GitHub annotation (::error::INFRA - … on a failing run,
    ::warning:: if it recovered) and appends the same verdict to $GITHUB_STEP_SUMMARY, naming
    ci: merge queue red on the Dell pool — shared soldr daemon drops compile connections (route 7f93f978…) #2178 and stating that a rerun is not the repair.
  • normalized() is extracted so TestEvidence and DaemonDeath share one line normalizer
    (TestEvidence's assertions are unchanged).

Real log from 9d94ad24 through the new classifier:

the shared soldr daemon killed the compile on route soldr-daemon-7f93f9787aa90e99a66b7496369b535c:
3 relay reset(s) (soldr#3377), 2 lost-connection report(s)

This does not repair the red lane — the daemon is soldr's and the host is Zach's call
(FORGE_POOL_LABELS). It makes the failure name itself.

Tests

uv run --no-project python -m unittest ci.test_test_cache_status → 11 tests OK (7 new:
classifier, route extraction, forwarded-warning twin, dedupe, clean log, plus two end-to-end
wiring tests that run the real script against a soldr shim and read back $GITHUB_STEP_SUMMARY).

RED proof: with emit_daemon_verdict(...) removed from main(), the wiring test fails
('::error::INFRA -' not found), so the guard cannot be silently dropped.

Gates, real output:

  • ci/check_python_complexity.py → All checks passed!
  • ci/check_python_types.py → 0 errors, 0 warnings, 0 notes
  • ruff format --check clean; ci.test_gate_script_coverage + ci.test_fractional_workflows →
    42 tests OK (no workflow change, so both invocation contracts are untouched)

#2178 stays open — the lane still needs the daemon restarted or rerouted.

Live proof from PR #2186's own Dell run (job 139429807645, 2026-11-25):
the classifier fired correctly --
  ##[error]INFRA - the shared soldr daemon killed the compile on route
  soldr-daemon-7f93f9787aa...: 1 relay reset(s) (soldr#3377),
  2 lost-connection report(s); not a code failure
-- but "2 lost-connection report(s)" was ONE kill: cargo prints it as the
build script's own `warning: <package>: ...` line and again as the
forwarded `cargo:warning=...` copy. Dedup now compares the event body
(cc-rs's `warning: <package>: ` decoration stripped), so the count states
how many compiles the daemon actually dropped.

Tests: the two real renderings collapse to one; the captured Dell shape
(3 identical relay lines + both lost renderings) reports 1 and 1.
@zackees

zackees commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Production proof that the classifier fires, from this PR's own linux / Check run (job 139429807645, run 45677691790, 8c... head, 2026-11-25T18:47Z on the Dell):

18:47:30 soldr: SESSION relay closed before Exit; ... retrying once (soldr#3377)   x3
18:47:30 warning: [email protected]: zccache-soldr: dispatch failed: ... lost the connection to the soldr daemon
         (route soldr-daemon-7f93f9787aa90e99a66b7496369b535c) after 13.4s: Connection reset by peer
18:49:26 ##[error]INFRA - the shared soldr daemon killed the compile on route soldr-daemon-7f93f9787aa...:
         1 relay reset(s) (soldr#3377), 2 lost-connection report(s); not a code failure
18:49:26 ##[error]Process completed with exit code 101.

Zero test result: FAILED, zero error[E in the whole 2,139-line log; CI selected coverage and CI summary both fail only on LINUX: failure (env LINUX=failure, LINUX_ATTESTED=false). So all three red checks on this PR are the one Dell daemon death — the annotation is doing its job, and the run's job-cpu line reads load=68.01 36.67 22.72 nproc=6.

That run also exposed a counting bug, now fixed in 562b859: cargo prints one kill twice (the build script's own warning: <package>: ... line plus the forwarded cargo:warning=... copy), so the verdict said "2 lost-connection report(s)" for one event. Dedup now compares the event body with cc-rs's decoration stripped; the captured shape reports 1 relay reset(s), 1 lost-connection report(s).

Verification on 562b859: uv run --no-project python -m unittest ci.test_test_cache_status -> 13 tests OK; RED-proof — reverting the dedup to a raw string compare fails both new tests, restoring it passes; ci/check_python_complexity.py -> All checks passed!; ci/check_python_types.py -> 0 errors, 0 warnings, 0 notes; ruff format/ruff check clean; gate-coverage + fractional-workflows -> 42 OK.

#2178 stays open: the unblock is still a daemon restart or gh variable delete FORGE_POOL_LABELS, not code.

@zackees
zackees added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 25, 2026
@zackees
zackees added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 25, 2026
Merge group 45701476278 (pr-2186) captured the hole live: 8 relay resets
and a lost connection from route soldr-daemon-7f93f978..., plus
`test result: FAILED. 5 passed; 1 failed` (lnk_e2e::
lnk_resolver_cache_hit_skips_network_on_second_call over its 15s budget at
avg_cpus=1.31, load=20.67). The daemon verdict still printed
"not a code failure", which would excuse a genuine break on trunk.

emit_daemon_verdict now takes the TestEvidence the wrapper already
collects: when the runner saw its own failed test or a compiler error the
daemon hit is reported as context (route kept, "NOT proven infra"), and the
INFRA summary is not written at all.

Proven RED: with the veto block removed the new wiring test fails on
`assertNotIn("not a code failure")`; all 14 tests pass with it.
@zackees

zackees commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Second commit 0e08e43f — the classifier was over-claiming on trunk, found by the merge group that just ran this branch.

Live evidence (merge group 45701476278, job 139512701906): route soldr-daemon-7f93f978… dropped compiles (10 soldr#3377 relay closes, then lost the connection … Broken pipe), and in the same run the suite reported

test result: FAILED. 5 passed; 1 failed; 3 ignored
lnk_e2e::lnk_resolver_cache_hit_skips_network_on_second_call
  exceeded 15s budget — see #806 audit
job-cpu: avg_cpus=1.31 quota_cpus=6.0 throttled=2553/15780 (16%) load=20.67 nproc=6

The wrapper still printed ##[error]INFRA - … not a code failure. That is a false claim: the failing test is a load-induced wall-clock timeout (1.31 avg cores against a 6-core quota), not a logic break, but the annotation cannot know that — and on a real break it would excuse one.

Fix: emit_daemon_verdict(daemon, returncode, evidence) now consumes the TestEvidence the wrapper already collects. If the runner saw its own test result: FAILED or a compiler error, the daemon hit is still named (route preserved) as context — … the suite also reported a failure of its own, so this is NOT proven infra -- read the failing test — and the INFRA step summary is not written.

Tests: 14 OK (unittest ci.test_test_cache_status). RED proven — removing the veto block fails the new wiring test on assertNotIn("not a code failure"); restoring it passes. check_python_complexity → All checks passed!; check_python_types → 0 errors/0 warnings; ruff format+check clean; gate-coverage + fractional-workflows → 42 OK.

Both merge-group attempts today died on the same Dell route (load=25.96 and 20.67, nproc=6) while this PR's own push run on the same tree passed linux / Check in 20m04s — so the remaining blocker is still #2178/#2179-class infra, not this diff.

The previous commit's veto over-corrected and vetoed itself live: push run
45707669541 (job 139533914957) had only relay resets, a lost connection and
an ordinary cargo `{"reason":"build-finished","success":false}` with a cc-rs
exit 101 -- zero rustc diagnostics, zero failed tests -- yet the annotation
printed "NOT proven infra" instead of naming the daemon route as infra.

Cause: `observe` folded a failed build-finished record into compiler_failed.
That record is the *consequence* of the kill (the build script exits 101), so
treating it as independent evidence made the classification circular.

TestEvidence now tracks `build_failed` separately and only a rustc level=error
diagnostic, `Couldn't compile the test.`, or `test result: FAILED.` vetoes the
infra verdict. `assertion_failure_only` keeps its meaning via `not
build_failed`.

Proven RED: with the old fold restored, both new tests fail
(`assertFalse(result.compiler_failed)` and `assertNotIn("NOT proven infra")`);
17/17 pass with the fix. ruff format+check, C901 and basedpyright clean;
gate-script-coverage + fractional-workflows 42 OK.
@zackees

zackees commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Fourth commit 0ba9dc93: the veto was over-corrected — it vetoed itself.

The push run for 0e08e43f (run 45707669541, linux / Check job 139533914957) went red and printed:

##[error]the shared soldr daemon killed the compile on route soldr-daemon-7f93f978...:
1 relay reset(s) (soldr#3377), 1 lost-connection report(s); the suite also reported a
failure of its own, so this is NOT proven infra -- read the failing test

But there was no failing test and no rustc diagnostic in that job. The only "failure of its own" was cargo's {"reason":"build-finished","success":false} plus error occurred in cc-rs: ... exit status: 101 — which is the daemon kill's own consequence, since the build script exits 101 when the compile is dropped. Reading that record as a compiler failure made the classifier circular: every daemon death vetoes its own classification.

Fix: TestEvidence tracks build_failed separately from compiler_failed. Only a compiler-message with level: error, Couldn't compile the test., or test result: FAILED. vetoes the infra verdict. assertion_failure_only keeps its meaning through not build_failed.

shape before now
relay reset + build-finished:false + cc-rs 101 NOT proven infra (wrong) INFRA - ... + summary
relay reset + test result: FAILED NOT proven infra NOT proven infra
relay reset + compiler-message level=error NOT proven infra NOT proven infra

Real output: unittest ci.test_test_cache_status → 17 tests OK (two new: test_daemon_kill_own_build_failure_is_still_infra through the real wrapper, test_failed_build_record_is_not_a_compiler_failure). RED-proven: restoring the old fold makes both new tests fail (assertFalse(result.compiler_failed) → True is not false; assertNotIn("NOT proven infra")). ruff format + check clean, C901 clean, basedpyright 0 errors, 0 warnings; ci.test_gate_script_coverage + ci.test_fractional_workflows 42 OK.

Why it matters: as shipped in 0e08e43f, every genuine Dell-pool daemon death would have been reported as a possible code break — the exact misreading the PR exists to prevent — so the two directions had to be separated: a test/diagnostic failure is never infra; a dropped compile is never code.

@zackees
zackees added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 25, 2026
@zackees

zackees commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Live confirmation of 0ba9dc93 + merge-group result (merge group 45720569000, job 139577769694).

The push run for 0ba9dc93 went fully green: 17 pass / 0 fail / 1 skipped, linux / Check 23m55s, mergeStateStatus: CLEAN. Enqueued; the merge group died on the Dell route again and the annotation now says exactly the right thing:

##[error]INFRA - the shared soldr daemon killed the compile on route soldr-daemon-7f93f978...:
1 relay reset(s) (soldr#3377), 2 lost-connection report(s); not a code failure

Evidence from that same log: 0 occurrences of test result: FAILED and 0 of error[E (grep over the full 2900-line job log), with avg_cpus=1.71, load=29.25 — a pure dropped-compile job, correctly named infra. So both directions now hold on real data:

  • item 139533914957 (kill only) → INFRA ... not a code failure (was wrongly "NOT proven infra" before this commit)
  • item 139577769694 (kill only, load 29.25) → INFRA ... not a code failure
  • item 139512701906 (kill and a real test result: FAILED) → NOT proven infra -- read the failing test

Merge not attempted again. The queue failure is soldr-daemon-7f93f978... under host load (29.25 on nproc 6 for that runner), which gh run rerun --failed has never repaired (0/9 historically), so a re-enqueue would only spend another ~25 min of the same pool. #2178 needs an owner action: restart the shared daemon or reroute the lane via vars.FORGE_POOL_LABELS. The PR itself is green and clean — nothing further to change in the diff.

@zackees
zackees added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 8ec6611 Nov 26, 2026
31 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 26, 2026
@zackees zackees mentioned this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant