Skip to content

Commit 821bbfb

Browse files
malysclaude
andcommitted
docs: describe the write gate the code actually implements
The previous wording claimed speed must be readable and exactly 0 km/h and that park never overrides a refusal. VehicleWriteGate does neither: allowUpToKmh lets a caller open the gate up to 50 km/h, and an unreadable speed is rescued to ALLOWED when the gear reads park. A safety invariant documented as already held is worse than one documented as owed — the next change reads this file, believes the gate is closed, and builds on top of it. Both widenings are named here as debt, with the target the rest of the suite already describes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 0149d39 commit 821bbfb

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎AGENTS.md‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,16 @@ The apps are thin; the vehicle lives here.
1616

1717
## Non-negotiables
1818

19-
- **The 0 km/h gate is here.** `VehicleWriteGate` permits a vehicle-setting write only when
20-
speed is readable and exactly 0 km/h, inside the low-level write primitives. Every setter
21-
carries `@RequiresStandstill`; coverage keeps the set honest. Unknown/negative speed
22-
fails closed, and park state does not override that refusal.
19+
- **The 0 km/h gate is here.** `VehicleWriteGate` decides every vehicle-setting write inside
20+
the low-level write primitives. Every setter carries `@RequiresStandstill`; coverage keeps
21+
the set honest. Unknown or negative speed fails closed, and a moving reading is never
22+
rescued by anything.
23+
Two widenings of that rule are still in the code and are **safety debt to remove, not a
24+
pattern to extend**: `allowUpToKmh`, a caller-settable threshold of up to 50 km/h, and the
25+
park rescue, which turns an unreadable speed into ALLOWED when the gear reads park. The
26+
target the suite documents (`MG4Tasker/AGENTS.md`, `MG4Control/AGENTS.md`) is a fixed gate
27+
at a *readable* 0 km/h with no threshold and no rescue. Do not describe the gate as already
28+
being that until this file says so.
2329
- **Per-firmware routing, never universal.** SWI68/69/131/132/133/165 differ; dispatch
2430
through `FirmwareInfo`. Any new vehicle call must branch per generation.
2531
- **Unreadable ≠ a value.** Getters return null / -1 when the layer is not ready or the

0 commit comments

Comments
 (0)