Feature/modular bootstrapper#168
Merged
Merged
Conversation
Multiple modules calling services.AddRCommon() in the same process today produce duplicate singleton descriptors, reset internal guard flags, and silently corrupt the datastore-name registry. The fix is a cached IRCommonBuilder per IServiceCollection, sub-builder caching keyed by concrete type, and explicit conflict semantics: merge for additive verbs, throw for singleton-style verbs with different impls, eager hard-throws plus auto-warning at finalize for soft duplicates.
Corrects verb-name mismatches (WithJsonSerialization not WithSerialization, WithMemoryCaching/WithDistributedCaching not WithCaching), fixes AddProducer dedup mechanism (descriptor-scan, not TryAddSingleton which would block distinct producer types), preserves UnsupportedDataStoreException for backward compat instead of switching to RCommonBuilderException, picks a single finalize trigger (IHostedService at startup), specifies cache lookup as the primary AddRCommon dedup guard, expands modified-files list to cover all WithX verbs across the codebase (validation, CQRS, blobs, multi-tenancy, state machines, email, security), and changes the GetOrAddBuilder factory signature to parameterless so callers can close over either IServiceCollection or IRCommonBuilder as the sub-builder constructors require.
The Diagnostics section still listed dual finalize triggers (Configure() OR hosted-service), contradicting the Finalize flow section which had already committed to the hosted-service trigger alone. Replace with a back-reference to the Finalize flow.
Per CLAUDE.md's project documentation structure, specs live at
docs/specs/{domain}/{domain}.md. The brainstorming design at
docs/superpowers/specs/2026-05-15-modular-bootstrapper-design.md
remains the implementation-detail reference; this spec captures the
testable contract that the plan must satisfy.
20 bite-sized TDD tasks covering: AddRCommon idempotency, GetOrAddBuilder helper, SingletonRegistration tracker, DataStoreFactoryOptions collision detection, AddProducer dedup, WithJsonSerialization singleton semantics, per-provider routing migrations across 14 packages, finalize hosted service, and multi-module integration tests for EF Core and MediatR. Each task ends with a commit; full suite verified at the end.
- Fix Task 7 fakes: DataStoreValue requires concrete-class base, not interface; IDataStore has IAsyncDisposable + GetDbConnection so the fake must implement both. - Fix Task 8: DataStoreValue exposes ConcreteType, not ImplementationType. - Fix Task 10: EventSubscriptionManager path is under Producers/ and already uses HashSet<Type>, so list->set rework is unnecessary; only need to add HasProducerForBuilder lookup method. - Fix Task 13: drop stray Configure<JsonDeserializeOptions> that wasn't in the original file; keep scope tight. - Fix Tasks 9 and 19: complete IEventProducer test stubs with real ProduceEventAsync impls so the test files compile. - Add comment in Task 2 explaining Configure() is a no-op return.
…idempotent AddRCommon
…ch relaxed contract
…nt, different throws
…s for modular composition
…es for modular composition
…trict link checker
Regenerates the Docusaurus build output and .docusaurus cache after the modular-bootstrapper documentation pass. No source content changes — pure rebuild artifacts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Added modularity to bootstrapper.