Skip to content

fix(ci,#8915): make lake + navlink gates self-diagnosing (tee+grep on failure, drop --quiet) - #8918

Closed
jsboige wants to merge 3 commits into
mainfrom
fix/ci-gate-silent-diagnostic-8915
Closed

jsboige wants to merge 3 commits into
mainfrom
fix/ci-gate-silent-diagnostic-8915

Conversation

@jsboige

@jsboige jsboige commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Grain: MED/guard — lane myia-po-2026:CoursIA — prev: MED/qc (#8916)

Summary

One principle, three sites: a gate that fails must say why. Today three CI gates fail with exit 1 and no diagnostic — the first reader must reproduce locally to learn what broke. This is the defect I paid on #8895 (I had to DM ai-01 to run lake build Conway.Life.GridCanonical on a hot machine to get one line the CI had produced then thrown away). #8915 formalized it + found the mechanism (truncation, not stderr).

Site Before After
lean-build.yml:190 lake -R build 2>&1 | tail -20 tee full log → tail -20 nominal; on failure, grep error lines + exit $rc
lean-axiom.yml:93 lake -R build 2>&1 | tail -10 same self-diagnosing pipeline
notebook-navlink-check.yml:28 ... --check --quiet (no output) --check only (mirrors docs-link-check.yml:20-22); header fixed

Lake builds in parallel and continues after a module failure, so an early File.lean:L:C: error: gets pushed ~8000 lines up, out of any tail window — the gate names the target (Some required targets logged failures: - Conway.Life.GridCanonical) but never the error. The fix tees the full log and greps the error lines into a ::group:: block only on failure; the nominal path keeps the short tail summary (no added noise).

The 2026-06-14 invariant is preserved (proven, not assumed)

The | tail exists for a reason: set -o pipefail was added because without it tail returns 0 and a FAILED build masked as CI PASS (incident HashlifeCorrectness L1058). The new pipeline keeps that guarantee:

set -o pipefail
if lake -R build 2>&1 | tee "$RUNNER_TEMP/lake.log" | tail -20; then :
else
  rc=$?                                      # $? = the condition's exit (no intervening cmd)
  grep -nE "^error:|\.lean:[0-9]+:[0-9]+: (error|warning)" "$RUNNER_TEMP/lake.log" | head -100 || true
  exit "$rc"                                 # re-emit lake's non-zero -> step still FAILS
fi

pipefail makes the pipeline return lake's non-zero exit; the else-branch $? captures it (the : is in the untaken then-branch). Proven by execution, two ways (acceptance criterion: "ne pas se contenter du raisonnement sur pipefail"):

  1. Mock burying scenario (pipefail_proof.sh): a mock lake emits an error on line 1, then 8000 progress lines, then error: build failed, exit 1.
    • Current pipeline: exit=1 (pipefail propagates ✓) — but the error: line is ~8000 lines above the tail -20 window → diagnostic LOST (the defect reproduced).
    • Proposed pipeline: grep recovers 1:...GridCanonical.lean:42:11: error: unknown identifier 'foo' + 8004:error: build failed, exit=1 → error recovered + step fails ✓.
    • Nominal path: success → output stays tail -20 only, no added noise ✓.
  2. Real lake (minimal throwaway project, broken module): lake emits error: ...lakefile.lean:L:C: ... — the grep regex \.lean:[0-9]+:[0-9]+: (error|warning) matches lake's actual format (recovered at log line 1), exit=1 propagates. (The local rc1 toolchain is incomplete per MEMORY.md c.449, so the throwaway hit a lakefile-parse error rather than reaching my intended module — but that still validates the regex against real lake output + the exit propagation; the burying scenario is what the mock covers.)

Acceptance criteria

  • A failed Lean build surfaces the File.lean:L:C: error: line in the CI log (grep recovery, proven on mock + real lake).
  • Non-regression of the 2026-06-14 invariant: a FAILED build still fails the step (exit != 0) — proven by execution (mock exit=1, real lake exit=1).
  • A failed navlink lists source:line -> target per broken link (drops --quiet; checker already prints these without --quiet, per docs-link-check.yml rationale).
  • Nominal (success) path gains no noise — proven (mock nominal path = tail summary only).
  • notebook-navlink-check.yml header describes what the file actually does (fixed L4-7 + L31 — no longer claims the reversed --quiet convention).

Verification

  • YAML valid for all 3 files (yaml.safe_load → jobs parsed).
  • navlink run: line confirmed --check only (the 3 remaining "quiet" strings are explanatory comments).
  • Both lakes carry the tee "$RUNNER_TEMP/lake.log" + grep + exit $rc pipeline.

Base / method

Fresh base 87da50c76f. Local git fetch broken (invalid index-pack, C: 99% full) → delivered via GitHub contents/git-refs API relay (byte-content PUT; cf #8908/#8916).

Closes #8915.

🤖 Generated with Claude Code

jsboige added 3 commits July 30, 2026 05:10
…g + grep errors on failure; drop navlink --quiet): notebook-navlink-check.yml
…g + grep errors on failure; drop navlink --quiet): lean-build.yml
…g + grep errors on failure; drop navlink --quiet): lean-axiom.yml
@jsboige

jsboige commented Jul 30, 2026

Copy link
Copy Markdown
Owner Author

Closing as duplicate of #8917 (po-2023).

Collision resolution — po-203 has chronological priority. #8915 was [CLAIMED] by po-2023 at 02:58:51Z (c.966); I claimed it at 03:02:14Z (c.800) ~3.5 min later, missing the earlier claim. po-203 shipped #8917 first and it's CLEAN/MERGEABLE with the same fix (tee full log + grep error lines on failure + exit $rc, preserves the 2026-06-14 invariant, drops navlink --quiet) — empirically proven too.

Disposing my own PR to avoid wasting ai-01's review on two identical gates. po-203's #8917 also acknowledged transparently that #8915 suggested my lane (I paid the defect on #8895) but was non-claimed when po-203 scanned. No hard feelings — the defect gets fixed either way, and #8917 carries a bonus worktree-hygiene cleanup.

Lesson for me: re-read the dashboard intercom for [CLAIMED] tags right before claiming, not just gh pr list (which shows PRs, not pre-PR claims).

@jsboige

jsboige commented Jul 30, 2026

Copy link
Copy Markdown
Owner Author

Disposed as duplicate of #8917 (po-203 chronological priority). See comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: trois gates echouent sans emettre leur diagnostic (lake tronque a tail -10/-20, navlinks en --quiet)

1 participant