MCPcopy Create free account
hub / github.com/apache/maka / ensureTranscriptLedger

Method ensureTranscriptLedger

packages/runtime/src/session-manager.ts:5457–5472  ·  view source on GitHub ↗
(
    sessionId: string,
    repair: RuntimeLedgerRepair,
    source: 'compatibility' | 'import',
  )

Source from the content-addressed store, hash-verified

5455 }
5456
5457 private async ensureTranscriptLedger(
5458 sessionId: string,
5459 repair: RuntimeLedgerRepair,
5460 source: 'compatibility' | 'import',
5461 ): Promise<void> {
5462 if (this.preparedTranscriptLedgers.has(sessionId)) return;
5463 const header = await this.deps.store.readHeader(sessionId);
5464 if (header.transcriptLedgerVersion === 0 && source !== 'import') {
5465 throw new Error('Imported Session history is still being prepared');
5466 }
5467 if (header.transcriptLedgerVersion !== 1) {
5468 await repair.materializeTranscriptLedger(header);
5469 await this.updateHeader(sessionId, { transcriptLedgerVersion: 1 });
5470 }
5471 this.preparedTranscriptLedgers.add(sessionId);
5472 }
5473
5474 private async prepareConversationRuntimeLedgerClone(
5475 sourceSessionId: string,

Callers 2

sendMessageMethod · 0.95

Calls 5

updateHeaderMethod · 0.95
hasMethod · 0.65
readHeaderMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected