feat(cli): add timeline command for annotated cook milestones#285
Open
jongio wants to merge 1 commit into
Open
feat(cli): add timeline command for annotated cook milestones#285jongio wants to merge 1 commit into
jongio wants to merge 1 commit into
Conversation
Add a `timeline` command that condenses a saved cook into the moments that matter: the start, the low point, the longest stall, the first target crossing, the peak, and the end. Each line shows elapsed clock time, temperature, and a short label so you can read the shape of a cook without scrubbing every reading. Adds a pure SDK helper `buildCookTimeline` (linear-time stall detection via a sliding window with monotonic min/max deques) plus unit tests, the CLI command with parsing/formatting tests, and reference docs. Closes #284 Co-authored-by: Copilot App <[email protected]>
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.
Adds a
timelinecommand that turns a saved cook into an annotated timeline. It reads an archive, picks a probe channel, and marks the milestones worth knowing about: the start, the low point, the longest stall, the first crossing of a target temperature, the peak, and the end. Each line shows elapsed clock time, the temperature, and a short label, so you can read the shape of a cook at a glance instead of scrubbing through every reading.What is new
buildCookTimeline(readings, options)inpackages/sdk/src/timeline.ts. Pure and side-effect free. Stall detection runs in linear time using a sliding window with monotonic min/max deques. Non-anchor milestones that land on the first or last reading fold into the start and end lines, and when two milestones share a reading the more specific one wins (target over stall over peak over low).thermoworks timeline <SERIAL> [--archive ID] [--channel N] [--target F] [--json]. Defaults to the latest archive. Converts Celsius readings to Fahrenheit before analysis.packages/cli/README.mdanddocs/cli-reference.md.Example
Verification
pnpm --dir packages/sdk typecheck && test(488 tests)pnpm --dir packages/cli typecheck && test(891 tests)pnpm lintCloses #284