feat(review): bridge a submitter's AMS track record into ORB reputation, upgrade-only - #6566
Conversation
|
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 #6566 +/- ##
=======================================
Coverage 93.60% 93.60%
=======================================
Files 675 677 +2
Lines 67764 67799 +35
Branches 18627 18646 +19
=======================================
+ Hits 63431 63466 +35
Misses 3360 3360
Partials 973 973
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…on, upgrade-only Implements JSONbored#6208's decided design. A repo running both ORB and AMS had no way to let a submitter's genuine AMS track record count toward their standing here, so a contributor with a strong record on a local AMS instance still started from scratch on the ORB side. Adds a pull-based, UPGRADE-ONLY bridge behind a new `amsReputationBridge` converged feature: - ORB PULLS from AMS on demand (never AMS pushing in). A push model would let any AMS instance -- including a self-hosted one running against an arbitrary repo -- write arbitrary trust signals into ORB's internal reputation store, a direct gaming vector. Pull keeps ORB in control. - Strictly upgrade-only: a strong AMS record can move a submitter toward `trusted`, never toward `low`, so an AMS record can never be used punitively against a contributor on an unrelated repo. There is no representable way for AMS data to push a submitter down. - Identity is plain `authorLogin` -- the axis submitter-reputation.ts and TrackRecordPullRequestOutcome already share. No new identity system, and deliberately not hotkey/wallet. - Fail-safe per this path's existing contract: no endpoint configured, no AMS data, a non-OK status, a malformed body, an unreachable instance, or a timeout all degrade to "no bonus signal applied" and never throw into the gate. Timeout-bounded so a slow AMS never stalls gate evaluation. - Config-as-code, default OFF: gated by the `features.amsReputationBridge` `.loopover.yml` toggle plus the LOOPOVER_REVIEW_AMS_REPUTATION_BRIDGE env kill-switch, documented in both example configs. With either unset the reputation path is byte-identical to today. - Privacy: TrackRecordPullRequestOutcome carries no score/ranking/wallet/hotkey fields by construction, so the consumed shape is already safe. Inherits submitter-reputation.ts's STRICTLY INTERNAL contract -- never surfaced in a label, comment, or check-run. Closes JSONbored#6485
6e250cc to
0f8d3ce
Compare
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-16 14:22:54 UTC
Review summary Nits — 5 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy · Diff highlights exactly what changed. 🟩 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 LoopOver, a quiet PR intelligence layer for OSS maintainers.
|



What & why
Implements #6208's decided design. A repo running both ORB and AMS had no way to let a submitter's genuine AMS track record count toward their standing here — a contributor with a strong record on a local AMS instance still started from scratch on the ORB side.
This adds a pull-based, upgrade-only bridge behind a new
amsReputationBridgeconverged feature.Design (all four boundaries from #6208, enforced)
trusted, never towardlow.upgradeReputationSignaltakes a boolean rather than a signal precisely so there is no representable way for AMS data to push a submitter down — an AMS record can never be used punitively against a contributor on an unrelated repo. Tested explicitly with a deliberately terrible record.authorLogin— the axissubmitter-reputation.tsandTrackRecordPullRequestOutcomealready share. No new identity system; deliberately not hotkey/wallet.TrackRecordPullRequestOutcomecarries no score/ranking/wallet/hotkey fields, so the consumed shape is already safe. Inheritssubmitter-reputation.ts's STRICTLY INTERNAL contract — never surfaced in a label, comment, or check-run.Fail-safe + config
Matching this path's existing contract, every degraded case yields "no bonus signal applied" and never throws into the gate: no endpoint configured, no AMS data, non-OK status, malformed body, unreachable instance, or timeout. The probe is timeout-bounded (
AMS_TRACK_RECORD_TIMEOUT_MS = 400) so a slow AMS never stalls gate evaluation, and an already-trustedsubmitter skips the network entirely.Default OFF, config-as-code: gated by the
features.amsReputationBridge.loopover.ymltoggle (documented in.loopover.yml.example+config/examples/loopover.full.yml) plus theLOOPOVER_REVIEW_AMS_REPUTATION_BRIDGEenv kill-switch, followingimprovement-signal-wire.ts's precedent. With either unset the reputation path is byte-identical to today.Tests
test/unit/ams-reputation-bridge.test.tscovers every case the issue names — no AMS data → unchanged; positive record → upgrades; unreachable/timeout/malformed/non-OK → unchanged, no throw; off-by-default; and the never-downgrade guarantee. 100% line and branch coverage on both new modules (44/44 stmts, 41/41 branches; wire 3/3, 6/6), with zero uncovered lines across every changed file.Docs
LOOPOVER_REVIEW_AMS_REPUTATION_BRIDGEis documented in both surfaces the docs-drift check requires —tuning.mdx(the flag's behavior, itsfeatures.amsReputationBridgeco-requisite, and theLOOPOVER_AMS_TRACK_RECORD_URLendpoint) andprivacy-security.mdx(the operator flag block, marked never-shown like itsreputationsibling).Closes #6485