Add docs/infrastructure-report.html - a standalone, self-contained HTML
render of the infrastructure and cost plan, a presentation-friendly
companion to docs/infrastructure.md.
Contents: cover + summary, the self-host topology on the MS-02 cluster
(Node A GPU AI worker, Node B app/API/Postgres/Redis, Node C MinIO
storage/HA) fronted by a Cloudflare Tunnel (no open ports, no static IP),
Hetzner cloud fallback, and a cost table (source/CI/docs already hosted at
zero marginal cost). Reflects the 2026-07-05 "self-host on the MS-02
cluster" decision (state/DECISIONS.md).
Inline CSS only, no external assets, GPL-3.0-only per the code licence.
No infrastructure was provisioned; this is a plan/inventory document.
A runnable, self-hosted web interface so the whole workflow can be tested end to
end: record or upload audio in the browser, watch it transcribe and summarise,
browse a library, play back, and export.
What changed:
- server/app/store.py: SQLite + on-disk audio storage for recordings (stdlib only).
- server/app/pipeline.py: background task audio -> transcribe -> summarise via the
existing provider layer, updating status (queued/transcribing/summarising/done/error).
- server/app/main.py: web API - POST upload, list, detail, audio (Range), delete, and
export (txt/md/srt/vtt/json) - and serves the SPA at /.
- server/app/web/: Plaud-style single-page UI (index.html, styles.css, app.js). Sidebar
library, in-browser recording (MediaRecorder) + file upload, live status polling,
audio player, summary (overview/key points/actions), timestamped transcript, exports.
- server/Dockerfile + README: two-minute run instructions (default provider: Groq free
tier for both Whisper + LLM), and a Docker option.
- config: env prefix switched OPENSCRIBE_ -> NIGHTJAR_ to match the brand and the site
tutorials; .env.example rewritten with a ready Groq quick-start.
- state/TODO: web app recorded as done.
Why:
- User asked for a Plaud-like web interface to test how it all works. Nothing testable
existed before (marketing site is a brochure; pipeline was unwired). This delivers a
real, runnable product demo and effectively lands M5/M6 for the HTTP providers.
Notes:
- Slim by design: AI is offloaded to the configured provider, so no local ML deps needed
for the demo. Byte-compiles clean; JS passes node --check. Local faster-whisper still
needs its model (M5) for the fully-offline path.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Persists the branding/commercial/infrastructure work (previously only in chat and
on the live site) into version control.
What changed:
- docs/naming.md: due-diligence and the decision to brand the product Nightjar
(OpenScribe domain/GitHub/trademark collisions; alternatives screened; why Nightjar).
- docs/hosted-service.md: the commercial model - plan tiers (Self-host / Cloud
Starter / Cloud Pro / Private), indicative pricing, backend mapping, and the
build-to-sell roadmap (metering, billing, provisioning, DPA).
- docs/infrastructure.md: backend infra plan. Primary option = self-host on the
3x Minisforum MS-02 cluster (one with an RTX 3050 6GB) fronted by a Cloudflare
Tunnel, with node roles, the 3050 capacity reality, caveats, and a Hetzner cloud
fallback. Provision-later.
- site/: reproducible marketing-site source - block content for all 11 pages
(rebranded to Nightjar), the navigation, the Contact Form 7 config (honeypot),
the ApisCP SOAP helper (tools/apiscp.php, no secret), and a README on how the
WordPress site is built and managed via the API.
- state/: DECISIONS (Nightjar rebrand, hosted service, MS-02 backend), PROJECT
(brand + commercial section), TODO (rename decision, trademark, mailbox, pricing,
hosted-service build, infra provisioning).
Why:
- User asked to save everything to the repo. Captures the product rebrand, the
commercialisation plan, and the infrastructure decision so a cold session has the
full picture.
Notes:
- The repo is still named `openscribe`; the product/brand is Nightjar. A full
codebase rename is deferred (tracked in TODO + docs/naming.md).
- No secrets committed: the ApisCP API key is read from a local scratch file, never
the repo.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Lets the owner point transcription and summarisation at any AI: an open-standard
endpoint (OpenAI-compatible / local faster-whisper / Ollama) or a commercial API
(OpenAI, Anthropic, Gemini). Config-driven, self-hostable, no lock-in.
What changed:
- server/app/providers/: provider layer.
- base.py: Transcriber/Summariser protocols + shared summary prompt + tolerant JSON
parser (uniform Summary shape across providers).
- summary.py: OpenAICompatibleSummariser (any /chat/completions - OpenAI, Groq,
OpenRouter, LocalAI, LM Studio, vLLM, Ollama /v1) and AnthropicSummariser (Claude
via the official anthropic SDK; Messages API has no OpenAI-compatible endpoint).
- transcription.py: OpenAICompatibleTranscriber (/audio/transcriptions - OpenAI,
Groq, self-hosted whisper server) and LocalWhisperTranscriber (faster-whisper,
execution wired in M5).
- factory.py: builds the configured providers with per-provider defaults
(anthropic -> claude-opus-4-8, openai_compatible -> gpt-4o-mini, ollama -> llama3.1).
- config.py + .env.example: transcription_provider / llm_provider selectors + base_url,
key, model settings; local faster-whisper and Ollama kept as the self-hosted defaults.
- main.py: /health now reports the resolved provider names (no secrets).
- requirements.txt: httpx drives all HTTP providers; anthropic + faster-whisper are
optional, only for their respective providers.
- docs/ai-providers.md: config recipes for OpenAI, Groq, Anthropic, Gemini, LocalAI,
LM Studio, Ollama, self-hosted whisper.
- state/: DECISIONS, ARCHITECTURE, TODO updated.
Why:
- The user asked to connect the device to any open standard AI or commercial one; this
is also the core differentiator vs Plaud's locked cloud.
Notes:
- Anthropic provider uses the official SDK and defaults to claude-opus-4-8 (per the
claude-api guidance). AI deps are optional per chosen provider. Modules byte-compile
cleanly; end-to-end wiring into the ingest pipeline lands with M5.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Reviews the Plaud line (Note, Note Pro, NotePin/S) to make sure the OpenScribe
roadmap covers expected capabilities, and records where OpenScribe deliberately
differs (bring-your-own-AI, self-hosted, open).
What changed:
- docs/plaud-comparison.md: feature map (Plaud vs OpenScribe status), a derived
backlog, and what we deliberately do not copy. Sourced from Plaud's site (July 2026).
- state/TODO.md: adds a Plaud-derived backlog section (diarisation, summary templating,
Ask-AI/RAG, custom vocabulary, multimodal, mark-a-moment, auto-title, tags/folders/
search, share links, optional OLED display, calendar) and a pluggable-AI-providers
milestone.
Why:
- The user asked to review Plaud for other todos; this captures them and frames the
bring-your-own-AI differentiator that the next feature implements.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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>
Adds the WiFi-to-app sync path and the on-device open REST API implementing the
device paths of api/openapi.yaml, plus persistent config in NVS.
What changed:
- firmware/src/config.{h,cpp}: NVS (Preferences) store - stable device id from MAC,
WiFi SSID/PSK, API bearer token, upload settings. Secrets stay off the SD card.
- firmware/src/net_wifi.{h,cpp}: station join with stored creds; SoftAP provisioning
fallback when no creds / join fails; mDNS openscribe.local; reconnect in loop().
- firmware/src/api_http.{h,cpp}: synchronous WebServer on :80. Routes: GET /device,
GET/PUT /device/config, GET /recordings, GET /recordings/{id}, GET
/recordings/{id}/audio (HTTP Range -> 206 + Content-Range), DELETE /recordings/{id},
POST /record/start|stop. Bearer-token auth on mutating calls (open when no token).
- firmware/src/storage.{h,cpp}: list/read/delete/count helpers + path builders.
- firmware/src/main.cpp: wire config + WiFi + API into setup/loop; bump fw to 0.2.0.
- firmware/platformio.ini: add bblanchon/ArduinoJson@^7 (only new dep).
- state/: ARCHITECTURE, NOTES, TODO updated; security + NTP follow-ups recorded.
Why:
- This is the WiFi transfer channel and the device half of the "completely open API":
clients can list, download (resumable), delete and control without any cloud.
Notes:
- Not compiled locally (no PlatformIO on the dev host) or hardware-verified; CI builds
both board profiles. Security follow-ups logged: API is open when no token is set,
and the SoftAP uses a fixed default passphrase (make user-set at M4/BLE).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Post-merge bookkeeping so the next session's TODO is accurate. Next: M2
(WiFi manager + on-device REST API).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Implements the first working feature: the device records audio to the microSD
card, toggled by the button, with LED status and per-recording JSON metadata.
What changed:
- firmware/src/audio.{h,cpp}: mic capture via the core-bundled ESP_I2S. Dev board
uses I2S standard mode (INMP441/ICS-43434); XIAO uses PDM mode (onboard mic).
Presents 16-bit PCM mono to callers regardless of board.
- firmware/src/storage.{h,cpp}: microSD on a dedicated HSPI bus + a streaming
WavWriter that writes a 44-byte PCM header and patches RIFF/data sizes on close;
plus sidecar JSON metadata writer.
- firmware/src/recorder.{h,cpp}: idle/recording state machine; creates
/recordings/<id>.wav, pumps mic chunks in on update(), finalises + writes
<id>.json (Recording schema from api/openapi.yaml) on stop.
- firmware/src/ux.{h,cpp}: debounced button (short press toggles) + status LED
patterns (idle/recording/error), active-low aware.
- firmware/src/main.cpp: wires ux + recorder; loop toggles on button and drains
the mic while recording.
- firmware/include/audio_config.h: 16 kHz mono 16-bit, chunk size, rec dir.
- firmware/include/pins.h: added XIAO PDM mic + onboard SD pins, LED active-low flag.
- state/: TODO, ARCHITECTURE, NOTES updated for M1 and the deferred follow-ups.
Why:
- Recording is the foundation every later milestone (transfer, upload, transcription)
builds on. Kept dependency-free (only core-bundled ESP_I2S + SD) for simple CI builds.
Notes:
- Not compiled locally (no PlatformIO on the dev host) or hardware-verified; Forgejo
Actions CI builds both board profiles. Follow-ups tracked in state/TODO.md:
INMP441 16-bit level calibration, and real NTP timestamps (ids are uptime-based
until M2 brings WiFi/NTP).
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>