Skip to content

fix(justdummies): qualify the Combine replay hint across mixed sources - #320

Merged
Reefact merged 2 commits into
mainfrom
claude/justdummies-combine-reproducibility
Jul 27, 2026
Merged

fix(justdummies): qualify the Combine replay hint across mixed sources#320
Reefact merged 2 commits into
mainfrom
claude/justdummies-combine-reproducibility

Conversation

@Reefact

@Reefact Reefact commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

When a composer failed inside a Combine, the replay hint promised a full deterministic replay whenever every operand was individually reproducible — even when the operands drew from different seeded sources. Combine reports the first operand's source, so a mix of a WithSeed context and the ambient source (or two different WithSeed contexts) named one seed and claimed it replays the whole run, when it reproduces only the operands that draw from it. The full-replay promise now holds only when every operand draws from the one reported source.

Type of change

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

Changes

  • AnyDerivation.DrawsOnlyFrom(generator, source) = IsReproducible(generator) && ReferenceEquals(SourceOf(generator), source) — the per-operand condition for a full-replay promise.
  • All seven Combine overloads (2–8 arity) now compute reproducible from DrawsOnlyFrom(operand, source) rather than IsReproducible(operand), so a combine whose operands do not all share the reported source is qualified ("not reproducible from this seed alone"), the same wording a foreign operand already produces.
  • Behaviour preserved for the correct cases: same-ambient combines and combines over one shared Any.WithSeed(…) context stay full. The only new qualification is a genuine source mix — and, conservatively, two separate Any.WithSeed(4242) contexts of the same seed (safe under-promising of an unusual pattern).
  • As / OrNull are single-operand and unaffected; the collection count/element source interaction is a separate audit item, out of scope here.

Testing

  • dotnet build FirstClassErrors.sln — 0 warnings, 0 errors.
  • dotnet test FirstClassErrors.sln — 1810 tests, 0 failures.
  • Analyzer tests pass (as part of the solution-wide run).

Additionally:

  • CompositionTests.CombineOverMixedSeededSourcesQualifiesTheHint pins the fix (message content is the example suite's job, ADR-0040): a Combine(Any.WithSeed(4242).Int32(), Any.Int32(), …) whose composer throws must not say "already replays deterministically" and must say "not reproducible from this seed alone". Confirmed red before the fix.
  • The existing reproducibility-hint tests are unchanged and green: ambient → Any.Reproducibly(…) full hint, one shared WithSeed context → Any.WithSeed(…) full hint, foreign operand → qualified.
  • CI warning ratchet (GITHUB_ACTIONS=true): 0 warnings. The public API baseline is untouched (git diff -- JustDummies/PublicAPI/ empty) — the change is internal to the derivation plumbing.

Documentation

  • Public API / error documentation updated
  • README / doc/ updated
  • French translation updated if user-facing behavior changed
  • No documentation change required

The behaviour realises the intent already documented on RandomSource.PartialReplayGuidance and IReproducibilityHint ("the seed reporting must not over-promise"); no user-facing document quotes these runtime strings.

Architecture decisions

  • No architectural decision in this pull request
  • New decision recorded — ADR drafted as Proposed: ADR-____
  • Supersedes an existing ADR — successor proposed, status not flipped: ADR-____
  • ⚠️ Conflicts with an existing ADR — flagged for the maintainer: ADR-____

Advisory ADR check done: this makes the existing "do not over-promise a replay" intent hold for the mixed-source case rather than establishing a new decision, so no ADR is drafted.

Related issues

Closes #319


🤖 Generated with Claude Code


Generated by Claude Code

claude and others added 2 commits July 27, 2026 16:02
When a composer failed inside a Combine, the replay hint promised a full
deterministic replay whenever every operand was individually reproducible —
even when the operands drew from different seeded sources. Combine reports
the first operand's source, so a mix of a WithSeed context and the ambient
source (or two different WithSeed contexts) named one seed and claimed it
replays the whole run, when it reproduces only the operands that draw from
it. The flagship promise — a run is reproducible from a reported seed — was
overstated exactly where the seed cannot deliver it.

Gate the full-replay promise on every operand drawing from the one reported
source, not merely on each being reproducible: DrawsOnlyFrom(g, source) =
IsReproducible(g) && ReferenceEquals(SourceOf(g), source). A combine whose
operands do not all share the reported source is now qualified ("not
reproducible from this seed alone"), the same wording a foreign operand
already produces. Same-ambient and single-WithSeed-context combines stay
full; the only new qualification is a genuine source mix (and, conservatively,
two separate WithSeed contexts of the same seed — safe under-promising).

Internal to the derivation plumbing; no public API change.

Refs: #319
@Reefact
Reefact merged commit a48b93f into main Jul 27, 2026
28 checks passed
@Reefact
Reefact deleted the claude/justdummies-combine-reproducibility branch July 27, 2026 18:04
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.

JustDummies: Combine over two different seeded sources over-promises a full replay

2 participants