Skip to content

refactor(jobs): Migrate to declarative job scheduler#962

Merged
bokelley merged 1 commit intomainfrom
bokelley/issue-716-review
Feb 4, 2026
Merged

refactor(jobs): Migrate to declarative job scheduler#962
bokelley merged 1 commit intomainfrom
bokelley/issue-716-review

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented Feb 4, 2026

Summary

Replaces individual start/stop methods with a declarative configuration pattern for all 12 scheduled background jobs. This reduces boilerplate (~250 lines removed) and makes adding new jobs trivial.

  • scheduler.ts: Rewritten with JobConfig interface, register()/start()/stop() methods, and built-in business hours constraint handling
  • job-definitions.ts: New file with all job configurations including composite content-curator runner with error isolation
  • http.ts: Cleaned up by removing 5 inline job methods and 8 instance variables

Closes #716

Test plan

  • npm run typecheck passes
  • npm test - 273 tests pass
  • docker compose up --build - server starts correctly
  • Verified web UI loads via browser test

🤖 Generated with Claude Code

Replaces individual start/stop methods with a declarative configuration
pattern for all 12 scheduled background jobs. This reduces boilerplate
and makes adding new jobs trivial.

Changes:
- scheduler.ts: Rewritten with JobConfig interface, register/start/stop
  methods, and built-in business hours constraint handling
- job-definitions.ts: New file with all job configurations including
  the composite content-curator runner
- http.ts: Cleaned up by removing 5 inline job methods (~250 lines) and
  8 instance variables for job tracking

Closes #716

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@bokelley bokelley merged commit 770c706 into main Feb 4, 2026
6 checks passed
bokelley added a commit that referenced this pull request Apr 25, 2026
Brings in our get_media_buys request-builder fix (adcp-client#987
closing #983), placeholder-ID enricher audit (#991), schema-aware
brand/account injection in the storyboard runner (#943), the
a2a_context_continuity validator (#962), A2A wire-shape capture
(#904), and triage-bot ergonomics closing adcp#3121 (#992/#993).

Two compat fixes:

- **Hint type widening.** `StoryboardStepHint` widened from
  `ContextValueRejectedHint` alone to a five-kind union.
  `renderAllHintFixPlans` now accepts the broader type and filters
  to the kind it knows how to render. Other kinds drop silently
  from the fix-plan section but the runner's per-hint `message`
  field still surfaces them.
- **Strict request-schema validation.** 5.18.0's runner rejects
  unknown fields. `pagination-integrity-property-lists.yaml`'s
  `list_type` field isn't in `create-property-list-request.json`'s
  properties (the schema has `additionalProperties: false`). Drop
  it — no handler reads the field.

Multi-page upgrade for get_media_buys_pagination_integrity deferred —
the SDK's convention extractor populates context.media_buy_id from
the first-page response, then the request-builder injects that ID
and turns page 2 into an ID-lookup. Filed adcp-client#998 with the
diagnosis. Storyboard stays at single-step until the extractor fix
lands.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Migrate remaining scheduled jobs to centralized scheduler

1 participant