GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||
GeezerVison is showing github.com — doc(#9572): C4 quota forecasting design — prediction record, scoring, methodology log by dezren39 · Pull Request #13268 · developing-today/code Conversation
|
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Here are some automated review suggestions for this pull request.
Reviewed commit: a5785f3bbf
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ```jsonc | ||
| { | ||
| "record_version": 1, | ||
| "id": "c4:<kind>:<subject-key>:<issued-at-epoch-ms>", |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Include the basis in prediction record IDs
When §2 publishes parallel since_last_reset and trailing_30d forecasts for the same pool/window on one gatherer tick, both records receive the same ID under this format. That makes ID-based supersession and attribution of scores to individual predictions ambiguous, undermining the stated head-to-head comparison of bases. Include the basis and any concurrently published model variant in the record identity, or use a unique ID independent of the subject and issuance timestamp.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| `postIncident` precedent, source `quota-prediction`, deduped on | ||
| the prediction record id, thresholded per S3.15's selectivity |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Deduplicate forecast alerts by the predicted event
For a downtime or workhorse-wall forecast that persists across gatherer ticks, deduplicating on the prediction record ID creates a fresh alert each tick: §1 makes that ID issuance-time-specific, while AlertsStore.postIncident in pm-stack/aggregator/src/alerts.ts suppresses duplicates only for matching (source, incident_key). The selectivity threshold limits which forecast kinds alert, but does not suppress repeated alerts for the same impending outage. Use a stable event/episode key for alert deduplication and retain the prediction ID as supporting detail.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
) Publish downtime_window prediction records on gatherer ticks, in the C4 design's record format (doc/2026-11-13T15-12-00Z_design_ reporting-architecture-event-driven/c4-forecasting-design.md §1/§7, landed by PR #13268): appended to quota-predictions.jsonl beside the forecast product and mirrored into the Turso ledger under the C4 source "quota-prediction". src/quota-downtime.ts derives each record from the tick's Stage-3 forecast product (#12695): per-pool wall intervals [wall, reset) intersected across every routing pool (canonical provider id); earliest = the last member wall, latest = the earliest member reset; basis since_last_reset, named with its detail; the §4 range rendering stored at issuance; supersedes linked from the log's tail. Honesty per §1 and #13257 criterion 3: providers the forecast cannot project publish insufficient_history with a named reason (and veto a no-window verdict); an overlap no member reset bounds is an honesty state, not an unbounded prediction; a defensible no-window tick publishes no record — absence is the scored no-prediction signal. First methodology entry c4-meth:1 recorded in c4-methodology-log.jsonl (§6). Acceptance: criteria 1 (records published on gatherer ticks) and 3 (honesty state) of #13257. Criterion 2 (scoring per §3 in the accuracy ledger) is the next slice; the mirrored records are its input. Tests: src/quota-downtime.test.ts (15 tests: record shape, intersection range, in-progress windows, union within a provider, disjoint overlaps, honesty states, supersedes, §4 rendering, ledger mirror), mutation-checked; the gather-quota integration test now also asserts the tick appends the downtime record. Oracle: the C4 design §1/§7 over the #12695 forecast product.
New pure module pm-stack/aggregator/src/quota-reset-duration.ts implementing the builder slice of the C4.2 reset-duration kind, per the C4 design (PR #13268, sections 1/4/7) and the prepared scope recorded on the issue by Lane WC. - ResetDurationRecord in the design's section-1 shape: kind reset_duration, subject pool+window, singular basis reset_cadence, methodology c4-meth:1, supersedes link. - Reopening range: anchored on the published resetsAt when one exists, ranged by the reset jitter observed over completed reset periods (realized resets estimated at the midpoint of the bracketing readings); with no published reset, projected one observed cadence interval past the last published reset. - earliest == latest refused: a degenerate spread widens to the observation resolution (half the median reading gap). - Honesty states with named reasons: no_basis (no snapshot history) and insufficient_history (no completed period, or the ranged reopening already in the past — stale inputs). - Rendered strings from the one shared section-4 formatter (renderPredictionRange in quota-downtime.ts), stored at issuance; ledger mirror rows under source quota-prediction. Tests: quota-reset-duration.test.ts, 13 tests — jitter-spread range construction from synthetic snapshot history, degenerate spread widening, subject selection (walled + near-wall only), both honesty states, stale-input guards, cadence projection, the section-4 duration and calendar rendering forms, and the ledger mirror.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.