Skip to content

Sampling config is unused and samples(1) does not behave like sampled mode #2

Description

@MaestroError

Summary

The package exposes sampling defaults in config and docs, but the builder does not consume them. In addition, samples(1) currently behaves like a non-sampled run and returns EvalResult instead of SampleResults.

Why this matters

This creates an API and documentation mismatch that can confuse users and make sampling behavior harder to reason about.

Evidence

  • config/evals.php:38-40 defines sampling.default_samples and sampling.default_minimum.
  • README.md:1044-1045 documents those config keys as effective settings.
  • src/EvalBuilder.php:173-177 requires explicit values in samples() and never reads sampling config.
  • src/EvalBuilder.php:353-356 only treats counts greater than 1 as sampled.

Current behavior

  • ->samples() always depends entirely on explicit arguments.
  • sampling.default_samples and sampling.default_minimum appear to be dead config.
  • ->samples(1) returns a plain EvalResult, not SampleResults.

Why this may hurt DX

A user reading the README/config may reasonably expect:

  • sampling defaults to influence runtime behavior, or
  • samples(1) to still produce sampling semantics consistently.

Today neither expectation is clearly satisfied.

Suggested fix

This is only a suggestion; the actual fix should be planned carefully.

Possible directions:

  • Either wire sampling.default_samples / sampling.default_minimum into actual runtime behavior, or remove them from config/docs if they are not intended to be supported.
  • Decide and document whether samples(1) should:
    • return SampleResults for consistency, or
    • be rejected / normalized differently.
  • Add tests for configured defaults and one-sample semantics.

Notes

This looks more like an incomplete feature or API contract mismatch than a one-line bug, so the final fix probably needs a small design decision first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions