forjar 1.4.2

Rust-native Infrastructure as Code — bare-metal first, BLAKE3 state, provenance tracing
Documentation
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
//! CLI Args structs for analysis/audit commands (extract, security, sbom, cbom, prove, etc.)

/// FJ-1403: Least-privilege execution analysis.
#[derive(clap::Args, Debug)]
pub struct PrivilegeAnalysisArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Target specific machine
    #[arg(short, long)]
    pub machine: Option<String>,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1404: SLSA provenance attestation generation.
#[derive(clap::Args, Debug)]
pub struct ProvenanceArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// State directory
    #[arg(long, default_value = "state")]
    pub state_dir: std::path::PathBuf,

    /// Target specific machine
    #[arg(short, long)]
    pub machine: Option<String>,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1405: Merkle DAG configuration lineage.
#[derive(clap::Args, Debug)]
pub struct LineageArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1384: Extract resources matching tag/group/glob into sub-config.
#[derive(clap::Args, Debug)]
pub struct ExtractArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Filter to resources with this tag
    #[arg(long)]
    pub tags: Option<String>,

    /// Filter to resources in this resource_group
    #[arg(long)]
    pub group: Option<String>,

    /// Filter to resource IDs matching glob pattern (e.g., "web-*")
    #[arg(long)]
    pub glob: Option<String>,

    /// Output file (default: stdout)
    #[arg(short, long)]
    pub output: Option<std::path::PathBuf>,

    /// Output as JSON instead of YAML
    #[arg(long)]
    pub json: bool,
}

/// FJ-1390: Static IaC security scanner — detect security smells in configs.
#[derive(clap::Args, Debug)]
pub struct SecurityScanArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,

    /// Fail on findings at or above this severity (critical, high, medium, low)
    #[arg(long)]
    pub fail_on: Option<String>,
}

/// FJ-1395: Generate SBOM (Software Bill of Materials) for managed infrastructure.
#[derive(clap::Args, Debug)]
pub struct SbomArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// State directory (for hash lookups)
    #[arg(long, default_value = "state")]
    pub state_dir: std::path::PathBuf,

    /// Output as SPDX JSON (default: text table)
    #[arg(long)]
    pub json: bool,
}

/// FJ-1400: Cryptographic Bill of Materials (CBOM) generation.
#[derive(clap::Args, Debug)]
pub struct CbomArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// State directory (for hash lookups)
    #[arg(long, default_value = "state")]
    pub state_dir: std::path::PathBuf,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1406: Self-contained recipe bundle packaging.
#[derive(clap::Args, Debug)]
pub struct BundleArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Output archive path (default: dry-run manifest only)
    #[arg(short, long)]
    pub output: Option<std::path::PathBuf>,

    /// Include state directory in bundle
    #[arg(long)]
    pub include_state: bool,

    /// Verify an existing bundle manifest against filesystem
    #[arg(long)]
    pub verify: bool,
}

/// FJ-1407: Generate model card from config + state.
#[derive(clap::Args, Debug)]
pub struct ModelCardArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// State directory
    #[arg(long, default_value = "state")]
    pub state_dir: std::path::PathBuf,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1408: Agent-specific SBOM generation.
#[derive(clap::Args, Debug)]
pub struct AgentSbomArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// State directory
    #[arg(long, default_value = "state")]
    pub state_dir: std::path::PathBuf,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1409: Training reproducibility proof certificate.
#[derive(clap::Args, Debug)]
pub struct ReproProofArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// State directory
    #[arg(long, default_value = "state")]
    pub state_dir: std::path::PathBuf,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1401: Convergence proof from arbitrary state.
#[derive(clap::Args, Debug)]
pub struct ProveArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// State directory
    #[arg(long, default_value = "state")]
    pub state_dir: std::path::PathBuf,

    /// Machine to prove convergence for (default: all)
    #[arg(short, long)]
    pub machine: Option<String>,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1410: Data freshness monitoring — detect stale artifacts.
#[derive(clap::Args, Debug)]
pub struct DataFreshnessArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// State directory
    #[arg(long, default_value = "state")]
    pub state_dir: std::path::PathBuf,

    /// Maximum artifact age in hours (default: 24)
    #[arg(long)]
    pub max_age: Option<u64>,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1411: Declarative data validation checks.
#[derive(clap::Args, Debug)]
pub struct DataValidateArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Target specific resource
    #[arg(short, long)]
    pub resource: Option<String>,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1412: Training checkpoint management.
#[derive(clap::Args, Debug)]
pub struct CheckpointArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Target specific machine
    #[arg(short, long)]
    pub machine: Option<String>,

    /// Run garbage collection on old checkpoints
    #[arg(long)]
    pub gc: bool,

    /// Number of checkpoints to keep (with --gc)
    #[arg(long, default_value = "5")]
    pub keep: usize,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1413: Dataset versioning and lineage tracking.
#[derive(clap::Args, Debug)]
pub struct DatasetLineageArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1414: Data sovereignty tagging and compliance.
#[derive(clap::Args, Debug)]
pub struct SovereigntyArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// State directory
    #[arg(long, default_value = "state")]
    pub state_dir: std::path::PathBuf,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1415: Cost estimation and resource budgeting.
#[derive(clap::Args, Debug)]
pub struct CostEstimateArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1416: Model evaluation pipeline.
#[derive(clap::Args, Debug)]
pub struct ModelEvalArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Target specific resource
    #[arg(short, long)]
    pub resource: Option<String>,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1420: Fault injection testing.
#[derive(clap::Args, Debug)]
pub struct FaultInjectArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Target specific resource
    #[arg(short, long)]
    pub resource: Option<String>,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1421: Runtime invariant monitors.
#[derive(clap::Args, Debug)]
pub struct InvariantsArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// State directory
    #[arg(short, long, default_value = "state")]
    pub state_dir: std::path::PathBuf,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1422: ISO distribution export.
#[derive(clap::Args, Debug)]
pub struct IsoExportArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// State directory
    #[arg(short, long, default_value = "state")]
    pub state_dir: std::path::PathBuf,

    /// Output directory
    #[arg(short, long)]
    pub output: std::path::PathBuf,

    /// Include forjar binary in export
    #[arg(long)]
    pub include_binary: bool,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1423: Brownfield state import.
#[derive(clap::Args, Debug)]
pub struct ImportBrownfieldArgs {
    /// Machine name or hostname
    #[arg(short, long, default_value = "localhost")]
    pub machine: String,

    /// Resource types to scan (package, file, service)
    #[arg(short, long)]
    pub scan_types: Vec<String>,

    /// Output config file path
    #[arg(short, long)]
    pub output: Option<std::path::PathBuf>,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}

/// FJ-1424: Cross-machine dependency analysis.
#[derive(clap::Args, Debug)]
pub struct CrossDepsArgs {
    /// Path to forjar.yaml
    #[arg(short, long, default_value = "forjar.yaml")]
    pub file: std::path::PathBuf,

    /// Output as JSON
    #[arg(long)]
    pub json: bool,
}