---
id: M08-L02
title: "Implement and review the capstone"
module: M08
chapters: "17"
checkpoint: "CP08 to CP09"
---

# M08-L02 — Implement and review the capstone

Implement the feature in small slices and explain the resulting diff. Begin from the reviewed CP08 baseline and the plan from M08-L01. Use CP09 as the instructor reference after your attempt or for a specific diagnosed uncertainty.

Add ALERT and threshold configuration to shared policy. Preserve validity checks and the two-sample recovery gate before alert classification. From NORMAL use inclusive entry; from ALERT use inclusive clearing one degree below the threshold. Recovery classifies fresh input rather than retaining old state.

Add a validated setter that leaves the prior threshold intact after nonfinite or out-of-range values. Apply accepted changes only to current non-faulted state. The command collector must be bounded, drain oversized input to LF, and reset for the next command. Check the complete decimal grammar before conversion; a numeric prefix from `28junk` is not acceptable.

Validate the wider converted number before narrowing to float so a slightly out-of-range value cannot round into range. Handle CRLF, repeated commands, and EOF truncation. Firmware waits for LF without blocking its loop; host command mode ends at EOF. Do not invent a timeout or persistence feature.

Integrate the parser into the shared build lists, host adapter, and firmware loop. Keep work per loop bounded. Add threshold startup/configuration output and ALERT formatting while preserving synthetic labels and null unavailable temperature. A recovering sample can have a current numeric value while remaining FAULT.

Run appropriate checks after each slice. Review both source and test diffs; expected values must come from requirements. Reject unrelated redesign. Record failed attempts and their causes rather than replacing them with a final successful story.

## Reading the recorded demonstration

Some punctuation in the recorded terminal output renders incorrectly, and a few long source lines extend beyond the editor viewport. Use the supplied UTF-8 source files to read those lines in full. The displayed test results and policy decisions remain the evidence being discussed; a terminal display artifact does not establish a behavioral failure.

## Resources and completion

Read Chapter 17 and the matching Sensor Monitor checkpoint README, requirements, and evidence notes. Project paths are relative to its root. Figures: SS17-02. Attempt the [exercise](exercise.md), preserve actual results, then use the separate instructor answer key. 

Source resources: [Chapter 17](../../../../book/chapters/ch17/chapter.md); [checkpoint and recovery map](../../../../examples/sensor-monitor/docs/checkpoints.md). Use the README and requirements inside your named checkpoint; the repository's final CP09 files include features absent from earlier stages. The [capstone rubric](../capstone-rubric.md) defines scoring and mandatory evidence gates.
