Skip to content

Phase 6: NCMEC Reporting Pipeline#34

Merged
nullEFFORT merged 2 commits intomainfrom
phase6-ncmec
Mar 5, 2026
Merged

Phase 6: NCMEC Reporting Pipeline#34
nullEFFORT merged 2 commits intomainfrom
phase6-ncmec

Conversation

@nullEFFORT
Copy link
Owner

Summary

  • Wire ReportBuilder to POST /reports/ — XML generated on draft creation, not just a bare DB row
  • Wire NCMECClient to POST /reports/{id}/submit — real NCMEC submission replaces placeholder
  • Add LE summary endpoint, NCMEC status check, retract proxy, status lifecycle, evidence manifest
  • Reporter identity configurable via env vars; voice transcripts included in reports
  • ReportDetailPage dashboard with Summary/XML/Evidence tabs
  • 30 new tests (12 builder + 10 client + 8 API) — all passing

Issues Closed

Closes #27, #28, #29, #30, #31, #32, #33

Files Changed (16 files, +1664/-73)

Backend

  • server/nightshade/api/reports.py — 7 endpoints (create, submit, retract, status, xml, summary, ncmec/status)
  • server/nightshade/api/evidence.py — manifest endpoint
  • server/nightshade/config.py — reporter identity settings
  • server/nightshade/reporting/report_builder.py — voice transcripts, config reporter, removed auto-commit
  • server/nightshade/evidence/constants.py — REPORT_RETRACTED, REPORT_STATUS_CHANGE

Dashboard

  • ReportDetailPage.tsx (new) — tabs for Summary/XML/Evidence, submit/retract actions
  • ReportsPage.tsx — clickable rows, removed submitted_by from create
  • hooks-evidence-reports.ts — useReport, useReportXml, useReportSummary, useRetractReport
  • client.ts — getText() for plain text endpoints
  • types.ts — SubmissionResult interface
  • App.tsx — /reports/:id route

Tests

  • test_report_builder.py — 12 tests
  • test_ncmec_client.py — 10 tests
  • test_api/test_reports.py — 8 tests

Test plan

  • pytest tests/test_reporting/ tests/test_api/test_reports.py -v — 30/30 pass
  • npx tsc --noEmit — clean compile
  • POST /reports/ with valid session+subject returns draft with XML
  • GET /reports/{id}/summary returns formatted LE narrative
  • POST /reports/{id}/submit with NCMEC test env returns submitted status
  • Dashboard /reports shows clickable rows → /reports/:id detail page
  • Detail page tabs (Summary, XML, Evidence) render correctly

Generated with Claude Code

nullEFFORT and others added 2 commits March 5, 2026 01:27
Backend:
- Wire ReportBuilder.build_report() to POST /reports/ (generates XML on create)
- Wire NCMECClient.full_submission() to POST /reports/{id}/submit
- Add GET /reports/{id}/summary for LE plain-text narrative
- Add GET /reports/ncmec/status health check
- Add POST /reports/{id}/retract proxy to NCMEC
- Add PATCH /reports/{id}/status for admin transitions
- Add GET /evidence/manifest/{session_id} with files + chain of custody
- Reporter identity configurable via env vars (not hardcoded)
- Voice transcripts included in XML and LE summary reports
- Remove submitted_by from ReportCreate (derived from auth context)

Dashboard:
- ReportDetailPage with Summary/XML/Evidence tabs
- Report rows clickable in ReportsPage
- Hooks for report detail, XML text, LE summary, retract
- API client getText() method for plain text endpoints

Tests:
- 12 ReportBuilder tests (XML generation, build_report, LE summary)
- 10 NCMECClient tests (endpoint wrappers, full_submission orchestration)
- 8 API report tests (DB persistence, status transitions, filtering)
- All 30 tests pass

Closes #27, #28, #29, #30, #31, #32, #33

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mark Phase 6 items complete, add reporter identity env vars to .env.example.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nullEFFORT nullEFFORT merged commit 1fdb753 into main Mar 5, 2026
4 checks passed
@nullEFFORT nullEFFORT deleted the phase6-ncmec branch March 7, 2026 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wire ReportBuilder to create endpoint + add LE summary endpoint

1 participant