feat(serenity): publish-after-populate finalize on the sub-workspace path (LLMO-5492)#2873
Open
andreeastroe96 wants to merge 1 commit into
Open
feat(serenity): publish-after-populate finalize on the sub-workspace path (LLMO-5492)#2873andreeastroe96 wants to merge 1 commit into
andreeastroe96 wants to merge 1 commit into
Conversation
…path (LLMO-5492) Re-targets the #2584 deferred-publish work onto main's sub-workspace onboarding surface (the flat-mode /llmo/onboard fan-out it was originally built against is superseded by the sub-workspace model on main). - SERENITY_DEFER_PUBLISH flag (default OFF, behavior-preserving): when ON, brand-provisioning leaves each project a draft (publishMode 'skip') for a later finalize step instead of publishing inline at create. - handlers/finalize.js finalizeSerenityProjects: push prompts (publish deferred) -> set models per slice -> publish each project once, with populate gates (noPrompts/noModels) and a bounded publish-status confirm. - handlers/publish-status.js: classifyPublishStatus + pollProjectPublished (bounded confirm; the unbounded reconcile stays the DRS/worker's job). - rest-transport getProjectStatus for the publish-completion read. - handleCreatePrompts / handleUpdateModels gain a { publish } option so the finalize step can batch a single publish (inline publish preserved by default). The DRS-completion trigger that calls finalizeSerenityProjects lives in a separate repo and is intentionally out of scope; this is the reusable mechanism it will call. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
andreeastroe96
temporarily deployed
to
dev-branches
July 21, 2026 08:45 — with
GitHub Actions
Inactive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
LLMO-5492 — publish-after-populate for Serenity projects.
This re-targets #2584 onto
main's sub-workspace onboarding surface. #2584 was built against the flat-modePOST /llmo/onboardmarkets[]fan-out, which is superseded onmain— Serenity onboarding now runs through brand-create //serenity/activate//serenity/markets(provisionBrandSubworkspace→handleCreateMarketSubworkspace), which already publishes inline after populate. The deferred-publish mechanism didn't exist onmain; this PR ports it and wires it into the sub-workspace create path.Scope
SERENITY_DEFER_PUBLISHflag (defer-publish-active.js, default OFF → behavior-preserving). When ON,provisionBrandSubworkspaceusespublishMode: 'skip'so each project is left a draft for a later finalize step. Flag OFF preserves the existingrequire/best-effortlogic byte-for-byte.handlers/finalize.js→finalizeSerenityProjects: push prompts (publish deferred) → set models per slice → publish each project once, with populate gates (noPrompts/noModels) so an empty project never goes live, and a bounded publish-status confirm within the Lambda budget.handlers/publish-status.js:classifyPublishStatus+pollProjectPublished(bounded confirm; the unbounded ≤900s reconcile stays the DRS/worker's job). Enum aligns with the existingsubworkspace-projects.jsmapPublishStatus.rest-transport.getProjectStatusfor the publish-completion read.handleCreatePrompts/handleUpdateModelsgain a{ publish }option so finalize can batch a single publish. Defaulttruekeeps the standalone-endpoint contract;syncModelsForProjectalready supported the switch.ERROR_CODES.PUBLISH_QUOTA_EXHAUSTEDfor the disguised-405 no-quota rejection (classified via main'sisMeteredQuota).Deferred / out of scope
finalizeSerenityProjectslives in a separate repo (audit-worker/DRS) — intentionally not wired here; this is the reusable mechanism it will call.rest-transport.getProjectStatuscurrently passesquery: { draft: 'false', type: 'ai' }(mirroring the existinggetProject). #2584's design note calls for the v1 default view to read a never-published draft'spublish_statusfaithfully, and warns the live view can distort it.getProjectdefaults todraft: true. Please confirm the correctdraftvalue against the Semrush project-read semantics before merge — this is the one behavior I couldn't verify from the code alone.Tests
New/extended unit tests (all green; lint +
type-checkgates pass):finalize.test.js(12),publish-status.test.js(13), plus{ publish: false }cases forhandleCreatePrompts/handleUpdateModels,getProjectStatustransport, andPUBLISH_QUOTA_EXHAUSTED. Full serenity unit suite: 1028 passing.🤖 Generated with Claude Code