Commit 90a185e
feat: add extraction analysis admin dashboard tab (#272)
* feat: mount discogs/musicbrainz data volumes on API service (read-only)
* feat: add extraction analysis router with versions endpoint (Task 2)
Add GET /api/admin/extraction-analysis/versions that scans flagged/
directories in the Discogs and MusicBrainz data roots and returns
versions with their entity types. Includes input validation, configure()
wiring in api.py, and full TDD test coverage (15 tests passing).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add extraction analysis summary endpoint and configure in test fixture (Task 3)
Wire _extraction_analysis_router.configure() into the shared test_client
fixture so the router is properly initialised in integration tests.
The summary endpoint (GET /api/admin/extraction-analysis/{version}/summary)
with all its helpers (_find_version_root, _read_violations, _load_state_marker,
_build_violation_summary) was introduced alongside Task 2; this commit
captures the test-fixture wiring that belongs to Task 3.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add violations list and detail endpoints (Task 4)
Adds GET /api/admin/extraction-analysis/{version}/violations with
pagination and entity_type/severity/rule filters, and
GET /api/admin/extraction-analysis/{version}/violations/{record_id}
returning raw XML and parsed JSON alongside violation records.
Includes _load_record_files helper and _make_flagged_version test
fixture shared by Tasks 4-6. 11 new tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add parsing-errors endpoint with defusedxml classification (Task 5)
Adds GET /api/admin/extraction-analysis/{version}/parsing-errors that
classifies each violation as parsing_error (XML has value, JSON doesn't),
source_issue (both lack the field), or indeterminate (files missing).
Results are cached in memory with a 5-minute TTL. Adds defusedxml and
pyyaml as api dependencies with matching type stubs. 7 new tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: add compare and prompt-context endpoints (Task 6)
Adds GET /api/admin/extraction-analysis/{version}/compare/{other_version}
returning per-rule direction deltas (improved/worsened/unchanged) between
two versions, and POST /api/admin/extraction-analysis/{version}/prompt-context
assembling violation records with raw XML, parsed JSON, and optional rule
definition loaded from extraction-rules.yaml. Also adds defusedxml, pyyaml,
and their type stubs as project dependencies. 11 new tests.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(dashboard): add extraction analysis proxy routes (Task 7)
Add 7 proxy routes for the extraction analysis API under
/admin/api/extraction-analysis/*, update path validation regex to
allow dots for version strings (e.g. 20240101.0), update affected
tests, and add full test coverage for all new routes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(dashboard): add Extraction Analysis tab HTML (Task 8)
Add tab button, sub-view CSS, and full panel HTML for the Extraction
Analysis tab: single-version report with pipeline status, violation
entity cards, and rule breakdown table; version comparison view; AI
prompt generator view; and record detail modal.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat(dashboard): add Extraction Analysis JavaScript logic (Task 9)
Add _esc() helper, EA state properties, event bindings, and all EA
methods: version fetching, report rendering (pipeline status, entity
cards, rule breakdown), record detail modal, version comparison,
select-all, prompt generation and clipboard copy. All dynamic content
uses textContent or programmatic DOM construction — never innerHTML
with API data.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* test: improve extraction analysis coverage to satisfy Codecov requirements
Add targeted tests for all 35 missing lines across extraction_analysis.py
and admin_proxy.py, bringing both files from 92%/96% to 100% coverage.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent e66b5bd commit 90a185e
13 files changed
Lines changed: 3148 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
259 | 264 | | |
260 | 265 | | |
261 | 266 | | |
| |||
397 | 402 | | |
398 | 403 | | |
399 | 404 | | |
| 405 | + | |
400 | 406 | | |
401 | 407 | | |
402 | 408 | | |
| |||
0 commit comments