fix(publication): coalesce duplicate result lineages#801
Conversation
c96bbc5 to
cec2420
Compare
cec2420 to
ba68539
Compare
|
@clawsweeper review-pr |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(publication): coalesce duplicate result lineages This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
vincentkoc
left a comment
There was a problem hiding this comment.
P1: dashboard/exact-review-queue.ts:716-749 only returns the semantic-deduplication result when producerChanged is true. After producer B replaces producer A, the retained map key remains A's key while retained.item.decision now contains B's provenance. A retry from B therefore misses exact-key delivery dedupe, finds the retained semantic lineage, computes producerChanged === false, skips this block, and is admitted as a second pending item under B's key. Both rows can then become publication work.
Return the semantic-deduplication result whenever a retained lineage exists; use producerChanged only to decide whether to refresh the retained decision/provenance. Add a regression covering A -> B replacement -> B retry and prove the queue still contains one effective lineage.
This recreates the duplicate publication chains the PR is intended to eliminate, so it must be fixed before merge.
|
Superseded by #807. The original report from @snowzlmbot automation identified a real publication-lineage problem, but the submitted head recreated duplicate work on a refreshed producer retry. The maintainer replacement keeps the report credit, adds that regression plus legacy ordering coverage, and preserves the existing same-producer batch handoff contract. |
Summary
targetRepo#itemNumber + leaseRevision + claimGeneration;semantic_deduped_totaland time-window flow telemetry separately from stale-revision supersession;Fixes #800.
Problem
The queue key for result publication includes
producerRunIdandproducerRunAttempt. Two artifact deliveries from different producer attempts for the same already-reviewed lease can therefore occupy distinct queue records. Existing controls dedupe identical delivery ids, supersede an older review revision, and avoid duplicate target items inside one batch, but they do not collapse equal review tuples across the full pending queue.During a publication backlog, this creates avoidable preparation, state-writer, and GitHub mutation pressure without adding a new review decision. It also lets the queue count grow from repeated producer attempts even though there should be one visible final review result.
Behavior
The new semantic identity applies only to publication results for protocol-v2 tuples.
Safety and scope
This does not change Codex prompts, review criteria, close/merge policy, batch ownership, state-writer coordination, GitHub write authorization, or per-item tuple fences. It does not raise batch size or concurrency.
An active publisher is deliberately immutable for a different producer: its batch membership and callbacks keep the original key and immutable ownership tuple. The change only absorbs later equivalent ingress. Same-producer redelivery retains the existing newer-revision path required by batch completion fencing.
Code paths
dashboard/exact-review-queue.tstest/dashboard-worker.test.tstest/exact-review-publication-batches.test.tsdocs/state-publication-batching-plan.mdValidation
Local work was limited to lightweight static preflight:
git diff --check: passed;oxfmt --check dashboard/exact-review-queue.ts test/dashboard-worker.test.ts test/exact-review-publication-batches.test.ts: passed;oxlinton the same files with--deny-warnings: 0 warnings, 0 errors.Current-head cloud validation for
ba6853923507fa3f2b8f1b3ffeb2be69d6a1d5c7:pnpm check, Windows launcher, sparse repair build smoke, and crawl-remote integration passed;Failure-to-pass evidence:
Risk
Rollback
Revert commit
ba6853923507fa3f2b8f1b3ffeb2be69d6a1d5c7. The change is additive: no queue schema-version bump, no external migration, and no configuration change. Existing queue records and active callbacks remain readable through their original keys.Docs updated
docs/state-publication-batching-plan.mdRelated work
Not tested / limitations