refactor: consolidate chat state and task bridges
Centralize session scope, chat projections and typed task bridges. Keep historical interaction replies authoritative and publish terminal state to subscribers. Validate Server contracts before replacing generated artifacts.
This commit is contained in:
@@ -10,10 +10,10 @@ it("restores plan history independently of chat messages after reconnecting", as
|
||||
const store = new SessionUiStateStore(directory);
|
||||
await store.initialize();
|
||||
const executionPlans = [{ revision: 1, nodes: [{ id: "sampling", status: "waiting" }] }];
|
||||
await store.write({ sessionId: "session-1" }, { sessionId: "session-1", messages: [], executionPlans });
|
||||
const reloaded = await new SessionUiStateStore(directory).read({ sessionId: "session-1" });
|
||||
await store.write({ sessionId: "session-1", actorKey: "actor-test", projectKey: "project-test" }, { sessionId: "session-1", messages: [], executionPlans });
|
||||
const reloaded = await new SessionUiStateStore(directory).read({ sessionId: "session-1", actorKey: "actor-test", projectKey: "project-test" });
|
||||
expect(reloaded?.executionPlans).toEqual(executionPlans);
|
||||
expect(await store.read({ sessionId: "other-session" })).toBeNull();
|
||||
expect(await store.read({ sessionId: "other-session", actorKey: "actor-test", projectKey: "project-test" })).toBeNull();
|
||||
} finally {
|
||||
await rm(directory, { recursive: true, force: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user