Files
tool-mock/docs/GUIDELINES.md
T
mikkeli d4bd72ab83 Adopt designed front matter: typed, with staleness on plans
Replaces `type: default` — one value across every document, read by nothing,
so it discriminated nothing. Types are now reference, guidelines, plan and
report, applied to every markdown file with no exceptions for the hub.

Plans carry status and updated, reports carry date. REPOS.md already noted
that plans go stale and reports do not, but nothing made that visible: a plan
from months ago looked identical to one written today.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013kj58Jugkic783b8ZrtTVZ
2026-09-04 14:14:19 +09:00

29 lines
1.3 KiB
Markdown

---
type: guidelines
---
# Mock and fixture guidelines
## 1. Fixtures publish the real contract
- A fixture emits the **real topic with the real payload schema**. `yukart/gnss/fix`
from a replayed track must be indistinguishable, at the bus, from a real fix.
- A fixture that invents its own topic or shape is worse than no fixture: it defers
the integration work instead of removing it.
## 2. Do not reimplement our own services
- Stub the **car** and the **hardware**. Never write a *separate* implementation of
`svc-gw`, `svc-nav` or anything else we wrote — a second implementation of our own
contract will drift from the first.
- A service mocking **itself**, behind its own input interface, is the right shape:
one codebase, one contract implementation, a swappable data source. That belongs
in the service's own repo, not here.
- None of our services touch hardware, so they all run on x86 unmodified either way.
## 3. Prefer upstream tools, wrap rather than rewrite
- `vcan`, `canplayer` and ICSim already solve the CAN problem. This repo holds the
scripts that drive them, not reimplementations of them.
## 4. Recorded logs are data, not source
- `candump` logs and GPX tracks are artifacts. Reference them, do not commit them.
## 5. To be added