Skip to content

The agent that grows with you

fix: round-1 CI backlog (Windows lane probe, obligation test, generated contract)

ethernetf78f2b14f9e1
diff --git a/apps/shared/src/gateway-contract.generated.ts b/apps/shared/src/gateway-contract.generated.ts
index d85544c1bcf..e8f793ee7cb 100644
--- a/apps/shared/src/gateway-contract.generated.ts
+++ b/apps/shared/src/gateway-contract.generated.ts
@@ -1,7 +1,7 @@
// GENERATED by scripts/gen_gateway_contracts.py from tui_gateway/contracts — DO NOT EDIT.
// Regenerate: .venv/bin/python scripts/gen_gateway_contracts.py
// tests/tui_gateway/contracts/test_generated.py fails when this file is stale.
-
+/* eslint-disable */
// ── Types ──
/** Any method the desktop may route to a named profile (``requestGatewayForProfile`` adds ``profile``). */
export interface ProfileParams {
diff --git a/tests/hermes_cli/test_update_fleet_completion.py b/tests/hermes_cli/test_update_fleet_completion.py
index 2d757fbe022..984bfb0b1ff 100644
--- a/tests/hermes_cli/test_update_fleet_completion.py
+++ b/tests/hermes_cli/test_update_fleet_completion.py
@@ -41,8 +41,7 @@ def test_fleet_completion_preserves_runtime_verdict_and_restart_obligation(
monkeypatch.setattr(update_cmd_fleet, "_collect_fleet_snapshot", collect)
update_cmd_fleet._write_fleet_restart_pending_marker()
- marker = update_cmd_fleet._fleet_restart_pending_marker_path()
- assert marker.exists()
+ assert update_cmd_fleet._fleet_restart_obligation_armed()
healthy = update_complete and state == "current"
with update_receipt.update_receipt_scope():
update_receipt.begin_update_receipt()
@@ -58,6 +57,6 @@ def test_fleet_completion_preserves_runtime_verdict_and_restart_obligation(
assert receipt["outcome"] == ("success" if healthy else "partial")
assert receipt["fleet"] == snapshot
assert restart.incomplete is (state != "current")
- assert marker.exists() is (state != "current")
+ assert update_cmd_fleet._fleet_restart_obligation_armed() is (state != "current")
assert migrated == ([True] if healthy else [])
assert refreshed == [{"already_restarted_units": {"hermes-gateway"}}]
diff --git a/tests/scripts/test_source_build_env.py b/tests/scripts/test_source_build_env.py
index ff8bf284dff..89ba33d9162 100644
--- a/tests/scripts/test_source_build_env.py
+++ b/tests/scripts/test_source_build_env.py
@@ -64,6 +64,11 @@ stamp['write_stamp'](os.environ['PROBE_OUT'], update_mechanism='self')
Path(os.environ['PROBE_ENV']).write_text(json.dumps(dict(os.environ)), encoding='utf-8')
''', encoding="utf-8")
env["PROBE_SCRIPT"] = str(probe)
+ # A file, not `-c 'import json, ...'`: pwsh 7.6 on the Windows lane re-quotes native
+ # argv and the venv launcher receives a truncated -c body (`import` → SyntaxError).
+ dump = tmp_path / "dump_env.py"
+ dump.write_text("import json, os; print(json.dumps(dict(os.environ)))\n", encoding="utf-8")
+ env["PROBE_DUMP"] = str(dump)
if shell == "bash":
command = [shell, "-euc", '''
source "$ASSETS/source-build-env.sh"
@@ -91,28 +96,14 @@ console.log(JSON.stringify(process.env));
[Console]::Error.WriteLine("probe start: $($PSVersionTable.PSVersion) assets=$env:ASSETS python=$env:PROBE_PYTHON")
trap { [Console]::Error.WriteLine("probe trap: $_"); [Console]::Error.WriteLine($_.ScriptStackTrace); exit 97 }
. (Join-Path $env:ASSETS 'source-build-env.ps1')
-[Console]::Error.WriteLine("probe: asset sourced; python exists=$(Test-Path -LiteralPath $env:PROBE_PYTHON) script exists=$(Test-Path -LiteralPath $env:PROBE_SCRIPT)")
-& $env:PROBE_PYTHON -I -S -c 'import sys; sys.stderr.write("probe: bare child ran %s\n" % sys.version.split()[0])'
-[Console]::Error.WriteLine("probe: bare child dollar-question=$? exit=$LASTEXITCODE")
-$touch = Join-Path (Split-Path -Parent $env:PROBE_OUT) 'touched-by-child.txt'
-& $env:PROBE_PYTHON -c "open(r'$touch','w').write('yes')"
-[Console]::Error.WriteLine("probe: plain -c child touched=$(Test-Path -LiteralPath $touch) exit=$LASTEXITCODE")
-$proc = Start-Process -FilePath $env:PROBE_PYTHON -ArgumentList @('-I','-S','-c','import sys; sys.exit(42)') -NoNewWindow -Wait -PassThru
-[Console]::Error.WriteLine("probe: Start-Process exit=$($proc.ExitCode)")
-if ($IsWindows) {
- & cmd.exe /c "`"$env:PROBE_PYTHON`" -I -S -c `"import sys; sys.exit(43)`""
- [Console]::Error.WriteLine("probe: via cmd exit=$LASTEXITCODE")
-}
Invoke-SourceBuild {
& $env:PROBE_PYTHON -I -S $env:PROBE_SCRIPT
[Console]::Error.WriteLine("probe: child dollar-question=$? exit=$LASTEXITCODE out-exists=$(Test-Path -LiteralPath $env:PROBE_OUT)")
if ($LASTEXITCODE) { throw 'stamp failed' }
}
-[Console]::Error.WriteLine("probe: stamp step done")
try { Invoke-SourceBuild { throw 'child failure' }; throw 'lost exception' }
catch { if ($_.Exception.Message -ne 'child failure') { throw } }
-[Console]::Error.WriteLine("probe: failure step done")
-& $env:PROBE_PYTHON -I -S -c 'import json, os; print(json.dumps(dict(os.environ)))'
+& $env:PROBE_PYTHON -I -S $env:PROBE_DUMP
if ($LASTEXITCODE) { exit $LASTEXITCODE }
''', encoding="utf-8-sig")
command = [shell, "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", str(script)]
@@ -148,7 +139,10 @@ def test_posix_build_children_stamp_old_and_new_without_changing_parent(tmp_path
@pytest.mark.platforms("windows", "posix")
def test_powershell_build_children_stamp_old_and_new_without_changing_parent(tmp_path):
path = os.pathsep.join(p for p in os.get_exec_path() if ".hermes" not in Path(p).parts)
- shell = shutil.which("pwsh", path=path) or shutil.which("powershell", path=path)
+ # Windows PowerShell 5.1 is what install-e2e-windows-run.yml drives windows-e2e.ps1 (the
+ # asset's real consumer) with; pwsh is the only PowerShell a POSIX host offers.
+ order = ("powershell", "pwsh") if os.name == "nt" else ("pwsh", "powershell")
+ shell = next((found for name in order if (found := shutil.which(name, path=path))), None)
if not shell:
if os.name == "nt":
pytest.fail("native Windows acceptance requires PowerShell")