Skip to main content

Module home

Module home 

Source
Expand description

Where a migration looks: the AgentMux root and every install on it, read from the disk rather than from the running instance, so every channel and version is covered, running or not (S2’s “all channels and versions”).

Structs§

Home
The AgentMux root a migration works on.
Install
One channel, or one dev checkout: what it shares across its versions.
VersionData
One version’s data directory.

Functions§

fold
A name as every key table folds it.
has_agent_slugs
Whether an objects.db has agent slugs to read; one older than db_agents.slug (or db_agents itself) holds none.
has_column
in_tx
Run f in one BEGIN IMMEDIATE transaction: committed if it returns Ok, rolled back otherwise.
open_ro
A database opened to read, never to change: no schema step, no pragma that writes.
open_rw
A database opened to write, as it is: an existing file only, and no schema step. Another version’s objects.db must not be upgraded by opening it through Store::open.
owner_only
Make path owner-only on Unix: 0700 for a folder, 0600 for a file. On Windows it keeps the per-user ACL of the profile it lives in.
place
<install> or <install>@<version>, for reports.
table_exists
write_file
Write bytes to path through a temporary file beside it and a rename, never wider than the file it replaces. On Unix the temporary file is created owner-only (0600) from the start, so the bytes are never readable by others for a moment. A file being replaced then keeps its own mode, except a .mcp.json, which holds signing keys and is always 0600, as AgentMux writes it (Workdir::write(.., owner_only = true)); a new file stays 0600. On Windows the file takes its folder’s ACL, as every write through Workdir does: the profile’s per-user ACL.