hmp catalog#
Uses hmp.trash().
$ hmp catalog [-h] <action> ...Maintain the index of a project and its runs
| Command | What it does |
|---|---|
hmp catalog query | Run a SQL statement against the project index |
hmp catalog gc | Maintenance: measure the project, close dead attempts, trash old versions, purge fields |
hmp catalog reindex | Build the project index from what the run and session directories declare |
hmp catalog delete | Move a run or a session to the trash (reversible); --now to remove it for good |
hmp catalog restore | Move a trashed run or session back to the directory it came from |
hmp catalog trash | Move a run to the trash, list the trash, or remove its entries with --empty |
hmp catalog tag | Add or remove tags on a run (reserved tag: pinned, kept out of trash and gc) |
hmp catalog note | Append a timestamped note to a run |
hmp catalog rename | Rename a run: runs/<old>/ and sessions/<old>/ move to the new name |
hmp catalog watch | Show the running attempts with the age of their heartbeat |
hmp catalog import | Import a run written by 'hmp publish' (directory or tar), with the data it read |
hmp catalog rerun | Launch a run again from its frozen config.toml, with --set path=value overrides |
hmp catalog query#
$ hmp catalog query [-h] [-w WORKSPACE] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] [--limit LIMIT] sqlOpen the index read-only and run one statement. The tables are those of the index (simulations, cases, attempts, sites, parameters, metrics, calibration_sessions ...) and its views (v_cases, v_simulation_summary).
| Argument | What it does |
|---|---|
sql | SQL statement to execute against the index |
--limit LIMIT | Wrap the SQL in a LIMIT clause to cap the result set |
Also takes the shared options --workspace --format --verbosity --quiet --verbose --debug.
Example
$ hmp catalog query "SELECT case_id, label, nse FROM v_cases" --format jsonExit codes it sets itself: 1 10. All exit codes.
hmp catalog gc#
$ hmp catalog gc [-h] [-w WORKSPACE] [-y] [--dry-run] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] [--keep-versions N|all] [--max-age-days DAYS] [--trial-fields-days DAYS|never] [--solver-files-days DAYS]Maintenance: measure the project, close dead attempts, trash old versions, purge fields
| Argument | What it does |
|---|---|
-y, --yes | Carry the plan out. Without it the verb prints the plan and changes nothing |
--keep-versions N|all | Versions kept per run name; older ones go to the trash (default: 5, 'all' disables the rule) |
--max-age-days DAYS | Also trash runs started more than DAYS ago (default: no age limit) |
--trial-fields-days DAYS|never | Remove the fields of kept trials older than DAYS, all but the best (default: 90, 'never' disables the rule) |
--solver-files-days DAYS | Remove the solver/ folder that keep_solver_files kept in sealed runs older than DAYS (default: never, the folders stay) |
Also takes the shared options --workspace --dry-run --format --verbosity --quiet --verbose --debug.
A directory tagged 'pinned' is never collected. Trash entries are removed 30 days after their deletion. The fields of a kept trial leave after 90 days, all but the best.
Examples
$ hmp catalog gc $ hmp catalog gc --dry-run --format json $ hmp catalog gc --keep-versions 3 --max-age-days 180 -y $ hmp catalog gc --trial-fields-days never -y $ hmp catalog gc --solver-files-days 30 -y
Exit codes it sets itself: 10. All exit codes.
hmp catalog reindex#
$ hmp catalog reindex [-h] [-w WORKSPACE] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] [--incremental]Read every directory under runs/ and sessions/ and write .hmp/index.duckdb from them: the sealed runs with their label of the day, the attempts that failed or are running, the calibration sessions with their trials. The index is written to a staging file and published in one atomic step, so a reader keeps reading until the new one is there, and building twice yields the same index. With --incremental only the directories that appeared, changed or disappeared since the last pass are written.
| Argument | What it does |
|---|---|
--incremental | Write only what changed since the last pass; a full rebuild otherwise |
Also takes the shared options --workspace --format --verbosity --quiet --verbose --debug.
Examples
$ hmp catalog reindex $ hmp catalog reindex --incremental
hmp catalog delete#
$ hmp catalog delete [-h] [-w WORKSPACE] [-y] [--dry-run] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] [--site SITE] [--now] [--force] SIM_REFMove a run or a session to the trash (reversible); --now to remove it for good
| Argument | What it does |
|---|---|
SIM_REF | Full sim_id, unique hex prefix, name, or an @-selector (@last, @best:METRIC, @worst:METRIC, @running) |
--now | Remove the directory for good: a tombstone keeps its name from being reused |
--force | Go past the pin and the stale attempt: act on a pinned directory, or on one whose attempt stopped beating |
Also takes the shared options --workspace --yes --dry-run --format --verbosity --quiet --verbose --debug --site.
The reference is the directory: a bare name is runs/<name> exactly, and a bare name whose stem has other versions is refused with the list.
Examples
$ hmp catalog delete baseline_v2 -y $ hmp catalog delete sessions/calibration -y $ hmp catalog delete baseline_daily --now -y
Exit codes it sets itself: 2 130. All exit codes.
hmp catalog restore#
$ hmp catalog restore [-h] [-w WORKSPACE] [--dry-run] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] SIM_REFMove a trashed run or session back to the directory it came from
| Argument | What it does |
|---|---|
SIM_REF | The name 'hmp catalog trash' lists, or the directory the entry came from (baseline_daily, sessions/calibration) |
Also takes the shared options --workspace --dry-run --format --verbosity --quiet --verbose --debug.
Examples
$ hmp catalog restore baseline_daily $ hmp catalog restore runs__baseline_daily@20261014T093000
hmp catalog trash#
$ hmp catalog trash [-h] [-w WORKSPACE] [-y] [--dry-run] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] [--empty] [--force] [REF]Move a run to the trash, list the trash, or remove its entries with --empty
| Argument | What it does |
|---|---|
REF | Move this run or session to trash/. Without it, list the trash. |
--empty | Remove every trashed directory for good (frees disk, leaves tombstones) |
--force | Go past the pin: remove the pinned directories too when emptying |
Also takes the shared options --workspace --yes --dry-run --format --verbosity --quiet --verbose --debug.
Each removed entry leaves a line in trash/tombstones.txt, so its name is never given to a new run.
Examples
$ hmp catalog trash $ hmp catalog trash --empty --dry-run $ hmp catalog trash --empty --force -y
Exit codes it sets itself: 2 130. All exit codes.
hmp catalog tag#
$ hmp catalog tag [-h] [-w WORKSPACE] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] [--site SITE] [--rm TAG] SIM_REF [TAG ...]Add or remove tags on a run (reserved tag: pinned, kept out of trash and gc)
| Argument | What it does |
|---|---|
SIM_REF | Full sim_id, unique hex prefix, name, or an @-selector (@last, @best:METRIC, @worst:METRIC, @running) |
TAG | Tags to add (a leading + is optional) |
--rm TAG | Tag to remove (repeatable) |
Also takes the shared options --workspace --format --verbosity --quiet --verbose --debug --site.
Example
$ hmp catalog tag baseline_v2 pinned paper --rm draftExit codes it sets itself: 2. All exit codes.
hmp catalog note#
$ hmp catalog note [-h] [-w WORKSPACE] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] [--site SITE] SIM_REF textAppend a timestamped note to a run
| Argument | What it does |
|---|---|
SIM_REF | Full sim_id, unique hex prefix, name, or an @-selector (@last, @best:METRIC, @worst:METRIC, @running) |
text | Note text |
Also takes the shared options --workspace --format --verbosity --quiet --verbose --debug --site.
Example
$ hmp catalog note calibration "best fit after widening Sy bounds"hmp catalog rename#
$ hmp catalog rename [-h] [-w WORKSPACE] [--dry-run] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] [--site SITE] SIM_REF new_nameRename a run: runs/<old>/ and sessions/<old>/ move to the new name
| Argument | What it does |
|---|---|
SIM_REF | Full sim_id, unique hex prefix, name, or an @-selector (@last, @best:METRIC, @worst:METRIC, @running) |
new_name | New directory name |
Also takes the shared options --workspace --dry-run --format --verbosity --quiet --verbose --debug --site.
The directory is the name, so a rename moves runs/<old>/ and, for a calibration, sessions/<old>/ to the new name. Links between them are ids and stay valid. The new name must be free: a live directory, a trashed one or a tombstone holding it is refused.
Example
$ hmp catalog rename baseline_v2 baseline_k2e5hmp catalog watch#
$ hmp catalog watch [-h] [-w WORKSPACE] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] [--stale-minutes STALE_MINUTES]Read the outcome.json and logs/heartbeat.json of every run directory and list the attempts that are running. The index is never opened: this answers while a solve is going on and on a project that has no index yet.
| Argument | What it does |
|---|---|
--stale-minutes STALE_MINUTES | Heartbeat age (minutes) beyond which a running attempt is flagged stale default 5.0 |
Also takes the shared options --workspace --format --verbosity --quiet --verbose --debug.
Example
$ hmp catalog watch --stale-minutes 5Exit codes it sets itself: 10. All exit codes.
hmp catalog import#
$ hmp catalog import [-h] [-w WORKSPACE] [--dry-run] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] [--name NAME] sourceImport a run written by 'hmp publish' (directory or tar), with the data it read
| Argument | What it does |
|---|---|
source | Directory or tar written by 'hmp publish' |
--name NAME | Name of the imported run (default: the published name without its _vN) |
Also takes the shared options --workspace --dry-run --format --verbosity --quiet --verbose --debug.
The run lands under runs/ with the next free version of its name, read without its _vN: a published x_v2 becomes x in a project that has no x. Pass --name to give it the name other documents cite.
A copy carries its inputs unless it was published with --without inputs, so it installs every file the run read into data/ of the workspace: identical bytes already there cost nothing, other bytes at the same path are refused by name, and nothing is written.
Examples
$ hmp catalog import baseline.tar $ hmp catalog import ../published/baseline --name lab_copy
hmp catalog rerun#
$ hmp catalog rerun [-h] [-w WORKSPACE] [--dry-run] [--format {table,json,csv}] [--verbosity {quiet,normal,verbose,debug} | -q | -v | --debug] [--site SITE] [--set PATH=VALUE] [--name NAME] SIM_REFLaunch a run again from its frozen config.toml, with --set path=value overrides
| Argument | What it does |
|---|---|
SIM_REF | Full sim_id, unique hex prefix, name, or an @-selector (@last, @best:METRIC, @worst:METRIC, @running) |
--set PATH=VALUE | Dotted config path override, repeatable (e.g. flow.param.K.field.value=2e-4) The grammar of a key path and a value |
--name NAME | Name of the new run (default: the name of the source, next version) |
Also takes the shared options --workspace --dry-run --format --verbosity --quiet --verbose --debug --site.
The new run keeps the name of its source and takes the next version; its manifest names the source in lineage (parent_sim_id, kind = rerun). A key that differs from config.resolved.toml of the source gets a warning and is recorded in lineage.drift.
Example
$ hmp catalog rerun baseline --set flow.param.K.field.value=2e-4Exit codes it sets itself: 2. All exit codes.