Skip to content

feat(miner-foundation): move buildPredictedGateVerdict into gittensory-engine and re-point src/ #2283

Description

@JSONbored

This is the keystone of the whole extraction: move the actual buildPredictedGateVerdict function body from src/rules/predicted-gate.ts into packages/gittensory-engine/src/predicted-gate.ts (alongside the types/pure-helpers already moved), now that its dependencies (buildCollisionReport/buildPreflightResult/buildPublicReadinessScore/buildQueueHealth/unionScopedOverlapClusters from signals/engine, buildFocusManifestGuidance from the now-extracted focus-manifest, buildPullRequestAdvisory/evaluateGateCheck from ./advisory, and evaluatePreMergeChecks from ../review/pre-merge-checks) are all resolvable. Where a dependency has NOT yet been extracted to the engine package by an earlier issue, port that minimal dependency alongside this one rather than blocking on it — this is explicitly the ONE gittensor:priority issue for the phase because every miner self-review capability depends on this function living in the shared, versioned package. src/rules/predicted-gate.ts becomes a thin re-export so the LIVE maintainer gate keeps calling the exact same code the miner will call for self-review.

Deliverables

  • packages/gittensory-engine/src/predicted-gate.ts gains the full buildPredictedGateVerdict implementation (all of it — the collision report, readiness score, synthetic-PR construction, pre-merge-check evaluation, focus-manifest policy parity, and the final evaluateGateCheck call), byte-identical to today's src/rules/predicted-gate.ts.
  • Any not-yet-extracted direct dependency (signals/engine's report builders, ./advisory's buildPullRequestAdvisory/evaluateGateCheck, ../review/pre-merge-checks's evaluatePreMergeChecks) gets a minimal engine-side port in this same issue if small, or is explicitly called out as a follow-up dependency issue if too large to fit the 1000-LOC cap — do not silently stub it.
  • src/rules/predicted-gate.ts becomes a re-export shim: export { buildPredictedGateVerdict } from "@jsonbored/gittensory-engine" (plus the types already shimmed by the earlier types-extraction issue).
  • The FULL existing predicted-gate test suite passes UNMODIFIED — this is the hard byte-identity bar the phase's parity suite (a separate issue) will assert against continuously going forward.
  • packages/gittensory-engine/src/index.ts re-exports buildPredictedGateVerdict.

References

  • src/rules/predicted-gate.ts (263 lines, full file) — THE target: "deterministic predicted-gate, byte-identical to the live merge/close gate" per the phase brief, and "THE self-review target for an autonomous miner."
  • src/signals/engine.tsbuildCollisionReport/buildPreflightResult/buildPublicReadinessScore/buildQueueHealth/unionScopedOverlapClusters dependencies (imported at predicted-gate.ts lines 1-8).
  • src/rules/advisory.tsbuildPullRequestAdvisory/evaluateGateCheck/isTestPath/GateCheckConclusion (imported at line 20).
  • src/review/pre-merge-checks.tsevaluatePreMergeChecks (imported at line 21).
  • Earlier issues in this phase (focus-manifest extraction, predicted-gate types extraction) — sequence dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:priorityMaintainer-selected Gittensor priority — scores a 1.5x multiplier.

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions