From 8d09309d49fea2b1fb8f88ac7e9a6bf30f60754a Mon Sep 17 00:00:00 2001 From: "r4yharris-agent-coder[bot]" <334673250+r4yharris-agent-coder[bot]@users.noreply.github.com> Date: Fri, 6 Nov 2026 19:33:50 -0500 Subject: [PATCH] feat(execution): prepend src/ to PYTHONPATH and strip leading underscores in Python test discovery (FEATURE_SPEC 5.2, 5.4) AI-Agent: r4yharris-agent-coder AI-Model: GPT-6.1-Sol AI-Run: 1|github-copilot|GPT-6.1-Sol@-|x|-/1000000|-|-|- --- rust/execution/tools.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/rust/execution/tools.rs b/rust/execution/tools.rs index c3df952..df6cba2 100644 --- a/rust/execution/tools.rs +++ b/rust/execution/tools.rs @@ -3085,11 +3085,20 @@ impl Boundary { .join("roster-pycache") .display() .to_string(); + let py_path = if self.root.join("src").is_dir() { + if cfg!(windows) { + "src;.".to_owned() + } else { + "src:.".to_owned() + } + } else { + ".".to_owned() + }; let mut environment = BTreeMap::from([ ("ROSTER_SEAT".to_owned(), "coder".to_owned()), ("PYTHONDONTWRITEBYTECODE".to_owned(), "1".to_owned()), ("PYTHONPYCACHEPREFIX".to_owned(), pycache_prefix), - ("PYTHONPATH".to_owned(), ".".to_owned()), + ("PYTHONPATH".to_owned(), py_path), ]); for var in ["HOME", "USERPROFILE", "APPDATA", "LOCALAPPDATA"] { if let Ok(val) = std::env::var(var) { @@ -3172,8 +3181,10 @@ impl Boundary { if stem.is_empty() { continue; } + let clean_stem = stem.trim_start_matches('_'); let mut candidate_paths = vec![ format!("tests/test_{stem}.py"), + format!("tests/test_{clean_stem}.py"), format!("tests/preparation/test_{stem}.py"), format!("tests/cli/test_{stem}.py"), ];