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

Function inspect_project_store

src/migrate/inventory.rs:297–403  ·  view source on GitHub ↗
(
    project_root: &Path,
    data_dir: &Path,
    db_path: PathBuf,
    brand: StoreBrand,
    role: StoreRole,
    follow_symlinks: bool,
    skipped: &mut Vec<SkippedPath>,
)

Source from the content-addressed store, hash-verified

295}
296
297async fn inspect_project_store(
298 project_root: &Path,
299 data_dir: &Path,
300 db_path: PathBuf,
301 brand: StoreBrand,
302 role: StoreRole,
303 follow_symlinks: bool,
304 skipped: &mut Vec<SkippedPath>,
305) -> Result<StoreInventory> {
306 let mut statuses = Vec::new();
307 let mut artifacts = Vec::new();
308
309 if db_path.is_file() {
310 artifacts.push(StoreArtifact {
311 kind: "graph_db".to_string(),
312 size_bytes: file_size(&db_path),
313 path: db_path.clone(),
314 });
315 if !sqlite_quick_check(&db_path).await {
316 statuses.push(StoreStatus::Corrupt);
317 }
318 } else {
319 statuses.push(StoreStatus::MissingDb);
320 }
321
322 record_optional_artifact(
323 data_dir,
324 "sessions_db",
325 SESSIONS_DB_FILENAME,
326 &mut artifacts,
327 );
328 record_optional_artifact(
329 data_dir,
330 "branch_meta",
331 BRANCH_META_FILENAME,
332 &mut artifacts,
333 );
334 record_branch_db_artifacts(
335 data_dir,
336 follow_symlinks,
337 skipped,
338 &mut statuses,
339 &mut artifacts,
340 )
341 .await;
342 record_optional_artifact(data_dir, "config", "config.json", &mut artifacts);
343 record_optional_artifact(
344 data_dir,
345 "store_manifest",
346 STORE_MANIFEST_FILENAME,
347 &mut artifacts,
348 );
349 record_optional_artifact(
350 data_dir,
351 "response_handles",
352 "response-handles",
353 &mut artifacts,
354 );

Callers 1

Calls 8

record_optional_artifactFunction · 0.85
dir_sizeFunction · 0.85
pushMethod · 0.80
existsMethod · 0.80
file_sizeFunction · 0.70
sqlite_quick_checkFunction · 0.70
is_emptyMethod · 0.45

Tested by

no test coverage detected