Skip to content

features privacy reporting

Douwe de Vries edited this page Jul 1, 2026 · 1 revision

Privacy reporting

Active contributors: Douwe de Vries

Purpose

Privacy reporting gives users a post-transform summary of what changed, what needs review, what evidence was checked, and how much utility was preserved. Reports are built in the Rust core and rendered by the frontend after CSV file anonymization, paste transformation, and quick generation.

Directory layout

Path Role
crates/csv-anonymizer-core/src/release_report.rs Readiness, evidence, column decisions, utility metrics, standard notes, and Smart rejection labels
crates/csv-anonymizer-core/src/report_notes.rs Notes for unselected columns and high or medium detector-risk leftovers
crates/csv-anonymizer-core/src/types.rs PrivacyReport, PreflightData, readiness, evidence, column report, and utility metric DTOs
crates/csv-anonymizer-core/src/service.rs build_privacy_report and preflight report assembly
frontend/src/components/PrivacyReportSummary.tsx Public component export for privacy report rendering
frontend/src/components/privacy-report/ Report UI components, helpers, status labels, metric grids, evidence, utility, and column decisions

Key abstractions

Abstraction Source Notes
PrivacyReport crates/csv-anonymizer-core/src/types.rs Result report returned after a transform or quick generation.
PreflightData crates/csv-anonymizer-core/src/types.rs Pre-run readiness, evidence, and column reports used to block or warn before preview or output.
ReleaseReadiness release_report.rs Status plus blockers, review items, and verified items.
ReleaseEvidenceItem release_report.rs Evidence row with verified, review, blocked, or info status.
ColumnReleaseReport release_report.rs Per-column decision, action, detail, strategy, and risk.
UtilityMetric release_report.rs Metrics such as selected column coverage, repeat reuse, and Local AI acceptance.
Report notes report_notes.rs and release_report.rs Human-readable caveats and follow-up notes.

How it works

flowchart TD
    Transform[Transform result] --> CoreReport[build_privacy_report]
    CoreReport --> Counts[Identifier and strategy counts]
    CoreReport --> Readiness[Readiness]
    CoreReport --> Evidence[Evidence]
    CoreReport --> Columns[Column decisions]
    CoreReport --> Utility[Utility metrics]
    CoreReport --> Notes[Notes]
    Counts --> UI[PrivacyReportSummary]
    Readiness --> UI
    Evidence --> UI
    Columns --> UI
    Utility --> UI
    Notes --> UI
Loading

service.rs builds PrivacyReport from selected column metadata and the TransformReport collected during transformation. The report includes direct identifier counts, quasi-identifier counts, sensitive column count, strategy counts, pseudonym and token counts, Smart replacement accepted values, Smart replacement rejections and reasons, Smart replacement fallbacks, readiness, evidence, column decisions, utility metrics, and notes.

Readiness is built by build_readiness. It verifies randomized replacement behavior and flags high or medium detector-risk columns that were left unselected. It also adds review items when Smart replacement candidates were rejected and always reminds the user that transformed CSV output is risk reduction, not a formal anonymity guarantee.

Evidence is built by build_evidence. It records column coverage, detector-risk review, and Local AI validation when Smart replacement was requested. Evidence items carry statuses that the frontend renders as pills.

Column decisions are built by build_column_reports. Each source column gets an action such as Masked, Redacted, Tokenized, Smart replacement, Pass-through, Pseudonymized, No-op/pass-through, or Unselected. The status and detail explain whether the action is verified, review, or informational.

Utility metrics are built by build_utility_metrics. They include selected column coverage, repeated source reuse, and Local AI accepted values when transform context is available.

Notes are built by standard_notes and report_notes.rs. They describe standard transform behavior, residual anonymity limits, unselected columns, pseudonym and token reuse, collision avoidance, pseudonym pool exhaustion, Smart replacement review, structured scalar redaction warnings, Smart rejection counts, and fallback counts.

Frontend rendering

frontend/src/components/PrivacyReportSummary.tsx re-exports the report component from frontend/src/components/privacy-report/PrivacyReportSummary.tsx. The component computes overview metrics for readiness, transformed columns, sensitive columns, and pass-through or no-op columns.

The privacy-report subcomponents render the report in sections:

  • PrivacyMetricGrid.tsx renders overview, advanced, Smart replacement, utility, and evidence metrics.
  • PrivacyReportColumnDecisions.tsx renders the first 12 column decisions with risk, strategy, status, action, and details.
  • ReportDisclosure.tsx wraps expandable Smart replacement, advanced counts, utility, and evidence sections.
  • helpers.ts formats status labels, metric values, sensitive summaries, transformation summaries, pluralized counts, and Smart rejection reason labels.

Integration points

Entry points for modification

  • Add or change report DTO fields in crates/csv-anonymizer-core/src/types.rs and mirror them in frontend/src/types.ts.
  • Change post-transform report assembly in crates/csv-anonymizer-core/src/service.rs.
  • Change readiness, evidence, column decisions, utility metrics, or Smart rejection labels in crates/csv-anonymizer-core/src/release_report.rs.
  • Change unselected-column notes in crates/csv-anonymizer-core/src/report_notes.rs.
  • Change frontend report layout in frontend/src/components/privacy-report/PrivacyReportSummary.tsx.
  • Change metric formatting and status labels in frontend/src/components/privacy-report/helpers.ts.

Key source files

File Why it matters
crates/csv-anonymizer-core/src/release_report.rs Builds readiness, evidence, utility metrics, column decisions, and standard notes.
crates/csv-anonymizer-core/src/report_notes.rs Adds notes about unselected columns.
crates/csv-anonymizer-core/src/types.rs Defines report and preflight contracts.
crates/csv-anonymizer-core/src/service.rs Assembles the final report from metadata and transform counters.
frontend/src/components/privacy-report/PrivacyReportSummary.tsx Renders overview and report sections.
frontend/src/components/PrivacyReportSummary.tsx Public component export used by workflows.

Clone this wiki locally