Skip to content

fix: Auto-detected flaky tests (merge-group) — review for quarantine (#2730) - #2774

Draft
zaxbysauce wants to merge 1 commit into
mainfrom
auto-fix/issue-2730-auto-detected-flaky-tests-merg-1c8d4f
Draft

zaxbysauce wants to merge 1 commit into
mainfrom
auto-fix/issue-2730-auto-detected-flaky-tests-merg-1c8d4f

Conversation

@zaxbysauce

@zaxbysauce zaxbysauce commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Closes #2730

Summary

Scope: Adds three quarantine ledger entries for the issue #2730 merge-group flake candidates (two macOS-only, one general-ledger for the ubuntu-only coverage job), with OWNER/EXPIRY metadata and a 14-test pinning regression file.

|Verdict: APPROVE
|
|### Findings
|
|#### LOW — Per-shard flake attribution is narrative-only
|- Location: scripts/ci/quarantined-tests-macos.txt:26-41, scripts/ci/quarantined-tests.txt:15-45
|- Evidence: The single-OS evidence claims (macos shard 1 retry-pass, macos shard 5 double-fail, ubuntu coverage-shard 3 retry-pass) come from CI run 34670762927 artifacts that cannot be re-verified from the diff.
|- Why it matters: If an attribution were wrong, the entry could over-suppress (file quarantined on all OSes when only one flakes) or under-suppress (re-filing on the next run).
|- Suggested fix: None required now — the Check 7-enforced EXPIRY (2026-10-14) forces re-review, and detection Rule A stops re-filing as long as the path is in any ledger. If a future run shows cross-OS evidence, move the entries to the general ledger per the documented precedent.
|
|### What I Checked
|- Target file present in diff: yes (scripts/ci/quarantined-tests.txt, scripts/ci/quarantined-tests-macos.txt — the files the issue's "append each line" instruction names)
|- New/updated test exercises the changed code path: yes — reads the real ledger files off disk and asserts the new entries plus no-duplicate invariants (tests/unit/scripts/ci/ci-yml-quarantine-2730.test.ts:53-287); verified 14/14 pass against the post-change tree
|- Scope creep beyond the issue: no — ledgers + pinning test + release fragment only; no source/workflow/script changes
|- Ledger placement mechanism verified: ci.yml reads macOS ledger only on macOS runners (.github/workflows/ci.yml:632); coverage gate reads only the general ledger (scripts/ci/run-coverage-gate.sh:85,111) — init-rehome entry is in the only ledger the coverage job honors
|- Fourth issue candidate (#2675) correctly not duplicated: already quarantined by #2738 in the macOS ledger; detection Rule A drops it
|- Pre-existing ledger-reader tests unaffected: ci-yml-windows-quarantine.test.ts, ci-coverage-sharding.test.ts, check-quarantine-metadata.test.ts (fixture-based) — all pass against the real post-change ledgers
|- Check 7 metadata grammar: ran checkQuarantineMetadata on the real repo — 0 violations; EXPIRYs future-dated and inside grace
|- Anti-patterns scanned: silent-except, mock-without-call, off-by-one, signature-break, scope-creep, stale-docs — none found; fragment's cited assertion text and test count verified against source
|
|### Confidence
|high — the change is additive to data files consumed by well-understood gates; every gate that reads these ledgers was either run or read directly, and the only unverifiable claim (per-shard attribution) is bounded by the enforced EXPIRY.

Invariant audit

  • No engineering invariants were identified as touched by this diff; the change is confined to docs/releases/pending/issue-2730-three-merge-group-flaky-tests-quarantine.md, scripts/ci/quarantined-tests-macos.txt, scripts/ci/quarantined-tests.txt, tests/unit/scripts/ci/ci-yml-quarantine-2730.test.ts

Test plan

See the linked issue and the change summary.

Review in cubic

Quarantine the three new candidates auto-filed by issue #2730's
merge-group flake-detection run (CI run 34670762927, head 1499a74,
2026-09-12T04:27:48Z → 04:34:14Z):

  tests/unit/telemetry/init-rehome.test.ts
    → scripts/ci/quarantined-tests.txt (general ledger)
    Ubuntu-latest coverage-shard 3 only, 2026-09-12T04:04:09Z:
    Attempt 1 failed → Passed on retry 1 (passed-on-retry flake).
    Sibling coverage-shards 1/2/4/5/6 green. Coverage runs ubuntu-only
    and honors ONLY the general ledger
    (scripts/ci/run-coverage-gate.sh:85,111 never branches per-OS).

  tests/unit/hooks/pr-feedback-scope-controller.test.ts
    → scripts/ci/quarantined-tests-macos.txt (macOS ledger)
    macos-latest unit-shard 1 only, 2026-09-12T03:56:04Z:
    Attempt 1 failed → Passed on retry 1 (passed-on-retry flake).
    Sibling macos shards 2/4/5/6, all ubuntu shards 1-4, all windows
    shards 2/3/4/6 green or did not run the file (round-robin).

  tests/unit/utils/bun-compat-exit-first-2530.test.ts
    → scripts/ci/quarantined-tests-macos.txt (macOS ledger)
    macos-latest unit-shard 5 only, 2026-09-12T03:57:26Z:
    Attempt 1 failed → Attempt 2 failed → ::error file=...::FAILED
    (hard failure, both retries exhausted). Failing cell is
    `native Bun reports bounded output overflow and terminates the
    child` at
    tests/unit/utils/bun-compat-exit-first-2530.test.ts:450-454:
    `expect(receipt.exitCode !== 0 || receipt.signalCode !== null)
    .toBe(true)` fails because native Bun on macos-latest returns
    both exitCode 0 and signalCode null after the bounded-output
    termination path. Sibling macos shards 1/2/4/6 and all
    ubuntu/windows shards green or did not run the file.

Each new entry carries the structured # OWNER: / # EXPIRY: metadata
required by scripts/check-invariants.ts Check 7 (issue #2477).
EXPIRY 2026-10-14 is 30 days out, well inside the 14-day grace
window so the gate warns rather than fails.

The fourth candidate listed in the issue body
(tests/unit/scripts/ci/repository-validation-real-process-2675.test.ts)
is already quarantined in scripts/ci/quarantined-tests-macos.txt by
issue #2738 (commit ad8c53a, 2026-09-12). Re-listing it in any
other ledger would be a silent no-op for the detection script's
Rule A and a confusing cross-ledger duplicate for triage; the new
pinning test asserts the path stays in the macOS ledger (the
existing #2738 entry) and is not duplicated.

Adds a 14-test pinning regression file
(tests/unit/scripts/ci/ci-yml-quarantine-2730.test.ts) covering all
three new entries (ledger placement, scope isolation, OWNER/EXPIRY
metadata, on-disk path presence) plus the no-duplicate invariant
for the #2738 entry. RED check performed: with the ledger entries
reverted, the new file fails exactly its 6 ledger/metadata
assertions (8 pass / 6 fail); green at HEAD (14 pass / 0 fail).
Tests pass locally on this checkout (21/21 quarantined cases pass in
~5.7s on TMPDIR=~/.cache/hermes-tmp).

Includes the mandated pending release fragment
(docs/releases/pending/issue-2730-three-merge-group-flaky-tests-quarantine.md)
covering What changed / Why / Migration steps / Known caveats.
Every file path, identifier, and line number cited in the fragment
was verified against the codebase before commit.

Refs: #2730 (this issue), #1782 (flake-detection workflow),
#2477 (OWNER/EXPIRY metadata grammar enforced by Check 7),
#2738 (the pre-existing #2675 macOS-ledger entry this PR defers to),
#2368 (precedent for coverage-shard general-ledger quarantine),
#1908 (general-ledger retirement precedent).
@zaxbysauce zaxbysauce added the auto-fix-attempt Auto-generated PR from the auto-fix-issue skill (autonomous cron-driven fix; awaiting human review). label Sep 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Drift check report

Found 2 drift finding(s): 0 error, 0 warning, 2 notice.

required-check-contract (2)

  • 🔵 notice scripts/required-check-contract.json: [RULESET_DIVERGENCE] intended-required context "drift" is not yet required by the captured ruleset
  • 🔵 notice scripts/required-check-contract.json: [RULESET_DIVERGENCE] intended-required context "drift" is not present for every expected event in captured external workflow evidence

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The general-ledger header comment now contradicts the entry it adds, and the release fragment misuses "grace window," so both documentation inaccuracies should be corrected before approval.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR resolves issue #2730 by quarantining three merge-group flaky tests detected during CI run 34670762927. It adds the flaky test paths to the appropriate CI quarantine ledgers with the mandatory OWNER/EXPIRY metadata blocks (enforced by check-invariants Check 7), and pins the placement with a new regression test. The fourth candidate from the issue body (repository-validation-real-process-2675) is deliberately not re-added because it is already quarantined via issue #2738.

Changes:

  • Add two macOS-only entries (pr-feedback-scope-controller, bun-compat-exit-first-2530) to quarantined-tests-macos.txt and one general entry (init-rehome) to quarantined-tests.txt, each with OWNER/EXPIRY (2026-10-14) metadata; the general-ledger target is correct because the ubuntu-only coverage gate reads only that ledger.
  • Add a 14-test pinning regression file asserting ledger placement, scope isolation, metadata presence, on-disk path existence, and the no-duplicate invariant for the #2738-owned path.
  • Add a pending release fragment documenting the rationale and per-shard evidence.
File summaries
File Description
scripts/ci/quarantined-tests.txt Adds the init-rehome general-ledger entry; header comment now contradicts the added entry.
scripts/ci/quarantined-tests-macos.txt Adds two macOS-only entries with valid OWNER/EXPIRY blocks placed correctly for Check 7.
tests/unit/scripts/ci/ci-yml-quarantine-2730.test.ts New pinning test (14 tests) reading the real ledgers to assert placement/scope/metadata.
docs/releases/pending/issue-2730-three-merge-group-flaky-tests-quarantine.md Release fragment; "grace window" wording in Known caveats mischaracterizes Check 7.
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

created).
- **`scripts/check-invariants.ts` Check 7** hard-fails any quarantine
entry whose `# EXPIRY:` lapses beyond the 14-day grace window. The
EXPIRYs below are set inside the grace window (30 days out); if the
Comment on lines +14 to +15
# No active global test quarantines. Issue #1908 retired the tracked backlog;
# (post-#1908 entries live below).
@zaxbysauce

Copy link
Copy Markdown
Collaborator Author

Swarm PR Review — #2774

Scope: 37ee0ce8..4199ba65 (4 files, +539/-2): two CI quarantine-ledger data files, one new pinning regression test (287 lines / 14 assertions), one release-notes fragment. No production source code changed.

Methodology

Reviewed at exact PR head 4199ba657. 3 consolidated explorer lanes covered all 6 review dimensions (intent-architecture, correctness-state, tests-falsifiability, security-trust, reliability-performance, compatibility-delivery) plus the 11 repository-agnostic risk families (5 MATCHED and independently evaluated: dependencies-build-release, generated-provenance, privacy-observability, test-infrastructure, unclassified-risk; 6 NOT_TRIGGERED with absence evidence given the diff touches no source/auth/concurrency/schema/UI code). The single candidate finding was routed to an independent reviewer (opus) for validation — the discovering context never self-approved it.

PR claim-integrity check

The PR body embeds an auto-generated "cubic" bot review claiming APPROVE with specific numeric claims (14/14 tests, 0 Check-7 violations, specific line numbers). These were treated as claims, not proof, and independently re-verified:

  • tests/unit/scripts/ci/ci-yml-quarantine-2730.test.ts genuinely contains 14 test cases; bun test on it returns 14 pass / 0 fail.
  • bun run scripts/check-invariants.ts (Check 7 — OWNER/EXPIRY metadata grammar) returns 0 violations against the real post-change ledgers.
  • ✅ All 3 quarantined test files exist on disk at the claimed paths; per-file test counts cited in ledger comments (8, 8, 5) match actual grep -c 'test(' counts.
  • ✅ Every per-shard flake claim (macOS shard 1 retry-pass, macOS shard 5 double-fail, ubuntu coverage-shard 3 retry-pass, including the exact cited assertion text and line numbers) was verified against live CI job logs for run 34670762927 (jobs unit (macos-latest,1), unit (macos-latest,5), coverage-shard(3)) — all matched exactly.
  • tests/unit/scripts/ci/repository-validation-real-process-2675.test.ts (issue [Workstream C] PR 08 of 09: Make full repository validation reproducible and truthfully bounded #2675, the 4th candidate from Auto-detected flaky tests (merge-group) — review for quarantine #2730's body) is correctly not re-added — already quarantined via issue repository-validation-real-process-2675 signal test fails deterministically on macos-latest runners (blocks all PR unit matrices) #2738/commit ad8c53ae3; the new pinning test explicitly guards against this duplication.
  • ✅ Ledger-consumption mechanism verified directly in .github/workflows/ci.yml: exact full-path line matching via comm -23 on sorted paths (not substring/regex), macOS/Windows ledgers gated per-RUNNER_OS, general ledger read unconditionally (including by the ubuntu-only run-coverage-gate.sh, which never branches per-OS).
  • ✅ PR authored by third-party automation (Hermes Agent <agent@hermes-agent.nousresearch.com>) on behalf of the human PR owner; every factual claim traced back to verifiable primary evidence (CI logs, source), not opaque/unfalsifiable.

Finding

C1 — LOW→INFO (reclassified PRE_EXISTING) — reliability-performance

  • Claim: Adding init-rehome.test.ts to the general ledger (required because the ubuntu-only coverage job only reads that ledger) also silently suppresses that file on macOS/Windows unit-job runs, beyond the single-OS (ubuntu coverage-shard-3) flake evidence cited.
  • Independent reviewer verdict: PRE_EXISTING. ci.yml is not part of this PR's diff (last touched pre-merge-base) and run-coverage-gate.sh has zero RUNNER_OS branches — so this cross-OS suppression is inherent, pre-existing two-ledger architecture that every general-ledger entry has always been subject to; the PR doesn't introduce or worsen it, and there is no alternative ledger placement that would avoid it. Mitigated by a bounded 30-day EXPIRY gate (Check 7-enforced) and a documented rationale in the release fragment.
  • Non-blocking nit: the release fragment's caveat (lines ~141-147) explains the general-ledger placement in terms of the coverage job's needs but doesn't explicitly spell out the unit-job cross-OS side effect. A one-clause addition would make the disclosure fully self-describing — optional polish, not required for merge.

No other findings. No CRITICAL, HIGH, or MEDIUM issues. No pre-existing issues surfaced beyond the above. No test/coverage gaps identified — the new pinning test is real, specific, read-only, and deterministic (no test-theater, no timing dependence).

Verdict: APPROVE

Additive, low-risk, well-evidenced CI-hygiene change. All PR-body claims independently verified rather than trusted. The only candidate finding describes pre-existing CI architecture, not a defect introduced by this PR.


🤖 Generated with Claude Code — swarm-pr-review (Profile B, depth tier M)

https://claude.ai/code/session_01QR9dSFaEPAKuiLwoLgQhim

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

Labels

auto-fix-attempt Auto-generated PR from the auto-fix-issue skill (autonomous cron-driven fix; awaiting human review).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-detected flaky tests (merge-group) — review for quarantine

2 participants