Skip to content

Rectify: Codex Cook Startup History Isolation and Lifecycle Immunity#4347

Merged
Trecek merged 35 commits into
developfrom
impl-rectify_codex_cook_startup_history_2026-07-23_105000-20260723-173730
Jul 25, 2026
Merged

Rectify: Codex Cook Startup History Isolation and Lifecycle Immunity#4347
Trecek merged 35 commits into
developfrom
impl-rectify_codex_cook_startup_history_2026-07-23_105000-20260723-173730

Conversation

@Trecek

@Trecek Trecek commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • isolate fresh Codex cook attempts from retained rollout history using managed generated homes and durable per-attempt views
  • serialize configuration and rollout lifecycle mutations, validate recovery state, and preserve canonical active/archive representations
  • centralize cook process-group ownership, PTY descriptor inheritance, startup tracing, and hard readiness budgets
  • add contract, lifecycle, race, recovery, environment, observability, and installed-Codex canary coverage

Verification

  • AUTOSKILLIT_TEST_FILTER=conservative AUTOSKILLIT_TEST_BASE_REF=develop task test-check — 28,622 passed
  • AUTOSKILLIT_CODEX_STARTUP_CANARY=1 PYTEST_TEST_PATHS="tests/integration/test_codex_startup_canary.py" task test-all — 2 passed
  • pre-commit run --all-files — passed

Closes #4267

@Trecek Trecek left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

AutoSkillit PR Review — Verdict: changes_requested

Comment thread src/autoskillit/cli/_init_helpers.py Outdated
Comment thread src/autoskillit/cli/session/_session_cook.py Outdated
Comment thread src/autoskillit/cli/session/_session_cook.py
Comment thread src/autoskillit/cli/session/_session_cook.py Outdated
Comment thread src/autoskillit/cli/session/pty/_observer.py
Comment thread src/autoskillit/execution/backends/_codex_session_storage.py
Comment thread src/autoskillit/server/_lifespan.py Outdated
Comment thread src/autoskillit/workspace/session_skills.py Outdated
Comment thread src/autoskillit/workspace/session_skills.py Outdated
Comment thread tests/integration/test_codex_startup_canary.py Outdated

@Trecek Trecek left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

AutoSkillit review: blocking findings detected. See inline comments for the required fixes.

@Trecek Trecek left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

AutoSkillit PR Review — Verdict: approved_with_comments

Comment thread src/autoskillit/cli/session/_session_picker.py Outdated
Comment thread src/autoskillit/cli/session/_session_startup_trace.py
Comment thread src/autoskillit/cli/session/pty/_observer.py Outdated
Comment thread src/autoskillit/cli/session/pty/_observer.py Outdated
Comment thread src/autoskillit/execution/backends/_codex_config_lock.py
Comment thread src/autoskillit/execution/backends/claude.py
Comment thread tests/arch/test_capability_consumption.py Outdated
Comment thread tests/cli/test_interactive_subprocess_contracts.py Outdated

@Trecek Trecek left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

AutoSkillit review: warning-only findings detected. See inline comments — no blocking changes required.

@Trecek
Trecek force-pushed the impl-rectify_codex_cook_startup_history_2026-07-23_105000-20260723-173730 branch from d5df77e to e7d8b15 Compare July 24, 2026 23:50

@Trecek Trecek left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

AutoSkillit PR Review — Verdict: approved_with_comments

Comment thread src/autoskillit/cli/session/_session_cook.py Outdated
Comment thread src/autoskillit/execution/backends/_codex_session_storage.py Outdated
Comment thread src/autoskillit/execution/backends/codex.py Outdated
Comment thread tests/execution/backends/test_codex_session_storage.py
Comment thread tests/execution/backends/test_codex_config_validation.py

@Trecek Trecek left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

AutoSkillit review: warning-only findings detected. See inline comments — no blocking changes required.

@Trecek Trecek left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

AutoSkillit PR Review — Verdict: approved_with_comments

_fsync_directory(path.parent)


@dataclass(slots=True)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

[warning] cohesion: _FileLease independently reimplements the same lock-path validation, flock acquisition, descriptor ownership, and release lifecycle as workspace.session_skills._SessionLease and CodexConfigLock. The implementations already differ in directory-fd/inode validation and failure aggregation, so related session leases receive inconsistent safety behavior. Extract one hardened lease primitive with optional owner-diagnostic behavior and reuse it across these call sites.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Valid observation — flagged for an architecture decision. _FileLease, workspace _SessionLease, and CodexConfigLock share OS-locking mechanics but intentionally differ in contention, timeout, reentrancy, directory hardening, diagnostics, and failure aggregation. Enforced import boundaries prohibit execution/workspace coupling, so consolidation requires a designed IL-0 primitive and cross-domain migration rather than a local extraction.

Comment thread src/autoskillit/execution/backends/_codex_session_storage.py
Comment thread src/autoskillit/execution/backends/codex.py
Comment thread tests/cli/test_cook_interactive.py
Comment thread tests/cli/test_cook_interactive.py
Comment thread tests/cli/test_cook_interactive.py Outdated

@Trecek Trecek left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

AutoSkillit review: warning-only findings detected. See inline comments — no blocking changes required.

@Trecek
Trecek force-pushed the impl-rectify_codex_cook_startup_history_2026-07-23_105000-20260723-173730 branch from 8407d94 to e5cfea4 Compare July 25, 2026 04:32
@Trecek
Trecek added this pull request to the merge queue Jul 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 25, 2026
@Trecek
Trecek force-pushed the impl-rectify_codex_cook_startup_history_2026-07-23_105000-20260723-173730 branch from e5cfea4 to f5ea3cc Compare July 25, 2026 15:07
@Trecek
Trecek added this pull request to the merge queue Jul 25, 2026
Merged via the queue into develop with commit 98a66d0 Jul 25, 2026
3 checks passed
@Trecek
Trecek deleted the impl-rectify_codex_cook_startup_history_2026-07-23_105000-20260723-173730 branch July 25, 2026 16:20
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