Skip to content

fix(workboard): lifecycle timer test races with database reads - #148221

Merged
steipete merged 1 commit into
mainfrom
codex/workboard-timer-settlement
Sep 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/workboard-timer-settlement

Conversation

@steipete

@steipete steipete commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Related: #147950, #146976, #148102

What Problem This Solves

Fixes intermittent Workboard lifecycle timer test failures when the first card status becomes visible before its background reconciliation sweep finishes. This is a maintainer-requested follow-up to the failure observed in #148102 CI.

User Impact

No user-visible behavior changes. The existing recurring reconciliation test stops depending on SQLite worker scheduling.

Why This Change Was Made

The service arms its next timeout after the complete admitted sweep, including its final database reads. Waiting only for the first persisted running status can advance the fake clock before that timeout exists. The test now awaits each outer runOperation promise, following the completion pattern established in #147950, while retaining the 60-second interval, running then review assertions, and exactly two session reads.

Evidence

  • Hosted changed-extension CI passed on ba7d1f8051fdec1dac343d399408c16473b6d6a1.
  • The ordinary focused timer case passed with the repair: 1 passed, 56 filtered out.
  • The original ordinary local case also passed; the race is supported by the existing CI failure and source ordering, not a claimed deterministic local red reproduction.
  • The selected changed-file gate passed, including extension test typechecking and lint.
  • Independent P2 review found no actionable issue; git diff --check passed.

No production code, timeout, retry policy, or line-budget exception changed.

@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@steipete
steipete marked this pull request as ready for review September 14, 2026 11:42
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 14, 2026
@clawsweeper

clawsweeper Bot commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 8:42 AM ET / 12:42 UTC (Revision 2).

ClawSweeper review

What this changes

The Workboard lifecycle test waits for each complete reconciliation sweep before checking card status or advancing its fake clock.

Merge readiness

✅ Ready for maintainer review

Keep open: this is a focused, useful repair to a timer test that still races on current main. No actionable patch defect was found, and the earlier merged fixture repair does not cover this interval case.

Priority: P3
Reviewed head: ba7d1f8051fdec1dac343d399408c16473b6d6a1

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused synchronization repair with preserved behavioral checks, source-backed ordering, and passing relevant hosted validation.
Proof confidence 🌊 off-meta tidepool Not applicable: The provided repository state identifies a member-authored test repair with no production or authority change, so the external-contributor runtime-proof gate does not apply; the exact-head extension CI result supports the changed test.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The provided repository state identifies a member-authored test repair with no production or authority change, so the external-contributor runtime-proof gate does not apply; the exact-head extension CI result supports the changed test.
Evidence reviewed 7 items Verified introduced scope: The pinned merge-base-to-head diff changes only the existing interval test, preserving running/review assertions, the 60-second advancement, and exactly two session reads.
Completion ordering supports the repair: The service awaits runOperation around session reconciliation, the final card list, and cleanup before arming its next timeout. The store’s operation promise settles after the callback completes; the spy preserves that implementation.
Still necessary on fetched main: Comparison with fetched main shows the interval test still uses status polling there; the production lifecycle and store-runtime files match the reviewed head. No implemented-on-main closure is supported.
Findings None None.
Security None None.

How this fits together

Workboard’s Gateway service reconciles linked session activity into persisted card status and schedules another sweep after completion. This test exercises that service with a real SQLite worker and controlled session responses.

flowchart TD
  A[Gateway startup] --> B[Lifecycle reconciliation]
  C[Session snapshot] --> B
  B --> D[SQLite card updates and final reads]
  D --> E[Completed sweep]
  E --> F[Next 60-second timer]
  E --> G[Test status assertions]
  F --> B
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +5. Total +5 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 12 7 +5
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 12 7 +5

Review metrics

None.

Technical review

Best possible solution:

Keep the existing lifecycle owner and synchronize the interval test with its complete admitted operation, preserving timing and observable status assertions.

Do we have a high-confidence way to reproduce the issue?

Yes at the source-ordering level: a persisted running status can precede the final database read and timeout registration. No deterministic failing execution was established in this read-only review, and the author explicitly reports that the original local case passed.

Is this the best way to solve the issue?

Yes. Awaiting the existing operation promise removes the premature clock advance without adding production seams, retries, longer timeouts, or weaker assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 3a2101a0fc2a.

Labels

Label justifications:

  • P3: This repairs test synchronization without changing runtime behavior or user settings.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The provided repository state identifies a member-authored test repair with no production or authority change, so the external-contributor runtime-proof gate does not apply; the exact-head extension CI result supports the changed test.

Evidence

What I checked:

  • Verified introduced scope: The pinned merge-base-to-head diff changes only the existing interval test, preserving running/review assertions, the 60-second advancement, and exactly two session reads. (extensions/workboard/src/lifecycle-sync.test.ts:933, ba7d1f8051fd)
  • Completion ordering supports the repair: The service awaits runOperation around session reconciliation, the final card list, and cleanup before arming its next timeout. The store’s operation promise settles after the callback completes; the spy preserves that implementation. (extensions/workboard/src/lifecycle-sync.ts:486, ba7d1f8051fd)
  • Still necessary on fetched main: Comparison with fetched main shows the interval test still uses status polling there; the production lifecycle and store-runtime files match the reviewed head. No implemented-on-main closure is supported. (extensions/workboard/src/lifecycle-sync.test.ts:933, 3a2101a0fc2a)
  • Earlier repair covers a different fixture: The merged fix(workboard): prevent premature lifecycle test assertions #147950 repairs runSessionSweep, establishing the same completion pattern without changing the recurring interval case. GitHub commit metadata identifies RomneyDa and the recorded parent. Local full blame could not complete because a historical object was unavailable. (extensions/workboard/src/lifecycle-sync.test.ts:81, 487bd6fd38a3)
  • Validation on the reviewed head: GitHub confirms checks-node-changed-extensions-config succeeded on the exact head. The captured PR body reports the focused case and changed-file gate passed, explicitly acknowledging that the original local case also passed. This review ran no tests; read-only diff checking passed. (ba7d1f8051fd)
  • Area history: Current-main history includes lifecycle maintenance by Peter Steinberger and the recent shared-fixture repair by Dallin Romney; these support routing candidates without attributing the race to either person. (extensions/workboard/src/lifecycle-sync.test.ts, 3a2101a0fc2a)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-14T12:06:37.209Z sha ba7d1f8 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 8638c54 into main Sep 14, 2026
164 checks passed
@steipete
steipete deleted the codex/workboard-timer-settlement branch September 14, 2026 13:27
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: workboard rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant