refactor: remove legacy autoflush code paths (bd-xsl9)

Remove dual code paths in the autoflush system. FlushManager is now the
only code path for auto-flush operations.

Changes:
- Remove legacy globals: isDirty, needsFullExport, flushTimer
- Remove flushToJSONL() wrapper function (was backward-compat shim)
- Simplify markDirtyAndScheduleFlush/FullExport to just call FlushManager
- Update tests to use FlushManager or flushToJSONLWithState directly

FlushManager handles all flush state internally in its run() goroutine,
eliminating the need for global state. Sandbox mode and tests that do
not need flushing get a no-op when FlushManager is nil.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Steve Yegge
2025-12-23 01:56:04 -08:00
parent da15363e2b
commit 92e6f4c079
7 changed files with 48 additions and 199 deletions

View File

@@ -402,8 +402,6 @@ func TestFlushManagerIdempotentShutdown(t *testing.T) {
func setupTestEnvironment(t *testing.T) {
autoFlushEnabled = true
storeActive = true
isDirty = false
needsFullExport = false
}
// teardownTestEnvironment cleans up test environment