Skip to content

audit the self-tests chained in check:merge-driver for the verdict/exit-code split — a callee that reports failure by return false alone prints ✗ and exits 0 #18166

Description

@claude

Filed by the domain:devx execution seat as the successor for an out_of_scope_findings entry returned by #17602's dev (report on #17602; PR #18165). ⛔ Unlabelled for domain:* and ungraded — triage's to route and grade. ⛔ The seat did not dedupe; dedupe words are at the bottom.

The defect class, proven live once

PR #18165 fixes a real instance in scripts/git-merge-regen.mjs: the --self-test dispatch printed its failure verdict —

✗ merge driver wiring is inconsistent — N failure(s)

— and exited 0, because the exit code was set only inside fail(), while the verdict LINE is printed from a count of returned booleans. Every callee happened to call fail(), so the split was invisible until a new callee reported a failure by returning false alone. The repair sets the code from the same count the verdict is printed from:

if (failures > 0) process.exitCode = 1;

⚠️ Why it matters beyond cosmetics: pnpm check:merge-driver chains these files with &&, so a zero from any one of them is the gate passing. A callee in that state makes the whole battery advisory without saying so — the #13799 shape ("a battery that never ran is indistinguishable from one that passed"), one level in.

What is unaudited

The sibling self-tests chained beside it in check:merge-driver were not audited for the same split:

  • scripts/git-env.mjs
  • scripts/check-regen-pending.mjs

Neither is known to have the defect — this card is an audit, not a bug report against them. ⛔ Do not write a PR body claiming they are broken before measuring.

Suggested shape of the answer

Per-file, the question is mechanical: is there any path on which the dispatch prints a failing verdict (or counts a failure) while process.exitCode stays 0? The decisive reading is an ablation per file — regress one callee to report failure by return false alone, run the dispatch, read the exit code, not the output.

⭐ If the answer is "the split is possible in more than one of them", the better fix is one shared verdict/exit helper rather than three copies of if (failures > 0) — but ⛔ that is a judgement for whoever takes it, on measurements, not a prescription from this card.

Acceptance

  1. Each chained file in check:merge-driver is either shown immune (with a firing control — an ablation that does produce a non-zero exit, so the reading discriminates) or repaired.
  2. ⛔ No gate weakened, no exemption added: every change here can only turn a previously-green-but-failing run red.
  3. State the population — which files check:merge-driver actually chains, re-derived from the script, ⛔ not copied from this card. This card's list is a hint, not a reading.

Dedupe words

check:merge-driver · verdict exit code · self-test exits 0 · assertion floor · advisory battery

⚠️ Related but ⛔ not asserted as duplicates: #13799 (the assertion-floor population, domain:devx, p2) is the parent class and may already cover this; #16717 records check:merge-driver staying red on macOS for unrelated reasons. Check both before grading.


Generated by Claude Code

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions