1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Shared integration-test command helpers for invoking the `aid` binary.
// Exports helpers that isolate subprocess state with a temp AID_HOME.
// Deps: std::process::Command and temp directories supplied by callers.
use Path;
use Command;
/// Build an `aid` subprocess with a temp `AID_HOME` and **isolated cwd**.
///
/// Project config is discovered by walking from the process working directory
/// for a git root with `.aid/project.toml`. Leaving cwd at the developer repo
/// root makes e2e tasks inherit that repo's verify/team/skills defaults. The
/// temp `AID_HOME` is not a git repo, so discovery finds nothing unless a test
/// opts into a project via [`aid_cmd_with_cwd`].
///
/// We deliberately do **not** add a product-level env opt-out for discovery
/// (`AID_NO_PROJECT` or similar): discovery-from-cwd is correct operator
/// behaviour, and an escape hatch would hide bugs that should call
/// `detect_project_in(explicit_path)` instead. Tests that need a project write
/// one under a temp git root and point cwd there; tests that need git without
/// project config use a temp git root with no `.aid/project.toml`.
pub
/// Like [`aid_cmd_in`], but runs with an explicit working directory.
///
/// Use this when a test intentionally wants project discovery (pass a temp
/// git root that contains `.aid/project.toml`) or needs relative path resolution
/// against a specific tree. Do not pass the developer repo root unless the test
/// is explicitly probing inheritance.
pub