Skip to content

feat: manual cook notes + fix a real stage-crossing bug - #27

Merged
ctopherwilliams merged 1 commit into
mainfrom
feat/cook-notes-and-sustained-crossing
Jul 5, 2026
Merged

feat: manual cook notes + fix a real stage-crossing bug#27
ctopherwilliams merged 1 commit into
mainfrom
feat/cook-notes-and-sustained-crossing

Conversation

@ctopherwilliams

Copy link
Copy Markdown
Owner

Summary

  • New cook_notes.py: attach cut, weight, a corrected --on-grill time (sensor logging can start after the meat actually went on), and a verdict/notes to a past cook via history.py note <id> .... history.py show and the Cook Report both display it automatically.
  • Real bug fix, found while logging today's actual cook: stage-crossing detection used a naive "first reading past threshold" check, which a brief probe-reinsertion spike (pulling the probe to wrap, reading grill-ambient air for a few ticks before resettling into the meat) could trigger hours before the meat actually got there. New history.stage_hits() reuses plot.py's already-tested spike filter (clean_and_events) instead of duplicating bespoke logic -- verified against the real cook: a false "done" timestamp of 2:06 PM is now correctly reported as 5:07 PM.
  • Also caught and fixed a path=NOTES_FILE-as-default-argument late-binding bug in cook_notes.py itself while writing its own tests.

Test plan

  • Full smoke suite green (new tests: notes save/load/merge/size-cap, CLI note + show display, _parse_time_of_day, the sustained-crossing fix against a synthetic probe-reinsertion spike, report.py note + on-grill-override display)
  • bandit + pip-audit clean
  • Verified end-to-end against the real, actual cook: attached real notes (8.5 lb pork butt, 8:15 AM on-grill, verdict "amazing"), confirmed history.py show and a regenerated Cook Report both display correctly, and confirmed the stage-crossing fix reports the real 5:07 PM finish instead of the false 2:06 PM

…al stage-crossing bug

Adds cook_notes.py: attach the cut, weight, a corrected on-grill time
(sensor logging can start well after the meat actually went on, e.g.
mid-setup), and a free-text verdict/notes to a past cook via
`history.py note <id> ...`. Both `history.py show` and the Cook Report
pick these up automatically -- cut/weight in the header, verdict front
and center, and total duration measured from the corrected --on-grill
time instead of whichever tick logging happened to start on.

Also fixes a real bug found while logging today's actual cook: stage-
crossing detection (history.py's inline stage loop, report.py's
_stage_hits) reported the first single reading past a threshold, which
a brief probe-reinsertion spike -- pulling the probe to wrap it, then
reinserting, reads grill-ambient air for a few ticks before settling
into the meat -- could trigger hours before the meat actually got
there. New shared history.stage_hits() reuses plot.py's already-tested
clean_and_events() spike filter instead of duplicating bespoke logic.
Verified against the real cook: the false "done" timestamp (2:06 PM,
a spike reading 219-231F) is now correctly reported as 5:07 PM (the
real, sustained crossing).

Caught and fixed a second bug while testing this: cook_notes.py's
save_note()/get_note()/load_notes() used `path=NOTES_FILE` as a
default argument, which binds at function-definition time -- a test
monkeypatching NOTES_FILE had no effect on internal callers (history.py/
report.py) that omit `path`. Changed to `path=None` with a dynamic
`path or NOTES_FILE` lookup inside each function.
@ctopherwilliams
ctopherwilliams merged commit ba0309b into main Jul 5, 2026
5 checks passed
@ctopherwilliams
ctopherwilliams deleted the feat/cook-notes-and-sustained-crossing branch July 5, 2026 15:04
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