diff --git a/CLAUDE.md b/CLAUDE.md index 0f4fd74..3d7c39b 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -70,7 +70,7 @@ 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:`. +- Commit prefixes are mandatory: `req()`, `test()`, `feat()`, `tech()`, `perf()`, `ui()`, `conf()`, `plat()` (PLAT implementation, rbd ≥ 0.18), `arch()`, `plan:`. - Every Unity test function must carry a `// @req FUNC-DOMAIN-NNN` tag on the line above it, and every bench sheet a `` tag on its first line. - ID format: `FUNC-DOMAIN-NNN` (e.g. `FUNC-OREGON-001`, `TECH-HAL-001`). @@ -144,7 +144,7 @@ Current-limiting and pull resistors sit **at the board end**, never at the LED o Strip EXIF/GPS from every image before committing: `python3 ~/.claude/skills/hardware-change/scripts/strip_exif.py ` (`--check` to verify). ### Commits -The rbd plugin's pre-push hook (a Claude Code hook on `git push`) checks the prefixes. It accepts the RBD ones above (`req()`…`arch()` must cite a validated ID), `plan:`, `hw:` for hardware (`enclosing/`, `hardware/`, from `.rbd/config.yml` `extra_commit_prefixes`), `docs:` for doc-only commits, and `fix:`, `chore:`, `style:`, `refactor:`. Make granular commits, one per area, and push after each. +The rbd plugin's pre-push hook (a Claude Code hook on `git push`) checks the prefixes. It accepts the RBD ones above (`req()`…`arch()`, `plat()` included, must cite a validated ID), `plan:`, `hw:` for hardware (`enclosing/`, `hardware/`, from `.rbd/config.yml` `extra_commit_prefixes`), `docs:` for doc-only commits, and `fix:`, `chore:`, `style:`, `refactor:`. Make granular commits, one per area, and push after each. ## Modeling diff --git a/audits/2026-11-23-audit.md b/audits/2026-11-23-audit.md new file mode 100644 index 0000000..7c101c3 --- /dev/null +++ b/audits/2026-11-23-audit.md @@ -0,0 +1,60 @@ +# Audit Report — 2026-11-23 + +Audited commit: b979667ce422a276b96b59e6696720aec2b9c674 — branch `plan/rbd-0.18` + +Mode: since 27fd3a0a0d33d629a10e7c8b2b93c45a79b9081a + +Plugin rbd 0.18.0 (T3 follows `**Superseded by:**`, `plat()` prefix). Agents: `audit-traceability`, `audit-coherence`; both returned valid output. + +9 raw entries (4 traceability, 5 coherence) merged into 4 findings and 5 info items. + +## Summary + +| # | Finding | Status | +|---|---------|--------| +| 1 | 6132405 `style:` changed the requirement files (plan files) without a `plan:` prefix | excluded | +| 2 | PLAT-POWER-004 needs FUNC-MAIN-001 to define an environment transmission, while FUNC-MAIN-001 depends on PLAT-POWER-004 | fixed | +| 3 | PLAT-POWER-004 does not say whether the LED goes off before or after the 40 ms gap of an X10 frame | fixed | +| 4 | TECH-SERIAL-002 does not say how float values become the logged unsigned decimals (truncation, negative temperature) | fixed | + +## Resolution (2026-11-23) + +- 1: excluded, STYLE-LAYOUT-001. +- 2, 3: PLAT-POWER-004 defines a transmission without FUNC-MAIN-001 and puts the X10 LED-off after the last gap. +- 4: TECH-SERIAL-002 states the truncation toward zero; a negative temperature has no defined line yet (the code converts a negative float to `uint16_t`, undefined; to fix when TECH-SERIAL-002 is validated). + +## Findings + +### Finding 1 +**Type:** Traceability — plan-file coverage (T4) +**Files:** requirements/*.md +**Issue:** 6132405 (PR #95) inserts 354 blank lines in the five requirement files under a `style:` prefix; `.rbd/plan-files.yml` accepts no other prefix than `plan:` on those files, and HIST-PREFIX-001 / SESSION-PREFIX-001 do not cover it. Layout only, already merged. +**Status:** excluded +**Exclusion ref:** STYLE-LAYOUT-001 + +### Finding 2 +**Type:** Coherence — circular dependency (C4, in substance) +**Requirements:** PLAT-POWER-004, FUNC-MAIN-001 +**Issue:** PLAT-POWER-004 says "each environment copy ([FUNC-MAIN-001]) is its own transmission", so it cannot be read without FUNC-MAIN-001, which depends on PLAT-POWER-004. Declaring the dependency would make a cycle; TEXT-BACKREF-001 does not cover this pair. State the transmission without FUNC-MAIN-001's copy concept (each frame copy an encoder sends on its own), or drop FUNC-MAIN-001's dependency on PLAT-POWER-004. +**Status:** fixed + +### Finding 3 +**Type:** Coherence — precision (C2) +**Requirement:** PLAT-POWER-004 +**Issue:** For an X10 frame the LED goes off "after its last bit" and "the 30 ms come after the 40 ms gap of its last copy"; whether the LED goes off before or after that gap is open. The code (`TRANSMIT_WITH_LED` around `Send()`) turns it off after the gap. +**Status:** fixed + +### Finding 4 +**Type:** Coherence — precision (C2) +**Requirement:** TECH-SERIAL-002 +**Issue:** The values are floats (`Measurements`) passed as `uint16_t`: humidity and pressure are truncated toward zero, and a negative temperature × 10 converted to `uint16_t` is undefined behaviour in C++. The requirement says "unsigned decimal" without the conversion, and nothing for negative temperatures. The logging path is built by no environment (TECH-SERIAL-002 is draft). +**Status:** fixed + +## Info (no action required) + +- **T3:** PLAT-DEBUG-001 is covered through 6817d72 `tech(TECH-SERIAL-001)`, TECH-SERIAL-001 being superseded by PLAT-DEBUG-001 (rbd 0.18); its removal from HIST-COMMIT-MISMATCH-001 is sound. +- **T1:** PLAT-POWER-001 and 003 are verified by inspection and covered by their bench sheets. +- **T1, bench check pending for the latest release tag v1.0.0:** 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. +- **C2:** TECH-SENSOR-001 (draft) does not say which layer releases PA3 (a `Hal` operation or the 1-Wire driver; the wrapper may not write registers per TECH-HAL-001), and cites PLAT-POWER-007 without listing it as a dependency. To settle with the DS18B20 rework. +- **C4:** PLAT-POWER-003 cites PLAT-POWER-006, which depends on it, and FUNC-SENSOR-002 cites TECH-SENSOR-001 ("Wrapper details"); same pattern as TEXT-BACKREF-001, not listed there. +- **Checks with no finding:** T2, T6a, T6b (no test file in range), T5, T7, T8 (all IDs linked). diff --git a/audits/exclusions.yml b/audits/exclusions.yml index e576a1f..498c1b8 100644 --- a/audits/exclusions.yml +++ b/audits/exclusions.yml @@ -4,8 +4,8 @@ exclusions: justification: "The code predates the RBD workflow; the test commits tagged existing tests (FUNC-ANALOG-001 to PLAT-POWER-004 added on 2026-11-17 by 7f4c027, 6fdc43a, 4919547). Adding implementation commits would mean rewriting master history." date: 2026-11-17 - id: HIST-COMMIT-MISMATCH-001 - finding: "Commit history mismatches for CONF-BUILD-002, CONF-BUILD-003, CONF-BUILD-013, FUNC-DECODE-003, FUNC-DECODE-005, TECH-SERIAL-001, CONF-BUILD-012, FUNC-SENSOR-003, PLAT-POWER-001, PLAT-POWER-003, TECH-HAL-001, TECH-DECODE-003, CONF-BUILD-007, CONF-BUILD-011, PLAT-DEBUG-001" - justification: "Merged history (chore: CI wiring, tests or code bundled in a neighbour commit). TECH-SERIAL-001 (6817d72 added its tests inside the tech commit), CONF-BUILD-012 (code in 0d775cc feat(FUNC-BATTERY-002), tag in d64fb61) and FUNC-SENSOR-003 (tags in a5987fb, tech: without ID) added on 2026-11-17 (audit 3, finding 10). It cannot change without rewriting master; the current tags and code are traced. Added on 2026-11-20 (audit 2026-11-20, finding 6): build/inspection requirements whose code predates RBD (TECH-HAL-001, CONF-BUILD-007, CONF-BUILD-011), was committed with fix(PLAT-POWER-003) (22eacc3), or under neighbour IDs (PLAT-POWER-001 under TECH-HAL-007, TECH-DECODE-003 under the FUNC-DECODE commits). PLAT-DEBUG-001 added on 2026-11-20 (audit 2026-11-20 (2), finding 1): its code is 6817d72 tech(TECH-SERIAL-001), deprecated with **Superseded by:** PLAT-DEBUG-001; T3 does not follow Superseded by yet." + finding: "Commit history mismatches for CONF-BUILD-002, CONF-BUILD-003, CONF-BUILD-013, FUNC-DECODE-003, FUNC-DECODE-005, TECH-SERIAL-001, CONF-BUILD-012, FUNC-SENSOR-003, PLAT-POWER-001, PLAT-POWER-003, TECH-HAL-001, TECH-DECODE-003, CONF-BUILD-007, CONF-BUILD-011" + justification: "Merged history (chore: CI wiring, tests or code bundled in a neighbour commit). TECH-SERIAL-001 (6817d72 added its tests inside the tech commit), CONF-BUILD-012 (code in 0d775cc feat(FUNC-BATTERY-002), tag in d64fb61) and FUNC-SENSOR-003 (tags in a5987fb, tech: without ID) added on 2026-11-17 (audit 3, finding 10). It cannot change without rewriting master; the current tags and code are traced. Added on 2026-11-20 (audit 2026-11-20, finding 6): build/inspection requirements whose code predates RBD (TECH-HAL-001, CONF-BUILD-007, CONF-BUILD-011), was committed with fix(PLAT-POWER-003) (22eacc3), or under neighbour IDs (PLAT-POWER-001 under TECH-HAL-007, TECH-DECODE-003 under the FUNC-DECODE commits)." date: 2026-11-17 - id: HIST-PREFIX-001 finding: "Plan and architecture files changed by commits with the wrong prefix (.rbd/config.yml, requirements/technical.md, requirements/platform.md, docs/architecture.md)" @@ -35,3 +35,7 @@ exclusions: finding: "A parent requirement cites in its text a child that lists it as a dependency (TECH-MAIN-001 / FUNC-MAIN-001, TECH-HAL-006; UI-DECODE-001 / FUNC-DECODE-007, UI-DECODE-003; PLAT-DECODE-005 / CONF-DECODE-004)" justification: "These citations give context (where the behaviour is specified), not a dependency: each parent is fully specified without the child, and the declared Dependencies graph has no cycle." date: 2026-11-20 + - id: STYLE-LAYOUT-001 + finding: "6132405 (style:) inserted blank lines between requirement fields in requirements/*.md" + justification: "Layout only (354 blank lines, no text change), merged in PR #95 before the plan: rule was checked. Later layout changes to plan files use plan:." + date: 2026-11-23 diff --git a/requirements/platform.md b/requirements/platform.md index 994b11b..6bed0d6 100644 --- a/requirements/platform.md +++ b/requirements/platform.md @@ -56,7 +56,7 @@ **derives_from:** [FUNC-X10-005](functional.md#func-x10-005) -**Description:** A transmission is one frame of an encoder, with all its copies: the repeated copies of an X10 frame ([FUNC-X10-005](functional.md#func-x10-005)) are one transmission, while each luminosity copy ([FUNC-SENSOR-003](functional.md#func-sensor-003)) and each environment copy ([FUNC-MAIN-001](functional.md#func-main-001)) is its own transmission. Every transmission of a cycle turns the LED on before its first bit, turns it off after its last bit, then waits 30 ms; for an X10 frame, the 30 ms come after the 40 ms gap of its last copy. +**Description:** A transmission is what one send of an encoder puts on air: an X10 frame with all its repeated copies and their gaps ([FUNC-X10-005](functional.md#func-x10-005)) is one transmission, while each frame copy the cycle sends on its own, such as each luminosity copy ([FUNC-SENSOR-003](functional.md#func-sensor-003)) or each environment copy, is its own transmission. Every transmission of a cycle turns the LED on before its first bit and off at its end, then waits 30 ms; for an X10 frame, the end is after the 40 ms gap of its last copy, so the LED goes off after that gap. --- diff --git a/requirements/technical.md b/requirements/technical.md index 60dea17..5e18e13 100644 --- a/requirements/technical.md +++ b/requirements/technical.md @@ -155,7 +155,7 @@ **Dependencies:** [PLAT-DEBUG-001](platform.md#plat-debug-001) -**Description:** With `USE_SERIAL_LOG`, each cycle writes one line per value it measures on the debug serial output ([PLAT-DEBUG-001](platform.md#plat-debug-001)), as `: ` with the value an unsigned decimal, in this order and only for the values the build measures: `Vbatt: mV`, `Raw analog: ADC`, `Analog voltage: mV`, `Luminosity: Lux`, `Temp.: °C`, `RH : <%> %`, `Pressure : hPA`. Without it, the firmware writes nothing and links no serial code, which keeps flash and cycle time for the sensor builds. +**Description:** With `USE_SERIAL_LOG`, each cycle writes one line per value it measures on the debug serial output ([PLAT-DEBUG-001](platform.md#plat-debug-001)), as `: `, the value being the measurement truncated toward zero to an integer and written as an unsigned decimal (a negative temperature has no defined line yet), in this order and only for the values the build measures: `Vbatt: mV`, `Raw analog: ADC`, `Analog voltage: mV`, `Luminosity: Lux`, `Temp.: °C`, `RH : <%> %`, `Pressure : hPA`. Without it, the firmware writes nothing and links no serial code, which keeps flash and cycle time for the sensor builds. ---