GeezerVison is showing github.com — C4.5 — Forecast push alerts (downtime + wall predictions to push notifications) · Issue #13261 · developing-today/code
C4.5 — Forecast push alerts (downtime + wall predictions to push notifications) #13261DescriptionComponent 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: S2.12 C4 half — push notifications carrying C4 predictions: predicted complete-downtime windows, predicted workhorse full-wall, and reset-duration ranges, in the design's rendered formats. Delivery precedent is the S5 anomaly path (alerts ledger via postIncident, source named); dedupe/threshold rules per the design (not every wall/reset alerts — S3.15's selectivity applies to pushes too).
Acceptance:
- Alerts fire for predicted downtime windows and workhorse full-wall predictions meeting the design's thresholds, with the prediction record id attached.
- Repeat ticks do not re-alert the same prediction (dedupe keyed on the prediction record).
- Alert text uses the design's range formats verbatim from the record, never re-derived at send time.
Activitydeveloping-today commented on Nov 23, 2026 dezren39 commented on Nov 23, 2026 Lane WD claiming #13261 (served via the fleet shortlist, refill #6). Plan: land the next feature slice — the forecast-alert plumbing against the prediction-record shape and the S5 alerts-ledger precedent, with tests, per the issue's acceptance criteria. Worktree on the laptop; PR to follow. dezren39 commented on Nov 23, 2026 Progress (Lane WD): first slice landed as PR #13276 — the alert-evaluation module (pm-stack/aggregator/src/quota-forecast-alerts.ts, +12 tests), built against the C4 design that merged today in PR #13268 (§1 record schema, §8 delivery).
What the slice pins, per the acceptance criteria:
- Criterion 1 (fires, id attached):
evaluateForecastAlerts fires findings for predicted downtime_window records and for predicted pool_exhaustion records whose subject pool serves the workhorse section (the predicted workhorse full-wall); the finding and the ledger incident key carry the prediction record id, source quota-prediction per design §8.
- Criterion 2 (dedupe): repeat evaluation over the same records with the returned tick state re-alerts nothing; a superseding record re-issuing the same prediction (same kind + subject + range) is also suppressed, while a moved range alerts as a new prediction.
- Criterion 3 (verbatim): the alert body is the record's stored
rendered string byte-for-byte; a test pins that changing basis/methodology fields cannot change the body.
Selectivity decisions recorded in the module header: ordinary pool walls do not alert (S3.15); reset_duration and model_plan_arrival records do not alert standalone in this slice (design §8's alert set is downtime windows + workhorse full-wall). Honesty states evaluate silent with the state named; a predicted record with no rendered text or an inverted range evaluates unevaluable, never fired.
Verification (laptop, at main c1700bc77d8): new suite 12/12 pass (failing-first confirmed before the module existed); full aggregator bun test src/ 210/210; tsc --noEmit clean.
Remaining for this issue: the gatherer tick hook — read the C4 prediction log on each tick, post findings via AlertsStore.postIncident, persist the alert state beside the anomaly state. Next slice, in the same form: after the C4.1/C4.2 producers (#13257/#13258) publish records, scripts/gather-quota.ts shows forecast-alert findings posted to the ledger on a live tick. This issue stays open on that wiring. dezren39 commented on Nov 24, 2026
Triage verdict (lane oc-code-02, task 22295): issue stays open on the gather-tick wiring remainder. Slice 1 (evaluation module + 12 tests) is merged via #13276 and present on main; no open PR covers the wiring; producers #13257/#13258 still open so the hook should build against the merged #13268 record schema. Routed follow-on: queue task 23625 (feature_slice, slice-2) for the tick hook in pm-stack/aggregator/scripts/gather-quota.ts. dezren39 commented on Nov 24, 2026 Slice 2 (gather-tick wiring) merged: PR #14575 (merge commit 96078f4, 2026-11-24T19:52:33Z).
What now runs every tick:
- gather-quota reads the C4 prediction log (
quota-predictions.jsonl), evaluates the newest record per (kind, subject) via evaluateForecastAlerts, and posts new alertable predictions with AlertsStore.postIncident (source quota-prediction, incident key = the prediction record id, body = the record's stored rendered text verbatim).
- Fired record ids persist in
quota-forecast-alert-state.json beside quota-anomaly-state.json; repeat ticks report already-alerted and post nothing.
- Workhorse membership is joined from the deployed OpenCode config with
sectionPoolIdsFromConfig; an unreadable config silences pool walls only (downtime windows still fire).
- Fail-soft: a failed tick never fails on this path; no alerts store = the finding is logged and the state still advances.
Tests: 16 in src/quota-forecast-alerts.test.ts (log parsing, state guard, two-tick post/suppress/moved-range, empty workhorse set) and 10 in test/gather-quota.test.ts (new end-to-end two-tick tick posting/suppression run of the real script); aggregator typecheck clean for touched files.
Acceptance status on this issue:
Leaving this issue open for that producer leg. developing-today-fleet commented on Nov 26, 2026 Triage verdict — oc-code-07, 2026-11-26
Verdict: still open; the C4.5 consumer is implemented, but the workhorse full-wall producer is not.
Fresh verification:
Routed as feature slice task 25141 in repo-health-code-pilot: implement the C4 pool_exhaustion producer from the live Stage-3 forecast rows, connect it to the existing alert tick path, and prove honest range/state handling plus one-post/repeat-tick suppression with focused and integration tests. No duplicate implementation started. #13261 stays open until the producer is verified against live tick data. developing-today-fleet commented on Nov 28, 2026 C4.5 producer slice done (queue task 25141): PR #16399 adds the pool_exhaustion producer + gather-tick wiring + tests.
src/quota-pool-exhaustion.ts: derivePoolExhaustionRecords wraps the S1 product — one record per walled/near-wall pool/window; range from the S2 accuracy calibration (window cell n>=20, else pool band, else insufficient_history); ledger mirror under quota-prediction.
- Tick wiring reads
quota-exhaustion-calibration.json (missing/torn = honesty states), appends to quota-predictions.jsonl, chains supersedes, fail-soft. Repeat-tick re-posts are suppressed by the slice-2 alert-state dedupe.
- Verified: tsc clean; 26 pass (producer unit + tick + alerts); 10 pass gather-quota suite; 63 pass neighbor suites.
Left for the follow-on: the S2 live-scoring feed that populates the calibration file — until then subjects honestly report insufficient_history. PR refs this issue without closing.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|