Skip to main content

aprender_contracts_cli/
query_args.rs

1use clap::Args;
2use std::path::PathBuf;
3
4/// Arguments for the `pv query` command — extracted for file health compliance.
5#[derive(Args, Clone, Debug)]
6pub struct QueryArgs {
7    /// Search query string
8    pub query: String,
9    /// Directory containing contract YAML files
10    #[arg(long, default_value = "contracts")]
11    pub contract_dir: PathBuf,
12    /// Use regex matching instead of semantic search
13    #[arg(long)]
14    pub regex: bool,
15    /// Use literal substring matching
16    #[arg(long)]
17    pub literal: bool,
18    /// Force case-sensitive matching
19    #[arg(long)]
20    pub case_sensitive: bool,
21    /// Maximum number of results
22    #[arg(short, long, default_value = "10")]
23    pub limit: usize,
24    /// Filter by obligation type
25    #[arg(long)]
26    pub obligation: Option<String>,
27    /// Filter to contracts depending on this stem
28    #[arg(long)]
29    pub depends_on: Option<String>,
30    /// Filter to contracts depended on by this stem
31    #[arg(long)]
32    pub depended_by: Option<String>,
33    /// Show only contracts with unproven obligations
34    #[arg(long)]
35    pub unproven: bool,
36    /// Minimum score threshold
37    #[arg(long)]
38    pub min_score: Option<f64>,
39    /// Minimum proof level (L1-L5)
40    #[arg(long)]
41    pub min_level: Option<String>,
42    /// Include contract scores in output
43    #[arg(long)]
44    pub score: bool,
45    /// Include dependency graph info
46    #[arg(long)]
47    pub graph: bool,
48    /// Include paper references
49    #[arg(long)]
50    pub paper: bool,
51    /// Include proof level (L1-L5)
52    #[arg(long)]
53    pub proof_status: bool,
54    /// Include binding status per equation
55    #[arg(long)]
56    pub binding_info: bool,
57    /// Show only contracts with unimplemented bindings
58    #[arg(long)]
59    pub binding_gaps: bool,
60    /// Show last git modification date
61    #[arg(long)]
62    pub diff: bool,
63    /// Show dependency pagerank score
64    #[arg(long)]
65    pub pagerank: bool,
66    /// Show cross-project call sites
67    #[arg(long)]
68    pub call_sites: bool,
69    /// Show contract violations in consumer projects
70    #[arg(long)]
71    pub violations: bool,
72    /// Show cross-project coverage matrix
73    #[arg(long)]
74    pub coverage_map: bool,
75    /// Filter cross-project results to a named project
76    #[arg(long)]
77    pub project: Option<String>,
78    /// Add an explicit project path to the cross-project scan
79    #[arg(long)]
80    pub include_project: Option<PathBuf>,
81    /// Force full cross-project scan
82    #[arg(long)]
83    pub all_projects: bool,
84    /// Filter by contract tier (1-7)
85    #[arg(long)]
86    pub tier: Option<u8>,
87    /// Filter by kernel equivalence class (A-E)
88    #[arg(long, value_name = "CLASS")]
89    pub class: Option<char>,
90    /// Filter: kernel|registry|model-family|pattern|schema
91    #[arg(long)]
92    pub kind: Option<String>,
93    /// Force rebuild of the contract index
94    #[arg(long)]
95    pub rebuild_index: bool,
96    /// Path to binding registry YAML
97    #[arg(long)]
98    pub binding: Option<PathBuf>,
99    /// Output format: text, json, or markdown
100    #[arg(short, long, default_value = "text")]
101    pub format: String,
102    /// Exit with status 1 if no results match
103    #[arg(long)]
104    pub exit_code: bool,
105}