Skip to content

C4.5 — Forecast push alerts (downtime + wall predictions to push notifications) #13261

Done

Description

@dezren39

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: 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.

Acceptance criteria

  • Delivered: C4.5 — Forecast push alerts (downtime + wall predictions to push notifications) — the outcome named in the title is demonstrably in place.
  • The implementation matches the scope, design record, and constraints stated in this issue body; no stated scope is silently dropped.
  • Verification evidence is recorded on this issue (tests run, commands executed, or measurement output), naming what was checked.
  • Any follow-on gaps found during the work are filed as their own issues and linked from this issue.

Activity

  1. developing-today commented on Nov 23, 2026

    @developing-today
    Contributor
  2. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    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.

  3. dezren39 commented on Nov 23, 2026

    @dezren39
    MemberAuthor

    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.

  4. added a commit that references this issue on Nov 23, 2026
  5. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    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.

  6. added a commit that references this issue on Nov 24, 2026
  7. dezren39 commented on Nov 24, 2026

    @dezren39
    MemberAuthor

    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.

  8. developing-today-fleet commented on Nov 26, 2026

    @developing-today-fleet
    Contributor

    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.

  9. added a commit that references this issue on Nov 28, 2026
  10. developing-today-fleet commented on Nov 28, 2026

    @developing-today-fleet
    Contributor

    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.

  11. added a commit that references this issue on Nov 28, 2026
  12. added
    priority/normal
    kind/feature
    epic/pm-stack
    on Nov 29, 2026
  13. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Census 2026-11-29 (Felix): recheck of this issue (body, all comments, labels, blocker edges).

    STRENGTHS: The delivery discipline is in the acceptance itself — alerts attach the prediction record id, dedupe is keyed on the prediction record (repeat ticks never re-alert), and alert text uses the design's range formats verbatim from the record, never re-derived at send time. The S5 anomaly path is the named delivery precedent, with its source named.

    GAPS: None in labels (complete: kind/feature, priority/normal, status:in-review, epic/pm-stack).

    FIXES I APPLIED: None needed. Progress state: slice 1 (evaluation module + 12 tests, PR #13276) and slice 2 (gather-tick wiring, PR #14575) are merged; the gap the 2026-11-26 triage named — the workhorse full-wall producer — was closed by the producer slice on 2026-11-28 (PR #16399: pool_exhaustion producer + gather-tick wiring + tests).

    REMAINS: Final acceptance verification against the merged producer (alerts firing for both prediction classes with dedupe and verbatim formats demonstrated from the record), then this component of #9572 can close.

  14. developing-today-fleet commented on Nov 29, 2026

    @developing-today-fleet
    Contributor

    Issue census — 2026-11-29

    Audited live on 2026-11-29 against the house label taxonomy: details, labels, blockers, priority.

    Gaps found: no ## Acceptance criteria section in the body
    Strengths found: detailed body with scope and context a picker-up can start from; links a parent issue and/or design record; active discussion: 8 recent comment(s) skimmed
    Actions taken by the census: appended ## Acceptance criteria section to the body (original text unchanged).

    Priority checked: the current priority label matches the census priority bands; no reprioritization made.

  15. added
    effort/m
    and removed on Nov 29, 2026
  16. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Claim — lane 0900-AK (Xaltha, wave 0900). Taking the final acceptance verification the 2026-11-29 Felix census named as #13261's sole remainder: alerts firing for both prediction classes (downtime_window + workhorse pool_exhaustion from the merged producer, PR #16399) with dedupe and verbatim formats demonstrated from the record — via the aggregator test suites on current main, remotely dispatched. Closing as completed if the evidence holds.

  17. developing-today-fleet commented on Nov 30, 2026

    @developing-today-fleet
    Contributor

    Closed as completed — final acceptance verification, lane 0900-AK (2026-11-30).

    All three slices are merged: slice 1 evaluation module (PR #13276), slice 2 gather-tick wiring + dedupe state (PR #14575), and the workhorse full-wall producer (PR #16399, merged 2026-11-28T04:03:24Z). The sole remainder the 2026-11-29 census named was this verification against the merged producer; it now stands:

    Remote dispatch run 46462424581 on current main completed success — bun install --frozen-lockfile && bun test src/quota-forecast-alerts.test.ts src/quota-pool-exhaustion.test.ts src/quota-downtime.test.ts && bunx tsc --noEmit in pm-stack/aggregator. The suites demonstrate, against records of the exact shape the merged producer emits:

    1. Firing (criterion 1): a predicted downtime_window fires with the record id attached; a predicted pool_exhaustion for a workhorse pool fires; an ordinary (non-workhorse) pool wall does not alert (S3.15 selectivity); reset_duration / model_plan_arrival records do not alert standalone.
    2. Dedupe (criterion 2): a repeat tick over the same records re-alerts nothing; a superseding record re-issuing the same prediction does not re-alert; a superseding record whose range moved fires as a new prediction; the two-tick log test posts once and suppresses the repeat.
    3. Verbatim formats (criterion 3): the alert body is the record's stored rendered string byte for byte and is never re-derived from other record fields; honesty-state records stay silent with their state named.

    C4.5 (#13261, component of #9572) is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mepic/pm-stackkind/featurepriority/normalstatus/in-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions