Causality Analyzer
    Preparing search index...

    Tamper-evident audit trail.

    Example:

    const audit = await AuditTrail.create();
    await audit.append('analysis.start', { graphId: 'g1', nodes: 5 });
    await audit.append('rca.result', { rootCause: 'Memory', score: 0.87 });
    const result = await audit.verify();
    console.log(result.valid); // true
    Index
    • Append an entry to the audit trail.

      Parameters

      • type: AuditEntryType

        — entry type

      • payload: unknown

        — arbitrary JSON-serializable data

      Returns Promise<AuditEntry>

      the appended entry

    • Verify the integrity of the entire audit trail.

      Checks:

      1. Each entry's hash matches its content
      2. Each entry's previousHash matches the previous entry's hash
      3. Entry indices are sequential

      Returns Promise<AuditVerifyResult>

      verification result with tampered indices

    • Restore audit trail from JSON snapshot. Verifies integrity on restore.

      Parameters

      • entries: AuditEntry[]

      Returns Promise<AuditTrail>

      if the snapshot fails verification