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
Documents the baseline-selection invariant in buildWindow: once a baseline is found (fetchedAt <= latest - windowDays), observedDays is always at least the requested window span, so ready windows divide safely.
Adds regression tests that duplicate latest fetchedAt timestamps still yield finite reviewVelocityPerDay and that ready windows always have observedDays >= windowDays.
Does not add a null/zero-day velocity branch — that path is unreachable for ready windows given how baseline is chosen (lines 88–90).
Why not null on zero observedDays?
The gate flagged the prior approach as a dead fix: baseline must be at or before targetMs, so observedDays <= 0 cannot occur on any readybuildWindow result. A null-velocity guard would never run on the real path and contradicted the PR title.
Scope
The PR title follows type(scope): short summary Conventional Commit format.
Focused change in src/services/queue-trends.ts + tests only.
Validation
npm run test:ci green
npm run test:coverage green
Test plan
test/unit/queue-trends.test.ts — duplicate latest fetchedAt → no Infinity; ready windows → observedDays >= windowDays and finite velocity.
Files changed
File
Change
src/services/queue-trends.ts
Invariant comment only (no dead null branch)
test/unit/queue-trends.test.ts
Regression + invariant tests
PR body note (important)
Update the open PR title and description to match this summary. Remove any claim about “return null when observedDays is zero” — that was incorrect for the ready-window path.
⏸️ Gittensory review result - manual review recommended
Review updated: 2026-06-30 07:52:52 UTC
2 files · 1 AI reviewer · no blockers · readiness 71/100 · CI green · unknown
⏸️ Suggested Action - Manual Review
Touches a guarded path — held for manual review
Review summary
This change documents the real buildWindow invariant and adds tests around duplicate latest timestamps plus ready-window observedDays bounds. The production change is safe because the baseline selection requires fetchedAt <= latest - windowDays before computing observedDays, so ready windows cannot divide by zero. The notable issue is metadata drift: the PR title still claims a null-on-zero behavior that the code intentionally does not implement.
Nits — 4 non-blocking
nit: Pull request metadata should be updated because the current title says `return null review velocity when observedDays is zero`, while `src/services/queue-trends.ts:90` intentionally keeps finite velocity for ready windows.
Update the PR title to match the implemented invariant/test-only fix, for example `test(queue-trends): cover ready-window observedDays invariant` or `docs(queue-trends): document ready-window observedDays invariant`.
Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal
Result
Evidence
Code review
✅ No blockers
1 reviewer
Linked issue
⚠️ Missing
No linked issue or no-issue rationale found.
Related work
✅ No active overlap found
No same-issue or scoped active PR overlap found.
Change scope
✅ 20/20
Low review scope from cached public metadata (size label size:XS; no linked issue context).
Validation posture
❌ 5/25
Preflight is holding this PR; address the blocker before review.
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
gittensor:bugGittensor-scored bug fix - worth 0.5x multiplier.gittensorGittensor contributor contextlgtmThis PR has been approved by a maintainersize:XSThis PR changes 0-9 lines, ignoring generated files.
2 participants
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.
Summary
buildWindow: once a baseline is found (fetchedAt <= latest - windowDays),observedDaysis always at least the requested window span, so ready windows divide safely.fetchedAttimestamps still yield finitereviewVelocityPerDayand that ready windows always haveobservedDays >= windowDays.Why not null on zero observedDays?
The gate flagged the prior approach as a dead fix:
baselinemust be at or beforetargetMs, soobservedDays <= 0cannot occur on any readybuildWindowresult. A null-velocity guard would never run on the real path and contradicted the PR title.Scope
type(scope): short summaryConventional Commit format.src/services/queue-trends.ts+ tests only.Validation
npm run test:cigreennpm run test:coveragegreenTest plan
test/unit/queue-trends.test.ts— duplicate latestfetchedAt→ noInfinity; ready windows →observedDays >= windowDaysand finite velocity.Files changed
src/services/queue-trends.tstest/unit/queue-trends.test.tsPR body note (important)
Update the open PR title and description to match this summary. Remove any claim about “return null when observedDays is zero” — that was incorrect for the ready-window path.