Skip to content

feat(dummies): add WithOffset/WithOffsetBetween on AnyDateTimeOffset - #299

Merged
Reefact merged 1 commit into
mainfrom
claude/anydatetimeoffset-withoffset-297
Jul 26, 2026
Merged

feat(dummies): add WithOffset/WithOffsetBetween on AnyDateTimeOffset#299
Reefact merged 1 commit into
mainfrom
claude/anydatetimeoffset-withoffset-297

Conversation

@Reefact

@Reefact Reefact commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Summary

Give AnyDateTimeOffset an opt-in offset dimension: WithOffset(TimeSpan) pins a whole-minute offset (±14:00) and WithOffsetBetween(min, max) draws a bounded one, so offset-sensitive code can be exercised. Today the offset is always TimeSpan.Zero, so the common latent bug "the code assumes offset == 0" is never surfaced. The unconstrained default stays TimeSpan.Zero, so the change is non-breaking.

Type of change

  • New feature
  • Tests
  • Documentation

Changes

  • WithOffset(TimeSpan) (pin) and WithOffsetBetween(TimeSpan, TimeSpan) (bounded draw) on AnyDateTimeOffset; whole-minute offsets within ±14:00; declared once per generator.
  • The instant is tightened at declaration so localTicks = UtcTicks + offset stays valid for every admitted offset; the offset is then an independent, always-valid draw, and an instant window with no room for the offset conflicts eagerly through the existing interval engine.
  • OneOf values are returned verbatim (offset included); the offset dimension governs only the constructed draw.
  • Own SurfaceParityTests family for AnyDateTimeOffset; behavioural + edge + conflict tests in AnyDateTimeOffsetOffsetTests.
  • Public API entries for both TFMs; Dummies readme updated.

Testing

  • dotnet build FirstClassErrors.sln
  • dotnet test FirstClassErrors.sln
  • Analyzer tests pass (FirstClassErrors.Analyzers.UnitTests)

Documentation

  • Public API / error documentation updated
  • README / doc/ updated
  • French translation — n/a: the Dummies NuGet readme is English-only; ADR-0037 ships EN + FR.

Architecture decisions

  • New decision recorded — ADR drafted as Proposed: ADR-0037

Related issues

Closes #297
Refs #226

🤖 Generated with Claude Code

https://claude.ai/code/session_01JpQ9768mubATEjedfdAZus


Generated by Claude Code

Give AnyDateTimeOffset an opt-in offset dimension (split from #226):
WithOffset(TimeSpan) pins a whole-minute offset (±14:00) and
WithOffsetBetween(min, max) draws a bounded one, so offset-sensitive code
(local rendering, offset arithmetic, "same instant, different offset") is
exercised. The unconstrained default stays TimeSpan.Zero, so this is
non-breaking.

The instant is tightened at declaration so the local ticks stay in range
for every admitted offset; the offset is then an independent, always-valid
draw, and an instant window with no room for the offset conflicts eagerly
through the existing interval engine.

Adds the two methods to the netstandard2.0 and net8.0 public API, gives
AnyDateTimeOffset its own surface-parity family, documents the dimension in
the Dummies readme, and proposes ADR-0037.

Refs: #297

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JpQ9768mubATEjedfdAZus
@Reefact
Reefact force-pushed the claude/anydatetimeoffset-withoffset-297 branch from 3210e3b to 47f9446 Compare July 26, 2026 12:33
@Reefact
Reefact enabled auto-merge July 26, 2026 12:34
@Reefact
Reefact merged commit 740dcd7 into main Jul 26, 2026
16 checks passed
@Reefact
Reefact deleted the claude/anydatetimeoffset-withoffset-297 branch July 26, 2026 12:36
Reefact added a commit that referenced this pull request Jul 26, 2026
ADR-0037 ("Vary the DateTimeOffset offset dimension") records the decision
behind the WithOffset/WithOffsetBetween constraints that shipped in #299. The
maintainer accepts the decision; the Date stays 2026-07-26, the day it took
effect.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JpQ9768mubATEjedfdAZus
@Reefact Reefact mentioned this pull request Jul 26, 2026
4 tasks
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: WithOffset on AnyDateTimeOffset — vary the offset dimension

2 participants