feat(scoring): per-repo time-decay hyperparameters + go live (#703) - #733
Conversation
Time-decay now resolves each repo's curve from its registry config and goes live (SCORING_TIME_DECAY_ENABLED=true). The defaults come straight from upstream's constants.py (parsed into the live snapshot now that the TIME_DECAY_* constants are modeled); each repo's scoring.time_decay overrides overlay them per-field — mirroring upstream's resolve_time_decay. - registry/normalize.ts: parse the nested scoring.time_decay block per repo (grace_period_hours, sigmoid_midpoint_days, sigmoid_steepness, min_multiplier) into RegistryRepoConfig.timeDecay; absent/invalid fields stay null. - scoring/preview.ts: resolveTimeDecay overlays overrides on the snapshot defaults (per-field ?? default); calculateTimeDecay(prAgeHours, constants, overrides?) uses the resolved per-repo curve; computeScoreCore passes repo.registryConfig.timeDecay so each live repo's settings apply. - wrangler.jsonc: SCORING_TIME_DECAY_ENABLED=true — the go-live switch (deploys on merge). GITTENSOR_REGISTRY_URL is master_repositories.json, so these overrides are the SAME source upstream reads (e.g. JSONbored/gittensory already sets grace_period_hours: 24) — gittensory's projection matches upstream's scoring. A fresh PR is unaffected (decay 1.0); only aged-PR projections decay, so going live changes nothing until a caller supplies prAgeHours. Tests: scoring.time_decay parsing (partial/empty/absent), resolveTimeDecay overlay, calculateTimeDecay with overrides, and the preview applying each repo's resolved curve. 97% coverage held; OpenAPI clean.
|
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. |
|
gittensory · advisory review Reviewed 6 changed file(s) — two independent AI reviewers. Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
What
Completes #703: time-decay now resolves each repo's own curve and goes live (
SCORING_TIME_DECAY_ENABLED=true).constants.pyinto the scoring snapshot (theTIME_DECAY_*constants are now modeled).scoring.time_decayoverrides overlay the defaults per-field, mirroring upstream'sresolve_time_decay.GITTENSOR_REGISTRY_URLismaster_repositories.json, so these are the same overrides upstream reads → gittensory's projection matches upstream's actual scoring.How
registry/normalize.ts: parse the nestedscoring.time_decayblock per repo (grace_period_hours,sigmoid_midpoint_days,sigmoid_steepness,min_multiplier) →RegistryRepoConfig.timeDecay; absent/invalid fields staynull(→ fall back to the default at resolve time).scoring/preview.ts:resolveTimeDecay(constants, overrides)overlays per-field (override ?? default);calculateTimeDecay(prAgeHours, constants, overrides?)applies the resolved per-repo curve;computeScoreCorepassesrepo.registryConfig.timeDecay.wrangler.jsonc:SCORING_TIME_DECAY_ENABLED=true— the go-live switch (deploys on merge via Workers Builds).Real example
JSONbored/gittensoryalready setsscoring.time_decay: { grace_period_hours: 24, sigmoid_midpoint_days: 10, min_multiplier: 0.05 }upstream — so on this repo an 18h-old PR is still fresh (24h grace), where a default-config repo (12h grace) would have started decaying.sigmoid_steepness(unset) falls back to the upstream default 0.4.Safety
A fresh PR is unaffected (decay 1.0), and no caller passes
prAgeHourstoday — so going live changes nothing until a projection explicitly asks for an aged-PR score. Per-repo curves then apply automatically.Tests
scoring.time_decayparsing (partial / empty-object / absent / array),resolveTimeDecayper-field overlay,calculateTimeDecaywith overrides (grace + midpoint), and the preview applying each repo's resolved curve. 97% coverage held; typecheck + UI lint + OpenAPI clean.