You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(review): scope the live auto-tune breaker to miner-originated PRs independently (#5061)
Extends the existing self-tightening precision circuit-breaker
(src/review/auto-tune.ts) so a miner fleet's own self-review accuracy
trips the SAME safety breaker independently of the maintainer's
overall (mixed) review-stack accuracy, without ever blanket-penalizing
human-submitted PRs to the same repo.
Issue #2352's own premise (scope via computeGateEval's existing
`source` filter) does not hold: `source` only ever distinguishes WHICH
REVIEW ENGINE decided (currently always 'gittensory-native'), not who
authored the PR. The real signal -- `confirmedContributor`, an
official-Gittensor-miner check via the live subnet API -- was already
computed in processors.ts right where gate_decision rows get written,
but never threaded through.
- migrations/0144: adds `review_audit.miner_authored` -- a coarse,
non-identifying boolean category (NOT a login), preserving
review_audit's own deliberate "no actor-identifying data" design
(it feeds the anonymized cross-instance export).
- parity-wire.ts: recordNativeGateDecision takes an optional
`minerAuthored` field, written alongside the existing (unchanged)
`source` column.
- processors.ts: threads the already-in-scope `confirmedContributor`
through at the one gate_decision write site.
- parity.ts: computeGateEval gains an optional `minerOnly` filter,
orthogonal to `source`. Omitted (every pre-#2352 caller) is
byte-identical to before.
- outcomes-wire.ts: runSelfTuneBreaker now runs a SECOND,
miner-scoped computeGateEval pass alongside the existing one, then
re-keys its rows with a `:miner` suffix before running them through
the SAME applyAutoTune/applyCloseAutoTune/maybeAutoClear* primitives
used for the existing pass. Every one of those (plus createFlagStore
and listEngagedProjectScopes) is already fully generic over an
opaque `project` string, so the distinct flag scope
(holdonly:<project>:miner) falls out naturally with ZERO changes to
auto-tune.ts itself. Refactored the existing engage+log+autoclear
sequence into a shared runBreakerPassForReport helper, run once per
scope, so the human/mixed pass's behavior is preserved byte-for-byte
(same event names, same log shape) while the miner pass reuses the
identical logic under a "miner_" event prefix.
IMPORTANT, discovered while testing: the existing/unscoped pass is NOT
disjoint from miner-authored data -- it has no miner_authored filter,
so it counts every prediction for a project, miner-authored or not.
This preserves that pass's existing meaning (overall accuracy,
unchanged) but means a project's miner-authored rows are counted in
BOTH the mixed population and the miner-only subset.
Regression-tested per the issue's own deliverable: the miner-scoped
breaker fires independently of the existing one in both directions,
the CLOSE-side mirror does too, and clearing one flag (via cooldown +
precision recovery) never clears the other -- both merge- and
close-side, both directions.
0 commit comments