Skip to content

fix(engine): predicted-gate's linked-issue extractor truncates instead of mirroring the maintainer gate's overflow hard-fail #8868

Description

@JSONbored

⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.

Context

packages/loopover-engine/src/signals/predicted-gate-engine.ts's extractLinkedIssueNumbers (lines 920-961, used at line 365) only replicates the maintainer-side gate's numeric cap (.slice(0, MAX_LINKED_ISSUE_NUMBERS)), with no overflow signal anywhere. The maintainer-side gate hard-fails a PR with 51+ distinct linked-issue references (src/db/repositories.ts's extractLinkedIssueNumbersWithOverflow and src/review/linked-issue-hard-rules.ts's resolveLinkedIssueHardRule). test/unit/predicted-gate-engine.test.ts:341 only asserts the array is capped, never that a blocking finding is produced. The local prediction tool can therefore never warn a miner about a PR that will be hard-failed purely for reference overflow.

Requirements

Add an overflow-aware extraction result to extractLinkedIssueNumbers (mirroring extractLinkedIssueNumbersWithOverflow's shape) and have buildPreflightResult emit a blocking finding matching resolveLinkedIssueHardRule's message when overflow is detected, so the local predicted-gate tool warns about this failure mode before a PR is ever pushed.

Deliverables

  • extractLinkedIssueNumbers (or a new sibling function) reports whether the 51-reference cap was exceeded
  • buildPreflightResult emits a blocking finding matching resolveLinkedIssueHardRule's real message when overflow is detected
  • A 51+-reference fixture test verified via the existing engine-parity-fixtures.test.ts harness, confirming the predicted-gate result matches the real maintainer-gate hard-fail

All of the above Deliverables are required in the same PR unless the deliverable text itself states otherwise.

Test Coverage Requirements

packages/loopover-engine/** -- 99%+ patch coverage, branch-counted, on the new overflow-detection path.

Expected Outcome

A miner running the local predicted-gate preview against a PR with 51+ linked-issue references sees the same hard-fail warning the real maintainer gate would produce, instead of a silently-truncated, misleadingly-clean preview.

Links & Resources

  • packages/loopover-engine/src/signals/predicted-gate-engine.ts:365,920-961
  • src/db/repositories.ts
  • src/review/linked-issue-hard-rules.ts
  • test/unit/predicted-gate-engine.test.ts:341

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