fix(forecast): present() observes 0 (not NaN) on absence — VOID-rate regression#5327
Merged
Conversation
… VOID-rate regression While triaging the 68% resolution VOID rate, found a regression I introduced in the sampling refactor (#5243 P1): extractMetricObservation returned NaN for a missing matched record, but present() is a boolean existence check — an absent subject means the event did NOT occur → 0, not NaN. samplePendingEntries then stored an error sample instead of a valid 0, so a legitimately-NO within-horizon present spec (e.g. infra:outages present(country==X) for a quiet country) stranded with an empty timeline and VOIDed as no_establishable_metric instead of resolving NO. Now mirrors extractMetricValue's `record ? 1 : 0`. Tests: extractMetricObservation present-absent → 0 (matches extractMetricValue); present-within-horizon resolves NO on a sampled absence. 908/908 forecast+bet green; api tsc exit 0. Refs #5233, #4930 Claude-Session: https://claude.ai/code/session_01StNurp4TGC3JLHbTtKJhbp
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
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.
Why
Triaging the 68% resolution VOID rate surfaced a regression I introduced in the sampling refactor (#5243 P1).
extractMetricObservationreturnedNaNfor a missing matched record. Butpresent()is a boolean existence check — an absent subject means the event did not occur →0, notNaN. SosamplePendingEntriesstored an error sample instead of a valid0, and a legitimately-NO within-horizonpresentspec (e.g.infra:outages:v1|present(country==X)for a quiet country) stranded with an empty timeline and VOIDed (no_establishable_metric) instead of resolving NO. The oldextractMetricValuedidrecord ? 1 : 0; the refactored helper must match it.What
extractMetricObservation:present()now observesrecord ? 1 : 0(0 on absence),asOffrom the record when present.Evidence
0(parity withextractMetricValue); a within-horizonpresentspec resolves NO on a sampled absence.VOID-rate triage context (separate from this fix)
Historical VOIDs are all legacy-detector hard specs, zero bet_engine, two causes, both aging out:
unsupported_window: "sustained-48h"(gpsjam/chokepoint) — an old generator window the resolver never implemented; the current generator no longer emits it (0 in the pending pool).presentwithin-horizon 24h on a daily resolver — sparse sampling + this NaN bug (fixed here). The cadence + vague-forecast issues are what the bet-template re-engine supersedes.Refs #5233, #4930