How vettam/dpdp-compliance-scanner works
DPDP Compliance Scanner records personal-data observations from live pages and codebases, merges scans into a human-maintained data map, then interprets that map against a rule catalogue to produce findings, questions, and notice inputs. The main user path runs through the CLI or library entry point; page capture and code analysis are distinct sources. The README also describes map diffs, notice linting, rule explainers, and vendor matching. Edges below are limited to relationships shown in excerpts, the source index, or explicit README statements; unobserved connections are omitted.
Main entry points: cli/index.ts CLI commands · src/index.ts Library API · code/index.ts Code scan orchestration · playwright.ts Page capture
Components 26
User interfaces
- CLI commands
src/cli/index.ts - Library API
src/index.ts
Observation sources
- Page capture
src/engine/playwright.ts - Banner detection
src/engine/banner.ts - Geo lookup
src/geo/lookup.ts - Code scan orchestration
src/scanners/code/index.ts - JavaScript analysis
src/scanners/code/js/scan.ts - Python analysis
src/scanners/code/python/scan.ts - Manifest analysis
src/scanners/code/manifests/scan.ts
Data map
- Map schema
src/map/schema.ts - Map persistence
src/map/io.ts - Scan merge
src/map/merge.ts - Stable identifiers
src/map/ids.ts - Map diff
src/map/diff.ts - Map view
src/map/show.ts - Committed data map
Legal interpretation
- Rule catalogue
src/rules/loader.ts - Vendor dataset
src/vendors/loader.ts - Finding mapper
src/mapper/data-map.ts - Consent comparison
src/interaction/compare.ts
Reports and notices
- Finding reports
src/report/markdown.ts - Scan diff
src/diff/index.ts - Notice inputs
src/notice/index.ts - Notice lint
src/notice-lint/execute.ts - Rule explainers
src/explainers/build.ts
Other components
- Operator
Connections 34
- Operator → CLI commands: runs commands
README.md - Operator → Library API: calls API
README.md - CLI commands → Library API: dispatches scans
- Library API → Page capture: captures page
src/index.ts - Page capture → Banner detection: detects banner
src/engine/playwright.ts - Page capture → Geo lookup: looks up geography
src/engine/playwright.ts - CLI commands → Code scan orchestration: dispatches code scan
src/cli/index.ts - Code scan orchestration → Manifest analysis: scans manifests
src/scanners/code/index.ts - Code scan orchestration → JavaScript analysis: scans JavaScript
src/scanners/code/index.ts - Code scan orchestration → Python analysis: scans Python
src/scanners/code/index.ts - Code scan orchestration → Vendor dataset: loads dataset
src/scanners/code/index.ts - Library API → Finding mapper: maps observations
src/index.ts - Library API → Rule catalogue: loads rules
src/index.ts - Library API → Vendor dataset: loads trackers
src/index.ts - Library API → Consent comparison: compares consent
src/index.ts - Library API → Scan merge: emits map scan
src/index.ts - Scan merge → Stable identifiers: assigns identifiers
- CLI commands → Map persistence: reads and writes
src/cli/index.ts - Map persistence → Map schema: validates map
src/map/io.ts - Map persistence → Committed data map: persists YAML
README.md - CLI commands → Scan merge: merges scan
- CLI commands → Map diff: diffs maps
src/cli/index.ts - CLI commands → Map view: shows map
- Finding mapper → Rule catalogue: applies catalogue
README.md - Finding mapper → Vendor dataset: matches recipients
- Library API → Finding reports: renders findings
src/index.ts - CLI commands → Finding reports: writes reports
- CLI commands → Scan diff: diffs scans
- CLI commands → Notice inputs: builds notice inputs
- Notice inputs → Map diff: classifies changes
src/notice/index.ts - Notice inputs → Map view: reads questions
src/notice/index.ts - CLI commands → Notice lint: runs lint
src/cli/index.ts - CLI commands → Rule explainers: prints explanations
- Rule explainers → Rule catalogue: loads rules
src/explainers/build.ts