# 0002: Use C++ single-file stack instead of house Python stack - Status: accepted - Date: 2026-10-31 - Decision makers: retoor - Spec IDs: D-02, PIN-01, PIN-02, PIN-03, PIN-04 ## Context House stack defaults to Python plus FastAPI plus SQLite plus Jinja2. TOSV legacy (Python port, then C++ port) proved a tighter shape: one file, stdlib plus POSIX only, zero external deps, 64KB streaming, flat-file DB. The vault must run on bare hosts with only g++ present. Adopting the house stack would add an interpreter, a framework, and an ORM for no vault benefit. ## Decision Pin C++17 single-file for TOSV v1: tosv.cpp holds the whole app, build is one g++ line, storage is flat files under the working directory, HTTP plus WebDAV served in binary. No container, no pyproject, no ORM in v1. Makefile targets are adapted to C++. ## Consequences Good: zero deps to audit; binary under 5MB; build under 60s; memory model explicit (wipe_mem, 64KB chunks); matches operator skill set. Bad: no framework guardrails; raw HTTP parse must be fuzzed by hand; no migration tooling, DB changes are additive key lines only; future AEAD needs hand-rolled or new-dep ADR. Caps introduced: PIN-01 through PIN-10 in SPEC.md section 5. What this rules out: FastAPI routers, Jinja2 templates, dataset ORM, Python console binary, container image in v1. Any of these needs a new ADR that supersedes this one. ## Links - SPEC.md sections 5, 6.1, 9 (D-02) - ADR 0001 (method adoption)