Skip to content

refactor(testing): rebase arbitrary values on Dummies - #202

Merged
Reefact merged 2 commits into
mainfrom
claude/dummies-firstclasserrors-tests-ebuofy
Jul 19, 2026
Merged

refactor(testing): rebase arbitrary values on Dummies#202
Reefact merged 2 commits into
mainfrom
claude/dummies-firstclasserrors-tests-ebuofy

Conversation

@Reefact

@Reefact Reefact commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

FirstClassErrors.Testing now sources every arbitrary test value from Dummies instead of maintaining a private pseudo-random engine. The Any facade and ArbitrarySource are removed; the error vocabulary is exposed as named domain factories (ErrorCodeFactory, TransienceFactory, DiagnosticMessageFactory, …) that return the value directly, drawing from Dummies' ambient reproducible context. This realizes ADR-0026 and unifies the repository under a single seeded arbitrary-value source. At 0.1.0-preview this pre-1.0 removal ships without a breaking-change marker.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Analyzer / diagnostic change
  • Tests
  • Documentation
  • Build / CI / tooling

Changes

  • Removed: FirstClassErrors.Testing.Any static facade and its ArbitrarySource engine — replaced by Dummies.Any and its ambient context. Any and its Reproducibly runner are gone; use Dummies.Any.*().Generate() for primitives and Dummies.Any.Reproducibly(...) to replay a seeded run (pre-1.0 preview, so no breaking-change ceremony).
  • Added: domain factory classes in FirstClassErrors.Testing, each Any() returning the value directly (drawn from Dummies' ambient context):
    • ErrorCodeFactory.Any() — error codes shaped like ANY_CODE_7F3A9C
    • DiagnosticMessageFactory.Any(), ShortMessageFactory.Any(), DetailedMessageFactory.Any() — arbitrary messages
    • TransienceFactory.Any(), InteractionDirectionFactory.Any() — meaningful enums (never the Unknown sentinel); ErrorOriginFactory.Any() — uniform (no sentinel to exclude)
    • a composable IAny<T> generator is added per factory only where a call site needs it (none required today)
  • Updated: Clock.UseAny() and InstanceIds.UseAny() draw from Dummies' ambient context, so a single Dummies.Any.Reproducibly scope freezes primitives, factories, clock, and instance ids together.
  • Wiring: FirstClassErrors.Testing references Dummies privately and embeds Dummies.dll in its package while Dummies is not yet on NuGet (verified: Dummies.dll in lib/, no phantom NuGet dependency emitted). To be switched to a NuGet PackageReference once Dummies ships (ADR-0026 follow-up).
  • Migrated: all unit-test call sites (Any.ErrorCode()ErrorCodeFactory.Any(), Any.Int()Dummies.Any.Int32().Generate(), Any.ReproduciblyDummies.Any.Reproducibly).
  • Added: FirstClassErrors.Testing.UnitTests — contract tests for the seam reproducibility (Clock/InstanceIds under Dummies.Any.Reproducibly) and the meaningful-enum factories (never Unknown).

Testing

  • dotnet build FirstClassErrors.sln — 0 warnings, 0 errors
  • dotnet test FirstClassErrors.sln — all green
  • FirstClassErrors.Testing.UnitTests (new) — seam reproducibility + never-Unknown contracts
  • dotnet pack dry-run — Dummies.dll embedded in lib/, no Dummies dependency emitted

Documentation

  • Public API documented — the new factory classes carry XML docs
  • doc/ updated — arbitrary-test-values user guide rewritten (two-source model: Dummies for primitives, domain factories for the error vocabulary)
  • French translation updated — ArbitraryTestValues.fr.md and the ADR French version
  • ADR-0006 status note updated to reference ADR-0026

Architecture decisions

  • No architectural decision in this pull request
  • New decision recorded — ADR-0026 (accepted this session): rebase FirstClassErrors.Testing on Dummies
  • Supersedes an existing ADR — ADR-0006 flipped to Superseded by ADR-0026 on the maintainer's acceptance
  • ⚠️ Conflicts with an existing ADR

ADR-0026 records the decision to rebase FirstClassErrors.Testing on Dummies, realizing the follow-up actions anticipated by ADR-0006 (extract the generic value engine) and ADR-0011 (decide whether Testing re-bases on Dummies). It was numbered 0026 after ADR-0023 (binder expression-tree selectors), ADR-0024 (editorial refactoring), and ADR-0025 (regex string generation) landed on main.


🤖 Generated with Claude Code

https://claude.ai/code/session_01XqQfM3Wp4CQpDbfrh647WK

@Reefact
Reefact force-pushed the claude/dummies-firstclasserrors-tests-ebuofy branch 2 times, most recently from b0af163 to 424df42 Compare July 19, 2026 23:15
@Reefact Reefact changed the title refactor(testing): rebase arbitrary values on Dummies refactor(testing)!: rebase arbitrary values on Dummies Jul 19, 2026
Record the decision to source FirstClassErrors.Testing's arbitrary values from
Dummies and mark ADR-0006 Superseded by it; the decision was accepted this
session. Numbered 0026 after the binder expression-tree selectors (0023), the
editorial-refactoring exception (0024), and the regex string generation (0025)
landed on main.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqQfM3Wp4CQpDbfrh647WK
@Reefact
Reefact force-pushed the claude/dummies-firstclasserrors-tests-ebuofy branch from 424df42 to 081801e Compare July 19, 2026 23:29
@Reefact Reefact changed the title refactor(testing)!: rebase arbitrary values on Dummies refactor(testing): rebase arbitrary values on Dummies Jul 19, 2026
Remove the FirstClassErrors.Testing.Any facade and its private seedable
ArbitrarySource; every arbitrary value now comes from the Dummies generator
library instead (ADR-0026). The error vocabulary Any exposed becomes named
domain factories - ErrorCodeFactory, DiagnosticMessageFactory,
ShortMessageFactory, DetailedMessageFactory, TransienceFactory,
ErrorOriginFactory, InteractionDirectionFactory - each returning the value
directly and drawing through Dummies' ambient context; arbitrary primitives
come from Dummies.Any.*().Generate(). Clock.UseAny and InstanceIds.UseAny draw
from that same ambient context, so a single Dummies.Any.Reproducibly scope
freezes them together.

FirstClassErrors.Testing references Dummies privately and embeds Dummies.dll in
its package while Dummies is not yet on NuGet. Add a Testing.UnitTests project
for the seam-reproducibility and meaningful-enum contracts, migrate the
unit-test call sites, and update the arbitrary-test-values guide (English and
French) and the package README.

Testing.Any and its Reproducibly runner are removed; consumers use Dummies.Any.*
with .Generate() and Dummies.Any.Reproducibly(...). At 0.1.0-preview this pre-1.0
removal ships without a breaking-change marker.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqQfM3Wp4CQpDbfrh647WK
@Reefact
Reefact force-pushed the claude/dummies-firstclasserrors-tests-ebuofy branch from 081801e to 23ad6ca Compare July 19, 2026 23:38
@Reefact
Reefact enabled auto-merge July 19, 2026 23:40
@Reefact
Reefact merged commit 5df962f into main Jul 19, 2026
15 checks passed
@Reefact
Reefact deleted the claude/dummies-firstclasserrors-tests-ebuofy branch July 19, 2026 23:42
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.

2 participants