Skip to content

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

Description

@JSONbored

Build the adapter that takes a driver's raw diff/worktree state each iteration and turns it into the SAME inputs buildPredictedGateVerdict and the slop/scoring signals expect (a synthetic PR record, changed paths, title/body), so the iterate loop's self-review call is genuinely byte-identical to what the live maintainer gate would compute post-submission — not an approximation. This is the piece that makes the miner's own self-assessment trustworthy enough to decide autonomously whether to keep iterating, and is inseparable from the trigger-surface concern the orchestration-loop issue covers, so it is held to the same maintainer tier.

Deliverables

  • packages/gittensory-engine/src/miner/self-review-adapter.ts exporting a function that builds a PredictedGateInput-shaped object (repo, contributor login, title, body, labels, linked issues, changed paths) from an attempt's live worktree diff state
  • Calls buildPredictedGateVerdict (imported from wherever the shared-engine extraction issue relocates it, or directly from src/rules/predicted-gate.ts if that extraction has not yet landed — coordinate with whichever issue owns moving deterministic logic into packages/gittensory-engine) and returns its verdict alongside a slop-signal pass using src/signals/slop.ts
  • Explicitly threads changedPaths (the real changed file paths from the diff) so the path-dependent predicted-gate checks are evaluated, not skipped — an omitted-paths call silently under-predicts per the existing PREDICTED_GATE_NOTE_NO_PATHS disclaimer, which would be a dangerous false-confidence bug if the miner's own loop relied on it
  • A hard requirement (asserted in tests) that a conclusion other than a clear pass is treated as "do not hand off to submission" by any caller (this issue, plus the orchestration-loop issue, both enforce this independently — defense in depth)
  • Owner-reviewed tests using real predicted-gate fixtures (a genuinely passing synthetic diff and a genuinely blocked one) proving the adapter's verdict matches calling buildPredictedGateVerdict directly with the same inputs

References

  • /Users/shadowbook/Documents/gittensory/.claude/worktrees/quizzical-engelbart-34f3be/src/rules/predicted-gate.ts lines 95-263 (buildPredictedGateVerdict — the exact function this adapter feeds) and lines 107-112 (the changedPaths doc comment explaining why omitting them under-predicts — the precise footgun this issue must avoid)
  • src/signals/slop.ts (516 lines) — the slop-signal pass this adapter also threads through, per the predicted-gate's own PREDICTED_GATE_NOTE_SLOP disclaimer (slop is NEVER evaluated pre-submission from metadata alone, but the miner's own loop DOES have the full diff content locally, so it can run a real slop pass the metadata-only public predictor cannot)
  • packages/gittensory-engine/src/miner/iterate-loop.ts (the consumer of this adapter's verdict, sibling maintainer issue in this batch)

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintainer-onlyOwner-only work — yields no Gittensor points.

    Projects

    Status
    In Progress

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions