Skip to content

[Feature] Restrict forcePublish to valid states and add pipeline stale flag for reedit #15145

@saynoword

Description

@saynoword

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:

  1. A user who re-edits a reviewed version (reedit → draft) could still forcePublish without re-triggering the pipeline, bypassing the review process.
  2. There's no way to distinguish between a "legitimately rejected draft" (legacy data, should allow forcePublish) and a "re-edited draft" (should block forcePublish).
  3. deleteDraft logic is duplicated across Skill, Prompt, and AgentSpec with minor differences.

Describe the solution you'd like

  1. 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.

  2. Pipeline stale flag: Add a Boolean stale field to PublishPipelineInfo:

    • null (legacy data): forcePublish allowed on draft
    • true (after reedit): forcePublish blocked on draft
  3. Reedit marks pipeline stale: When doReEdit transitions a reviewed version back to draft, set stale = true on the pipeline info.

  4. Unified deleteDraft: Extract common deleteDraft logic into AiResourceManager.doDeleteDraft with a VersionStorageDeleter callback for resource-type-specific storage cleanup.

  5. Frontend adaptation: Hide forcePublish button when pipeline is stale; show delete button for reviewed versions.

Module

  • ai
  • console-ui-next
  • console-ui (legacy)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions