Repository navigation
Audit and remediation: 26 passes of fixes and regression tests - #143
Conversation
Twenty-four audit passes over the grading core, judges, targets, experiment caching, tracing and docs. Every confirmed finding is fixed at its root with a regression test; AUDIT.md records each finding, fix, verification result, the pass log and 22 documented remaining risks. Highlights: - Security: remove a committed Open WebUI API key default from examples/audit_openwebui_rag.py (rotation is still required); redact credentials in span attributes, span names, header text, tool events and URLs without hiding evidence the judge grades; fail-closed OTLP auth; auditor no longer inherits judge credentials across providers. - Grading: verdict parsing and severity normalisation hardened (stray keys, think tags, off-ladder values, contradictions); SingleTurnAuditor and ModelAuditor now grade the same input the same way (documents, default prompts, validation order, scenario_meta, empty ASR transcripts). - Experiment cache: content-based fingerprints (judge logic, scenario text, dates, attachment bytes), safe quarantine of stale runs, resume re-runs only errored scenarios, case-insensitive label collisions. - Tracing: 16 MiB body cap on HTTP and gRPC receivers, lowercase OTLP ids, corrected exporter env-var docs. - Docs/examples: corrected README claims and the inverted custom-judge rubric; examples no longer crash on ERROR results. Verification: 2396 passed, 2 skipped; `ruff check --select E9,F821` clean.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Pass 25 (partial, Haiku review of pass-24 changes): file:// URIs with percent-escapes were fingerprinted by path, so a regenerated clip could reuse stale cached runs. Decode the path as the ASR target does. Records pass 25 in AUDIT.md; the two-clean-pass criterion is still open.
AUDIT.md is an internal working log and must not be published.
8807346 to
3d4ff80
Compare
- Redact secrets in span/tool text that is not strict JSON (Python repr, truncated or trailing JSON), env assignments (*_PASSWORD=) and curl -u. - Redact URL passwords containing / or @; treat pwd/pass/jwt/sid/session_id query parameters as secrets. - Resume with adaptive_reruns off sets aside saved adaptive reruns instead of silently dropping them from the combined results. - Inspect severity_counts counts between-step values toward the more severe. - Local attachments with # or ? in the name are typed by their real extension. - An off-ladder default-judge severity records parse_error and the reason.
- Checklist: duplicate entries that agree on status keep the one whose quote verifies, so the grade no longer depends on entry order; violated optional items are not listed as issues. - Saved results get the usual umask mode instead of mkstemp's 0600. - Redact provider API keys (sk-, ghp_, AKIA, xox, AIza, hf_) in free span and tool text; config.json redaction covers connection strings, pwd, dsn and signing keys. - A fully cached experiment is not reported cancelled; a combined results file listing models this run omits is set aside instead of overwritten.
Found while testing PR #143 live against an OpenAI-compatible endpoint: - AuditExperiment(max_parallel_reps=N) runs independent repetitions of run_scenario_reps concurrently (default 1 keeps the old behaviour); live, 4 reps went from 26 s to 7 s with results in rep order. - ModelAuditor.aclose() closes the HTTP clients it created; sync run() and each experiment repetition call it, so clients no longer close on a dead event loop ('Event loop is closed' tracebacks, sockets held open). - An auditor probe that is empty only after <think> stripping is retried under max_retries instead of failing the scenario at once.
Live end-to-end testRan this branch against a real OpenAI-compatible endpoint (Qwen3.8-27B-FP8), with that model acting as the target, the judge and the auditor. 31/31 checks passed. The API key was supplied through an environment variable only and does not appear in any saved file.
Fixes from live testing (commit 700aea8)
Efficiency notes
Unit suite: 2424 passed, 2 skipped; |
|
@kelkalot could you take a look at this PR? The live test results are in the comment above, and the PR description lists the behaviour changes to check before merging. |
Summary
Audit and remediation of SimpleAudit: 26 review passes over the grading core, judges, targets, experiment caching, tracing and docs. Every confirmed finding is fixed with a regression test (2420 passed, 2 skipped;
ruff check --select E9,F821clean).Highlights
sk-,ghp_,AKIA…), tool events and URLs, tuned so the judge still sees the evidence it grades. OTLP auth fails closed. The auditor no longer inherits the judge's key across providers. Hard-coded keys removed from history.SingleTurnAuditorandModelAuditorgrade the same input the same way.Behaviour changes to note
error_phase/parse_error/scenario_metadata;ModelStabilityReport.to_dict()addsn_ungraded.adaptive-settings.json; saved files now use the normal umask mode.Known limits
vision_integrityandcontext_groundingpacks don't yet meet the pack-checker conventions.Test plan
.venv/bin/pytest -q -n auto -p no:cacheprovider --no-cov: 2420 passed, 2 skipped.venv/bin/ruff check --select E9,F821 .: clean