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
{{ message }}
Repository navigation
C4.2 — Reset-duration predictions as ranges in Drew's formats #13258
Component of #9572 (C4 quota forecasting), per its design record (doc/2026-11-13T15-12-00Z_design_reporting-architecture-event-driven/c4-forecasting-design.md).
Scope: per-pool reset-duration predictions (S2.13): how long a wall/downtime lasts until reset reopens the pool, expressed as a RANGE and rendered in Drew's formats — "between X and Y hours from now", "2.5 to 3.7 days", "2 days 4 hours to up to 3 days 16 hours", "likely runs out between tomorrow afternoon and Sunday 2 am" (natural-language windows in America/Chicago). Basis: observed reset cadence/interval history per pool from the snapshot store + the current window's resetsAt; each record names its basis (S2.14).
Acceptance:
Prediction records of kind reset_duration logged per walled/near-wall pool on gatherer ticks.
Range rendering implements the design's format rules, including the natural-language window form.
Scored on range coverage + width per the design; first scored outcomes published to the accuracy record.
Lane WC (archer) claiming this item for one feature slice: premise + ownership checks passed (issue open, no live claim; the only comment is the queue task link). Working in a laptop worktree off main; one PR landing one acceptance-criterion slice with its test, per the feature-slice instructions.
Lane WC — HOLD (platform execution-risk flag). While reading the laptop checkout of developing-today/code to scope this slice, a platform execution-risk check tripped on the checkout content. Per the standing hold rule I stopped immediately: nothing was modified, no worktree was created, no script/build/test was run inside the checkout, and I do not assess the flagged content's safety myself. Clearing this needs Drew's plain-words go-ahead for this specific item (#13258); the standing clone approval does not extend to flagged content.
Premise (verified by reads completed before the stop): TRUE. No reset_duration prediction records and no range rendering exist anywhere in the repo — the only mentions of reset-duration are the design statements (note.md C4; statement-inventory S2.13/S2.14). The neighbouring machinery is all in pm-stack/aggregator/src/: quota-forecast.ts (S1 forecast product + buildForecastLedgerRows, ledger source quota-forecast), quota-analytics.ts (projectWindow pace oracle), quota-forecast-accuracy.ts (S2 scoring/backtest; baselines ledger the weekly review reads), snapshot store records carry resetsAt per reading.
Prepared scope (one feature slice, ready to run on approval):
New pure module pm-stack/aggregator/src/quota-reset-duration.ts:
ResetDurationPrediction record: kind reset_duration, pool/window identity (canonical providerId + serviceId + window name, S1 keying), predicted reopen range [earliestMs, latestMs], the duration range, and a named basis (S2.14: e.g. current-window-resetsAt / observed-reset-cadence from consecutive snapshot resetsAt deltas for the pool/window, rename-joined via S1's forecastSeriesKey).
Range construction: for a walled window, the reopen instant is the current window's resetsAt; the range widens it by the observed reset-jitter spread (min/max deviation of realized resets from previously read resetsAt in the snapshot history). For a near-wall window (wallsBeforeReset true in the S1 projection), the duration range runs from the projected wall instant to the same reopen range. Thin/no history → an explicit honesty state with a named reason, never a fabricated range (mirrors the neighbourhood's insufficient-history rule).
Rendering in Drew's formats (S2.13), pure functions of (range, now): sub-day spans as "between X and Y hours from now"; day-scale spans as decimals ("2.5 to 3.7 days"); mixed spans compound ("2 days 4 hours to up to 3 days 16 hours"); and the natural-language window form naming America/Chicago wall-clock landmarks ("reopens between tomorrow afternoon and Sunday 2 am") when the range crosses day boundaries.
Tests quota-reset-duration.test.ts in the S1/S2 test style: format-rule table (each design example shape), jitter-spread range construction from synthetic snapshot history, honesty states for thin history, and the exactly-at-boundary cases.
This slice lands criterion 2 (range rendering per the design's format rules, incl. the natural-language form) plus the prediction-record builder criterion 1 consumes; the gatherer-tick wiring (records logged per walled/near-wall pool) and criterion 3 (coverage + width scoring into the accuracy record) follow as the next slices.
On Drew's go-ahead naming #13258, this takes one lane pass.
Takeover — Lane YB (archer), 2026-11-23. Adopting Lane WC's orphaned claim: WC claimed at 12:41Z and stopped on a platform execution-risk hold at 12:43Z (record above), with no PR, no done record, and no activity since — the lane has ended. Drew batch-approved all outstanding flag holds on 2026-11-23 07:35 CST ("Approve all the flag holds listed above"), which covers #13258. Landing WC's prepared scope exactly as recorded in its hold comment: new pure module pm-stack/aggregator/src/quota-reset-duration.ts (reset_duration prediction records + range rendering in Drew's formats, incl. the natural-language America/Chicago window form) plus quota-reset-duration.test.ts. This slice lands acceptance criterion 2 and the prediction-record builder criterion 1 consumes; gatherer-tick wiring and criterion-3 scoring remain follow-on slices, so this issue stays open. Working in a laptop worktree off main.
Done (builder slice) — Lane YB (archer), 2026-11-23. Adopted Lane WC's orphaned claim under Drew's 2026-11-23 batch approval of the flag holds and landed WC's prepared scope (its hold record above) exactly: PR #13352 merged (4ca7ab408626, head SHA-guarded at a0953e6ef4a).
What landed — pm-stack/aggregator/src/quota-reset-duration.ts + quota-reset-duration.test.ts:
The reset_duration prediction record in the C4 design's §1 shape: subject pool+window, singular basis reset_cadence (§7), methodology c4-meth:1, supersedes link, inputs naming the rename-joined series (forecastSeriesKey).
Range construction: reopening anchored on the published resetsAt, 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 (§1): a degenerate spread widens to the observation resolution (half the median reading gap).
Honesty states with named reasons: no_basis (no snapshot history), insufficient_history (no completed period; or the ranged reopening already in the past — stale inputs). Non-subject windows (not walled, not projected to wall before reset) publish nothing.
Ledger mirror rows under source quota-prediction (§1), payload verbatim.
Acceptance mapping: criterion 2 (range rendering per the design's format rules, incl. the natural-language window form) — landed: the stored rendered string comes from the one shared §4 formatter (renderPredictionRange, quota-downtime.ts), with the duration form and the America/Chicago calendar form both pinned by tests. Criterion 1 — the record builder it consumes is landed; the gatherer-tick wiring (assemble history per walled/near-wall pool, log per tick) remains. Criterion 3 (coverage + width scoring into the accuracy record) remains. This issue stays open on criteria 1 and 3.
Verification (laptop route of record):
bun test src/quota-reset-duration.test.ts: 14/14 pass (jitter-spread construction from synthetic history, degenerate-spread widening, subject selection, both honesty states, stale guards, cadence projection, both rendering forms, ledger mirror, null-rollover regression below).
Six C4/quota suites together (reset-duration, downtime, arrival, forecast, forecast-alerts, daytype-sufficiency): 86 pass / 0 fail.
Full aggregator suite post-bun install: 3255 pass / 20 fail — all 20 failures are server-boot tests failing on port 4871, which the production pm-aggregator service on the laptop holds (verified via ss: the deployed pm-aggregator process, up 11h51m); zero failures in any quota file, and this PR modifies no existing file. (The pre-install run's extra failures were the fresh worktree's missing node_modules.)
Review: Codex posted one P2 (null resetsAt readings past a published reset would extend the period bracket and bill the publication gap to the reset as jitter). Accepted and fixed forward on the PR before merge, mirroring the accuracy harness's unknown-reset-segment distinction; regression test included (an on-schedule rollover with a two-reading publication gap now measures +75m of jitter, not +150m).
Design notes filed: the §4 compound example form is unimplemented by the shared formatter and its day form is unreachable as ordered — filed as #13357 for the design owner rather than forked around here.
Activity
developing-today commentedon Nov 23, 2026
CODE-4833
dezren39 commentedon Nov 23, 2026
Lane WC (archer) claiming this item for one feature slice: premise + ownership checks passed (issue open, no live claim; the only comment is the queue task link). Working in a laptop worktree off main; one PR landing one acceptance-criterion slice with its test, per the feature-slice instructions.
dezren39 commentedon Nov 23, 2026
Lane WC — HOLD (platform execution-risk flag). While reading the laptop checkout of developing-today/code to scope this slice, a platform execution-risk check tripped on the checkout content. Per the standing hold rule I stopped immediately: nothing was modified, no worktree was created, no script/build/test was run inside the checkout, and I do not assess the flagged content's safety myself. Clearing this needs Drew's plain-words go-ahead for this specific item (#13258); the standing clone approval does not extend to flagged content.
Premise (verified by reads completed before the stop): TRUE. No
reset_durationprediction records and no range rendering exist anywhere in the repo — the only mentions of reset-duration are the design statements (note.md C4; statement-inventory S2.13/S2.14). The neighbouring machinery is all inpm-stack/aggregator/src/:quota-forecast.ts(S1 forecast product +buildForecastLedgerRows, ledger sourcequota-forecast),quota-analytics.ts(projectWindowpace oracle),quota-forecast-accuracy.ts(S2 scoring/backtest; baselines ledger the weekly review reads), snapshot store records carryresetsAtper reading.Prepared scope (one feature slice, ready to run on approval):
pm-stack/aggregator/src/quota-reset-duration.ts:ResetDurationPredictionrecord: kindreset_duration, pool/window identity (canonical providerId + serviceId + window name, S1 keying), predicted reopen range[earliestMs, latestMs], the duration range, and a namedbasis(S2.14: e.g.current-window-resetsAt/observed-reset-cadencefrom consecutive snapshotresetsAtdeltas for the pool/window, rename-joined via S1'sforecastSeriesKey).resetsAt; the range widens it by the observed reset-jitter spread (min/max deviation of realized resets from previously readresetsAtin the snapshot history). For a near-wall window (wallsBeforeResettrue in the S1 projection), the duration range runs from the projected wall instant to the same reopen range. Thin/no history → an explicit honesty state with a named reason, never a fabricated range (mirrors the neighbourhood's insufficient-history rule).quota-reset-duration.test.tsin the S1/S2 test style: format-rule table (each design example shape), jitter-spread range construction from synthetic snapshot history, honesty states for thin history, and the exactly-at-boundary cases.On Drew's go-ahead naming #13258, this takes one lane pass.
feat(quota): forecast-alert evaluation for C4 prediction records (#13261
dezren39 commentedon Nov 23, 2026
Takeover — Lane YB (archer), 2026-11-23. Adopting Lane WC's orphaned claim: WC claimed at 12:41Z and stopped on a platform execution-risk hold at 12:43Z (record above), with no PR, no done record, and no activity since — the lane has ended. Drew batch-approved all outstanding flag holds on 2026-11-23 07:35 CST ("Approve all the flag holds listed above"), which covers #13258. Landing WC's prepared scope exactly as recorded in its hold comment: new pure module
pm-stack/aggregator/src/quota-reset-duration.ts(reset_duration prediction records + range rendering in Drew's formats, incl. the natural-language America/Chicago window form) plusquota-reset-duration.test.ts. This slice lands acceptance criterion 2 and the prediction-record builder criterion 1 consumes; gatherer-tick wiring and criterion-3 scoring remain follow-on slices, so this issue stays open. Working in a laptop worktree off main.Merge pull request #13352 from developing-today/lane-yb-13258
dezren39 commentedon Nov 23, 2026
Done (builder slice) — Lane YB (archer), 2026-11-23. Adopted Lane WC's orphaned claim under Drew's 2026-11-23 batch approval of the flag holds and landed WC's prepared scope (its hold record above) exactly: PR #13352 merged (
4ca7ab408626, head SHA-guarded ata0953e6ef4a).What landed —
pm-stack/aggregator/src/quota-reset-duration.ts+quota-reset-duration.test.ts:reset_durationprediction record in the C4 design's §1 shape: subject pool+window, singular basisreset_cadence(§7), methodologyc4-meth:1, supersedes link, inputs naming the rename-joined series (forecastSeriesKey).resetsAt, 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 == latestrefused (§1): a degenerate spread widens to the observation resolution (half the median reading gap).no_basis(no snapshot history),insufficient_history(no completed period; or the ranged reopening already in the past — stale inputs). Non-subject windows (not walled, not projected to wall before reset) publish nothing.quota-prediction(§1), payload verbatim.Acceptance mapping: criterion 2 (range rendering per the design's format rules, incl. the natural-language window form) — landed: the stored
renderedstring comes from the one shared §4 formatter (renderPredictionRange, quota-downtime.ts), with the duration form and the America/Chicago calendar form both pinned by tests. Criterion 1 — the record builder it consumes is landed; the gatherer-tick wiring (assemble history per walled/near-wall pool, log per tick) remains. Criterion 3 (coverage + width scoring into the accuracy record) remains. This issue stays open on criteria 1 and 3.Verification (laptop route of record):
bun test src/quota-reset-duration.test.ts: 14/14 pass (jitter-spread construction from synthetic history, degenerate-spread widening, subject selection, both honesty states, stale guards, cadence projection, both rendering forms, ledger mirror, null-rollover regression below).bun install: 3255 pass / 20 fail — all 20 failures are server-boot tests failing on port 4871, which the production pm-aggregator service on the laptop holds (verified viass: the deployedpm-aggregatorprocess, up 11h51m); zero failures in any quota file, and this PR modifies no existing file. (The pre-install run's extra failures were the fresh worktree's missingnode_modules.)bun: command not foundin the fleet-build container (the fleet: fleet-command dispatch container cannot run nix develop out of the box (experimental features, nixbld group, homeless-shelter purity) #13159 family), not a test result.Review: Codex posted one P2 (null
resetsAtreadings past a published reset would extend the period bracket and bill the publication gap to the reset as jitter). Accepted and fixed forward on the PR before merge, mirroring the accuracy harness's unknown-reset-segment distinction; regression test included (an on-schedule rollover with a two-reading publication gap now measures +75m of jitter, not +150m).Design notes filed: the §4 compound example form is unimplemented by the shared formatter and its day form is unreachable as ordered — filed as #13357 for the design owner rather than forked around here.