chore(09-02): merge main to get plan 01 infrastructure
- Resolve merge conflicts in worker-service.ts and ipc-core-work-graph-handlers.ts - Keep granular emitEvent calls from plan 02 while preserving session management and task validation from main - Fix duplicate createSkillService import in service-graph.ts Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
commit
ffab9888ed
1169 files changed
+457249
-237
No files matched your search
@@ -11,6 +11,7 @@ import {
|
||||
import { getConnectorExecutionReadinessIssue } from "@shared/connector-policy";
|
||||
import { resolveApprovalDecision, shouldAutoApproveApproval } from "./approval-policy";
|
||||
import { fail, ok, type RegisterCoreHandlersDependencies } from "./ipc-core-common";
|
||||
import { validateTaskCreation, checkCapabilityMatch } from "./task-quality-gates";
|
||||
|
||||
export function registerCoreWorkGraphHandlers({
|
||||
registerHandle,
|
||||
@@ -316,6 +317,13 @@ export function registerCoreWorkGraphHandlers({
|
||||
return fail("INVALID_COMPANY_REFERENCE", `The selected ${invalidReference.label} does not belong to the current company.`);
|
||||
}
|
||||
const isNew = !parsed.id;
|
||||
if (isNew) {
|
||||
const isHeartbeat = parsed.title.startsWith("[Heartbeat]");
|
||||
const validation = validateTaskCreation(parsed, isHeartbeat);
|
||||
if (!validation.valid) {
|
||||
return fail("TASK_VALIDATION_FAILED", validation.errors.join("; "));
|
||||
}
|
||||
}
|
||||
let previousStatus: string | null = null;
|
||||
let previousAssigneeAgentId: string | null = null;
|
||||
if (!isNew) {
|
||||
@@ -357,8 +365,17 @@ export function registerCoreWorkGraphHandlers({
|
||||
wakeAgentIfPossible(parsed.assigneeAgentId, parsed.companyId, "assignment");
|
||||
}
|
||||
}
|
||||
let capabilityWarning: string | undefined;
|
||||
if (isNew && parsed.assigneeAgentId) {
|
||||
try {
|
||||
const match = checkCapabilityMatch(db, parsed.assigneeAgentId, parsed.description, parsed.companyId);
|
||||
if (!match.matched) {
|
||||
capabilityWarning = match.warning;
|
||||
}
|
||||
} catch { /* capability check is advisory — never block task creation */ }
|
||||
}
|
||||
emitEvent({ type: "task-updated", taskId: id, action: isNew ? "created" : "updated" });
|
||||
return ok(id);
|
||||
return ok({ id, capabilityWarning });
|
||||
});
|
||||
|
||||
registerHandle(IPC_CHANNELS.deleteAgent, async (_event, payload) => {
|
||||
|
||||
Reference in new issue
Block a user