Updates
jarvis-ci / node (push) Failing after 2m33s

This commit is contained in:
2026-09-11 14:00:44 -04:00
parent 8f6884ac42
commit 68d7a40605
12 changed files with 204 additions and 29 deletions
+22
View File
@@ -0,0 +1,22 @@
import { appendFile, mkdir } from 'node:fs/promises';
import path from 'node:path';
const ALLOWED = new Set(['event', 'state', 'code', 'lane', 'jobId', 'durationMs', 'success', 'reason']);
export class PrivacyLog {
constructor({ file = path.join(process.env.XDG_STATE_HOME || path.join(process.env.HOME || '/tmp', '.local/state'), 'jarvis/events.jsonl') } = {}) {
this.file = file;
}
async record(event, fields = {}) {
const safe = { ts: new Date().toISOString(), event };
for (const [key, value] of Object.entries(fields)) {
if (ALLOWED.has(key) && (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean')) safe[key] = value;
}
await mkdir(path.dirname(this.file), { recursive: true });
await appendFile(this.file, `${JSON.stringify(safe)}\n`, 'utf8');
return safe;
}
}
export { ALLOWED };