EV-51: Solar decides every meter-age rule on the writer step's own age; DEBUG line per step
checks / unit (pull_request) Successful in 41m26s
infra-pin / fresh (pull_request) Successful in 2s

The writer step took the meter age from the snapshot of the previous cycle
(silent / unknown_s / hold), so in production order the silent-meter pause
came one cycle late (C21) and a start or raise could still be written at an own
age of 31-39 s (C22, N8). The step now judges its own age: the pause timing and
held_pause, the non-zero write block (nz_block), and the late-readings hold with
its stale rule. Meter values stay from the snapshot; car.held / car.reading and
the arrival sources' spare-unknown check are unchanged.

Also: one DEBUG line per Solar writer step (time, meter age, decision, write);
tools/ev20_sun.drive takes cyc / phase / jitter / cset (default unchanged);
test_ev51.py (T1-T43, N1-N12); DECISIONS states the rule once.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VSY9UpTaUYnjJF5oVtbM1w
This commit is contained in:
ems-agent
2026-11-24 17:26:03 +01:00
co-authored by Claude
parent 5bff894cca
commit 68856bc3a0
6 changed files with 1012 additions and 11 deletions
@@ -161,9 +161,21 @@ one small set of facts and derives every path from them:
This also ends the false PEAK_GUARD_FLOOR_LIMITED after one gap (EV-18
T10(b) changed accordingly).
- **Silent meter on `ha_signed`:** Solar's unknown-sun pause is timed from the
meter's age: unknown since the age passed `meter_max_age_s`, so 0 A when the
age reaches `meter_max_age_s` + `ev_pause_min` (330 s), checked every
control cycle (bound 330 s + one cycle). Arrival sources are unchanged.
meter's age: unknown since the age passed `meter_max_age_s`, so 0 A on the
first car step whose own meter age (now minus the last reading, at that
step) is >= `meter_max_age_s` + `ev_pause_min` (330 s), held steps included.
Arrival sources are unchanged.
- **EV-51: decided at the step's own meter age.** Every decision that rests on
the meter's AGE is taken at the writer step's own age, not at the age the
cycle saw one step earlier: the pause above, the write block while the meter
is silent (no non-zero current, C17), the held-read pause (C18) and the
late-readings hold with its stale rule (a spare read while the hold was on
is not used once the step's own late time reaches `stale_input_s`). The
meter's VALUES (spare, target) stay the cycle's, one cycle of sensor latency
being normal; `car.held` and `car.reading` are unchanged. Arrival sources
keep the cycle's age for their "spare unknown" check. At log level debug
each Solar step logs one line: time, the meter age at the step, the decision
and the write.
- **No non-zero write while the meter is silent (SPIKE-06 C17, N8 strict):**
while the meter's age is past `meter_max_age_s`, Solar sends no non-zero
current: no retry, no raise, no phase change begun, and a phase change