Move Forge, Piebald, and Warp DB discovery and per-session parse ownership
onto their shared db-backed provider implementation, deleting the
package-level legacy entrypoints and per-agent engine sync dispatch. The
three become provider-authoritative.
Full-sync change detection runs through syncProviderDBBackedAgent, which
enumerates provider sources and skips those whose fingerprint mtime
matches the stored data-version mtime, so a repeat sync of unchanged data
stays a no-op. FindSourceFile, SourceMtime, and SyncSingleSession route
these agents through the provider facade, preserving Piebald's
chat-source-resolves-fork semantics including rejection of unknown forks.
Assert the provider-authoritative skip in the Piebald process test: an
unchanged chat skips on its per-chat updated_at fingerprint, matching the
legacy piebaldPendingSessionIDs skip and the Forge sibling. The prior test
asserted the opposite, a stale shadow-compare expectation that reparsed an
untouched session on every full sync.
refactor(parser): delete db-backed legacy whole-database parsers
The db-backed provider migration left the exported whole-database and
single-session parse free functions (ParseForgeDB, ParsePiebaldDB,
ParsePiebaldSession, ParseWarpDB) in place: the provider routes through
the lowercase per-session helpers (parseForgeSession,
parsePiebaldSessionResults, parseWarpSession), so these survived only as
dead production code kept alive by their own tests. ParsePiebaldDB had no
references at all.
Delete the four functions and the now-orphaned chain
(loadForgeConversations, loadWarpConversations, loadPiebaldChats, and the
ForgeSession/WarpSession/PiebaldSession bundle types). The retained parse
tests now drive the provider facade (Discover + Fingerprint + Parse) via a
shared parseDBBackedAll helper instead of the deleted free functions, so
they exercise the production path. Extend the db-backed deletion guard to
assert the four names stay gone.
fix(parser): honor sqlite fanout watch roots
SQLite fanout providers can publish a filesystem watch root that differs from the configured source root when FindDB resolves a canonical database under a subdirectory. Changed-path classification still compared WatchRoot to the configured root, so real DB/WAL/SHM events from the planned watch root produced no sources.\n\nAccept the emitted canonical DB directory as the matching watch root while keeping the configured-root compatibility path, and cover the FindDB subdirectory case with a WatchPlan-driven WAL event regression. The commit also removes two unused Codex fixture restats that blocked the existing staticcheck hook.\n\nValidation: go test -tags "fts5" ./internal/parser -run 'TestSQLiteFanoutSourceSet|TestDBBacked' -count=1 -v; go test -tags "fts5" ./internal/parser -count=1; go test -tags "fts5" ./internal/sync -run 'Test.*Codex' -count=1; go fmt ./...; go vet ./...
style(docs): mdformat provider facade design spec
Forge, Piebald, and Warp now use concrete parser providers over their existing per-session SQLite virtual paths. The shared DB-backed source helper keeps discovery metadata-driven, watches the provider root shallowly for database and SQLite sidecar updates, maps changed DB events to current virtual session sources, and preserves force-replace parsing plus Piebald fork fan-out. Review should focus on the shared DB-backed source-set behavior and the parser-specific spec adapters.