Drive a single source to completion against `db`, ingesting every transcript it locates for `project_root`. Fail-open: per-file errors are swallowed. `max_new_bytes` bounds how much newly-appended content a byte-offset source will read in one call (used to keep per-prompt hot paths inside budget); pass `None` for an unbounded catch-up.
(
db: &GlobalDb,
source: &dyn TranscriptSource,
project_root: &Path,
max_new_bytes: Option<u64>,
)
| 128 | /// will read in one call (used to keep per-prompt hot paths inside budget); |
| 129 | /// pass `None` for an unbounded catch-up. |
| 130 | pub async fn ingest_source( |
| 131 | db: &GlobalDb, |
| 132 | source: &dyn TranscriptSource, |
| 133 | project_root: &Path, |
| 134 | max_new_bytes: Option<u64>, |
| 135 | ) -> TranscriptIngestStats { |
| 136 | let mut stats = TranscriptIngestStats::default(); |
| 137 | for path in source.transcript_paths(project_root) { |
| 138 | stats = stats.merge(ingest_one(db, source, &path, project_root, max_new_bytes).await); |
| 139 | } |
| 140 | stats |
| 141 | } |
| 142 | |
| 143 | /// Ingest one transcript file: load the prior cursor, parse new content, persist |
| 144 | /// the advanced cursor, then upsert the session (merging preserved fields) and |
no test coverage detected