Skip to content
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ tokio = { version = "1.40", features = ["full"] }
p256 = { version = "0.14.0", features = ["ecdsa"] }
aien-protocol-types = { path = "../aien-protocols/crates/aien-protocol-types" }
aien-evaluation-protocol = { path = "../aien-protocols/crates/aien-evaluation-protocol" }
aien-probe = { path = "../aien-protocols/crates/aien-probe" }

[profile.release]
opt-level = 3
Expand Down
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ author: "Drake Stapleton <drake.aien@proton.me> & AIEN <aien.atlas@proton.me>"

inputs:
command:
description: "Inquisitor command: review, triage-issue, interview, audit, evaluate, or doctor"
description: "Inquisitor command: review, triage-issue, interview, audit, evaluate, probe, or doctor"
required: true
default: "review"
diff:
Expand Down Expand Up @@ -42,6 +42,11 @@ runs:
doctor)
spark-inquisitor doctor
;;
probe)
spark-inquisitor probe \
--diff "${{ inputs.diff }}" \
--output "${{ inputs.output-comment }}"
;;
review)
spark-inquisitor review \
--diff "${{ inputs.diff }}" \
Expand Down
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ pub use triage::{triage_issue, IssueCategory, TriageResult};

pub mod protocol_evaluator;
pub use protocol_evaluator::{InquisitorConstitutionalEvaluator, InquisitorDiffEvaluator};

pub mod probe_audit;
pub use probe_audit::{run_probe_audit, InquisitorProbeEvaluator, ProbeAuditReport};
92 changes: 92 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,35 @@ enum Commands {
output_labels: Option<PathBuf>,
},

/// Audit a git diff with the sovereign native probe evaluation engine
Probe {
#[arg(long, help = "Path to diff file")]
diff: PathBuf,

#[arg(
long,
default_value = "reference",
help = "Probe backend: reference or http"
)]
backend: String,

#[arg(long, help = "Endpoint for the http backend")]
endpoint: Option<String>,

#[arg(
long,
default_value_t = 0.95,
help = "Minimum telemetry safety probability"
)]
min_telemetry: f64,

#[arg(long, default_value_t = 2.0, help = "Minimum quality score")]
min_quality: f64,

#[arg(long, help = "Path to write the probe report markdown")]
output: Option<PathBuf>,
},

/// Run internal self-diagnostics
Doctor,
}
Expand Down Expand Up @@ -375,6 +404,69 @@ fn main() {
std::process::exit(1);
}
}
Commands::Probe {
diff,
backend,
endpoint,
min_telemetry,
min_quality,
output,
} => {
let content = match fs::read_to_string(&diff) {
Ok(c) => c,
Err(e) => {
eprintln!(
"{} Failed to read diff file {}: {}",
"error:".red().bold(),
diff.display(),
e
);
std::process::exit(1);
}
};

let runtime = match tokio::runtime::Runtime::new() {
Ok(runtime) => runtime,
Err(e) => {
eprintln!(
"{} Failed to initialize async runtime: {}",
"error:".red().bold(),
e
);
std::process::exit(1);
}
};

match runtime.block_on(spark_inquisitor::run_probe_audit(
&content,
&backend,
endpoint,
min_telemetry,
min_quality,
)) {
Ok(report) => {
if let Some(path) = &output {
if let Err(e) = fs::write(path, &report.markdown) {
eprintln!(
"{} Failed to write probe report to {}: {}",
"error:".red().bold(),
path.display(),
e
);
std::process::exit(1);
}
}
println!("{}", report.markdown);
if !report.clean {
std::process::exit(1);
}
}
Err(e) => {
eprintln!("{} Probe audit failed: {}", "error:".red().bold(), e);
std::process::exit(2);
}
}
}
Commands::Doctor => {
println!("⚖️ Sovereign Inquisitor Diagnostics: OK");
println!(" - Invariant rules: Active");
Expand Down
Loading
Loading