FIX [CONTENT] Prevent FS sync from overwriting admin-edited content 🧿#19
Merged
AdaInTheLab merged 1 commit intomainfrom Jan 10, 2026
Merged
FIX [CONTENT] Prevent FS sync from overwriting admin-edited content 🧿#19AdaInTheLab merged 1 commit intomainfrom
AdaInTheLab merged 1 commit intomainfrom
Conversation
- Guard pointer updates when current revision source is 'web' - Allow force sync to explicitly override protection - Handle force pointer advance even when content is unchanged - Track protected admin drafts and forced pointer updates for visibility co-authored-by: Lyric <lyric@thehumanpatternlab.com> co-authored-by: Carmel <carmel@thehumanpatternlab.com>
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.
🧿 Prevent FS Sync from Overwriting Admin-Edited Notes
This PR hardens the Lab Notes sync pipeline so filesystem imports never silently overwrite admin-authored content, while still allowing explicit overrides when intended.
✨ What Changed
Ownership-aware sync
import) and admin UI (web) as distinct truth channelsSafe by default
source='web'), FS sync:current_revision_idorpublished_revision_idExplicit override
forceoption to sync:POST /admin/notes/sync?force=1Visibility
pointersSkippedProtectedpointersForcedslug,locale,reason)🔒 Guard Logic (Summary)
Pointer updates are allowed only if:
force === true, orimportOtherwise, admin-owned revisions are protected.
🧪 Tests
Added coverage to assert:
web) revisions are not overwritten by FS sync🧠 Why This Matters
This change prevents a subtle but high-impact failure mode where:
The result is a clear, intentional content model:
📌 No Schema Changes
This PR is backend-only and uses existing fields (
lab_note_revisions.source) to enforce correctness.co-authored-by: Lyric lyric@thehumanpatternlab.com
co-authored-by: Carmel carmel@thehumanpatternlab.com