feat(miner-governor): add self-reputation throttle from own outcome history (#2346)#4632
feat(miner-governor): add self-reputation throttle from own outcome history (#2346)#4632dhgoal wants to merge 1 commit into
Conversation
…istory (JSONbored#2346) New packages/gittensory-engine/src/miner/self-reputation-throttle.ts: pure. Given the miner's OWN recent merge/close outcomes on one repo, compute a cadence multiplier (1.0 normal → floor as the own close/reject ratio worsens) — a self-correcting slowdown distinct from the fixed rate limit. Not a permanent ban: an improving ratio recovers cadence. Fails OPEN on insufficient sample (a new miner/new repo is never falsely throttled). Conservative built-in thresholds, configurable. Validates inputs rather than coercing. No IO — the Governor chokepoint consults this and records the verdict to the ledger (separate, maintainer-owned enforcement wiring). Closes JSONbored#2346
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4632 +/- ##
=======================================
Coverage 94.11% 94.11%
=======================================
Files 432 433 +1
Lines 38348 38373 +25
Branches 13979 13986 +7
=======================================
+ Hits 36091 36116 +25
Misses 1600 1600
Partials 657 657
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-10 08:38:16 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Flagged checks (non-blocking)
Linked issue satisfactionPartially addressed 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.
|
|
Gittensory is closing this pull request on the maintainer's behalf (Linked issue #2346 is assigned to the maintainer (@JSONbored) — that work is reserved for the maintainer, so this PR cannot be auto-accepted.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Adds the self-reputation throttle (Closes #2346) — a self-correcting slowdown driven by the miner's OWN local merge/close history, distinct from the fixed rate limit.
New
packages/gittensory-engine/src/miner/self-reputation-throttle.ts:selfReputationThrottle(outcomes, thresholds?)→ a cadence multiplier from the miner's own{merged, closed}on one repo:sample < minSample⇒ 1.0 (fails open) — a new miner / new repo is never falsely throttled (documented).closeRatio <= healthyCloseRatio⇒ 1.0;>= criticalCloseRatio⇒ the floor; linear interpolation between.DEFAULT_SELF_REPUTATION_THRESHOLDS, fully configurable (a.gittensory-miner.ymloverrides).Pure, no IO, local-only. The Governor chokepoint consults this before an
open_pr/file_issueaction and records the verdict + triggering ratio to the ledger — that consultation + ledger write is separate, maintainer-owned enforcement wiring.Test
test/unit/miner-self-reputation-throttle.test.ts— insufficient-sample fail-open, healthy full cadence, critical floor, linear degradation (exact midpoint), monotonic recovery as the ratio improves, custom thresholds, and input-validation rejections. 7 tests pass (engine src imported via vitest, mirroring the worktree-allocator test).site//CNAME/**/lovable/**; noCHANGELOG.md. New engine module + test + one entrypoint export; no secrets.