feat(FN-3946): add heartbeat scope guidance to agent-heartbeat

Adds heartbeat scope guidance to the agent-heartbeat module with corresponding tests, helping agents understand when and how to scope their heartbeat work.

Fusion-Task-Id: FN-3946
This commit is contained in:
Fusion
2026-05-10 13:57:36 -07:00
committed by gsxdsm
parent 4f5b0539d7
commit 73f0318160
2 changed files with 23 additions and 6 deletions

View File

@@ -1938,6 +1938,13 @@ describe("executeHeartbeat", () => {
expect(HEARTBEAT_NO_TASK_PROCEDURE.indexOf("**Inbox**")).toBeLessThan(HEARTBEAT_NO_TASK_PROCEDURE.indexOf("**Wake delta**"));
});
it("both heartbeat procedures include scope-classification guidance", () => {
expect(HEARTBEAT_PROCEDURE).toContain("Classify scope before acting");
expect(HEARTBEAT_PROCEDURE).toContain("Out-of-scope discovery");
expect(HEARTBEAT_NO_TASK_PROCEDURE).toContain("Classify scope before acting");
expect(HEARTBEAT_NO_TASK_PROCEDURE).toContain("Implementation-scope discovery");
});
it("no-task system prompt processing messages section does not reference fn_task_log", () => {
const processingMessagesSection = HEARTBEAT_NO_TASK_SYSTEM_PROMPT.split("## Processing Messages")[1] ?? "";
expect(processingMessagesSection).not.toContain("fn_task_log");