Skip to content

Consume lifted JasperFx rc.2 / Weasel alpha.8 dedupe types (#4517-#4525, partial #4527)#4529

Merged
jeremydmiller merged 11 commits into
masterfrom
feat/dedupe-consume-jasperfx-weasel-cycle
May 20, 2026
Merged

Consume lifted JasperFx rc.2 / Weasel alpha.8 dedupe types (#4517-#4525, partial #4527)#4529
jeremydmiller merged 11 commits into
masterfrom
feat/dedupe-consume-jasperfx-weasel-cycle

Conversation

@jeremydmiller
Copy link
Copy Markdown
Member

Foundation bump + the Critter Stack 2026 dedupe pillar (#214) consume cycle. Each issue is a separate commit; the final tree builds clean across net9/net10.

Foundation

  • JasperFx / JasperFx.Events / SourceGenerator / SourceGeneration → 2.0.0-rc.2
  • Weasel.Postgresql / Weasel.Core / Weasel.EntityFrameworkCore → 9.0.0-alpha.8

Issues closed (one commit each)

Issue Lifted type(s) Approach
#4517 TenancyStyle, DeleteStyle delete + alias
#4519 SkippedEventsCountObserver, ResilientEventLoader, EventLoaderException delete + consume (3-arg loader ctor)
#4520 ISoftDeleted, IVersioned, ITracked delete + alias
#4521 IPatchExpression<T>, RemoveAction consume (generic can't alias) + RemoveAction alias
#4523 IDocumentSchemaResolver delete + alias (StoreOptions still implements)
#4522 OpenTelemetryOptions base, TrackLevel derive from base + alias TrackLevel
#4518 DcbConcurrencyException delete + alias; ProgressionProgressOutOfOrderException already shared
#4525 IdentityAttribute, DocumentIdentity.FindIdMember delete + alias; reroute FindIdMember to the verbatim-identical shared helper
#4524 IInitialData<TStore>, IConfigureStore/IAsyncConfigureStore re-base Marten interfaces on the generics by inheritance

Centralized aliases

Rather than duplicate alias blocks across ~12 GlobalUsings.cs, the dedupe-pillar global-using aliases now live in src/Shared/DedupeAliases.cs, linked into every JasperFx-referencing .csproj via Directory.Build.props. (ImplicitUsings is off repo-wide, so MSBuild <Using> items don't apply — a linked C# global-using file is used.) F# projects, netstandard2.0 (the source generator), and LinqTestsTypes (base-JasperFx only) are excluded; the redundant per-project alias blocks were removed.

Partial: #4527

Weasel alpha.8's serialization enums (Casing, NonPublicMembersStorage) are consumed here (forced by the bump). The behavior-sensitive Hi-Lo sequence base refactor (HiloSequenceBase) is deferred to a focused follow-up PR.

Deferred to a follow-up PR (per maintainer)

The behavior-sensitive refactors: #4516 (ProjectionCoordinator → ProjectionCoordinatorBase), #4527 Hi-Lo base, #4526/#4528 (IRevisioned int-revert + ILongVersioned).

Verification

  • dotnet build src/Marten.slnx -c Release — 0 errors (net9 + net10).
  • CoreTests — 412 passed / 1 skipped.
  • DocumentDbTests (Metadata / Deleting / Identity / Internals) — 260 passed / 1 skipped.
  • EventSourcingTests.Dcb — 110 passed / 2 skipped.
  • EventSourcingTests.Projections — 131 passed, 1 pre-existing failure (testing_projections.test_async_aggregation, an mt_high_water_skips PK violation already failing on master from the Investigate StoreOptions.Events.EnableAdvancedAsyncTracking hangs in test suites #4425 EnableAdvancedAsyncTracking work — unrelated to this PR; verified independently).
  • Full CI matrix.

Refs [Master] Marten 9.0 (#4349) · pillar #214.

🤖 Generated with Claude Code

jeremydmiller and others added 11 commits May 20, 2026 09:02
…e cycle

Foundation bump for the Critter Stack 2026 dedupe pillar (#214)
consume work. JasperFx / JasperFx.Events / SourceGenerator / SourceGeneration
-> 2.0.0-rc.2; Weasel.Postgresql / Weasel.Core / Weasel.EntityFrameworkCore
-> 9.0.0-alpha.8.

These rc/alpha packages lift a batch of types Marten previously forked
(TenancyStyle, DeleteStyle, metadata markers, IPatchExpression, the
projection-coordinator base, Hi-Lo sequence base, exceptions, etc). This
commit only moves the pins; the following commits consume each lifted type
and type-forward the old Marten names. The tree does not build green until
that consume sequence lands (the lifted types collide with Marten's copies
until each is resolved).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
#327 lifted TenancyStyle -> JasperFx.MultiTenancy.TenancyStyle and
DeleteStyle -> JasperFx.DeleteStyle (ordinals unchanged: Single=0/Conjoined=1,
Remove=0/SoftDelete=1). Delete Marten's byte-identical copies and alias the old
names via global using, matching the OperationRole / SnapshotLifecycle pattern
already in GlobalUsings.cs. Fixed the two fully-qualified Storage.TenancyStyle
references + one xmldoc cref.

Closes #4517.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
#329 lifted SkippedEventsCountObserver, ResilientEventLoader, and
EventLoaderException into JasperFx.Events.Daemon. Delete Marten's copies and
consume the lifted versions:

- MartenDatabase subscribes the lifted SkippedEventsCountObserver (Marten's HWM
  guard was the one kept upstream — behavior identical).
- BuildEventLoader constructs the lifted ResilientEventLoader with its new
  3-arg ctor (ResiliencePipeline, IEventLoader inner, IEventDatabase database),
  passing the shard database.
- EventLoaderException now resolves to the lifted type (base changed
  MartenException -> Exception); the only catch site is the Polly
  .Handle<EventLoaderException>() in ResilientPipelineBuilderExtensions, which
  now imports JasperFx.Events.Daemon. Nothing catches it as MartenException.

Marten core builds clean. Closes #4519.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ned/ITracked)

#330 lifted ISoftDeleted, IVersioned, ITracked into JasperFx.Metadata
(ITracked carries Marten's exact non-nullable string shape). Delete Marten's
byte-identical copies and alias the old names via global using, matching the
TenancyStyle / DeleteStyle pattern. Marten's marker detection
(CanBeCastTo<ISoftDeleted>, `entity is ISoftDeleted`, the metadata policies)
now binds the single canonical JasperFx type, so document detection is
unchanged. IRevisioned is intentionally excluded (int-vs-long, handled under
#4526/#4528).

Closes #4520.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
#331 lifted IPatchExpression<T> (Marten's canonical superset, verbatim)
and RemoveAction into JasperFx.Events. Delete Marten's copies; PatchExpression<T>
and the Patch<T>() extensions now implement/return the lifted interface
(import JasperFx.Events). RemoveAction (enum) is aliased via global using; the
open-generic IPatchExpression<T> cannot be aliased so the two consumer files
import the namespace directly. The self-returning fluent shape rules out a thin
derived-interface shim (implicit interface impl needs exact return-type match),
so this is a true consume.

Closes #4521.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
#333 lifted IDocumentSchemaResolver to JasperFx.Events (contract
verbatim from Marten's — all 7 members identical). Delete Marten's copy and
alias the old name via global using; StoreOptions still implements it (its
explicit interface implementations bind through the alias), and
IReadOnlyStoreOptions.Schema keeps its return type.

Closes #4523.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
#332 lifted the common OpenTelemetryOptions base + TrackLevel to
JasperFx.OpenTelemetry. Marten.Services.OpenTelemetryOptions now derives from
JasperFx.OpenTelemetry.OpenTelemetryOptions via : base("Marten"), dropping the
duplicated TrackConnections + Meter (now inherited) while keeping the
changeset-metrics members (Applications, ExportCounterOnChangeSets,
TrackEventCounters, MartenCommitMetrics) which use the inherited Meter. The
name is unchanged so no type-forward is needed. TrackLevel is aliased via
global using.

Closes #4522.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ases

#328 lifted DcbConcurrencyException (now : JasperFx.ConcurrencyException)
into JasperFx.Events. Delete Marten's copy; AssertDcbConsistency binds the
lifted type (it already imports JasperFx.Events). ProgressionProgressOutOfOrder
Exception was already the shared type (Marten used the ShardName ctor) — no
change.

Because propagating all the dedupe type-forwards (TenancyStyle, DeleteStyle,
metadata markers, RemoveAction, IDocumentSchemaResolver, TrackLevel,
DcbConcurrencyException, IStorageOperation, OperationRole, SnapshotLifecycle)
across Marten's test/extension projects would otherwise duplicate alias blocks
in many GlobalUsings.cs files, centralize them in src/Shared/DedupeAliases.cs,
linked into every JasperFx-referencing .csproj via Directory.Build.props
(ImplicitUsings is off repo-wide, so MSBuild <Using> items don't apply — a
linked C# global-using file is used). Removed the now-redundant per-project
GlobalUsings alias blocks; F#/netstandard2.0/LinqTestsTypes (base-JasperFx only)
are excluded.

Closes #4518.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…d IdentityAttribute

#335 lifted JasperFx.IdentityAttribute + a side-effect-free
JasperFx.DocumentIdentity.FindIdMember(Type, Func<Type,bool>). Delete Marten's
empty MartenAttribute marker IdentityAttribute and alias the old name; it was
only consumed via HasAttribute<IdentityAttribute>() (the MartenAttribute
pipeline called a no-op Modify on it, so dropping the base changes nothing).

DocumentMapping.FindIdMember now delegates to the lifted helper, passing
Marten's own IsValidIdentityType predicate (which also recognizes strong-typed
ids + F# DUs). The lifted traversal + GetProperties are byte-identical to
Marten's prior implementation, so ID resolution behavior is unchanged; the now-
dead private GetProperties helper is removed. Fixed three tests that used the
fully-qualified Marten.Storage.TenancyStyle (now aliased).

Closes #4525.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ng, NonPublicMembersStorage)

Weasel 9.0.0-alpha.8 lifted the Casing and NonPublicMembersStorage enums into
Weasel.Core (weasel#287). Delete Marten's byte-identical copies from
ISerializer.cs and alias the old names in the shared dedupe file. Members are
unchanged (Default/CamelCase/SnakeCase; the [Flags] non-public storage set).

This is the forced serialization-enum subset of #4527 (the bump won't compile
without it). The Hi-Lo sequence base refactor (HiloSequenceBase) — the
behavior-sensitive remainder of #4527 — is deferred to the follow-up PR with
#4516 and #4526/#4528.

Refs #4527.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…erFx generics

#334 lifted IInitialData<TStore>, IConfigureStore<TOptions>, and
IAsyncConfigureStore<TOptions> to JasperFx core. Re-base Marten's interfaces on
the generic contracts by inheritance (preserving the names and every existing
implementer, rather than deleting):

- Marten.Schema.IInitialData : JasperFx.IInitialData<IDocumentStore>
  (Populate(IDocumentStore, CancellationToken) is the closed generic member;
  MartenActivator + existing seed-data impls unchanged).
- IConfigureMarten : JasperFx.IConfigureStore<StoreOptions>
  (Configure(IServiceProvider, StoreOptions) inherited).
- IAsyncConfigureMarten : JasperFx.IAsyncConfigureStore<StoreOptions>
  (Configure(StoreOptions, CancellationToken) inherited).
- IConfigureMarten<T> keeps its marker role (transitively : IConfigureStore<StoreOptions>).

The AddMarten() factory's IConfigureMarten discovery binds the inherited
Configure unchanged; full solution builds clean across net9/net10.

Closes #4524.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@jeremydmiller jeremydmiller merged commit 857fb27 into master May 20, 2026
6 checks passed
@jeremydmiller jeremydmiller deleted the feat/dedupe-consume-jasperfx-weasel-cycle branch May 20, 2026 15:37
jeremydmiller added a commit that referenced this pull request May 20, 2026
#4527) (#4532)

* #4516: reduce ProjectionCoordinator to a ProjectionCoordinatorBase subclass

#326 lifted the projection-coordinator execute loop + agent-start
resilience + lifecycle (Start/Pause/Resume/Stop) into
JasperFx.Events.Daemon.ProjectionCoordinatorBase. Reduce Marten's coordinator to
a subclass:

- Supply via the base ctor: BuildDistributor(store), the store's
  ResiliencePipeline, Events.TimeProvider, and the three settings
  (LeadershipPollingTime as a TimeSpan, AgentPauseTime, HealthCheckPollingTime).
- Implement the seams: ResolveDaemon (keeps Marten's ImHashMap +
  double-checked-lock daemon cache) and ResolvedDaemons; keep the existing
  DaemonForMainDatabase / DaemonForDatabase / AllDaemonsAsync.
- Delete the lifted-into-base members: executeAsync, start/stopAgentsIfNecessary,
  tryStartAgent, the Start/Pause/Resume/Stop bodies, pauseDistributor, and the
  DaemonShardName record. Behavior is unchanged (the base adopted Marten's
  resilient agent-start + single-cancellation lifecycle verbatim).

DaemonTests 185/0; HotCold leadership-election tests (detect_high_water_mark,
end_to_end_with_events_already_published) pass.

Closes #4516.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* #4527: derive HiloSequence from Weasel.Core.Sequences.HiloSequenceBase

Completes #4527 (the serialization-enum subset landed in #4529). weasel#287
lifted the dialect-agnostic Hi-Lo pieces into Weasel.Core.Sequences:
HiloSequenceBase (state + arithmetic), ISequence, IReadOnlyHiloSettings,
HiloSettings, and HiloSequenceAdvanceToNextHiAttemptsExceededException.

- Marten's HiloSequence now derives from HiloSequenceBase, keeping only the
  PostgreSQL I/O (mt_get_next_hi stored function in AdvanceToNextHi/Sync, the
  mt_hilo floor update in SetFloor). The client-side arithmetic
  (AdvanceValue/ShouldAdvanceHi/NextInt/NextLong/TrySetCurrentHi/hi-lo state) is
  inherited verbatim — id allocation is unchanged.
- Delete Marten's ISequence / IReadOnlyHiloSettings / HiloSettings /
  HiloSequenceAdvanceToNextHiAttemptsExceededException copies and alias the old
  names via the shared dedupe file (shapes identical; the exception's base
  changed MartenException -> Exception but nothing catches it as MartenException).
- AdvanceToNextHiSync is protected on the base; the one test that drove it
  directly now invokes it reflectively to keep exercising the sync I/O path.

Hi-Lo + sequence-id tests pass (32/0).

Closes #4527.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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