Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

fix(sandbox): isolate and recover session-built Compose images - #294

Open
omermorad wants to merge 52 commits into
agent/playwright/270-reportingfrom
agent/A-runtime/35-session-owned-images
Open

omermorad wants to merge 52 commits into
agent/playwright/270-reportingfrom
agent/A-runtime/35-session-owned-images

Conversation

@omermorad

@omermorad omermorad commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Compose services with build now get a unique local image tag per Sandbox and service. One explicit build supplies the images for telemetry preflight and Testcontainers startup. The generated override suppresses additional author-specified build tags. Pull-only services retain their configured images.

Sandbox records intended tags before Docker builds and then records observed image IDs. Normal stop, startup failure, and recovery remove a scoped tag only after checking its exact reference, owner, service, and recorded ID when available. Each removal is checked by inspecting the same tag again. Capsule acceptance now observes the catalog baseline and scoped tag throughout the journey.

Scope and gates

Validation

Command Local result
pnpm install --frozen-lockfile, pnpm lint, pnpm typecheck, pnpm check:deps Passed
VITEST_MAX_WORKERS=1 pnpm --filter @suites/blackbox-sandbox test 161 passed, 12 guarded Docker cases skipped
pnpm --filter @suites/blackbox-sandbox exec vitest run src/ownership/images/build.test.ts src/ownership/images/docker.test.ts src/acquisition/environment/effective.test.ts src/acquisition/environment/inspection.test.ts --reporter=verbose 15 passed
node --test demo/support/capsule-proof-image.test.mjs 5 passed
BLACKBOX_SANDBOX_DOCKER_TEST=1 VITEST_MAX_WORKERS=1 pnpm --filter @suites/blackbox-sandbox exec vitest run src/ownership/images/build-images.docker.test.ts --reporter=verbose 2 passed in 21.68 s. Separate daemon inspection found all six fixture tags absent and zero resources across nine scoped container/network/volume inventories.

The Docker tests seed synthetic sut-*:local and extra tags, build distinct file contents concurrently, stop one Sandbox, and verify the sibling still serves its own content. Recovery starts with an actual surviving image, a stopping record and a removed container. A separate startup-failure case inspects the immutable ID retained after the successful build. Both Docker cases failed at their baseline-ID assertions under a deliberately widened cleanup. Restored cases passed.

The unit controls removed ownership checks, omitted partial-build cleanup, and reintroduced implicit rebuilds. Eight targeted assertions failed. Two demo controls failed when catalog drift and leaked session tags were ignored. Local self-review provisionally qualifies these claims. The interruption fixture reconstructs a mid-stop state without killing the test process.

Local evidence is in .blackbox/tmp/35/ under the isolated worktree. Key files are qualification.md, docker-current.log, final-docker-cleanup.json, widened-control.log, and unit-controls-safe.log. All 31 current checks passed, including CI, E2E and Security. The issue's historical pnpm test:e2e:capsule is now the pnpm run test:demo acceptance lane. The local validation here was scoped to the affected package and real two-Sandbox regression.

Security and independent review

Cleanup uses non-forcing tag removal and preserves a tag whose identity has changed when inspected. It never removes a build image by immutable ID. Docker provides separate inspect and removal calls. The tests cover independent Sandbox sessions and observed tag replacement, with no claim of atomicity against a separate Docker administrator retagging the same UUID during deletion.

The first review identified a Docker transport mismatch when the winning Testcontainers strategy was configured via its properties file. The fix passes its resolved host/TLS/certificate values to the explicit image build and subsequent Compose commands. The preceding implementation lost all three transport settings in the new control. Follow-up focused tests, lint, typecheck and dependency checks passed. The current full E2E run includes the Sandbox Docker suite and both installed-consumer Capsule demo jobs.

GitHub Codex review request and completed review summary identify exact head de8a53c330650af9c18954775d68be1371133c5e, with zero findings and zero unresolved review threads.

…aywright/263-durable-evidence

# Conflicts:
#	packages/playwright/src/stimulus/lifecycle/native.test.ts
…aywright/263-durable-evidence

# Conflicts:
#	packages/playwright/src/stimulus/lifecycle/native.test.ts
@omermorad

Copy link
Copy Markdown
Contributor Author

@codex review

Please review head 805fe33fa4eee6a81a65e059e905d6c44516c7cd for #35, including build/service selection, tag ownership through startup and recovery, the exact-head Docker controls, and preservation of pre-existing image references. Please report actionable findings and the reviewed SHA.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-19T15:50:29.245573Z de8a53c Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 805fe33fa4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@omermorad

Copy link
Copy Markdown
Contributor Author

@codex review

Please review current head de8a53c330650af9c18954775d68be1371133c5e, including selection of the same Docker transport for the scoped image build, inspection, startup and recovery. The previous transport finding was corrected and has a regression control. Please report any remaining actionable findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: de8a53c330

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@omermorad
omermorad marked this pull request as ready for review November 19, 2026 15:48
@omermorad
omermorad added this pull request to stack #267 November 19, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant