From the Gemini adversarial review of Epic D, each checked against the
captures and firmware:
- The fixtures kept 13 real path bytes firmware leaves past a contact's
path end, and every contact's real advert times, which a public
observer's log could match back to the real nodes. Both are rewritten
now; path bytes no longer keep their repeats.
- Fail-closed: an unknown reply type or custom variable stops the run,
and GPS coordinates in the Offband GPS status text are replaced.
- Fixtures regenerated from the raw captures. None of the real keys,
names, positions, secrets, path fragments or advert times is in them;
the same search finds all of them in the raw captures.
- Hidden-contact stand-in keys no longer start with 0xFF, a reserved id
hash (companion-v1.18.0 MyMesh.cpp:951).
- ftoa edge cases (denormal, too small, too large, 0.001, 0.1) pinned to
the firmware function's output; the port already matched.
- OUTCOMES: the replay claim names its one normalization, and the leak,
the skipped gate and the early task closures are recorded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the Gemini adversarial review of Epics A and C, each checked before
fixing:
- TCP framing now matches ArduinoSerialInterface::checkRecvFrame: a zero
length is skipped, and a frame over MAX_FRAME_SIZE (176) is read to its
end and cut. New raw-socket tests; both fail on the old code.
- Remote preset tests waited for the fake to hold a login session; they
now wait for the client to receive LOGIN_SUCCESS for that node.
- The release guard folds case and backslashes before matching, so
'../../Test/' and '..\..\test\' are caught too.
- The runner listens on 127.0.0.1 unless given --host, and a bad seed
file exits 65 with a one-line message instead of a stack trace.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the Gemini adversarial review of Epic A, both checked against the
firmware before fixing:
- The generator reads source with regexes, so a protocol code inside #if
would be taken whichever branch a build uses. It now refuses one (none
exist at the pinned tags; FIRMWARE_VERSION's #ifndef default is not a
protocol code), and refuses a name defined twice with different values.
- The contract test compares names after dropping case and underscores;
it now fails if two names collapse to the same key.
Both pinned manifests regenerate unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two captures from hardware, anonymized and committed as fixtures: a Heltec
V4 on stock companion-v1.18.0 and a RAK4631 on offband-v1.5.0-beta7. A fake
seeded from each gives every reply the radio gave, byte for byte, and the
pinned profile must be the firmware the radio reports.
- anonymize_trace.py: replaces the radio's key, name and position, every
contact's key, name, path and position, and every channel's name and
secret with numbered stand-ins; drops pushes. Checked: none of the 1385+
real values survive in either fixture, and the same search finds all of
them in the raw capture.
- Stock profile re-pinned from companion-v1.17.1 to v1.18.0 (code 14),
the firmware the real stock radio runs. 1.18.0 adds CMD_RUN_CLI_COMMAND
and RESP_CODE_CLI_REPLY; the client uses neither.
- Seeding from a trace: firmware sends only contacts with lastmod > since
while CONTACTS_START counts all, so the RAK4631 announced 350 and sent
348. The seed now adds a hidden stand-in for each one never sent.
- Stock remote nodes print the frequency with ftoa (float32, 7 decimals:
910.5250244), not ftoa3. Ported and checked against the firmware
function compiled with g++.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A real radio can take seconds to answer right after the port opens, and a
busy one can answer a step late. Both filed replies under the wrong step.
Send DEVICE_QUERY until DEVICE_INFO comes back (5 tries), drain stragglers,
and wait up to 5 s for a reply before giving up on a step.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Running the capture script against the fake runner showed the 0xC1,
0xC2 and 0xC6 replies missing: split() filed every code >= 0x80 as a
push, but Offband replies use 0xC0-0xCF. Pushes are 0x80-0xBF now.
--tcp host:port runs the same capture over TCP (the fake runner, or a
radio with a TCP companion); pyserial is only needed for --port. A new
test runs the real script against the runner and replays the capture
into a fake seeded from it: every step has its replies, the block list
and contacts come through, and the replay is exact.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dart run tool/fake_radio.dart --profile offband|stock --port 5000
[--seed file] serves the fake on TCP so the desktop app can connect
with no hardware. Its clock follows real time, so ACKs and remote
replies arrive. Console: dm, chan, drop, status, quit. --seed takes an
offband-fake-radio-seed file (contacts with types and routes, channels
with secrets, remote nodes with passwords and firmware flavor) or a
captured trace. Format and the capture/manifest tools documented in
tool/fake_radio/README.md.
The TCP server moves to its own pure-Dart file (fake_radio_tcp.dart)
so dart run can load it; fake_radio_adapters re-exports it. Tests: the
README's example seed parses (docs can't drift), bad seeds are refused,
a trace works as a seed, the real connector connects and a console dm
lands, and the actual dart run process serves a client and quits.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tool/fake_radio/capture_trace.py records a real radio over USB serial:
the same read-only requests a client sends on connect, plus the
Offband extensions, each request with its exact reply frames. Nothing
is set or sent over the air; draining the message queue is opt-in
because it removes messages from the radio. RTS stays low and
--no-dtr keeps DTR low for ESP32 USB-Serial/JTAG boards (#244).
FakeRadioTrace loads a trace, builds the seed, profile and block list
the recorded radio held, and replays every request into a fake seeded
from it, reporting each reply that differs by step. Channel names are
compared up to their NUL (firmware fills that field with strcpy).
FakeRadioProfile.deviceInfoTailBytes lets older Offband builds with a
shorter DEVICE_INFO tail replay. The app's frame log wasn't usable: it
keeps 500 entries and truncates long frames.
Round trips exact under both profiles and for a v16-style short tail;
a doctored or missing reply is reported. 87 fake-radio tests.
Real-radio traces are captured at D1 (#783).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tool/fake_radio/gen_protocol_manifest.py reads companion firmware
source at a git ref and emits the manifest format proposed in
OffbandMesh/meshcore-firmware#1318. Pinned copies, verified identical
to the generator's output:
- offband-v1.5.0-beta7 (53951759): code 22, MeshCore base v1.17.0
- companion-v1.17.1 (stock, d9296435): code 13
FakeRadioProfile.fromManifest takes codes, bits and the DEVICE_INFO
version string (offbandClientVersion() derivation) from the manifest;
naming a bit the manifest lacks throws instead of reading 0. Offband
answers GPS status, the block list (BlockStore dedup/swap-remove
semantics) and the packet-hash query; stock rejects every Offband
command as unsupported.
Found writing it: the A2 default had OFFBAND_CAP_CAPLOG as 0x08 (it is
0x20) and the version string as 1.5.0-1.17.1 (beta7 is on v1.17.0).
Both now come from the manifest. 27 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>