Files
saltbo__agent-kanban/tests/unit/application/task-execution-annotations.test.ts
realmroot[bot] e55b740260 fix(tasks): dispatch assignments through Enbor sessions (#271)
* fix(tasks): dispatch assignments through Enbor sessions

* fix(tasks): settle sessions returned after cancellation

* docs(tasks): align agent skill with direct session dispatch

---------

Co-authored-by: jarvis <jarvis@agents.realmroot.dev>
2026-09-05 19:02:55 +00:00

20 lines
980 B
TypeScript

import { normalizeTaskCreate, normalizeTaskUpdate } from "@server/http/tasks/request";
import { describe, expect, it } from "vitest";
describe("server-owned Task execution annotations", () => {
it.each([
{ "agent-kanban.dev/launch": { state: "started" } },
{ "agent-kanban.dev/launch": null },
{ annotations: { "agent-kanban.dev/session-id": "forged-session" } },
{ annotations: { "agent-kanban.dev/session-id": null } },
{ annotations: null },
{ annotations: "replace-container" },
])("[spec: tasks/launch-request-binding] rejects forged or removed execution metadata: %j", (metadata) => {
expect(() => normalizeTaskCreate({ title: "Task", metadata })).toThrow();
expect(() => normalizeTaskUpdate({ metadata })).toThrow();
});
it("[spec: tasks/launch-request-binding] allows unrelated annotations", () => {
expect(() => normalizeTaskUpdate({ metadata: { annotations: { "example.com/ticket": "issue-1" } } })).not.toThrow();
});
});