feat(FN-1096): add task agent assignment persistence and API

- Add assignedAgentId to core task types, database schema migration, and TaskStore persistence flows
- Implement dashboard assignment API routes for setting and clearing task-to-agent assignments
- Expand core and dashboard test coverage for persistence, migration behavior, and assignment route handling
- Add a changeset for the published CLI package to document the assignment core update
This commit is contained in:
gsxdsm
2026-04-07 22:53:47 -07:00
parent d9344cee27
commit f123f958bb
8 changed files with 261 additions and 13 deletions

View File

@@ -93,7 +93,7 @@ describe("Database", () => {
});
it("seeds schema version", () => {
expect(db.getSchemaVersion()).toBe(12);
expect(db.getSchemaVersion()).toBe(13);
});
it("seeds lastModified", () => {
@@ -116,7 +116,7 @@ describe("Database", () => {
it("is idempotent - calling init() twice does not fail", () => {
expect(() => db.init()).not.toThrow();
expect(db.getSchemaVersion()).toBe(12);
expect(db.getSchemaVersion()).toBe(13);
});
it("does not overwrite existing config on re-init", () => {
@@ -723,7 +723,7 @@ describe("schema migrations", () => {
db.init();
// Verify version bumped to 5 (includes v1→v2, v2→v3, v3→v4, and v4→v5 migrations)
expect(db.getSchemaVersion()).toBe(12);
expect(db.getSchemaVersion()).toBe(13);
// Verify new columns exist and existing data is intact
const cols = db.prepare("PRAGMA table_info(tasks)").all() as Array<{ name: string }>;
@@ -748,11 +748,11 @@ describe("schema migrations", () => {
const db = new Database(kbDir);
db.init();
expect(db.getSchemaVersion()).toBe(12);
expect(db.getSchemaVersion()).toBe(13);
// Re-init should not fail
db.init();
expect(db.getSchemaVersion()).toBe(12);
expect(db.getSchemaVersion()).toBe(13);
db.close();
});
@@ -847,7 +847,7 @@ describe("schema migrations", () => {
db.init();
// Verify version bumped to 5
expect(db.getSchemaVersion()).toBe(12);
expect(db.getSchemaVersion()).toBe(13);
// Verify new columns exist and existing data is intact
const cols = db.prepare("PRAGMA table_info(tasks)").all() as Array<{ name: string }>;
@@ -1057,7 +1057,7 @@ describe("createDatabase factory", () => {
const db = createDatabase(kbDir);
db.init();
expect(db.getSchemaVersion()).toBe(12);
expect(db.getSchemaVersion()).toBe(13);
expect(db.getLastModified()).toBeGreaterThan(0);
db.close();