From 28e764607a9799351d55502534faec456c0f827a Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 2 Jun 2026 04:57:47 +0200 Subject: [PATCH 1/3] fix: cargo fmt failure in terraphim_orchestrator (src/lib.rs) Reformat active_compound_review field type and two reconcile_tick tracing macros to satisfy cargo fmt --check. The fmt gate was RED on main, blocking the merge pipeline (WIG-4). Refs #1978 --- crates/terraphim_orchestrator/src/lib.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/crates/terraphim_orchestrator/src/lib.rs b/crates/terraphim_orchestrator/src/lib.rs index 95302471d..4b7adeab6 100644 --- a/crates/terraphim_orchestrator/src/lib.rs +++ b/crates/terraphim_orchestrator/src/lib.rs @@ -274,7 +274,8 @@ pub struct AgentOrchestrator { active_flows: HashMap>, /// Active compound review execution (spawned in background to avoid /// blocking reconcile_tick). None when no compound review is running. - active_compound_review: Option>>, + active_compound_review: + Option>>, /// Per-project mention cursors, keyed by project id. /// /// Each project gets its own cursor so repo-wide polls can advance @@ -6208,14 +6209,12 @@ impl AgentOrchestrator { if elapsed > std::time::Duration::from_secs(5) { warn!( tick = self.tick_count, - elapsed_ms, - "reconcile_tick SLOW: took > 5s, likely blocking agent polling" + elapsed_ms, "reconcile_tick SLOW: took > 5s, likely blocking agent polling" ); } else { info!( tick = self.tick_count, - elapsed_ms, - "reconcile_tick complete" + elapsed_ms, "reconcile_tick complete" ); } } @@ -8036,9 +8035,7 @@ Remove the pause flag once the underlying failure is resolved:\n\n\ let git_ref = "HEAD".to_string(); let base_ref = self.config.compound_review.base_branch.clone(); let workflow = self.compound_workflow.clone(); - let handle = tokio::spawn(async move { - workflow.run(&git_ref, &base_ref).await - }); + let handle = tokio::spawn(async move { workflow.run(&git_ref, &base_ref).await }); self.active_compound_review = Some(handle); } ScheduleEvent::Flow(flow_def) => { From 482af21e0784b62f03c0e09266b758bd9872d9bc Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 2 Jun 2026 05:00:55 +0200 Subject: [PATCH 2/3] feat(pr-reviewer): agent work [auto-commit] --- BUILD.md | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/BUILD.md b/BUILD.md index 05227e9d9..c0a91d1ea 100644 --- a/BUILD.md +++ b/BUILD.md @@ -52,8 +52,8 @@ When `Cargo.toml` is detected: ```bash cargo fmt --all -- --check cargo clippy --workspace --all-targets -- -D warnings -cargo build --workspace --profile ci -cargo test --workspace --no-fail-fast --profile ci +cargo build --workspace --profile ci --profile ci +cargo test --workspace --no-fail-fast --profile ci --profile ci ``` ## Command Transformation @@ -191,7 +191,7 @@ cost:: low|medium|high ## Auto-corrected (2026-05-29T22:58:17Z) Failed: `cargo clippy --workspace --all-targets -- -D warnings` -CORRECTION: `cargo build --workspace --tests` +CORRECTION: `cargo build --workspace --profile ci --tests` REASON: The `terraphim_orchestrator` crate has compilation errors (not clippy warnings) that prevent the build from completing. Clippy cannot run on code that won't compile. Run a plain build to reveal the actual errors before attempting linting. @@ -208,7 +208,7 @@ REASON: View the full clippy warning/error message instead of the truncated outp After you see the full error, you'll likely need to either: - Fix the clippy warning in the code, then re-run with `-D warnings` -- Or run `cargo build --workspace --profile ci && cargo test --workspace --no-fail-fast --profile ci` first to verify compilation and tests work, then address the specific clippy warning +- Or run `cargo build --workspace --profile ci --profile ci && cargo test --workspace --no-fail-fast --profile ci --profile ci` first to verify compilation and tests work, then address the specific clippy warning ## Auto-corrected (2026-05-29T23:02:05Z) @@ -235,8 +235,8 @@ Alternatively, if you intended this as a conditional check that should fail unde ## Auto-corrected (2026-06-01T05:22:46Z) -Failed: `cargo build --workspace --profile ci --profile ci --profile ci --profile ci` -CORRECTION: `cargo build --workspace --profile ci` +Failed: `cargo build --workspace --profile ci --profile ci --profile ci --profile ci --profile ci` +CORRECTION: `cargo build --workspace --profile ci --profile ci` REASON: The `--profile` flag was specified 4 times; Cargo only accepts it once. Remove the duplicate flags, keeping a single `--profile ci`. @@ -244,3 +244,17 @@ REASON: The `--profile` flag was specified 4 times; Cargo only accepts it once. Failed: `git definitely-not-a-real-subcommand` Not logged in ยท Please run /login + +## Auto-corrected (2026-06-02T02:59:11Z) + +Failed: `cargo build --workspace --profile ci --profile ci` +CORRECTION: `cargo build --workspace --profile ci` + +REASON: The `--profile` argument was specified twice with the same value (`ci`); cargo does not allow duplicate profile specifications. + +## Auto-corrected (2026-06-02T02:59:19Z) + +Failed: `cargo test --workspace --no-fail-fast --profile ci --profile ci` +CORRECTION: `cargo test --workspace --no-fail-fast --profile ci` + +REASON: The `--profile` argument cannot be used multiple times; it was specified twice (`--profile ci --profile ci`), causing the error. Remove the duplicate. From 69a8e76d99e648dcebdbbfbe7da4dcff42234676 Mon Sep 17 00:00:00 2001 From: Test User Date: Tue, 2 Jun 2026 08:26:43 +0200 Subject: [PATCH 3/3] fix(tests): embed no_kg_config fixture via include_str! to survive worktree deletion The validate_with_no_kg_exits_3 test used concat!(env!("CARGO_MANIFEST_DIR"), ...) to construct a compile-time path to the fixture file. When the target directory is shared across worktrees, a binary compiled from a deleted worktree retains the old path, causing the test to fail with exit code 1 (file not found) instead of 3 (KG not configured). Fix: use include_str!() to embed the fixture content at compile time, then write it to a tempfile at runtime. This is resilient to worktree cleanup because the fixture bytes are embedded in the test binary itself. Refs #1985 --- crates/terraphim_agent/tests/exit_codes.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/terraphim_agent/tests/exit_codes.rs b/crates/terraphim_agent/tests/exit_codes.rs index 15b1cf5ea..a5478b935 100644 --- a/crates/terraphim_agent/tests/exit_codes.rs +++ b/crates/terraphim_agent/tests/exit_codes.rs @@ -71,14 +71,17 @@ fn search_succeeds_exits_0() { #[test] fn validate_with_no_kg_exits_3() { - // Load a fixture config where the role has kg: null so the service layer - // returns "Knowledge graph not configured", which classify_error maps to - // ErrorIndexMissing (3). This avoids relying on the developer's local KG. - let fixture = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/no_kg_config.json"); + // Embed the fixture content at compile time so this test works even when + // compiled from a git worktree that is later deleted (shared target dir). + // Writing to a temp file avoids a runtime path dependency on CARGO_MANIFEST_DIR. + let fixture_content = include_str!("no_kg_config.json"); + let dir = tempfile::tempdir().expect("temp dir"); + let fixture_path = dir.path().join("no_kg_config.json"); + std::fs::write(&fixture_path, fixture_content).expect("write fixture"); cmd() .args([ "--config", - fixture, + fixture_path.to_str().expect("valid path"), "validate", "xyzzy_f1_2_exit_code_test_sentinel", ])