Is your feature request related to a problem?
After the reviewed status was introduced (#15036), forcePublish still allows publishing from any non-online state including draft. This is problematic because:
- A user who re-edits a reviewed version (reedit → draft) could still forcePublish without re-triggering the pipeline, bypassing the review process.
- There's no way to distinguish between a "legitimately rejected draft" (legacy data, should allow forcePublish) and a "re-edited draft" (should block forcePublish).
deleteDraft logic is duplicated across Skill, Prompt, and AgentSpec with minor differences.
Describe the solution you'd like
-
ForcePublish state restriction: Only allow forcePublish on reviewed or reviewing status. For backward compatibility with legacy data, also allow on draft when pipeline is REJECTED and not marked as stale.
-
Pipeline stale flag: Add a Boolean stale field to PublishPipelineInfo:
null (legacy data): forcePublish allowed on draft
true (after reedit): forcePublish blocked on draft
-
Reedit marks pipeline stale: When doReEdit transitions a reviewed version back to draft, set stale = true on the pipeline info.
-
Unified deleteDraft: Extract common deleteDraft logic into AiResourceManager.doDeleteDraft with a VersionStorageDeleter callback for resource-type-specific storage cleanup.
-
Frontend adaptation: Hide forcePublish button when pipeline is stale; show delete button for reviewed versions.
Module
Is your feature request related to a problem?
After the
reviewedstatus was introduced (#15036),forcePublishstill allows publishing from any non-online state includingdraft. This is problematic because:deleteDraftlogic is duplicated across Skill, Prompt, and AgentSpec with minor differences.Describe the solution you'd like
ForcePublish state restriction: Only allow
forcePublishonreviewedorreviewingstatus. For backward compatibility with legacy data, also allow ondraftwhen pipeline is REJECTED and not marked as stale.Pipeline stale flag: Add a
Boolean stalefield toPublishPipelineInfo:null(legacy data): forcePublish allowed on drafttrue(after reedit): forcePublish blocked on draftReedit marks pipeline stale: When
doReEdittransitions a reviewed version back to draft, setstale = trueon the pipeline info.Unified deleteDraft: Extract common deleteDraft logic into
AiResourceManager.doDeleteDraftwith aVersionStorageDeletercallback for resource-type-specific storage cleanup.Frontend adaptation: Hide forcePublish button when pipeline is stale; show delete button for reviewed versions.
Module