1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
//! Documentation-accuracy gate for `sql-splitter generate`.
//!
//! `docs/generate/`, `website/src/content/docs/commands/generate.mdx`,
//! `README.md`, and `skills/sql-splitter/SKILL.md` all describe `generate`'s
//! CLI surface from the canonical design spec's CLI-contract tables. This
//! test is the trip wire against that surface silently drifting: it asserts
//! the `generate` subcommand is discoverable from top-level `--help`, and
//! that every flag `docs/generate/README.md`/`generate.mdx` document
//! actually appears in `generate --help`'s own output. If a flag is
//! renamed, removed, or a new one is added to `src/cmd/generate.rs` without
//! a matching doc update, this test fails before a reader hits a stale page.
use std::process::Command;
fn sql_splitter_bin() -> Command {
Command::new(env!("CARGO_BIN_EXE_sql-splitter"))
}
fn run_help(args: &[&str]) -> String {
let output = sql_splitter_bin()
.args(args)
.output()
.expect("sql-splitter binary runs");
assert!(
output.status.success(),
"{:?} exited with {:?}\nstderr: {}",
args,
output.status.code(),
String::from_utf8_lossy(&output.stderr)
);
String::from_utf8(output.stdout).expect("help output is valid UTF-8")
}
#[test]
fn top_level_help_lists_the_generate_subcommand() {
let help = run_help(&["--help"]);
assert!(
help.contains("generate"),
"top-level --help does not mention the `generate` subcommand:\n{help}"
);
}
#[test]
fn generate_help_omits_release_planning_labels() {
let help = run_help(&["generate", "--help"]);
let normalized = help.to_ascii_lowercase();
for label in [
concat!("phase ", "1"),
concat!("phase ", "2"),
concat!("phase ", "3"),
concat!("task ", "19"),
concat!("tasks ", "19"),
] {
assert!(
!normalized.contains(label),
"generate --help exposes release-planning label `{label}`:\n{help}"
);
}
}
#[test]
fn generate_help_documents_every_cli_contract_flag() {
let help = run_help(&["generate", "--help"]);
// Every flag from the canonical spec's CLI-contract tables
// (docs/superpowers/specs/2026-07-16-synthetic-data-generation-design.md,
// "CLI contract"), cross-checked against `GenerateArgs`
// (src/cmd/generate.rs) — including `--mssql-production-style`/
// `--mssql-go`, which were added after the spec was written.
let expected_flags = [
// Input and model options
"--config",
"--emit-config",
"--profile-depth",
"--profile-sample",
"--input-dialect",
// Volume options
"--scale",
"--rows",
"--table-rows",
"--table-scale",
"--max-rows",
"--tables",
"--exclude",
// Randomness options
"--seed",
"--randomize",
// Rendering options
"--output",
"--dialect",
"--schema-only",
"--data-only",
"--batch-size",
"--no-copy",
"--compress",
"--mssql-production-style",
"--mssql-go",
// Preflight and reporting options
"--check",
"--dry-run",
"--verify",
"--explain",
"--strict",
"--progress",
"--json",
"--quiet",
];
let missing: Vec<&str> = expected_flags
.iter()
.copied()
.filter(|flag| !help.contains(flag))
.collect();
assert!(
missing.is_empty(),
"generate --help is missing documented flag(s) {missing:?}\n\nfull help output:\n{help}"
);
}
#[test]
fn generate_help_documents_short_flags() {
let help = run_help(&["generate", "--help"]);
for short in ["-c", "-o"] {
assert!(
help.contains(short),
"generate --help is missing short flag `{short}`:\n{help}"
);
}
}
#[test]
fn generate_help_mentions_the_gen_alias() {
let help = run_help(&["--help"]);
assert!(
help.contains("gen"),
"top-level --help does not mention the `gen` alias for `generate`:\n{help}"
);
}