MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / attribute_commits_after_ingest

Function attribute_commits_after_ingest

src/sessions/mod.rs:108–116  ·  view source on GitHub ↗

Runs the bounded commit-attribution sweep against the correlation store. For each `(branch, worktree)` pair touched since the last sweep, scans that branch's git log inside the pair's span window (widened by the merge gap) and attributes overlapping commits to their sessions. Fail-open.

(db: &GlobalDb)

Source from the content-addressed store, hash-verified

106/// branch's git log inside the pair's span window (widened by the merge gap)
107/// and attributes overlapping commits to their sessions. Fail-open.
108async fn attribute_commits_after_ingest(db: &GlobalDb) {
109 let gap = git_correlation::DEFAULT_SPAN_MERGE_GAP_SECS;
110 let result = db
111 .git_run_commit_attribution_sweep(gap, |target| git_scan_commits(target, gap))
112 .await;
113 if let Err(err) = result {
114 tracing::debug!(error = %err, "commit attribution sweep skipped");
115 }
116}
117
118/// Reads commits on one span target's branch within its (gap-widened) window
119/// via `git log`. Returns an empty list on any error so the sweep simply

Callers 1

Calls 2

git_scan_commitsFunction · 0.85

Tested by

no test coverage detected