feat(options): add Compono.Options for IOptions/IOptionsSnapshot/IOptionsMonitor testing - #135
Merged
Merged
Conversation
…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
2 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.
Summary
Compono.Options—TestOptionsSource<T>+CompositionBuilder.UseOptions<T>()give one coherent, test-configured source of truth forIOptions<T>/IOptionsSnapshot<T>/IOptionsMonitor<T>, replacing a hand-rolledIOptionsMonitor<T>fake (the community's own standard answer has documented bugs — broken named options, single-subscriberOnChange, a no-opIDisposable) and hand-wired, drift-prone multi-interface registrations.TestOptionsSource<T>, an internalFrozenOptionsView<T>,UseOptions<T>, andUnconfiguredNamedOptionException— reflection-free, no generator dependency, no new core extension point.IConfigurationcomposition independently — there is noCompono.Configurationpackage.docs/architecture/capability-admission.mdconsolidates 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).Test plan
Compono.Options.Tests— 160 tests across net8.0/9.0/10.0/11.0: fullIOptions/IOptionsSnapshot/IOptionsMonitorinterface contract, the central coherence test, registration/precedence, disposal, concurrency, diagnostics.Compono.Options.AotSmokeTest— realPublishAot, zeroIL2xxx/IL3xxxwarnings, exercises the full public surface under real packaged consumption..github/scripts/inspect-packed-nupkgs.sh(extended with aCompono.Optionscase) — packed.nupkgcontents, dependency ranges, and metadata all pass.dotnet build/dotnet testonCompono.slnx).scripts/dogfood-validate.shagainstalexa-vox-craft(isolated worktree, never committed against the real repo): full solution, 2564/2564 tests passed against a freshly-packed localCompono.Options.skills/componoeval comparison (evals 53-55): no regressions — baseline correctly declined (no hallucination), updated skill answered all three correctly.CompositionConfigurationExceptionon 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