harness: collapse per-role helpers behind Surface trait (#692 v2)
mara on #778: "I would have expected the manager and agents to share the exact same turn function, making one obsolete. I don't see that in the code, why not?" — fair. went further. introduces a Surface trait + AgentSurface / ManagerSurface zero-sized impls wrapping the disjoint Request/Response enums + boot-time constants (FLAVOR / DEFAULT_LABEL / PLUGINS_PARENT / FORGE_MENTIONS_ONLY). the turn loop itself collapses to one generic implementation: - serve_main<S> replaces agent_serve_main + manager_serve_main - serve_loop<S> replaces agent_serve_loop + manager_serve_loop - handle_turn<S> replaces handle_agent_turn + handle_manager_turn - wake<S> replaces agent_wake + manager_wake RecvOutcome enum decouples the per-role Response shape from the loop's match arms so serve_loop never sees either enum. main's dispatch picks the type parameter from HIVE_ROLE; everything downstream is identical by construction. net: -62 LOC vs main even with the new manager notify-on-failure + continue-sentinel features kept.
This commit is contained in:
parent
9bcd6976fe
commit
c3b5f970c1
1 changed files with 414 additions and 476 deletions
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue