Skip to content

feat(options): add Compono.Options for IOptions/IOptionsSnapshot/IOptionsMonitor testing - #135

Merged
ncipollina merged 1 commit into
mainfrom
feat/compono-options
Sep 8, 2026
Merged

feat(options): add Compono.Options for IOptions/IOptionsSnapshot/IOptionsMonitor testing#135
ncipollina merged 1 commit into
mainfrom
feat/compono-options

Conversation

@ncipollina

Copy link
Copy Markdown
Contributor

Summary

  • Adds Compono.OptionsTestOptionsSource<T> + CompositionBuilder.UseOptions<T>() give one coherent, test-configured source of truth for IOptions<T>/IOptionsSnapshot<T>/IOptionsMonitor<T>, replacing a hand-rolled IOptionsMonitor<T> fake (the community's own standard answer has documented bugs — broken named options, single-subscriber OnChange, a no-op IDisposable) and hand-wired, drift-prone multi-interface registrations.
  • Ships TestOptionsSource<T>, an internal FrozenOptionsView<T>, UseOptions<T>, and UnconfiguredNamedOptionException — reflection-free, no generator dependency, no new core extension point.
  • New Configuration Cookbook (3 recipes) covers plain IConfiguration composition independently — there is no Compono.Configuration package.
  • docs/architecture/capability-admission.md consolidates the previously-scattered ADR-0029/ADR-0039 admission model into one standalone process doc, with a composition-ergonomics clarification grounded in existing precedent (Share<T>(), Compono.Bogus).
  • ADR-0061 (Accepted, plus an Amendment recording two documentation corrections found during final review — see below) and PLAN-0064 (Done) carry the full design/execution record; RESEARCH-0028 is the admission investigation that grounded it.

Test plan

  • Compono.Options.Tests — 160 tests across net8.0/9.0/10.0/11.0: full IOptions/IOptionsSnapshot/IOptionsMonitor interface contract, the central coherence test, registration/precedence, disposal, concurrency, diagnostics.
  • Compono.Options.AotSmokeTest — real PublishAot, zero IL2xxx/IL3xxx warnings, exercises the full public surface under real packaged consumption.
  • .github/scripts/inspect-packed-nupkgs.sh (extended with a Compono.Options case) — packed .nupkg contents, dependency ranges, and metadata all pass.
  • Full solution build/test green (dotnet build/dotnet test on Compono.slnx).
  • Real-consumer dogfooding via scripts/dogfood-validate.sh against alexa-vox-craft (isolated worktree, never committed against the real repo): full solution, 2564/2564 tests passed against a freshly-packed local Compono.Options.
  • Baseline-vs-updated skills/compono eval comparison (evals 53-55): no regressions — baseline correctly declined (no hallucination), updated skill answered all three correctly.
  • Independent final correctness/design-consistency review pass against ADR-0061 — found and corrected two documentation-only defects (see ADR-0061 Amendment 1): a stale "first-registration-wins" claim (real behavior is a strict CompositionConfigurationException on duplicate registration) and an overstated coherence claim between the bare settings type and the Options interfaces. No code changes resulted; re-verified 160/160 green after the doc fixes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NiVv392P3m46azTD1TpU3s

…hot/IOptionsMonitor testing

TestOptionsSource<T> + UseOptions<T>() gives one coherent, test-configured
source of truth for IOptions<T>/IOptionsSnapshot<T>/IOptionsMonitor<T>,
replacing a hand-rolled IOptionsMonitor<T> fake (community's own standard
answer has documented bugs: broken named options, single-subscriber
OnChange, no-op IDisposable) and hand-wired, drift-prone multi-interface
registrations.

- src/Compono.Options: TestOptionsSource<T>, internal FrozenOptionsView<T>,
  UseOptions<T> builder extension, UnconfiguredNamedOptionException.
- test/Compono.Options.Tests: 160 tests (4 TFMs) covering the full
  interface contract, coherence, registration/precedence, disposal,
  concurrency, diagnostics.
- test/Compono.Options.AotSmokeTest: real PublishAot proof, zero
  IL2xxx/IL3xxx warnings.
- docs/packages/compono-options.md, Configuration Cookbook (3 recipes),
  skills/compono/references/options.md, evals.json scenarios 53-55,
  mandatory baseline-vs-updated skill-eval comparison (no regressions).
- ADR-0061 (Accepted) + Amendment 1 (registration-precedence and
  coherence-scope corrections found during final review), PLAN-0064
  (Done), RESEARCH-0028 (admission investigation).
- docs/architecture/capability-admission.md: new standalone capability
  admission process doc consolidating the existing but scattered
  ADR-0029/ADR-0039 admission model, with a composition-ergonomics
  clarification (Share<T>()/Compono.Bogus precedent).
- Validated end-to-end against real alexa-vox-craft consumer via
  scripts/dogfood-validate.sh: full solution, 2564/2564 tests passed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiVv392P3m46azTD1TpU3s
@github-actions github-actions Bot added the type: feat New feature label Sep 8, 2026
@ncipollina
ncipollina merged commit b7ae998 into main Sep 8, 2026
19 of 20 checks passed
@ncipollina
ncipollina deleted the feat/compono-options branch September 8, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feat New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant