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>
Bootstrap of the project (M0). Sets up the monorepo, design docs, hardware BOM,
the open API contract, component skeletons, licensing and CI, following the
Default Workflow SOP.
What changed:
- CLAUDE.md + docs/: copied the Default Workflow so sessions load the SOP.
- state/: PROJECT, ARCHITECTURE, DECISIONS, TODO, NOTES filled in for OpenScribe.
ARCHITECTURE captures the four-part design (firmware, server, app, case) and the
three sync paths; DECISIONS records the hardware, AI-stack, storage, app and
licensing choices; TODO lays out milestones M1-M9.
- hardware/BOM.md: two build options (compact XIAO ESP32-S3 Sense; dev ESP32-S3 +
I2S mic + SD), wiring/pinout, indicative cost.
- api/openapi.yaml: the completely open API (device + server surfaces), including
recording list/download/delete and exports (wav/ogg/txt/srt/vtt/md/json).
- firmware/: PlatformIO ESP32-S3 project, two board profiles, pin map, boot scaffold
with module seams for M1-M4.
- server/: FastAPI skeleton mirroring the OpenAPI, config for self-hosted MinIO,
faster-whisper and Ollama; stub routes browsable at /docs.
- app/, case/: Flutter app plan; parametric OpenSCAD enclosure.
- Licensing: GPL-3.0 (code), CERN-OHL-S-2.0 (hardware), CC-BY-SA-4.0 (case/docs),
REUSE-style LICENSES/ with SPDX headers; LICENSING.md explains the split.
- CI: Forgejo Actions workflow builds firmware (both profiles) and lints/imports server.
Why:
- Everything self-hosted and openly licensed per the user's requirements: an open
API, three sync paths (BLE control, WiFi transfer, independent WiFi upload on
charge to generic cloud storage), and a full self-hosted transcription+summary stack.
Notes:
- No custom PCB in v1; off-the-shelf modules. Physical verification waits on parts.
- Component code is stubs at M0; features land milestone by milestone, each as its
own branch/PR per the workflow.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>