@staix/agent-mem 0.28.2 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +17 -11
- package/package.json +3 -2
- package/src/brief-work.ts +142 -0
- package/src/cli.ts +97 -17
- package/src/commands-table.ts +6 -0
- package/src/mcp-memory.ts +37 -9
- package/src/memory/bridge.ts +26 -1
- package/src/memory/capacity.ts +5 -2
- package/src/memory/catalog.ts +10 -1
- package/src/memory/commands.ts +5 -3
- package/src/memory/curated-cache-state.ts +10 -7
- package/src/memory/doctor.ts +32 -26
- package/src/memory/formats.ts +4 -3
- package/src/memory/generation-index.ts +79 -17
- package/src/memory/index-file.ts +2 -2
- package/src/memory/intent-brief.ts +34 -6
- package/src/memory/metrics.ts +174 -14
- package/src/memory/shard-bridge.ts +18 -6
- package/src/memory/shard-sync-format.ts +18 -0
- package/src/memory/shard-sync-history.ts +6 -0
- package/src/memory/shard-sync.ts +52 -4
- package/src/memory/shard.ts +33 -13
- package/src/memory/store.ts +147 -41
- package/src/memory/sync-placement-bound.ts +21 -4
- package/src/memory/sync-placement-cache.ts +16 -1
- package/src/memory/sync-placement-capture.ts +67 -19
- package/src/memory/sync-placement-checkpoint-format.ts +199 -0
- package/src/memory/sync-placement-checkpoint-person.ts +209 -0
- package/src/memory/sync-placement-checkpoint-prospective.ts +141 -0
- package/src/memory/sync-placement-checkpoint-storage.ts +218 -0
- package/src/memory/sync-placement-checkpoint.ts +234 -0
- package/src/memory/sync-placement-dependencies.ts +42 -9
- package/src/memory/sync-placement-effective-writers.ts +12 -6
- package/src/memory/sync-placement-git.ts +17 -7
- package/src/memory/sync-placement-guard.ts +52 -1
- package/src/memory/sync-placement-inspection-evidence.ts +1 -1
- package/src/memory/sync-placement-inventory.ts +141 -0
- package/src/memory/sync-placement-journal-format.ts +4 -1
- package/src/memory/sync-placement-journal-storage.ts +148 -28
- package/src/memory/sync-placement-journal.ts +13 -4
- package/src/memory/sync-placement-materialize.ts +47 -22
- package/src/memory/sync-placement-projection.ts +7 -1
- package/src/memory/sync-placement-publication-events.ts +42 -0
- package/src/memory/sync-placement-publication-plan.ts +26 -5
- package/src/memory/sync-placement-realm-admission-storage.ts +128 -0
- package/src/memory/sync-placement-realm-admission.ts +352 -0
- package/src/memory/sync-placement-realm-attribution.ts +23 -0
- package/src/memory/sync-placement-realm-discovery.ts +42 -0
- package/src/memory/sync-placement-realm-effective.ts +71 -0
- package/src/memory/sync-placement-realm-extension-format.ts +66 -0
- package/src/memory/sync-placement-realm-extension-storage.ts +82 -0
- package/src/memory/sync-placement-realm-intent-format.ts +55 -0
- package/src/memory/sync-placement-realm-intent-storage.ts +123 -0
- package/src/memory/sync-placement-realm-pending.ts +27 -0
- package/src/memory/sync-placement-realm-proof.ts +131 -0
- package/src/memory/sync-placement-realm-torn.ts +26 -0
- package/src/memory/sync-placement-remote-admission.ts +190 -0
- package/src/memory/sync-placement-remote-adoption-format.ts +54 -0
- package/src/memory/sync-placement-remote-materialization.ts +49 -0
- package/src/memory/sync-placement-remote-refusal.ts +21 -0
- package/src/memory/sync-placement-remote-stage.ts +275 -0
- package/src/memory/sync-placement-transport.ts +268 -79
- package/src/memory/sync-placement-writer-history.ts +75 -17
- package/src/memory/sync-placement-writer-renewal.ts +18 -10
- package/src/memory/sync-placement-writer-revision-format.ts +16 -13
- package/src/memory/sync-placement-yield.ts +44 -0
- package/src/memory/sync-progress.ts +47 -6
- package/src/memory/sync.ts +26 -1
- package/src/memory/work-lists.ts +129 -9
- package/src/session-brief.ts +34 -1
- package/src/sync-placement-writer-context.ts +5 -5
- package/src/ui/plugin.ts +1 -1
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Curated memory with append-only JSONL logs, a derived SQLite index, short- and long-term tiers, a typed graph, goals with leases, and git sync between machines. Extracted from [agent-hub](https://github.com/STAIxBWLB/agent-hub), with compatible storage and entry IDs.
|
|
4
4
|
|
|
5
5
|
<!-- facts:version -->
|
|
6
|
-
Version: 0.
|
|
6
|
+
Version: 0.30.0. Requires Bun 1.4.2 or later; no runtime dependencies.
|
|
7
7
|
<!-- /facts:version -->
|
|
8
8
|
|
|
9
9
|
## Quick start
|
|
@@ -92,7 +92,7 @@ Memory commands: `list`, `search`, `show`, `graph`, `suggestions`, `confirm`, `r
|
|
|
92
92
|
|
|
93
93
|
`amem import codex` reads Codex's Markdown memory as review candidates. It supports both on-disk layouts: memories v1 under `$CODEX_HOME/memories` (else `~/.codex/memories`) and memories v2, the default for fresh profiles since Codex 0.165.0, under the sibling `memories_v2/` (`memory_summary.md`, `rollout_summaries/`, `extensions/`; v2 titles start with `memories_v2/`). The v2 SQLite state is never read. With `--from` only the given directory is read. When neither layout exists, the receipt names the locations it checked.
|
|
94
94
|
|
|
95
|
-
Agent markers are honest-session identity context, not authentication. Marked `amem note add` writes use the existing peer field for attribution. An agent-marked session runs every amem command a person runs (#431): `doctor`, `project export`, history and as-of reads, `migrate --sync-placement` and the rest, with the same preview and `--confirm`/`--apply` steps; its reads keep the configured policy screen. Outbound publication (npm publish, release tags) still needs the person. Unmarked reads retain their existing unscreened behavior. `amem mcp` remains scoped to its startup project and can write only candidate and work-list data; hooks and ingest append capture only. Curated candidate acceptance and other CLI writes use the current configured policy. The CLI no longer has a general agent-marker refusal or stdin-TTY gate; use each command's explicit preview and `--confirm`/`--apply` flow where provided. `amem review walk` stays interactive and requires terminal input and output; `amem review decide <id> accept|reject|defer` is its non-interactive form: without `--confirm` it prints the candidate and its overlaps and marks it shown, and `--confirm` applies that one decision; `$EDITOR` opens only when a terminal is available.
|
|
95
|
+
Agent markers are honest-session identity context, not authentication. Marked `amem note add` writes use the existing peer field for attribution. An agent-marked session runs every amem command a person runs (#431): `doctor`, `project export`, history and as-of reads, `migrate --sync-placement` and the rest, with the same preview and `--confirm`/`--apply` steps; its reads keep the configured policy screen. Outbound publication (npm publish, release tags) still needs the person. Unmarked reads retain their existing unscreened behavior. `amem mcp` remains scoped to its startup project and can write only candidate and work-list data, plus content-free read-call telemetry; hooks and ingest append capture only. Curated candidate acceptance and other CLI writes use the current configured policy. The CLI no longer has a general agent-marker refusal or stdin-TTY gate; use each command's explicit preview and `--confirm`/`--apply` flow where provided. `amem review walk` stays interactive and requires terminal input and output; `amem review decide <id> accept|reject|defer` is its non-interactive form: without `--confirm` it prints the candidate and its overlaps and marks it shown, and `--confirm` applies that one decision; `$EDITOR` opens only when a terminal is available.
|
|
96
96
|
|
|
97
97
|
## Configuration and privacy policy
|
|
98
98
|
|
|
@@ -238,7 +238,7 @@ These interactive checks remain unrun until a person checks them in each install
|
|
|
238
238
|
|
|
239
239
|
`memoryHome()` selects `AMEM_HOME` first; then the `home` of a pointer file `amem.config.json` in the default home (a file with `home` carries nothing else, and a redirected home's own file cannot redirect again); then `$AGENTHUB_HOME/memory`, otherwise `~/.agenthub/memory`. `amem status` prints the home in use, which of these chose it, and the configuration files in effect. `AMEM_HOME` names the memory directory itself; `AGENTHUB_HOME` names its parent. Existing agent-hub memory directories need no migration. An explicit `StoreOptions.home` retains the parent-directory convention and appends `/memory`.
|
|
240
240
|
|
|
241
|
-
The JSONL segments are authoritative. The curated index (`index-
|
|
241
|
+
The JSONL segments are authoritative. The curated index (`index-v5.db`; 0.14.0 through 0.24.0 use `index.db`) is derived and can be rebuilt. Entries are immutable; changes append operations. The compatibility schema remains `agent-hub.memory/v1` because it participates in entry IDs.
|
|
242
242
|
|
|
243
243
|
## Capture tier and full-text search
|
|
244
244
|
|
|
@@ -292,7 +292,7 @@ amem capacity apply --split [--confirm] # each shard's share of the global cap
|
|
|
292
292
|
|
|
293
293
|
- `archive`, `unarchive` and `forget` are append-only ops in `lifecycle.jsonl` of the memory home (local, never synced, like `aliases.jsonl`): nothing rewrites a line and nothing deletes a shard. The latest op wins and `forgotten` is terminal. An alias resolves to its one canonical project, and the reply names it. An archived or forgotten project has no writable capture store, no SessionStart brief and no MCP server; `unarchive` restores an archived one. A forgotten project's bytes stay on disk: `forget` is an append-only lifecycle record, not an erase. An alias shard of an archived or forgotten project counts as that state, `alias add` to or from a forgotten key is refused, and hooks that staged capture for a project before it was archived or forgotten are retired at the next drain (counted as `project_archived` or `project_forgotten`). `openShardStore` refuses such a project at the open, so a library caller such as agent-hub is gated too once it pins this release.
|
|
294
294
|
- `gc` opens only the capture store of each shard and calls its bounded `evict()` (at most four batches of 256 rows and 25 ms per call), so a cap shrink never takes a shard in one pass: the report says `remainingOverCap` and the next run continues. It never opens a curated store, a goal or a work list. An archived shard is still bounded; a forgotten one is skipped and listed as skipped.
|
|
295
|
-
- `export` changes no content under the memory home: it opens the capture databases read-only and reads the curated store, and the only files that may appear or refresh are derived (the curated `index-
|
|
295
|
+
- `export` changes no content under the memory home: it opens the capture databases read-only and reads the curated store, and the only files that may appear or refresh are derived (the curated `index-v5.db` and `search.db`, SQLite sidecars and `catalog.db`), which every reader rebuilds from the logs. A destination inside the home is refused. The bundle is screened like sync and promotion are, so a secret-looking value, a PII pattern or a denied path is withheld and counted in `withheld`.
|
|
296
296
|
- `search --all-projects` runs one ordinary project-scoped search per active project and merges by score. It is a person command: the MCP server stays bound to one project and has no all-projects argument, and the raw memory command (what a host exposes as its own `memory` command) refuses the flag.
|
|
297
297
|
- `capacity` also prints a per-shard split of the global disk-share budget. Each shard's weight halves every 14 days since its last capture, so recently used projects keep more capture and cold ones shrink first; the split never exceeds the budget, gives every shard at least 1 MB, keeps every shard at what it holds whenever the total fits, never proposes a retention shorter than a shard's idle time plus 30 days, and says when the budget forces a shard below what it holds. When the budget holds fewer whole MB than there are shards, no split is proposed and `capacity` says why (`splitRefused`). It proposes capture bounds only, and never evicts curated notes, goals or work lists. `capacity apply --split` previews, then `--confirm` writes exactly the previewed values to each shard's `config.json`, and only if the preview is under an hour old and the set of shards and every shard's config are unchanged since then (a `--disk-share` given only to `--confirm` changes nothing that is written).
|
|
298
298
|
- amem lists vault candidates and never writes the vault.
|
|
@@ -325,6 +325,8 @@ If both replayable tiers fill, or SessionStart's reserve alone fills, the curren
|
|
|
325
325
|
|
|
326
326
|
SessionStart prioritizes known open work. Native curated notes use a private prebuilt section prepared after curated writes and sync, with current policy screening before work and whole-line output after work. Admission requires all writers to be upgraded and a `home` or `curated` floor of 0.24.0 or later, raised explicitly with `amem formats raise` after checking writers. Below it, native curated stays deferred. Migration and profile/selector changes invalidate caches without rebuilding; a later curated write or explicit trigger prepares them. A CLI `amem brief`, including an agent-marked call, or an explicit off-hook host call to the root export `prepareCuratedBriefCache(base, project)` prepares a quiet project cache. The export is a write: it opens one selected store, reads at most four 32-row pages and writes one file up to 32 KiB. MCP and library `sessionStartBrief()` never prepare it. A project with no curated writes and neither explicit trigger keeps native curated unavailable; mutations rebuild only their touched projects after invalidating old derived files. Missing and stale files report `curated cache missing` or `curated cache stale` without rebuilding. Profile/generation binding, selected-note expiry and a 24-hour age cap bound freshness; see [the curated cache contract](docs/contracts.md#r2-hook-budget-150-mb-ceiling-per-runner-baseline-regression-300-ms-maximum-228). Native capture uses the prebuilt Record/Recap/Compact section; raw chronological history remains a library source. Neither native cache path creates schema/FTS or repairs indexes. Missing/locked/incompatible sources are explicitly unavailable. The standalone `sessionStartBrief()` retains all its original sources. Recovery failure cannot discard a computed brief. Work and reader-lease host ports use zero busy-wait and cooperative deadline checks; ordinary library callers retain their original defaults, including 3,000 ms waits. No watcher, resident worker, model/network call, embedding job or vault access is added. Host policy callbacks remain unsupported by `runHook`, while the standalone brief composes them normally.
|
|
327
327
|
|
|
328
|
+
Native work uses a bounded snapshot prepared by a work write, selected for the current static repository and host policy. A missing, stale, oversized or incompatible snapshot reports the work section unavailable with `use amem_work_state_read`; the hook does not replay the work log. A standalone brief with a host screen callback instead uses the deadline-bound live read. See [the work snapshot contract](docs/contracts.md#r2-hook-budget-150-mb-ceiling-per-runner-baseline-regression-300-ms-maximum-228).
|
|
329
|
+
|
|
328
330
|
SessionStart admits directly to the reserve with at most 32 metadata entries and performs no active-tier scan or replay. Both tiers use per-cwd fair shares (64 active records, 8 reserve records), grouping together all HOME/scope variants of a cwd. Admission can retire native records from an overrepresented cwd, counting each loss as `scope_capacity` before removal. Accepted summaries survive same-cwd pressure; new summaries backpressure without advancing their transcript cursor. A fully verified foreign all-summary inventory can use counted `summary_capacity` eviction; otherwise it stays pending for replay. All admission maintenance shares a 32-file/256 KiB body-read bound; unknown/newer schemas retain their seven-day protection. Non-SessionStart hooks maintain and drain both tiers. This is bounded reserve admission, not O(1) accounting; an atomic slot-reservation protocol is the upgrade. Parent brief storage still contains synchronous filesystem/SQLite work between cooperative deadline checks; asynchronous/deadline-aware storage remains the upgrade, not a larger handler limit. The default R2 wall limit remains 150 ms p95, with the scoped hosted-runner exceptions in [the R2 contract](docs/contracts.md#r2-hook-budget-150-mb-ceiling-per-runner-baseline-regression-300-ms-maximum-228), including 181 ms for hosted macOS M1 transcript hooks. The production handler budget remains 140 ms; the absolute 100 MB peak RSS was retired by #228 for a 150 MB per-invocation ceiling plus a per-runner baseline regression gate. Functional tests construct a programmatic host-only deadline; the actual executable exposes no environment or CLI deadline extension. Its exec-only boot-clock handoff can only shorten the deadline and is cleared before hook import. Dedicated budget scripts retain the actual CLI, original sample counts, cold attempt 0 and timeout/reaper assertions. The [P3 receipt](docs/p3-hook-budget-2026-10-23.md) identifies prior-head evidence separately from current acceptance; the current rework has no newly claimed both-OS green CI result.
|
|
329
331
|
|
|
330
332
|
A private admission cursor rotates bounded inspection across pending records (at most 32 files/256 KiB per pass), so a healthy first slice cannot indefinitely hide later removed/unknown entries from retirement checks. Git include/conditional identity dependencies are traversed within depth four and 16 files. Pending scope hashes relevant semantic project-identity values rather than unrelated full-config or HEAD churn; derived cache validity may additionally hash raw configuration/HEAD bytes. Unconditional and `gitdir` includes bind semantic identity values. Dynamic `onbranch`/`hasconfig` or unknown conditional trees without identity keys bind nothing; if they contain origin/rewrite/worktree identity keys, scope stays unknown. Native read-only identity may still supply known work, but it never adopts that pending capture; counted `scope_unknown` retirement needs seven days. This conservative ceiling is upgraded by evaluating `onbranch` against HEAD at drain time, not by adding a condition interpreter in this PR.
|
|
@@ -443,7 +445,7 @@ Real migration remains blocked until the separately reviewed generation-capable
|
|
|
443
445
|
|
|
444
446
|
## Curated shard migration (#15 T2)
|
|
445
447
|
|
|
446
|
-
Bare `amem migrate --shards` is a preview; `--apply` writes the migration. `amem migrate --shards --apply` moves the curated single home into `projects/<key-hash>/` and `user/` through a resumable generation journal. The original single-home log bytes are never rewritten. A populated selected generation is supported and keeps its generation ID. Each shard keeps private legacy inputs in read-only `legacy/`, public-main inputs in read-only `legacy-main/`, and generation-born rows in its own `log/` and `local/`. It has its own `index-
|
|
448
|
+
Bare `amem migrate --shards` is a preview; `--apply` writes the migration. `amem migrate --shards --apply` moves the curated single home into `projects/<key-hash>/` and `user/` through a resumable generation journal. The original single-home log bytes are never rewritten. A populated selected generation is supported and keeps its generation ID. Each shard keeps private legacy inputs in read-only `legacy/`, public-main inputs in read-only `legacy-main/`, and generation-born rows in its own `log/` and `local/`. It has its own `index-v5.db`, `search.db` and mutation lock; original IDs, hashes, placement and own/local/public provenance are preserved. The source generation bytes stay unchanged. Immutable prune proofs are validated before effects; a multi-shard prune is translated into one deterministic row per shard, with a receipt naming the original row. Existing capture and `work/` directories are not migration inputs and are left untouched. `catalog.db` remains derived and rebuildable, now including curated entry counts and last use. Without active placement, split curated stores sync the opened canonical project and user overlay to separate private-remote refs (`amem/p/<key-hash>` and `amem/u`); unopened projects and machine data are not fetched. Active placement instead syncs the effective home-wide inventory as described below. `--policy-free` remains accepted and never bypasses screening. Original IDs and attribution survive independent generations. See `docs/contracts.md`, "Per-shard private sync", for prune transport and application boundaries.
|
|
447
449
|
|
|
448
450
|
Before splitting a live home, every installed host must open it through `openShardStore({ project })` or the explicit user shard. Plain `new MemoryStore()` refuses any split marker, including an interrupted split, so it cannot silently keep writing the old layout. No host capability registry currently exists; migration preflight output states that limitation. Do not release T2 for agent-hub use until its memory factory is integrated with `openShardStore` and that host version is installed. Existing unannounced older builds remain the documented unchanged-source ceiling.
|
|
449
451
|
|
|
@@ -494,7 +496,7 @@ The MCP server exposes these tools. The nine-tool contract frozen for dotfiles#2
|
|
|
494
496
|
| `amem_capacity` | yes | Read this machine's bounded capture capacity proposal; applying it requires the matching CLI preview and `--confirm`. |
|
|
495
497
|
<!-- /facts:mcp-tools -->
|
|
496
498
|
|
|
497
|
-
Search/show/timeline label capture as recall with `evidence: false`; capture never enters the curated graph.
|
|
499
|
+
Search/show/timeline label capture as recall with `evidence: false`; capture never enters the curated graph. Search, show, timeline and graph screen complete rows before result selection, limits or graph construction. The intent brief first selects candidates by plan-node references or, without them, intent-word matches in titles and text; it then screens each row before it can contribute a line or bridge to a neighbour; at most 96 candidates are screened and exceeding that cap reports truncation. The standalone secret screen, private flags, PII patterns and deny paths compose with a host's stricter policy through `createMemoryMcp({cwd, base, policy})`. Screening errors fail closed. `base` is the exact memory root; historical library `home` options still name its parent. Scope and profile changes refuse further access instead of silently reopening another store. Graph reads retain the 5,000-row curated ceiling; work-list reads stream the complete ordered history without an operation-count ceiling, applying policy before latest-value reduction. The working state scales with the current result, not historical payloads. The graph ceiling is an operational bound, not an exposed count of unscreened data. Graphs cover curated-note relationships, not goal/suggestion tables.
|
|
498
500
|
|
|
499
501
|
`WorkListStore` writes `projects/<key-hash>/work/` with its own append log, derived index and lock. Scalar fields reduce by latest value, null clears, list status `done` closes, and item status is `todo|doing|done|dropped`. Work lists are outside generation selection and capture eviction. `amem import claude-mem` additionally imports `work_state_entries` only through persisted D2 aliases, preserving source DB bytes and stable replay receipts; JSON keeps observation fields and adds `work` counts/cursor. `--capture-days N` also imports observations and session summaries from the last N days into machine-local capture under the same aliases, with read/added/spooled/skipped counts, stable replay receipts and the configured capture cap and retention. Widening N after an earlier import requires `--restart` to revisit rows below the saved cursor. Chroma vectors are never read.
|
|
500
502
|
|
|
@@ -548,7 +550,7 @@ Agents use `amem_evidence` with a question to get cited, live curated entries, n
|
|
|
548
550
|
|
|
549
551
|
### Public prune view and v2 sync (opt-in)
|
|
550
552
|
|
|
551
|
-
On an active curated split, the person can preview and enable the forward-only v2 reader floor. This keeps the receiving generation and native logs/seals, builds a separate `index-v2-
|
|
553
|
+
On an active curated split, the person can preview and enable the forward-only v2 reader floor. This keeps the receiving generation and native logs/seals, builds a separate `index-v2-i5.db`, and preserves every native/local mask. Once activated, explicit sync uses the v2 transport and can install complete generation-neutral public-prune proof; historical hold receipts alone never authorize a mask.
|
|
552
554
|
|
|
553
555
|
```sh
|
|
554
556
|
AMEM_HOME=/path/to/synthetic-memory amem migrate --public-prune-view --dry-run
|
|
@@ -586,9 +588,9 @@ Since 0.23.0, native Claude SessionStart can prepend the package-owned `RECORD_I
|
|
|
586
588
|
|
|
587
589
|
For the #313 AC6 comparison week (#325), the person can create a private `record-instruction.json` in the memory home containing `{"instruction":"alternate"}` (`a`, `b` and `alternate` are the only values). This is separate from `amem.config.json`, whose `records` key remains boolean-only. The file must be regular, single-link, owned by the current uid and not group- or other-writable (`mode & 022 == 0`): normal 0644 is accepted; 0664 and 0666 are rejected. Core never writes the selection file. Missing means A; an invalid, unreadable, group/other-writable, oversized, foreign-owned or linked file also means A, with numeric `recordInstructionInvalid: 1` in the hook metric, without refusing the hook. Existing 0.23.x readers ignore this file and retain A. B uses purpose framing with a `basis:` hint and `?` for unverified text. Both reserve 332 bytes before the untrusted header; A emits 332 bytes including the separator, B emits 331 (about 83 estimated tokens each). Alternate uses even/odd parity of the last hex digit of the existing 16-character capture session hash for A/B, so resume keeps the same variant without exposing a raw session id. A missing or invalid session id falls back to A rather than guessing parity; metrics record that resolved A choice. `records: false` in either configuration file still wins. `RECORD_INSTRUCTION` remains the exact A text; `RECORD_INSTRUCTION_B`, `RECORD_INSTRUCTIONS`, `readRecordInstruction`, `captureSessionKey`, `recordInstructionVariant` and their mode/variant types let hosts reuse the package-owned text and selection rule. `basis:` and `?` remain ordinary Record text, with no grammar or capture-field change. The person compares the variants during the live week before deciding the default. [Record variant measurements](docs/bench/record-instruction-variants.md) records the public fixture protocol and its evidence status.
|
|
588
590
|
|
|
589
|
-
The live-week counters use a separate `record-variants.jsonl` beside the existing resource metrics. Each row contains `at`, the hook `event`, resolved `variant` (`a` or `b`) and allowlisted numeric Record fields; no Record text is written. Observations use single short `O_APPEND` writes and 0600 creation, retaining eight days within a 4 MiB hard cap. Capture rows
|
|
591
|
+
The live-week counters use a separate `record-variants.jsonl` beside the existing resource metrics. Each row contains `at`, the hook `event`, resolved `variant` (`a` or `b`) and allowlisted numeric Record fields; no Record text is written. Observations use single short `O_APPEND` writes and 0600 creation, retaining eight days within a 4 MiB hard cap. Capture rows and spool events/status values are unchanged; general resource metrics use the per-kind rolling window below. One session is one SessionStart with source `startup` or `resume`, including an omitted instruction; `recordInstructionEmitted` and `recordEnabled` distinguish exposure and opt-out. One turn is one Stop invocation. Stop/SessionEnd report eligible parsed Record counts, the number containing `basis:` and the number starting with `?`; these are parsing observations, not durable-publication counts. SessionEnd contributes Records but no Stop-turn denominator. An unavailable scan leaves counts unknown, and the report never converts missing counters into zero. SessionStart reports actual emitted brief bytes including the instruction. Capacity trims leave 1 MiB of headroom (4 MiB trigger, 3 MiB retained). Incomplete or unknown transcript scans are excluded from exact Stop-turn observations; the full-window exact share stays null until coverage is complete.
|
|
590
592
|
|
|
591
|
-
Run `bun scripts/report-record-variants.ts --input /path/to/memory/record-variants.jsonl` read-only to report sessions, Records/session, the share of Stop turns with a Record, basis and uncertainty shares, and mean brief bytes with explicit denominators. Missing Stop scan counters produce an incomplete/null exact turn share and a separate observed share. The bounded first-line probe triggers an age rewrite only past nine days, keeping eight days (daily hysteresis). Ordinary appends never read the tail or rewrite it. When the 4 MiB cap forces older observations out, numeric `capTrimmed` markers make `window.capForcedTrim` true and coverage incomplete; do not treat a capped window as a complete AC6 week. The general metrics file retains its
|
|
593
|
+
Run `bun scripts/report-record-variants.ts --input /path/to/memory/record-variants.jsonl` read-only to report sessions, Records/session, the share of Stop turns with a Record, basis and uncertainty shares, and mean brief bytes with explicit denominators. Missing Stop scan counters produce an incomplete/null exact turn share and a separate observed share. The bounded first-line probe triggers an age rewrite only past nine days, keeping eight days (daily hysteresis). Ordinary appends never read the tail or rewrite it. When the 4 MiB cap forces older observations out, numeric `capTrimmed` markers make `window.capForcedTrim` true and coverage incomplete; do not treat a capped window as a complete AC6 week. The general metrics file retains its 64 KiB trim trigger; a trim keeps up to the newest 200 samples per kind.
|
|
592
594
|
|
|
593
595
|
At Stop/SessionEnd, complete native assistant text can yield `Record` capture events through the existing transcript scan. `parseRecordLines`, `RECORD_INSTRUCTION` and `recordsEnabled(base, cwd?)` are public root exports; hosts check `recordsEnabled` before emitting the instruction or capturing parsed Records. The canonical grammar is maintained in `src/hook-record.ts`. The parser checks format and explicit text exclusions; hosts still apply their capture privacy policy before storage. It accepts the five kinds decision/fix/fail/contract/finding, repository-relative anchors and at most 300 text characters, excludes fenced/quoted examples, and requires the fix/fail relation. Missing native row time or stable `message.id` refuses extraction. At most two syntactically valid record lines are considered per stable message per scan call, with no persisted count. Whole records are declined on a denied anchor, policy refusal, truncation or redaction; no partial record is saved.
|
|
594
596
|
|
|
@@ -619,10 +621,14 @@ amem migrate --sync-placement --abandon --json
|
|
|
619
621
|
|
|
620
622
|
Dry-run shows root versions/pins and safe policy counts, never row text or patterns, and writes nothing. Initial writer errors name the root category and cause, with upgrade/setup instructions. If a pre-marker interruption retained an intent and its inputs changed, person `--abandon` removes only its owned initial metadata so a fresh preview/apply can follow. It cannot remove a v3 marker, active fence or journal history. After apply, choose the private remote on the first v3 sync (`amem sync --remote <private-git-url>`); ordinary and cadence sync then read the immutable root locator and measure the installs afresh. Allowed originals can publish while declined originals remain in the local append-only history, with counts in the sync receipt. No writer roots need to be repeated on sync.
|
|
621
623
|
|
|
622
|
-
A long first sync reports its phase, row counters and last progress on stderr when stderr is a terminal (`--progress json` for one versioned event per line, `--progress off` to silence it); stdout and `--json` output are unchanged. From another terminal, `amem sync --status` shows running, finished or interrupted operations without opening memory or taking a lock. One sync covers the
|
|
624
|
+
A long first sync reports its phase, row counters and last progress on stderr when stderr is a terminal (`--progress json` for one versioned event per line, `--progress off` to silence it); stdout and `--json` output are unchanged. From another terminal, `amem sync --status` shows running, finished or interrupted operations without opening memory or taking a lock. One placement sync covers the effective home-wide inventory, publishing the user realm first and then project realms in key-hash order in batches of at most two realms. A failed publication stops the run; a retry resumes it first. Activation and each publication share a 64 MiB/20000-row source envelope; a refusal names its phase, bound kind, limit and observed size.
|
|
625
|
+
|
|
626
|
+
To add a curated project realm that appears after activation, preview `amem migrate --sync-placement --admit <project> --dry-run`, then use `--apply` if the preview is acceptable. An interrupted admission uses `--resume`; `--abandon` previews removal of eligible unpublished intent bytes and `--abandon --confirm` applies that removal. It appends a same-epoch inventory extension and does not rewrite activation metadata. To discover remote-only curated project realms, run `amem migrate --sync-placement --list-remote`; it reports scope and key hash only, using the already configured private placement remote. Map a hash to a project key yourself, then preview `amem migrate --sync-placement --admit <project> --from-remote --dry-run` and use `--apply` to adopt it. Targeted rows withheld by a remote prune witness are omitted from the staged subset; the receipt counts omissions and names `amem sync` as the next step to import the remaining history and witnesses. The standard `--resume` and `--abandon` commands recognize a retained remote operation. See [the remote admission contract](docs/contracts.md#remote-only-realm-discovery-and-admission-461).
|
|
623
627
|
|
|
624
|
-
A placement sync that
|
|
628
|
+
A placement sync that returns a refusal before publication names the failing check by a fixed category (`epoch`, `source-selection`, `policy`, `remote`, `writer-pin`, `size-bound`, `lock` or `other`) and the phase, with one next step; the result carries `placementPublication.refusal` and `amem sync --status` shows the category. No path, row or remote URL is printed (#426). Returned failures also expose a closed `failure.cause` in the library result (#462). Some early inventory failures instead throw before publication; for example an unknown epoch member raises `SyncPlacementJournalError` with code `corrupt` (#492).
|
|
625
629
|
|
|
626
630
|
On an active home, the same dry-run/apply commands explicitly renew the writer inventory on its existing epoch (#282). Declare the complete new 0.22.0-or-later roots after updating host pins and managed setup receipts. Ordinary and cadence sync then locate the new inventory and measure it afresh; original activation data, holds and prior receipts are unchanged. Pending publication or source-recovery work must first be finished with the inventoried install, for example after `dot ai rollback amem` or restoring the host's previous pin.
|
|
627
631
|
|
|
628
632
|
An interrupted renewal resumes only its exact intent. Before commit append starts, person `--abandon` can discard its unpublished metadata; after the first commit-log byte, only forward resume is supported. Unpublished intent staging requires explicit `--abandon`, then a fresh dry-run; it is never cleaned automatically. Compatible ordinary reads remain available while only renewal metadata is pending. After a crash, a retained `profile.lock` still blocks new reader admission until person `--resume` or, before commit append, `--abandon`. Never edit activation files, downgrade markers or start another epoch to discard a hold. See the [renewal contract](docs/contracts.md#same-epoch-writer-inventory-renewal-282). Real-home renewal and release remain separately authorized person operations.
|
|
633
|
+
|
|
634
|
+
When the live window reaches its revision or object bound, preview `amem migrate --sync-placement --checkpoint --writer-root '<install-root>' --json` with every writer root. The preview reports whether a new window leaves enough room for a renewal and the next observed plan; a plan too large for one window needs the separate multi-plan work. Confirming the saved preview requires a person-written `home` floor of 0.30.0 or later and every writer at or above the recorded floors. The checkpoint preserves the frozen history and carries one writer renewal into the new window. An interrupted checkpoint uses `--checkpoint --resume`, or `--checkpoint --abandon` before the first commit byte. See the [checkpoint contract](docs/contracts.md#placement-history-checkpoint-windows-288).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@staix/agent-mem",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"description": "Curated, shared memory for coding agents: append-only logs, a derived index, tiers and a typed graph.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"bun-types-host-1-4-2": "npm:bun-types@1.4.2",
|
|
28
28
|
"@staix/agent-mem-v0220": "npm:@staix/agent-mem@0.22.0",
|
|
29
29
|
"@types/bun-host-1-4-2": "npm:@types/bun@1.4.2",
|
|
30
|
-
"@staix/agent-mem-v0221": "npm:@staix/agent-mem@0.22.1"
|
|
30
|
+
"@staix/agent-mem-v0221": "npm:@staix/agent-mem@0.22.1",
|
|
31
|
+
"@staix/agent-mem-v0290": "npm:@staix/agent-mem@0.29.0"
|
|
31
32
|
},
|
|
32
33
|
"exports": {
|
|
33
34
|
".": "./src/index.ts",
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { createHash, randomBytes } from "node:crypto";
|
|
2
|
+
import { closeSync, constants, fstatSync, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, readSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import type { StandalonePolicyOptions } from "./memory/policy.ts";
|
|
5
|
+
import { shardDir, shardMachineDir } from "./memory/shard.ts";
|
|
6
|
+
import type { WorkListFields, WorkListView } from "./memory/work-lists.ts";
|
|
7
|
+
|
|
8
|
+
/** Shared bound for the derived work snapshot; it holds every current list, closed ones included, with every item. */
|
|
9
|
+
export const WORK_BRIEF_BYTES = 16 * 1024;
|
|
10
|
+
const SCHEMA = "agent-mem.brief-work/v1", MAX_FIELDS = 64;
|
|
11
|
+
/** Lists one snapshot keeps; past this the brief reports the work section partial. */
|
|
12
|
+
export const WORK_BRIEF_VIEWS = 32;
|
|
13
|
+
|
|
14
|
+
export interface WorkBriefBinding { base: string; project: string; machine: string; revision?: string }
|
|
15
|
+
/** One work-log segment's write frontier: a later append changes `bytes` (and `mtimeMs`), which makes a snapshot stale. */
|
|
16
|
+
export interface WorkSegment { key: string; file: string; bytes: number; mtimeMs: number }
|
|
17
|
+
export interface WorkBrief {
|
|
18
|
+
schema: typeof SCHEMA; project: string;
|
|
19
|
+
/** The segments the rows were read at; a changed frontier makes the file stale, never wrong. */
|
|
20
|
+
segments: WorkSegment[];
|
|
21
|
+
/** The home policy configuration the rows were screened with; a change invalidates the file. */
|
|
22
|
+
policy: string;
|
|
23
|
+
/** Composed views, sorted by list name, closed lists included so a later write can update one in place. */
|
|
24
|
+
rows: { source: WorkListView }[];
|
|
25
|
+
/** More lists existed than the snapshot keeps. */
|
|
26
|
+
truncated: boolean;
|
|
27
|
+
}
|
|
28
|
+
export function workBriefFile(binding: WorkBriefBinding): string {
|
|
29
|
+
if (binding.revision !== undefined && !/^[a-f0-9]{64}$/.test(binding.revision)) throw new Error("invalid work policy revision");
|
|
30
|
+
return join(shardMachineDir(binding.base, binding.project, binding.machine), binding.revision ? `brief-work-${binding.revision}.json` : "brief-work.json");
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Static policy inputs only. A host callback has no stable identity and cannot be bound to a snapshot.
|
|
35
|
+
*/
|
|
36
|
+
export function workPolicyRevision(options: StandalonePolicyOptions): string {
|
|
37
|
+
return createHash("sha256").update(JSON.stringify({ schema: "agent-mem.standalone-policy/v1",
|
|
38
|
+
denyPaths: [...(options.denyPaths ?? [])].sort(), piiPatterns: [...(options.piiPatterns ?? [])].sort() })).digest("hex");
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Called under the work mutation lock after publishing a revision file. */
|
|
42
|
+
export function pruneWorkBriefs(binding: WorkBriefBinding): void {
|
|
43
|
+
const directory = shardMachineDir(binding.base, binding.project, binding.machine);
|
|
44
|
+
const files = readdirSync(directory).filter(name => /^brief-work-[a-f0-9]{64}\.json$/.test(name))
|
|
45
|
+
.map(name => ({ name, stat: lstatSync(join(directory, name), { throwIfNoEntry: false }) }))
|
|
46
|
+
.filter(entry => entry.stat?.isFile() && !entry.stat.isSymbolicLink())
|
|
47
|
+
.sort((a, b) => b.stat!.mtimeMs - a.stat!.mtimeMs || a.name.localeCompare(b.name));
|
|
48
|
+
const current = workBriefFile(binding), latest = Math.max(Date.now(), ...files.map(entry => entry.stat!.mtimeMs + 1));
|
|
49
|
+
const fd = openSync(current, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
50
|
+
try { futimesSync(fd, latest / 1000, latest / 1000); } finally { closeSync(fd); }
|
|
51
|
+
const currentName = `brief-work-${binding.revision}.json`;
|
|
52
|
+
files.sort((a, b) => Number(b.name === currentName) - Number(a.name === currentName) || b.stat!.mtimeMs - a.stat!.mtimeMs || a.name.localeCompare(b.name));
|
|
53
|
+
for (const entry of files.slice(4)) rmSync(join(directory, entry.name), { force: true });
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Reserve a slot before replacement so a crash cannot leave a fifth revision. Caller holds the mutation lock. */
|
|
57
|
+
export function reserveWorkBriefSlot(binding: WorkBriefBinding): void {
|
|
58
|
+
const directory = shardMachineDir(binding.base, binding.project, binding.machine);
|
|
59
|
+
mkdirSync(directory, { recursive: true, mode: 0o700 });
|
|
60
|
+
const current = `brief-work-${binding.revision}.json`;
|
|
61
|
+
const files = readdirSync(directory).filter(name => /^brief-work-[a-f0-9]{64}\.json$/.test(name))
|
|
62
|
+
.map(name => ({ name, stat: lstatSync(join(directory, name)) }))
|
|
63
|
+
.sort((a, b) => b.stat.mtimeMs - a.stat.mtimeMs || a.name.localeCompare(b.name));
|
|
64
|
+
const others = files.filter(entry => entry.name !== current);
|
|
65
|
+
for (const entry of others.slice(3)) rmSync(join(directory, entry.name), { force: true });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The work log's frontier for a project and its aliases, in stable order. An unsafe segment path answers undefined,
|
|
70
|
+
* which no published snapshot matches.
|
|
71
|
+
*/
|
|
72
|
+
export function workLogSegments(base: string, project: string, aliases: readonly string[]): WorkSegment[] | undefined {
|
|
73
|
+
const segments: WorkSegment[] = [];
|
|
74
|
+
for (const key of [project, ...aliases]) {
|
|
75
|
+
const directory = join(shardDir(base, key), "work", "log");
|
|
76
|
+
let files: string[];
|
|
77
|
+
try { files = readdirSync(directory).sort(); } catch { continue; }
|
|
78
|
+
for (const file of files) {
|
|
79
|
+
if (!/^[a-f0-9]{16}\.jsonl$/.test(file)) continue;
|
|
80
|
+
const stat = lstatSync(join(directory, file), { throwIfNoEntry: false });
|
|
81
|
+
if (!stat || !stat.isFile() || stat.isSymbolicLink()) return;
|
|
82
|
+
segments.push({ key, file, bytes: stat.size, mtimeMs: stat.mtimeMs });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return segments;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const text = (value: unknown, maximum: number): boolean => typeof value === "string" && value.length <= maximum && !/[\x00-\x1f\x7f]/.test(value);
|
|
89
|
+
function validFields(input: unknown): input is WorkListFields {
|
|
90
|
+
if (!input || typeof input !== "object" || Array.isArray(input)) return false;
|
|
91
|
+
const entries = Object.entries(input);
|
|
92
|
+
if (entries.length > MAX_FIELDS) return false;
|
|
93
|
+
return entries.every(([key, value]) => text(key, 100) && (value === null || typeof value === "boolean"
|
|
94
|
+
|| typeof value === "number" && Number.isFinite(value) || typeof value === "string" && value.length <= 8000 && !value.includes("\0")));
|
|
95
|
+
}
|
|
96
|
+
/** Cache files are untrusted derived data: require the only view shape `read()` composes before any display. */
|
|
97
|
+
export function validCachedWork(source: unknown): source is WorkListView {
|
|
98
|
+
if (!source || typeof source !== "object" || Array.isArray(source)) return false;
|
|
99
|
+
const view = source as WorkListView;
|
|
100
|
+
return text(view.list, 300) && validFields(view.fields) && typeof view.closed === "boolean"
|
|
101
|
+
&& Array.isArray(view.items)
|
|
102
|
+
&& view.items.every(item => !!item && typeof item === "object" && text(item.task, 300) && validFields(item.fields));
|
|
103
|
+
}
|
|
104
|
+
const validSegments = (input: unknown): input is WorkSegment[] => Array.isArray(input) && input.length <= 64
|
|
105
|
+
&& input.every(segment => !!segment && typeof segment === "object" && text(segment.key, 1000) && text(segment.file, 64)
|
|
106
|
+
&& Number.isSafeInteger(segment.bytes) && segment.bytes >= 0 && Number.isFinite(segment.mtimeMs));
|
|
107
|
+
|
|
108
|
+
export function readWorkBrief(binding: WorkBriefBinding): WorkBrief | undefined {
|
|
109
|
+
let fd: number | undefined;
|
|
110
|
+
try {
|
|
111
|
+
fd = openSync(workBriefFile(binding), constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
112
|
+
const stat = fstatSync(fd);
|
|
113
|
+
if (!stat.isFile() || stat.nlink !== 1 || stat.uid !== process.getuid?.() || stat.size < 1 || stat.size > WORK_BRIEF_BYTES || (stat.mode & 0o077) !== 0) return;
|
|
114
|
+
const bytes = Buffer.alloc(WORK_BRIEF_BYTES + 1);
|
|
115
|
+
const size = readSync(fd, bytes, 0, bytes.length, 0); // one bounded read, including an oversize sentinel
|
|
116
|
+
const after = fstatSync(fd);
|
|
117
|
+
if (size !== stat.size || size > WORK_BRIEF_BYTES || stat.size !== after.size || stat.mtimeMs !== after.mtimeMs || stat.ctimeMs !== after.ctimeMs) return;
|
|
118
|
+
const brief = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes.subarray(0, size))) as WorkBrief;
|
|
119
|
+
if (brief.schema !== SCHEMA || brief.project !== binding.project || !validSegments(brief.segments)
|
|
120
|
+
|| typeof brief.policy !== "string" || !brief.policy || typeof brief.truncated !== "boolean"
|
|
121
|
+
|| !Array.isArray(brief.rows) || brief.rows.length > WORK_BRIEF_VIEWS
|
|
122
|
+
|| brief.rows.some(row => !row || !validCachedWork(row.source))) return;
|
|
123
|
+
return brief;
|
|
124
|
+
} catch { return undefined; }
|
|
125
|
+
finally { if (fd !== undefined) closeSync(fd); }
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Atomic private replacement. The caller proves the frontier its rows were read at and writes nothing when the composed set
|
|
130
|
+
* passes the bound, so an over-cap set leaves the previous file (stale) rather than a subset that reads as complete.
|
|
131
|
+
*/
|
|
132
|
+
export function writeWorkBrief(binding: WorkBriefBinding, brief: WorkBrief): boolean {
|
|
133
|
+
const body = JSON.stringify(brief) + "\n";
|
|
134
|
+
if (Buffer.byteLength(body) > WORK_BRIEF_BYTES) return false;
|
|
135
|
+
const file = workBriefFile(binding), temporary = `${file}.${process.pid}.${randomBytes(8).toString("hex")}.tmp`;
|
|
136
|
+
try {
|
|
137
|
+
mkdirSync(join(file, ".."), { recursive: true, mode: 0o700 });
|
|
138
|
+
writeFileSync(temporary, body, { mode: 0o600, flag: "wx" });
|
|
139
|
+
renameSync(temporary, file);
|
|
140
|
+
return true;
|
|
141
|
+
} finally { rmSync(temporary, { force: true }); }
|
|
142
|
+
}
|
package/src/cli.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { recordMemoryUse } from "./memory/use-telemetry.ts";
|
|
|
16
16
|
import { DecayApplyError } from "./memory/decay-review.ts";
|
|
17
17
|
import { createMemoryMcp } from "./mcp-memory.ts";
|
|
18
18
|
import { safeProfileLockMessage } from "./memory/profile-lock-diagnostic.ts";
|
|
19
|
+
import { PLACEMENT_CHECKPOINT_PENDING_MESSAGE } from "./memory/sync-placement-journal-format.ts";
|
|
19
20
|
import { MCP_TOOLS, serveMcp, writeConfirmed } from "./mcp.ts";
|
|
20
21
|
import { createStandalonePolicy } from "./memory/policy.ts";
|
|
21
22
|
import { configuredPolicy, configuredPolicyOptions, loadAmemConfig, repoConfigRoot } from "./memory/config.ts";
|
|
@@ -33,7 +34,7 @@ import { memoryProjectKey } from "./memory/project.ts";
|
|
|
33
34
|
import { CandidateStore, candidateTargetRevision, type CandidateFilter } from "./memory/candidates.ts";
|
|
34
35
|
import { candidateOverlaps, candidateOverlapsBatch } from "./memory/candidate-overlaps.ts";
|
|
35
36
|
import { openCuratedForRead } from "./memory/curated-read.ts";
|
|
36
|
-
import { aliasedKeys, appendAlias, appendUnalias,
|
|
37
|
+
import { aliasedKeys, appendAlias, appendUnalias, listAliases, readShardedSelection, resolveAlias } from "./memory/shard.ts";
|
|
37
38
|
import { capacityReport, capacityText, capacityApplyText, capacitySplitText } from "./memory/capacity.ts";
|
|
38
39
|
import { CaptureStore, readCaptureConfigFile, writeCaptureConfigFile, type CaptureConfig } from "./memory/capture.ts";
|
|
39
40
|
|
|
@@ -41,6 +42,7 @@ import { COMMANDS, commandHelp, parseCommand } from "./commands-table.ts";
|
|
|
41
42
|
import { completionScript } from "./completion.ts";
|
|
42
43
|
import { memoryHome, resolveMemoryHome } from "./memory/home.ts";
|
|
43
44
|
import { realPath } from "./memory/platform.ts";
|
|
45
|
+
import { RemoteRealmRefusal } from "./memory/sync-placement-remote-refusal.ts";
|
|
44
46
|
import { hashJSON, readSelector, resolveProfile } from "./memory/generation.ts";
|
|
45
47
|
import { migrate, migrationText } from "./memory/migrate.ts";
|
|
46
48
|
import { migrateShards, shardMigrationStatus, shardMigrationText } from "./memory/shard-migration.ts";
|
|
@@ -122,13 +124,13 @@ const planFileIO: PrunePlanFileIO = {
|
|
|
122
124
|
};
|
|
123
125
|
|
|
124
126
|
/** Open once: pathname replacement cannot redirect the read and growth cannot exceed the fixed byte budget. */
|
|
125
|
-
export function readPrunePlanFile(path: string, io: PrunePlanFileIO = planFileIO): string {
|
|
127
|
+
export function readPrunePlanFile(path: string, io: PrunePlanFileIO = planFileIO, maximum = PRUNE_PLAN_MAX_BYTES): string {
|
|
126
128
|
try {
|
|
127
129
|
const fd = io.open(path, constants.O_RDONLY | constants.O_NOFOLLOW | constants.O_NONBLOCK);
|
|
128
130
|
try {
|
|
129
131
|
const before = io.stat(fd);
|
|
130
|
-
if (!before.isFile() || !Number.isSafeInteger(before.size) || before.size < 0 || before.size >
|
|
131
|
-
const data = Buffer.alloc(
|
|
132
|
+
if (!before.isFile() || !Number.isSafeInteger(before.size) || before.size < 0 || before.size > maximum) throw new Error();
|
|
133
|
+
const data = Buffer.alloc(maximum + 1);
|
|
132
134
|
let length = 0;
|
|
133
135
|
while (length < data.length) {
|
|
134
136
|
const n = io.read(fd, data, length, data.length - length, length);
|
|
@@ -136,7 +138,7 @@ export function readPrunePlanFile(path: string, io: PrunePlanFileIO = planFileIO
|
|
|
136
138
|
if (n === 0) break;
|
|
137
139
|
length += n;
|
|
138
140
|
}
|
|
139
|
-
if (length >
|
|
141
|
+
if (length > maximum) throw new Error();
|
|
140
142
|
const after = io.stat(fd);
|
|
141
143
|
if (!after.isFile() || after.size !== before.size || length !== before.size) throw new Error();
|
|
142
144
|
return new TextDecoder("utf-8", { fatal: true }).decode(data.subarray(0, length));
|
|
@@ -163,6 +165,16 @@ function assertSpoolReplayArguments(path: readonly string[], options: Record<str
|
|
|
163
165
|
if (!isAbsolute(source)) throw new AgentUsageError("--source is a relative path; pass the absolute path of the parked directory");
|
|
164
166
|
}
|
|
165
167
|
}
|
|
168
|
+
/** Realm admission receipts name hashes and counts only; the project key is the caller's own argument. */
|
|
169
|
+
function realmAdmissionDetail(result: { state: string; next?: { sequence: number; mode: "new" | "existing" }; sequence?: number; headHash?: string; created?: boolean; discarded?: number; discards?: number; staged?: number; nextStep?: string }): string {
|
|
170
|
+
if (result.staged) return `; ${result.state === "abandoned" ? "removed" : "would remove"} ${result.staged} private intent stage(s), ${result.discarded ?? result.discards ?? 0} bytes${result.state === "abandoned" ? "" : "; rerun with --confirm"}`;
|
|
171
|
+
if (result.state === "admitted") return `; appended record ${result.sequence} ${result.headHash}${result.created ? "; wrote the realm's empty curated metadata first" : ""}`;
|
|
172
|
+
if (result.state === "already-admitted") return result.nextStep ? `; ${result.nextStep}` : "; the realm is already in the effective inventory and nothing was appended";
|
|
173
|
+
if (result.state === "abandoned") return `; removed the retained intent for record ${result.sequence} and discarded ${result.discarded ?? 0} incomplete bytes`;
|
|
174
|
+
if (result.next) return `; would append record ${result.next.sequence} over the ${result.next.mode} realm's curated metadata; writes nothing until --apply`;
|
|
175
|
+
if (result.state === "abandonable" || result.state === "retained") return `; would remove the retained intent for record ${result.sequence} and discard ${result.discards ?? result.discarded ?? 0} incomplete bytes; rerun with --confirm`;
|
|
176
|
+
return result.nextStep ? `; ${result.nextStep}` : `; no change`;
|
|
177
|
+
}
|
|
166
178
|
/** Body-free preview text: counts by class, then each record's cwd, current project and class for explicit confirmation. */
|
|
167
179
|
function replayPreviewText(plan: { records: { name: string; cwd: string; project: string | null; class: string; event: string | null }[]; counts: Record<string, number>; digest: string; needsConfirmation: { cwd: string; project: string; count: number }[] }): string {
|
|
168
180
|
const lines = [`spool replay preview (no record bodies shown; plan ${plan.digest.slice(0, 12)})`,
|
|
@@ -314,7 +326,7 @@ export async function runCli(argv: readonly string[], context: CliContext = {}):
|
|
|
314
326
|
}
|
|
315
327
|
}
|
|
316
328
|
return output;
|
|
317
|
-
}).catch((error: unknown) => {
|
|
329
|
+
}).catch(async (error: unknown) => {
|
|
318
330
|
// Preserve the authoritative partial outcome, without exposing a cause or a withheld target.
|
|
319
331
|
if (marked && error instanceof DecayApplyError) {
|
|
320
332
|
let readable = false;
|
|
@@ -324,6 +336,11 @@ export async function runCli(argv: readonly string[], context: CliContext = {}):
|
|
|
324
336
|
}
|
|
325
337
|
// Data-free errors (decided before any store or file is opened) keep their own message.
|
|
326
338
|
if (marked && error instanceof AgentUsageError) throw error;
|
|
339
|
+
if (marked && error instanceof RemoteRealmRefusal) throw error;
|
|
340
|
+
// The checkpoint pending message is a fixed data-free remedy shared by journal and writer guards.
|
|
341
|
+
if (marked && error instanceof Error && error.message === PLACEMENT_CHECKPOINT_PENDING_MESSAGE) throw new Error(PLACEMENT_CHECKPOINT_PENDING_MESSAGE);
|
|
342
|
+
// #288 step 3: checkpoint refusals are fixed cause-and-next-step strings with numbers only (no path, row or project).
|
|
343
|
+
if (marked && error instanceof Error && error.name === "PlacementCheckpointError" && error instanceof (await import("./memory/sync-placement-checkpoint-person.ts")).PlacementCheckpointError) throw new Error(error.message);
|
|
327
344
|
const recovery=marked?safeProfileLockMessage(error):undefined;if(recovery)throw new Error(recovery);
|
|
328
345
|
if (marked) {
|
|
329
346
|
// parseCommand is pure: when it rejects argv, the error it raised is a usage error, not memory data.
|
|
@@ -398,8 +415,26 @@ async function runCliCommand(argv: readonly string[], context: CliContext): Prom
|
|
|
398
415
|
const modes = ["--dry-run","--apply","--resume","--abandon","--deactivate"].filter(key=>options[key]===true);
|
|
399
416
|
if (modes.length>1 || parsed.positionals.length || ["--shards","--public-prune-view","--generation","--deactivate"].some(key=>options[key]!==undefined))
|
|
400
417
|
throw new AgentUsageError("Sync placement is a home-wide forward-only migration; use only --sync-placement with --dry-run, --apply, --resume or pre-marker --abandon and the writer roots, never combine migration families or deactivate.");
|
|
401
|
-
|
|
402
|
-
|
|
418
|
+
if (options["--list-remote"] === true && (modes.length || options["--admit"] !== undefined || options["--from-remote"] === true || options["--writer-root"] !== undefined || options["--confirm"] === true || options["--checkpoint"] === true || options["--plan"] !== undefined))
|
|
419
|
+
throw new AgentUsageError("Remote realm listing uses only --sync-placement --list-remote and optional --json.");
|
|
420
|
+
if (options["--from-remote"] === true && options["--admit"] === undefined)
|
|
421
|
+
throw new AgentUsageError("--from-remote requires --sync-placement --admit <project>.");
|
|
422
|
+
if (options["--checkpoint"] === true) {
|
|
423
|
+
// #288 step 3: preview (default), --confirm --plan, --resume or --abandon; one mode at a time.
|
|
424
|
+
const chosen = [options["--confirm"] === true, options["--resume"] === true, options["--abandon"] === true].filter(Boolean).length;
|
|
425
|
+
if (options["--admit"] !== undefined || options["--list-remote"] === true || options["--from-remote"] === true || options["--apply"] === true || options["--dry-run"] === true || chosen > 1 || (options["--confirm"] === true) !== (options["--plan"] !== undefined)
|
|
426
|
+
|| (options["--resume"] === true || options["--abandon"] === true) && options["--writer-root"] !== undefined)
|
|
427
|
+
throw new AgentUsageError("A placement checkpoint uses --sync-placement --checkpoint --writer-root <install root> (repeat) to preview, then --confirm --plan <saved preview JSON> with the same writer roots, or --resume / --abandon alone.");
|
|
428
|
+
} else if (options["--plan"] !== undefined) {
|
|
429
|
+
throw new AgentUsageError("--plan applies only to --sync-placement --checkpoint --confirm.");
|
|
430
|
+
} else if (options["--admit"] !== undefined) {
|
|
431
|
+
if (options["--writer-root"] !== undefined || options["--confirm"] === true && options["--abandon"] !== true)
|
|
432
|
+
throw new AgentUsageError("Admitting one realm uses only --sync-placement --admit <project> with --dry-run, --apply, --resume or --abandon --confirm; writer roots belong to initial activation.");
|
|
433
|
+
} else if (options["--confirm"] === true) {
|
|
434
|
+
throw new AgentUsageError("--confirm applies only to --sync-placement --admit <project> --abandon or --sync-placement --checkpoint --plan <file>; other placement modes keep their own confirmation.");
|
|
435
|
+
}
|
|
436
|
+
} else if (parsed.path[0] === "migrate" && (options["--writer-root"] !== undefined||options["--abandon"]!==undefined||options["--admit"]!==undefined||options["--list-remote"]!==undefined||options["--from-remote"]!==undefined||options["--checkpoint"]!==undefined||options["--plan"]!==undefined)) {
|
|
437
|
+
throw new AgentUsageError("--writer-root, --abandon, --admit, --list-remote, --from-remote, --checkpoint and --plan apply only to --sync-placement; run amem migrate --sync-placement --dry-run to review the inventory.");
|
|
403
438
|
}
|
|
404
439
|
if (parsed.path[0] === "setup") {
|
|
405
440
|
if (parsed.positionals.length !== 1 || options["--apply"] === true && options["--undo"] === true
|
|
@@ -502,6 +537,58 @@ async function runCliCommand(argv: readonly string[], context: CliContext): Prom
|
|
|
502
537
|
if (modes.length > 1) throw new Error("migration modes are mutually exclusive");
|
|
503
538
|
const mode = options["--apply"] ? "apply" : options["--resume"] ? "resume" : options["--deactivate"] ? "deactivate" : "dry-run";
|
|
504
539
|
if (options["--sync-placement"] === true) {
|
|
540
|
+
if (options["--list-remote"] === true) {
|
|
541
|
+
const { discoverRemotePlacementRealms } = await import("./memory/sync-placement-transport.ts");
|
|
542
|
+
const realms = await discoverRemotePlacementRealms(memoryHome(), { ...(context.visibility ? { visibility: context.visibility } : {}) });
|
|
543
|
+
const nextStep = "amem migrate --sync-placement --admit <project> --from-remote --dry-run";
|
|
544
|
+
return options["--json"] === true ? JSON.stringify({ realms, nextStep }, null, 2) : `${realms.map(realm => `scope=${realm.scope} keyHash=${realm.keyHash}; next ${nextStep}`).join("\n") || "no remote-only placement realms"}`;
|
|
545
|
+
}
|
|
546
|
+
if (options["--checkpoint"] === true) {
|
|
547
|
+
const person = await import("./memory/sync-placement-checkpoint-person.ts");
|
|
548
|
+
const writerRoots = repeated(argv, "--writer-root"), ownRoot = fileURLToPath(new URL("..", import.meta.url));
|
|
549
|
+
if (options["--resume"] === true) { const r = await person.resumePlacementCheckpointPerson(memoryHome()); return options["--json"] === true ? JSON.stringify(r, null, 2) : `sync placement checkpoint: ${r.resumed ? "resumed" : "nothing pending"}; window ${r.window}\nnext: ${r.nextStep}\n`; }
|
|
550
|
+
if (options["--abandon"] === true) { const r = await person.abandonPlacementCheckpointPerson(memoryHome()); return options["--json"] === true ? JSON.stringify(r, null, 2) : `sync placement checkpoint: ${r.abandoned ? `abandoned (${r.removed} staged files removed)` : "nothing pending"}\nnext: ${r.nextStep}\n`; }
|
|
551
|
+
if (options["--confirm"] === true) {
|
|
552
|
+
let saved: unknown;
|
|
553
|
+
try { saved = JSON.parse(readPrunePlanFile(String(options["--plan"]), undefined, 4 * 1024 * 1024)); } catch { throw new Error("The checkpoint --plan file is unreadable or not the saved preview JSON; rerun amem migrate --sync-placement --checkpoint --json with the writer roots and save its output."); }
|
|
554
|
+
const r = await person.confirmPlacementCheckpoint(memoryHome(), saved, { writerRoots, ownRoot });
|
|
555
|
+
return options["--json"] === true ? JSON.stringify(r, null, 2) : `sync placement checkpoint: committed window ${r.window} with one writer renewal (plan ${r.planHash})\nnext: ${r.nextStep}\n`;
|
|
556
|
+
}
|
|
557
|
+
const preview = await person.previewPlacementCheckpoint(memoryHome(), { writerRoots, ownRoot });
|
|
558
|
+
if (options["--json"] === true) return JSON.stringify(preview, null, 2);
|
|
559
|
+
const { placementJournalObjectCompositionText } = await import("./memory/sync-placement-journal-storage.ts"), h = preview.headroom;
|
|
560
|
+
// Counts and hashes only; the sealed plan itself is in --json for the confirm step.
|
|
561
|
+
return `sync placement checkpoint preview: window ${preview.window} -> ${preview.nextWindow}; ${preview.currentObjects} of ${h.limit} live objects now\n`
|
|
562
|
+
+ `${placementJournalObjectCompositionText(preview.journalObjects)}\n`
|
|
563
|
+
+ `completed plan: ${h.completedPlan.slots} slots + ${h.completedPlan.reservedJournalChunks} reserved journal chunks; prospective plan: ${h.prospectivePlan.state === "cache-only" ? `${h.prospectivePlan.slots} slots + ${h.prospectivePlan.reservedJournalChunks} reserved journal chunks (cache-only; remote may have changed)` : h.prospectivePlan.state === "none" ? "none" : "unavailable without current remote evidence; using completed history"}\n`
|
|
564
|
+
+ `headroom after checkpoint: ${h.remaining} of ${h.limit} (live ${h.liveAfter}, next renewal ${h.nextRenewal}, largest plan ${h.largestPlan.slots} + ${h.largestPlan.reservedJournalChunks} reserved journal chunks)\n`
|
|
565
|
+
+ `home floor ${preview.requiredHomeFloor}: ${preview.floorReady ? "ready" : `missing; preview amem formats raise home ${preview.requiredHomeFloor}, then --confirm it`}; writers ${preview.writers}; plan ${preview.planHash}\n`
|
|
566
|
+
+ `next: save this preview with --json, then ${preview.nextStep}\n`;
|
|
567
|
+
}
|
|
568
|
+
if (options["--admit"] !== undefined) {
|
|
569
|
+
const { previewRealmAdmission, planRealmAbandon, applyRealmAdmission } = await import("./memory/sync-placement-realm-admission.ts");
|
|
570
|
+
const project = String(options["--admit"]);
|
|
571
|
+
const { readRemoteAdoption, inspectRemoteAdoptionPending, pendingRemoteAdoptions } = await import("./memory/sync-placement-remote-stage.ts");
|
|
572
|
+
const realm = createHash("sha256").update(project).digest("hex"), recovery = options["--resume"] === true || options["--abandon"] === true;
|
|
573
|
+
const pending = recovery ? pendingRemoteAdoptions(memoryHome()) : undefined;
|
|
574
|
+
const remotePending = recovery && (!!readRemoteAdoption(memoryHome(), realm) || inspectRemoteAdoptionPending(memoryHome(), realm).length > 0 || !!pending?.unknown || !!pending?.hashes.includes(realm));
|
|
575
|
+
if (options["--from-remote"] === true || remotePending) {
|
|
576
|
+
const { remoteRealmAdmission } = await import("./memory/sync-placement-remote-admission.ts");
|
|
577
|
+
const result = await remoteRealmAdmission(memoryHome(), project, { mode: options["--apply"] === true ? "apply" : options["--resume"] === true ? "resume" : options["--abandon"] === true ? "abandon" : "dry-run",
|
|
578
|
+
...(options["--confirm"] === true ? { confirm: true } : {}), ...(context.visibility ? { visibility: context.visibility } : {}) });
|
|
579
|
+
if (result.state === "preview") result.nextStep = "amem migrate --sync-placement --admit <project> --from-remote --apply";
|
|
580
|
+
if (options["--json"] === true) return JSON.stringify(result, null, 2);
|
|
581
|
+
return `sync placement remote admission: ${result.state}; realm ${result.realm}${result.remoteHead ? `; remote head ${result.remoteHead}` : ""}${result.omitted !== undefined ? `; omitted ${result.omitted}` : ""}${result.nextStep ? `; next ${result.nextStep}` : ""}\n`;
|
|
582
|
+
}
|
|
583
|
+
const result = options["--apply"] === true ? await applyRealmAdmission(memoryHome(), project, { mode: "apply" })
|
|
584
|
+
: options["--resume"] === true ? await applyRealmAdmission(memoryHome(), project, { mode: "resume" })
|
|
585
|
+
: options["--abandon"] === true ? options["--confirm"] === true ? await applyRealmAdmission(memoryHome(), project, { mode: "abandon", confirm: true })
|
|
586
|
+
: planRealmAbandon(memoryHome(), project)
|
|
587
|
+
: previewRealmAdmission(memoryHome(), project);
|
|
588
|
+
if (options["--json"] === true) return JSON.stringify(result, null, 2);
|
|
589
|
+
// Identifiers and counts only: the named project key never reaches output.
|
|
590
|
+
return `sync placement realm admission: ${result.state}; realm ${result.realm}${realmAdmissionDetail(result)}\n`;
|
|
591
|
+
}
|
|
505
592
|
const { activateSyncPlacement } = await import("./memory/sync-placement-activation.ts");
|
|
506
593
|
const result = await activateSyncPlacement({ memoryDir:memoryHome(),mode:options["--abandon"]?"abandon":mode as "dry-run"|"apply"|"resume",
|
|
507
594
|
writerRoots:repeated(argv,"--writer-root"),ownRoot:fileURLToPath(new URL("..",import.meta.url)),
|
|
@@ -1208,7 +1295,6 @@ async function runCliCommand(argv: readonly string[], context: CliContext): Prom
|
|
|
1208
1295
|
let output: string;
|
|
1209
1296
|
let placementWriters: import("./sync-placement-writer-context.ts").PlacementWriterContext | undefined;
|
|
1210
1297
|
let progress: import("./memory/sync-progress.ts").SyncProgress | undefined;
|
|
1211
|
-
let skippedCwdProject = false;
|
|
1212
1298
|
const stop = ifDue ? stopSignal(context.syncDeadlineMs ?? SYNC_IF_DUE_DEADLINE_MS, process) : undefined;
|
|
1213
1299
|
try {
|
|
1214
1300
|
if (sub === "sync" && (readPlacementRuntimeMarkers(syncHome).profile as { publicationFormat?:string } | undefined)?.publicationFormat === "agent-mem.sync-placement/v1") {
|
|
@@ -1216,19 +1302,13 @@ async function runCliCommand(argv: readonly string[], context: CliContext): Prom
|
|
|
1216
1302
|
progress = await placementProgress(syncHome, typeof options["--progress"] === "string" ? options["--progress"] as string : "auto", context);
|
|
1217
1303
|
placementWriters = activePlacementWriterContext(syncHome,fileURLToPath(new URL("..",import.meta.url)));
|
|
1218
1304
|
const markers = readPlacementRuntimeMarkers(syncHome);
|
|
1219
|
-
|
|
1220
|
-
if (!active) throw Error("sync placement activation metadata unavailable or changed; inspect the retained activation before continuing");
|
|
1221
|
-
skippedCwdProject = !active.activation.realms.some(realm => realm.scope === "project" && realm.keyHash === createHash("sha256").update(boundProject()).digest("hex"));
|
|
1305
|
+
if (!readActivePlacementBinding(syncHome, markers.profile, markers.shards)) throw Error("sync placement activation metadata unavailable or changed; inspect the retained activation before continuing");
|
|
1222
1306
|
}
|
|
1223
|
-
output = await withRepoRows(await rawMemoryCommand(memoryArgs, cwd, { person: true, rankedSearch: !legacySearch, ...(identity.actor === "agent" ? { screenGraph: true } : {}), ...(explainSearch ? { explainSearch: true } : {}), project: boundProject(), open:
|
|
1307
|
+
output = await withRepoRows(await rawMemoryCommand(memoryArgs, cwd, { person: true, rankedSearch: !legacySearch, ...(identity.actor === "agent" ? { screenGraph: true } : {}), ...(explainSearch ? { explainSearch: true } : {}), project: boundProject(), open: sub === "sync" && placementWriters ? () => openShardStore({ memoryDir: syncHome, user: true, deferPromotions: true }) : open, readable: notes => identity.actor === "person" ? notes : notes.filter(view => view.project === boundProject() && policyOf().screenStandalone(view)), stale: createRecallStalenessProbe({ cwd: recallRoot ?? cwd, rootConfirmed, policy: () => configured }), outputReady: notes => outputReady(notes.map(view => view.id)), importPolicy: () => text => configured.declinesPersonal(text),
|
|
1224
1308
|
sync: { ...(placementWriters ? { placementAttestation:placementWriters.attest } : {}), ...(progress ? { progress } : {}), screen: row => configured.screenStandalone(row), policyVersion: () => JSON.stringify(configuredPolicyOptions(memoryHome(), policyCwd)), ...(stop ? { signal: stop.signal } : {}) }, // the repository-narrowed policy binds what sync publishes too
|
|
1225
1309
|
onBridgeStatus: status => { receipt.bridgeStatus = status; },
|
|
1226
1310
|
// #188: ids-only listing of nearby machine-local rows; policy-refused rows are neither listed nor counted.
|
|
1227
1311
|
forgetNearby: note => forgetNearby({ base: memoryHome(), project: note.project, text: note.text, title: note.title, screen: value => configured.screenStandalone(value) }) }));
|
|
1228
|
-
if (skippedCwdProject) {
|
|
1229
|
-
const notice = "cwd project is not in the activated inventory and was skipped";
|
|
1230
|
-
output = options["--json"] ? JSON.stringify({ ...JSON.parse(output), skippedCwdProject: notice }, null, 2) : `${output}\n${notice}`;
|
|
1231
|
-
}
|
|
1232
1312
|
} catch (error) {
|
|
1233
1313
|
if (sub === "sync") progress?.finish(stop?.cause() ? "cancelled" : "failed", stop?.cause() ? "cancelled" : "unavailable");
|
|
1234
1314
|
if (sub === "sync") stampSync((error as Error).message, stop?.cause());
|
package/src/commands-table.ts
CHANGED
|
@@ -121,7 +121,13 @@ export const COMMANDS: Record<string, CommandDefinition> = {
|
|
|
121
121
|
"--shards": flag("Migrate the curated home into project and user shards"),
|
|
122
122
|
"--public-prune-view": flag("Enable the forward-only v2 public prune view on an active split"),
|
|
123
123
|
"--sync-placement": flag("Person-only forward-only placement activation on this memory home; no automatic migration or renewal"),
|
|
124
|
+
"--list-remote": flag("List remote placement project refs outside the active inventory by hash"),
|
|
124
125
|
"--abandon": flag("Person-only: discard an interrupted sync-placement attempt only before either v3 marker is installed"),
|
|
126
|
+
"--admit": text("Admit one curated project realm that appeared after activation into the same epoch; previews without --apply"),
|
|
127
|
+
"--from-remote": flag("Admit the named remote-only realm using the configured placement sync remote"),
|
|
128
|
+
"--confirm": flag("Confirm the previewed realm admission abandonment"),
|
|
129
|
+
"--checkpoint": flag("Person-reviewed placement checkpoint: preview by default, then --confirm --plan, --resume or --abandon"),
|
|
130
|
+
"--plan": { description: "Saved --checkpoint --json preview to confirm", value: "path" },
|
|
125
131
|
"--writer-root": { description: "Repeatable absolute amem install root in the complete local writer inventory", value: "path" },
|
|
126
132
|
} },
|
|
127
133
|
status: { description: "Report shard migration and pending old-layout appends", options: json },
|