inspect_mount
Preview what a mount sync would change without modifying anything: list files to transfer, cluster-only paths, and stale uploads so deletions can be reviewed before syncing.
Instructions
Report what syncing a mount would change, without changing anything.
Read-only: this never transfers, deletes, or creates anything on the
cluster. Call it freely, including before a sync you are unsure about.
Its main job is answering a question ``sync_files`` cannot: **what is on the
cluster that no longer exists locally?** A sync is additive, so those files
stay — including code deleted in a local refactor, which a job on the
cluster can still import and run. They are listed here as
``mirror_delete_candidate_paths``.
Those candidates mix two kinds of thing:
* **produced by jobs** — checkpoints, logs, outputs. Must NOT be deleted.
* **left over locally** — stale modules, renamed files. Usually should be.
``stale_upload_paths`` is the second group on its own: paths srunx recorded
uploading that are no longer present locally. Job output was never uploaded,
so it does not appear there — which holds even when the mount's exclude list
misses an output directory, the case that otherwise buries a few stale
scripts among dozens of artifacts.
One exception: output pulled into the local tree with ``srunx cluster sync
--pull`` becomes a file the next push manages, so it is recorded like any
other and can be reported as stale once its local copy is removed. Excluding
the output directories on the mount avoids that, and is worth doing anyway.
**Check ``stale_uploads_known`` first.** When it is false the record could
not answer (nothing uploaded with tracking yet, an unreadable record, or a
changed exclude filter), and ``stale_uploads: 0`` means "could not tell",
not "nothing is stale" — ``stale_uploads_unknown_reason`` says which. Fall
back to reading the full candidate list yourself in that case.
Args:
cluster: SSH cluster name (see ``list_clusters``). Required.
project: Project root (directory holding ``.srunx/config.toml``)
whose mounts are used. Required.
mount: Mount name from that project on that cluster.
max_paths: Cap on how many paths to list. Counts stay exact regardless;
past the cap the list is omitted rather than shortened, and
``mirror_delete_candidate_paths_omitted`` says so.
Returns:
``files_would_transfer``, ``mirror_delete_candidates`` (a count),
``mirror_delete_candidate_paths``, whether that list was omitted,
``effective_exclude_patterns``, and the stale-upload fields described
above (``stale_uploads_known`` / ``stale_uploads`` /
``stale_upload_paths`` / ``stale_uploads_unknown_reason``).
The exclude list matters for reading the result: excluded paths are
invisible to this inspection *and* protected from a mirror's deletions,
so something absent from the candidates may simply be excluded rather
than in sync.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"cluster": "<cluster>",
"project": "<project>",
"mount": "<mount>"
},
"name": "inspect_mount"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mount | Yes | ||
| cluster | Yes | ||
| project | Yes | ||
| max_paths | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||