Skip to content

WP4: evidence scripts - timer baseline, constrained site, forecast, fit, multi-day - #12

Merged
Neal006 merged 1 commit into
mainfrom
worktree-wp4-evidence
Sep 13, 2026
Merged

Neal006 merged 1 commit into
mainfrom
worktree-wp4-evidence

Conversation

@Neal006

@Neal006 Neal006 commented Sep 13, 2026

Copy link
Copy Markdown
Owner

WP4 of prompt.md — scripts only (solutions.md §0, §4, §6; ROADMAP.md §5). Plan: .docs/implementation-plan.md (deviation 9).

The numbers this PR puts on record (real day, python scripts/prove.py --policy timer)

                          kWh    $ bill    kg CO2   peak kW  clean-h %  overage $  short kWh
charge-immediately      378.9     67.42      23.0     101.0       86.3       0.80        3.0
dumb timer 09-14        350.6     91.51      18.6     139.7       89.2      32.88       31.3
noonshift               378.8     65.46       8.1     100.0       95.0       0.00        3.0
saving vs charge-now               2.9%     64.6%      1.0%
saving vs timer                   28.5%     56.2%     28.4%

The judge's kill question, answered: over a wall-clock timer the LP is −56 % CO₂, −28 % bill, −28 % peak, and the timer leaves 31 kWh undelivered while bursting the block. Stated-vs-actual departures: 29/36 left later than they said, 5 earlier (worst −158 min) — drivers under-state, they don't game.

Constrained site (--block 50 --feed 80): the feed binds all day, both policies peak at the 40 kW of headroom; Noonshift −23 % CO₂ with less shortfall (12.5 vs 14.6 kWh) but the bill is +7.4 % — deferred energy lands in the 16–21 h price peak. That is the carbon-vs-tariff conflict (ROADMAP §6.9, per-site W_CARBON), reported as measured, not hidden. The full rung there would sit at 60 × 0.667 kW = 40 kW.

What changed

  • prove.py: --policy timer, --block/--feed, --forecast <file> (plans on it, scores on data/signal.json, prints mean |forecast − actual|); every run prints clean-hour share (metrics.md §3), block overage $, kWh short, stated-vs-actual. Gate unchanged.
  • fetch_data.py signal --forecast → data/signal_forecast.json from /v3/forecast/historical (the 06:00 issue, horizon_hours=24); signal also stores health_damage ($/MWh) when the plan serves it. Not run here — no WattTime credentials on this machine. If Basic does not serve historical forecasts, the flag works on a live day via the same code path with /v3/forecast.
  • scheduler.impact(..., health=True) → health_usd (None without an index), keyword-only; impact_detail carries it. One unit test.
  • scripts/fit.py: cash tiers | perks only | not a fit from stated-slack median, tariff spread, demand charge, and --saving-rate (what prove.py measured — the slack rule alone would call Caltech "cash tiers"; 0.6 ¢/kWh measured makes it perks only, matching metrics.md §6b). Caltech stated slack median 3.8 h, distribution 4 / 15 / 17 = solutions.md Fact 1.
  • scripts/replay_days.py --days …: min/median/max over data/days/<date>.json; names missing days. Only the committed day is on disk, so the range still needs signal files (fetch_data.py signal --day …).

70 tests pass; CI runs prove.py as before.

🤖 Generated with Claude Code

https://claude.ai/code/session_017thvbGo7rTVnG2f46cLMzU

…ast, fit, multi-day

- prove.py: --policy timer (full power 09-14, else 6 A) prints the LP's
  delta over a wall-clock timer: CO2 -56.2 %, bill -28.5 %, peak -28.4 %;
  the timer leaves 31 kWh short and bursts the block ($32.88/day).
  --block/--feed overrides print block overage $, kWh short and what the
  full rung (static share) would draw. At feed 80 / block 50: CO2 -23 %,
  bill +7.4 % (deferred energy lands in the 16-21 h price peak) - the
  carbon-vs-tariff conflict, reported as measured.
  --forecast <file> plans on it and scores on data/signal.json, printing
  mean |forecast - actual|. Every run prints clean-hour share (metrics §3)
  and stated-vs-actual departures (29/36 later, 5 earlier).
- fetch_data.py signal --forecast -> data/signal_forecast.json from
  /v3/forecast/historical (06:00 issue); signal also stores health_damage
  ($/MWh) when served. Not run here: no WattTime credentials.
- scheduler.impact(..., health=True) adds health_usd (None without an
  index); impact_detail carries it. One test.
- scripts/fit.py: cash tiers | perks only | not a fit from stated slack,
  tariff spread, demand charge and --saving-rate. Caltech: perks only
  (slack median 3.8 h; 4 / 15 / 17 = solutions.md Fact 1).
- scripts/replay_days.py: range over data/days/<date>.json; names missing
  days. Only the committed day exists on disk.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017thvbGo7rTVnG2f46cLMzU
Copilot AI lite review requested due to automatic review settings September 13, 2026 00:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Neal006
Neal006 merged commit 96b4244 into main Sep 13, 2026
3 checks passed
@Neal006
Neal006 deleted the worktree-wp4-evidence branch September 13, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants