Artifact bootstrap is a no-op across clone paths (project name is derived from the absolute repo path)
Problem
cbm_project_name_from_path derives the project name from the full normalized repo path. Two clones of the same repository at different paths therefore get different project names.
The shared artifact DB (.codebase-memory/graph.db.zst) is keyed by the exporter's project name. When a teammate bootstraps from it (try_artifact_bootstrap in src/mcp/mcp.c), the imported DB contains rows only under the exporter's project, so the importer:
In other words, artifact bootstrap currently only helps when the importing machine uses the same absolute repo path as the exporter — which is rarely true across teammates. This was discovered while benchmarking #867 (see "Explicitly deferred" there).
Scope
Pre-existing and independent of the #868/#869/#870 stack — those PRs make bootstrap cheap when the project names line up (same path, CI caches, container images with fixed paths). This issue tracks making the team-sharing case work too.
Possible directions (not prescriptive)
- Key the artifact by a path-independent identity (e.g. repo basename + first-commit hash), and map it to the local project name at import.
- Rewrite the project column during
cbm_artifact_import (the importer knows its own project name at import time).
- Store the exporter's project name in
artifact.json and translate on read.
(2) looks smallest: import already byte-copies into a fresh cache DB, so an UPDATE ... SET project = ? over the copied rows right after the copy is contained and needs no schema/metadata changes.
Refs #867. Happy to take this on as a follow-up PR once the #868–#870 stack settles, if the direction above (or another you prefer) sounds right.
Artifact bootstrap is a no-op across clone paths (project name is derived from the absolute repo path)
Problem
cbm_project_name_from_pathderives the project name from the full normalized repo path. Two clones of the same repository at different paths therefore get different project names.The shared artifact DB (
.codebase-memory/graph.db.zst) is keyed by the exporter's project name. When a teammate bootstraps from it (try_artifact_bootstrapinsrc/mcp/mcp.c), the imported DB contains rows only under the exporter's project, so the importer:file_hashesrows for their own project name →classify_filessees everything as new → full re-parse;In other words, artifact bootstrap currently only helps when the importing machine uses the same absolute repo path as the exporter — which is rarely true across teammates. This was discovered while benchmarking #867 (see "Explicitly deferred" there).
Scope
Pre-existing and independent of the #868/#869/#870 stack — those PRs make bootstrap cheap when the project names line up (same path, CI caches, container images with fixed paths). This issue tracks making the team-sharing case work too.
Possible directions (not prescriptive)
cbm_artifact_import(the importer knows its own project name at import time).artifact.jsonand translate on read.(2) looks smallest: import already byte-copies into a fresh cache DB, so an
UPDATE ... SET project = ?over the copied rows right after the copy is contained and needs no schema/metadata changes.Refs #867. Happy to take this on as a follow-up PR once the #868–#870 stack settles, if the direction above (or another you prefer) sounds right.