kimi-code/packages/agent-core-v2/test/record
haozhe.yang 8ee741007b refactor(agent-core-v2): fold replayBuilder into record
The record stream had three services: wireRecord (durable log), record
(live/facet facade), and replayBuilder (replay buffer). replayBuilder was
just one more projection of the same record stream, so fold it into record
and model the split as Event Store + Projection:

- record now owns the replay read model: push/patchLast/removeLastMessages/
  buildReplay/captureLiveRecords, plus the range/segment logic for partial
  resume (seeded via RecordServiceOptions).
- The two onRestoredRecord handlers collapse into one; record no longer
  injects IAgentReplayBuilderService.
- Drop the unused restore/flush/close forwarders from IAgentRecordService;
  orchestration keeps using wireRecord directly.
- replayBuilder keeps only its shared cross-domain types (AgentReplayRecord,
  ResumeSessionResult) as a types-only module; the service is removed.
- Update consumers (contextMemory, fullCompaction, goal, messageLegacy,
  agentLifecycle), the test harness, and stubs to IAgentRecordService.
- Add a record>contextMemory domain-layer exception: replay message records
  carry ContextMessage.
2026-07-02 20:10:11 +08:00
..
recordService.test.ts refactor(agent-core-v2): fold replayBuilder into record 2026-07-02 20:10:11 +08:00