Skip to content

GAP-43: master_data_routes._save_master bypasses post-write schema validation #116

@warnes

Description

@warnes

Summary

master_data_routes.py:38–51 (_save_master) creates a backup and writes without running validate_master_data_file. The web_app.py version of the same helper does run validation and restores the backup on failure. Malformed writes through the routes module bypass the safety net.

Evidence

master_data_routes.py:38–51_save_master backs up and writes without validation.

web_app.py:1166–1191_save_master runs validate_master_data_file after writing, restores backup on failure.

Two implementations of the same write-path helper with different safety guarantees.

Impact

Writes routed through master_data_routes._save_master can corrupt Master_CV_Data.json without triggering the automatic backup-restore. This is a data integrity risk.

Acceptance criteria

  • A single _save_master implementation that always runs post-write validation with backup-restore on failure
  • All write routes use the validated version
  • The inconsistency between modules is resolved

Related

  • GAP-43 in tasks/gaps.md
  • Affected persona stories: US-M1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions