Name Any's boolean factory Boolean, not Bool - #276
Merged
Conversation
Record the decision the 2026-07-20 Dummies architecture audit surfaced (section 8.2): every parameterless scalar factory on Any and AnyContext, and the builder it returns, is named after the CLR name of the type it produces, with no exception. Accepted by the maintainer. Numbered 0031 because ADR-0030 was taken by the terminal String().OneOf decision. Refs: #222 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019XoisyHa8b5UpezV7QV4Jd
The scalar factories are named after the CLR type they produce (Int32, Single, ...), which is also their builder's name; Bool()/AnyBool was the sole deviation from that rule, since the CLR name of bool is Boolean. Rename it to Boolean()/AnyBoolean so the convention holds without exception, while the library is still pre-release and the rename costs nothing. Implements ADR-0031. Refs: #222 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019XoisyHa8b5UpezV7QV4Jd
Assert by reflection that every parameterless scalar factory on Any is
named after the CLR type it produces, that its builder is Any{ClrType},
and that AnyContext mirrors it. The rule is derived from the surface, so
no allow-list can drift; it fails on any future keyword-short name (a
second Bool) that ADR-0031 forbids.
Refs: #222
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019XoisyHa8b5UpezV7QV4Jd
Reefact
force-pushed
the
claude/issue-222-discussion-9ay73w
branch
from
July 21, 2026 19:55
dcf469b to
0cdfe3c
Compare
Reefact
enabled auto-merge
July 21, 2026 20:03
Merging main brought in SurfaceParityTests (the audit's mirror + algebra parity guard, #214), which hard-codes typeof(AnyBool) — stale after this branch renamed the builder to AnyBoolean, so the test project stopped compiling. Point it at AnyBoolean, and drop the now-redundant mirror method from FactoryNamingConventionTests: SurfaceParityTests guards the Any<->AnyContext mirror more thoroughly, leaving this file to own only the CLR-naming rule ADR-0031 adds. Refs: #222 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019XoisyHa8b5UpezV7QV4Jd
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
Dummies' scalar factories are named after the CLR type they produce (
Any.Int32()→AnyInt32,Any.Single()→AnySingle, …).Any.Bool()/AnyContext.Bool()/AnyBoolwas the single exception — the CLR name ofboolisBoolean. This PR renames it toAny.Boolean()/AnyContext.Boolean()/AnyBooleanso the convention holds without exception, records the rule as ADR-0031, and adds a reflection guard that enforces it. It is a public-symbol rename — breaking for any consumer, but free now because Dummies is pre-release with no published version (which is exactly why it is settled before 1.0).Type of change
Changes
Any.Bool()→Any.Boolean(),AnyContext.Bool()→AnyContext.Boolean(), and the builderAnyBool→AnyBoolean(file renamed; git history preserved).Dummies.UnitTests(AnySetTypeTests,AnyCollectionTests,SeedReproducibilityTests) and thedummies-checkpackaged-asset probe.Bool→Boolean).FactoryNamingConventionTests: a reflection guard asserting every parameterless scalar factory onAnyis named after its CLR type, that its builder isAny{ClrType}, and thatAnyContextmirrors it — derived from the surface, so no allow-list can drift out of sync.Testing
dotnet build FirstClassErrors.sln— 0 warnings, 0 errorsdotnet test FirstClassErrors.sln— all suites green after rebasing ontomain(Dummies 394/394; Core 447; Binder 152; GenDoc 169; CLI 64; Testing 8; PropertyTests 21 + 3; Analyzers 132; Binder.Usage 14)FirstClassErrors.Analyzers.UnitTests— 132/132)The standalone
dummies-checktool builds only in CI against the packed artifact (itslocal-feeddoes not exist locally), so it was not compiled here; its one-line change mirrors the sibling factory calls andAnyContext.Boolean()compiles in the solution.Documentation
doc/updated (package README, ADR-0031 EN/FR, ADR index)doc/handwritten/for-users/README.fr.md) — N/A: the for-users README (EN and FR) does not name the boolean factory, so it needs no change; the ADR's own French translation is included.Architecture decisions
Related issues
Closes #222