fathom.AuditLog¶
fathom.AuditLog
¶
Records audit entries from evaluation results via a pluggable sink.
Source code in src/fathom/audit.py
is_recording
property
¶
True when the configured sink actually persists records.
Lets :meth:fathom.engine.Engine.evaluate skip the working-memory
snapshot that only a real sink would ever consume.
__init__(sink)
¶
Create an audit log backed by the given sink.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sink
|
AuditSink
|
Pluggable sink that receives serialised audit records. |
required |
record(result, session_id, input_facts=None, modules_traversed=None, *, asserted_facts=None, log_level=LogLevel.SUMMARY)
¶
Write one audit record, honouring the winning rule's then.log.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
result
|
EvaluationResult
|
The evaluation result being recorded. |
required |
session_id
|
str
|
Session the evaluation ran under. |
required |
input_facts
|
list[dict[str, object]] | None
|
Working-memory snapshot taken before inference.
Written only at :attr: |
None
|
modules_traversed
|
list[str] | None
|
Overrides |
None
|
asserted_facts
|
list[AssertedFact] | None
|
Facts the rules themselves asserted. |
None
|
log_level
|
LogLevel
|
The |
SUMMARY
|