Skip to content

feat(miner-governor): self-review adapter wiring diffs through predicted-gate + slop (#2334) - #5034

Merged
JSONbored merged 1 commit into
mainfrom
feat/miner-self-review-adapter-2334
Jul 11, 2026
Merged

feat(miner-governor): self-review adapter wiring diffs through predicted-gate + slop (#2334)#5034
JSONbored merged 1 commit into
mainfrom
feat/miner-self-review-adapter-2334

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • 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 (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.
  • 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.
  • Cross-boundary problem solved with existing precedent, not a new pattern: src/signals/slop.ts has not been extracted into packages/gittensory-engine (it depends on several sibling src/signals/* modules that are also unextracted, and porting all of them is out of this issue's scope). This mirrors the established RewardRiskEngineDeps injection 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), with SelfReviewSlopInput/SelfReviewSlopAssessment as a hand-kept structural mirror of SlopAssessmentInput/SlopAssessment — same discipline types/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 private src/ tree; the real binding happens in whichever src-side shim eventually wires a live iterate-loop.
  • passesPredictedGate is the hard requirement the deliverables explicitly call for: true only when predictedGateVerdict.conclusion === "success" (exported as SELF_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.
  • Tests use real predicted-gate fixtures (mirroring the exact fixture style already established in 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 calling buildPredictedGateVerdict directly with the same translated inputs — proving the adapter is a faithful pass-through, not an approximation.
  • Barrel-exports RepositoryRecord/IssueRecord/PullRequestRecord/BountyRecord/IssueQualityReport/AdvisoryFinding from types/predicted-gate-types.ts — previously internal-only to predicted-gate.ts's own call sites, now needed because SelfReviewContext/SelfReviewSlopAssessment reference them in their own public signature and must be nameable by consumers (verified: IssueQualityReport is 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

Validation

  • git diff --check
  • npm run typecheck — clean.
  • npm run build + npm run test in packages/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 direct buildPredictedGateVerdict call, an explicit both-branches assertion of the hard pass/fail requirement, a changedPaths threading 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 only packages/gittensory-engine/**, and per CONTRIBUTING.md only src/** is Codecov-measured. CI runs them authoritatively.

Safety

Notes

  • Sequencing: maintainer: iterate-loop stop/abandon/handoff policy + Phase 4 handoff contract #2335 (iterate-loop policy — the pure decideNextAction state 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 the CodingAgentDriver + this adapter + the policy + the attempt-log primitive — all four already exist or are landing in this batch).
  • Design call worth flagging for review: I chose to barrel-export the six previously-internal types (RepositoryRecord etc.) rather than keep SelfReviewContext referencing unnameable types. The alternative would have been redefining yet another local mirror inside self-review-adapter.ts itself (a third parallel copy, on top of types/predicted-gate-types.ts's existing mirror of the src-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.

…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-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

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

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 11, 2026
@loopover-orb

loopover-orb Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-11 09:41:26 UTC

3 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
The AI review returned non-blocking notes for this change but did not include a separate narrative summary. Review the nits below before deciding this PR.

Nits — 5 non-blocking
  • `SelfReviewSlopInput.tests` (self-review-adapter.ts:69) is declared but never populated by `buildSelfReviewSlopInput` (self-review-adapter.ts:122-131) — either wire it from `diffState` or drop the field so the mirror doesn't imply a mapping that doesn't exist.
  • The hand-kept structural mirrors (`SelfReviewSlopInput`/`SelfReviewSlopAssessment`) have no compile-time or runtime check tying them back to the real `SlopAssessmentInput`/`SlopAssessment` in `src/signals/slop.ts` — a future field rename there will silently desync until the `src`-side shim breaks; worth a one-line note on where that shim's own type-check should live.
  • Test file imports from `../dist/index.js` rather than source — confirm this matches the existing convention for other `packages/gittensory-engine/test/*.test.ts` files so the build step is a required precondition for `validate-tests` and not accidentally skipped.
  • `buildSelfReviewPredictedGateInput` doesn't thread `diffState.issueDiscoveryLane` into anything other than the slop input — confirm `buildPredictedGateVerdict` genuinely has no path-independent use for it, otherwise it's silently dropped for the gate call.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2334
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 47 registered-repo PR(s), 39 merged, 428 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 47 PR(s), 428 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, TypeScript, Ruby, Go, JavaScript, MDX, Shell, Solidity
  • Official Gittensor activity: 47 PR(s), 428 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 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.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 11, 2026
@JSONbored
JSONbored merged commit 214b4c3 into main Jul 11, 2026
13 checks passed
@JSONbored
JSONbored deleted the feat/miner-self-review-adapter-2334 branch July 11, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

maintainer: self-review adapter wiring iterate-loop diffs through predicted-gate + slop scoring

1 participant