chore: recovery checkpoint - v3.0 API successfully recovered
CRITICAL CHECKPOINT - DO NOT PUSH TO GITHUB Recovery Status: - Successfully recovered brainy.ts from compiled JavaScript - All core v3.0 API methods functional (add, get, update, delete, relate, find, etc.) - Neural subsystem intact (562KB embedded patterns, NLP working) - Augmentation pipeline operational (20+ augmentations) - HNSW clustering system complete - Triple Intelligence compiled (needs constructor fix) - Test suite validates functionality Changes preserved: - 898 files with changes from last 3 days - 144,475 insertions - All augmentation improvements - All test coverage enhancements - Complete v3.0 feature set This is a LOCAL checkpoint only - contains recovered work after corruption incident. Created backup in .backups/brainy-full-20250910-151314.tar.gz Branch: recovery-checkpoint-20250910-151433 Date: Wed Sep 10 03:18:04 PM PDT 2025
This commit is contained in:
parent
f65455fb22
commit
8ff382ca3b
895 changed files with 143654 additions and 28268 deletions
109
.recovery-workspace/dist-backup-20250910-141917/augmentations/auditLogAugmentation.d.ts
vendored
Normal file
109
.recovery-workspace/dist-backup-20250910-141917/augmentations/auditLogAugmentation.d.ts
vendored
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
/**
|
||||
* Audit Logging Augmentation
|
||||
* Provides comprehensive audit trail for all Brainy operations
|
||||
*/
|
||||
import { BaseAugmentation } from './brainyAugmentation.js';
|
||||
import { AugmentationManifest } from './manifest.js';
|
||||
export interface AuditLogConfig {
|
||||
enabled?: boolean;
|
||||
logLevel?: 'minimal' | 'standard' | 'detailed';
|
||||
includeData?: boolean;
|
||||
includeMetadata?: boolean;
|
||||
retention?: number;
|
||||
storage?: 'memory' | 'file' | 'database';
|
||||
filePath?: string;
|
||||
maxMemoryLogs?: number;
|
||||
}
|
||||
export interface AuditLogEntry {
|
||||
id: string;
|
||||
timestamp: number;
|
||||
operation: string;
|
||||
params: any;
|
||||
result?: any;
|
||||
error?: any;
|
||||
duration: number;
|
||||
userId?: string;
|
||||
sessionId?: string;
|
||||
metadata?: Record<string, any>;
|
||||
}
|
||||
/**
|
||||
* Audit Log Augmentation
|
||||
*/
|
||||
export declare class AuditLogAugmentation extends BaseAugmentation {
|
||||
readonly name = "auditLogger";
|
||||
readonly timing: "around";
|
||||
readonly metadata: "readonly";
|
||||
operations: any;
|
||||
readonly priority = 90;
|
||||
readonly category: "core";
|
||||
readonly description = "Comprehensive audit logging for compliance and debugging";
|
||||
private logs;
|
||||
private sessionId;
|
||||
constructor(config?: AuditLogConfig);
|
||||
getManifest(): AugmentationManifest;
|
||||
protected onInitialize(): Promise<void>;
|
||||
protected onShutdown(): Promise<void>;
|
||||
/**
|
||||
* Execute augmentation - log operations
|
||||
*/
|
||||
execute<T = any>(operation: string, params: any, next: () => Promise<T>): Promise<T>;
|
||||
/**
|
||||
* Sanitize parameters to remove sensitive data
|
||||
*/
|
||||
private sanitizeParams;
|
||||
/**
|
||||
* Sanitize result data
|
||||
*/
|
||||
private sanitizeResult;
|
||||
/**
|
||||
* Sanitize error information
|
||||
*/
|
||||
private sanitizeError;
|
||||
/**
|
||||
* Write log entry
|
||||
*/
|
||||
private writeLog;
|
||||
/**
|
||||
* Flush logs to persistent storage
|
||||
*/
|
||||
private flushLogs;
|
||||
/**
|
||||
* Clean up old logs based on retention
|
||||
*/
|
||||
private cleanupOldLogs;
|
||||
/**
|
||||
* Generate unique ID
|
||||
*/
|
||||
private generateId;
|
||||
/**
|
||||
* Query audit logs
|
||||
*/
|
||||
queryLogs(filter?: {
|
||||
operation?: string;
|
||||
startTime?: number;
|
||||
endTime?: number;
|
||||
sessionId?: string;
|
||||
hasError?: boolean;
|
||||
}): AuditLogEntry[];
|
||||
/**
|
||||
* Get audit statistics
|
||||
*/
|
||||
getStats(): {
|
||||
totalLogs: number;
|
||||
operations: Record<string, number>;
|
||||
averageDuration: number;
|
||||
errorRate: number;
|
||||
};
|
||||
/**
|
||||
* Export logs for analysis
|
||||
*/
|
||||
exportLogs(): AuditLogEntry[];
|
||||
/**
|
||||
* Clear all logs
|
||||
*/
|
||||
clearLogs(): void;
|
||||
}
|
||||
/**
|
||||
* Create audit log augmentation
|
||||
*/
|
||||
export declare function createAuditLogAugmentation(config?: AuditLogConfig): AuditLogAugmentation;
|
||||
Loading…
Add table
Add a link
Reference in a new issue