Skip to main content

hyprstream_core/cli/commands/
trust.rs

1use clap::{Args, Subcommand};
2use std::os::fd::RawFd;
3use std::path::PathBuf;
4
5#[cfg(test)]
6mod tests {
7    use super::TrustCommand;
8    use clap::Subcommand as _;
9
10    /// Every argument relationship (`requires`, `conflicts_with`) must name a
11    /// real argument; clap only discovers a typo when the command is built.
12    #[test]
13    fn trust_argument_relationships_resolve() {
14        TrustCommand::augment_subcommands(clap::Command::new("hyprstream")).debug_assert();
15    }
16}
17
18#[derive(Debug, Subcommand)]
19pub enum TrustCommand {
20    /// Hash public enrollment-only MAC boot input before independent review or signing.
21    HashMacBootPolicy(HashMacBootPolicyArgs),
22    /// Sign reviewed enrollment-only MAC boot artifacts with an existing enrolled Policy key.
23    SignMacBootPolicy(SignMacBootPolicyArgs),
24    /// Fold the enrollment-intent journal into the next UNSIGNED boot-policy
25    /// generation for offline review. Never signs and never installs.
26    ReconcileMacBootEnrollment(ReconcileMacBootEnrollmentArgs),
27    /// Generate an Ed25519 + ML-DSA-65 deployment authority.
28    MintDeploymentCa(MintDeploymentCaArgs),
29    /// Create a root-authorized, registry-only online signer.
30    DelegateRegistrySigner(DelegateRegistrySignerArgs),
31    /// Mint the one-hour registry deployment credential.
32    MintRegistryJwt(MintRegistryJwtArgs),
33    /// Attest a discovery/policy service's live hybrid public key into the
34    /// deployment trust chain (hyprstream#1562).
35    EnrollServiceKey(EnrollServiceKeyArgs),
36    /// Verify deployment artifacts through the production verifier.
37    VerifyDeployment(VerifyDeploymentArgs),
38    /// Add or replace an authority key through the signed rotation log.
39    RotateAuthority(RotateAuthorityArgs),
40    /// Install ceremony outputs to the fixed OS-owned trust paths, and
41    /// optionally enable the unattended registry-credential refresher.
42    Install(InstallDeploymentTrustArgs),
43
44    /// Mint the deployment anchor capsule and its did:web document.
45    MintAnchorCapsule(MintAnchorCapsuleArgs),
46}
47
48#[derive(Debug, Args)]
49pub struct HashMacBootPolicyArgs {
50    /// Public CompiledPolicy JSON; the matrix and UCAN capabilities must be empty.
51    #[arg(long)]
52    pub policy_input: PathBuf,
53    /// Authority-reviewed empty-capability UCAN JSON; no signer credentials are read.
54    #[arg(long)]
55    pub reviewed_ucan: PathBuf,
56}
57
58#[derive(Debug, Args)]
59pub struct ReconcileMacBootEnrollmentArgs {
60    /// Enrollment-intent journal directory written by the provisioning hooks.
61    #[arg(long)]
62    pub journal_dir: PathBuf,
63    /// Current signed boot policy JSON from the OS-owned config-pinned path.
64    #[arg(long)]
65    pub current_policy: PathBuf,
66    /// OS-owned pinned generation of the current policy; never inferred.
67    #[arg(long)]
68    pub expected_generation: u64,
69    /// OS-owned pinned BLAKE3 hash of the current policy (64 hex digits).
70    #[arg(long)]
71    pub expected_hash: String,
72    /// New directory for unsigned-policy.json and reconcile-report.json; never overwritten.
73    #[arg(long)]
74    pub output_dir: PathBuf,
75}
76
77#[derive(Debug, Args)]
78pub struct SignMacBootPolicyArgs {
79    /// Public CompiledPolicy JSON, including reviewed enrollment and an empty TE matrix.
80    #[arg(long)]
81    pub policy_input: PathBuf,
82    /// Authority-reviewed empty-capability UCAN JSON; no delegated chain is inferred.
83    #[arg(long)]
84    pub reviewed_ucan: PathBuf,
85    /// Independently reviewed lattice/policy generation; never inferred.
86    #[arg(long)]
87    pub expected_generation: u64,
88    /// Independently reviewed full policy BLAKE3 hash (64 hex digits).
89    #[arg(long)]
90    pub expected_hash: String,
91    /// Existing Policy credentials and deployment-chain-enrolled bootstrap roster.
92    #[arg(long)]
93    pub secrets_dir: PathBuf,
94    /// New directory for signed-policy.json and signed-approval.json; never overwritten.
95    #[arg(long)]
96    pub output_dir: PathBuf,
97}
98
99#[derive(Debug, Args)]
100pub struct MintAnchorCapsuleArgs {
101    /// Raw 1984-byte public deployment root.
102    #[arg(long, default_value = "deployment-ca.hybrid")]
103    pub public_ca: PathBuf,
104
105    /// Age-encrypted root/current authority bundle.
106    #[arg(long, default_value = "deployment-ca.age")]
107    pub authority_key: PathBuf,
108
109    /// Signed authority rotation log.
110    #[arg(long, default_value = "deployment-authority.log.json")]
111    pub authority_log: PathBuf,
112
113    /// Independently trusted expected authority-log head.
114    #[arg(long, default_value = "deployment-authority.head.json")]
115    pub authority_checkpoint: PathBuf,
116
117    /// Identity used to unlock the authority. Repeatable.
118    #[arg(long = "identity", value_name = "AGE_IDENTITY_FILE")]
119    pub identities: Vec<PathBuf>,
120
121    /// YubiKey identity used to unlock the authority. Repeatable.
122    #[arg(long = "yubikey-identity", value_name = "AGE_YUBIKEY_IDENTITY_FILE")]
123    pub yubikey_identities: Vec<PathBuf>,
124
125    /// Break-glass: use the age-wrapped recovery copy of a PIV Ed25519 key.
126    #[arg(long)]
127    pub software_recovery: bool,
128
129    /// Deployment did:web the capsule aliases and the document identifies.
130    #[arg(long, value_name = "DID_WEB")]
131    pub did_web: String,
132
133    /// Anchor node's iroh nodeId as an Ed25519 Multikey (`z6Mk...`).
134    #[arg(long, value_name = "MULTIKEY", conflicts_with = "quic_endpoint")]
135    pub iroh_node_id: Option<String>,
136
137    /// Optional iroh relay URL published beside the nodeId.
138    #[arg(long, value_name = "URL", requires = "iroh_node_id")]
139    pub iroh_relay: Option<String>,
140
141    /// Anchor node's QUIC socket address (`IP:PORT`).
142    #[arg(long, value_name = "ADDR")]
143    pub quic_endpoint: Option<std::net::SocketAddr>,
144
145    /// SNI presented when dialing the QUIC reach (defaults to its IP).
146    #[arg(long, value_name = "HOST", requires = "quic_endpoint")]
147    pub quic_sni: Option<String>,
148
149    /// Accepted QUIC leaf-certificate SHA-256 pin (hex). Repeatable.
150    #[arg(
151        long = "quic-cert-sha256",
152        value_name = "HEX",
153        requires = "quic_endpoint"
154    )]
155    pub quic_cert_sha256: Vec<String>,
156
157    /// Require WebPKI validation for the QUIC reach in addition to any pins.
158    #[arg(long, requires = "quic_endpoint")]
159    pub quic_web_pki: bool,
160
161    /// Discovery service's `#mesh-kem` X25519 encapsulation key (multibase).
162    #[arg(long, value_name = "MULTIBASE", requires_all = ["mesh_kem_mlkem768", "mesh_pq"])]
163    pub mesh_kem_x25519: Option<String>,
164
165    /// Discovery service's `#mesh-kem` ML-KEM-768 encapsulation key (multibase).
166    #[arg(long, value_name = "MULTIBASE", requires_all = ["mesh_kem_x25519", "mesh_pq"])]
167    pub mesh_kem_mlkem768: Option<String>,
168
169    /// Discovery service's `#mesh-pq` ML-DSA-65 verifying key (multibase).
170    #[arg(long, value_name = "MULTIBASE", requires_all = ["mesh_kem_x25519", "mesh_kem_mlkem768"])]
171    pub mesh_pq: Option<String>,
172
173    /// DAG-CBOR anchor-capsule output.
174    #[arg(long, default_value = "anchor-capsule.cbor")]
175    pub capsule_out: PathBuf,
176
177    /// Deployment did:web document output.
178    #[arg(long, default_value = "did.json")]
179    pub did_json_out: PathBuf,
180
181    /// Replace existing output files.
182    #[arg(long)]
183    pub force: bool,
184}
185
186#[derive(Debug, Args)]
187pub struct MintDeploymentCaArgs {
188    /// Raw 1984-byte public root output (32-byte Ed25519, then 1952-byte ML-DSA-65).
189    #[arg(long, default_value = "deployment-ca.hybrid")]
190    pub public_ca: PathBuf,
191
192    /// Age-encrypted authority bundle. This file must remain operator-held.
193    #[arg(long, default_value = "deployment-ca.age")]
194    pub authority_key: PathBuf,
195
196    /// Signed authority rotation log, anchored by the raw public root.
197    #[arg(long, default_value = "deployment-authority.log.json")]
198    pub authority_log: PathBuf,
199
200    /// Independently provisioned expected authority-log head.
201    #[arg(long, default_value = "deployment-authority.head.json")]
202    pub authority_checkpoint: PathBuf,
203
204    /// Native age or age-plugin recipient. Repeat to add recovery recipients.
205    #[arg(long = "recipient", value_name = "AGE_RECIPIENT")]
206    pub recipients: Vec<String>,
207
208    /// age-plugin-yubikey recipient (age1yubikey1...). Repeatable.
209    #[arg(long = "yubikey", value_name = "AGE_YUBIKEY_RECIPIENT")]
210    pub yubikey_recipients: Vec<String>,
211
212    /// Cloud/PQ-HSM age-plugin recipient. Repeatable.
213    #[arg(long = "kms-plugin", value_name = "AGE_PLUGIN_RECIPIENT")]
214    pub kms_plugin_recipients: Vec<String>,
215
216    /// Place the Ed25519 leg in this YubiKey PIV slot (firmware 5.7.4+).
217    #[arg(long, value_name = "SLOT")]
218    pub piv_slot: Option<String>,
219
220    /// Replace existing output files.
221    #[arg(long)]
222    pub force: bool,
223}
224
225#[derive(Debug, Args)]
226pub struct DelegateRegistrySignerArgs {
227    /// Raw 1984-byte public deployment root.
228    #[arg(long, default_value = "deployment-ca.hybrid")]
229    pub public_ca: PathBuf,
230
231    /// Signed authority rotation log.
232    #[arg(long, default_value = "deployment-authority.log.json")]
233    pub authority_log: PathBuf,
234
235    /// Independently trusted expected authority-log head.
236    #[arg(long, default_value = "deployment-authority.head.json")]
237    pub authority_checkpoint: PathBuf,
238
239    /// Age-encrypted root/current authority bundle.
240    #[arg(long, default_value = "deployment-ca.age")]
241    pub authority_key: PathBuf,
242
243    /// Identity used to unlock the root/current authority. Repeatable.
244    #[arg(long = "identity", value_name = "AGE_IDENTITY_FILE")]
245    pub identities: Vec<PathBuf>,
246
247    /// YubiKey identity used to unlock the root/current authority. Repeatable.
248    #[arg(long = "yubikey-identity", value_name = "AGE_YUBIKEY_IDENTITY_FILE")]
249    pub yubikey_identities: Vec<PathBuf>,
250
251    /// Break-glass: use the age-wrapped recovery copy of a PIV Ed25519 key.
252    #[arg(long)]
253    pub software_recovery: bool,
254
255    /// Recipient for the separately encrypted online signer. Repeatable.
256    #[arg(long = "signer-recipient", value_name = "AGE_RECIPIENT")]
257    pub signer_recipients: Vec<String>,
258
259    /// Encrypted online signer output.
260    #[arg(long, default_value = "registry-delegated-signer.age")]
261    pub delegated_key: PathBuf,
262
263    /// Root-authorized delegation output.
264    #[arg(long, default_value = "registry-signer.delegation.json")]
265    pub delegation: PathBuf,
266
267    /// Delegation lifetime in seconds (default 30 days, maximum one year).
268    #[arg(
269        long,
270        default_value_t = 2_592_000,
271        value_parser = clap::value_parser!(u64).range(3600..=31_536_000)
272    )]
273    pub delegation_ttl_seconds: u64,
274
275    /// Replace existing output files.
276    #[arg(long)]
277    pub force: bool,
278}
279
280#[derive(Debug, Args)]
281#[command(group = clap::ArgGroup::new("delegated_signer")
282    .args(["via_delegated_signer", "via_delegated_signer_fd"])
283    .multiple(false)
284    .conflicts_with("root"))]
285pub struct MintRegistryJwtArgs {
286    /// Raw 1984-byte public deployment root.
287    #[arg(long, default_value = "deployment-ca.hybrid")]
288    pub public_ca: PathBuf,
289
290    /// Age-encrypted root authority bundle (used only with --root).
291    #[arg(long, default_value = "deployment-ca.age")]
292    pub authority_key: PathBuf,
293
294    /// Age identity file. Repeatable for native or plugin identities.
295    #[arg(
296        long = "identity",
297        value_name = "AGE_IDENTITY_FILE",
298        conflicts_with = "identity_fds"
299    )]
300    pub identities: Vec<PathBuf>,
301
302    /// Inherited FD carrying an age identity (systemd LoadCredentialEncrypted /
303    /// podman --preserve-fds); plaintext never touches a filesystem path.
304    /// Repeatable; mutually exclusive with --identity.
305    #[arg(long = "identity-fd", value_name = "FD", value_parser = clap::value_parser!(RawFd).range(0..))]
306    pub identity_fds: Vec<RawFd>,
307
308    /// age-plugin-yubikey identity file. Repeatable; decryption requires the token.
309    #[arg(long = "yubikey-identity", value_name = "AGE_YUBIKEY_IDENTITY_FILE")]
310    pub yubikey_identities: Vec<PathBuf>,
311
312    /// Break-glass: use the age-wrapped recovery copy of a PIV Ed25519 key.
313    #[arg(long)]
314    pub software_recovery: bool,
315
316    /// Common path: decrypt this scoped online signer.
317    #[arg(long, value_name = "DELEGATED_KEY.age")]
318    pub via_delegated_signer: Option<PathBuf>,
319
320    /// Inherited FD carrying the age-encrypted scoped online signer (systemd
321    /// LoadCredentialEncrypted / podman --preserve-fds). Mutually exclusive
322    /// with --via-delegated-signer and --root.
323    #[arg(long, value_name = "FD", value_parser = clap::value_parser!(RawFd).range(0..))]
324    pub via_delegated_signer_fd: Option<RawFd>,
325
326    /// Delegation authorizing the selected delegated signer.
327    #[arg(long, value_name = "DELEGATION.json", requires = "delegated_signer")]
328    pub delegation: Option<PathBuf>,
329
330    /// Installed/current public authority log. Required for every credential.
331    #[arg(long, default_value = "deployment-authority.log.json")]
332    pub authority_log: PathBuf,
333
334    /// Independently trusted expected authority-log head.
335    #[arg(long, default_value = "deployment-authority.head.json")]
336    pub authority_checkpoint: PathBuf,
337
338    /// Rare/bootstrap path: sign directly with the deployment authority.
339    /// Required unless a delegated signer (path or inherited-FD form) is
340    /// selected; conflicts with both via the `delegated_signer` group.
341    #[arg(long, required_unless_present = "delegated_signer")]
342    pub root: bool,
343
344    /// Raw 32-byte Ed25519 registry-service public key for the cnf claim.
345    #[arg(long, value_name = "PATH")]
346    pub registry_public_key: PathBuf,
347
348    /// Credential lifetime in seconds; the profile caps this at one hour.
349    #[arg(long, default_value_t = 3600, value_parser = clap::value_parser!(u32).range(1..=3600))]
350    pub ttl_seconds: u32,
351
352    /// Registry deployment credential output.
353    #[arg(long, default_value = "registry-service.jwt")]
354    pub jwt: PathBuf,
355
356    /// Out-of-band cloud-secret publisher manifest (never pass its values to Terraform).
357    #[arg(long, default_value = "deployment-trust.contract.json")]
358    pub contract: PathBuf,
359
360    /// Replace existing output files.
361    #[arg(long)]
362    pub force: bool,
363}
364
365#[derive(Debug, Args)]
366#[command(group = clap::ArgGroup::new("delegated_signer")
367    .args(["via_delegated_signer", "via_delegated_signer_fd"])
368    .required(true)
369    .multiple(false))]
370pub struct EnrollServiceKeyArgs {
371    /// Raw 1984-byte public deployment root.
372    #[arg(long, default_value = "deployment-ca.hybrid")]
373    pub public_ca: PathBuf,
374
375    /// Installed/current public authority log.
376    #[arg(long, default_value = "deployment-authority.log.json")]
377    pub authority_log: PathBuf,
378
379    /// Independently trusted expected authority-log head.
380    #[arg(long, default_value = "deployment-authority.head.json")]
381    pub authority_checkpoint: PathBuf,
382
383    /// Age identity file. Repeatable for native or plugin identities.
384    #[arg(
385        long = "identity",
386        value_name = "AGE_IDENTITY_FILE",
387        conflicts_with = "identity_fds"
388    )]
389    pub identities: Vec<PathBuf>,
390
391    /// Inherited FD carrying an age identity (systemd LoadCredentialEncrypted /
392    /// podman --preserve-fds); plaintext never touches a filesystem path.
393    /// Repeatable; mutually exclusive with --identity.
394    #[arg(long = "identity-fd", value_name = "FD", value_parser = clap::value_parser!(RawFd).range(0..))]
395    pub identity_fds: Vec<RawFd>,
396
397    /// age-plugin-yubikey identity file. Repeatable; decryption requires the token.
398    #[arg(long = "yubikey-identity", value_name = "AGE_YUBIKEY_IDENTITY_FILE")]
399    pub yubikey_identities: Vec<PathBuf>,
400
401    /// Break-glass: use the age-wrapped recovery copy of a PIV Ed25519 key.
402    #[arg(long)]
403    pub software_recovery: bool,
404
405    /// Age-encrypted delegated online signer carrying the enrollment scope.
406    #[arg(long, value_name = "DELEGATED_KEY.age")]
407    pub via_delegated_signer: Option<PathBuf>,
408
409    /// Inherited FD carrying the age-encrypted delegated signer (systemd
410    /// LoadCredentialEncrypted / podman --preserve-fds). Mutually exclusive
411    /// with --via-delegated-signer.
412    #[arg(long, value_name = "FD", value_parser = clap::value_parser!(RawFd).range(0..))]
413    pub via_delegated_signer_fd: Option<RawFd>,
414
415    /// Two-capability delegation authorizing --via-delegated-signer.
416    #[arg(long, value_name = "DELEGATION.json")]
417    pub delegation: PathBuf,
418
419    /// Service whose key is enrolled (fixed allowlist, hyprstream#1562).
420    #[arg(long, value_parser = ["discovery", "policy"])]
421    pub service: String,
422
423    /// Raw 1984-byte hybrid service public key (`service-pubkey.hybrid`:
424    /// 32-byte Ed25519 followed by 1952-byte ML-DSA-65).
425    #[arg(long, value_name = "PATH")]
426    pub service_public_key: PathBuf,
427
428    /// Attestation lifetime in seconds; the capability caps this at one hour.
429    #[arg(long, default_value_t = 3600, value_parser = clap::value_parser!(u32).range(1..=3600))]
430    pub ttl_seconds: u32,
431
432    /// Service-key enrollment attestation output (public, 0644).
433    #[arg(long, default_value = "service-key-enrollment.json")]
434    pub attestation: PathBuf,
435
436    /// Replace existing output files.
437    #[arg(long)]
438    pub force: bool,
439}
440
441#[derive(Debug, Args)]
442pub struct RotateAuthorityArgs {
443    /// Raw 1984-byte original public root (does not change during log rotation).
444    #[arg(long, default_value = "deployment-ca.hybrid")]
445    pub public_ca: PathBuf,
446
447    /// Current signed authority rotation log.
448    #[arg(long, default_value = "deployment-authority.log.json")]
449    pub authority_log: PathBuf,
450
451    /// Current independently trusted expected authority-log head.
452    #[arg(long, default_value = "deployment-authority.head.json")]
453    pub authority_checkpoint: PathBuf,
454
455    /// Age-encrypted currently active authority used to sign the rotation.
456    #[arg(long, default_value = "deployment-ca.age")]
457    pub authority_key: PathBuf,
458
459    /// Identity used to unlock the current authority. Repeatable.
460    #[arg(long = "identity", value_name = "AGE_IDENTITY_FILE")]
461    pub identities: Vec<PathBuf>,
462
463    /// YubiKey identity used to unlock the current authority. Repeatable.
464    #[arg(long = "yubikey-identity", value_name = "AGE_YUBIKEY_IDENTITY_FILE")]
465    pub yubikey_identities: Vec<PathBuf>,
466
467    /// Break-glass: use the age-wrapped recovery copy of a PIV Ed25519 key.
468    #[arg(long)]
469    pub software_recovery: bool,
470
471    /// Recipient ring for the new authority. At least two distinct values.
472    #[arg(long = "recipient", value_name = "AGE_RECIPIENT")]
473    pub recipients: Vec<String>,
474
475    /// Keep existing active authority keys and add the new key.
476    #[arg(long, conflicts_with = "replace")]
477    pub add: bool,
478
479    /// Retire existing active authority keys after authorizing the new key.
480    #[arg(long, conflicts_with = "add")]
481    pub replace: bool,
482
483    /// Encrypted new authority key output.
484    #[arg(long, default_value = "deployment-authority-next.age")]
485    pub new_authority_key: PathBuf,
486
487    /// Raw 1984-byte new authority public pair (operator record, not the root pin).
488    #[arg(long, default_value = "deployment-authority-next.hybrid")]
489    pub new_public_key: PathBuf,
490
491    /// Updated signed rotation log output.
492    #[arg(long, default_value = "deployment-authority.log.next.json")]
493    pub authority_log_out: PathBuf,
494
495    /// Updated independently trusted authority-log head output.
496    #[arg(long, default_value = "deployment-authority.head.next.json")]
497    pub authority_checkpoint_out: PathBuf,
498
499    /// Replace existing output files.
500    #[arg(long)]
501    pub force: bool,
502}
503
504#[derive(Debug, Args)]
505pub struct InstallDeploymentTrustArgs {
506    /// Ceremony-produced public root to install (source; not the install path).
507    #[arg(long, default_value = "deployment-ca.hybrid")]
508    pub public_ca: PathBuf,
509
510    /// Ceremony-produced authority log to install (source).
511    #[arg(long, default_value = "deployment-authority.log.json")]
512    pub authority_log: PathBuf,
513
514    /// Ceremony-produced authority checkpoint to install (source).
515    #[arg(long, default_value = "deployment-authority.head.json")]
516    pub authority_checkpoint: PathBuf,
517
518    /// Also install the delegated online signer and enable the unattended
519    /// registry-credential refresher (systemd timer). Omit to install only
520    /// the three OS-owned public artifacts.
521    #[arg(long, requires = "delegation")]
522    pub delegated_key: Option<PathBuf>,
523
524    /// Delegation authorizing --delegated-key. Required with --delegated-key.
525    #[arg(long, requires = "delegated_key")]
526    pub delegation: Option<PathBuf>,
527
528    /// Raw 32-byte Ed25519 registry-service public key for the refresher's
529    /// `mint-registry-jwt --registry-public-key`. Required with --delegated-key.
530    #[arg(long, requires = "delegated_key")]
531    pub registry_public_key: Option<PathBuf>,
532
533    /// Plaintext age X25519 identity file (AGE-SECRET-KEY-1...) the unattended
534    /// refresher uses to decrypt the delegated signer. Required with
535    /// --delegated-key. Installed root-only; this identity can open only the
536    /// separately encrypted delegated signer, never the root authority bundle.
537    #[arg(long, requires = "delegated_key", value_name = "AGE_IDENTITY_FILE")]
538    pub refresh_identity: Option<PathBuf>,
539
540    /// Refresh interval for the registry credential's 1-hour TTL. Must leave
541    /// headroom for the profile's 60-second clock-skew allowance.
542    #[arg(
543        long,
544        default_value = "30min",
545        requires = "delegated_key",
546        value_name = "SYSTEMD_TIME_SPAN"
547    )]
548    pub refresh_interval: String,
549
550    /// Replace existing installed trust artifacts. The two systemd unit files
551    /// are always overwritten regardless of this flag.
552    #[arg(long)]
553    pub force: bool,
554
555    /// Skip `systemctl enable --now` (write/print units only; for offline
556    /// testing or non-systemd environments).
557    #[arg(long)]
558    pub no_enable: bool,
559}
560
561#[derive(Debug, Args)]
562pub struct VerifyDeploymentArgs {
563    /// Raw 1984-byte public deployment root.
564    #[arg(long, default_value = "deployment-ca.hybrid")]
565    pub public_ca: PathBuf,
566
567    /// Registry deployment credential.
568    #[arg(long, default_value = "registry-service.jwt")]
569    pub jwt: PathBuf,
570
571    /// Installed/current authority log (required for every credential).
572    #[arg(long, default_value = "deployment-authority.log.json")]
573    pub authority_log: PathBuf,
574
575    /// Independently trusted expected authority-log head.
576    #[arg(long, default_value = "deployment-authority.head.json")]
577    pub authority_checkpoint: PathBuf,
578
579    /// Optional contract whose public artifacts must match the files.
580    #[arg(long)]
581    pub contract: Option<PathBuf>,
582
583    /// Service-key enrollment attestation to verify against the deployment
584    /// trust chain (hyprstream#1562). Repeatable; every attestation must
585    /// verify against the same root, authority log, and checkpoint — any
586    /// missing, malformed, expired, or out-of-scope attestation fails the
587    /// command.
588    #[arg(long = "service-key-attestation", value_name = "ATTESTATION_FILE")]
589    pub service_key_attestations: Vec<PathBuf>,
590}