feat(scoring): upstream time-decay, behind a default-off flag (#703)#731
Merged
Conversation
…f flag (#703) Ports upstream gittensor's sigmoid time-decay (the validator's calculate_time_decay) into gittensory's score model. DEFAULT-OFF + owner-gated: the roadmap defers #703 pending owner review of a before/after ranking diff, so this changes nothing live until SCORING_TIME_DECAY_ENABLED is set. - scoring/model.ts: model the 4 upstream constants (TIME_DECAY_GRACE_PERIOD_HOURS 12, SIGMOID_MIDPOINT 10, SIGMOID_STEEPNESS_SCALAR 0.4, MIN_MULTIPLIER 0.05) so they no longer surface as unmodeled drift (#690); + isTimeDecayEnabled gate (default off). - scoring/preview.ts: calculateTimeDecay (verbatim port: hard 12h grace -> 1.0, then a logistic on days-since-merge, 50% at 10d, floored at 0.05) + a timeDecayMultiplier applied to estimatedMergedScore. A fresh PR (age < grace) is unaffected even when enabled, so a normal new-PR preview never changes. - prAgeHours input + the owner-gated applyTimeDecay flag injected server-side at the routes + MCP score-preview entry points (not caller-controllable). Why per-PR projection (not a historical-aggregate refactor): gittensory's preview scores a single fresh planned PR and surfaces the contributor's upstream-API standing (already decayed upstream); it has no raw historical per-PR aggregation to decay, so re-applying there would double-count. The faithful model is per-PR (predicted score x decay-by-age). Decay curve (the before/after to review): fresh 100% -> 5d ~88% -> 10d 50% -> >=20d 5% floor. Tests: calculateTimeDecay vs upstream (grace, 50%@10D, floor, monotonic), constants now modeled, the env gate, the preview applied/unapplied paths, and a before/after trajectory. 97% coverage held; OpenAPI regenerated.
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 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. |
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | 52dbcd9 | Commit Preview URL Branch Preview URL |
Jun 14 2026, 04:55 PM |
Closed
12 tasks
12 tasks
12 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




What
Implements upstream gittensor's sigmoid time-decay in gittensory's score model (#703), default-off and owner-gated. The roadmap defers #703 "gated on owner review of a before/after diff" — so this changes nothing live until you set
SCORING_TIME_DECAY_ENABLED.Faithfulness
Ports the validator's
calculate_time_decay(gittensor/validator/utils/datetime_utils.py) verbatim:1.0.1 / (1 + exp(0.4·(days − 10)))→ 50% at 10 days.The 4 constants are now modeled in
DEFAULT_SCORING_CONSTANTS(so they stop surfacing as unmodeled drift via #690).Before / after (what enabling would do — for your review)
A fresh PR is unaffected even when enabled, so a normal new-PR preview never changes — only an aged-PR projection decays.
Architecture note (why per-PR projection, not a historical-aggregate refactor)
I'd initially scoped "per-PR merge-age data spine." On investigation, gittensory's preview scores a single fresh planned PR and surfaces the contributor's upstream-API standing (already decayed upstream) — there's no raw historical per-PR aggregation in gittensory to decay, so re-applying there would double-count. The faithful, double-decay-safe model is per-PR: predicted score ×
calculateTimeDecay(prAgeHours), withprAgeHoursan optional preview input andapplyTimeDecayinjected server-side from the env flag (not caller-controllable).How to enable (after you review)
Set
SCORING_TIME_DECAY_ENABLED=true. Then a score preview that suppliesprAgeHoursdecays per the curve above.Tests
calculateTimeDecayvs upstream (grace / 50%@10D / floor / monotonic), constants-now-modeled, the env gate, preview applied-vs-unapplied paths, and a before/after trajectory. Typecheck + UI lint + OpenAPI (regenerated) clean; 97% coverage held.