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
+13
View File
@@ -46,6 +46,19 @@ using persist_detail::projectDirOf;
using persist_detail::readActiveProject;
using persist_detail::relocateBankFolder;
void ReaSamplerSession::recordCreated(const model::Sample& sample,
tracking::OriginKind kind) {
tracking::OriginRecord rec;
rec.relativePath = sample.relativePath;
rec.kind = kind;
rec.sampleId = sample.id;
// The Sample's own provenance is where the parent was resolved; reading it here
// rather than re-deriving keeps one source for the lineage fact. Absent
// provenance is a root capture, not a gap.
if (sample.provenance) rec.parentSampleId = sample.provenance->parentSampleId;
tracking_.record(rec);
}
bool ReaSamplerSession::consumeLoadSignal() {
const bool pending = loadPending_;
loadPending_ = false;