Skip to content

Commit review transitions and GitHub outbox intent atomically - #3

Merged
timReynolds merged 1 commit into
mainfrom
codex/durable-review-transitions
Sep 13, 2026
Merged

timReynolds merged 1 commit into
mainfrom
codex/durable-review-transitions

Conversation

@timReynolds

Copy link
Copy Markdown
Owner

An outbox insertion failure could leave a reviewer assignment, notification, or escalation recorded in Clearance state without scheduling its GitHub work. The workflow then swallowed the failure and the webhook delivery could be marked processed, preventing a useful retry.

PR changes, submitted reviews, and escalation runs now submit state and typed outgoing intent through one commitTransition interface. The GitHub adapter translates that intent into existing outbox jobs, and the Drizzle store commits canonical state, its projections, and the complete job batch in one transaction. Failed acceptance propagates to the handler, which records a failed delivery; retry can then schedule the work that rolled back. GitHub execution remains asynchronous in the existing outbox runner. The standalone state-save/enqueue path and catch-and-continue callbacks have been removed.

Validation:

  • npm run typecheck, npm run lint, npm test (165 tests), npm run format, and npm run build pass.
  • Five integration cases run the real Drizzle persistence code against PGlite PostgreSQL: SQL failures roll back assignment/notification, submitted-review, and escalation transitions; signed PR and review webhook deliveries fail, replay successfully, and skip an already processed delivery.
  • Existing policy, dry-run, override, GitHub adapter, and outbox execution tests remain covered.

PGlite is a pinned development dependency. Its fixture applies the Clearance schema migration using PostgreSQL's native UUID function instead of Supabase's pgcrypto wrapper. No schema migration is required. These checks exercise transactional persistence locally; they do not verify hosted Supabase, connection pooling, concurrent workers, or exactly-once GitHub execution.

@clearance-app-tr

clearance-app-tr Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Clearance

No review requirements were triggered.

Warnings

  • examples/OWNERS.toml $.escalation.fallback_team: GitHub team @org/platform-leads was not found
  • examples/OWNERS.toml $.rule[0].require[0].from: GitHub team @org/platform-eng was not found
  • examples/OWNERS.toml $.rule[0].require_any[0].from: GitHub team @org/security-eng was not found
  • examples/OWNERS.toml $.rule[0].require_any[1].from: GitHub team @org/compliance was not found
  • examples/OWNERS.toml $.rule[1].require[0].from: GitHub team @org/platform-eng was not found
  • examples/OWNERS.toml $.rule[1].require[1].from: GitHub team @org/security-eng was not found
  • examples/OWNERS.toml $.notify[0].teams[0]: GitHub team @org/compliance was not found
  • examples/OWNERS.toml $.override.teams[0]: GitHub team @org/repo-admins was not found

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-13T21:58:02.695523Z eb72043 PR opened
ℹ️ 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: eb7204328e

ℹ️ 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 on lines +18 to +21
case "upsert-comment":
return {
type: githubOutboxJobTypes.upsertComment,
payload: { ...pull, body: effect.body },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Prevent stale transition jobs from overwriting newer review state

When an earlier transition's comment or status job fails and is delayed for retry, a later transition for the same PR can complete first; the older job then retries and overwrites the sticky comment and same-SHA statuses with stale state. For example, a pending-status job can fail, an approval transition can publish success, and the pending job can subsequently revert the visible check indefinitely. These jobs need per-PR/SHA sequencing, version checks, or supersession before execution rather than being independent unversioned outbox entries.

Useful? React with 👍 / 👎.

@timReynolds
timReynolds merged commit 45386cf into main Sep 13, 2026
1 of 4 checks passed
@timReynolds
timReynolds deleted the codex/durable-review-transitions branch September 18, 2026 07:16
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