feat(miner-governor): self-review adapter wiring diffs through predicted-gate + slop (#2334) - #5034
Conversation
…ted-gate + slop (#2334) Builds the adapter that takes an attempt's live worktree diff state and turns it into the SAME inputs buildPredictedGateVerdict and the slop-signal pass expect, so the iterate-loop's self-review call (#2333) is genuinely byte-identical to what the live maintainer gate would compute post-submission -- not an approximation. changedPaths is always threaded through explicitly, never omitted, so path-dependent predicted-gate checks are genuinely evaluated (an omitted-paths call silently under-predicts per predicted-gate.ts's own PREDICTED_GATE_NOTE_NO_PATHS disclaimer -- exactly the false-confidence bug this issue's deliverables call out by name). src/signals/slop.ts has not been extracted into the engine package (it depends on several sibling src/signals/* modules that are also unextracted), so this mirrors the established RewardRiskEngineDeps injection pattern (reward-risk.ts, #2281): the slop assessment is an injected dependency, with a hand-kept structural mirror of SlopAssessmentInput/SlopAssessment, rather than importing slop.ts directly. passesPredictedGate is the hard requirement the deliverables call for: true only when the predicted-gate conclusion is a clear "success" -- every other conclusion (failure/action_required/neutral/skipped) reads false. Tests use real predicted-gate fixtures (a genuinely passing synthetic diff and a genuinely blocked one) and assert byte-identical equality against calling buildPredictedGateVerdict directly with the same inputs. Also barrel-exports RepositoryRecord/IssueRecord/PullRequestRecord/ BountyRecord/IssueQualityReport/AdvisoryFinding from types/predicted-gate- types.ts -- previously internal-only, now needed since SelfReviewContext/ SelfReviewSlopAssessment reference them in their public signature.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 64d49f0 | Commit Preview URL Branch Preview URL |
Jul 11 2026, 09:39 AM |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-11 09:41:26 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Summary
buildPredictedGateVerdictand the slop-signal pass expect, so the iterate-loop's self-review call (maintainer: local create->score->self-review iterate-loop orchestrator (the control-flow core) #2333, not yet built) is genuinely byte-identical to what the live maintainer gate would compute post-submission — not an approximation.changedPathsis always threaded through explicitly, never omitted, so path-dependent predicted-gate checks are genuinely evaluated. An omitted-paths call silently under-predicts perpredicted-gate.ts's ownPREDICTED_GATE_NOTE_NO_PATHSdisclaimer — exactly the false-confidence bug this issue's deliverables call out by name.src/signals/slop.tshas not been extracted intopackages/gittensory-engine(it depends on several siblingsrc/signals/*modules that are also unextracted, and porting all of them is out of this issue's scope). This mirrors the establishedRewardRiskEngineDepsinjection pattern (reward-risk.ts, feat(miner-foundation): extract reward-risk scoring into gittensory-engine #2281, itself solving the identical problem for a different signal): the slop assessment is an injected dependency (SelfReviewAdapterDeps.runSlopAssessment), withSelfReviewSlopInput/SelfReviewSlopAssessmentas a hand-kept structural mirror ofSlopAssessmentInput/SlopAssessment— same disciplinetypes/predicted-gate-types.ts's own header comment already documents ("Local mirrors from src/... Keep in sync by hand — the engine package cannot import across into src/."). The engine package keeps zero import dependency on the privatesrc/tree; the real binding happens in whicheversrc-side shim eventually wires a live iterate-loop.passesPredictedGateis the hard requirement the deliverables explicitly call for: true only whenpredictedGateVerdict.conclusion === "success"(exported asSELF_REVIEW_PASSING_CONCLUSION) — every other conclusion (failure/action_required/neutral/skipped) reads false. This is defense-in-depth: the sibling orchestration-loop issue (maintainer: local create->score->self-review iterate-loop orchestrator (the control-flow core) #2333) is expected to independently enforce the same requirement.test/unit/predicted-gate.test.ts): a genuinely passing synthetic diff and a genuinely blocked one (duplicate-PR collision), and assert byte-identical deep equality against callingbuildPredictedGateVerdictdirectly with the same translated inputs — proving the adapter is a faithful pass-through, not an approximation.RepositoryRecord/IssueRecord/PullRequestRecord/BountyRecord/IssueQualityReport/AdvisoryFindingfromtypes/predicted-gate-types.ts— previously internal-only topredicted-gate.ts's own call sites, now needed becauseSelfReviewContext/SelfReviewSlopAssessmentreference them in their own public signature and must be nameable by consumers (verified:IssueQualityReportis confirmed a pure re-export from the same source in both places it was previously imported from, so this isn't introducing a second parallel type).Scope
CONTRIBUTING.md.main.Validation
git diff --checknpm run typecheck— clean.npm run build+npm run testinpackages/gittensory-engine— 380/380 passing (9 new self-review-adapter tests: barrel smoke test, input/path/slop-input mapping, a passing real-fixture scenario, a blocked real-fixture scenario each asserted byte-identical against a directbuildPredictedGateVerdictcall, an explicit both-branches assertion of the hard pass/fail requirement, achangedPathsthreading proof, and a slop-injection-seam proof).npm run test:coverage,test:workers,build:mcp,test:mcp-pack,ui:*,npm audit— not re-run locally; this PR touches onlypackages/gittensory-engine/**, and perCONTRIBUTING.mdonlysrc/**is Codecov-measured. CI runs them authoritatively.Safety
runSelfReviewis not called from any real driving loop yet (that's maintainer: local create->score->self-review iterate-loop orchestrator (the control-flow core) #2333/maintainer: wire the submission-gate trigger into the harness driving loop #2337, later work).Notes
decideNextActionstate machine consuming this adapter's verdict shape) lands next, then maintainer: local create->score->self-review iterate-loop orchestrator (the control-flow core) #2333 (the iterate-loop orchestrator itself, composing theCodingAgentDriver+ this adapter + the policy + the attempt-log primitive — all four already exist or are landing in this batch).RepositoryRecordetc.) rather than keepSelfReviewContextreferencing unnameable types. The alternative would have been redefining yet another local mirror insideself-review-adapter.tsitself (a third parallel copy, on top oftypes/predicted-gate-types.ts's existing mirror of thesrc-side originals) — barrel-exporting the existing mirror seemed clearly better, but flagging in case there's a reason those six were deliberately kept internal-only that I'm not seeing.