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
--helpadds its block fromhelp::verbs, and the root help ishelp::root.tests/cli_help.rsholds all three. - cmd
- Command implementations and the shared invocation context.
- exit
- The exit-code table. Every CLI error path maps through
this enum;
mainis 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 oneworktree remove --forceof a unit worktree). Publish failures are classified: CAS/push rejection → a typedLostRace; 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
--helpblock. - home
~/.vitrifymaterialization 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::cascadeandvitrify_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 (outsiderun). 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 writesrun.jsonbefore 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.