Skip to content

Name Any's boolean factory Boolean, not Bool - #276

Merged
Reefact merged 5 commits into
mainfrom
claude/issue-222-discussion-9ay73w
Jul 21, 2026
Merged

Name Any's boolean factory Boolean, not Bool#276
Reefact merged 5 commits into
mainfrom
claude/issue-222-discussion-9ay73w

Conversation

@Reefact

@Reefact Reefact commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Summary

Dummies' scalar factories are named after the CLR type they produce (Any.Int32()AnyInt32, Any.Single()AnySingle, …). Any.Bool() / AnyContext.Bool() / AnyBool was the single exception — the CLR name of bool is Boolean. This PR renames it to Any.Boolean() / AnyContext.Boolean() / AnyBoolean so 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).

Rebased onto main after #275 merged: that PR took ADR number 0030 (terminal String().OneOf), so this decision is recorded as ADR-0031. The README.nuget.md overlap merged cleanly (its new OneOf bullet and this rename touch different lines).

Type of change

  • Breaking change (public API rename — pre-release, no published version, so free now)
  • Refactoring
  • Tests
  • Documentation

Changes

  • Rename Any.Bool()Any.Boolean(), AnyContext.Bool()AnyContext.Boolean(), and the builder AnyBoolAnyBoolean (file renamed; git history preserved).
  • Update every call site: Dummies.UnitTests (AnySetTypeTests, AnyCollectionTests, SeedReproducibilityTests) and the dummies-check packaged-asset probe.
  • Update the package README's supported-types list (BoolBoolean).
  • Record the naming rule as ADR-0031 (English + French) and index it — status Accepted.
  • Add FactoryNamingConventionTests: a reflection guard asserting every parameterless scalar factory on Any is named after its CLR type, that its builder is Any{ClrType}, and that AnyContext mirrors it — derived from the surface, so no allow-list can drift out of sync.

Testing

  • dotnet build FirstClassErrors.sln — 0 warnings, 0 errors
  • dotnet test FirstClassErrors.sln — all suites green after rebasing onto main (Dummies 394/394; Core 447; Binder 152; GenDoc 169; CLI 64; Testing 8; PropertyTests 21 + 3; Analyzers 132; Binder.Usage 14)
  • Analyzer tests pass (FirstClassErrors.Analyzers.UnitTests — 132/132)

The standalone dummies-check tool builds only in CI against the packed artifact (its local-feed does not exist locally), so it was not compiled here; its one-line change mirrors the sibling factory calls and AnyContext.Boolean() compiles in the solution.

Documentation

  • Public API / error documentation updated (XML docs travel with the renamed members)
  • README / doc/ updated (package README, ADR-0031 EN/FR, ADR index)
  • French translation (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

claude added 3 commits July 21, 2026 19:52
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
Reefact force-pushed the claude/issue-222-discussion-9ay73w branch from dcf469b to 0cdfe3c Compare July 21, 2026 19:55
@Reefact
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
@Reefact
Reefact merged commit cf5ca2c into main Jul 21, 2026
15 checks passed
@Reefact
Reefact deleted the claude/issue-222-discussion-9ay73w branch July 21, 2026 20:12
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.

Dummies: decide Any.Bool() vs Any.Boolean() before 1.0 and record the naming rule

2 participants