Skip to content

Rearchitect review runtime and presentation ownership - #85

Merged
lynnswap merged 62 commits into
mainfrom
codex/normalize-review-rollout-companions
Jul 29, 2026
Merged

Rearchitect review runtime and presentation ownership#85
lynnswap merged 62 commits into
mainfrom
codex/normalize-review-rollout-companions

Conversation

@lynnswap

Copy link
Copy Markdown
Owner

Purpose

Implement the approved July design-audit rearchitecture so review execution, runtime shutdown, authentication, MCP sessions, and chat presentation each have a single typed owner.

This removes duplicated lifecycle and persisted-review reconstruction paths that caused stale or repeated ReviewMonitor output, while adopting the current Codex v2 contracts through the reviewed CodexKit implementation.

Changes

  • Adopt the direct CodexAppServerKit, CodexDataKit, and testing products, pin the merged CodexKit revision, and pin the structured-shutdown MCP SDK fork.
  • Introduce typed review attempt, thread identity, terminal, and non-empty output contracts; centralize worker commits, cancellation/restart arbitration, and retained-thread cleanup.
  • Split host ownership into explicit runtime, login, account registry, and account-transition coordinators with generation-safe, awaitable restart and shutdown.
  • Rework MCP HTTP/session lifetime and projections so lifecycle state remains with the review store while final review and bounded log detail come from authoritative CodexChat projections.
  • Move ReviewMonitor chat presentation to typed snapshot/change observations and semantic rollout-companion metadata, including incremental sidebar/detail refresh and presentation invalidation when turns move.
  • Align preview and test infrastructure with production current-v2 lifecycle, cancellation, list, and shutdown semantics; add the design audit, approved architecture contract, and a frozen TextTransitions API CI gate.

Testing

  • swift test --build-system swiftbuild --no-parallel
  • Package tests with both the local CodexKit checkout and the remote fallback revision
  • xcodebuild test -project Tools/ReviewMonitor/CodexReviewMonitor.xcodeproj -scheme CodexReviewMonitor -destination 'platform=macOS,arch=arm64' CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO
  • Branch-wide Codex review: 0 findings

lynnswap and others added 30 commits July 10, 2026 10:48
Multi-agent structural/API audit of CodexKit (3f6216c) and CodexReviewKit
(6c1b432) against upstream codex (8347b8d) and openai-python (2.43.0):
verified findings (50 CONFIRMED / 1 PLAUSIBLE / 2 REFUTED), owner maps,
API coverage gaps, prioritized fix plan (P1-P3), and test checklist.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Clarify that Apple APIs are design analogs rather than implementation templates, align DataKit conformance and observation ownership, and complete restart, retention, MCP, and presentation lifecycle contracts.
Move review attempts, cancellation, retention, MCP sessions, projections, and preview runtime resources under explicit owners. Align Host/AppServer integration with the current CodexKit v2 contracts and require shutdown to join cleanup work.
Own each accepted app-server generation, MCP lifetime, event consumers, lifecycle callback, and shared teardown in HostRuntimeSession. Preserve final retention during staged shutdown and reject late generation publication.
lynnswap added 21 commits July 13, 2026 04:53
Inject one monotonic ReviewWorkerClock for connectivity observations and recovery timers. Keep presentation dates separate and move recovery tests to the same deterministic clock seam.
Centralize account mutations, login cancellation handoffs, runtime generation publication, and durable registry commits under explicit owner contracts. Preserve preview cancellation semantics and cover the lifecycle races with focused integration tests.
Pin the fallback dependency and canonical resolved graph to the PR review-fix commit.
Pin the fallback dependency and canonical resolved graph to the latest PR review fixes.
Reconstruct persisted reviewer rollouts from authoritative turn structure, keep incremental projection invalidation coherent, and display command durations only when app-server timing metadata is available.
Remove persisted text and adjacency heuristics from ReviewMonitor. Suppress typed companion messages only within the review sequence owned by the nearest exited-review marker.

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

ℹ️ 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 Sources/ReviewUI/ReviewMonitorAddAccountAction.swift Outdated
Comment thread Sources/CodexReviewMCPServer/CodexReviewMCPToolResults.swift Outdated
Comment thread scripts/verify-text-transitions-api.sh
Route authentication operation failures through user-visible UI state, resolve successful list and completed cancel output from the authoritative chat projection, and pin the API gate toolchain. Split build and test execution into cached ten-minute jobs so CI no longer spends the package-test budget on unrelated gates.

@lynnswap lynnswap left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 9fff09c2ac

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

@lynnswap

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 560820872c

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

@lynnswap
lynnswap merged commit 5180159 into main Jul 29, 2026
13 checks passed
@lynnswap
lynnswap deleted the codex/normalize-review-rollout-companions branch July 29, 2026 01:31
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