Skip to content

M3 vup CLI: sigil grammar + lifecycle + vault verbs#4

Merged
redsolver merged 2 commits into
mainfrom
m3-vup-grammar
Apr 27, 2026
Merged

M3 vup CLI: sigil grammar + lifecycle + vault verbs#4
redsolver merged 2 commits into
mainfrom
m3-vup-grammar

Conversation

@redsolver

Copy link
Copy Markdown
Contributor

Replaces the legacy verbs (init/backup/restore/snapshots/add) with the locked sigil grammar vup +<vault> <verb>. The CLI is now a thin RPC frontend over the running daemon: only _daemon and onboard skip the daemon connection; every other verb routes through the node.

Grammar

vup ls                       # list configured vaults
vup new +music               # create + onboard a vault
vup drop +music              # remove a vault
vup +music snap              # take a snapshot, publish
vup +music history           # list snapshots
vup +music restore <hash>    # restore a snapshot
vup +music add <path>        # add a source
vup +music info              # show vault state

Single-letter aliases on every verb (s snap, h history, r restore, a add, i info). + and ++ follow the sigil rules: +name is a vault reference; ++ is reserved for future tag syntax and left untouched.

What's in

  • sigil.rs. Argv preprocessor that rewrites vup +music snap into vup vault music snap before clap sees it, plus a vault-name validator (chars + length + reserved names). Walks known global flags (--config <path>, -v/-q/--verbose/--quiet) so prefix flags don't break the rewrite. 16 unit tests.

  • cmd/lifecycle.rs. Top-level ls/new/drop. new +vault runs the onboard flow (paper key + recipient bundle); drop +vault removes the config entry after a confirm prompt.

  • cmd/vault.rs. Vault-scoped snap/history/restore/add/info, wired against the v3 vault schema (recipients / sources / blob_stores) via the existing TaskSpec RPCs. tasks::poll_until_done is now pub so vault verbs can drive their own progress bars.

  • cmd/onboard.rs. Renamed from init.rs; writes the v3 schema directly.

  • cmd/stubs.rs. Placeholders that print not yet implemented and exit 0. Stubbed: mount, snap --watch, export, join, grant, pair, kick, who, peers, unpair, and the store sub-namespace. Each stub takes &S5NodeClient even when unused, matching the production model.

Five legacy task helpers retained with #[allow(dead_code)] as natural starting points for the sub-verbs that replace them.

Bundled chore: commit cleans up five clippy lints + two fmt drifts that slipped past the previous two merges (4 of the 5 introduced by them) so the workspace once again builds clean under cargo clippy -- -D warnings. Includes a justified #[allow(clippy::enum_variant_names)] on SnapshotsCmd since the Fs postfix is user-visible (s5 snapshots list-fs, etc.).

Validation

cargo test -p vup_cli                                        # 16 sigil + 4 recovery tests
cargo test --workspace --lib --tests                         # no regressions
cargo build --workspace

…tore

Replace legacy verbs (init/backup/restore/snapshots/add) with the locked
sigil grammar `vup +<vault> <verb>`. New modules:

  sigil.rs      — argv preprocessor + vault-name validator + 16 tests
  cmd/lifecycle — top-level ls / new +vault / drop +vault
  cmd/vault     — vault-scoped snap / history / restore / add / info,
                  wired against the new vault.recipients / sources /
                  blob_stores schema via existing TaskSpec RPCs
  cmd/onboard   — renamed from init.rs; writes the new schema
  cmd/stubs     — placeholders for verbs that still need infra
                  (mount / grant / pair / export / kick / etc.)

Bootstrap exception model: only `_daemon` and `onboard` skip the daemon
connection. Every other verb routes through the running node — the CLI
is an RPC frontend.

Single-letter aliases on every verb (`s` snap, `h` history, …).
Subject-first and verb-first phrasings both accepted.
`tasks::poll_until_done` made pub so vault verbs can drive their own
progress. Five legacy task helpers retained with #[allow(dead_code)]
as natural starting points for future sub-verbs.

Assisted-by: claude-opus-4-7
CI under `cargo clippy -- -D warnings` was failing on five sites that
slipped through review:

- `s5_node/src/tasks/publish.rs`: `field_reassign_with_default` in the
  recovery-secret test fixture (use struct-update syntax).
- `s5_cli/src/cmd/blobs.rs`: drop `BlobsRead` from imports — unused since
  the v3 wire-format adapter pass.
- `s5_node/tests/peer_load.rs` (×2): `cloned_ref_to_slice_refs` —
  `&[s.clone()]` → `std::slice::from_ref(&s)`.
- `s5_node/tests/concurrent_publish.rs`: `doc_lazy_continuation` — indent
  the `window.` line so it nests under the `+` list item it continues.
- `s5_cli/src/main.rs`: `enum_variant_names` on `SnapshotsCmd::*Fs` —
  silenced with a justified `#[allow]` rather than renamed, since the
  variants are user-visible CLI subcommand names (`snapshots list-fs`,
  etc.) and the `Fs` postfix is intentional (distinguishes from future
  non-FS variants).

Also re-runs `cargo fmt --all` over `vup_cli/src/cmd/vault.rs` and
`vup_cli/src/sigil.rs` — both had latent rustfmt drift (collapsed
`println!` / argv arrays) that the previous commit didn't surface.

Validation: `cargo clippy --workspace --all-targets -- -D warnings` and
`cargo fmt --all -- --check` both pass.

Assisted-by: claude-opus-4-7
@redsolver redsolver merged commit f3d51d9 into main Apr 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant