GeezerVison is showing github.com — impl(quota-plane): stage-3 S5 — anomaly detectors: burn spike, adapter schema drift, vendor plan change · Issue #12699 · developing-today/code
impl(quota-plane): stage-3 S5 — anomaly detectors: burn spike, adapter schema drift, vendor plan change #12699DescriptionStage-3 epic #12694, slice S5. Design record: doc/2026-11-22T22-35-00Z_design_quota-plane-stage-3/ (issue #1177; hub copy files/stage-3-design-2026-11-22.md in the usage-billing-hub goal files).
Gate: work starts after Drew's review of the Stage-3 design doc (per #1177's method).
Scope: Three detectors running beside the gatherer tick (quota-watchdog pattern), each emitting into the evidence-baseline record and the alerts ledger rather than new plumbing: (a) burn spike — realized burn residual outside the forecast band from S1/S2; (b) adapter schema drift — a provider response whose parsed shape changes (fields appearing/disappearing, parse falling to the fail-closed unparseable state); (c) vendor plan change — a window limit/denominator change in consecutive snapshot records for the same service+metric.
Acceptance criteria
- Each detector fires on at least one replayed historical incident from the snapshot store (named in the implementation PR) and stays silent across a replayed clean week.
- A live finding lands as an evidence-baseline diff record plus an alert-ledger entry, demonstrated once (real or replay-injected).
Activitydeveloping-today commented on Nov 22, 2026 dezren39 commented on Nov 23, 2026
Picked up by felix — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while felix posts progress markers; after 30 minutes of silence any other worker may pick this up.) dezren39 commented on Nov 23, 2026
Progress from felix: still working dezren39 commented on Nov 23, 2026
Progress from felix: still working dezren39 commented on Nov 23, 2026 Implementation record — S5 anomaly detectors landed as PR #12754 (unmerged; Felix reviews).
What was built (pm-stack/aggregator/src/quota-anomaly.ts, wired fail-soft into the gatherer tick after the S1 forecast publish):
- Burn spike — realized next-hour burn vs the
projectWindow forecast rate + the pool/window's own matured-residual p99 band (S2's construction); a spike clears band × 1.25 with ≥ 1 pt/h excess; one finding per episode, re-arm after 2h inside the band; spike residuals trimmed at maturation so the band can't ratchet. The known weekly model bias is inside the residual band by construction — bias never fires as an anomaly.
- Adapter schema drift — parsed shape (usage keys + canonical window kinds; renames fold, models are data not schema) vs a recorded per-service baseline; additions and parse→unparseable fire at once, removals after consecutive confirming parses.
- Vendor plan change — limit/denominator moves between consecutive snapshot records, plus per-pool window-kind set changes.
Honesty: a series that cannot evaluate reports unevaluable with a named reason (never "no anomaly" from absent data); baselines establish silently; state loss re-baselines without an alert storm. Findings land as evidence-baseline diff records in quota-anomaly-history.jsonl + alerts-ledger incidents (postIncident, source quota-anomaly); no alerts store → the history record still stands.
Evidence (venue: Muse sandbox; full detail in PR #12754): fail-before on pristine main (suite fails, module absent); 15 new unit fixtures + neighbouring quota suites 72/72 pass; tsc --noEmit and biome clean; no new dependencies. Store replay (20,663 records, 2026-10-20 → 2026-11-23): 84 findings — burn 35, schema 28, plan 21. The plan-change limit leg fires exactly the 9 real turso limit changes (2026-11-08, 2026-11-14); burn fires on opencode-go's 2026-10-29 blowout (72.2 pts/h vs threshold 8.3) and _openai.alt's 2026-11-11 near-total 5h burn (98.1 vs 91.2). Clean weeks: plan-change silent 2026-11-16 → 2026-11-23; burn-spike's longest silent span 2026-10-20 → 2026-10-28 with per-series gatherer-era silence (anthropic:claude-pro finding-free until 2026-11-12); schema-drift has no ≥7-day finding-free span in the store — the estate restructured adapters continuously; stated plainly in the replay report, with per-service silence (19 of 55 silent, 21 baseline-only) and the unit fixtures as the clean-data proof. The unparseable leg has no replay trace (the store records no parse outcomes) — covered by the live path + fixtures, and the report says so. The landing demonstration (history record + incident input for one replay finding) is in the replay report's final section.
Activation: no new schedule (rides the existing quota-gatherer.timer; registry row already exists). The detectors are not live yet: the laptop aggregator runs a deployed build, so first live ticks wait on the next laptop rebuild — the same gate as #12718 and S1's live acceptance. This issue stays open for that live acceptance, like #12695. dezren39 commented on Nov 23, 2026
Released by felix (outcome: done). S5 anomaly detectors implemented: PR #12754 (open, Felix reviews; not merged by the lane). Three detectors (burn spike / schema drift / plan change) in pm-stack/aggregator/src/quota-anomaly.ts, fail-soft tick hook in gather-quota.ts, replay tool scripts/quota-anomaly-replay.ts. Evidence (sandbox): fail-before on pristine main; 72/72 quota tests; tsc + biome clean; no new deps. Store replay: 84 findings (burn 35, schema 28, plan 21) incl. exactly the 9 real turso limit changes and the named burn incidents; clean weeks stated per detector (schema-drift has none in-store — stated plainly). Records: issue comment 7089090765, epic #12694 comment 7089091354. Issue stays open for live acceptance after the next laptop aggregator rebuild (same gate as #12718 / S1). dezren39 commented on Nov 23, 2026 agent-note:v1
event: implementation merged; live acceptance pending rebuild
by: agent felix (kind muse, Muse sandbox seat)
at: 2026-11-22
Merged: PR #12754 — the three Stage-3 anomaly detectors (burn spike, adapter schema drift, vendor plan change). Felix re-ran the detector suite at review: 15/15, 61 expects. Findings land as evidence-baseline diff records in quota-anomaly-history.jsonl and as alerts-ledger incidents (source quota-anomaly); a series that cannot evaluate reports unevaluable with a named reason — never a silent all-clear. The burn detector's band is built from matured residuals (S2's construction), so the known weekly model bias sits inside the band and does not fire as anomaly. Store replay over 20,663 records: 84 findings after calibration (the first cut's 137 and the calibration fixes are recorded on the PR); the plan-change limit leg fires exactly the 9 real turso limit changes and nothing else in the clean week 2026-11-16 → 11-23; schema drift has no ≥7-day silent span in the store — stated plainly, with the fixtures as the clean-data proof.
#12699 stays open for live acceptance: the detectors ride the existing quota-gatherer timer, and first live ticks wait on the laptop aggregator running the merged build — the same rebuild gate as #12718, S1 and S3. dezren39 commented on Nov 23, 2026 agent-note:v1
event: correction — merged now
by: agent felix (kind muse, Muse sandbox seat)
at: 2026-11-22
Correction to comment 7089106951: that note said "Merged: PR #12754", but the first merge attempt had in fact failed on a merge conflict (against S3's gather-quota.ts hook, PR #12748, which landed after the S5 branch was cut) and the PR did not land at that time. The conflict is now resolved (merge commit a507828 on the branch: both fail-soft tick hooks survive — shadow placement, then anomaly detectors — with all suites re-run green on the merged tree: anomaly 15/15, shadow 14/14, forecast 31/31, tsc clean) and PR #12754 is MERGED as of this note. Everything else in the earlier note (detector behaviour, replay results, live-acceptance state) stands as written. dezren39 commented on Nov 23, 2026
Lane oc-code-01 -- S5 live acceptance: criterion 2 demonstrated live, first-hand (2026-11-23).
Criterion 2 ("a live finding lands as evidence-baseline diff record plus alert-ledger entry, demonstrated once") now reads met by real live ticks, not only the replay-injected path in the replay report. Verified this pass against the laptop aggregator state and the Turso ledger:
- 3 live burn-spike findings, filed by the deployed gatherer tick 2026-11-23 ~01:30-03:02 UTC (one finding per episode + re-arm, as designed):
- burn-spike anthropic:claude-pro 5h -- 57 pts/h vs 47.1 threshold (at 2026-11-23T01:15:28Z)
- burn-spike anthropic:claude-pro weekly -- 15.2 pts/h vs 11.3 threshold (at 2026-11-23T00:30:23Z)
- burn-spike opencode-go weekly -- 26.4 pts/h vs 25.3 threshold (at 2026-11-23T01:45:48Z)
- Evidence-baseline diff records: all 3 present in quota-anomaly-history.jsonl (kind quota-anomaly-finding), keys match; the tick's own quota-anomaly-state.json (updated 2026-11-23T16:00:22Z) holds exactly these 3 firedKeys.
- Alert-ledger entries: all 3 present in Turso alerts.incidents with source quota-anomaly, keys 1:1 with the history lines, severity warning, status open, occurrences 1 (read-only query via the repo Turso client; no writes).
- Steady state since: recent ticks log
anomaly detectors: 0 new finding(s), 70 evaluations -- episodes ended, no re-fire, no alert storm.
Criterion 1 stands as implemented (replay: burn fired on the named opencode-go 2026-10-29 and _openai.alt 2026-11-11 incidents; plan-change limit leg fired exactly the 9 real turso limit changes; clean weeks stated per detector with the schema-drift in-store caveat documented on the PR).
Verdict: both S5 acceptance criteria read met on current main. Leaving the status:in-review close to the reviewing workflow (Felix/Drew) -- no code changed by this lane, so no PR; closing unilaterally would repeat the #12697 state-vs-note mismatch flagged on #12698. Next slice for the epic: S4's live week (still gated on the S3 shadow-week summary) or the S7 second weekly run folding PR #13265. developing-today-fleet commented on Nov 24, 2026
Triage verdict (queue task 22236): resolved in substance — both acceptance criteria met; close reserved to the reviewing workflow.
Fresh verification this pass:
- Implementation is on main. PR Stage-3 S5: anomaly detectors — burn spike, schema drift, plan change (#12699) #12754 reads back
MERGED (merged 2026-11-23T01:27:32Z, merge commit 2a064b46f8d877701d741a8560f1ee35c7e89f9d), and pm-stack/aggregator/src/quota-anomaly.ts is present on main (44,288 bytes).
- Criterion 1 (replay): met, as documented on the PR — burn-spike fired on the opencode-go 2026-10-29 blowout and the _openai.alt 2026-11-11 burn; the plan-change limit leg fired exactly the 9 real turso limit changes (2026-11-08, 2026-11-14) and stayed silent across the clean week 2026-11-16 → 2026-11-23; schema-drift's lack of a ≥7-day silent span in the store is stated plainly on the PR with the unit fixtures as the clean-data proof.
- Criterion 2 (live finding): met live, per lane oc-code-01's 2026-11-23 first-hand record on this issue — 3 live burn-spike findings from the deployed gatherer tick, each present both as an evidence-baseline diff record in
quota-anomaly-history.jsonl and as an alerts-ledger incident in Turso (source quota-anomaly, keys 1:1), with steady state since (0 new findings, no re-fire).
Disposition: this issue is deliberately not closed by this triage. Its own record leaves the close to the reviewing workflow (Felix/Drew) — closing unilaterally from a triage lane would repeat the #12697 state-vs-note mismatch flagged on #12698. The triage task completes on this verdict; nothing about the implementation remains outstanding. developing-today-fleet commented on Nov 26, 2026 🤖 Agent note (lane code-j, 2026-11-26, triage task 24616): resolved in substance — close reserved to the reviewing workflow.
developing-today-fleet commented on Nov 26, 2026
Agent note — small_fix triage (lane oc-code-02, task 25093)
State: resolved in substance; close remains with the reviewing workflow, consistent with prior verdicts.
Fresh evidence (checked 2026-11-27T00:10Z):
Triage verdict: no new fix or packet. Keep open for review workflow to perform the issue done check and close or list remaining work. Task 25093 completes as triaged. dezren39 commented on Nov 27, 2026
Agent note — triage (xaltha, queue task 25837, follow-on from task 25532)
Verdict: resolved in substance — close reserved to the reviewing workflow. No PR, no code change (none appropriate).
Fresh verification this run (2026-11-26):
- Issue impl(quota-plane): stage-3 S5 — anomaly detectors: burn spike, adapter schema drift, vendor plan change #12699 OPEN, labels include
status:in-review.
- PR Stage-3 S5: anomaly detectors — burn spike, schema drift, plan change (#12699) #12754 MERGED 2026-11-23T01:27:32Z, merge commit
2a064b46f8d877701d741a8560f1ee35c7e89f9d, title "Stage-3 S5: anomaly detectors — burn spike, schema drift, plan change (impl(quota-plane): stage-3 S5 — anomaly detectors: burn spike, adapter schema drift, vendor plan change #12699)".
pm-stack/aggregator/src/quota-anomaly.ts present on main (44,288 bytes).
- No open PRs reference impl(quota-plane): stage-3 S5 — anomaly detectors: burn spike, adapter schema drift, vendor plan change #12699.
Acceptance, as documented on the issue/PR record and re-confirmed by prior verify passes (tasks 22236, 24616, 25093):
- Criterion 1 (replay): burn-spike fired on opencode-go 2026-10-29 and _openai.alt 2026-11-11 incidents; plan-change limit leg fired exactly the 9 real turso limit changes and stayed silent in the clean week 2026-11-16 → 2026-11-23; schema-drift's lack of a ≥7-day in-store silent span is stated plainly on the PR, with unit fixtures as clean-data proof.
- Criterion 2 (live): met live 2026-11-23 per lane oc-code-01's first-hand note — 3 live burn-spike findings, each present both as an evidence-baseline diff record in
quota-anomaly-history.jsonl and as an alerts-ledger incident in Turso (source quota-anomaly, keys 1:1), steady state since.
Disposition: this lane does not close the issue. The issue record explicitly reserves the close to the reviewing workflow (Felix/Drew); closing unilaterally from a triage lane would repeat the #12697 state-vs-note mismatch flagged on #12698. Nothing about the implementation remains outstanding. Refs #12694, #1177.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|