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
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.ts — buildCollisionReport/buildPreflightResult/buildPublicReadinessScore/buildQueueHealth/unionScopedOverlapClusters dependencies (imported at predicted-gate.ts lines 1-8).
src/rules/advisory.ts — buildPullRequestAdvisory/evaluateGateCheck/isTestPath/GateCheckConclusion (imported at line 20).
src/review/pre-merge-checks.ts — evaluatePreMergeChecks (imported at line 21).
- Earlier issues in this phase (
focus-manifest extraction, predicted-gate types extraction) — sequence dependencies.
This is the keystone of the whole extraction: move the actual
buildPredictedGateVerdictfunction body fromsrc/rules/predicted-gate.tsintopackages/gittensory-engine/src/predicted-gate.ts(alongside the types/pure-helpers already moved), now that its dependencies (buildCollisionReport/buildPreflightResult/buildPublicReadinessScore/buildQueueHealth/unionScopedOverlapClustersfromsignals/engine,buildFocusManifestGuidancefrom the now-extractedfocus-manifest,buildPullRequestAdvisory/evaluateGateCheckfrom./advisory, andevaluatePreMergeChecksfrom../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.tsbecomes 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.tsgains the fullbuildPredictedGateVerdictimplementation (all of it — the collision report, readiness score, synthetic-PR construction, pre-merge-check evaluation, focus-manifest policy parity, and the finalevaluateGateCheckcall), byte-identical to today'ssrc/rules/predicted-gate.ts.signals/engine's report builders,./advisory'sbuildPullRequestAdvisory/evaluateGateCheck,../review/pre-merge-checks'sevaluatePreMergeChecks) 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.tsbecomes a re-export shim:export { buildPredictedGateVerdict } from "@jsonbored/gittensory-engine"(plus the types already shimmed by the earlier types-extraction issue).predicted-gatetest 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.tsre-exportsbuildPredictedGateVerdict.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.ts—buildCollisionReport/buildPreflightResult/buildPublicReadinessScore/buildQueueHealth/unionScopedOverlapClustersdependencies (imported at predicted-gate.ts lines 1-8).src/rules/advisory.ts—buildPullRequestAdvisory/evaluateGateCheck/isTestPath/GateCheckConclusion(imported at line 20).src/review/pre-merge-checks.ts—evaluatePreMergeChecks(imported at line 21).focus-manifestextraction,predicted-gatetypes extraction) — sequence dependencies.