Skip to main content

Crate vitrify_cli

Crate vitrify_cli 

Source
Expand description

vitrify library target: exposes the CLI internals so integration tests can exercise the git layer and command modules directly. The vitrify binary is a thin wrapper over [run].

Modules§

cli
The complete command tree, via clap derive. Non-interactive always; stdout data, stderr diagnostics. Every argument carries help text; each command’s --help adds its block from help::verbs, and the root help is help::root. tests/cli_help.rs holds all three.
cmd
Command implementations and the shared invocation context.
exit
The exit-code table. Every CLI error path maps through this enum; main is the only place that converts to a process exit.
gate
Running an SDD’s own commands — the §5 Commands and Verification-table rows — through sh -c: the one sanctioned shell use, and the one place it happens.
git
The closed git subprocess layer. Every git invocation in the binary goes through here: argv-style, never a shell, never --force (save the one worktree remove --force of a unit worktree). Publish failures are classified: CAS/push rejection → a typed LostRace; anything else → an exit-1 class error with git’s stderr tail.
help
Help text: the root help (what vitrify is, where to start, commands by task, conventions, exit status) and each command’s --help block.
home
~/.vitrify materialization and disk-wins resolution.
incremental
Incremental builds against a real repository: which Verified units a change reaches, which rows a gate or a re-check runs, the rule that a gate blames a batch only for failures it caused, adoption of built attempts, and culprit finding. The pure decisions live in vitrify_core::cascade and vitrify_core::facf; this module runs git and the commands.
layout
Where vitrify keeps its working copies, and what it calls them.
out
The single output module: stdout is data, stderr is diagnostics — everywhere, no exceptions. JSON emitters match the golden corpus’ output formats byte for byte: non-ASCII escaped as \uXXXX, separators (", ", ": ") on the single-line form, or two-space indent with separators (",", ": "). Normative JSON is built from ordered pairs, never from maps (Conventions).
run
vitrify run — the deterministic orchestrator: preflight, continuous dispatch, batched serial integration, termination reports. Control flow is Rust; inference happens only at the three enumerated points: workers, escalation, and plan-time authoring (outside run). Resume = re-derivation from repo state, never memory.
signals
Interrupt handling for vitrify run. SIGINT, SIGTERM and SIGHUP set a flag; the orchestrator polls it, stops its workers and gate commands, releases its claims and writes run.json before the process ends. A second signal ends the process at once. A signal the process was started ignoring (nohup, a background job of a non-interactive shell) stays ignored.

Functions§

run
Parse argv and dispatch; returns the exit code.