Commit Graph
100 Commits
Author SHA1 Message Date
Simone b31d6b61b8 docs(todo): track WinRM 4× concurrency instability + shim $IsWindows bug
§3.6: Windows-host WinRM loses jobs under sustained 4× concurrency (burn-in
§13 Win 36/40, rounds 6–8); mitigations noted (vCPU/parallelism, pypsrp
timeout+retry). §3.7: Invoke-CIJob.ps1:37 derefs $IsWindows, undefined on
Windows PowerShell 5.1 + StrictMode — throws unless CI_VENV_PYTHON is set.
2026-06-07 14:06:21 +02:00
Simone 34635a3996 docs(benchmark): record Windows-host §11–§14 + plan closeout
§11 Win-guest static (boot 29.75s, +24% vs Linux-host §8; static-IP floor
~22s confirmed host-independent), §12 Lin-guest DHCP (13.51s, +53%), §13
burn-in 4×10 (Win 36/40 — transient WinRM faults under 4× concurrency,
self-recovered; Lin 40/40). §14 adds the full host×guest×IP-mode matrix.
Plan checkboxes filled with results and the template-parity pre-req note.
2026-06-07 14:06:13 +02:00
Simone 85d1158ba4 docs(baseline): add raw benchmark output for Windows host baseline
Raw Measure-CIBenchmark.ps1 output captured 2026-05-18; supports
the B7 ±20% comparison criterion documented in RUNBOOK.md.
2026-06-07 11:30:20 +02:00
Simone 752600ef5a docs(bridge): Phase A→B bridge checklist completed
All sections done: SSH keys, BuildVMGuest password, Gitea PAT,
OpenSSH Server, template powered-off verification, CI backup.
Fixed errata: .vmsn always present (not error indicator), backup
switched from Git tar to 7z LZMA2, removed scheduled-task section
(no CI-* tasks exist on this host).
2026-06-07 11:30:20 +02:00
Simone f0361df0a5 docs(runbook): record Windows host pre-migration baseline
Phase A benchmark data (2026-05-17): VM lifecycle avg 60.6s boot,
smoke job avg 27s Win / 49s Linux, 100% success rate (12/12 burn-in).
B7 reference thresholds: Win ≤32s, Linux ≤59s.
2026-06-07 11:30:20 +02:00
Simone 94c0d021ce docs: Windows host compat is a categorical constraint (B8 cancelled)
User requirement (non-negotiable): the project must stay
first-class compatible with a Windows host permanently — Phase B
adds Linux *alongside* Windows, never replacing/degrading it.
- implementation-plan-A-B §2: categorical-constraint banner; B8
  decommissioning cancelled (kept only as historical record);
  master checklist B8 row updated.
- PhaseB-user-checklist: Passo 9 (B8) cancelled -> dual-host kept;
  Passo 8 no longer a decommission gate; tracking table + closing
  note updated.
2026-05-17 23:45:31 +02:00
Simone 6fe249f857 fix(ci): build-ns7zip workflow_dispatch only (decouple from CI-system tags)
Lint / python (push) Failing after 1s
Lint / pssa (push) Failing after 2s
build-ns7zip builds an EXTERNAL repo (nsis-plugin-ns7zip). The
`push: tags v*` trigger (inherited from when this workflow lived in
the plugin repo) made every CI-system tag — including the Phase A
marker v2.0.0-phaseA — auto-build and publish an ns7zip release on
the CI-system repo. Remove the tag trigger; manual dispatch only.
The release job's tag-gate `if` now never fires (skipped) — release
flow already validated with a throwaway tag.
2026-05-17 23:32:46 +02:00
Simone 9d123d765e docs: implementation-plan-A-B — Phase A closed, B kept as forward plan
Medium update: exec-summary status (A COMPLETATA, B ready), master
checklist A items [x], Phase A gating satisfied, §1 COMPLETATA banner
with real validation deviations (LocalSystem venv/keyring, github-free
artifacts, transport, shim common-params, deferred §8.1/§8.2), §7
A-side definition-of-done [x]. Fase B (§2/§3/§4) + risk matrix +
cronoprogramma left intact as the Phase B design reference alongside
PhaseB-user-checklist.md.
2026-05-17 23:29:19 +02:00
Simone dedeff70ac docs(phaseA): Phase A closed — Passo 9 done (merge + tag)
feature merged to main (753f47e), tag v2.0.0-phaseA pushed
(triggers build-ns7zip as final end-to-end validation of main).
All Passi 1-9 [x]. Residual non-blocking cleanup: delete the test
Gitea releases via UI (tags kept).
2026-05-17 23:23:12 +02:00
Simone 0ef8f86d83 docs(phaseA): Passo 9 merge done; global table 6-8 PASS
feature merged to main (753f47e, tree == feature). Passi 6/7/8 [x],
Passo 9 in progress (release tag pending).
2026-05-17 23:20:40 +02:00
Simone 753f47e3c1 Merge Fase A: Python rewrite + Linux migration into main
Phase A validated end-to-end (PhaseA-user-checklist Passi 1-8):
venv deploy, smoke wait-ready/job (Win+Linux), Gitea workflows
(lint, self-test both transports, build-ns7zip matrix + release),
burn-in 12/12, benchmark. ci_orchestrator Python pipeline + PS shims,
github-free artifacts, in-guest/host-clone transports, perf tuning.

Resolution: result tree == feature (authoritative). Removed 5 obsolete
files superseded by Phase A (old gitea/ action+lint paths now under
.gitea/, Pester tests for the replaced PS New/Remove-BuildVM/
Wait-VMReady scripts).
2026-05-17 23:19:27 +02:00
Simone 49960c6e1e docs(phaseA): mark baseline comparison skipped (decided)
No reliable pre-Python PS baseline; not blocking Phase A close.
2026-05-17 23:17:10 +02:00
Simone 5b46bba749 docs(phaseA): Passo 8 benchmark recorded (destroy fixed)
Measure-CIBenchmark.ps1 x4 clean: clone/start/WinRM negligible,
destroy ~4-6s (shim common-param fix), 0 orphans. IP-acquire phase
(20-85s) is the dominant variable cost (VMware Tools IP detect) —
known, non-blocking. No reliable pre-Python PS baseline; infra
metrics tracked in benchmark.jsonl.
2026-05-17 23:09:56 +02:00
Simone e23346cd55 fix(shims): skip PowerShell common params in CLI forwarders
The blind -X -> --x shims forwarded PowerShell common parameters
(-ErrorAction, -Verbose, ...) to the Python CLI, e.g.
Measure-CIBenchmark.ps1 -> Remove-BuildVM.ps1 -ErrorAction
SilentlyContinue produced `ci_orchestrator vm remove --error-action`
-> "No such option" -> destroy failed (orphan VM left). Skip
common switches and consume value-taking ones. Applied to all 7
blind-loop shims; param-style shims (New-BuildVM, Invoke-RemoteBuild,
Get-BuildArtifacts) are not affected. PSSA clean.
2026-05-17 23:03:24 +02:00
Simone 267a9d6c2a docs(phaseA): Passo 7 burn-in PASS (12/12, 0 orphans)
Start-BurnInTest.ps1 (lab wrapper: burnin-dummy + build.ps1) — 4
concurrent x 3 rounds all PASS, clean VM/lock teardown each round.
Note the gotcha: raw Test-CapacityBurnIn.ps1 without -BuildCommand
defaults to dotnet and fails on the non-.NET dummy repo.
2026-05-17 22:57:55 +02:00
Simone f0e500cb1d docs(phaseA): drop moot failure-contingency checkbox (Passo 6)
All workflows passed; the "if one fails" item never triggered. Replace
the dangling [ ] with a historical note so Passo 6 has no false-open
task.
2026-05-17 22:44:32 +02:00
Simone 393f15a449 docs(phaseA): Passo 6 complete — build-ns7zip matrix + release PASS
lint, self-test, build-ns7zip (Win+Linux) and the release job
(Gitea release + asset upload via REST API, auto token) all green.
Phase A Gitea end-to-end validated.
2026-05-17 22:41:41 +02:00
Simone 7eeef1c409 fix(ci): close release foreach loop (was truncated -> parse error)
build-nsInnoUnp.yml shipped without the closing brace of the
asset-upload foreach (and no EOF newline) since its origin; the
release job had never run (tag-only) so the PS parse error
"MissingEndCurlyBrace" was latent until the test tag triggered it.
Close the loop, add per-asset + final Write-Host. PS parse verified.
2026-05-17 22:35:08 +02:00
Simone 057bfcf63a fix(scripts): satisfy PSScriptAnalyzer (lint gate)
- Remove-Securely: suppress PSUseShouldProcessForStateChangingFunctions
  (internal best-effort shred; ShouldProcess prompts are undesirable)
  + add [CmdletBinding()].
- Replace the two empty catch blocks (Set-CIGuestCredential.ps1,
  Test-CIGuestWinRM.ps1) with Write-Verbose so PSAvoidUsingEmptyCatchBlock
  is satisfied while keeping best-effort behavior.
2026-05-17 22:31:34 +02:00
Simone b6d8a51101 perf(ci): 8 vCPU for ns7zip build VM (4 was starving parallel build)
WSL on the host builds the 3 configs in parallel in ~103s (= one
config) — the parallel design is correct. The 4-vCPU CI VM ran 3x
make -j on 4 cores -> oversubscription thrash -> ~3x slower. Not
structural / not RAM. Bump guest-cpu to 8 (job.py patches the clone
VMX numvcpus); host is 10c/20t, this matrix is 2 VMs.
2026-05-17 22:12:03 +02:00
Simone 56185a8ecb feat(ci): guest-cpu/guest-memory-mb action inputs on main
Runner fetches the composite action from @main. Propagates the VMX
override inputs.
2026-05-17 21:42:48 +02:00
Simone 40e928fbcb feat(ci): expose guest-cpu/guest-memory-mb; ns7zip Linux 8GB
job.py already patches the clone VMX (numvcpus/memsize) via
--guest-cpu/--guest-memory-mb; expose them as action inputs
(default '0' = keep template). build-ns7zip.yml sets
guest-memory-mb: 8192 — the parallel MinGW cross-compile thrashes at
the 4 GB Linux template default (Windows template is 6 GB).
2026-05-17 21:42:47 +02:00
Simone ce3c6ef7a7 fix(winrm): retry transient WSMan host-process faults (1018)
After a memory-heavy parallel build the guest can momentarily fail to
launch wsmprovhost (WSManFault 1018), which broke artifact collect
(now does Compress-Archive + fetch over WinRM). run() retries up to 4x
with exponential backoff on transient WSMan markers, dropping the
cached shell so a fresh one is opened once the guest recovers.
2026-05-17 21:30:56 +02:00
Simone 6288bedfc7 fix(ci): harden release job condition (avoid stuck 'blocked')
A bare `if: github.ref_type == 'tag'` on a needs-dependent job can
leave `release` stuck in "blocked" instead of skipped for
workflow_dispatch runs on Gitea. Use the explicit
${{ github.event_name == 'push' && github.ref_type == 'tag' }} form.
2026-05-17 21:08:49 +02:00
Simone 83a0e46e6b feat(build): live-stream Linux build output; ns7zip via in-guest clone
- SshTransport.run_streaming: incremental channel recv, forwards
  stdout/stderr live (no more one-block-at-end). _linux_build uses it
  with PYTHONUNBUFFERED so the guest python flushes promptly.
- _tail_lines split out for failure messages (no double print).
- Windows live streaming deferred (TODO 8.2) — pypsrp execute_ps
  returns only at completion.
- build-ns7zip.yml: use-git-clone:'true' (in-guest), repo-url ->
  https://gitea.emulab.it/... (guest-reachable; host SSH alias was
  host-only). Requires GiteaPAT in the LocalSystem keyring or a public
  nsis-plugin-ns7zip.
2026-05-17 20:51:48 +02:00
Simone e7a8ddc668 ci: ns7zip build uses --dist; collect dist/
ns7zip now supports --dist (commit 57133b7 on nsis-plugin-ns7zip):
DLLs land in <repo>/dist/<config>. Build with `python build_plugin.py
--dist` and collect artifact-source 'dist'.
2026-05-17 20:33:56 +02:00
Simone e1bd598684 ci: single build-command for ns7zip (Linux has python)
Linux template provides `python`, so the OS-aware split is
unnecessary. Use `python build_plugin.py` for both matrix legs.
2026-05-17 20:28:39 +02:00
Simone c14445498c fix(ci): correct ns7zip build-command and artifact-source
build_plugin.py is a dispatcher: it auto-detects host/toolset and
forwards extra args to the per-version script, which rejected
--final/--dist-dir. Both the Windows (legacy 2601_vs2026) and Linux
build scripts copy nsis7z.dll into <repo>/plugins/{x86-ansi,
x86-unicode,amd64-unicode}, not dist.

- build-command: just `python build_plugin.py` (python3 on Linux —
  Ubuntu 24.04 has no `python`).
- artifact-source: 'plugins' (fixes the "dist missing" failure too).
2026-05-17 20:27:14 +02:00
Simone 348faf720e ci: rename build workflow to build-ns7zip.yml on main
Propagates the renamed cross-repo build workflow (targets
nsis-plugin-ns7zip) to main.
2026-05-17 20:12:26 +02:00
Simone 95ee91c506 ci: rename build-nsInnoUnp.yml -> build-ns7zip.yml; update doc refs
Workflow now targets Simone/nsis-plugin-ns7zip. Renamed the file and
the workflow `name:`, and updated all references in active docs
(plans/archived and docs/archived left as frozen history).
2026-05-17 20:12:25 +02:00
Simone ff0aaab9da ci: build-nsInnoUnp targets nsis-plugin-ns7zip
Switch the cross-repo build target to Simone/nsis-plugin-ns7zip
(repo-url, artifact-name, release asset name).
2026-05-17 20:09:15 +02:00
Simone 90ecce7dc0 fix(build): flush guest build output + put tail in failure message
On a non-zero build the guest stdout/stderr was written unflushed
then a ClickException raised, so the cause was lost (only
"build command failed (exit 1)" surfaced). _report_build_output now
emits the output with markers, flushes both streams, and returns the
last lines which are appended to the failure message — diagnosable
even if act_runner buffering drops the body. Applied to Linux + Windows.
2026-05-17 17:47:17 +02:00
Simone b884c23124 fix(ci): conditional --commit splat on main
Propagates the PS5.1 empty-arg-drop fix (runner fetches action @main).
2026-05-17 17:39:37 +02:00
Simone 5962951234 fix(ci): don't splat empty --commit (PS5.1 drops zero-length args)
PowerShell 5.1 drops a zero-length string when splatting to a native
exe, so an empty $repoCommit shifted flag/value pairing and click saw
the build command as an unexpected positional. Append --commit only
when a commit is set.
2026-05-17 17:39:36 +02:00
Simone 86716773d7 feat(ci): repo-branch/repo-commit inputs on main
Runner fetches the composite action from @main. Propagates the
cross-repo branch/commit inputs.
2026-05-17 17:37:20 +02:00
Simone 9f54c99c9c feat(ci): repo-branch/repo-commit inputs for cross-repo builds
github.ref_name/github.sha refer to the workflow's own repo. When
repo-url points elsewhere (build-nsInnoUnp builds
nsis-plugin-nsinnounp) the workflow's branch does not exist there
("Remote branch ... not found in upstream origin"). New inputs:
- repo-branch: target branch (default: github.ref_name)
- repo-commit: target commit (default: github.sha only if repo-url
  not overridden; cross-repo => empty = branch tip, no pin)
build-nsInnoUnp.yml sets repo-branch: main.
2026-05-17 17:37:18 +02:00
Simone 5027389080 fix(job): surface redacted git stderr from host-side clone
_host_clone hid all stderr ("exit 128" with no cause). Surface the
last stderr lines with scheme://user:pass@ credentials masked, so
failures (e.g. unresolved SSH alias under LocalSystem) are diagnosable.
2026-05-17 17:28:35 +02:00
Simone 27070ebb3e fix(ci): build-nsInnoUnp uses host-side clone (SSH alias is host-only)
repo-url is ssh://gitea-ci/... — an SSH alias defined only in the
host ~/.ssh/config. With the new in-guest-clone default the guest
tried to resolve `gitea-ci` and failed (name resolution). Set
use-git-clone:'false' so the host (which has the alias + SSH key)
performs the clone.
2026-05-17 17:24:00 +02:00
Simone 81672e9285 fix(ci): build-nsInnoUnp uses full Gitea action URL
Short-form `Simone/local-ci-cd-system/...@main` resolved to
github.com (DEFAULT_ACTIONS_URL=github) -> "authentication required:
Repository not found". Use the full gitea.emulab.it URL like
self-test.yml.
2026-05-17 17:14:23 +02:00
Simone 6b50a0fcea docs(phaseA): record self-test smoke matrix (both transports PASS)
Passo 6: self-test.yml validated — in-guest clone (default) and
host-side clone+zip, Windows + Linux, all SUCCESS. Artifact handling
github-free.
2026-05-17 17:11:40 +02:00
Simone c40373cb2a feat(ci): use-git-clone/submodules default-on in action (main)
Runner fetches the composite action from @main. Propagates the
default-on transport/submodules inputs and explicit flag forwarding.
2026-05-17 17:00:53 +02:00
Simone 8d059cd3c4 feat(job): wire use-git-clone + submodules; default in-guest clone
The job command previously discarded --use-git-clone and --submodules
(`del`) and always in-guest cloned with submodules off — making both
action inputs dead no-ops (submodule repos silently broken).

- job.py: --use-git-clone/--host-clone and --submodules/--no-submodules
  are real booleans defaulting to ON. Default = in-guest clone with
  submodules. --host-clone clones on the host into a temp dir
  (_host_clone) and transfers a zip; temp dir cleaned in finally.
  clone_submodules now honoured (was hardcoded False).
- action.yml: use-git-clone / submodules default 'true'; forward the
  explicit positive/negative flag so the Python default is overridden
  deterministically.
- self-test.yml: add smoke-{windows,linux}-hostclone jobs covering the
  host-side transport (default jobs already cover in-guest).
- tests: default-transport, host-clone, and --no-submodules coverage.
2026-05-17 17:00:46 +02:00
Simone 1577bb8fdb docs(todo): defer GitHub Actions mirror (fix 1) — checkout still github.com
Artifact github.com dependency removed (fix 2 applied). Remaining:
actions/checkout@v4 in lint.yml. Recorded as deferred §8.1 with
revisit conditions (air-gapped host / total github.com independence).
2026-05-17 16:44:49 +02:00
Simone 622279df73 refactor(ci): drop upload-artifact from action on main
Runner fetches the composite action from @main. Propagates the
github.com-free artifact handling (host-side collect dir).
2026-05-17 16:42:38 +02:00
Simone 1e5cdc3b00 refactor(ci): drop upload/download-artifact (remove github.com dependency)
actions/upload-artifact and download-artifact run code fetched from
github.com (and v4 is GHES-incompatible, v3 deprecated). The runner
host is single with a shared filesystem, so the orchestrator's
host-side collect dir is the artifact handoff:

- action.yml: replace the two upload-artifact steps with
  host-path report steps; artifacts stay under F:\CI\Artifacts and
  are aged by Invoke-RetentionPolicy.ps1.
- build-nsInnoUnp.yml: release job reads
  F:\CI\Artifacts\{run_id}-{run_attempt}-{target} directly instead of
  download-artifact; existing Gitea REST release-asset upload unchanged.

Tradeoff (accepted): artifacts are no longer downloadable from the
Gitea Actions run page for non-tag builds — only on host disk, and as
release assets for tagged builds.
2026-05-17 16:42:36 +02:00
Simone 6c9822b929 refactor(artifacts): harmonize Windows to Linux raw-file collection
Windows produced an intermediate C:\CI\output\artifacts.zip that
upload-artifact then re-zipped (zip-in-zip), while Linux deposited raw
files. Make both paths consistent: the build stages raw outputs into a
collect dir; collect zips it only as a transport archive, fetches, and
extracts into the host artifact dir; actions/upload-artifact produces
the single final archive.

- _windows_build: param artifact_zip -> output_dir; stage raw files
  (in-place when source IS the collect dir, else wipe+copy), no
  Compress-Archive; absolute artifact-source resolved.
- _windows_collect: zip guest dir as transport, fetch, extract (mirror
  _linux_collect); guest_path is now the collect directory.
- job.py / build_run CLI: pass output_dir; rename --guest-artifact-zip
  -> --guest-output-dir.
- Tests updated for the raw-file contract.
2026-05-17 16:30:34 +02:00
Simone 54a7fd4171 fix(build): fetch pinned commit (shallow clone lacks it)
git clone --depth 1 --branch X only fetches the branch tip. When the
branch advances between workflow trigger and runner pickup, checking
out the pinned commit failed with "reference is not a tree: <sha>".
Fetch that exact commit (git fetch --depth 1 origin <sha>) before
checkout, on both Linux (SSH) and Windows (WinRM) paths.
2026-05-17 16:17:55 +02:00
Simone 0c68013e87 fix(build): Linux artifact staging — absolute source + don't wipe output
Two bugs made the Linux smoke "succeed" with an empty artifact:
- artifact_source was always joined as workdir + '/' + src, so an
  absolute source (/opt/ci/output) became /opt/ci/build//opt/ci/output
  and was never found — only a non-fatal WARNING was logged.
- `rm -rf output_dir` ran unconditionally; when the build writes
  directly into the collect dir (the smoke case: output == source),
  it deleted the build output before collection.

Resolve absolute vs workdir-relative; when the source is the output
dir, collect in place without wiping; a missing/empty source is now a
hard failure instead of a silent empty artifact.
2026-05-17 16:12:50 +02:00
Simone 9daf7df871 docs(phaseA): mark self-test.yml validated
Both smoke jobs (Linux + Windows) passed end-to-end this session.
2026-05-17 16:09:52 +02:00
Simone b7efa33f76 docs: align documentation with session fixes
Reconcile docs with the end-to-end pipeline fixes:
- upload/download-artifact @v4 -> @v3 (Gitea GHES) in WORKFLOW-AUTHORING
  and workflow-example.yml; add Common Mistakes rows (v4, action ref
  form + DEFAULT_ACTIONS_URL, public action repo).
- BEST-PRACTICES / README / HOST-SETUP: guest credential must live in
  the LocalSystem vault with a host-qualified username; document
  Set-CIGuestCredential.ps1 / Test-CIGuestWinRM.ps1 and auth=ntlm.
- README / AGENTS / HOST-SETUP: production venv install is NON-editable
  (LocalSystem); no CI workflow may install into it.
- HOST-SETUP: add DEFAULT_ACTIONS_URL=github + full-URL uses: + public
  repo + @main requirements discovered during validation.
- Correct stale repo name local-ci-system -> local-ci-cd-system.
2026-05-17 16:09:15 +02:00
Simone d8039ffb4e docs(phaseA): fix Windows smoke artifact-source to match build cmd
The Windows manual smoke used --guest-artifact-source
'C:\ci\workspace\artifact.txt' (a stale absolute path that does not
exist in the build flow; workdir is C:\CI\build). The build command
writes artifact.txt into the workdir, so the source must be relative
'artifact.txt' — matching the Linux example.
2026-05-17 15:55:52 +02:00
Simone 1b2b6acb45 fix(build): run Windows build cmd as PowerShell; resolve absolute artifact-source
Two Windows-guest build bugs:
- The build command was wrapped in `cmd /c`, so PowerShell-authored
  commands failed ("'New-Item' is not recognized"). Run it as PS
  (seed LASTEXITCODE=0 so PS-only commands exit cleanly).
- artifact_source was always Join-Path'd with the workdir; an absolute
  source (C:\CI\output) became C:\CI\build\C:\CI\output. Use the path
  as-is when rooted, else Join-Path the workdir.
2026-05-17 15:50:17 +02:00
Simone 2b6a5f0557 fix(ci): ephemeral lint venv on main
Stops a main-triggered Lint run from poisoning the shared production
venv (see feature branch commit for full rationale).
2026-05-17 15:44:37 +02:00
Simone dc14396832 fix(ci): lint must use an ephemeral venv, not the production one
The python lint job set VENV_DIR=F:\CI\python\venv (the shared
orchestrator venv) and ran `pip install -e ".[dev]"`. Every lint run
repointed ci_orchestrator at the lint job's transient checkout; once
act_runner cleaned that dir, all later smoke/build jobs failed with
"No module named ci_orchestrator". Use a job-local venv under
github.workspace, rebuilt fresh each run.
2026-05-17 15:44:36 +02:00
Simone 953d5b1e02 feat(scripts): add Test-CIGuestWinRM.ps1 diagnostic
Reproduces the orchestrator WinRM readiness probe as SYSTEM (the
act_runner account) and surfaces the real error the silent
is_ready() swallows: TCP reachability, guest hostname from the TLS
cert CN, and an auth x username-form matrix, with a classified
fix recommendation.
2026-05-17 12:24:35 +02:00
Simone c577588bbd fix(winrm): default to NTLM for local-account build VMs
pypsrp defaults to auth='negotiate', which attempts Kerberos with no
domain and fails under SSPI with SEC_E_UNKNOWN_CREDENTIALS for the
workgroup ci_build account. Default to 'ntlm' (configurable). The
guest username must be host-qualified (WINBUILD-2025\ci_build) and
stored that way in the credential vault.
2026-05-17 12:24:34 +02:00
Simone 7336cbe77f fix(ci): BOM-free GITHUB_OUTPUT + hardened artifact path on main
Runner fetches the composite action from @main. Propagates the fix
that stops an empty artifact-path output from globbing the F: drive.
2026-05-17 12:13:23 +02:00
Simone 2e44eaadb9 fix(ci): write GITHUB_OUTPUT without BOM; harden artifact path
PowerShell 5.1 `Out-File -Encoding utf8` prepends a UTF-8 BOM. The
act_runner GITHUB_OUTPUT parser then read the key as "artifact-path",
so steps.invoke-ci.outputs.artifact-path resolved empty. Combined with
the trailing backslash, the upload path became "\" -> the F: drive root,
causing upload-artifact to ingest the entire drive (hundreds of GB of
unrelated files).

- Append outputs with UTF8Encoding($false) (no BOM).
- Throw if artifactPath is empty instead of emitting nothing.
- Drop the trailing backslash; use /*.log for the diagnostic glob.
2026-05-17 12:13:22 +02:00
Simone 0f163a4732 docs(phaseA): production venv install must be non-editable
act_runner runs as LocalSystem; `pip install -e .` writes a .pth to a
path LocalSystem can't resolve (N: user drive or a transient
F:\CI\RunnerWork job dir), causing "No module named ci_orchestrator".
Prescribe `pip install .` and warn about the cd target.
2026-05-17 12:08:57 +02:00
Simone cfe82410ee fix(ci): downgrade artifact actions v4 -> v3 on main
Runner fetches the composite action from @main; main still had
upload-artifact@v4 which fails on Gitea (GHESNotSupportedError).
Brings the v3 action.yml from feature/python-rewrite-and-linux-migration.
2026-05-17 11:57:08 +02:00
Simone e59bac2434 feat(scripts): add Set-CIGuestCredential.ps1
Stores a guest-VM credential into the LocalSystem keyring vault via a
transient SYSTEM scheduled task, using the production venv's keyring
(the backend ci_orchestrator reads). Fixes the per-user vault mismatch
that made act_runner (LocalSystem) fail with "Credential not found in
keyring" for cmdkey/UI-stored credentials.
2026-05-17 11:56:40 +02:00
Simone ea3e30403a fix(ci): downgrade artifact actions v4 -> v3 for Gitea compat
Gitea act_runner reports as GHES; @actions/artifact v2 (upload/
download-artifact@v4) uses the Twirp API Gitea does not implement,
failing with GHESNotSupportedError. v3 uses the artifact protocol
Gitea supports.
2026-05-17 11:56:40 +02:00
Simone 003e899c3c ci: add local-ci-build composite action to main
Required so `uses: .../local-ci-build@main` resolves: the action only
existed on feature/python-rewrite-and-linux-migration. Brings just the
action.yml (host-side orchestrator unchanged) without merging the full
migration branch.
2026-05-17 02:51:36 +02:00
Simone 7bdafe8e59 ci: update artifact upload actions to use standard upload-artifact action 2026-05-17 02:15:36 +02:00
Simone 045d005024 ci: update artifact upload actions to use local repository references 2026-05-17 02:13:18 +02:00
Simone a18912233e ci: update action references to local-ci-cd-system in workflows and action files 2026-05-17 01:37:03 +02:00
Simone aebd308526 ci: sposta local-ci-build action in .gitea/actions/ 2026-05-17 00:45:43 +02:00
Simone 7932c1971c ci: sposta self-test.yml e build-nsInnoUnp.yml in .gitea/workflows 2026-05-17 00:29:53 +02:00
Simone 7f0f34ec42 docs: aggiorna checklist FaseA (tracking workflow) 2026-05-17 00:29:21 +02:00
Simone 2da133b4b8 ci: sposta self-test.yml e build-nsInnoUnp.yml in .gitea/workflows 2026-05-17 00:29:11 +02:00
Simone 3977c4c6ea chore: allinea .gitignore a main 2026-05-17 00:24:26 +02:00
Simone e388bed8a6 ci: aggiungi workflow_dispatch (trigger manuale) a lint.yml 2026-05-17 00:23:56 +02:00
Simone 1e573e4f04 fix: add missing workflow_dispatch trigger to lint.yml
fix: update .gitignore to include AI tools and Python bytecode
2026-05-17 00:22:41 +02:00
Simone ebbd550857 ci: aggiungi workflow lint.yml da feature/python-rewrite-and-linux-migration 2026-05-17 00:14:16 +02:00
Simone 57bfc41a5a docs,config: aggiorna AGENTS.md, config.example, HOST-SETUP.md, checklist faseA e fix vari orchestrator (workstation, build, job, wait, winrm, test) 2026-05-17 00:14:04 +02:00
Simone 8b18d56eec ci(lint): add CmdletBinding and ShouldProcess support to ISO creation functions for safer execution 2026-05-14 18:34:03 +02:00
Simone fcf5dceeed ci(lint): enhance PSScriptAnalyzer settings and suppress false positives; improve error handling in scripts 2026-05-14 18:34:03 +02:00
Simone 14958c3f83 ci(lint): add rule to suppress false positives for param() in remote script blocks 2026-05-14 18:34:03 +02:00
Simone cb24c3cfad ci(lint): update PSScriptAnalyzer settings and suppress warnings for plain-text passwords in templates 2026-05-14 18:34:03 +02:00
Simone de31b8b56b ci(lint): update PSScriptAnalyzer settings to include additional formatting rules 2026-05-14 18:34:02 +02:00
Simone 2c7af6b39a ci(lint): update PSScriptAnalyzer invocation to use custom settings file 2026-05-14 18:34:02 +02:00
Simone 72bb5d26bb ci: remove Python setup step from lint workflow 2026-05-14 18:34:02 +02:00
Simone 9f003648e2 fix: correct table formatting in ideas-overview.md for better readability 2026-05-13 11:12:28 +02:00
Simone c3e2ce7150 archive: move completed plans and sprint test plan to dated folders
- plans/archived/2026-05-13/: final-master-plan (done), 4 AI analysis/review
  docs (gpt55-analysis, gpt55-review-of-opus, opus47-analysis,
  opus47-review-of-gpt55)
- docs/archived/2026-05-13/: TEST-PLAN-v1.3-to-HEAD (sprint complete)
2026-05-13 10:47:06 +02:00
Simone 6d04e8e084 feat: update installer SHA256 hashes for Python, DotNetInstallScript, SevenZip, and NodeJS 2026-05-13 10:41:42 +02:00
Simone b30d905487 nice-to-have: implement all 6 tier items
- Get-CIJobSummary.ps1: already present with full implementation (marked done)
- Get-BuildArtifacts.ps1: add -JobId/-Commit params; Write-ArtifactManifest writes
  manifest.json (name, size, sha256, commit, jobId) after both Linux and Windows
  artifact collection branches
- Invoke-CIJob.ps1: add -GuestCPU/-GuestMemoryMB params; insert post-clone VMX
  override block (numvcpus/memsize rewrite) before vmrun start; pass -JobId/-Commit
  to Get-BuildArtifacts calls
- Watch-RunnerHealth.ps1: add -GiteaUrl/-GiteaCredentialTarget params; optional
  GET /api/v1/admin/runners check in Running branch warns if 0 online runners
- Install-CIToolchain-WinBuild2025.ps1: fill SHA256 hashes for Python 3.13.3,
  7-Zip 26.01, Node.js 22.14.0, dotnet-install.ps1
- Measure-CIBenchmark.ps1: add deltaKB field (linked-clone disk footprint in KB)
  measured post-clone; added to result object and summary Format-Table
2026-05-13 10:38:49 +02:00
Simone a637923fd6 feat(low): sprint 4 Low items tutti 5 completati
codice:
- template/Validate-SetupState.ps1: docblock HTTP/Basic -> HTTPS/Basic, port 5986
- scripts/Validate-HostState.ps1 (nuovo): check ACL SSH key ci_linux, Credential Manager
  target BuildVMGuest, struttura dir F:\CI\, vmrun.exe raggiungibile

docs:
- docs/TEST-PLAN-v1.3-to-HEAD.md sezione 3.6: campi JSONL corretti (cloneSec/startSec/
  ipSec/winrmSec/destroySec/totalBootSec) per riflettere output reale di Measure-CIBenchmark.ps1
- docs/CI-FLOW.md tabella failure: 'partial artifacts' -> Get-GuestDiagnostics a diagnostics/
- docs/CHANGELOG.md (nuovo): log reverse-cronologico di tutti gli sprint completati
- plans/final-master-plan.md: tutti i Low marcati done
2026-05-13 10:26:08 +02:00
Simone 82ffccde38 feat(medium): sprint 3 Medium items 6 implementati, 6 confermati gia' presenti
codice:
- Watch-DiskSpace.ps1: Event Log source CI-DiskAlert -> CI-DiskSpaceAlert
  (allineato con task scheduler CI-DiskSpaceAlert)
- Watch-RunnerHealth.ps1: maintenance flag  salta restart se
  F:\CI\State\runner-maintenance.flag esiste
- Invoke-CIJob.ps1:
  - param WebhookUrl (default '') per alert webhook
  - sanity check TemplatePath: Write-Warning se non sotto F:\CI\Templates\
  - 90-min duration warning: Start-Job che posta [WARNING] dopo 5400s
  - finally: Remove-Job per cancellare il warn se build finisce prima

docs:
- BEST-PRACTICES.md sezione 11: VMware HGFS write semantics e cache-poisoning risk
- final-master-plan.md: marcati done  post-failure diagnostics, UseSharedCache,
  VMDK SHA256, SSH host-key, template-refresh runbook, 90-min warn, HGFS,
  Event Log names, TemplatePath sanity, maintenance flag, Setup-Host pass docs,
  emoji-free webhooks
2026-05-13 10:19:55 +02:00
Simone c8f28994fa docs(plan): sprint 3 verification pass tutti gli High restanti gia' implementati
- H9 (ci-report-ip.service check): gia' in Validate-DeployState.ps1 branch Linux
- H10 (smoke test workflow): gia' in gitea/workflows/self-test.yml + scripts/Test-Smoke.ps1
- H12 (Get-GuestIPAddress): gia' estratto in _Common.psm1 e usato da Measure-CIBenchmark
- Medium: disk gate (L339), JobId ValidatePattern (L77), ExtraGuestEnv key validation
  (L184), phase-duration summary (L541), TEST-PLAN PS7 syntax gia' corretta
- Low: Install-Runner.ps1 gia' assente dal repo
- Aggiornato header Last updated + Status
2026-05-13 10:10:55 +02:00
Simone f4f7efebd4 Refactor documentation and analysis in final master plan, opus47 analysis, and opus47 review of GPT-5.5
- Updated the final master plan to improve clarity and consistency in the status of various capabilities, including fixes and enhancements made as of 2026-05-12.
- Revised the opus47 analysis to provide a more structured overview of the system's production readiness, including detailed coverage of OWASP Top 10 risks and operational gaps.
- Enhanced the opus47 review of GPT-5.5 by clarifying severity ratings and rationales for various items, while adding new high-severity items that were previously overlooked.
2026-05-13 00:08:19 +02:00
Simone a3089cb887 feat(workflow): rinomina build-nsis.yml -> build-nsInnoUnp.yml, aggiunge job release
- Rinominato gitea/workflows/build-nsis.yml in build-nsInnoUnp.yml
- Aggiunto job release: scarica artifact Windows+Linux, crea release Gitea
  via API REST, comprime e uploada gli asset come zip (richiede secret GITEA_TOKEN)
- Aggiornati tutti i riferimenti in README.md, TODO.md, plans/*.md
2026-05-12 23:37:00 +02:00
Simone 95f3f8f856 docs(readme): sync con stato attuale (Linux support, burn-in, transport, action.yml)
- Stato: aggiornato (Windows+Linux e2e PASS, burn-in 4 job concorrenti PASS)
- Panoramica: diagram aggiornato con Linux/SSH path e dual runner label
- Template VM: aggiunta sezione LinuxBuild2404 (BaseClean-Linux, SSH, ci_build)
- Struttura: aggiunti _Transport.psm1, Test-CapacityBurnIn, Start-BurnInTest-Linux,
  Get-CIJobSummary, template Linux (Deploy/Prepare/Install-CIToolchain), actions/
- Setup rapido: separato in 1a Windows / 1b Linux con Prepare-LinuxBuild2404 -TakeSnapshot
- act_runner: tabella env vars completa (LINUX_TEMPLATE_PATH, SSH_KEY_PATH, ...)
  + labels windows-build:host e linux-build:host
- Uso build manuale: aggiunto esempio Linux guest + note -UseGitClone/-SkipArtifact
- Workflow: composite action documentata con tabella input; matrix Windows+Linux
- Docs: LINUX-TEMPLATE-SETUP.md non piu' 'non implementato'
2026-05-12 23:23:50 +02:00
Simone bbc2b36efe fix(ssh): switch CI SSH to permissive mode (no known_hosts)
Root cause: ssh-keygen -R prints 'Host X not found in F:\CI\State\known_hosts'
to stderr when the IP has no prior entry. In PS5.1 with ErrorActionPreference=Stop,
native stderr is converted to ErrorRecords before 2>$null can discard them,
making the command a terminating error caught by the job's catch block.

This caused all 4 concurrent burn-in jobs to fail after ~15s with:
  Error: Host 192.168.79.XXX not found in F:\CI\State\known_hosts

Additionally, 4 concurrent SSH connections writing to the same known_hosts file
with no advisory locking risk file corruption under concurrent load.

Fix: set SshKnownHostsFile default to '' in Invoke-CIJob, Invoke-RemoteBuild,
and Get-BuildArtifacts. When KnownHostsFile='' _Transport.psm1 uses
StrictHostKeyChecking=no + UserKnownHostsFile=NUL (permissive mode), consistent
with Wait-VMReady and Prepare-LinuxBuild2404.ps1. Ephemeral CI VMs on a
local NAT network have no meaningful MITM risk.

Remove the ssh-keygen purge block from Invoke-CIJob.ps1 (no longer needed).

AGENTS.md: document PS5.1 native stderr / 2>$null interaction (error #12).
2026-05-12 22:51:20 +02:00
Simone d562ba90c0 fix(template): clear machine-id in Prepare-LinuxBuild2404 (Step 7b)
Each Ubuntu clone derived from the same snapshot shared an identical
machine-id, causing systemd-networkd to use the same DHCP client-id
and receive the same NAT IP  triggering IP collision failures.

Step 7b truncates /etc/machine-id and removes /var/lib/dbus/machine-id
before the snapshot is taken. On first boot each clone generates a
fresh machine-id from /dev/urandom -> unique DHCP client-id -> unique IP.
2026-05-12 22:33:55 +02:00
Simone 51557bc737 docs(AGENTS): add machine-id Linux DHCP collision as known error #11 2026-05-12 22:30:18 +02:00
Simone 8c74e27590 fix(diagnostics): use StrictHostKeyChecking=no for Linux guest-diag SSH
Diagnostics is best-effort. Using accept-new without UserKnownHostsFile
caused the system known_hosts (~/.ssh/known_hosts) to be consulted,
which holds a stale key from a previous clone of the same IP.
Switch to no+NUL (same as Wait-VMReady) to avoid false host-key errors.
2026-05-12 22:29:57 +02:00
Simone c7f1a46a58 fix(linux): purge stale known_hosts entry before first SSH on each clone
Each Linux BuildVM clone gets a new SSH host key for the same
NAT IP, causing 'host key has changed' errors with accept-new mode.

After IP detection, ssh-keygen -R removes the old entry from the
CI-local known_hosts file (F:\CI\State\known_hosts by default)
before Phase 4/5 make any SSH connection. The file is created if
it does not exist yet. Windows jobs are unaffected.
2026-05-12 22:23:33 +02:00
Simone 8eddda09ba docs(burnin-dummy): update README for Linux build support 2026-05-12 22:16:31 +02:00
Simone 87fdb8b6a5 feat(burnin): add build.sh for Linux guest + Start-BurnInTest-Linux.ps1
gitea/burnin-dummy/build.sh: bash equivalent of build.ps1 (sleep 30,
writes dist/build-info.txt). Needed because powershell is not present
on LinuxBuild2404 template.

scripts/Start-BurnInTest-Linux.ps1: burn-in wrapper for LinuxBuild2404
template (SnapshotName=BaseClean-Linux, GuestOS=Linux,
BuildCommand='bash build.sh'). Mirrors Start-BurnInTest.ps1.
2026-05-12 22:14:52 +02:00
Simone 2294307a12 feat: expose skip-artifact as workflow input in action.yml
action.yml:
  - Add skip-artifact input (default: 'false').
  - Forward as INPUT_SKIP_ARTIFACT env var to the PS run step.
  - Pass SkipArtifact=true to Invoke-CIJob.ps1 when set.
  - Gate 'Upload artifacts' step on inputs.skip-artifact != 'true'.

Invoke-CIJob.ps1:
  - Restore -SkipArtifact switch; skips Phase 6 and logs 'skipped' event.

Invoke-RemoteBuild.ps1:
  - Restore -SkipArtifact switch; skips packaging inside the guest.
  - Error message updated to mention skip-artifact workflow input.
2026-05-12 22:05:17 +02:00