feat: manual cook notes + fix a real stage-crossing bug - #27
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cook_notes.py: attach cut, weight, a corrected--on-grilltime (sensor logging can start after the meat actually went on), and a verdict/notes to a past cook viahistory.py note <id> ....history.py showand the Cook Report both display it automatically.history.stage_hits()reusesplot.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.path=NOTES_FILE-as-default-argument late-binding bug incook_notes.pyitself while writing its own tests.Test plan
note+showdisplay,_parse_time_of_day, the sustained-crossing fix against a synthetic probe-reinsertion spike, report.py note + on-grill-override display)history.py showand 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