2 Commits

Author SHA256 Message Date
Alphaeus Mote bb707b9b33 test: hold on the CI runner (SYSTEM account, path case, presign second)
CI / build-test (push) Failing after 9m36s
CI / images (push) Has been skipped
Release / release (push) Failing after 1m25s
Release / images (push) Has been skipped
The runner runs the suite as SYSTEM: a pipe it owns is trusted by design,
and its temp path's case varies. A presigned link signed a moment after its
expiry was set reads one second shorter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 22:26:39 -05:00
Alphaeus Mote b5068d962f feat(scripts): per-job folders, Run From File and a configurable job root on the agent
Every script job now runs in <JobRoot>\<JobId>\, locked to SYSTEM and
Administrators (inheritance off; 0700 and root-owned on linux/macOS). The
script is staged under its own name (Install-Baseline.ps1), the 5.1
wrapper and preludes sit beside it as .executer-* helper files that are
always deleted, and the folder goes too with Clean Up After Run (default
on). Folders older than 7 days are swept at agent start.

- PowerShell 7 Run From File: the script is written to the job folder and
  invoked by path (AddCommand), so $PSScriptRoot, $PSCommandPath and
  $MyInvocation.MyCommand.Definition are the file's. The prelude runs first
  on its own; `exit N` reaches the host as with pwsh -File via the engine's
  rethrow-exit flag (with a $LASTEXITCODE fallback).
- Set Working Directory to Script Folder (staged runs only): process
  directory for 5.1/Bash, runspace location for PowerShell 7 (the shared
  process directory is never touched). Off keeps today's directory.
- $ExecuteRJobDir in both PowerShell engines (every mode) and
  EXECUTER_JOB_DIR for 5.1 and Bash.
- Bash sources the prelude through BASH_ENV, so the script file is the script.
- JobRoot policy (GPO > registry > default; ADMX/ADML, MSI JOBROOT):
  %VAR% / $VAR expansion as the agent, validation (absolute, local, not
  under user profiles, no parent others can rename), warning + default on
  a bad value, reported in the inventory.
- The script command carries RunFromFile, CleanUpAfterRun and
  SetWorkingDirectory (older backends: the defaults).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 14:41:23 -05:00