From 0fcd037e4f99137196a8544784aba70e2f1f9348 Mon Sep 17 00:00:00 2001 From: DCCONSTRUCTIONS Date: Mon, 31 Aug 2026 21:01:30 +0300 Subject: [PATCH] fix(worker): compose staged source paths safely --- .../observatory_portable/Install-Worker006AgentImage.ps1 | 6 +++--- tests/test_worker_006_agent_image_installer.py | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/experiments/perception/worker/observatory_portable/Install-Worker006AgentImage.ps1 b/experiments/perception/worker/observatory_portable/Install-Worker006AgentImage.ps1 index e44af87..f48c965 100644 --- a/experiments/perception/worker/observatory_portable/Install-Worker006AgentImage.ps1 +++ b/experiments/perception/worker/observatory_portable/Install-Worker006AgentImage.ps1 @@ -119,9 +119,9 @@ function Get-StagedSnapshotInspection { $manifestPath = Join-Path $Root ($ContextManifestRelativePath.Replace("/", "\")) $dockerfilePath = Join-Path $Root ($DockerfileRelativePath.Replace("/", "\")) $requiredSourceFiles = @( - Join-Path $sourceRoot "__init__.py", - Join-Path $sourceRoot "observatory\m49_worker_container_main.py", - Join-Path $sourceRoot "observatory\m49_worker_service.py" + (Join-Path $sourceRoot "__init__.py") + (Join-Path $sourceRoot "observatory\m49_worker_container_main.py") + (Join-Path $sourceRoot "observatory\m49_worker_service.py") ) foreach ($requiredPath in $requiredSourceFiles + @($manifestPath, $dockerfilePath)) { if (-not (Test-Path -LiteralPath $requiredPath -PathType Leaf)) { diff --git a/tests/test_worker_006_agent_image_installer.py b/tests/test_worker_006_agent_image_installer.py index a3d8ef7..c7b7473 100644 --- a/tests/test_worker_006_agent_image_installer.py +++ b/tests/test_worker_006_agent_image_installer.py @@ -62,6 +62,15 @@ def test_worker_agent_installer_separates_archive_and_staged_identities() -> Non assert 'canonicalization = "utf8-path-nul-length-nul-sha256-lf-v1"' in script assert 'Assert-ExactDirectoryChildren $Root @("experiments", "src")' in script assert 'Assert-ExactDirectoryChildren $srcRoot @("k1link")' in script + assert '(Join-Path $sourceRoot "__init__.py")' in script + assert ( + '(Join-Path $sourceRoot "observatory\\m49_worker_container_main.py")' + in script + ) + assert ( + '(Join-Path $sourceRoot "observatory\\m49_worker_service.py")' + in script + ) assert "Dockerfile.worker-006-agent" in script assert "worker-006-agent-build-context.json" in script assert (