Skip to content

engine(review): guardrail-config's DEFAULT_HARD_GUARDRAIL_GLOBS omits predicted-gate-engine.ts and signals/engine.ts #10315

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/review/guardrail-config.ts's ENGINE_DECISION_GUARDRAIL_GLOBS (lines
24-62, folded into the exported DEFAULT_HARD_GUARDRAIL_GLOBS at line 67) is the invariant floor of
file paths that always force a hard-guardrail (mandatory manual review) disposition on a PR,
regardless of a repo's own configured guardrail list. Its own comment, added under #8698, explains
exactly why this list exists:

"#8698: the guardrail-matching engine and the gate-decision core themselves were a
self-referential blind spot -- none of the packages/loopover-engine files that actually decide a
PR's disposition were listed, so a PR weakening the glob matcher, flipping a block/advisory
disposition, or rewiring the orchestrator would not itself trip the hard guardrail."

That fix added packages/loopover-engine/src/signals/change-guardrail.ts,
packages/loopover-engine/src/advisory/gate-advisory.ts, and
packages/loopover-engine/src/predicted-gate.ts to the list. But predicted-gate.ts itself imports
its actual collision/preflight/duplicate-detection/bounty-lifecycle logic from
./signals/predicted-gate-engine.js (confirmed: predicted-gate.ts line 8 imports
buildCollisionReport, buildPreflightResult, buildPublicReadinessScore, buildQueueHealth from
that module) — and packages/loopover-engine/src/signals/predicted-gate-engine.ts is not in the
guardrail list. Grepping the whole file for "signals/engine" or "predicted-gate-engine" returns
zero matches beyond the two mentions in this Context. A PR that edits only
predicted-gate-engine.ts directly — for example, weakening a collision-detection threshold,
neutering the bounty-lifecycle classification, or narrowing MAX_COLLISION_PAIRWISE_ISSUES — would
not trip the hard guardrail today, exactly the class of self-referential blind spot #8698 was meant
to close for predicted-gate.ts's other dependencies.

packages/loopover-engine/src/signals/engine.ts — the host-side twin of the same collision/duplicate/
bounty-lifecycle logic, consumed directly by src/queue/processors.ts and src/rules/advisory.ts
is also absent from the list (only change-guardrail.ts under src/signals/ appears).

This issue only ADDS entries to an existing protective list — it does not change what causes an
auto-merge or auto-close decision, remove any existing protection, or alter any gate logic. It
brings two more files that already, today, drive that same decision-making under the same
already-established guardrail tier.

Requirements

Deliverables

  • DEFAULT_HARD_GUARDRAIL_GLOBS includes
    "packages/loopover-engine/src/signals/predicted-gate-engine.ts".
  • DEFAULT_HARD_GUARDRAIL_GLOBS includes "packages/loopover-engine/src/signals/engine.ts".
  • Every pre-existing entry in the file is unchanged.

All three Deliverables are required in this one PR — there is no narrower scope for this issue.

Test Coverage Requirements

packages/loopover-engine/src/** is measured by Codecov via two separate uploads whose hits are
unioned
— root test/** AND packages/loopover-engine/test/**. Add (or extend an existing)
regression test in test/unit/guardrail-config.test.ts (root-level, matching this file's existing
test location) asserting that both new paths are present in DEFAULT_HARD_GUARDRAIL_GLOBS and that
resolveHardGuardrailGlobs still includes them even when a repo supplies its own configured
guardrail list (i.e. the invariant-floor property is preserved for the new entries the same way it
already is for the existing #8698 entries). This is a pure data/config addition — no new branches
are introduced, so the coverage requirement is the presence assertions above, not branch coverage.

Expected Outcome

A PR that edits packages/loopover-engine/src/signals/predicted-gate-engine.ts or
packages/loopover-engine/src/signals/engine.ts directly always trips the hard guardrail (mandatory
manual review), closing the last self-referential gap #8698 identified but didn't fully close.

Links & Resources

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