From 48189243f747d5f73d5a38a565010e64e2db74e7 Mon Sep 17 00:00:00 2001 From: cflmy Date: Fri, 27 Nov 2026 00:26:57 +0800 Subject: [PATCH] fix(acceptance): pass the explicit negative-gate environment The fail-closed gates must run with MARQDO_STDLIB_DIR explicitly pointed at a missing or tampered Bundle; inheriting the caller environment let a CLI with an adjacent valid Bundle fall back and made the missing-bundle negative pass. Reproduced with an installed CLI that has stdlib/ next to the binary. Refs cflmy/marqdo#9 --- scripts/acceptance-stdlib.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/acceptance-stdlib.py b/scripts/acceptance-stdlib.py index 63edfab..979d162 100755 --- a/scripts/acceptance-stdlib.py +++ b/scripts/acceptance-stdlib.py @@ -240,8 +240,8 @@ def component_gates(cli: str, bundle: Path) -> list[dict]: def negative_gates(cli: str, bundle: Path, work: Path) -> list[dict]: results = [] - def expect_failure(name, command): - result = run(command) + def expect_failure(name, command, env_for_gate): + result = run(command, env=env_for_gate) if result.returncode == 0: raise AcceptanceError(f"negative gate {name} unexpectedly passed") results.append( @@ -259,6 +259,7 @@ def negative_gates(cli: str, bundle: Path, work: Path) -> list[dict]: expect_failure( "missing-explicit-bundle", [cli, "run", str(ROOT / "tests/integration/composition/default-bundle.mq.md")], + env, ) tampered = work / "tampered-bundle" @@ -271,6 +272,7 @@ def negative_gates(cli: str, bundle: Path, work: Path) -> list[dict]: expect_failure( "tampered-module-digest", [cli, "run", str(ROOT / "tests/integration/composition/default-bundle.mq.md")], + env, ) return results