Consume lifted JasperFx rc.2 / Weasel alpha.8 dedupe types (#4517-#4525, partial #4527)#4529
Merged
jeremydmiller merged 11 commits intoMay 20, 2026
Merged
Conversation
…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>
5 tasks
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>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Issues closed (one commit each)
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.csprojviaDirectory.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), andLinqTestsTypes(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).testing_projections.test_async_aggregation, anmt_high_water_skipsPK violation already failing on master from the Investigate StoreOptions.Events.EnableAdvancedAsyncTracking hangs in test suites #4425 EnableAdvancedAsyncTracking work — unrelated to this PR; verified independently).Refs [Master] Marten 9.0 (#4349) · pillar #214.
🤖 Generated with Claude Code