Skip to content

SDK design improvements: fold operator surface into @benchsdk/runner and add ergonomics/observability - #375

Open
dtice25 wants to merge 11 commits into
masterfrom
devin/1787847959-benchsdk-operator-runner
Open

SDK design improvements: fold operator surface into @benchsdk/runner and add ergonomics/observability#375
dtice25 wants to merge 11 commits into
masterfrom
devin/1787847959-benchsdk-operator-runner

Conversation

@dtice25

@dtice25 dtice25 commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR implements the SDK-design improvements we discussed: @benchsdk/runner is now the canonical operator package, @benchsdk/client is a compatibility re-export shim, and a set of ergonomics/observability/validation fixes round out the surface.

Breaking

  • TaskStepOptions.concurrency is renamed to parallelInvocations to avoid ambiguity with config.concurrency (max in-flight tasks). The old field is still accepted and logs a one-time deprecation warning.
  • runWorker is now a free function: runWorker(client, options). The legacy createBenchmarkClient().runWorker(options) spelling is preserved in @benchsdk/client.

Added

  • runBenchmarkWorker(options) one-shot operator helper in @benchsdk/runner — run a single participant's worker without a *.bench.ts file.
  • bench check <file.bench.ts> CLI command validates env vars, API connectivity, participant availability, and scoring weights before a run.
  • validateBenchmarkConfig(config) returns structured { field, message }[]; defineBenchmarkConfig throws BenchmarkConfigError with the same shape.
  • defineOnComplete(handler) helper for typed onComplete callbacks.
  • RunWorkerOptions.processKey now defaults to os.hostname().
  • RunWorkerOptions.onTelemetryError / BenchmarkReporterConfig.onTelemetryError callbacks expose heartbeat/log-upload/artifact telemetry failures.
  • TaskError now includes step, timeoutMs, and participant context for step timeouts.

Fixed

  • Worker telemetry failures now emit console.warn by default instead of failing silently.
  • Step timeout diagnostics now include the step name, configured timeout, and participant name.
  • @benchsdk/client public API contract test now derives the expected type/value surface from @benchsdk/runner rather than a hand-maintained list.

Package boundaries

  • @benchsdk/client now depends only on @benchsdk/runner and re-exports its entire surface. createBenchmarkClient is a thin wrapper that attaches the legacy runWorker method.
  • @benchsdk/runner re-exports the low-level worker/API primitives (runWorker, BenchmarkReporter, createBenchmarkClient, etc.) so operators can import from one package.

Verification

  • pnpm typecheck passes.
  • pnpm --filter @benchsdk/runner test passes (96 tests).
  • pnpm --filter @benchsdk/client test passes (122 tests).
  • pnpm exec bench run examples/*.bench.ts --dry-run and pnpm exec bench check examples/*.bench.ts --dry-run pass for all examples.

Link to Devin session: https://app.devin.ai/sessions/f67b6ba526fe43619684b90f0d19e045
Open in Devin Desktop: https://app.devin.ai/desktop/session/f67b6ba526fe43619684b90f0d19e045?variant=devin
Requested by: @dtice25


Devin Review

… bench check, telemetry observability, config validation, and diagnostics

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@open-cla

open-cla Bot commented Aug 27, 2026

Copy link
Copy Markdown

Contributor License Agreement

All contributors are covered by a CLA.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1787847959-benchsdk-operator-runner branch from 4094563 to d43f867 Compare August 27, 2026 17:01
…and improved error pretty-printing

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

dtice25 and others added 2 commits August 27, 2026 18:37
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration[bot]

This comment was marked as resolved.

dtice25 and others added 2 commits September 3, 2026 15:02
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.

1 participant