MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / recordFailure

Function recordFailure

src/skills/learning/failures.ts:120–128  ·  view source on GitHub ↗
(ev: Omit<FailureEvent, 'ts'>)

Source from the content-addressed store, hash-verified

118}
119
120export async function recordFailure(ev: Omit<FailureEvent, 'ts'>): Promise<void> {
121 try {
122 const full = failuresPath();
123 await fs.mkdir(path.dirname(full), { recursive: true });
124 await fs.appendFile(full, JSON.stringify({ ts: new Date().toISOString(), ...ev }) + '\n', 'utf-8');
125 } catch (e: any) {
126 logger.debug('Failure not recorded', { err: e?.message });
127 }
128}
129
130/** Read the failure log (most recent `limit` events, to bound memory). */
131export async function readFailures(limit = 2000): Promise<FailureEvent[]> {

Callers 1

recordToolFailureMethod · 0.85

Calls 2

failuresPathFunction · 0.85
debugMethod · 0.80

Tested by

no test coverage detected