feat(FN-3321): add agent self-improvement service and heartbeat evaluation

This merge delivers agent self-improvement (FN-3321) — adding evaluation identity tools, wiring evaluation into the heartbeat loop, implementing a self-improvement service, and providing test coverage. It also expands the dashboard guide view with regression tests, adds org chart full-view mode with

Fusion-Task-Id: FN-3321
This commit is contained in:
Fusion
2026-05-05 03:44:01 -07:00
committed by gsxdsm
parent 02a0c48bad
commit 499417bc8e
14 changed files with 667 additions and 16 deletions

View File

@@ -1889,8 +1889,8 @@ describe("executeHeartbeat", () => {
expect(callArgs.systemPrompt).toContain("fn_task_document_write");
expect(callArgs.tools).toBe("coding");
// Tools: fn_task_create, fn_task_log, fn_task_document_write, fn_task_document_read, fn_list_agents, fn_delegate_task,
// fn_get_agent_config, fn_update_agent_config, fn_memory_search, fn_memory_get, fn_memory_append, fn_heartbeat_done
expect(callArgs.customTools).toHaveLength(12);
// fn_get_agent_config, fn_update_agent_config, fn_read_evaluations, fn_update_identity, fn_memory_search, fn_memory_get, fn_memory_append, fn_heartbeat_done
expect(callArgs.customTools).toHaveLength(14);
expect(callArgs.customTools![0]!.name).toBe("fn_task_create");
expect(callArgs.customTools![1]!.name).toBe("fn_task_log");
expect(callArgs.customTools![2]!.name).toBe("fn_task_document_write");
@@ -1899,11 +1899,13 @@ describe("executeHeartbeat", () => {
expect(callArgs.customTools![5]!.name).toBe("fn_delegate_task");
expect(callArgs.customTools![6]!.name).toBe("fn_get_agent_config");
expect(callArgs.customTools![7]!.name).toBe("fn_update_agent_config");
expect(callArgs.customTools![8]!.name).toBe("fn_memory_search");
expect(callArgs.customTools![9]!.name).toBe("fn_memory_get");
expect(callArgs.customTools![10]!.name).toBe("fn_memory_append");
expect(callArgs.customTools![8]!.name).toBe("fn_read_evaluations");
expect(callArgs.customTools![9]!.name).toBe("fn_update_identity");
expect(callArgs.customTools![10]!.name).toBe("fn_memory_search");
expect(callArgs.customTools![11]!.name).toBe("fn_memory_get");
expect(callArgs.customTools![12]!.name).toBe("fn_memory_append");
// fn_heartbeat_done is last (terminal tool)
expect(callArgs.customTools![11]!.name).toBe("fn_heartbeat_done");
expect(callArgs.customTools![13]!.name).toBe("fn_heartbeat_done");
});
it("includes memory instructions even when agent has no custom instructions", async () => {