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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
use clap::Args;
#[derive(Debug, Args)]
pub(crate) struct DumpHighlightKeywordsArgs {
/// Path to the generated keyword file (relative to the repo root).
#[arg(long, default_value = "docs/theme/harn-keywords.js")]
pub output: String,
/// Path to the portable machine-readable vocabulary manifest.
#[arg(long, default_value = "spec/language-vocabulary.json")]
pub json_output: String,
/// Package-local projection used by the standalone browser demo.
#[arg(long, default_value = "crates/harn-wasm/demo/language-vocabulary.json")]
pub wasm_json_output: String,
/// Verify the on-disk file matches what would be generated; exit non-zero
/// if stale. Used by CI to prevent drift between the highlighter and the
/// lexer/stdlib.
#[arg(long)]
pub check: bool,
}
#[derive(Debug, Args)]
pub(crate) struct DumpBuiltinMethodsArgs {
/// Markdown file whose generated builtin-method region is rewritten.
#[arg(long, default_value = "docs/src/builtins.md")]
pub output: String,
/// Verify the generated region matches the method registry; exit
/// non-zero if stale.
#[arg(long)]
pub check: bool,
}
#[derive(Debug, Args)]
pub(crate) struct DumpOperatorPrecedenceArgs {
/// Markdown files holding a generated precedence table region.
#[arg(
long = "markdown",
default_values = [
"spec/chapters/03-operator-precedence-table.md",
"docs/src/language-basics.md",
]
)]
pub markdown: Vec<String>,
/// Generated `PREC` constants the tree-sitter grammar reads.
#[arg(long, default_value = "tree-sitter-harn/grammar/precedence.js")]
pub tree_sitter: String,
/// Verify both outputs match the parser's precedence table; exit non-zero
/// if either is stale.
#[arg(long)]
pub check: bool,
}
#[derive(Debug, Args)]
pub(crate) struct DumpPromptGrammarArgs {
/// Path to the generated TextMate grammar (relative to the repo root).
#[arg(
long,
default_value = "editors/vscode/syntaxes/harn-prompt.tmLanguage.json"
)]
pub output: String,
/// Verify the on-disk grammar matches what would be generated; exit
/// non-zero if stale. Used by CI to prevent drift between the editor
/// grammar and the prompt-template engine.
#[arg(long)]
pub check: bool,
}
#[derive(Debug, Args)]
pub(crate) struct DumpPortableBenchmarkSchemaArgs {
/// Path to the generated Portable Kernel benchmark receipt schema.
#[arg(
long,
default_value = "spec/schemas/portable-kernel-benchmark.v1.schema.json"
)]
pub output: String,
/// Verify the committed schema matches the kernel-owned receipt contract.
#[arg(long)]
pub check: bool,
}
#[derive(Debug, Args)]
pub(crate) struct DumpTriggerQuickrefArgs {
/// Path to the generated trigger quickref file (relative to the repo root).
#[arg(long, default_value = "docs/llm/harn-triggers-quickref.md")]
pub output: String,
/// Verify the on-disk file matches what would be generated; exit non-zero
/// if stale. Used by CI to prevent drift between the quickref and the
/// runtime trigger provider catalog.
#[arg(long)]
pub check: bool,
}
#[derive(Debug, Args)]
pub(crate) struct DumpCliSurfaceArgs {
/// Path to the generated CLI surface listing (relative to the repo root).
#[arg(long, default_value = "spec/cli-surface.txt")]
pub output: String,
/// Verify the on-disk listing matches the live parser; exit non-zero if
/// stale. Used by CI so a removed or renamed command, flag, or alias is
/// visible in the diff that removes it.
#[arg(long)]
pub check: bool,
}
#[derive(Debug, Args)]
pub(crate) struct DumpConnectorMatrixArgs {
/// Path to the generated connector parity matrix page (relative to the repo root).
#[arg(long, default_value = "docs/src/connectors/parity-matrix.md")]
pub output: String,
/// Package manifest, package directory, or directory tree to scan. Repeatable.
#[arg(long = "source", value_name = "PATH")]
pub sources: Vec<String>,
/// Verify the on-disk file matches what would be generated; exit non-zero
/// if stale. Used by CI to prevent drift from connector package manifests.
#[arg(long)]
pub check: bool,
}
#[derive(Debug, Args)]
pub(crate) struct ConnectorSchemaCodegenArgs {
/// Schema module to read. Defaults to the embedded canonical copy
/// (`harn_stdlib::CONNECTOR_EVENT_SCHEMAS_SOURCE`).
#[arg(long, value_name = "FILE")]
pub schema: Option<String>,
/// Path for the vendored generated Rust file (relative to the repo root).
#[arg(long, value_name = "FILE")]
pub out: Option<String>,
/// Verify the vendored file matches the generator output; exit non-zero if
/// stale. Used by CI to prevent drift between the Harn schema and the
/// generated Rust structs.
#[arg(long)]
pub check: bool,
}
#[derive(Debug, Args)]
pub(crate) struct DumpHarnessMigrationsArgs {
/// Path for the vendored generated Rust table (relative to the repo root).
#[arg(long, value_name = "FILE")]
pub out: Option<String>,
/// Verify the vendored table matches the runtime registry; exit non-zero if
/// stale. Used by CI to keep the type checker's "did you mean" answers from
/// drifting away from the migration record the linter uses.
#[arg(long)]
pub check: bool,
}
#[derive(Debug, Args)]
pub(crate) struct DumpProtocolArtifactsArgs {
/// Directory for generated protocol schemas and bindings.
#[arg(long, default_value = "spec/protocol-artifacts")]
pub output_dir: String,
/// Verify checked-in artifacts match the generator output; exit non-zero
/// if stale.
#[arg(long)]
pub check: bool,
}