Architecture Decision
The “Overwrite” Risk in Sugartown CMS
I had a realization today while trying to manually edit a post in WordPress: The Pipeline is a Bully.
In a typical “Push” architecture (Python -> WordPress), the script is the Source of Truth. If I manually add a witty joke or a custom image inside the WordPress Editor, the next time I run my Python script, it will blow those changes away because it performs a PUT (Replace) operation, not a PATCH (Merge) operation.
The Strategy: Hybrid Content Management
To solve this, I am evaluating two patterns for “Safe Updates”:
- The “Protected Block” Pattern: Using HTML comments (e.g.,
<!-- manual-start -->) to mark zones that the script ignores. - The “Read-Merge-Write” Pattern: The script must first GET the current content, diff it against the new payload, and intelligently merge them before pushing back.
Current Verdict: I have moved this feature to the Backlog. For now, the Python script owns the “Structured Data” (Tables, Lists), and I will manually sync content if needed.