Repository navigation
fix(publication): prevent aged owner starvation - #1225
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 22, 2026, 5:09 AM ET / 09:09 UTC. ClawSweeper reviewWhat this changesThis PR makes publication-batch departure and claim select the same oldest eligible aged owner before fresh or full batches, while excluding superseded revisions consistently. Merge readinessKeep open for maintainer review: the member-authored PR resolves the prior superseded-revision finding and source review found the alarm, preflight, and claim paths using the same eligibility and owner-selection rule. Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe exact-review queue groups publication work into owner-homogeneous batches. Durable Object alarms choose a batch for workflow dispatch, and the signed claim endpoint leases that same owner’s eligible work. flowchart LR
A[Queued publication work] --> B[Eligibility filtering]
B --> C[Shared owner selection]
C --> D[Durable Object alarm]
D --> E[Workflow dispatch and preflight]
E --> F[Signed claim and batch lease]
Decision needed
Why: Member-authored items are non-closeable and require explicit maintainer judgment even when the patch is technically sound. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain one shared eligibility and owner-selection contract for alarm departure, terminal preflight, and signed claim, with the focused aged-owner and superseded-revision regressions guarding it. Do we have a high-confidence way to reproduce the issue? Yes—the focused aged-versus-fresh and superseded-revision scenarios are clear in current source and the supplied local Durable Object proof, though this read-only review did not rerun them. Is this the best way to solve the issue? Yes—the shared selector plus identical superseded-revision exclusion is the narrowest maintainable way to prevent departure and claim from disagreeing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9a09faa3da3b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What Problem This Solves
Fixes an issue where an owner with aged publication work could remain queued while another owner's fresh or full batch kept winning departure selection. The alarm could also be scheduled from the selected fresh owner instead of the globally oldest eligible item, delaying the aged owner's next dispatch opportunity.
Why This Change Was Made
Departure and claim now share one owner-selection rule: the globally oldest aged owner's owner wins before cross-owner fresh/full optimization, while batches remain owner-homogeneous and existing within-owner ordering is preserved. The global oldest eligible timestamp remains the alarm boundary even while a different fresh owner is temporarily selected.
Both paths also use the same superseded-revision exclusion. An expired batch can no longer leave an aged stale revision eligible for departure while claim rejects it, which previously allowed that stale owner to trigger an early dispatch of another owner's fresh work.
This does not change capacity, configuration, telemetry, read models, publication payloads, or queue storage.
User Impact
Operators can expect aged publication work to receive a bounded dispatch opportunity instead of being indefinitely displaced by continuously arriving fresh work from another owner.
OpenClaw Bay Impact
OpenClaw Bay is unaffected. This changes internal publication batch owner selection and alarm timing only; Bay's observer-only projection, status fields, data contracts, and navigation remain unchanged.
Documentation Impact
Reviewed
AGENTS.mdandCONTRIBUTING.md. No documentation update is required because this repair does not add or change a public API, configuration option, workflow input, status field, or operator procedure.Evidence
node --test --test-name-pattern='aged superseded publication|oldest publication aging deadline|fresh publication owner still wins' test/exact-review-publication-batches.test.ts— 3/3 passed; covers the superseded lifecycle regression plus both owner-ordering contracts.node --test --test-name-pattern='exact-review batch preflight follows the publisher owner selection' test/dashboard-worker-queue-runtime.test.ts— 1/1 passed; preflight inspected beta items 9222/9223, dispatched one full beta batch, and left alpha queued.node --test test/exact-review-publication-batches.test.ts— 69/69 passed../node_modules/.bin/tsc -p tsconfig.dashboard.json --pretty false.git diff --checkpassed.Real Behavior Proof
Claim: A real local Durable Object alarm preserves the globally oldest publication's aging deadline after an earlier wake, then departure preflight and the signed workflow claim agree on that aged owner despite a fresh competing owner.
Runtime surface: Exact head
e709b11798d4136077dc1101f6a12844fc47e5dbunder[email protected] dev --local, using the repository's Worker entry point, persisted SQLite-backedExactReviewQueue, automatic Durable Object alarms, signed internal enqueue/claim routes, GitHub App authentication, terminal preflight, and workflow dispatch code. The harness follows the existingdocs/proof/alarm-hydration-dedup/run-proof.mjsWorker/alarm pattern anddocs/proof/csw-127-phase0-6/run-proof.mjssigned claim pattern.Command and environment:
Node 26.5.0; Wrangler 4.107.0 local runtime; disposable local Durable Object persistence; generated synthetic RSA/HMAC credentials; loopback-only GitHub API/workflow receiver.
Controlled scenario:
aged/proof#140.fresh/proof#141.review/proof#300to force an earlier real alarm/wake./internal/exact-review/publication-batches/claimthrough the Worker with a valid synthetic signature and the captured dispatch identity.Observable result:
The earlier review wake occurred 2,549 ms before the old owner's boundary. The subsequent real alarm dispatched 165 ms after that boundary, not at the fresh owner's later deadline. The loopback terminal preflight touched only the aged owner, the signed claim returned only the aged owner, and the persisted SQLite receipt contained one leased batch owned by
pr-1225-runtime-workerwith that exact member.Artifacts:
.artifacts/pr-1225-publication-runtime-proof/runtime-summary.json(local ignored evidence), SHA-2564d2cf94447e8127c48479c52f2aaa543789274f6521a825abe63858cadcf9aa4; reproducible harnessrun-proof.mjs, SHA-25662e2c754f05a68bb27dc738c04766d4e3b18266d517880606ac976be0ef78c2a. Supporting request trace and redacted Wrangler log are stored beside them.Limits: GitHub App/API and workflow dispatch were terminated at a loopback receiver. No production Worker, GitHub repository, workflow, queue, secret, deployment, or live ClawSweeper state was contacted or mutated.