docs(spec): park the phase 1a review's minor findings in the spec

They were recorded only in the plan's scratch ledger, which is deleted
when the plan finishes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-10-21 01:59:42 -04:00
1 parent 278921796a
commit e1af35e1d0
1 file changed
+34
@@ -374,6 +374,40 @@ Each phase is its own implementation plan and its own merge.
- `0x08` is named `read_event_index` in `micromate/`; it is the preferences
block.
## Left open by the phase 1a review (2026-10-21)
Minor findings from the whole-branch review, parked here so they outlive the
plan's scratch ledger. None blocks 1a; the phase each one matters to is named.
- **CORS ordering (1c, if a browser calls SFM directly).** The `/device` guard
middleware is registered after CORS, so it sits outside it: its 409/501
responses carry no `access-control-allow-origin`, and an OPTIONS preflight to
a guarded URL gets the guard's refusal instead of CORS's 200. Register CORS
last, or let OPTIONS through. Terra-View proxies server-side and is not
affected.
- **Legacy handlers take no unit lock (1c / phase 3).** The guard checks for a
held line and then lets the legacy handler run unlocked; a legacy request
admitted just before a Series-4 call-up at the same address can overlap it.
- **Address keys are not normalised.** `tcp:<host>:<port>` is the raw string:
a hostname vs an IP, or `/dev/serial/by-id/...` vs `/dev/ttyACM0`, gets two
locks for one link.
- **A serial-less request to an UNHELD Micromate still runs Series-3 bytes.**
The guard only knows about lines SFM holds. This is the phase-2 opcode
guard's job.
- **`tcp_port` coercion mismatch.** The guard parses with `int()`, pydantic
coerces more loosely (`"9034.0"`), so such a request passes the guard
unchecked. Parse with pydantic's own int coercion, or fail closed.
- **Test gaps.** The middleware wrapper itself is untested (a raw ASGI call
works without httpx); the contract test compares field names of one shared
dataclass, which cannot fail, and does not enforce "a field absent for one
series lives under `detail`".
- **`_ensure_reaper` race.** Two first Series-4 requests at once can start two
reaper threads; harmless because `try_hold` keeps them off each other's units.
- **Held serial lines share `/dev/ttyACM0` silently.** pyserial's open is not
exclusive, so a bench script beside a held line interleaves bytes with the
keep-alive; it looks like a dead unit. Open with `exclusive=True`, or don't
hold serial links.
## Table 2: to be added later (both series)
| area | item |