Skip to content

Audit 3/3: the evidence - red-first tests for every finding - #27

Draft
enoch85 wants to merge 1 commit into
audit/2-simulator-toolingfrom
audit/3-tests
Draft

Audit 3/3: the evidence - red-first tests for every finding#27
enoch85 wants to merge 1 commit into
audit/2-simulator-toolingfrom
audit/3-tests

Conversation

@enoch85

@enoch85 enoch85 commented Jul 14, 2026

Copy link
Copy Markdown
Owner

The evidence: ~96 new test files, each one written red-first against a defect that was live in production. Stacked on the production and simulator PRs; the tip of this PR is byte-identical to the audit branch.

What they pin, by area:

  • Billing: the hour survives the clocks going back (PEP 495 fold); an hour the meter slept through is not a bill; a billing hour remembers where its samples came from; one definition of the billed quantity; one peak per day; v1 stores migrate instead of breaking setup.
  • Control: an unloaded integration does not drive the heat pump (the race held open, as the network holds it open in production); the thermostat OFF switch actually turns it off; one writer at a time (AST-counted); reads do not drive the pump; a user boost outranks the price optimizer; wear and rate limits are real.
  • Physics & models: the pump models match their datasheets (every EN 14511 point); the emitter law matches OpenEnergyMonitor to 0.00 °C; the simulated plant obeys physics (falsifiable bounds — water-node leak, per-step Carnot, datasheet-COP envelope); the plant engages aux where the pump does.
  • Structural guards: no hardcoded values (ratcheted baseline); every simulator constant says where it came from; no document misquotes the safety thresholds; the rulebook describes this codebase; no fenced constant declaration a phantom; translation key parity across five locales; no production naive datetimes; no test captures the clock at import time.
  • Known-open defects stay visible: F-124 (saturated compressor) is a strict xfail restricted to AssertionError — fixing the layer turns the suite red until the marker is removed; a crash can no longer impersonate the finding.

Run against main, this suite fails 556 tests and 40 files cannot import — the measured before/after of the audit.

@enoch85
enoch85 marked this pull request as draft July 15, 2026 14:33
@enoch85
enoch85 force-pushed the audit/2-simulator-tooling branch from bc6a256 to 1fc2c9a Compare July 15, 2026 19:58
@enoch85
enoch85 force-pushed the audit/3-tests branch 2 times, most recently from 143cea6 to f95b008 Compare July 15, 2026 20:11
@enoch85
enoch85 force-pushed the audit/2-simulator-tooling branch from 1fc2c9a to 9c36d7a Compare July 15, 2026 20:12
Ninety-odd new test files, one per defect or invariant: the billing hour
survives the clocks going back; an hour the meter slept through is not a
bill; an unloaded integration does not drive the heat pump; the thermostat
off switch actually turns it off; a user boost outranks the price optimizer;
the pump models match their datasheets; the emitter law matches
OpenEnergyMonitor to 0.00 C; the simulated plant obeys physics through bounds
that can actually fail; no document misquotes the safety thresholds; no
fenced declaration names a constant the code does not have.

The two known-open defects stay visible as strict xfails restricted to
AssertionError (F-124 saturation trap, F-132b learning ceiling): fixing
either turns the suite red until its marker is removed, and a crash can no
longer impersonate the finding.

Run against main, this suite fails 556 tests and 40 files cannot import -
the measured before/after of the audit. The tip of this branch is
byte-identical to audit/safety-fixes-and-en442.
@enoch85
enoch85 force-pushed the audit/2-simulator-tooling branch from 9c36d7a to 06219a4 Compare July 15, 2026 20:14
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.

1 participant