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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user