Skip to content

Adopt lifted Weasel.Core dedupe types (Hi-Lo sequence base + serialization enums) from Weasel 9.0.0-alpha.8 #137

@jeremydmiller

Description

@jeremydmiller

Follow-up to the Critter Stack 2026 dedupe pillar (JasperFx/jasperfx#214). Weasel 9.0.0-alpha.8 lifted several Marten/Polecat duplicates into Weasel.Core; Polecat should now consume them and drop its copies. Tracked under [Master] Polecat 4.0 (#46).

Published surface to adopt (Weasel 9.0.0-alpha.8):

1. Hi-Lo sequence — JasperFx/weasel#287 (weasel PR #288)

Weasel.Core.Sequences now owns the dialect-agnostic Hi-Lo pieces:

  • ISequence, IReadOnlyHiloSettings, HiloSettings
  • HiloSequenceBase : ISequence — owns CurrentHi/CurrentLo/MaxLo/EntityName state + the arithmetic (AdvanceValue, ShouldAdvanceHi, NextInt/NextLong under lock, TrySetCurrentHi). Leaves AdvanceToNextHi / AdvanceToNextHiSync / SetFloor abstract.
  • HiloSequenceAdvanceToNextHiAttemptsExceededException

Tasks:

  • Polecat.Schema.Identity.Sequences.HiloSequence derives from Weasel.Core.Sequences.HiloSequenceBase, keeping only the SQL Server I/O — the optimistic UPDATE/INSERT on pc_hilo, the EnsureHiloTable* migration, and the ResiliencePipeline wrapping — in the AdvanceToNextHi* / SetFloor overrides. (Note: the base's TrySetCurrentHi(object?) accepts the boxed long Polecat passes today.)
  • Consume Weasel.Core.Sequences.{ISequence, IReadOnlyHiloSettings, HiloSettings}; drop Polecat's local copies.
  • Throw the lifted HiloSequenceAdvanceToNextHiAttemptsExceededException; drop Polecat.Exceptions' copy.
  • No behavior change in id allocation (Weasel side has arithmetic unit tests; Polecat's hilo tests should pass unchanged).

2. Serialization option enums — JasperFx/weasel#286 (weasel PR #289)

Weasel.Core now owns Casing, CollectionStorage, NonPublicMembersStorage (verbatim, incl. the [Flags] All composition), beside the already-canonical Weasel.Core.EnumStorage.

Tasks:

  • Consume Weasel.Core.{Casing, CollectionStorage, NonPublicMembersStorage}; drop Polecat.Serialization.{Casing, CollectionStorage, NonPublicMembersStorage}.
  • Drop any redefined EnumStorage in favour of Weasel.Core.EnumStorage (per the weasel#286 note).

Refs

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions