Skip to content

feat(durable,subagent): criterion benchmarks + durable subagent promise adapter#4994

Merged
bug-ops merged 1 commit into
mainfrom
4950-durable-benchmarks-subagent
Jun 7, 2026
Merged

feat(durable,subagent): criterion benchmarks + durable subagent promise adapter#4994
bug-ops merged 1 commit into
mainfrom
4950-durable-benchmarks-subagent

Conversation

@bug-ops

@bug-ops bug-ops commented Jun 7, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #4950, Closes #4954

Changes

#4950 — Criterion benchmarks (zeph-durable)

crates/zeph-durable/benches/durable_benches.rs:

  • bench_step_run_idempotent / bench_step_run_atleastonce / bench_step_run_exactly_once_n (N=5)
  • bench_parallel_n (N=8), bench_replay_cursor_n (N=5000)
  • bench_journal_append_buffered / bench_journal_append_acked
  • bench_payload_seal / bench_payload_open (4 KiB, real XChaCha20-Poly1305)
  • bench_prune_batch (10 000 entries, 500-row batches, iter_batched setup outside timer)

crates/zeph-durable/tests/nfr_gates.rs:

  • nfr_de_07_append_throughput_ge_1000_per_sec — runs in CI
  • nfr_de_01_exactly_once_n5_p99_le_5ms and nfr_de_02_replay_cursor_5000_steps_le_5ms#[ignore] (release-only; 5 ms bound is normative per NFR-DE-01/02, not loosened)

#4954 — Durable subagent promise adapter (zeph-subagent + zeph-core)

crates/zeph-subagent/src/durable.rs (new):

  • SubagentResult { output, error, state } — carries both success and failure case
  • DurableResolverSeatZeroizing<[u8;32]> token, consumed by background task after spawn (INV-9 boundary)
  • make_durable_promise, await_durable_subagent (with subagent.durable.await span), resolve_durable_promise (with subagent.durable.resolve instrument span)

crates/zeph-core/src/agent/subagent_commands.rs:

  • maybe_make_durable_seat called from both handle_agent_background and handle_agent_spawn_foreground, gated on durable.enabled && durable.subagent
  • When either flag is false, SpawnContext.durable_resolver = None — existing spawn/await path is byte-identical

Scope boundary (spec §1038 / INV-9): Finished-child replay only. Still-running-child crash recovery is out of scope — resolver token recovery is impossible by design (only BLAKE3 hash persisted). Documented in module doc and playbook.

Test plan

  • cargo +nightly fmt --check — CLEAN
  • cargo clippy --workspace --all-targets -- -D warnings — CLEAN
  • cargo nextest run --workspace --lib --bins — 10670 passed, 0 failed
  • cargo bench -p zeph-durable --no-run — benches compile
  • cargo nextest run -p zeph-durable --test nfr_gates — nfr_de_07 passes, 2 #[ignore] skipped
  • cargo test --doc -p zeph-subagent — 23 passed
  • RUSTFLAGS="-D warnings" cargo check --workspace --all-targets — CLEAN

@github-actions github-actions Bot added documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate dependencies Dependency updates enhancement New feature or request size/XL Extra large PR (500+ lines) labels Jun 7, 2026
…se adapter

Closes #4950, #4954

Add 10 criterion benchmark groups in crates/zeph-durable/benches/durable_benches.rs
measuring step execution, parallel throughput, journal append (buffered/acked),
payload AEAD seal/open, replay cursor, and prune batch performance.

Add NFR gate tests in crates/zeph-durable/tests/nfr_gates.rs:
- nfr_de_07_append_throughput_ge_1000_per_sec runs in CI
- nfr_de_01/02 p99 gates are #[ignore] (release-only; 5 ms bound normative)

Add crates/zeph-subagent/src/durable.rs implementing SubagentResult,
DurableResolverSeat (Zeroizing token, INV-9 compliant), make_durable_promise,
await_durable_subagent, and resolve_durable_promise.

Wire the durable_resolver seat into SpawnContext via maybe_make_durable_seat in
zeph-core/subagent_commands.rs, gated on durable.enabled && durable.subagent.
When either flag is false, spawn/await behavior is byte-identical to today.

Scope: finished-child replay only per spec §1038 / INV-9. Still-running-child
crash recovery is out of scope (resolver token recovery is impossible by design).
@bug-ops
bug-ops force-pushed the 4950-durable-benchmarks-subagent branch from ba2eef9 to d75d226 Compare June 7, 2026 12:55
@bug-ops
bug-ops enabled auto-merge (squash) June 7, 2026 13:00
@bug-ops
bug-ops merged commit acc0921 into main Jun 7, 2026
32 checks passed
@bug-ops
bug-ops deleted the 4950-durable-benchmarks-subagent branch June 7, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(sub-agents): durable promise for subagent spawn/await resume (P4) feat(durable): criterion benchmarks and exactly-once p99 CI gate

1 participant