Skip to content

fix(sync,web): surface exhausted jobs and skip draft compass hop - #2522

Merged
cursor[bot] merged 2 commits into
mainfrom
cursor/exhausted-jobs-draft-render-f6e6
Jul 31, 2026
Merged

fix(sync,web): surface exhausted jobs and skip draft compass hop#2522
cursor[bot] merged 2 commits into
mainfrom
cursor/exhausted-jobs-draft-render-f6e6

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

Summary

Surfaces Sync jobs that exhausted the self-heal requeue budget so operators can find and clear/requeue wedged work, and removes the unnecessary CompassEvent hop on the Week draft render path.

  • Diagnostics include failedJobCount / exhaustedJobCount
  • Self-heal sweep logs a bounded sample of exhausted job ids/keys
  • New CLI: bun run cli manage-failed-jobs list|clear|requeue
  • Week Draft / GridDraft project GridEventDraft → GridEvent directly

Simplicity

Shared the exhausted-job Mongo filter between count/list helpers. CLI list reports true count + truncation rather than treating the sample length as the total. No new React state/effects.

Automated validation

  • Focused sync DB tests for job repository + failed-job requeue (pass)
  • Diagnostic contracts + diagnostic routes DB tests (pass)
  • Web: grid-event-draft adapter + GridDraft tests (pass)
  • bun run type-check and bun run lint (pass)

Independent review

Fresh diff review confirmed three CLI issues; all fixed before merge:

  1. list under-reported when sample capped — now uses countExhaustedFailed + truncated
  2. clear could delete non-failed jobs — now requires state === "failed"
  3. clear --apply ignored remove() failure — now throws on false

No confirmed defects on the draft → GridEvent projection path.

Test plan

  • bun packages/scripts/src/testing/test-mongo-env.ts sync -- packages/sync/src/storage/repositories/job.repository.db.test.ts packages/sync/src/domain/failed-job-requeue.service.db.test.ts packages/sync/src/server/diagnostic.routes.db.test.ts
  • bun test packages/core/src/types/sync/diagnostic.contracts.test.ts
  • bun packages/scripts/src/testing/test-parallel.ts web -- packages/web/src/events/grid-event-draft.adapter.test.ts packages/web/src/views/Week/components/Draft/grid/GridDraft.test.tsx packages/web/src/grid/layout/all-day-draft.position.test.ts
  • bun run type-check
  • bun run lint
Open in Web Open in Cursor 

cursoragent and others added 2 commits July 31, 2026 22:30
Expose exhausted failed Sync jobs in diagnostics, sweep logs, and a
manage-failed-jobs CLI so operators can clear or requeue wedged work.
Project Week grid drafts straight to GridEvent without a CompassEvent bridge.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
Use a true exhausted count with truncation signal on list, reject clear
on non-failed jobs, and check remove success. Share the exhausted-job
Mongo filter between count/list helpers.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
@cursor
cursor Bot merged commit d5d5246 into main Jul 31, 2026
20 checks passed
@cursor
cursor Bot deleted the cursor/exhausted-jobs-draft-render-f6e6 branch July 31, 2026 22:38
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.

2 participants