Q26: knowledge has scope, expiry, and supersession
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8c70111c93
commit
18128b5ad4
14 files changed
+252
-56
No files matched your search
@@ -56,6 +56,9 @@ describe("run memory", () => {
|
||||
topic: expect.stringMatching(/^Outcome: /), category: "run_outcome",
|
||||
content: "Chose Postgres for bookings; MySQL lacked the JSON features we need.", source_type: "task_run",
|
||||
}]);
|
||||
const project = (h.connection.db.prepare("select t.project_id from tasks t join task_runs r on r.task_id = t.id where r.id = ?").get(kickoff.id) as { project_id: string | null }).project_id;
|
||||
expect(project).not.toBeNull();
|
||||
expect(h.connection.db.prepare("select scope_type, scope_id from knowledge_entries").get()).toEqual({ scope_type: "project", scope_id: project });
|
||||
h.connection.close();
|
||||
});
|
||||
|
||||
|
||||
@@ -65,8 +65,8 @@ describe("task prompt scope", () => {
|
||||
await execution.executeRun(kickoff!.org_id, kickoff!.id);
|
||||
|
||||
const task = connection.db.prepare("select id from tasks where org_id = ? and title = 'Build the booking API'").get(orgId) as { id: string };
|
||||
new KnowledgeService(connection.db).create({ orgId, topic: "Booking storage", category: "decision", content: "Bookings live in Postgres.", importance: "high", sourceType: "employee", sourceId: null });
|
||||
new KnowledgeService(connection.db).create({ orgId, topic: "Offsite venue", category: "fact", content: "Lisbon in May.", importance: "low", sourceType: "employee", sourceId: null });
|
||||
new KnowledgeService(connection.db).create({ orgId, topic: "Booking storage", category: "decision", content: "Bookings live in Postgres.", importance: "high", sourceType: "employee", sourceId: null, scopeType: "organization", scopeId: null, validUntil: null, supersedesId: null });
|
||||
new KnowledgeService(connection.db).create({ orgId, topic: "Offsite venue", category: "fact", content: "Lisbon in May.", importance: "low", sourceType: "employee", sourceId: null, scopeType: "organization", scopeId: null, validUntil: null, supersedesId: null });
|
||||
await execution.runTask({ orgId, taskId: task.id });
|
||||
|
||||
const danaId = (connection.db.prepare("select id from agents where org_id = ? and name = 'Dana Lee'").get(orgId) as { id: string }).id;
|
||||
|
||||
Reference in new issue
Block a user