Skip to content

adr: gradual consumer migration from services to jobs#19

Draft
0xgleb wants to merge 1 commit into
docs/migrate-jobs-model-docsfrom
adr/services-to-jobs-migration
Draft

adr: gradual consumer migration from services to jobs#19
0xgleb wants to merge 1 commit into
docs/migrate-jobs-model-docsfrom
adr/services-to-jobs-migration

Conversation

@0xgleb

@0xgleb 0xgleb commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Motivation

ADR-0001 removes EventSourced::Services, so consumers need a reviewable path from inline command-handler side effects to durable jobs before they can take the breaking jobs API. st0x.liquidity has 10 EventSourced impls, st0x.issuance has 5, and issuance has an in-flight EventSourced migration that must not be disturbed.

Closes RAI-923.

Solution

  • Add ADR-0002 to record the consumer rollout strategy: extract side effects into consumer-side jobs first, then land one mechanical jobs API bump per repo.
  • Use liquidity as the lead repository because it already has conductor::job machinery and more aggregates exercising the pattern.
  • Keep issuance extraction separate from its existing EventSourced migration, then apply the same mechanical bump only after extraction is complete.
  • Place this PR at the top of the jobs stack because it documents how downstream repos adopt the API introduced below it.

@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@0xgleb, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 59 minutes and 58 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 92b90c0c-d44b-4187-93a9-b9297ed7a05a

📥 Commits

Reviewing files that changed from the base of the PR and between 2d6d324 and 8c7c6f7.

📒 Files selected for processing (1)
  • adrs/0002-consumer-services-to-jobs-migration.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch adr/services-to-jobs-migration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

0xgleb commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add the label add-to-gt-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from 11a7a94 to bf2e0a4 Compare June 10, 2026 01:18
@0xgleb 0xgleb force-pushed the feat/jobs-examples-docs branch from 3922ec6 to 7192363 Compare June 10, 2026 01:18
@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from bf2e0a4 to 9dc82da Compare June 10, 2026 02:50
@0xgleb 0xgleb force-pushed the feat/jobs-examples-docs branch from 7192363 to 5b9e6a8 Compare June 10, 2026 02:50
@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from 9dc82da to 834f710 Compare June 10, 2026 03:05
@0xgleb 0xgleb force-pushed the feat/jobs-examples-docs branch from 5b9e6a8 to 0366f23 Compare June 10, 2026 03:05
@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from 834f710 to 5843a37 Compare June 10, 2026 03:39
@0xgleb 0xgleb force-pushed the feat/jobs-examples-docs branch from 0366f23 to 39780cf Compare June 10, 2026 03:39
@linear-code

linear-code Bot commented Jun 10, 2026

Copy link
Copy Markdown

RAI-923

@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from 5843a37 to fd55c0f Compare June 10, 2026 04:06
@0xgleb 0xgleb force-pushed the feat/jobs-examples-docs branch from 39780cf to 8f4f05a Compare June 10, 2026 04:06
@0xgleb 0xgleb marked this pull request as ready for review June 10, 2026 04:07
@0xgleb 0xgleb self-assigned this Jun 10, 2026
@0xgleb 0xgleb added the documentation Improvements or additions to documentation label Jun 10, 2026 — with Graphite App
@0xgleb 0xgleb requested review from JuaniRios and findolor June 10, 2026 04:18
@0xgleb 0xgleb changed the base branch from feat/jobs-examples-docs to graphite-base/19 June 10, 2026 04:53
@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from 9184207 to 2ef55ed Compare June 10, 2026 04:55
@0xgleb 0xgleb changed the base branch from docs/migrate-jobs-model-docs to graphite-base/19 June 10, 2026 04:56
@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from 2ef55ed to 772cdd2 Compare June 10, 2026 06:00
@0xgleb 0xgleb force-pushed the graphite-base/19 branch from a7d1b09 to 1760f55 Compare June 10, 2026 06:00
@0xgleb 0xgleb changed the base branch from graphite-base/19 to docs/migrate-jobs-model-docs June 10, 2026 06:00

@findolor findolor left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from 772cdd2 to acac499 Compare June 10, 2026 17:39
@0xgleb 0xgleb force-pushed the docs/migrate-jobs-model-docs branch from 1760f55 to 6cc8e9f Compare June 10, 2026 17:39
@graphite-app graphite-app Bot force-pushed the docs/migrate-jobs-model-docs branch from 6cc8e9f to f2752ab Compare June 10, 2026 19:21
@graphite-app graphite-app Bot force-pushed the adr/services-to-jobs-migration branch from acac499 to a656523 Compare June 10, 2026 19:21
@0xgleb 0xgleb force-pushed the docs/migrate-jobs-model-docs branch from f2752ab to 9947e4e Compare June 12, 2026 19:45
@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from a656523 to 5e24f05 Compare June 12, 2026 19:45
@0xgleb 0xgleb force-pushed the docs/migrate-jobs-model-docs branch from 9947e4e to 9d1a600 Compare June 12, 2026 21:16
@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from 5e24f05 to 7002bce Compare June 12, 2026 21:16
@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from 7002bce to ef0e37d Compare June 12, 2026 21:55
@0xgleb 0xgleb force-pushed the docs/migrate-jobs-model-docs branch from 9d1a600 to 95a21bd Compare June 12, 2026 21:55
@graphite-app graphite-app Bot force-pushed the docs/migrate-jobs-model-docs branch from 95a21bd to 3cfa702 Compare June 15, 2026 19:30
@graphite-app graphite-app Bot force-pushed the adr/services-to-jobs-migration branch from ef0e37d to 79a8e1a Compare June 15, 2026 19:31
Comment on lines +156 to +158
request -> job -> outcome shape. The shared equity-transfer module precedes the
four aggregates that consume `EquityTransferServices`, so they don't grow four
divergent copies of the same SDK wrappers. The recoveries go last among

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text states "four aggregates that consume EquityTransferServices" but the table on lines 24-30 shows only two aggregates actually use EquityTransferServices: TokenizedEquityMint (line 27) and EquityRedemption (line 28). UnwrappedEquityRecovery uses UnwrappedEquityRecoveryServices and WrappedEquityRecovery uses WrappedEquityRecoveryServices. This count mismatch will confuse readers about which aggregates depend on the shared equity-transfer module.

# Should be changed to:
The shared equity-transfer module precedes the two aggregates that consume `EquityTransferServices`, so they don't grow divergent copies of the same SDK wrappers.
Suggested change
request -> job -> outcome shape. The shared equity-transfer module precedes the
four aggregates that consume `EquityTransferServices`, so they don't grow four
divergent copies of the same SDK wrappers. The recoveries go last among
request -> job -> outcome shape. The shared equity-transfer module precedes the
two aggregates that consume `EquityTransferServices`, so they don't grow
divergent copies of the same SDK wrappers. The recoveries go last among

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@0xgleb 0xgleb force-pushed the docs/migrate-jobs-model-docs branch from 3cfa702 to ec562c0 Compare June 26, 2026 20:28
@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from 79a8e1a to 3016cb6 Compare June 26, 2026 20:28
@0xgleb 0xgleb force-pushed the adr/services-to-jobs-migration branch from 3016cb6 to 8c7c6f7 Compare June 27, 2026 03:19
@0xgleb 0xgleb force-pushed the docs/migrate-jobs-model-docs branch from ec562c0 to 2d6d324 Compare June 27, 2026 03:19
@0xgleb 0xgleb marked this pull request as draft June 27, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants