Repository navigation
Description
Part of the flight-recorder persistence epic — design: docs/superpowers/specs/2026-08-21-flight-recorder-persistence-design.md, discussion #27. Sequenced after #52.
Scope reduced by #50 (PR #56, merged 2026-09-01). Slice 2 shipped this slice's default — no bodies on disk — ahead of schedule, because shipping the opposite default in the interim was judged worse than pulling the work forward. What remains is mostly the opt-in flag.
Deliverable
After this slice: a consumer can opt in to persisting bodies via persistBodies = true. The default (no bodies on disk) already ships.
Already shipped in slice 2 (#50)
- Bodies/payloads dropped before the blob is written.
toRow()copies the DTO withrequestBody/responseBody(HTTP) andpayload(MQTT/BLE) nulled. Note this landed intoRow()on the persistence path, not inEventDto.fromEvent()as originally scoped —EventDtodeliberately stays capable of carrying bodies, so this slice only has to stop nulling them rather than re-add them. Pinned by three tests inPersistenceToRowTest. - Persisted events carry redacted
••••headers. Pinned inEventDtoTest— redaction is inherited fromHttpLogger, as predicted. -
Sharingan.clear()purges rows on disk. Routedstore.clear()→onClearseam →PersistenceController.clear(). The clear travels as a command on the same channel as the writes, so the single flusher applies it in submission order and a pending batch cannot resurrect cleared rows. Pinned byGiven a pending batch When clear is called Then no events are resurrected.
Remaining scope
- The
persistBodiesgate. Whentrue,toRow()stops nulling the three fields. Blocked on Flight recorder 4/5: retention + Sharingan.configure() (public knob) #52 shipping theconfigure()surface that carries the flag. - Decide
clear()'s intended blast radius. It currently issuesDELETE FROM event— every run, not just the current one. That is broader than this issue originally specified ("the current session's rows"). Confirm which is the contract. - Orphaned session rows.
deleteAllEventsdeletes only fromevent; theON DELETE CASCADEruns session→event, not the reverse, so cleared runs linger as emptysessionrows. Decide whether to purge them. - Clear-on-new-session. Not implemented. Confirm it is still wanted now that
clear()purges everything.
TDD / acceptance
- RED→GREEN: with
persistBodies=true, persisted HTTP events carry bodies. Thefalsedefault is already pinned. -
checkApiParitygreen (no new public symbol —persistBodiesships in slice 4).
Note
Encryption at rest is out of scope — deferred to a future additive epic behind the same configure() surface (see design doc + roadmap).
Workflow change since #56: :sharingan-db is no longer exempt from binary-compatibility-validator, so every schema edit in this slice needs ./gradlew apiDump committed or apiCheck fails.
Activity