Auditability in AGISystem2 means every reasoning step can be traced back to its inputs and rules. The AuditLog component records all operations with timestamps and provenance, creating an immutable trail for debugging, compliance, and trust.
Every query creates audit log entries that record the input, each reasoning step, and the final result. The log is immutable with hash chains for integrity. Any decision can be replayed to verify correctness or investigate issues.
| Event Type | Data Recorded | Purpose |
|---|---|---|
| QUERY_START | Input, context, active layers, mask | Reproduce initial conditions |
| CONCEPT_LOOKUP | Name, vector hash, retrieval time | Track data access |
| CONTAINMENT_CHECK | Concepts, distance, threshold, result | Explain IS_A decisions |
| BIAS_MASK_APPLIED | Mask dimensions, context | Fairness compliance |
| THEORY_PUSH/POP | Layer name, facts added | Counterfactual tracking |
| QUERY_RESULT | Output, confidence, duration | Performance and correctness |
{
"id": "a1b2c3d4",
"timestamp": "2024-01-15T10:30:00.123Z",
"event": "CONTAINMENT_CHECK",
"data": {
"subject": "Dog",
"predicate": "IS_A",
"object": "Animal",
"distance": 42,
"threshold": 100,
"result": true
},
"context": {
"queryId": "q789",
"layer": "base",
"mask": "full"
},
"prevHash": "abc123...",
"hash": "def456..."
}
Any logged query can be replayed to verify it produces the same result:
// Get original query from audit log
const entry = auditLog.getEntry("q789");
// Replay with same context
const replayResult = reasoner.replay(entry);
// Verify deterministic behavior
assert(replayResult.equals(entry.result));
// If not equal, something changed (data, code, or corruption)
Audit logs can be exported for regulatory compliance:
// Export all entries for a time range
auditLog.export({
format: "json", // or "csv"
from: "2024-01-01",
to: "2024-01-31",
events: ["BIAS_MASK_APPLIED", "QUERY_RESULT"],
output: "/reports/january-audit.json"
});
Hash chains ensure the log hasn't been tampered with:
// Verify entire log integrity
const valid = auditLog.verifyChain();
// Returns: { valid: true } or { valid: false, brokenAt: "entry#123" }
// Each entry's hash includes previous hash
hash(entry) = SHA256(entry.data + entry.prevHash)