test(core): add real-Agent NFR-P7 idle-session memory bench#5849
Merged
Conversation
Closes the measurement gap #5445's standalone harness left open: that harness could not construct a real Agent<LoopbackChannel> (private to zeph-core), so it only measured SessionActor::spawn's housing cost. This adds an in-crate, ignored test that spawns real SessionActors wrapping real Agent<LoopbackChannel> instances (sharing one SkillRegistry across sessions, mirroring production) and samples RSS the same way production's system_metrics module does, reporting a combined housing+Agent-state floor directly comparable against NFR-P7's budget. Measured ~875-905 KiB/session, under budget but with far less headroom than the housing-only figure implied. specs/068-session-persistence/nfr.md gains a rationale paragraph making explicit that this composite is a distinct, larger quantity than NFR-P7's own housing-only scope, rather than silently redefining it.
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
Agent<LoopbackChannel>(private tozeph-core), so it only measuredSessionActor::spawn's own housing (~65-93 KiB/actor). This adds an in-crate#[ignore]d test,nfr_p7_real_agent_idle_session_memory_floor, that spawns realSessionActors wrapping realAgent<LoopbackChannel>instances (one sharedSkillRegistryacross sessions viaAgent::new_with_registry_arc, mirroring production's sharing pattern rather than a private registry per actor) and samples RSS the same way production'ssystem_metricsmodule does, using the same batched/marginal methodology as the session persistence: fsync p99 exceeds NFR-P1 target, NFR-P7 idle-actor-memory unverified, replay reads whole log into memory #5445 harness.Agent's owned state) floor: ~875-905 KiB/session — under NFR-P7's 1 MiB budget, but with far less headroom than the ~65-93 KiB housing-only figure implied.specs/068-session-persistence/nfr.mdgains a rationale paragraph making explicit that this composite is a distinct, larger quantity than NFR-P7's own housing-only scope, rather than silently redefining it — and that this measurement is a synthetic lower bound (mock provider, one trivial skill, no real conversation history), not a production compliance proof.#[ignore]d and matched by no CI workflow filter, so it never runs automatically; it's a manual tripwire, run viacargo nextest run -p zeph-core -E 'test(nfr_p7)' --run-ignored ignored-only --no-capture.Review notes
SkillRegistryconstruction was replaced with the shared-Arcpattern production actually uses; a doc comment mis-attributing the measured cost to the message-history buffer (this is a zero-conversation-turn floor, so history is empty) was corrected; the composite-vs-housing-only scope mismatch against NFR-P7's own budget was made explicit in both the test doc comment and the spec; a synthetic-lower-bound caveat and a decomposition TODO were added.cargo denyadvisory (RUSTSEC-2026-0204, viazeph-index→ignore→crossbeam-epoch) still fails the deny gate; this PR's diff does not touch that dependency chain..local/testing/coverage-status.mdand.local/testing/playbooks/session-persistence.mdwere updated in the main repository (not part of this diff, per project convention for shared testing docs).Test plan
cargo +nightly fmt --checkcargo clippy --profile ci --workspace --all-targets --features "desktop,ide,server,chat,pdf,scheduler,testing" -- -D warningscargo nextest run --config-file .github/nextest.toml --workspace --features "desktop,ide,server,chat,pdf,scheduler" --lib --bins(12368 passed)RUSTFLAGS="-D warnings" RUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps --workspace --features "desktop,ide,server,chat,pdf,scheduler"RUSTFLAGS="-D warnings" cargo check --workspace --all-targets --features desktop,ide,server,chat,pdf,scheduler --lockedcargo test --doc -p zeph-corecargo nextest run -p zeph-core -E 'test(nfr_p7)' --run-ignored ignored-only --no-capture— passes, ~876-905 KiB/session across multiple runs