---
id: M08-L01
title: "Plan the capstone feature"
module: M08
chapters: "17"
checkpoint: "CP08"
---

# M08-L01 — Plan the capstone feature

Translate configurable alerts into a requirement-to-check plan. CP08 contains normal/fault behavior; CP09 is the final reference. Keep existing missing/nonfinite/stale handling and two-sample recovery while adding thresholds, hysteresis, and commands.

Default threshold is 28.0 °C. From NORMAL, enter ALERT at or above it. From ALERT, clear at or below threshold minus 1.0 °C. Inside the band retain the prior non-fault state. After FAULT recovery, classify using the fresh entry threshold rather than restoring an old alert. Startup still requires two fresh valid samples.

Write expected cases with starting state: 27.5 from NORMAL differs from 27.5 from ALERT. Include entry equality 28.0, clear equality 27.0, boundary jitter, interrupted recovery, and stale gaps. Derive expectations before inspecting a proposed patch.

The command is `threshold <decimal>` with LF termination, optional final CR, maximum 64 bytes before LF, and a 0–50 °C inclusive range. Settings are RAM-only. Reject malformed suffixes, exponents, invalid whitespace, nonfinite words, out-of-range numbers, oversize, and truncation without changing configuration.

A valid setting immediately re-evaluates a current non-faulted reading against the entry threshold. It cannot clear FAULT or advance recovery. Reset restores 28.0 and FAULT/missing. Poll injected time before a command so stale data is not treated as current.

Plan four slices: policy/configuration, parser, adapter/output integration, then full verification and documentation. Preserve shared source between host and firmware. Establish a CP08 baseline before editing, and inspect each bounded diff. Hardware and public publication are not capstone prerequisites.

## Reading the recorded demonstration

The recorded plan contains adjacent threshold examples without a clear separator. Treat each as a separate command: for example, `threshold 28` and `threshold 30` are two examples, not one combined input. The grammar and rejection rules above govern the implementation.

## 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-01. 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.
