refactor(core): split note content planning by state - #1229
Merged
Conversation
Signed-off-by: phernandez <paul@basicmachines.co>
This was referenced Aug 11, 2026
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.
Phase 1 of #1205 (Constructive Domain Modeling tracker).
Makes the note-content planner's contract visible to the type checker instead of enforcing
it at runtime:
plan_note_content_reconciliation(current: NoteContentState | None, ...)is split intobootstrap_note_content_plan(*, observed) -> NoteContentBootstrap(the only Bootstrapconstruction) and
plan_existing_note_content_reconciliation(*, current, observed) -> ExistingNoteContentReconciliationPlan(a closed union excluding Bootstrap).NoteContentReconciler.reconcile("missing note_content mustbootstrap" / "existing note_content cannot bootstrap") are deleted — the split signatures
prove both properties statically, and after the existing Deferred check the plan type
narrows into
NoteContentUpdatePlanforapply_note_content_update_planwith noisinstance needed. No test asserted either guard.
untouched. Two named functions rather than
@overload, matching house style and theexisting narrowed-alias pattern (
NoteContentUpdatePlan,NoteMaterializationPublishUpdate).Verification: planner/reconciler/batch suites 31 passed;
just typecheck(ty, rulesall=error) and
just lintclean.Phase 1 checklist on #1205 can be ticked when this merges.
🤖 Generated with Claude Code
https://claude.ai/code/session_01CPdSXDbYyhyZ1TwgFnpEv8