tracking: one ledger, one authority — prune protection and replace-vs-add answered from the same records, fail-safe on unreadable state

This commit is contained in:
2026-07-30 19:44:11 -04:00
parent 7bd911d58b
commit 7f70d94228
40 changed files with 1546 additions and 633 deletions
+4 -5
View File
@@ -31,14 +31,13 @@ void CommitRealtimeResult(ReaSamplerSession& session, const CaptureResult& res)
return;
}
session.bank().add(res.sample);
// Record the file in the owned manifest regardless of the index AddResult — even
// a hash-collapse still wrote a file the tool owns; the manifest dedups a repeat
// path itself (prune reconciles manifest vs index).
session.owned().add(res.sample.relativePath);
// Record the birth regardless of the index AddResult — even a hash-collapse still
// wrote a file the tool owns; the ledger dedups a repeat path itself.
session.recordCreated(res.sample, tracking::OriginKind::Capture);
// A capture add changes what a live instance could play, so bump the generation
// before persisting to refresh instances.
session.bumpBankGeneration();
session.saveToActiveProject(); // persist book + manifest + generation + MarkProjectDirty
session.saveToActiveProject(); // persist book + ledger + generation + MarkProjectDirty
}
// Advances any in-flight realtime capture one tick. Detects a project switch