Files
basicmachines-co-basic-memory/tests/services
claude[bot] 985f650a62 fix: Prevent deletion of user-created projects during reconciliation
Add managed_by field to Project model to distinguish between:
- CONFIG: Projects managed by config file (can be auto-deleted)
- USER: Projects created via API/MCP (never auto-deleted)

This fixes issue #413 where user-created projects were being deleted
during system startup because they weren't in the config file.

The fix preserves the behavior from issue #193 (cleaning up orphaned
config projects) while protecting user-created projects.

Changes:
- Add ProjectManagementType enum and managed_by field to Project model
- Add database migration for managed_by column (defaults to 'config')
- Update add_project() to set managed_by=USER for API-created projects
- Update synchronize_projects() to only delete CONFIG-managed projects
- Add regression test to ensure USER projects are never auto-deleted
- Update existing test to validate CONFIG projects are still cleaned up

Closes #413

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Paul Hernandez <phernandez@users.noreply.github.com>
2025-11-03 21:59:49 +00:00
..
2025-02-12 22:39:22 -06:00