Skip to content
Open
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
2 changes: 1 addition & 1 deletion docs/validate.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ login.
| `--repeat N` | Consensus runs for every agent check (overrides the graph). |
| `--json` | Stream newline-delimited JSON events to stdout. |
| `--junit PATH` | Also write JUnit XML. |
| `--out DIR` | Output directory (default `.copperpilot/validate/`). |
| `--out DIR` | Relative output paths start in the current working directory. The default is `.copperpilot/validate/` in the workspace. |
| `--emit-fix-prompt` | Also print a ready message for `copper-pilot -n --mode agent -y -m "..."`. |

## Exit codes
Expand Down
2 changes: 1 addition & 1 deletion src/copper_pilot_cli/validate/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def __init__(
self.snapshot_root = snapshot_root
self.profile_name, self.profile = config.profile(options.profile)
self.results: dict[str, CheckResult] = {}
self.out_dir = options.out_dir or workspace / ".copperpilot" / "validate"
self.out_dir = (options.out_dir or workspace / ".copperpilot" / "validate").resolve()
self.cache_dir = self.out_dir / "cache"
self.run_id = f"{datetime.now(UTC).strftime('%Y%m%dT%H%M%SZ')}-{uuid.uuid4().hex[:8]}"
self.run_dir = self.out_dir / "runs" / self.run_id
Expand Down
8 changes: 8 additions & 0 deletions tests/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,14 @@ def test_extract_last_json_block_and_parse() -> None:
assert findings[0].title == "C = 22 uF * 0.8" and findings[0].detail == "a_b"


def test_relative_report_directory_is_resolved_before_kicad_changes_cwd(tmp_path, monkeypatch):
monkeypatch.chdir(tmp_path)
workspace = tmp_path / "project"
workspace.mkdir()
runner = runner_for(workspace, options=RunOptions(out_dir=Path("reports")))
assert runner.run_dir.parent == tmp_path / "reports" / "runs"


def test_fan_out_collapses_identical_parts_and_skips_dnp() -> None:
index = build_index(NETLIST, json.dumps(PROJECT), PCB)
config = build_config(packaged_default_raw())
Expand Down