Skip to content

Lift generic store-config contracts (IInitialData<TStore>, IConfigureStore<TOptions>, resilience API shape) #334

@jeremydmiller

Description

@jeremydmiller

Background

Three configuration-contract shapes are structural twins between Marten and Polecat, blocked only on a store-typed parameter → resolvable with generics. Part of the Critter Stack 2026 dedupe pillar.

What to lift (generic over the store / options type)

  1. IInitialData<TStore> — Marten src/Marten/Schema/IInitialData.cs (Task Populate(IDocumentStore, CancellationToken)) vs Polecat src/Polecat/IInitialData.cs (identical signature + a richer InitialDataCollection : List<IInitialData> with a lambda overload Marten lacks). Both activators invoke it the same way (PolecatActivator.cs:28, MartenActivator.cs:95). Lift as IInitialData<TStore>; carry Polecat's InitialDataCollection convenience.

  2. IConfigureStore<TOptions> (+ async sibling) — Marten IConfigureMarten / IAsyncConfigureMarten (MartenServiceCollectionExtensions.cs:976, void Configure(IServiceProvider, StoreOptions)) vs Polecat IConfigurePolecat (same shape). Both consumed in the AddX() factory. Lift as IConfigureStore<TOptions> + IAsyncConfigureStore<TOptions>.

  3. ConfigureResilience / ExtendResilience API shape (borderline) — Marten StoreOptions.cs:195-212 + ResilientPipelineBuilderExtensions.AddMartenDefaults vs Polecat StoreOptions.cs:202-219 + PolecatResilienceDefaults.AddPolecatDefaults. The public method bodies (new ResiliencePipelineBuilder() → configure → Build(); extend-variant prepends defaults) are structurally identical; only the default predicate set is dialect-bound (Marten handles NpgsqlException/MartenCommandException; Polecat's default is an empty stub today). Lift the API shape with a virtual ApplyDefaults hook. Honest note: borderline wash while Polecat's defaults are empty — include only if the generic-contracts work is already opening this surface.

Home: JasperFx core for items 1–2; item 3 also JasperFx core (or skip).

Acceptance

  • JasperFx.IInitialData<TStore> (+ InitialDataCollection<TStore>) added; both stores consume
  • JasperFx.IConfigureStore<TOptions> + async sibling added; both stores' AddX() factories consume
  • (Optional) shared resilience-configuration API shape with a virtual ApplyDefaults hook
  • Old store-specific interface names type-forwarded

Refs

Parent: #214 · Master: #217 (net-new finds in pass N)

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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions