refactor(epic-1973): Extract zeph-subagent crate from zeph-core (Phase 1f)#2010
Merged
refactor(epic-1973): Extract zeph-subagent crate from zeph-core (Phase 1f)#2010
Conversation
…e 1f)
Extract 9,028 LOC subagent management module from zeph-core into standalone
zeph-subagent crate. zeph-core reduces from 64,851 to 55,860 LOC (-13.9%).
New crate zeph-subagent contains 11 modules:
command, def, error, filter, grants, hooks, manager,
memory, resolve, state, transcript
Key changes:
- spawn_for_task() refactored to accept generic completion callback
(F: FnOnce(String, Result<String, SubAgentError>)) eliminating the
direct orchestration dependency from zeph-subagent
- zeph-core re-exports pub mod subagent { pub use zeph_subagent::*; }
preserving all crate::subagent::* import paths in orchestration,
agent, and test code without modification
- SubAgentHandle fields widened from pub(crate) to pub to allow test
harnesses in downstream crates to construct handles directly
Test results: 5,917 tests passing (299 new in zeph-subagent)
Phase 1g will extract zeph-orchestration.
Closes: epic #1973 Phase 1f
3 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-coreinto standalonezeph-subagentcratezeph-corereduced from 64,851 to 55,860 LOC (-13.9%)zeph-subagenthas zero imports fromzeph-coreNew crate:
crates/zeph-subagent11 modules:
command,def,error,filter,grants,hooks,manager,memory,resolve,state,transcriptKey design decisions
spawn_for_task()callback refactor — instead of takingTaskId + mpsc::Sender<TaskEvent>(which would require zeph-subagent → zeph-core), the method now accepts a generic completion callback:The caller (
agent/mod.rs) constructs the closure that sendsTaskEventto the scheduler. This breaks the orchestration dependency at the API boundary.Re-export shim —
zeph-core/src/lib.rsreplacespub mod subagent;with:All
crate::subagent::*paths in orchestration, agent, and tests work unchanged.SubAgentHandlefields — widened frompub(crate)topubto allow test harnesses inzeph-coreto construct handles via struct literals.Test results
zeph-subagent), 0 failurescargo +nightly fmt --check: cleancargo clippy --workspace --features full -- -D warnings: cleanBreaking changes
None. All re-exports in
zeph-coremaintain backward compatibility.Next phase
Phase 1g will extract
zeph-orchestration.spawn_for_taskno longer depends on orchestration types, so the circular dependency between orchestration and subagent is resolved.Spec:
.local/specs/003-epic-1973-phase-1f/spec.mdEpic: #1973