Skip to content

feat(nsubstitute): milestone 5 phase 1 - Compono.NSubstitute package - #29

Merged
ncipollina merged 3 commits into
mainfrom
feat/milestone-5-phase-1-nsubstitute-package
Jul 31, 2026
Merged

feat(nsubstitute): milestone 5 phase 1 - Compono.NSubstitute package#29
ncipollina merged 3 commits into
mainfrom
feat/milestone-5-phase-1-nsubstitute-package

Conversation

@ncipollina

Copy link
Copy Markdown
Contributor

Summary

Implements Milestone 5 Phase 1: the Compono.NSubstitute package itself, per ADR-0025 (Amendment 1's corrected shapes). Phase 0's core ICompositionValueProvider extensibility mechanism (ADR-0024) already merged in #28 — this phase is the first real consumer of it.

Changes

  • New src/Compono.NSubstitute project: NSubstituteProvider (interface / delegate / optional unsealed-abstract-class substitution via Substitute.For(Type[], object[])), NSubstituteOptions (SubstituteAbstractClasses, default true), and CompositionBuilderExtensions.UseNSubstitute()/UseNSubstitute(configure).
  • NSubstituteProvider snapshots NSubstituteOptions.SubstituteAbstractClasses into a private readonly bool at construction rather than retaining the mutable options instance, and delegate matching uses IsSubclassOf(typeof(MulticastDelegate)) rather than typeof(Delegate).IsAssignableFrom(...) — both per ADR-0025 Amendment 1, catching a pre-implementation review finding before any code shipped.
  • Compono.NSubstitute.csproj mirrors Compono.XunitV3.csproj's shape (net10.0;net11.0, ProjectReference to Compono with PrivateAssets="none" so Compono.Generators's analyzer asset flows to consumers, PackageReference to NSubstitute).
  • Added to Compono.slnx; docs/plans/0005-milestone-5-nsubstitute-integration.md Phase 1 marked Done.
  • Also shortened the PrivateAssets="none" comment on Compono.XunitV3.csproj's Compono reference — the original wording implied all transitive dependencies would otherwise disappear rather than specifically the analyzer asset.

Validation

  • dotnet build on the whole solution (Compono.slnx): 0 warnings, 0 errors.
  • No test project yet — test/Compono.NSubstitute.Tests is Phase 2 of PLAN-0005, tracked separately and not part of this PR's scope.

Related Issues

Part of PLAN-0005, implementing ADR-0025.

ncipollina and others added 2 commits July 31, 2026 14:57
NSubstituteProvider/NSubstituteOptions/UseNSubstitute per ADR-0025
(Amendment 1's corrected snapshot/delegate-matching shapes). Tests
(Phase 2) and docs (Phase 3) tracked separately in PLAN-0005.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Trim wording that implied all transitive dependencies would otherwise
disappear - it's specifically the analyzer asset that needs to flow through.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the feat label Jul 31, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd47a90118

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

### Phase 1: `Compono.NSubstitute` package (ADR-0025)

**Status:** Not Started
**Status:** Done

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the shipped-state docs in this phase

Marking Phase 1 done while leaving docs/public-api.md:425-427 and docs/mvp.md:270-276 saying that Compono.NSubstitute is “not yet implemented” makes the API and roadmap documentation contradict the packable project and public entry points added by this commit. This affects readers immediately after the change lands, even if verification remains pending in Phase 2; update those statements to distinguish implemented package code from pending tests rather than deferring the correction to Phase 3.

AGENTS.md reference: AGENTS.md:L156-L157

Useful? React with 👍 / 👎.

…nted

docs/public-api.md and docs/mvp.md still said the package was "not yet
implemented" after this phase's code landed - pulled the correction
forward into this PR rather than deferring to Phase 3, per Codex review
and matching the same fix pattern PR #28 established for Phase 0.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@ncipollina
ncipollina merged commit 4c664a0 into main Jul 31, 2026
7 checks passed
@ncipollina
ncipollina deleted the feat/milestone-5-phase-1-nsubstitute-package branch July 31, 2026 19:09
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