Skip to content

Prefactor: extract Validation Core from CalendarCore #26

Description

@bart-krakowski

Parent

#25

What to build

Extract the availability, dependency-propagation, and recurrence validation logic currently fused into `CalendarCore` into pure, isomorphic functions with the signature `validate(write, events, config) → conflicts`. These functions must have zero dependencies on the store, viewport, DOM, or any database.

This is the mandatory first step before any modularization can happen. It is a pure refactor — no new behavior, no public API changes. The existing `CalendarCore` continues to call these functions internally; callers see no difference.

The extraction creates the seam that makes the following possible:

  • the module-stage pipeline (both client and server can run the same stages)
  • the `loadEvents` adapter in the server package
  • the client/server Data Strategy

Acceptance criteria

  • Availability conflict detection, dependency-constraint checking (FS/SS/FF/SF), and recurrence validation each exist as standalone pure functions importable independently of `CalendarCore`
  • Each function accepts plain event objects and config; returns a conflicts/errors array; has no side effects
  • `CalendarCore` delegates to these functions internally — all existing tests continue to pass unchanged
  • No `Temporal` objects, store references, or DOM references appear in the extracted functions' signatures
  • Unit tests cover the extracted functions directly (not through `CalendarCore`)

Blocked by

None — can start immediately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions