stemedb/applications/aphoria/src/handlers/mod.rs
jordan 157dbbb9eb feat: Complete Aphoria Phase 8-9 + UAT suite (90/90 tests passing)
## Phase 8: Enterprise Extractor Improvements 
- 14 security extractors (TLS, JWT, SQL injection, XSS, etc.)
- 10 framework-specific extractors (Spring, Django, Rails, etc.)
- Config file security detection (YAML, TOML)

## Phase 9: Autonomous Extractor Generation 
- Shadow mode executor with TP/FP tracking
- Graduation pipeline with confidence thresholds
- Auto-rollback on regression detection
- Cross-project pattern syncing

## UAT Suite Complete (14 scripts, 90 tests)
- test-core-detection.sh (6 tests)
- test-declarative-extractors.sh (5 tests)
- test-domain-frameworks.sh (5 tests)
- test-domain-unreal.sh (3 tests)
- test-llm-extraction.sh (6 tests)
- test-eval-harness.sh (5 tests)
- test-cross-language.sh (3 tests)
- test-precommit-performance.sh (4 tests)
- test-output-formats.sh (8 tests)
- test-drift-detection.sh (6 tests)
- test-exit-codes.sh (12 tests)
+ 3 more scripts

## Other Changes
- Updated roadmap to mark Phase 8-9 complete
- Added .gitignore entries for build artifacts
- Updated pre-commit: 800 line limit, exclude tests/data/cmd

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-06 22:50:55 -07:00

103 lines
2.9 KiB
Rust

//! Command handlers for Aphoria CLI
use std::process::ExitCode;
use aphoria::AphoriaConfig;
use crate::cli::Commands;
mod corpus;
mod eval;
mod extractors;
mod patterns;
mod policy;
mod policy_ops;
mod research;
mod scan;
mod shadow;
mod utils;
// Re-export for public API compatibility.
// These are used by the CLI binary but not within this module,
// so we allow unused imports for the re-export pattern.
#[allow(unused_imports)]
pub use corpus::*;
#[allow(unused_imports)]
pub use eval::*;
#[allow(unused_imports)]
pub use extractors::*;
#[allow(unused_imports)]
pub use patterns::*;
#[allow(unused_imports)]
pub use policy::*;
#[allow(unused_imports)]
pub use policy_ops::*;
#[allow(unused_imports)]
pub use research::*;
#[allow(unused_imports)]
pub use scan::*;
#[allow(unused_imports)]
pub use shadow::*;
#[allow(unused_imports)]
pub use utils::*;
/// Dispatch and execute CLI commands
pub async fn handle_command(command: Commands, config: &AphoriaConfig) -> ExitCode {
match command {
Commands::Scan {
path,
format,
exit_code,
strict,
persist,
debug,
sync,
staged,
community_preview,
} => {
if community_preview {
scan::handle_community_preview(path, config).await
} else {
scan::handle_scan(
path, format, exit_code, strict, persist, debug, sync, staged, config,
)
.await
}
}
Commands::Ack { concept_path, reason, expires } => {
policy_ops::handle_ack(concept_path, reason, expires, config).await
}
Commands::Bless { concept_path, predicate, value, reason } => {
policy_ops::handle_bless(concept_path, predicate, value, reason, config).await
}
Commands::Update { concept_path, value, reason } => {
policy_ops::handle_update(concept_path, value, reason, config).await
}
Commands::Baseline => policy_ops::handle_baseline(config).await,
Commands::Diff => policy_ops::handle_diff(config).await,
Commands::Status => policy_ops::handle_status(config).await,
Commands::Init => policy_ops::handle_init(config).await,
Commands::Corpus { command } => corpus::handle_corpus_command(command, config).await,
Commands::Research { command } => research::handle_research_command(command, config).await,
Commands::Policy { command } => policy::handle_policy_command(command, config).await,
Commands::Extractors { command } => {
extractors::handle_extractor_command(command, config).await
}
Commands::Eval { command } => eval::handle_eval_command(command, config).await,
Commands::Patterns { command } => patterns::handle_pattern_command(command, config).await,
}
}