v0.71.3 — Compliance / annex / audit / energy
Sixth patch in the post-v0.71.0 chain — the EU AI Act + carbon + audit surfaces deferred from v0.59.0 go live. Pure-Python; smoke-validated on a real RTX 3050.
What's New
- Energy & CO2 measurement —
soup train --track-energywraps the training window in a codecarbon offline tracker (no IP-geolocation network call) and reports kWh / CO2 / grid intensity, feeding them into--annex-xi.--energy-country <ISO3>picks the grid for the CO2 estimate (defaultUSA). NewEnergyTrackercontext manager; graceful no-op when codecarbon is absent. - PDF compliance docs —
soup train --annex-xi report.pdfrenders a reportlab PDF of the EU AI Act Annex XI/XII (a.mdpath still renders markdown). The top crawled domains of your training corpus are auto-extracted and listed. - Per-command audit log — every
soupcommand now appends one HIPAA/SOC2-shaped record to~/.soup/audit.jsonl(secrets redacted, args capped). Opt out withsoup --no-audit-log <cmd>orSOUP_NO_AUDIT_LOG=1. Tail/rotate withsoup audit-log. - Signed Soup Cans (v3) —
soup can pack --attest <statement.json>(repeatable) embeds in-toto Statements into a v3 can manifest; v1/v2 cans still load. - Airgap reproducibility receipts —
soup airgap-bundle --repro-receipt <receipt.json>embeds an SR 11-7 receipt asrepro-receipt.json(auto-detected from<model>/repro-receipt.jsonwhen not supplied).
Closes #180, #181, #182, #183, #184, #188.
Install / Upgrade
pip install -U soup-cli # core
pip install -U 'soup-cli[carbon]' # + codecarbon for --track-energy
pip install -U 'soup-cli[pdf]' # + reportlab for --annex-xi *.pdfSecurity
soup can pack --attestrejects oversize attestation files by raw size before parsing them into memory (memory-exhaustion defence).- All new file-loading paths (attestation JSON, airgap receipt, training-corpus scan, PDF write) are cwd-contained + TOCTOU symlink-rejected + size-capped.
- The audit auto-log redacts
hf_/sk-/Bearertokens across every field, uses0o600+O_NOFOLLOW, and never crashes the CLI on a broken log.
Known Limitations
- codecarbon energy figures are hardware-estimated — on hosts without RAPL/NVML, codecarbon falls back to a CPU-TDP constant; the kWh is an estimate, not a meter reading. The CO2 / grid intensity reflect the
--energy-countrygrid (kWh is country-independent). This is a codecarbon characteristic, not a Soup defect. --track-energyfeeds--annex-xionly — the measurement is not yet auto-threaded intosoup bom emit; the BOMattach_energysurface (v0.59.0) remains a manual call.- Audit auto-log is default-ON — a deliberate behaviour change for the regulated-org use case (local file under
~/.soup, not telemetry); opt out per-invocation or via env. - PDF rendering is block-level — headings / bullets / paragraphs only; inline emphasis is not interpreted. Operator-controlled strings are XML-escaped.
measure_run_energystays a duration-onlyNone-returning fallback — it cannot read instantaneous power from a wall-clock number; useEnergyTrackerfor a real start/stop measurement.
🤖 Generated with Claude Code