Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ff2d840
plan: requirement abstraction rules (spec not plan, no test info, hel…
arcadien Nov 20, 2026
5f7b71a
req(PLAT-POWER-008,PLAT-ISP-001,PLAT-DEBUG-001): awake pin states (fr…
arcadien Nov 20, 2026
0298503
test(FUNC-X10-005,FUNC-X10-006,FUNC-X10-007,PLAT-POWER-004,PLAT-DEBUG…
arcadien Nov 20, 2026
d4563d0
test(FUNC-DECODE-001,UI-DECODE-001,UI-DECODE-003): retag loopback and…
arcadien Nov 20, 2026
02cbdea
refactor: remove unused AnalogFilter and dec32ToHex with their tests …
arcadien Nov 20, 2026
f72a545
req(TECH-HAL-001,TECH-HAL-006,TECH-MAIN-001,TECH-DECODE-002,TECH-DECO…
arcadien Nov 20, 2026
8c5bf09
req(PLAT-POWER-001,PLAT-POWER-003..007,PLAT-DECODE-003..005): drop ve…
arcadien Nov 20, 2026
1a3ac8e
req(CONF-BUILD-003,CONF-BUILD-007,CONF-BUILD-011,CONF-BUILD-013..015,…
arcadien Nov 20, 2026
a3e2f63
req(FUNC-OREGON-015,FUNC-BATTERY-002,FUNC-SENSOR-001,FUNC-SENSOR-002,…
arcadien Nov 20, 2026
59c7207
req(UI-DECODE-001..003): test sentences become behaviour examples or …
arcadien Nov 20, 2026
ef99dd0
test(PLAT-DECODE-003..005,PLAT-ISP-001,PLAT-POWER-008,PLAT-POWER-007,…
arcadien Nov 20, 2026
9482bb6
arch(PLAT-POWER-008,PLAT-ISP-001,PLAT-DEBUG-001,PLAT-POWER-007): rows…
arcadien Nov 20, 2026
53e7b93
docs: point WIRING and BACKLOG to PLAT-POWER-008 (TECH-HAL-004 deprec…
arcadien Nov 20, 2026
4597897
plan: bench sheets carry an @req tag like tests; tag convention @req …
arcadien Nov 20, 2026
49a0bc4
test(PLAT-DECODE-003..005,PLAT-ISP-001,PLAT-POWER-001,PLAT-POWER-003,…
arcadien Nov 20, 2026
68d0510
plan: bench tests are run by hand before each release; a release is t…
arcadien Nov 20, 2026
5ad52ad
test(PLAT-DECODE-003..005,PLAT-ISP-001,PLAT-POWER-001,PLAT-POWER-003,…
arcadien Nov 20, 2026
adaab59
plan: a requirement checked by build or inspection carries a Verifica…
arcadien Nov 20, 2026
8a34334
req(TECH-HAL-001,TECH-DECODE-003,TECH-SERIAL-002,CONF-BUILD-003,CONF-…
arcadien Nov 20, 2026
ec05447
req(PLAT-POWER-001,PLAT-POWER-003,PLAT-POWER-008,PLAT-ISP-001,PLAT-DE…
arcadien Nov 20, 2026
7a654bc
plan: audit 2026-11-20, since b015593, on ec05447 (12 findings open)
arcadien Nov 20, 2026
81fcb8f
req(TECH-DECODE-002,TECH-SERIAL-002,TECH-HAL-003..005,TECH-SERIAL-001…
arcadien Nov 20, 2026
ce96f94
req(PLAT-DEBUG-001,PLAT-POWER-007,PLAT-ISP-001): PLAT-DEBUG-001 deriv…
arcadien Nov 20, 2026
97906e8
test(PLAT-POWER-004): tag the native LED tests too (audit 2026-11-20 …
arcadien Nov 20, 2026
60c8ce5
arch(TECH-MAIN-001,PLAT-DEBUG-001): TECH-MAIN-001 row without test en…
arcadien Nov 20, 2026
7bd5642
docs: debugging.md points to PLAT-ISP-001 and its bench sheet instead…
arcadien Nov 20, 2026
27fd3a0
plan: audit 2026-11-20, 11 findings fixed, 1 excluded (HIST-COMMIT-MI…
arcadien Nov 20, 2026
6cc14bc
plan: audit 2026-11-20 (2), full, rbd 0.17.0, on 27fd3a0 (7 findings …
arcadien Nov 20, 2026
c4ec819
req(TECH-SENSOR-001,TECH-SERIAL-002): constraint and reason only for …
arcadien Nov 20, 2026
1a5c44b
req(PLAT-POWER-001,PLAT-POWER-003,PLAT-POWER-004,FUNC-X10-005): Verif…
arcadien Nov 20, 2026
4f4c434
arch(FUNC-X10-005,FUNC-SENSOR-003): X10 row restates the current timi…
arcadien Nov 20, 2026
2ff756f
plan: audit 2026-11-20 (2), 4 findings fixed, 3 excluded (HIST-COMMIT…
arcadien Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .rbd/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ id_format:
test_tagging:
language: cpp
framework: unity
convention: "// @req {id}" # placed above the test function
convention: "@req {id}" # C++: "// @req {id}" above the test function; bench sheet: "<!-- @req {id} -->" on its first line
bench_sheets: "tests/bench/{id}.md" # manual test of a requirement no software test can cover

linter:
# tinyDecoders/ is the 433 MHz receiver sub-project; its .pio/ build tree is skipped
Expand Down
14 changes: 12 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Protocol encoders receive a `Hal*` at construction and call only HAL methods —

Tests run on the host (`-e native_debug` and the `native_cycle_*` environments, `-DNATIVE`). The test harness instantiates `TestHal_` and passes it to the encoder under test. Protocol correctness is verified by checking the `Orders` vector against expected character sequences — e.g., a zero bit must produce `{'H','D','L','P','H','D'}`. This verifies timing ordering without hardware.

Test suites: `test_oregon`, `test_lacrosseWS7000`, `test_x10`, `test_conversionTools`, `test_analogFiltering`, `test_power`, `test_led`, `test_softSerial`, `test_ds18b20`, `test_x10_hal`, `test_environment`, `test_main_cycle` (only in `native_cycle_*`).
Test suites: `test_oregon`, `test_lacrosseWS7000`, `test_x10`, `test_conversionTools`, `test_power`, `test_led`, `test_softSerial`, `test_ds18b20`, `test_x10_hal`, `test_environment`, `test_main_cycle` (only in `native_cycle_*`).

### `src/main.cpp`

Expand All @@ -71,9 +71,19 @@ This project uses Requirement-Based Development. **Every code change must origin
- Requirements live in `requirements/*.md` (functional, technical, performance, ui, configuration, platform).
- Architecture is tracked in `docs/architecture.md` — updated with an `arch(ID):` commit whenever a requirement changes the component diagram.
- Commit prefixes are mandatory: `req()`, `test()`, `feat()`, `tech()`, `perf()`, `ui()`, `conf()`, `arch()`, `plan:`.
- Every Unity test function must carry a `// @req FUNC-DOMAIN-NNN` tag on the line above it.
- Every Unity test function must carry a `// @req FUNC-DOMAIN-NNN` tag on the line above it, and every bench sheet a `<!-- @req ID -->` tag on its first line.
- ID format: `FUNC-DOMAIN-NNN` (e.g. `FUNC-OREGON-001`, `TECH-HAL-001`).

Requirements are a spec, not a plan. Each one passes four checks:
1. **Observable** from outside the unit (radio output, pins, screen, serial lines, build result), or a design constraint that has a reason (testability, memory, no hardware access).
2. **Survives a refactor**: no class, method, file or register name, except at a boundary interface (`Hal`, `ReceiverHal`, `runCycle`, build flags, environments).
3. **States its reason** when it is not obvious.
4. **Verifiable on its own**.
- The "how" (classes, helpers, registers, file layout) goes in `docs/architecture.md` and code comments.
- **No test information in a requirement**: no "Test:", "Verified by", "Acceptance:", "native test", "bench check pending". Input → output examples that define the behaviour stay, as "Examples:". One exception: a requirement checked automatically by something that is not a test carries `**Verification:** build — <how>` or `**Verification:** inspection — <how>` (before the description); manual hardware checks never go there, they are bench sheets.
- A helper's unit tests are tagged with the requirement whose behaviour uses the helper (`dec16ToHex` tests → FUNC-X10-006/007).
- A requirement no software test can cover gets a bench test sheet `tests/bench/<ID>.md`, tagged like a test: `<!-- @req <ID> -->` on its first line, one line per requirement it covers (requirement link, equipment, setup, steps, pass criteria, results table filled at each run); Bench tests are run by hand before each release, in the order of `tests/bench/bring-up.md`; a release is tagged only when every sheet has a passing line for it.

To start a new requirement: invoke `/rbd` and describe the intent. The workflow dispatches `requirement-analyst` → `test-builder` → `code-builder` in sequence.

Every report in `audits/` (`/rbd-audit`, `/rbd-review`) states on its first line under the title the full hash of the commit it audited (`Audited commit:` or `Reviewed commit:`), so `git diff <hash>..HEAD -- requirements docs emitter lib tinyDecoders` shows what changed since the last audit.
Expand Down
88 changes: 88 additions & 0 deletions audits/2026-11-20-audit-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Audit Report — 2026-11-20

Audited commit: 27fd3a0a0d33d629a10e7c8b2b93c45a79b9081a — branch `req/abstraction` — PR #94

Mode: full

Plugin rbd 0.17.0 (bench sheets count as tests). Agents: `audit-traceability`, `audit-coherence`; both returned valid output. `audits/exclusions.yml` holds 7 exclusions; the entries they cover are not repeated.

30 raw entries (14 traceability, 16 coherence) merged into 7 findings and 20 info items.

## Summary

| # | Finding | Status |
|---|---------|--------|
| 1 | PLAT-DEBUG-001 has a test commit but no implementation commit (code committed under the deprecated TECH-SERIAL-001) | excluded |
| 2 | Two old `arch()` commits cite IDs removed since (CONF-DECODE-001, PLAT-DECODE-001) | excluded |
| 3 | TECH-SENSOR-001 (draft) only names the code behind FUNC-SENSOR-002 and ends with plan text | fixed |
| 4 | TECH-SERIAL-002 (draft): the `name value unit` line is not pinned down; its title names `SoftSerial` | fixed |
| 5 | PLAT-POWER-001 and 003: their Verification line mentions the bench sheet | fixed |
| 6 | FUNC-X10-005 and PLAT-POWER-004 both state the X10 LED framing; PLAT-POWER-004 derives from FUNC-X10-005 only | fixed |
| 7 | Back-references in text make parent and child depend on each other (TECH-MAIN-001 / FUNC-MAIN-001, TECH-HAL-006; UI-DECODE-001 / FUNC-DECODE-007, UI-DECODE-003; PLAT-DECODE-005 / CONF-DECODE-004) | excluded |

## Resolution (2026-11-20)

- 1: excluded, HIST-COMMIT-MISMATCH-001 extended with PLAT-DEBUG-001 (reported to the rbd plugin: T3 should follow `**Superseded by:**`).
- 2: excluded, HIST-ARCH-REMOVED-ID-001.
- 3, 4: TECH-SENSOR-001 reduced to its constraint and reason; TECH-SERIAL-002 lists the exact lines `main.cpp` writes.
- 5: PLAT-POWER-001 and 003 Verification lines keep only the inspection.
- 6: the LED sentence leaves FUNC-X10-005; PLAT-POWER-004 also depends on FUNC-SENSOR-003 (not on FUNC-MAIN-001, which already depends on it).
- 7: excluded, TEXT-BACKREF-001.
- Info items fixed with them: the FUNC-X10-005 architecture row (current timings, no deprecated link), the LightSensor edge (5 × 30 ms), "Oregon v2.1" in the luminosity note.

## Findings

### Finding 1
**Type:** Traceability — implementation coverage (T3)
**Requirement:** PLAT-DEBUG-001
**Issue:** `test(PLAT-DEBUG-001)` (0298503) exists, but no implementation commit cites PLAT-DEBUG-001: the code is 6817d72 `tech(TECH-SERIAL-001)`, now deprecated with `**Superseded by:** PLAT-DEBUG-001`. 0298503 is not a tag-only backfill (it also edits comments), and neither HIST-COMMIT-MISMATCH-001 nor HIST-BACKFILL-001 lists PLAT-DEBUG-001. PLAT-POWER-008, in the same situation, is not flagged because its only tests are bench sheets.
**Status:** excluded
**Exclusion ref:** HIST-COMMIT-MISMATCH-001

### Finding 2
**Type:** Traceability — architecture currency (T5)
**Requirements:** CONF-DECODE-001, PLAT-DECODE-001
**Issue:** ee76804 `arch(CONF-DECODE-001)` and b7b07fc `arch(PLAT-DECODE-001)` (2026-11-09) cite IDs that were later removed from the requirement files (aecbdb3, a25dc41). Valid when committed; historical.
**Status:** excluded
**Exclusion ref:** HIST-ARCH-REMOVED-ID-001

### Finding 3
**Type:** Coherence — precision (C2)
**Requirement:** TECH-SENSOR-001
**Issue:** The draft names the `Ds18b20` class, `emitter/include/Ds18b20.h`, `Begin()` / `Convert()` / `Read()`, `hal->Delay1s()` and the driver calls, and ends with "Not implemented yet: to do when the DS18B20 path is validated again". Keep the constraint and its reason (PA3 released after the read, no AVR register in the cycle); the rest belongs in docs/architecture.md. To do with the DS18B20 rework (#54, #56).
**Status:** fixed

### Finding 4
**Type:** Coherence — precision (C2)
**Requirement:** TECH-SERIAL-002
**Issue:** The line format `name value unit` gives no exact name and unit per value, no order and no number format, so two implementations would differ. The title still names the `SoftSerial` class.
**Status:** fixed

### Finding 5
**Type:** Coherence — precision (C2)
**Requirements:** PLAT-POWER-001, PLAT-POWER-003
**Issue:** "…; current and period measured by the bench sheet" and "…; pin levels measured by the bench sheet" are test information in the Verification line. The sheet carries the tag; the requirement need not mention it. Keep only the inspection `<how>`.
**Status:** fixed

### Finding 6
**Type:** Coherence — overlap (C1)
**Requirements:** FUNC-X10-005, PLAT-POWER-004
**Issue:** FUNC-X10-005 says "the LED is lit from before the first copy until after the last", which PLAT-POWER-004 defines for every transmission. PLAT-POWER-004 derives from and depends on FUNC-X10-005 only, though it also covers FUNC-SENSOR-003 and FUNC-MAIN-001. Keep the LED sentence in PLAT-POWER-004 only.
**Status:** fixed

### Finding 7
**Type:** Coherence — circular dependency (C4, in substance)
**Requirements:** TECH-MAIN-001, FUNC-MAIN-001, TECH-HAL-006; UI-DECODE-001, FUNC-DECODE-007, UI-DECODE-003; PLAT-DECODE-005, CONF-DECODE-004
**Issue:** The declared Dependencies graph has no cycle, but in each group the parent's text cites a child that lists the parent as a dependency (e.g. TECH-MAIN-001 cites FUNC-MAIN-001 and TECH-HAL-006, which both depend on TECH-MAIN-001). Either move the cited behaviour out of the parent, or accept these as back-references.
**Status:** excluded
**Exclusion ref:** TEXT-BACKREF-001

## Info (no action required)

- **T1, build or inspection:** CONF-BUILD-003, 007, 011, 014, 015, CONF-DECODE-002..004, TECH-HAL-001, TECH-DECODE-003.
- **T1, bench check pending for the latest release tag v1.0.0** (every Results table is empty): tests/bench/FUNC-SENSOR-001.md, PLAT-DECODE-003.md, PLAT-DECODE-004.md, PLAT-DECODE-005.md, PLAT-ISP-001.md, PLAT-POWER-001.md, PLAT-POWER-003.md, PLAT-POWER-005.md, PLAT-POWER-006.md, PLAT-POWER-007.md, PLAT-POWER-008.md.
- **T3:** bench-only requirements need no implementation commit: FUNC-SENSOR-001, PLAT-POWER-005, 007, 008, PLAT-ISP-001.
- **C2:** CONF-BUILD-012 ends with "which closes BACKLOG F1"; CONF-BUILD-003 keeps a history note (the old 0xA5 limit); CONF-BUILD-014 says "the environment docs list it" without naming docs/environments.md or the fields; FUNC-OREGON-009 does not say what byte 2 holds before any valid channel is set.
- **C1:** the low-battery muting rule is written in FUNC-BATTERY-003 and repeated as "while the battery is not low" in FUNC-X10-006, FUNC-X10-007, FUNC-SENSOR-003 and FUNC-ANALOG-001; they agree today.
- **C5:** the FUNC-X10-005 row points to the deprecated TECH-X10-001, whose note gives DelayX10BitLong 1120 µs where FUNC-X10-005 says a `1` low is 1680 µs (560 + 1120); the TECH-MAIN-001 row omits the call order and still lists `platformio.ini`; the component diagram shows `LightSensor -->|Delay30ms|` while FUNC-SENSOR-003 waits 150 ms, and the "Luminosity always uses Lacrosse" note says "Oregon v3"; the CONF-BUILD-014 row omits the 1104 mV calibration and the docs listing; the BMx280 Dependency Injection Map row is "— (none)" on purpose (TECH-HAL-001).
- **Checks with no finding:** T2 (no unknown ID; no bench sheet cites a draft or deprecated requirement), T5 (every validated requirement has a row), T6a (all 145 Unity test functions, 3 shell checks and 11 bench sheets tagged), T7 (every PLAT derives from a validated FUNC or TECH requirement), T8 (all IDs linked), C3 (no validated requirement rests on a draft), no cycle in Dependencies.
Loading