Commit 57504cb
feat(serenity): opt-in async provisioning for createMarket, createBrandForOrg, activate (LLMO-7352/LLMO-7418)
Converts the three remaining synchronous Semrush sub-workspace/project
provisioning endpoints to an opt-in async model, gated by a per-request
`async: true` flag (mirroring the existing `createPrompts` precedent) so
default behavior is unchanged for every current consumer.
- createMarket, createBrandForOrg's initial market, and activate's
project-activation branch now mint a provisioning attempt and enqueue
provision-workspace-job -> {create-market,activate-markets}-job when
`async: true` is supplied, returning 202 with a pollable jobId.
- Business logic shared between the sync controller path and the async
job handler is extracted into create-market-orchestration.js and
activate-markets-orchestration.js.
- guardAgainstConcurrentProvisioning protects every synchronous branch
against racing a live async attempt for the same brand.
- Adds a generic /serenity/jobs/:jobId polling alias.
- Adds recordFreshBrandProvisioningStartFailure so a brand row created in
the same request is marked failed (not left silently inert) if minting
the provisioning attempt itself throws.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>1 parent 70fe12d commit 57504cb
26 files changed
Lines changed: 3805 additions & 1802 deletions
File tree
- docs/openapi
- src
- controllers
- routes
- serenity-prompt-classification
- support
- serenity/handlers
- test
- controllers
- openapi-contract
- routes
- serenity-prompt-classification
- support
- serenity/handlers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
82 | 95 | | |
83 | 96 | | |
84 | 97 | | |
| |||
104 | 117 | | |
105 | 118 | | |
106 | 119 | | |
| 120 | + | |
| 121 | + | |
107 | 122 | | |
108 | 123 | | |
109 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8068 | 8068 | | |
8069 | 8069 | | |
8070 | 8070 | | |
| 8071 | + | |
| 8072 | + | |
| 8073 | + | |
| 8074 | + | |
| 8075 | + | |
| 8076 | + | |
| 8077 | + | |
| 8078 | + | |
| 8079 | + | |
| 8080 | + | |
| 8081 | + | |
| 8082 | + | |
| 8083 | + | |
| 8084 | + | |
| 8085 | + | |
| 8086 | + | |
| 8087 | + | |
| 8088 | + | |
| 8089 | + | |
| 8090 | + | |
| 8091 | + | |
| 8092 | + | |
| 8093 | + | |
| 8094 | + | |
| 8095 | + | |
| 8096 | + | |
| 8097 | + | |
| 8098 | + | |
| 8099 | + | |
| 8100 | + | |
| 8101 | + | |
| 8102 | + | |
| 8103 | + | |
| 8104 | + | |
| 8105 | + | |
| 8106 | + | |
| 8107 | + | |
| 8108 | + | |
| 8109 | + | |
| 8110 | + | |
| 8111 | + | |
| 8112 | + | |
| 8113 | + | |
| 8114 | + | |
8071 | 8115 | | |
8072 | 8116 | | |
8073 | 8117 | | |
| |||
12178 | 12222 | | |
12179 | 12223 | | |
12180 | 12224 | | |
| 12225 | + | |
| 12226 | + | |
| 12227 | + | |
| 12228 | + | |
| 12229 | + | |
| 12230 | + | |
| 12231 | + | |
| 12232 | + | |
| 12233 | + | |
| 12234 | + | |
| 12235 | + | |
| 12236 | + | |
| 12237 | + | |
| 12238 | + | |
| 12239 | + | |
| 12240 | + | |
| 12241 | + | |
| 12242 | + | |
| 12243 | + | |
| 12244 | + | |
| 12245 | + | |
| 12246 | + | |
| 12247 | + | |
| 12248 | + | |
| 12249 | + | |
| 12250 | + | |
| 12251 | + | |
| 12252 | + | |
| 12253 | + | |
| 12254 | + | |
| 12255 | + | |
12181 | 12256 | | |
12182 | 12257 | | |
12183 | 12258 | | |
| |||
12430 | 12505 | | |
12431 | 12506 | | |
12432 | 12507 | | |
| 12508 | + | |
| 12509 | + | |
| 12510 | + | |
| 12511 | + | |
| 12512 | + | |
| 12513 | + | |
| 12514 | + | |
| 12515 | + | |
| 12516 | + | |
| 12517 | + | |
| 12518 | + | |
| 12519 | + | |
12433 | 12520 | | |
12434 | 12521 | | |
12435 | 12522 | | |
| |||
12560 | 12647 | | |
12561 | 12648 | | |
12562 | 12649 | | |
| 12650 | + | |
| 12651 | + | |
| 12652 | + | |
| 12653 | + | |
| 12654 | + | |
| 12655 | + | |
| 12656 | + | |
| 12657 | + | |
| 12658 | + | |
| 12659 | + | |
| 12660 | + | |
| 12661 | + | |
| 12662 | + | |
| 12663 | + | |
12563 | 12664 | | |
12564 | 12665 | | |
12565 | 12666 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
330 | 382 | | |
331 | 383 | | |
332 | 384 | | |
| |||
393 | 445 | | |
394 | 446 | | |
395 | 447 | | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
396 | 461 | | |
397 | 462 | | |
398 | 463 | | |
399 | 464 | | |
400 | 465 | | |
401 | | - | |
| 466 | + | |
402 | 467 | | |
403 | 468 | | |
404 | 469 | | |
| |||
915 | 980 | | |
916 | 981 | | |
917 | 982 | | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
918 | 991 | | |
919 | 992 | | |
920 | 993 | | |
| |||
929 | 1002 | | |
930 | 1003 | | |
931 | 1004 | | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
932 | 1018 | | |
933 | 1019 | | |
934 | 1020 | | |
| |||
944 | 1030 | | |
945 | 1031 | | |
946 | 1032 | | |
947 | | - | |
| 1033 | + | |
948 | 1034 | | |
949 | | - | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
950 | 1038 | | |
951 | 1039 | | |
952 | 1040 | | |
| |||
0 commit comments