Skip to content

feat: serialize exact review publication - #592

Merged
steipete merged 4 commits into
mainfrom
codex/exact-review-artifact-publisher
Jul 15, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/exact-review-artifact-publisher

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • keep exact reviewers read-only and upload immutable, hash-bound review bundles
  • enqueue durable publication work independently from review generation
  • serialize Git-backed publication, validate producer and queue identity, and retry without rerunning Codex
  • recover source drift, reopened or unlocked items, expired artifacts, failed handoffs, and publisher interruptions safely

Validation

  • pnpm run build:all
  • pnpm run lint
  • focused workflow, bundle, queue, ledger, and recovery tests
  • pnpm run format:check
  • git diff --check
  • autoreview clean

@steipete
steipete requested a review from a team as a code owner July 15, 2026 09:56

@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: 77e7cb8123

ℹ️ 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 dashboard/worker.ts Outdated
Comment on lines 2854 to 2858
const publication = item.decision.sourceAction === EXACT_REVIEW_ARTIFACT_PUBLISH_SOURCE_ACTION;
if (publication && activePublishers >= 1) continue;
const target = item.decision.targetRepo;
const active = activeTargets.get(target) || 0;
if (active >= targetCapacity) continue;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid starving publisher behind review target capacity

When a target is already at EXACT_REVIEW_TARGET_MAX_CONCURRENT with ordinary review leases, a publication item passes the new activePublishers check but is still skipped by the shared target-capacity check. Because pending items are sorted by creation time, older ordinary review backlog for the same target can keep refilling the target slot before newer @publish items, so completed exact-review bundles may sit unpublished until the review backlog drains instead of using the dedicated serialized publisher lane.

Useful? React with 👍 / 👎.

Comment on lines +1154 to +1156
has_command_context: Boolean(
producerDecision.commandStatusMarker && producerDecision.statusCommentId,
),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve marker-only command status updates

Command-routed reviews can carry a commandStatusMarker without a statusCommentId (src/repair/comment-router.ts emits the marker unconditionally and only adds the id when known), and update-command-status can update by marker alone. Requiring both here makes the delayed publisher skip Mark re-review complete for those successful reviews, leaving the command status stuck at the in-progress/failure state even though publication finished.

Useful? React with 👍 / 👎.

@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: 3ed62dff60

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

set -euo pipefail
test -n "$GH_TOKEN"
target_branch="${RECOVERY_TARGET_BRANCH:-$(gh api "repos/$TARGET_REPO" --jq .default_branch)}"
target_branch="$CLAIM_TARGET_BRANCH"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve default-branch fallback for legacy events

When a legacy exact-review dispatch omits target_branch, the legacy intake still records targetBranch: payload.target_branch || "main", while the previous workflow ignored that default and fetched the repository's live default branch for non-recovery reviews. Using the claimed value here makes those legacy items clone main; for any target whose default branch is not main (or was renamed), the checkout step fails before Codex and the durable queue just retries the same bad branch.

Useful? React with 👍 / 👎.

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

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

continue-on-error: true
env:
GH_TOKEN: ${{ steps.target-write-token.outputs.token }}
GH_TOKEN: ${{ steps.target-read-token.outputs.token }}

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 Pass a write token to the exact review runner

For normal exact event reviews of an open issue/PR, pnpm run review is still invoked without --skip-start-comment, and it calls postReviewStartStatusComment in src/clawsweeper.ts to POST the dedicated clawsweeper-review-lease issue comment before reviewing. Supplying the read-only App token here makes that POST fail with insufficient permissions, which is recorded as a lease acquisition failure and causes the review step to exit before producing a bundle, so exact-review queue items just retry instead of publishing.

Useful? React with 👍 / 👎.

@steipete
steipete merged commit 30502fd into main Jul 15, 2026
9 checks passed
@steipete
steipete deleted the codex/exact-review-artifact-publisher branch July 15, 2026 10:38
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
* feat: serialize exact review publication

* fix: keep exact review publication independent

* fix: resolve legacy target default branch

* fix: keep exact review generation read-only
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