Skip to content

feat(runtime): add delivery profile presets#97

Merged
Lythaeon merged 5 commits intomainfrom
feat/runtime-delivery-profiles
Apr 11, 2026
Merged

feat(runtime): add delivery profile presets#97
Lythaeon merged 5 commits intomainfrom
feat/runtime-delivery-profiles

Conversation

@Lythaeon
Copy link
Copy Markdown
Owner

@Lythaeon Lythaeon commented Apr 11, 2026

Description

Adds runtime delivery profiles as a typed runtime-level policy for SOF-owned downstream delivery defaults. This implements the Rust runtime side of ADR-0013 after the docs branch was merged to main.

The feature makes the default downstream delivery posture explicit while preserving bounded ingest and keeping caller-supplied plugin/extension hosts untouched.

Changes

Detailed list of what changed:

  • crates/sof-observer/src/runtime.rs: added RuntimeDeliveryProfileSettings, profile-to-builder helpers, ObserverRuntime::with_runtime_delivery_profile, setup defaults, regression tests, and ignored soak/benchmark fixtures.
  • crates/sof-observer/src/app/config/base.rs: added SOF_RUNTIME_DELIVERY_PROFILE parsing with explicit warning fallback for unknown env values.
  • crates/sof-observer/src/app/runtime/entrypoints.rs: applies the selected profile to SOF-owned default plugin and extension hosts.
  • docs/architecture/adr/0013-runtime-delivery-profiles.md: documents the implemented profile table and manual soak/benchmark commands.
  • docs/gitbook/operations/knob-registry.md and docs/operations/advanced-env.md: document the new env knob.

For slice-related changes, include:

  • Affected slices: observer runtime configuration, runtime entrypoints, plugin dispatch defaults, runtime-extension dispatch defaults, derived-state replay env-backed defaults.
  • Cross-slice communication changes (if any) and why: no new runtime cross-slice dependency; profile application lives at the runtime composition boundary and uses existing framework builders.
  • Migration requirements (if any): none. Default remains latency_optimized and explicit caller-supplied hosts preserve their existing configuration.

Motivation

Business motivation: make SOF easier to operate across latency-sensitive, balanced, and stateful/analytics-style consumers without exposing a bag of low-level toggles.

Technical motivation: replace implicit downstream runtime bias with one typed, testable policy bundle while preserving bounded queues and explicit runtime ownership.

Alternative approaches considered: keeping only env knobs, exposing per-hook/per-plugin queue policy, or claiming lossless delivery. These are intentionally avoided per ADR-0013.

Scope and impact

  • Affected slices: sof runtime API, runtime env config, app runtime entrypoints, runtime docs.
  • Data/API changes: adds RuntimeDeliveryProfile application helpers and ObserverRuntime::with_runtime_delivery_profile; adds SOF_RUNTIME_DELIVERY_PROFILE values latency_optimized, balanced, delivery_disciplined.
  • Backward compatibility: default behavior remains latency optimized; unknown env values warn and fall back to default; explicitly supplied plugin/extension hosts are preserved.
  • Performance impact: profile selection happens during setup/default host construction, not per event. Larger queues and stricter delivery-disciplined transaction worker settings are opt-in.
  • Security impact: no new network or trust boundary; no unbounded queues introduced.

Testing

  • Unit tests
  • Integration tests
  • Manual verification
  • Performance checks (if applicable)
  • Security checks (if applicable)

Commands/results:

cargo fmt --all
cargo test -p sof runtime_delivery_profile --lib
cargo test -p sof observer_runtime_profile --lib
SOF_PROFILE_ITERATIONS=1024 cargo test -p sof runtime_delivery_profile_plugin_dataset_dispatch_profile_fixture --lib -- --ignored --nocapture
SOF_PROFILE_ITERATIONS=1024 cargo test -p sof runtime_delivery_profile_transaction_dispatch_profile_fixture --lib -- --ignored --nocapture
SOF_PROFILE_ITERATIONS=1024 cargo test -p sof runtime_delivery_profile_extension_dispatch_profile_fixture --lib -- --ignored --nocapture
cargo test -p sof --lib
cargo clippy -p sof --lib --all-features -- -D warnings

Results:

runtime_delivery_profile_* focused tests: passed
ignored soak/benchmark fixtures at SOF_PROFILE_ITERATIONS=1024: passed
cargo test -p sof --lib: 265 passed, 38 ignored
cargo clippy -p sof --lib --all-features -- -D warnings: passed

Related issues and documentation

  • Fixes:
  • Related: ADR-0013 runtime delivery profiles; ARD-0010 simplification without capability regression.
  • Architecture docs: docs/architecture/README.md
  • Relevant ARD/ADR: docs/architecture/adr/0013-runtime-delivery-profiles.md, docs/architecture/ard/0010-simplification-without-capability-regression.md
  • Operations/runbook updates: docs/gitbook/operations/knob-registry.md, docs/operations/advanced-env.md

Reviewer checklist

  • Code follows project standards and architecture constraints
  • Slice boundaries are respected (docs/architecture/ard/0003-slice-dependency-contracts.md)
  • Tests added/updated and passing
  • Documentation updated (README/docs/operations as needed)
  • No undocumented breaking change
  • Performance trade-offs documented where relevant
  • Security considerations addressed where relevant

Additional notes

This PR is based directly on the merged main that already contains the docs/runtime-profile-spec work. TS/Python SDK enum exposure remains future follow-up work from ADR-0013 and is not implemented here.

@Lythaeon Lythaeon merged commit 637d67e into main Apr 11, 2026
2 checks passed
@Lythaeon Lythaeon deleted the feat/runtime-delivery-profiles branch April 11, 2026 09:40
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