Skip to content

fix(engine): correct mergeReadinessGateMode doc comment's sub-gate count#7288

Merged
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
galuis116:fix/merge-readiness-gate-doc-comment-7242-v2
Jul 19, 2026
Merged

fix(engine): correct mergeReadinessGateMode doc comment's sub-gate count#7288
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
galuis116:fix/merge-readiness-gate-doc-comment-7242-v2

Conversation

@galuis116

Copy link
Copy Markdown
Contributor

Summary

  • GateCheckPolicy.mergeReadinessGateMode's doc comment (packages/loopover-engine/src/advisory/gate-advisory.ts) claimed the merge-readiness composite (feat(github-app): merge-readiness aggregate gate #551) overrides four sub-gates when set: linked-issue, duplicate, quality/readiness, and slop. applyMergeReadinessGate (same file) only ever escalates three — linked-issue, duplicate, slop. Quality/readiness findings come from buildQualityGateWarning, which can only ever produce an advisory warnings entry, never a blockers entry, regardless of any gate mode — so it always stays advisory-only.
  • Corrected the doc comment to list the three sub-gates that are actually escalated and added a sentence explaining why quality/readiness is deliberately excluded from the composite.
  • src/rules/advisory.ts (the hand-duplicated host twin of the engine file, per scripts/check-engine-parity.ts's GATE_DECISION_TWIN_PAIR) carried the identical incorrect claim on its own mergeReadinessGateMode field — its own applyMergeReadinessGate function a few lines below already states "Readiness/quality is intentionally excluded" in a code comment, directly contradicting the field's doc comment above it. Mirrored the same correction there.
  • Checked the twin field in src/types.ts (mergeReadinessGateMode: GateRuleMode, line 881) — its doc comment is terse ("Merge-readiness gate (#merge-readiness). off/advisory/block. No min-score. Default off.") but doesn't make the same incorrect claim, so it needed no change.
  • Added a regression test in test/unit/gate-check-policy.test.ts's describe("merge-readiness composite gate (#551)", ...) block asserting slop escalates into a hard blocker under mergeReadinessGateMode: "block" — the block already had dedicated tests for linked-issue and duplicate escalation (and for quality/readiness staying advisory-only), but not slop.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves.

Closes #7242

Validation

  • git diff --check — clean.
  • npm run actionlint — clean.
  • npm run typecheck — the whole-repo tsc --noEmit reliably OOMs on this shared, memory-constrained sandbox regardless of diff size (documented pattern from prior PRs in this repo's history). Verified instead with: (1) tsc --noEmit -p packages/loopover-engine/tsconfig.json — the whole loopover-engine workspace package (small enough to avoid the OOM), clean; (2) a standalone scoped tsc --noEmit against src/rules/advisory.ts and the changed test files using this project's exact root tsconfig.json compiler options (--strict --exactOptionalPropertyTypes --noUncheckedIndexedAccess --noImplicitOverride --noFallthroughCasesInSwitch --forceConsistentCasingInFileNames), clean.
  • npx vitest run test/unit/gate-check-policy.test.ts test/unit/check-engine-parity-script.test.ts — 155/155 passing, including the new slop-escalation regression test and the full engine-parity suite.
  • Comment-only change to both non-test files; the test file addition is fully covered by the new test itself. packages/loopover-engine/**, src/rules/**, and test/** don't add any new logic paths — no coverage delta beyond the new test's own assertions.
  • npm run test:workers / npm run build:mcp / npm run test:mcp-pack / npm run ui:openapi:check (not applicable — no Worker route, MCP, UI, or OpenAPI surface changed)
  • npm audit --audit-level=moderate (no dependency changes)

If any required check was skipped, explain why:

  • The whole-repo npm run typecheck OOMs on this specific sandbox under current memory pressure regardless of diff size; the two scoped tsc --noEmit checks above (full package + exact-flags scoped check) are the local proxy, and CI's isolated runner performs the real whole-repo tsc --noEmit.
  • A first push of this PR (from a branch touching only the packages/loopover-engine side) was closed by CI: scripts/check-engine-parity.ts's checkGateDecisionVersionBump tripwire (test/unit/check-engine-parity-script.test.ts) requires a single-sided edit to either of the GATE_DECISION_TWIN_PAIR files (src/rules/advisory.ts / packages/loopover-engine/src/advisory/gate-advisory.ts) to be matched by an edit to the other twin, or a packages/loopover-engine/package.json version bump — my scoped local verification only ran the engine-package tsc build and the directly-relevant unit test file, and didn't include this repo-wide drift-tripwire test, so it missed the failure CI's full suite caught. Root-caused and fixed by mirroring the same doc-comment correction into src/rules/advisory.ts (a genuine fix, not a workaround — that file had the identical incorrect claim), then re-verified via check-engine-parity-script.test.ts's full 38-test suite locally — clean.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A — doc-comment fix + a pure gate-evaluation unit test; no auth/cookie/CORS/session changes.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A — no route, schema, or MCP behavior changed; this is a comment correction plus test coverage for existing, unchanged runtime behavior.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A — no UI changes.)
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots. (N/A — no UI changes.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

The doc comment claimed the merge-readiness composite overrides four
sub-gates (linked-issue, duplicate, quality/readiness, slop), but
applyMergeReadinessGate only ever escalates three (linked-issue,
duplicate, slop) — buildQualityGateWarning can only ever produce an
advisory warning, never a blocker, so quality/readiness always stays
advisory-only regardless of this field's mode.

Closes JSONbored#7242
…host twin

src/rules/advisory.ts's mergeReadinessGateMode field carried the same
incorrect claim as its packages/loopover-engine twin (that the
composite overrides all four sub-gates including quality/readiness),
which contradicts applyMergeReadinessGate's own inline comment a few
lines below stating quality/readiness is deliberately excluded.
@galuis116
galuis116 requested a review from JSONbored as a code owner July 19, 2026 12:43
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.81%. Comparing base (2372739) to head (3224c96).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7288   +/-   ##
=======================================
  Coverage   93.81%   93.81%           
=======================================
  Files         704      704           
  Lines       69462    69462           
  Branches    18896    18896           
=======================================
  Hits        65167    65167           
  Misses       3302     3302           
  Partials      993      993           
Flag Coverage Δ
shard-1 43.61% <ø> (ø)
shard-2 37.34% <ø> (ø)
shard-3 33.18% <ø> (+0.13%) ⬆️
shard-4 33.74% <ø> (-0.57%) ⬇️
shard-5 32.89% <ø> (+0.70%) ⬆️
shard-6 45.49% <ø> (-0.30%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ages/loopover-engine/src/advisory/gate-advisory.ts 98.75% <ø> (ø)
src/rules/advisory.ts 97.77% <ø> (ø)

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 19, 2026
@loopover-orb

loopover-orb Bot commented Jul 19, 2026

Copy link
Copy Markdown

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-19 12:52:33 UTC

3 files · 1 AI reviewer · no blockers · readiness 88/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a pure doc-comment correction: the mergeReadinessGateMode field's comment incorrectly claimed the composite gate overrides four sub-gates (including quality/readiness), when applyMergeReadinessGate only ever escalates three (linked-issue, duplicate, slop) — quality/readiness is sourced from buildQualityGateWarning, which per the PR description can only ever populate warnings, never blockers. The fix is mirrored correctly across both the engine file and its hand-duplicated host twin in src/rules/advisory.ts, keeping them in sync per the stated parity convention. A regression test is added for slop escalation, closing a previously untested sub-gate combination in the same describe block.

Nits — 3 non-blocking
  • packages/loopover-engine/src/advisory/gate-advisory.ts:72 and src/rules/advisory.ts:72 still use 'Master' to describe the composite gate — consider 'primary' or 'top-level' for more neutral terminology.
  • The new test's comment in test/unit/gate-check-policy.test.ts explains the describe block's overall coverage rather than the specific assertion — fine, but slightly unusual for a per-test comment.
  • Consider a lint/parity check that fails when the two hand-duplicated doc comments in gate-advisory.ts and advisory.ts drift, similar to check-engine-parity.ts, to prevent this exact class of doc/behavior mismatch recurring.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7242
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ❌ 8/20 High review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 1953 registered-repo PR(s), 1282 merged, 51 issue(s).
Contributor context ✅ Confirmed Gittensor contributor galuis116; Gittensor profile; 1953 PR(s), 51 issue(s).
Improvement ✅ Minor risk: clean · value: minor · LLM: minor
Linked issue satisfaction

Addressed
The PR corrects the stale doc comment on mergeReadinessGateMode to list only the three actually-escalated sub-gates (linked-issue, duplicate, slop) and explicitly states quality/readiness remains advisory-only, matching applyMergeReadinessGate's real behavior; it also adds the requested regression test for slop escalation without altering the function's behavior.

Review context
  • Author: galuis116
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: JavaScript, Python, Dart, TypeScript, HTML, MDX, Rust, C++
  • Official Gittensor activity: 1953 PR(s), 51 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Add a concise scope and risk note.
  • Then work through the remaining 1 step in the Signals table above.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.

  • @loopover ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

Full command reference: https://loopover.ai/docs/loopover-commands

🧪 Experimental — new and may change.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.

  • Re-run LoopOver review

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 341798a into JSONbored:main Jul 19, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant