Skip to main content

Module migrate

Module migrate 

Source
Expand description

Directory-scoped project binding (VIS-1256): resolving a project NAME to the project_id a .tracevault/config.toml carries, and migrating the legacy default_project name to it.

The workspace tier of the capture chain reads project_id (a UUID) locally, so the per-event stream hook never needs the network. A NAME is resolved exactly once, by a command that already talks to the server and may write config: tracevault init (any mode that has a project config) and tracevault sync. Ingest never resolves names; until a config is migrated its default_project contributes nothing, and project status / status say so (legacy_default_project_notice).

Enums§

Migration
What migrate_default_project did to the in-memory config.
ResolveNameError
Why a name could not be turned into a project_id.

Functions§

legacy_default_project_notice
The status notice for a config that still carries the legacy default_project: the name is never used for capture, so project status and status say so instead of reporting it as effective (VIS-316: status must match ingest). None when the config has no legacy key.
migrate_default_project
Migrate a config’s legacy default_project NAME to project_id + project_name, in memory: the caller saves. On any error the config is left exactly as it was.
migration_report
The one line a command prints after a migration, or None when nothing changed.
resolve_project_by_name
Look name up once against the server’s project list.
resolve_unique_project
Exact, case-sensitive name → the one project carrying it. An unknown name lists the available ones; a name several projects share is an error naming their ids, never a guess.