LAB17 — Complete and defend the capstone
Begin from a preserved CP08 Sensor Monitor exercise repository. Plan several practice sessions. CP08 supplies basic normal/fault behavior and tests; your task adds the capstone behavior. CP09 is the instructor reference, to inspect after your own attempt or for a specific diagnosed uncertainty.
Write requirements and independent expected cases before implementation. Preserve missing/nonfinite/stale faults and two consecutive fresh valid samples for recovery. Add a default 28.0 °C threshold, inclusive alert entry, inclusive clearing at threshold minus 1.0 °C, and state retention within the band. After FAULT, classify the second fresh sample against the entry threshold.
Accept only complete threshold <decimal> lines terminated by LF, with an optional terminal CR and at most 64 bytes before LF. The range is 0–50 °C inclusive. Define the complete numeric grammar, reject trailing text and nonfinite tokens, preserve configuration on failure, drain oversized lines to the boundary, and handle partial host input as truncated. Valid changes re-evaluate current non-faulted input; they cannot clear FAULT. Reset restores default RAM-only configuration and FAULT/missing.
Implement in bounded slices: policy/configuration, parser, adapter/output, then verification and documentation. Compile the same shared implementation for host and firmware. Review each diff against its applicable requirement. Chapter 17 demonstrates alert-entry equality; complete the remaining cases independently.
Add the new parser source to the native source list in scripts/common.cmd (and scripts/native.py if using that appendix path). CP08 does not supply fixtures/commands.csv. After your initial integration attempt, inspect that fixture and docs/formats.md in a separately extracted CP09 reference, then copy only the command fixture into your exercise or author equivalent contract-based cases. Keep your own implementation intact.
From the final exercise root, record the maintained checks:
.\scripts\test.cmd
.\scripts\replay.cmd fixtures/normal.csv
.\scripts\replay.cmd fixtures/commands.csv
.\scripts\replay.cmd fixtures/stale-recovery.csv
.\scripts\replay.cmd fixtures/rollover.csv
.\scripts\build-firmware.cmd
Map results to expectations, including startup recovery, both hysteresis directions, equality, jitter, interrupted recovery, stale time and rollover, valid and malformed commands, overflow, truncation, and reset. Distinguish malformed-fixture exit 2 from successful synthetic replay that intentionally includes FAULT. Preserve actual records rather than substituting the reference's expected outputs.
Use separate FAULT-hysteresis and FAULT-command copies to show that meaningful, compiling defects are behaviorally rejected. Preserve the good solution and show it still passes. Never adjust expected values to make a known faulty comparison appear correct.
Package a private release candidate containing complete source, reviewed history/diff, requirements, sourced target facts, formats, setup, decisions, release notes, evidence, and handoff. Create a fresh second checkout of the intended release source and reproduce the written setup and required checks. A clean status by itself does not demonstrate reproduction.
Submit the source, requirement-to-test map, actual host/replay/build receipts, mutation evidence, second-checkout result, documentation, and skill/fresh-session records. Score with the capstone rubric: suggested pass 80/100 plus mandatory reproducible build, critical behavior, host/replay checks, and honest labeling. Physical equipment, public release, and bench validation are separate optional work. Figures: SS17-01–05; HP06 applies only to an actually performed physical supplement.
