feat(agent): add comprehensive prompt audit system
This commit is contained in:
@@ -7,6 +7,7 @@ edition = "2024"
|
||||
clap.workspace = true
|
||||
codetaker-agent = { path = "../codetaker-agent" }
|
||||
codetaker-db.workspace = true
|
||||
dialoguer.workspace = true
|
||||
git2.workspace = true
|
||||
rig-core.workspace = true
|
||||
serde_json.workspace = true
|
||||
|
||||
@@ -31,6 +31,9 @@ struct Cli {
|
||||
#[arg(long)]
|
||||
head_ref: String,
|
||||
|
||||
#[arg(long)]
|
||||
pull_request_id: i64,
|
||||
|
||||
#[arg(long, default_value = "local")]
|
||||
owner: String,
|
||||
|
||||
@@ -40,6 +43,7 @@ struct Cli {
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
tracing_subscriber::fmt::init();
|
||||
let cli = Cli::parse();
|
||||
|
||||
let repo_name = cli.repo.unwrap_or_else(|| {
|
||||
@@ -63,6 +67,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
owner: cli.owner,
|
||||
repo: repo_name,
|
||||
},
|
||||
pull_request_id: cli.pull_request_id,
|
||||
base_ref: cli.base_ref,
|
||||
head_ref: cli.head_ref,
|
||||
};
|
||||
@@ -72,3 +77,26 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::Cli;
|
||||
use clap::Parser;
|
||||
|
||||
#[test]
|
||||
fn requires_pull_request_id() {
|
||||
let parsed = Cli::try_parse_from([
|
||||
"codetaker-cli",
|
||||
"--anthropic-api-key",
|
||||
"key",
|
||||
"--repo-path",
|
||||
".",
|
||||
"--base-ref",
|
||||
"main",
|
||||
"--head-ref",
|
||||
"feature",
|
||||
]);
|
||||
|
||||
assert!(parsed.is_err());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user