Answers "how do we emulate/lint this?" with runnable tooling for every part, and factors the pure firmware logic out so it is unit-testable on the host. What changed: - firmware/src/wav.h, firmware/src/httprange.h: pure, header-only WAV header builder and HTTP Range parser (no Arduino deps), so the tricky byte-layout and range logic can be tested on a PC. storage.cpp and api_http.cpp refactored to use them. - firmware/test/test_pure/: Unity tests for the WAV header fields and Range parsing (start-end, open-ended, clamped, unsatisfiable, non-bytes). Run: pio test -e native. - firmware/platformio.ini: add [env:native] (host tests) and [env:esp32s3_wokwi] (emulator build with default WiFi = Wokwi-GUEST so the API comes up in the sim). - firmware/wokwi.toml + firmware/diagram.json: Wokwi emulator harness (ESP32-S3 + microSD + button + LED). Note: Wokwi has no I2S mic part, so audio isn't emulated; the harness targets boot + WiFi + REST API. - firmware/src/main.cpp + config.cpp: bring up WiFi + API even if audio/SD init fails (device stays reachable, reports the fault via GET /device); compile-time default WiFi honoured when NVS is empty (used by the Wokwi build). - .forgejo/workflows/ci.yml: add native tests + cppcheck to the firmware job; new openapi job (openapi-spec-validator) and emulator job (Wokwi build, plus a full run when WOKWI_CLI_TOKEN is set). - docs/testing.md: the full emulate/lint guide for firmware, server, API, app, case. - state/: NOTES points at the guide; TODO reflects this branch. Why: - The firmware can't be flashed yet (no parts) and doesn't build on this dev host, so we need host-runnable checks. Pure-logic unit tests + OpenAPI validation run anywhere; Wokwi emulates boot/WiFi/API; CI compiles the real firmware. Verified locally: the OpenAPI spec validates (12 paths, 10 schemas). Notes: - Native tests and cppcheck run in CI (no compiler on the dev host). The Wokwi full run is skipped unless a WOKWI_CLI_TOKEN secret is present; the build is still verified. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2.9 KiB
2.9 KiB
TODO
The current state of play. Keep it honest and current; this is what the next session reads to know what to do. Move items between sections as they progress.
In progress
- Dev testing + emulation harness - on
feature/dev-testing, in PR.
Pending (roughly in build order)
- M3 Independent uploader: charge/VBUS detect -> powered mode, S3-compatible +
WebDAV upload of audio + metadata (config store already landed in M2).
(branch
feature/fw-uploader) - M4 BLE GATT: device info, battery, record control, WiFi provisioning, status
notifications; hand-off to WiFi for transfer. (branch
feature/fw-ble) - M5 Server ingest + transcription: FastAPI ingest from object store/upload, store,
faster-whisper transcription, DB, exports (audio/TXT/SRT/VTT/JSON). REST API.
(branch
feature/server-ingest-stt) - M6 Server summaries: Ollama LLM summary + action items, Markdown export.
(branch
feature/server-summary) - M7 Flutter app: BLE provisioning, device dashboard, library from server API,
playback, transcript/summary view, export/share, settings.
(branch
feature/app-mvp) - M8 3D case: parametric OpenSCAD enclosure fit to the BOM board + battery; print/fit.
(branch
feature/case-v1) - M9 Hardening + OTA: API auth, credential handling, OTA update, docs handoff.
(branch
feature/hardening-ota)
Done
- M2 On-device WiFi + REST API - WiFi/SoftAP + mDNS + config(NVS) + device REST API
(status, list, metadata, audio-with-Range, delete, record start/stop, config).
(PR #2
feature/fw-rest-api, 2026-07-03). Not yet hardware-verified. - M1 Firmware recording core - mic capture to WAV on SD + button/LED + metadata
(merged: PR #1
feature/fw-recorder-core, 2026-07-03). Not yet hardware-verified. - M0 Scaffold - repo, licences, state docs, BOM, OpenAPI, skeletons, CI
(merged to
main, 2026-07-03) - Create Forgejo repo
laurence/openscribe(public, main) - 2026-07-03 - Decide hardware, sync model, AI stack, app platform, storage, licensing (see DECISIONS.md) - 2026-07-03
Follow-ups (deferred, do when convenient)
- Audio calibration: INMP441 emits 24-bit samples in a 32-bit slot. M1 reads in
16-bit mode (usable for speech, may be quiet). If levels are low on the dev build,
capture 32-bit and right-shift into int16 in
audio.cpp. - Real timestamps: ids/
started_atare uptime-based (no RTC/NTP yet). Add NTP now that WiFi exists (M2), and switch ids andstarted_atto real UTC. - API auth is open when no token set; SoftAP has a fixed default passphrase. Harden both before any deployment (see NOTES "Security follow-ups").
Blocked / waiting
- Physical build + on-device verification - waiting on parts from
hardware/BOM.md. Until parts arrive, firmware is validated by CI build (Forgejo Actions) of both board profiles, not on real hardware.