mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-05-21 20:55:32 +00:00
f6290b6373
Enforces issue #1283 architecture: cmd/server is read-only, all write/maintenance ops live on the ingestor's *Store. Three new tests: - TestServerDBHasNoWriteMethods — reflect-asserts PruneOldPackets, PruneOldMetrics, RemoveStaleObservers are NOT methods on cmd/server *DB. Fails on master (all three currently exist + use cachedRW to bypass the server's read-only handle, racing ingestor INSERTs → SQLITE_BUSY). - TestServerDBConnIsReadOnly — opens via OpenDB, asserts INSERT fails. Today this passes via OpenDB(mode=ro), but pinning it as an invariant prevents future regressions if anyone ever drops the ro flag. - TestIngestorPruneOldPackets — exercises new Store.PruneOldPackets that the GREEN commit will implement. Stub returns 0; test asserts 2 rows pruned → fails (RED proof). Plus TestIngestorVacuumOnStartupMigratesNONEtoINCREMENTAL guarding the existing CheckAutoVacuum path so the GREEN commit's deletions in cmd/server cannot regress the vacuum migration.