Skip to content

memhtml curate collapse

1. Synopsis

Plan and run a collapse of the corpus on a curate/ branch: cut the head into archive, fold, and keep clusters by source and type, frame key, and lexical similarity (rulings first when given), archive the archive clusters with no model, fold each fold cluster into one canonical through a curator session with the driver completing every archive and supersedes link, and leave keep clusters alone.

Terminal window
memhtml curate collapse [options]

2. Arguments

This command takes no positional arguments.

3. Flags

Flag Type Default Values Description
--ref string no default no fixed set The curator branch, refs/heads/ prepended when absent. Defaults to curate/<UTC date>-collapse. Must sit under curate/ (ERR_INVALID_FLAG at exit 2 otherwise), and the branch HEAD points at is ERR_INVALID_MEMORY at exit 1. Every cluster lands on this one ref through the rebase-and-retry loop, so concurrent folds serialize at it. Sessions are named collapse-<cluster id>.
--model string no default no fixed set The model each fold runs under: fake, bedrock:<modelId>, or proxy:<model>, resolved as curate run resolves it (MEMHTML_CURATOR_MODEL, else proxy:<default> when MEMHTML_LLM_BASE_URL is set). Archive clusters use no model.
--plan string no default no fixed set A saved plan (the plan field of a --dry-run payload) to execute in place of computing one. Members are re-checked against the ref’s tip per cluster, and planShaMismatch says when the plan named another sha.
--rulings string no default no fixed set A JSONL file of audit rulings, one {path, verdict, theme?, reason?} per line with verdict one of keep, fold, trace, archive. Archive and trace rulings become archive clusters, fold rulings group by theme, keep rulings take a record out of every cut, and each is quoted in its cluster’s briefing.
--concurrency integer 4 no fixed set Fold sessions run at once; each lands on the one ref through the rebase-and-retry loop.
--only string no default no fixed set Comma-separated cluster ids to execute; every other cluster is reported under untouched and left alone. ERR_INVALID_MEMORY when none names an archive or fold cluster.
--limit integer no default no fixed set Execute only the first N archive or fold clusters in plan order.
--dry-run flag false no fixed set Compute the plan and print it whole under plan, with every executable cluster previewed as dry-run; no session, no ref, and no commit is written.
--max-steps integer 14 no fixed set Model calls one fold may make before it is stopped.
--wall-clock-ms integer 900000 no fixed set Wall clock for one fold, model calls and tool executions together.
--charter string no default no fixed set A file to brief every fold with in place of the shipped collapse charter, its placeholders filled from the store’s memhtml.config.json as curate run --charter fills them. Archive clusters use no charter. A file that cannot be read or has no text is ERR_STORAGE at exit 1 before any cluster runs.

Every command also accepts the global flags.

4. Response

On success the command writes one JSON envelope to stdout, and its type is curate.collapse.

On failure it writes the failure envelope, whose code comes from error codes.

The JSON envelope gives the fields both shapes carry. Response types lists every value type takes across the binary.

5. Further reading

No guide block names this command. The guide is the workflow prose the CLI ships beside the command table: which command to reach for, and in what order.

6. Provenance

A loader generates this page from apps/cli/src/commands.ts while the site builds, so no file in the repository holds it: the COMMANDS array there is the one source of argument parsing, of memhtml manifest, and of AGENTS.md. Change the registry and this page changes with it.