feat(durable,subagent): criterion benchmarks + durable subagent promise adapter#4994
Merged
Conversation
…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
force-pushed
the
4950-durable-benchmarks-subagent
branch
from
June 7, 2026 12:55
ba2eef9 to
d75d226
Compare
bug-ops
enabled auto-merge (squash)
June 7, 2026 13:00
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
zeph-durablecovering all NFR-DE-01..07 targets, plus NFR gate testszeph-subagentfor crash-resumable subagent spawn/awaitCloses #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_ackedbench_payload_seal/bench_payload_open(4 KiB, real XChaCha20-Poly1305)bench_prune_batch(10 000 entries, 500-row batches,iter_batchedsetup outside timer)crates/zeph-durable/tests/nfr_gates.rs:nfr_de_07_append_throughput_ge_1000_per_sec— runs in CInfr_de_01_exactly_once_n5_p99_le_5msandnfr_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 caseDurableResolverSeat—Zeroizing<[u8;32]>token, consumed by background task after spawn (INV-9 boundary)make_durable_promise,await_durable_subagent(withsubagent.durable.awaitspan),resolve_durable_promise(withsubagent.durable.resolveinstrument span)crates/zeph-core/src/agent/subagent_commands.rs:maybe_make_durable_seatcalled from bothhandle_agent_backgroundandhandle_agent_spawn_foreground, gated ondurable.enabled && durable.subagentSpawnContext.durable_resolver = None— existing spawn/await path is byte-identicalScope 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— CLEANcargo clippy --workspace --all-targets -- -D warnings— CLEANcargo nextest run --workspace --lib --bins— 10670 passed, 0 failedcargo bench -p zeph-durable --no-run— benches compilecargo nextest run -p zeph-durable --test nfr_gates— nfr_de_07 passes, 2 #[ignore] skippedcargo test --doc -p zeph-subagent— 23 passedRUSTFLAGS="-D warnings" cargo check --workspace --all-targets— CLEAN