Article Publish and Sync Procedure¶
Purpose¶
This procedure defines how article-domain cleanup work is turned into persisted CMS state through the BFF.
It is the operational companion to CMS Persistence Workflow.
Scope¶
This procedure applies to:
- article objects
- article collections
- collection membership updates
Preconditions¶
Before publish or sync:
- the local article or collection artifact has been cleaned and reviewed
- slugs and keys are stable enough for persistence
- referenced media URLs are valid
- collection membership targets exist or are being created in the same publish cycle
Publish Decision¶
For each changed article-domain artifact, decide:
createif there is no corresponding BFF object yetupdateif the BFF object already existsmembership-syncif the collection exists but members changed
The assistant should first query BFF for current state.
Article Object Procedure¶
- Read the local source from
docs/articles/<slug>.md. - Extract identity, content, media, taxonomy, and author fields.
- Query BFF using
getArticle(slug)orgetArticleById(articleKey). - Validate before write:
- slug uniqueness
- required fields present
- hero image fields present
- category and tag shape valid
- Persist:
createArticle(input)if missingupdateArticle(articleKey, input)if present- Re-read from BFF and verify key, slug, title, and updated fields.
Article Collection Procedure¶
- Read the local source from
docs/articles/collections/<collection>.yaml. - Extract collection identity, description, media, and member slugs.
- Resolve member articles to actual BFF article identities.
- Query BFF using
getArticleCollection(collectionKey)or listing. - Persist collection object:
createArticleCollection(input)if missingupdateArticleCollection(collectionKey, input)if present- Sync membership:
addArticlesToCollectionremoveArticlesFromCollectionreplaceArticlesInCollection- Re-read the collection and verify metadata and member set.
Safe Publish Rule¶
Do not persist on ambiguous identity.
Examples:
- two plausible target articles with conflicting keys
- uncertain whether a collection key is new or renamed
- local artifact references articles not yet present in BFF
Resolve the ambiguity before write.
Transition Rule¶
Current scaffolding may still read local article artifacts directly.
That does not remove the publish obligation.
During transition, local files are:
- staging input for scaffold compatibility
- staging input for BFF/CMS persistence
not the terminal state of cleanup work.