feat(09-02): convert high-frequency callsites to granular emitEvent

- Replace publishDomainChanged() with granular events at 9 high-frequency callsites
- saveTask/deleteTask emit task-updated events in ipc-core-work-graph-handlers
- decideApproval emits approval-updated, addComment emits task-updated
- worker-service emits run-updated for status changes and completion
- worker-service emits agent-updated for budget hard-stop pause
- orchestration-service emits agent-updated for auto-pause, run-updated for dispatch
- Wire emitEvent dependency to orchestration-service via service-graph
- Keep publishDomainChanged for low-frequency and multi-entity paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
ZacharyZhang-NYandClaude Opus 4.6 committed 2026-03-27 19:45:30 -04:00
1 parent c1de05a7f1
commit 5124209ddb
5 files changed
+20 -11

No files matched your search

+2 -2
View File
@@ -114,7 +114,7 @@ export function registerCoreOperationHandlers({
decisionNote: parsed.decisionNote,
detail: parsed.decisionNote,
});
publishDomainChanged();
emitEvent({ type: "approval-updated", approvalId: approval.id, action: "decided" });
return ok(true);
});
@@ -179,7 +179,7 @@ export function registerCoreOperationHandlers({
detail: parsed.body.slice(0, 100),
});
emitEvent({ type: "agent-message", taskId: parsed.taskId, comment });
publishDomainChanged();
emitEvent({ type: "task-updated", taskId: parsed.taskId, action: "updated" });
try {
const task = db.getTask(parsed.taskId);
if (task.assigneeAgentId) {