Skip to content

Wire real reputationHistory into the Governor's self-reputation throttle #5675

Description

@JSONbored

Context

governor-state.js's saveReputationHistory/loadReputationHistory store (a {decided, unfavorable} counter pair per repo) exists with a real schema and tested store methods, but nothing calls either anywhere in the real pipeline -- attempt-runner.js's own header names this exact gap: "Reputation/self-plagiarism state also has real persistence primitives (governor-state.js) but isn't auto-loaded here yet." Because of this, chokepoint.ts's selfReputationThrottle stage is always skipped (GovernorChokepointInput.reputationHistory is never supplied, and the stage is gated on input.reputationHistory !== undefined) -- meaning the self-reputation cadence throttle, one of the Governor's own documented defense layers, is silently inactive in every real deployment today.

A prerequisite for this issue just shipped in the same session: recordOwnSubmission's write side is now wired into attempt-cli.js (a real submission fingerprint + PR number is recorded on every real "submitted" outcome), so a real submission history now exists to derive reputationHistory from going forward.

Dependencies

None to start -- independently shippable. Builds on the now-real recordOwnSubmission/listRecentOwnSubmissions write path.

Requirements

  1. Determine where the decided/unfavorable classification happens: a submission's live terminal outcome (merged vs. closed-without-merge) isn't known at submission time. loop-cli.js's own header references a real "PR-disposition poll (pr-disposition-poller.js, on a submitted outcome)" -- check whether that poller already resolves a terminal outcome and, if so, call governor-state.js's saveReputationHistory there: increment decided always, increment unfavorable only when the PR closed without merge (reuse rejection-state-machine.js's own isRejectedPr classification for consistency with the existing own-rejection-history trigger, Check a miner's own prior-rejection history on a repo (rejectionSignaled's second documented trigger) #5655).
  2. Wire attempt-input-builder.js's buildAttemptGovernorContext (or its caller) to read the real reputationHistory via governor-state.js's loadReputationHistory and pass it into GovernorChokepointInput, the same optional-parameter-with-honest-fallback pattern convergenceInput already uses (Track real per-issue attempt-history on the portfolio queue, feed the Governor's convergenceInput #5654).
  3. Out of scope: changing selfReputationThrottle's own calculator logic (reputation-throttle.ts) or its default thresholds.

Deliverables / Acceptance Criteria

  • A real terminal-outcome classification updates governor-state.js's reputation-history store (decided always increments on a resolved outcome, unfavorable increments only on closed-without-merge)
  • buildAttemptGovernorContext receives and forwards a real reputationHistory instead of always leaving the field undefined
  • A repo with a real unfavorable-outcome streak measurably throttles cadence in a real chokepoint evaluation (regression test)

Test Coverage Requirements

This PR must ship with full test coverage for every changed line and branch -- the repo's Codecov patch gate requires 99%+ coverage and the house standard is to aim for 100%, including both sides of every conditional/nullish-coalescing branch introduced.

Expected Outcome

The self-reputation cadence throttle -- fully built and tested since Wave 3 -- finally receives real data instead of always skipping, closing a genuine safety gap before Wave 5 puts this on a paid, higher-stakes footing.

Links & Resources

  • packages/gittensory-miner/lib/attempt-runner.js's own header comment (the documented gap)
  • packages/gittensory-engine/src/governor/reputation-throttle.ts
  • packages/gittensory-miner/lib/governor-state.js's saveReputationHistory/loadReputationHistory
  • packages/gittensory-miner/lib/pr-disposition-poller.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.gittensor:priorityMaintainer-selected Gittensor priority — scores a 1.5x multiplier.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions