v0.3.0 — cost accountability + LLM call audit trail (#7)

Per-call recording of cost and I/O for every LLM probe. New tables prv_call_meta (schema v3) and prv_call_io. New admin pages: Costs (spend drill-down vs $5 cap) and Call Log (paginated + detail drawer). 90-day I/O retention prune via prv_daily_prune cron. P0 security: key never stored; gateway client exposes HTTP status only.

QA APPROVED 2026-06-15 SHA 09dc6db9ce
This commit is contained in:
peptiderepo
2026-06-15 17:07:08 +07:00
committed by GitHub
parent 2f4c1b2c72
commit 2e2c72cac6
37 changed files with 3246 additions and 325 deletions

View File

@@ -137,6 +137,20 @@ class PRV_Config {
);
}
/**
* Get the I/O retention window in days.
*
* Raw prompt + response text in prv_call_io is pruned after this many days.
* Cost/metadata in prv_call_meta is kept indefinitely.
*
* @return int Days; minimum 1, default PRV_IO_RETENTION_DEFAULT_DAYS.
*/
public static function get_io_retention_days(): int {
$val = (int) get_option( 'prv_io_retention_days', PRV_IO_RETENTION_DEFAULT_DAYS );
return max( 1, $val );
}
/**
* Default set of ~12 high-interest peptides (slug + human-readable label).
*