Skip to contents

Appends one JSON line to the JSONL audit file.

Usage

log_ai_decision(audit, step, decision_type, ...)

Arguments

audit

An AuditLog object returned by init_audit_log.

step

Character. The pipeline step the decision belongs to. Accepts "coding", "sentiment", "theming", "saturation", "insight", or "synthesis".

decision_type

Character. One of "code_assignment", "new_code_created", "entry_skipped", "merge_decision", "sentiment_assignment", "saturation_signal", "theme_structure", or "insight_generation".

...

Additional named fields to include in the JSON record (e.g. entry_id, code_name, rationale, model, tokens_used).

Value

Invisibly returns audit (for pipe-friendly usage).