Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
}
],
"expected_query_fallback_digests": {
"train": "sha256:3a9ac57b8868d65a89b0475be25d49e2b6fab779fe1c55af519889b2dc7064db",
"train": "sha256:b25e8f6c5fa1b1da422a35b1fb1510b430797dbce898277cbf7995796c437d22",
"validation": "sha256:49a204a7466f12859e5e1a4e5424ed5d2b9e3581855631256bfed6a08303e543"
},
"profile_matrix": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ use tracedecay_api::{
is_http_application_operation_exposed,
};
use tracedecay_contracts::catalog_composition::build_application_catalog_snapshot;
use tracedecay_runtime_core::ast_grep::AST_GREP_BIN_ENV;
use tracedecay_session_memory::event_lane::ActivityFamilyV1;
use tracedecay_tool_catalog::{
ApplicationSurfaceOperation, BindingSurface, CapabilityManifestV1, CatalogSnapshotV1,
Expand Down Expand Up @@ -204,7 +205,9 @@ impl MountFixture {
);
common::initialize_tracedecay_cli_project(&home, &project);

let daemon = common::spawn_tracedecay_daemon(&home);
let daemon = common::spawn_tracedecay_daemon_with(&home, |command| {
command.env(AST_GREP_BIN_ENV, ast_grep_executable());
});
let authority = wait_for_http_authority(&common::daemon_authority_path(&profile));

let context = run_ok(
Expand Down Expand Up @@ -254,8 +257,27 @@ impl MountFixture {

fn isolated_command(home: &Path) -> Command {
let mut command = common::tracedecay_command_with_home(home);
command.env("TRACEDECAY_TEST_ALLOW_INCOMPLETE_HOLDER_SCAN", "1");
command
.env("TRACEDECAY_TEST_ALLOW_INCOMPLETE_HOLDER_SCAN", "1")
.env(AST_GREP_BIN_ENV, ast_grep_executable());
command
}

/// The ast-grep executable the source-edit bindings are graded against.
///
/// A fixture child's PATH is the system directories only, and an npm-installed
/// ast-grep never lives there, so the child is handed the test process's own
/// executable through the product's explicit override instead.
fn ast_grep_executable() -> PathBuf {
let name = format!("ast-grep{}", std::env::consts::EXE_SUFFIX);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Resolve the Windows npm launcher before passing it to children

On the Windows root-transport partition, .github/actions/install-ast-grep/action.yml installs @ast-grep/cli globally, which exposes npm's ast-grep.cmd launcher; the production resolver explicitly handles this launcher in tracedecay-runtime-core/src/ast_grep.rs. This lookup instead probes only ast-grep.exe directly in each PATH directory, so the standard Windows CI installation is not found and the conformance test panics before starting. Use a PATHEXT-aware lookup and translate the npm launcher to its packaged native executable, as the product resolver does.

AGENTS.md reference: AGENTS.md:L209-L209

Useful? React with 👍 / 👎.

std::env::var_os(AST_GREP_BIN_ENV)
.map(PathBuf::from)
.or_else(|| {
std::env::split_paths(&std::env::var_os("PATH")?)
.map(|dir| dir.join(&name))
.find(|path| path.is_file())
})
.expect("ast-grep must be on the test PATH to grade the ast-grep bindings")
}

fn wait_for_http_authority(path: &Path) -> Value {
Expand Down
Loading