name: flask-redundancy-refactor-p0 description: Implement exactly one P0 item from redundancy-audit.md in a Flask backend with contract snapshots and a single commit.
Flask Redundancy Refactor P0
Goal
Read redundancy-audit.md, implement exactly one P0 item, and make one commit. Preserve behavior. Do not add dependencies.
Workflow
Read redundancy-audit.md
- Select exactly one P0 cluster.
- If no P0 exists, stop and report that no P0 items are available.
Create a contract snapshot before changes
- Create docs/contract_snapshots if it does not exist.
- Create a file named docs/contract_snapshots/
.md. - Add a Before section that captures public contracts
- Routes and HTTP methods
- Request and response shapes
- Background jobs or CLI commands if relevant
- Config or environment variables touched
- Tests that cover the behavior
Implement the refactor
- Remove redundancy using a single shared helper or service.
- Keep changes minimal and localized.
- Preserve external behavior and existing APIs.
Update the contract snapshot
- Add an After section with the same structure as Before.
- Note any behavior that is intentionally unchanged.
Tests
- Run existing tests if they are fast and available.
- If a regression test is feasible without new dependencies, add one minimal test.
Commit
- Make exactly one commit.
- Suggested message: refactor: resolve redundancy
Guardrails
- Do not touch auth, billing, or security logic.
- Do not refactor more than one P0 cluster.
- Do not change dependencies or deployment configuration.