Skip to content

fix(lifecycle): recover owned mux sessions#63

Merged
roodboi merged 7 commits into
mainfrom
codex/lifecycle-session-recovery
Jul 9, 2026
Merged

fix(lifecycle): recover owned mux sessions#63
roodboi merged 7 commits into
mainfrom
codex/lifecycle-session-recovery

Conversation

@roodboi

@roodboi roodboi commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reconcile deterministic lifecycle mux sessions with token-backed ownership, adopting only healthy owned sessions and safely replacing stale owned sessions
  • include a deterministic SHA-256 fingerprint of the effective overlay and sorted lifecycle env in freshness, so changed env replaces stale host helpers without persisting names, keys, or values
  • preserve running Compose services, lifecycle helpers, and ownership state when a down.before guard aborts hack down or hack restart
  • target detached Zellij sessions through the documented global --session selector for owner metadata, inspection, pane creation, exec, and input
  • teach doctor to detect and safely repair established ownership-proven orphan sessions while preserving foreign collisions and recent in-flight startups
  • make the local tmux recovery scenario capability-aware while requiring tmux in the dedicated Docker/tmux CI job

Verification

  • 850 unit tests passed, 5 intentional skips, 0 failed
  • typecheck, privacy check, canonical Turbo quality checks, changed-file Ultracite, build, generated agent parity, and CLI reference generation passed
  • full local E2E with tmux mandatory: 9 local scenarios passed; 3 disabled Docker-tier scenarios skipped
  • lifecycle recovery E2E proves env refresh, failed down/restart guard preservation, ownership safety, signal cleanup, and doctor repair
  • compiled binary passed the lifecycle session recovery E2E scenario
  • no-tmux recovery E2E exits 0 with an explicit local skip and exits 1 with zero skips when HACK_E2E_REQUIRE_TMUX=1
  • live Zellij 0.43.1 detached-session probe wrote and read owner metadata through --session and cleaned up successfully
  • release tarball extracted and its binary passed version smoke
  • current-head CI passed secret scan, test/release smoke, runtime images, and non-skippable Docker/tmux E2E
  • local Docker 29.4.0 responds to info but hangs on container creation; Docker scenarios are proven by current-head CI

Release

Release signal: yes. This is a user-visible lifecycle reliability fix and should produce a patch release through semantic-release. No separate changeset is used by this repository release flow.

roodboi commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

CI coverage check: the E2E harness skips Docker scenarios when the hack-dev network is absent. Please make the new docker-e2e job create that network and assert the Docker scenarios actually ran, otherwise the job can pass with all Docker cases skipped.

@roodboi

roodboi commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Addressed in 96fc075: the job now creates the isolated hack-dev network before the run, and HACK_E2E_REQUIRE_DOCKER=1 makes any Docker-tier skip fail the runner. The skip gate also has a local negative-path verification.

@roodboi roodboi force-pushed the codex/lifecycle-session-recovery branch from 96fc075 to fd66e44 Compare July 9, 2026 21:16
@roodboi

roodboi commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Secret scan follow-up: the only finding was a UUID-shaped fake ownership token in a unit test. I replaced it with a constructed low-entropy test value and autosquashed the change into the original commit so the flagged literal is absent from branch history.

@roodboi

roodboi commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@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: fd66e44fe7

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

Comment thread src/commands/project.ts
Comment thread tests/e2e/run.ts
@roodboi

roodboi commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 2148cf5c41

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

Comment thread src/commands/project.ts Outdated
Comment thread src/mux/zellij-backend.ts Outdated
@roodboi

roodboi commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

Current head: fd66e44

@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: 2148cf5c41

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

Comment thread src/mux/zellij-backend.ts Outdated
@roodboi

roodboi commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 91a0c2e0c8

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

@roodboi roodboi merged commit c1da123 into main Jul 9, 2026
5 checks passed
@roodboi roodboi deleted the codex/lifecycle-session-recovery branch July 9, 2026 22: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