feat: --format html — visual triage report with per-file spectrum plots (v1.3.0)#45
Merged
Conversation
…ts (v1.3.0) Adds a fourth report format: a single self-contained HTML page you open in a browser. Two parts: a sortable/filterable triage table, and a detail card with an inline-SVG spectrum plot for every flagged file, so the MP3 "cliff" (a sharp magnitude drop well below Nyquist) is visible to the eye, with the detected cutoff marked. Design: no new dependency (numpy is already core; the curve is drawn as a hand-rolled inline <svg> polyline — no matplotlib, no PNGs). The core analysis path is untouched — spectra are recomputed at report time and only for flagged files, so the per-file result dict carries no extra payload and json/csv stay lean. A file not natively readable simply shows no plot; the report never fails because one curve could not render. - New reporting/html_reporter.py (HTMLReporter, exported from the package). - Wire --format html (argparse choice + dispatch + .html extension). - Refactor the format dispatch out of generate_final_report into _write_report to keep it within the C901 complexity budget. - Tests in tests/test_html_reporter.py (structure, ranking, escaping, SVG render for a readable flagged file, graceful placeholder, curve shape). - Docs: README + user-guide; version bump 1.2.0 -> 1.3.0 across the repo. Backward compatible; no detection-logic change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| return str(p.relative_to(root)) | ||
| except ValueError: | ||
| continue | ||
| except Exception: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The reports told you which files were suspect (text/csv) or handed raw numbers to a script (json). This adds a way to see why — a fourth format,
--format html: a single self-contained page you double-click to open.Two parts:
This is also the microscope for eyeballing band-limited false-positives and validating field findings.
Design (lightweight, on-brand)
<svg>polyline — no matplotlib, no PNGs, no base64.Changes
reporting/html_reporter.py(HTMLReporter, exported fromflac_detective.reporting).--format html(argparse choice + dispatch +.htmlextension).generate_final_reportinto_write_report(keeps it within the C901 budget).tests/test_html_reporter.py— structure, ranking, HTML escaping, SVG render for a readable flagged file, graceful placeholder, curve shape.Verification
black --check,isort --check-only,flake8,mypyall clean.pytest(excl. integration/benchmarks): 163 passed, 8 pre-existing skips.flac-detective <dir> --format htmlwrites a valid.html; SVG rendering covered by a unit test on a synthetic band-limited file.Backward compatible; no detection-logic change.
🤖 Generated with Claude Code