Skip to content

refactor(core): split note content planning by state - #1229

Merged
phernandez merged 1 commit into
mainfrom
refactor/1205-split-note-content-planning
Aug 11, 2026
Merged

refactor(core): split note content planning by state#1229
phernandez merged 1 commit into
mainfrom
refactor/1205-split-note-content-planning

Conversation

@phernandez

Copy link
Copy Markdown
Member

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 into
    bootstrap_note_content_plan(*, observed) -> NoteContentBootstrap (the only Bootstrap
    construction) and plan_existing_note_content_reconciliation(*, current, observed) -> ExistingNoteContentReconciliationPlan (a closed union excluding Bootstrap).
  • The two runtime guards in NoteContentReconciler.reconcile ("missing note_content must
    bootstrap" / "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 NoteContentUpdatePlan for apply_note_content_update_plan with no
    isinstance needed. No test asserted either guard.
  • Behavior-preserving: the concurrent-insert IntegrityError path and all result mapping are
    untouched. Two named functions rather than @overload, matching house style and the
    existing narrowed-alias pattern (NoteContentUpdatePlan,
    NoteMaterializationPublishUpdate).

Verification: planner/reconciler/batch suites 31 passed; just typecheck (ty, rules
all=error) and just lint clean.

Phase 1 checklist on #1205 can be ticked when this merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CPdSXDbYyhyZ1TwgFnpEv8

Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez
phernandez merged commit fba8228 into main Aug 11, 2026
25 checks passed
@phernandez
phernandez deleted the refactor/1205-split-note-content-planning branch August 11, 2026 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant