Skip to content
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
f89496b
Implement environment variable expansion for configuration files and …
EffortlessSteven Feb 5, 2026
c9a8a2a
Add conformance tests and schema validation for sensor report
EffortlessSteven Feb 5, 2026
c188b79
feat: Add timing metrics to CheckReceipt and update related tests
EffortlessSteven Feb 5, 2026
c41517f
feat: Enhance configuration management and validation
EffortlessSteven Feb 5, 2026
8c936db
feat: Update fingerprint computation to use full SHA-256 hash and enh…
EffortlessSteven Feb 6, 2026
5c219f0
Add snapshot tests for JSON receipt and GitHub annotation formats
EffortlessSteven Feb 6, 2026
0c9d09f
Refactor verdict reasons handling in markdown rendering
EffortlessSteven Feb 7, 2026
d3e4d3a
feat: Refactor error handling and improve JSON schema drift diagnostics
EffortlessSteven Feb 7, 2026
8aaa6f0
Refactor code structure for improved readability and maintainability
EffortlessSteven Feb 9, 2026
bdac0d3
Refactor code structure for improved readability and maintainability
EffortlessSteven Feb 10, 2026
583d4ec
chore: remove accidental build artifacts and binaries
EffortlessSteven Feb 10, 2026
ccf0f41
chore: reorder imports for consistency and readability across multipl…
EffortlessSteven Feb 10, 2026
8325454
chore: fmt, clippy fixes and unsafe blocks
EffortlessSteven Feb 10, 2026
fdd81d1
chore: update authors and repository URLs in Cargo.toml
EffortlessSteven Feb 12, 2026
a53d5fa
feat: add directory rule overrides and related tests
EffortlessSteven Feb 17, 2026
31170b8
feat: Enhance rule configuration and CLI options for multi-base diff …
EffortlessSteven Feb 17, 2026
804b4ce
Implement LSP server for diffguard with document state management and…
EffortlessSteven Feb 17, 2026
4b39685
refactor(lsp): split into lib+bin targets, fix initialize handshake
EffortlessSteven Apr 5, 2026
d8a69f3
fix(xtask): cargo_bin_path fallback to target/debug when CARGO_BIN_EX…
EffortlessSteven Apr 5, 2026
b8e2532
fix: remove duplicate init_logging call (#10)
EffortlessSteven Apr 5, 2026
7ebce05
chore: add conveyor governance templates and CI gates
EffortlessSteven Apr 5, 2026
4cb1876
docs: add DESIGN.md — governance primitive layer positioning
EffortlessSteven Apr 5, 2026
fb13941
fix: LSP git diff timeout and cmd_validate ENV_LOCK race (#16)
EffortlessSteven Apr 5, 2026
3dd5155
Merge main into feat/v0.2-enhancements-v2
EffortlessSteven Apr 5, 2026
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
26 changes: 25 additions & 1 deletion crates/diffguard-lsp/src/server.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use std::collections::{BTreeSet, HashMap};
use std::path::{Path, PathBuf};
use std::process::Command;
use std::thread;
use std::time::{Duration, Instant};

use anyhow::{Context, Result, bail};
use diffguard_core::{CheckPlan, run_check};
Expand Down Expand Up @@ -915,7 +917,29 @@ fn run_git_diff(workspace_root: &Path, relative_path: &str, staged: bool) -> Res
}
command.arg("--unified=0").arg("--").arg(relative_path);

let output = command.output().context("run git diff")?;
// Spawn with a 10-second timeout to avoid blocking the LSP indefinitely
const GIT_DIFF_TIMEOUT: Duration = Duration::from_secs(10);
let mut child = command.spawn().context("spawn git diff")?;
let deadline = Instant::now() + GIT_DIFF_TIMEOUT;

let output = loop {
match child.try_wait() {
Ok(Some(_)) => {
// Process has exited; wait_with_output() returns immediately
break child.wait_with_output().context("wait for git diff")?;
}
Ok(None) => {
// Still running
if Instant::now() >= deadline {
let _ = child.kill();
bail!("git diff timed out after {}s", GIT_DIFF_TIMEOUT.as_secs());
}
thread::sleep(Duration::from_millis(100));
}
Err(e) => bail!("checking git diff status: {e}"),
}
};

if !output.status.success() {
bail!(
"git diff failed (exit={}): {}",
Expand Down
Loading