Service for generating and saving signal sync markdown reports.
Features:
constructor();
loggerService: any
getStorage: any
subscribe: (() => () => void) & ISingleshotClearable<() => () => void>
Subscribes to syncSubject to start receiving SignalSyncContract events.
Protected against multiple subscriptions via singleshot — subsequent calls
return the same unsubscribe function without re-subscribing.
The returned unsubscribe function clears the singleshot state, evicts all
memoized ReportStorage instances, and detaches from syncSubject.
unsubscribe: () => Promise<void>
Detaches from syncSubject and clears all accumulated data.
Calls the unsubscribe closure returned by subscribe().
If subscribe() was never called, does nothing.
tick: any
Handles a single SignalSyncContract event emitted by syncSubject.
Maps the contract fields to a SyncEvent, enriching it with a
createdAt ISO timestamp from getContextTimestamp() (backtest clock
or real clock aligned to the nearest minute).
For "signal-close" events, closeReason is preserved; for
"signal-open" events it is set to undefined.
Routes the constructed event to the appropriate ReportStorage bucket
via getStorage(symbol, strategyName, exchangeName, frameName, backtest).
getData: (symbol: string, strategyName: string, exchangeName: string, frameName: string, backtest: boolean) => Promise<SyncStatisticsModel>
Returns accumulated sync statistics for the given context.
Delegates to the ReportStorage bucket identified by
(symbol, strategyName, exchangeName, frameName, backtest).
If no events have been recorded yet for that combination, the returned
model has an empty eventList and all counters set to 0.
getReport: (symbol: string, strategyName: string, exchangeName: string, frameName: string, backtest: boolean, columns?: Columns$2[]) => Promise<string>
Generates a markdown sync report for the given context.
Delegates to ReportStorage.getReport. The resulting string includes a
markdown table (newest events first) followed by total / open / close
counters.
dump: (symbol: string, strategyName: string, exchangeName: string, frameName: string, backtest: boolean, path?: string, columns?: Columns$2[]) => Promise<void>
Generates the sync report and writes it to disk.
Delegates to ReportStorage.dump. The filename follows the pattern:
{symbol}_{strategyName}_{exchangeName}_{frameName}_backtest-{timestamp}.md{symbol}_{strategyName}_{exchangeName}_live-{timestamp}.mdclear: (payload?: { symbol: string; strategyName: string; exchangeName: string; frameName: string; backtest: boolean; }) => Promise<void>
Evicts memoized ReportStorage instances, releasing all accumulated event data.
payload — clears only the storage bucket identified by
(symbol, strategyName, exchangeName, frameName, backtest);
subsequent calls for that combination start from an empty state.payload — clears all storage buckets.Also called internally by the unsubscribe closure returned from subscribe().