stemedb/applications/aphoria/src/cli/scope.rs
jordan 8af9b48ac7 feat: Complete Aphoria Phase 14 - Governance Workflows
Implement structured approval workflows for pattern promotion with full
audit trails for SOC 2 compliance.

Core Components:
- governance/types.rs: ApprovalRequest, ApprovalStatus, ApprovalDecision
- governance/workflow.rs: ApprovalWorkflow, ApprovalStage with escalation
- governance/store.rs: JSONL persistence for requests and decisions
- governance/state_machine.rs: Approval state transitions with auto-advance
- governance/audit.rs: AuditTrail with JSON/CSV/Markdown export

CLI Commands:
- aphoria governance pending/approve/reject/escalate/status/create
- aphoria audit trail/export/summary

Integration:
- Pipeline gate blocks promotion until governance approval
- Auto-creates approval requests when governance enabled
- Evidence-based auto-approval for high-confidence patterns

Also includes:
- Phase 11-13: Evidence, Lifecycle, Scope modules
- 62+ governance-specific tests (946 total passing)
- Clippy clean with -D warnings
- Refactored cli.rs into submodules (governance, lifecycle, scope, etc.)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-07 05:16:26 -07:00

63 lines
1.6 KiB
Rust

//! Scope CLI command definitions.
use clap::Subcommand;
#[derive(Subcommand)]
pub enum ScopeCommands {
/// Show current scope context
///
/// Displays the configured scope hierarchy and inheritance chain.
Status,
/// Override an inherited pattern
///
/// Creates an explicit override for a pattern inherited from a
/// broader scope (organization or team). Requires justification.
Override {
/// Concept path to override (e.g., "tls/min_version")
concept_path: String,
/// New value for the override
#[arg(short = 'V', long)]
value: String,
/// Reason for the override (required)
#[arg(short, long)]
reason: String,
/// Evidence reference (ADR, ticket, spec)
#[arg(short, long)]
evidence: Option<String>,
/// Expiration duration (e.g., "90d" for 90 days)
#[arg(long)]
expires: Option<String>,
},
/// List overrides at current scope
///
/// Shows all pattern overrides defined at the current scope level.
List {
/// Include inherited overrides from broader scopes
#[arg(long)]
include_inherited: bool,
/// Show expired overrides
#[arg(long)]
show_expired: bool,
},
/// Remove an override
///
/// Deletes a scope override, allowing the inherited pattern
/// to take effect again.
Remove {
/// Concept path of the override to remove
concept_path: String,
/// Force removal without confirmation
#[arg(short, long)]
force: bool,
},
}