Repository navigation
feat(quota-tracker): EWMA burn-rate forecast + pass-budget prediction - #1166
bassilkhilo-ag2 wants to merge 2 commits into
Conversation
ab6f038 to
231cb2b
Compare
VasiliyRad
left a comment
There was a problem hiding this comment.
EWMA implementation is correct — alpha=0.3, proper first-sample init, positive-delta filter, 30-min gap guard, history cap at 60 samples, graceful None handling throughout. The quota feature itself is well-scoped and useful.
Bundling issue (same pattern as previous PRs): 6 of 7 commits are unrelated to the EWMA feature:
build_log.md(114 lines) — workspace runtime file, should not be in PRssrc/health-check.py— multi-bridge source-path warn (fix from a different issue)src/watch-tasks-stream.sh— EPIPE + PPID watchdog fixes (issue #1088)tests/health-check-bridge-multi-pid.test.py— tests for the health-check fixtests/watch-tasks-stream-orphan.test.py— tests for the watcher fixtests/web-client-security-scrub.test.py— tests for web-client e.message scrub (#1121)
The quota-related files (read-quota.py, tests/quota-burn-rate.test.py, tests/quota-bare-except.test.py) are the only things that belong here.
Please split: remove build_log.md entirely, and move the health-check, watch-tasks-stream, and web-client test changes to their respective PRs (or dedicated ones). Happy to approve the quota feature once it's isolated.
sonichi#1062) The broad except Exception: around the workspace_default import swallowed any non-ImportError raised by status_read_path(), silently falling through to the misleading "No quota-state.json found" message instead of surfacing the real error. Narrowed to ImportError so only the module-not-on-path case is suppressed; all other exceptions propagate to cron pass logs. 5 structural tests in tests/quota-bare-except.test.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…closes sonichi#1087) Adds predictive degradation to read-quota.py: records utilization samples in <workspace>/state/quota-burn-history.json, computes an EWMA (α=0.3) of pct/min consumption, and outputs burn_rate_pct_per_min / estimated_minutes_to_exhaustion / estimated_passes_remaining. Positive-delta filter and 30-min gap guard prevent quota resets and long pauses from spiking the rate. Human-readable output gains a "Burn rate: X.XXX%/min (~N passes left)" line. 17 structural tests added. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
231cb2b to
38a3c50
Compare
|
Rebased to strip the 6 unrelated commits flagged in review. Branch now contains only the 2 quota-tracker commits:
Same pattern as the #1175 cleanup. No logic changes — EWMA implementation is exactly as reviewed. |
|
The bundled junk has been rebased out. Current diff: |
Summary
read-quota.py: recordsutil_5hsamples in<workspace>/state/quota-burn-history.json, computespct/minconsumption rate per passburn_rate_pct_per_min,estimated_minutes_to_exhaustion,estimated_passes_remaining(in both--jsonand human-readable output)except ImportError:narrowing from fix(quota-tracker): narrow bare except Exception to ImportError (closes #1062) #1165 (not yet merged)Test plan
python3 tests/quota-burn-rate.test.py→ All 17 tests passedpython3 tests/quota-bare-except.test.py→ All 5 tests passed (carried-forward fix)python3 read-quota.pytwice in succession — second call shows a burn rate linepython3 read-quota.py --json— output includes the three new keys<workspace>/state/quota-burn-history.jsonis created/updated on each runCloses #1087
🤖 Generated with Claude Code