Skip to content

feat: metadata drift detector between backend and on-chain records (#…#1003

Merged
Cedarich merged 3 commits into
Pulsefy:mainfrom
codewithzubair07:fix/issue-882-metadata-drift-detector
Jun 30, 2026
Merged

feat: metadata drift detector between backend and on-chain records (#…#1003
Cedarich merged 3 commits into
Pulsefy:mainfrom
codewithzubair07:fix/issue-882-metadata-drift-detector

Conversation

@codewithzubair07

Copy link
Copy Markdown
Contributor

Fixes #882

Detects when off-chain backend metadata (ProjectView/ProjectMilestone) falls out of sync with on-chain identifiers or status.

  • MetadataDriftDetector (src/metadata_drift_detector.py) recomputes canonical project/milestone state from the immutable ContractEvent log and diffs it against the mutable ProjectView/ProjectMilestone materialized views. Strictly read-only with respect to source data.
  • New MetadataDriftFinding table + PostgresService persistence methods (save/get/mark-reviewed), following the existing RoundAnomalySignal review pattern.
  • scripts/detect_metadata_drift.py for manual execution (--project-id, --no-persist, --json).
  • Registered as a 6-hourly scheduled job in src/scheduler.py.
  • tests/test_metadata_drift_detector.py: 8 tests covering no-drift baseline, status/amount/milestone drift, missing records, non-mutation of source data, multi-project runs, and persistence of findings.
  • METADATA_DRIFT_DETECTOR.md mapping the implementation to each acceptance criterion.

@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@codewithzubair07 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Cedarich Cedarich merged commit 299f3b2 into Pulsefy:main Jun 30, 2026
1 check passed
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.

Data-processing: Metadata drift detector between backend and on-chain records

2 participants