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
#![cfg_attr(coverage_nightly, coverage(off))]
// Roadmap and Agent commands - extracted for file health (CB-040)
use crate::cli::{OutputFormat, QualityGateOutputFormat};
use clap::Subcommand;
use std::path::PathBuf;
/// Roadmap management subcommands
#[derive(Subcommand)]
#[cfg_attr(test, derive(Debug))]
pub enum RoadmapCommands {
/// Initialize a new sprint in the roadmap
Init {
/// Sprint version (e.g., v2.6.0)
#[arg(long)]
version: String,
/// Sprint title
#[arg(long)]
title: String,
/// Sprint duration in days
#[arg(long, default_value = "14")]
duration_days: u32,
/// Sprint priority (P0, P1, P2)
#[arg(long, default_value = "P0")]
priority: String,
},
/// Generate PDMT todos from roadmap tasks
Todos {
/// Sprint ID to generate todos for (uses current if not specified)
#[arg(long)]
sprint: Option<String>,
/// Output file path for todos
#[arg(long, default_value = "todos.md")]
output: PathBuf,
/// Include quality gate requirements in todos
#[arg(long)]
include_quality_gates: bool,
},
/// Start working on a task
Start {
/// Task ID (e.g., PMAT-3001)
task_id: String,
/// Create a git branch for the task
#[arg(long)]
create_branch: bool,
},
/// Complete a task (with quality validation)
Complete {
/// Task ID (e.g., PMAT-3001)
task_id: String,
/// Skip quality gate checks
#[arg(long)]
skip_quality_check: bool,
},
/// Check sprint or task status
Status {
/// Sprint ID to check
#[arg(long)]
sprint: Option<String>,
/// Task ID to check
#[arg(long)]
task: Option<String>,
/// Output format
#[arg(long, value_enum, default_value = "table")]
format: OutputFormat,
},
/// Validate sprint readiness for release
Validate {
/// Sprint ID to validate
#[arg(long)]
sprint: String,
/// Fail if validation fails (exit code 1)
#[arg(long)]
strict: bool,
},
/// Run quality checks for a task
QualityCheck {
/// Task ID to check
#[arg(long)]
task_id: String,
},
}
/// Test suite types for performance validation
#[derive(Clone, Debug, clap::ValueEnum, PartialEq)]
pub enum TestSuite {
/// Performance tests per SPECIFICATION.md Section 30
Performance,
/// Property-based testing expansion per SPECIFICATION.md Section 28
Property,
/// Integration test suite
Integration,
/// Regression detection tests
Regression,
/// Memory usage validation tests
Memory,
/// Throughput validation tests
Throughput,
/// All test suites
All,
}
/// Transport protocol options for serve command
#[derive(Clone, Debug, clap::ValueEnum)]
#[cfg_attr(test, derive(PartialEq))]
pub enum ServeTransport {
/// HTTP transport (REST API)
Http,
/// WebSocket transport (real-time bidirectional)
WebSocket,
/// HTTP Server-Sent Events transport (streaming)
HttpSse,
/// Both HTTP and WebSocket (hybrid mode)
Both,
/// All transports (HTTP, WebSocket, SSE)
All,
}
/// Agent mode subcommands for Claude Code integration
#[derive(Subcommand)]
#[cfg_attr(test, derive(Debug))]
pub enum AgentCommands {
/// Start the background agent daemon
Start {
/// Project path to monitor (defaults to current directory)
#[arg(short = 'p', long, default_value = ".")]
project_path: PathBuf,
/// Configuration file path
#[arg(short = 'c', long)]
config: Option<PathBuf>,
/// Working directory for the daemon
#[arg(long)]
working_dir: Option<PathBuf>,
/// PID file location
#[arg(long)]
pid_file: Option<PathBuf>,
/// Log file location
#[arg(long)]
log_file: Option<PathBuf>,
/// Run in foreground (don't daemonize)
#[arg(long)]
foreground: bool,
/// Health check interval in seconds
#[arg(long, default_value = "30")]
health_interval: u64,
/// Maximum memory usage in MB before restart
#[arg(long, default_value = "500")]
max_memory_mb: u64,
/// Disable auto-restart on failure
#[arg(long)]
no_auto_restart: bool,
},
/// Stop the background agent daemon
Stop {
/// PID file location
#[arg(long)]
pid_file: Option<PathBuf>,
/// Force stop (SIGKILL) if graceful stop fails
#[arg(long)]
force: bool,
/// Timeout for graceful shutdown in seconds
#[arg(long, default_value = "10")]
timeout: u64,
},
/// Show daemon status
Status {
/// PID file location
#[arg(long)]
pid_file: Option<PathBuf>,
/// Output format
#[arg(long, value_enum, default_value = "json")]
format: OutputFormat,
},
/// Start monitoring a new project
Monitor {
/// Project path to start monitoring
#[arg(short = 'p', long)]
project_path: PathBuf,
/// Project identifier (defaults to path basename)
#[arg(long)]
project_id: Option<String>,
/// Quality thresholds configuration file
#[arg(long)]
thresholds: Option<PathBuf>,
},
/// Stop monitoring a project
Unmonitor {
/// Project ID to stop monitoring
#[arg(short = 'i', long)]
project_id: String,
},
/// Run health check
Health {
/// PID file location
#[arg(long)]
pid_file: Option<PathBuf>,
/// Detailed health information
#[arg(long)]
detailed: bool,
},
/// Reload daemon configuration
Reload {
/// PID file location
#[arg(long)]
pid_file: Option<PathBuf>,
/// Configuration file path
#[arg(short = 'c', long)]
config: Option<PathBuf>,
},
/// Run quality gate through agent
QualityGate {
/// Project ID or path
#[arg(short = 'p', long)]
project: String,
/// Specific file to check
#[arg(long)]
file: Option<PathBuf>,
/// Output format
#[arg(long, value_enum, default_value = "summary")]
format: QualityGateOutputFormat,
},
/// Start MCP server for testing
McpServer {
/// Configuration file path
#[arg(short = 'c', long)]
config: Option<PathBuf>,
/// Debug mode (verbose logging)
#[arg(long)]
debug: bool,
},
}