Skip to content

mergeReadinessGateMode's doc comment claims it overrides quality/readiness, but applyMergeReadinessGate never touches it #7242

Description

@JSONbored

Context

packages/loopover-engine/src/advisory/gate-advisory.ts:73-75 documents mergeReadinessGateMode as:

Master "merge-readiness" composite (#551). When set (advisory/block) it OVERRIDES all four sub-gates — linked-issue, duplicate, quality/readiness, slop — to its mode, so a maintainer flips ONE switch instead of four...

The actual implementation, applyMergeReadinessGate (gate-advisory.ts:657-666), only escalates three sub-gates:

function applyMergeReadinessGate(policy: GateCheckPolicy): GateCheckPolicy {
  const composite = gateMode(policy.mergeReadinessGateMode ?? "off");
  if (composite === "off") return policy;
  return {
    ...policy,
    linkedIssueGateMode: composite,
    duplicatePrGateMode: composite,
    slopGateMode: composite,
  };
}

qualityGateMode (readiness) is never touched. This isn't an oversight in the code — the call site's own inline comment (gate-advisory.ts:467-468) correctly documents the real behavior: "Merge-readiness composite (#551): when set, escalate enforceable sub-gates to its mode... Readiness/quality stays advisory-only." So the code and the call-site comment agree with each other, but the field-level doc comment on mergeReadinessGateMode (lines 73-75) is stale/wrong — it still claims a fourth sub-gate ("quality/readiness") that was deliberately never wired into the composite (buildQualityGateWarning structurally can only ever produce a warning, never a blocker).

A maintainer reading only the field doc (the type is the public consumer-facing contract of this package) would reasonably expect setting mergeReadinessGateMode: "block" to make a low-readiness-score PR a hard blocker. It does not, and there is no code path that would ever make it one.

Requirements

  • Fix the doc comment on mergeReadinessGateMode in packages/loopover-engine/src/advisory/gate-advisory.ts (around line 73-75) so it accurately lists only the three sub-gates the composite actually escalates: linked-issue, duplicate, slop.
  • The doc comment must explicitly state that quality/readiness is NOT part of the composite and always stays advisory-only, matching applyMergeReadinessGate's real behavior and the correct call-site comment already in the file (gate-advisory.ts:467-468).
  • Do not change applyMergeReadinessGate's behavior — this is a documentation-only fix. If, after reading the code, you believe readiness/quality genuinely should be folded into the composite as a behavior change, do not make that change here — comment on this issue instead so a maintainer can decide; this issue's scope is the doc/comment mismatch only.

Deliverables

  • Corrected doc comment on mergeReadinessGateMode in gate-advisory.ts describing exactly the three sub-gates it overrides
  • A regression test in the existing gate-advisory test suite that asserts applyMergeReadinessGate with mergeReadinessGateMode: "block" does NOT change qualityGateMode, locking in the documented (and actual) behavior so a future edit can't silently reintroduce the mismatch

Test Coverage Requirements

This repo's Codecov patch gate is 99%+ hard (branch-counted) on every changed line/branch in src/**/packages/**. Add the regression test described above; a pure doc-comment change plus one assertion should trivially clear the gate.

Expected Outcome

A maintainer reading mergeReadinessGateMode's doc comment gets an accurate description of what the composite gate actually does — no false expectation that a low readiness/quality score can become a hard merge blocker via this switch.

Links & Resources

packages/loopover-engine/src/advisory/gate-advisory.ts:73-75 (the stale doc), :657-666 (applyMergeReadinessGate, the real behavior), :467-468 (the correct call-site comment to match).

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:bugGittensor-scored bug fix — scores a 0.05x multiplier.help wantedExtra attention is needed

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions