( fixture: Fixture, workspaceId = "ws-dream" )
| 303 | } |
| 304 | |
| 305 | async function seedCompactionEpoch( |
| 306 | fixture: Fixture, |
| 307 | workspaceId = "ws-dream" |
| 308 | ): Promise<CompactionCompletionMetadata> { |
| 309 | await fixture.historyService.appendToHistory( |
| 310 | workspaceId, |
| 311 | createMuxMessage("pref-1", "user", "Please remember that I prefer concise tests.") |
| 312 | ); |
| 313 | await fixture.historyService.appendToHistory( |
| 314 | workspaceId, |
| 315 | createMuxMessage("compact-request", "user", "Please compact", { |
| 316 | muxMetadata: { type: "compaction-request", rawCommand: "/compact", parsed: {} }, |
| 317 | }) |
| 318 | ); |
| 319 | const summary = createMuxMessage("summary-1", "assistant", "The user prefers concise tests.", { |
| 320 | compactionBoundary: true, |
| 321 | compacted: "user", |
| 322 | compactionEpoch: 1, |
| 323 | }); |
| 324 | await fixture.historyService.appendToHistory(workspaceId, summary); |
| 325 | |
| 326 | const summaryHistorySequence = summary.metadata?.historySequence; |
| 327 | expect(typeof summaryHistorySequence).toBe("number"); |
| 328 | return { |
| 329 | workspaceId, |
| 330 | summaryMessageId: "summary-1", |
| 331 | summaryHistorySequence: summaryHistorySequence ?? -1, |
| 332 | compactionEpoch: 1, |
| 333 | compactionRequestMessageId: "compact-request", |
| 334 | }; |
| 335 | } |
| 336 | |
| 337 | describe("MemoryConsolidationService", () => { |
| 338 | it("runs, persists the journal record, and reports it via getRecord", async () => { |
no test coverage detected