Skip to main content

vitrify_cli/help/
root.rs

1//! The root help: `vitrify -h` and `vitrify --help`.
2//!
3//! clap lists subcommands under one heading, so the root command renders
4//! through [`TEMPLATE`] and these texts instead: the short variants for
5//! `-h`, the long variants for `--help`. The command lists name every
6//! command path once; `tests/cli_help.rs` holds that.
7
8/// The root help template, shared by `-h` and `--help`; the parts that
9/// differ come from `before_help`/`before_long_help` and
10/// `after_help`/`after_long_help`.
11pub const TEMPLATE: &str =
12    "{before-help}{usage-heading} {usage}\n\nOptions:\n{options}{after-help}\n";
13
14/// The one-line description, also the root command's `about`.
15pub const ABOUT: &str =
16    "vitrify — specs your coding agent builds through mechanical gates (spec-driven development)";
17
18/// `vitrify -h`, before the usage line.
19pub const BEFORE_SHORT: &str = "\
20vitrify — specs your coding agent builds through mechanical gates (spec-driven development)
21
22Start here — agents: run the procedure before changing anything under specs/
23  a new project, or a feature, from a PRD       vitrify brief authoring
24  change TDDs or SDDs, one or many              vitrify brief change
25  build an Active SDD                           vitrify brief run
26  where a build stands                          vitrify locate --units · vitrify run status
27  is the repository consistent                  vitrify check --all";
28
29/// `vitrify -h`, after the options.
30pub const AFTER_SHORT: &str = "\
31Commands, by task:
32  set up this machine      init · probe
33  procedures and formats   brief · schema show · new
34  author and check         lint · check · readset · pin list · questions
35  build and watch          run · run status · locate · ledger progress
36  change                   change apply · audit · pin sync
37  protocol verbs           claim · renew · release · trace record · trace verify ·
38                           journal append · journal replay · ledger regen
39
40Run 'vitrify --help' for commands by task, conventions and exit codes;
41'vitrify <command> --help' for what a command reads, writes and prints.";
42
43/// `vitrify --help`, before the usage line.
44pub const BEFORE_LONG: &str = "\
45vitrify — specs your coding agent builds through mechanical gates (spec-driven development)
46
47A project is described by a TDD (what to build and why) and a decision-complete
48SDD (how, cut into units with contracts and verification rows). vitrify builds
49the units in parallel with headless agent workers run through your own harness
50CLI. Work lands only through mechanical gates, and the repository is the record:
51claims, traces, the journal and the ledger live beside the spec.
52
53Start here — agents: run the procedure before changing anything under specs/
54  a whole repository, from nothing              vitrify brief onboard
55  a new project, or a feature, from a PRD       vitrify brief authoring
56  change TDDs or SDDs, one or many              vitrify brief change
57  build an Active SDD                           vitrify brief run
58  where a build stands                          vitrify locate --units · vitrify run status
59  is the repository consistent                  vitrify check --all
60  the document formats                          vitrify schema show · vitrify schema show --tdd
61  every procedure                               vitrify brief";
62
63/// `vitrify --help`, after the options.
64pub const AFTER_LONG: &str = concat!(
65    "\
66Commands by task:
67
68 Set up this machine (once, in your own terminal; not a repository's step)
69  init              ~/.vitrify/config.toml with every default, then a first probe
70  probe             probe git and the harness CLIs again; update config.toml, asking first
71
72 Procedures and formats
73  brief             print the procedure index, or one procedure
74  schema show       print the SDD schema, or the TDD schema with --tdd
75  new               materialize a TDD or SDD template into the current directory
76
77 Author and check
78  lint              authoring checks L1–L12, each finding with its remediation
79  check             every read-only check over one SDD or all: is it consistent
80  readset           a unit's ordered minimal reading set, with its byte budget
81  pin list          the external contracts (pins, transcriptions) and their states
82  questions         the open questions (Q-###) and the units they block
83
84 Build and watch
85  run               the orchestrator: build every unit through the gate
86  run status        what a run is doing, unit by unit; its report once it ends
87  locate            find SDDs; list units and whether each can be claimed; the SDD graph
88  ledger progress   the one-line progress summary
89
90 Change
91  change apply      a change entry's bookkeeping: events, Stale marks, ledger
92  audit             the seven drift checks; --fix-leases, --apply-stale fix
93  pin sync          rewrite stale pins from their authorities
94
95 Protocol verbs, for workers, the integrator and authored baselines
96 (not run by hand while `vitrify run` builds the SDD)
97  claim             take a unit's lease (publishes a mainline commit)
98  renew             extend a held lease (publishes a mainline commit)
99  release           give a lease back (publishes a mainline commit)
100  trace record      write a unit's trace map and stamp it Built or Verified
101  trace verify      compare a unit's recorded trace with the current content
102  journal append    append one event to the journal
103  journal replay    replay the journal and compare it with front matter
104  ledger regen      rewrite the derived ledger, or --check it
105
106Conventions:
107  - Never interactive, but for probe, which asks before it changes
108    ~/.vitrify/config.toml (-y answers yes); no color, pager or animation,
109    whatever the streams are.
110  - init sets the machine up once; every other command exits 4 until it
111    has, naming vitrify init, and reads ~/.vitrify/config.toml and the
112    repository's .vitrify/config.toml first: an error in either stops any
113    command alike.
114  - stdout is data; stderr is diagnostics, including `next:` lines that name
115    the command to run next.
116  - Read verbs take --json.
117  - With several SDDs in the repository, pass --sdd <root>, or --all where the
118    verb takes it.
119  - claim, renew, release and run publish mainline commits. trace record,
120    journal append, ledger regen, audit's fixing flags, pin sync and
121    change apply edit the working tree only; commit the result yourself.
122  - Briefs, schemas and templates are this binary's version.
123
124Exit status:
125  0  the asserted state holds (recorded, clean, listed, published)
126  1  unexpected error (git failure, I/O)
127  2  usage error, or a named check failed (lint, audit or check findings,
128     an init or probe FAIL, probe changes not applied, run preflight failure
129     or Blocked, a refused change apply)
130  3  trace or projection mismatch (trace verify, journal replay,
131     ledger regen --check, and check when one of those is the worst)
132  4  not found or precondition failed (no SDD, several SDDs and no --sdd, an
133     SDD of a schema version this vitrify does not read, no run recorded,
134     no journal, a machine init has not set up)
135  5  lost the publish race after retries
136  6  lease already expired (renew refused — claim again)
137
138vitrify ",
139    env!("CARGO_PKG_VERSION"),
140    " · https://github.com/bitshock-src/vitrify
141The repository's docs/ holds the guides and the reasons behind the design, for humans."
142);