Skip to content

Prepare controlled-session cleanup manifest - #33

Open
omry wants to merge 1 commit into
pr32from
pr33
Open

Prepare controlled-session cleanup manifest#33
omry wants to merge 1 commit into
pr32from
pr33

Conversation

@omry

@omry omry commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • derive an immutable cleanup manifest from durably recorded session ownership
  • bind it to the exact prepared containers and private channel before startup
  • keep absent lease networks and volumes explicit and reject later resource selection
  • use strict canonical encoding without a separate schema-version marker

Why

The upcoming short-lived watchdog must receive a frozen cleanup target instead of accepting resource choices after startup.

Validation

  • full Go test suite
  • focused race-enabled ownership and manifest tests
  • live Docker controlled-session integration test

@omry
omry changed the base branch from main to pr32 August 9, 2026 10:05
@omry

omry commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: ed5f4a187b

ℹ️ 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".

@omry

omry commented Aug 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: da288dd3a3

ℹ️ 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".

@omry omry added the approved PR reviewed and approved label Aug 9, 2026
@omry
omry marked this pull request as ready for review August 9, 2026 13:47
Copilot AI lite review requested due to automatic review settings August 9, 2026 13:47

Copilot AI 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.

Pull request overview

Derives a controlled-session cleanup manifest from the durably recorded session ownership, validates it against the exact prepared runtime resources before startup, and introduces strict canonical JSON encoding/decoding for watchdog consumption.

Changes:

  • Add ControlledSessionCleanupManifest with validation plus canonical encode/decode helpers.
  • Have the controlled-session supervisor persist ownership, derive a cleanup manifest, validate it against the prepared containers/channel, and reject non-empty networks/volumes.
  • Extend test coverage for manifest derivation/canonicalization and for rejecting runtime cleanup resource selection.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
internal/dockerdeploy/controlled_session_supervisor.go Derive/validate cleanup manifest during prepare; adjust ownership recording flow.
internal/dockerdeploy/controlled_session_supervisor_test.go Add coverage ensuring invalid cleanup resource selection is rejected before startup.
internal/deploy/live_run_queue_file_test.go Update controlled-session ownership fixture channel directory path.
internal/deploy/controlled_session_cleanup_manifest.go New manifest type with validation and strict canonical JSON encode/decode.
internal/deploy/controlled_session_cleanup_manifest_test.go New tests for derivation, validation, and canonical/unknown-field rejection.
docs/CONTROLLED_SESSION_DESIGN.md Document the immutable cleanup manifest derived from durable ownership.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +185 to +189
released = true
if err := operation.Unlock(); err != nil {
return fmt.Errorf("release operation lock before controlled-session startup: %w", err)
return deploy.ControlledSessionCleanupManifest{}, fmt.Errorf("release operation lock before controlled-session startup: %w", err)
}
return nil
return manifest, nil
Comment on lines +17 to +19
// Networks and volumes are explicit arrays even while controlled sessions do
// not create either resource. Future slices may populate them only after their
// exact identities become part of durable ownership.
Comment thread docs/CONTROLLED_SESSION_DESIGN.md Outdated
Comment on lines +62 to +66
record; failed cleanup retains it. Reploy now derives the immutable watchdog
cleanup manifest from that recorded ownership before startup. It names only
the exact containers and private channel, carries the host boot identity,
represents the currently absent lease networks and volumes as empty arrays,
and omits protocol authority. The parent and watchdog will be the same
@omry omry removed the approved PR reviewed and approved label Aug 9, 2026
@omry
omry force-pushed the pr33 branch 2 times, most recently from 682209d to b4d58b6 Compare August 9, 2026 17:27
@omry
omry force-pushed the pr33 branch 2 times, most recently from 8c03f9e to f1ea356 Compare August 9, 2026 20:39
@omry
omry force-pushed the pr33 branch 2 times, most recently from ceebb6e to 2ca12cd Compare August 9, 2026 21:01
@omry
omry force-pushed the pr33 branch 2 times, most recently from 0aeea52 to a1d6657 Compare August 9, 2026 22:08
@omry
omry force-pushed the pr33 branch 2 times, most recently from 55a2b9a to 9a8cafd Compare August 9, 2026 22:31
@omry
omry force-pushed the pr33 branch 2 times, most recently from 0969ca5 to fd03cc2 Compare August 9, 2026 22:59
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.

2 participants