Skip to contents

Reads {output_dir}/ai_decisions.jsonl and produces a summary of all recorded decisions. Useful for post-analysis review and reporting.

Usage

summarize_audit_log(output_dir)

Arguments

output_dir

Character. The same output directory passed to init_audit_log.

Value

A named list with:

total_decisions

Integer. The total number of logged decisions.

decisions_by_type

Named integer vector of counts per decision_type.

decisions_by_step

Named integer vector of counts per pipeline step.

new_codes_timeline

A data.frame with columns timestamp and cumulative_codes, showing the running total of new codes over time.

entries_skipped

Integer. The number of entry_skipped decisions.

merge_decisions_accepted

Integer. Merge decisions where action == "merge".

merge_decisions_standalone

Integer. Merge decisions where action == "standalone".

total_ai_requests

Integer count of ai_request records, one per ai_complete call.

total_tokens_used

Integer. The sum of usage_total across all ai_request records, with NA values dropped.

ai_requests_by_model

Named integer vector of ai_request counts per model name.

methodology_modes_observed

Character vector of the unique non-NA values of the methodology_mode field across all records. This is normally length-1 or length-0; a length above 1 marks a run whose methodology was changed mid-pipeline.

Details

Some fields (total_ai_requests, total_tokens_used, ai_requests_by_model, methodology_modes_observed) are absent from very old audit logs. For those logs the summary returns zero or empty values for the missing keys, while the remaining counts still surface in decisions_by_type and decisions_by_step as usual.