Skip to content

fix(aggregator): refuse empty/conflicting github-result reports; posted is terminal (#1686) - #3062

Merged
dezren39 merged 2 commits into
mainfrom
queue/4247-1686-github-result
Oct 31, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/4247-1686-github-result

Conversation

@dezren39

@dezren39 dezren39 commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Fixes #1686 (queue task 4247, per triage task 1905's confirmed reproduction).

CommentsStore.markGithubResult mapped any url-less report to failed — an empty {} report wrote a pending comment off unposted, and flipped a posted comment back to failed with its githubUrl still set.

Pinned rules (store-level; the endpoint already maps a store throw to 400):

  • A report carries exactly one outcome: neither url nor error → refused, state unchanged; both → refused.
  • posted is terminal: a later error or empty report is refused; the same url repeats as an idempotent no-op; a different url is a conflicting report, refused — the first posted result stands.
  • failed is not terminal against success: a retry that lands moves failed → posted; a repeat failure is an idempotent no-op.

Tests (bun test test/slice3.test.ts on laptop): 20 pass / 1 fail — the failure is the pre-existing manifest route-uniqueness test owned by PR #2604 / #2580. New regression test covers empty-on-pending, empty-on-posted, url+error, repeat/conflicting reports, and the failed→posted retry path.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner October 31, 2026 13:18
@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9e0c0b06-0135-40c3-b973-f1a623f19315
Commits

Reviewing files that changed from the base of the PR and between c6e099c and dac9902.

Files selected for processing: 2
  • pm-stack/aggregator/src/comments.ts
  • pm-stack/aggregator/test/slice3.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 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-10-31T13:48:07.555093Z dac9902 Manual request
ℹ️ 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: bea8b4e25b

ℹ️ 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 pm-stack/aggregator/src/comments.ts Resolved
Codex P2 on PR 3062: markGithubResult flips the in-memory state
before persist(); if that write failed, a repeat report hit the
idempotent early return (posted+same url, failed repeat) and
acknowledged success while the on-disk comment stayed pending —
after a restart it would post again and duplicate the GitHub
comment. Both early returns now persist first (persist snapshots
the full current state, so the flush lands the earlier un-persisted
result too). Regression test breaks the filesystem under the store
mid-report (directory replaced by a regular file), forces the first
persist to fail, then verifies the repeat lands posted/failed on
disk — fails pre-fix, passes now. slice3: 21 pass, only the
pre-existing manifest uniqueness failure (#2580) remains.
@dezren39

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: dac9902bcc

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

@dezren39
dezren39 merged commit b383fc4 into main Oct 31, 2026
1 check passed
@dezren39
dezren39 deleted the queue/4247-1686-github-result branch October 31, 2026 14:22
@dezren39
dezren39 restored the queue/4247-1686-github-result branch November 1, 2026 09:11
@dezren39
dezren39 deleted the queue/4247-1686-github-result branch November 1, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant