Skip to main content

Design Worksheet โ€” Before You Type

advanced10 min readLesson 203 of 204

Decide the invariants first: who owns the window, what reset means, and why the report is a total order โ€” then implement once.

Decisions to lock before implementing

  1. Window ownership. Where does "current window" live? (Hint: a single timestamp comparison in admit โ€” not a timer, not a thread.)
  2. Reset semantics. A window rolls on the first admit at a new timestamp: clear usage and ordinals together, or nothing.
  3. Reject paths are ordered too. Unknown tag and exhausted tag are both rejections โ€” one counter, two reasons, same discipline.
  4. The report is a total order. Timestamp asc, then code severity (REJECT < ADMIT), then stable insertion โ€” which makes snapshot() deterministic even for equal-timestamp evidence.
  5. Provenance. Admission.ordinal must survive the roll (restart at 1) โ€” learners who store ordinals globally fail the acceptance battery.

Write your answers as comments above each method, then implement. The acceptance battery below is the grader, in the practice and again โ€” harder โ€” in the checkpoint.

Now practice

Capstone Practice โ€” Admission CoreThe tag-limit and window mechanics of the capstone, graded on a deterministic clock.1 challenge ยท ยท ~20 minCapstone Practice โ€” Ops ReportThe audit trail as an exact string: total order over timestamps and severities, deterministic by construction.1 challenge ยท ยท ~15 min