feat(memory,subagent): add A* node cap and sub-agent fleet registration#4377
Merged
Conversation
Add MAX_GRAPH_NODES (500) constant to zeph-memory graph retrieval: node_map is truncated to the highest-scored nodes before the A* inner loop, bounding worst-case complexity from O(seeds × n²) to O(seeds × n log n). Closes #4368. Introduce FleetRegistry trait and SqliteFleetRegistry adapter in zeph-subagent. SubAgentManager now calls register_active on spawn and mark_terminal on completion or cancellation, making sub-agents visible in the fleet dashboard. cancel_all also marks sessions as cancelled during shutdown. Closes #4370.
b7a3454 to
a9949cc
Compare
…rieval_astar tests
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
MAX_GRAPH_NODES = 500constant inzeph-memorygraph retrieval.node_mapis truncated to the 500 highest-scored nodes before the A* inner loop, bounding worst-case complexity from O(seeds × n²) to O(seeds × n log n) — consistent with the existing cap inactivation.rs.FleetRegistrytrait andSqliteFleetRegistryadapter inzeph-subagent.SubAgentManagernow registers sub-agents in the fleetagent_sessionstable on spawn (Active) and updates status on completion/cancellation.cancel_allalso marks sessions as cancelled during shutdown.Changed files
crates/zeph-memory/src/graph/retrieval_astar.rs—MAX_GRAPH_NODESconstant +cap_node_maphelper + 2 unit testscrates/zeph-subagent/src/fleet.rs— newFleetRegistrytrait +SharedFleetRegistrytype aliascrates/zeph-subagent/src/manager.rs— fleet registration wiring + 3 unit tests withMockFleetRegistry+Notify-based synchronisationcrates/zeph-subagent/src/lib.rs— re-exportfleetmodulesrc/fleet_session.rs—SqliteFleetRegistryimplsrc/runner.rs— wireset_fleet_registryafter manager constructionTest plan
cargo nextest run --workspace --lib --bins— 9884 passed, 21 skippedcargo clippy --workspace -- -D warnings— cleancargo +nightly fmt --check— cleanregister_activeon spawn,mark_terminal(Completed)on collect,mark_terminal(Cancelled)on cancel andcancel_allCloses #4368
Closes #4370