Commit Graph
8 Commits
Author SHA1 Message Date
windyboy 0a6bddcc7e refactor review-plan safety and validation 2026-04-07 11:00:47 +08:00
windyboy 2dd329cba9 refactor CLI command modules and synchronize docs 2026-02-16 12:31:26 +08:00
windyboy 0be802eac5 chore: snapshot current project updates 2026-02-13 13:36:39 +08:00
windyboyandClaude Sonnet 4.5 71e67ab65c Add schema versioning to all remaining data files
Adds vlm_schema_version field to all data file formats for schema
evolution and migration tracking. Task #1 already added versioning
to identities.json; this completes the remaining files.

Changes to scanner.py:
- Add "# vlm_schema_version: 1.0" as first comment line in inventory.csv

Changes to commands/analyze.py:
- Add "vlm_schema_version": "1.0" to analysis.json root

Changes to planner.py:
- Add "vlm_schema_version": "1.0" to plan.json root

Changes to executor.py:
- Add "vlm_schema_version": "1.0" to rollback log JSON

Schema versions:
- inventory.csv: 1.0 (in comment header)
- identities.json: 1.0 or 2.0 (set by parse command)
- analysis.json: 1.0
- plan.json: 1.0
- rollback_log.json: 1.0

Future migrations:
- Version field allows detecting old formats
- Can implement auto-migration logic
- Can warn users about version mismatches
- Enables schema evolution without breaking changes

Testing:
- All 449 tests pass
- No test changes needed (backward compatible)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 09:54:11 +08:00
windyboyandClaude Sonnet 4.5 d6c8852e1e Fix quarantine non-atomic operations with two-phase commit
Implements atomic quarantine/restore operations using two-phase commit
pattern to prevent orphaned files when manifest updates fail.

Changes to models.py:
- Add status field to QuarantineEntry ("pending" | "committed")
- Default to "committed" for backward compatibility

Changes to quarantine.py:
- Rewrite quarantine_file() with three phases:
  1. Write pending manifest entry BEFORE moving file
  2. Move file to quarantine
  3. Mark manifest entry as committed
- Rewrite restore_from_quarantine() with same pattern
- Add _recover_pending_entries() for auto-recovery on manifest load
- Update _load_manifest() and _save_manifest() to handle status field

Changes to executor.py:
- Add special handling for quarantine rollback using QuarantineManager
- Fix bug where executor didn't preserve quarantine destination_path
- Return QuarantineManager result directly (includes actual quarantine path)

Testing:
- Fixed pre-existing test_rollback_quarantine_operation
- All 439 tests now pass (was 438 with 1 failure)

Atomicity guarantees:
- If manifest write fails → operation fails, no file moved
- If file move fails → rollback removes pending manifest entry
- If commit fails → auto-recovery fixes on next load
- No orphaned files possible

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-13 09:50:29 +08:00
windyboy 79f5ddf1f5 Update analysis and plan files to enhance duplicate handling and reporting
- Updated `analysis.json` with a new generation timestamp.
- Modified `plan.json` to include a new plan ID and created timestamp, and changed operation types from "no-op" to "quarantine" for specific files needing manual review.
- Enhanced the README.md to document the new `--analysis` option for generating execution plans, which now includes a human-readable summary and duplicate handling strategies.
- Introduced a new `duplicate_resolve.py` module to manage duplicate file resolution strategies.
- Improved the execution engine to support quarantine operations and added rollback functionality for quarantined files.

These changes improve the functionality of the Video Library Manager by providing better duplicate management and clearer reporting capabilities.
2026-02-10 18:07:38 +08:00
windyboy dcd87754cf Enhance project structure and add new files for enrichment and analysis
- Updated AGENTS.md to reflect changes in CLI commands and module organization, including the addition of an enrichment step and new functional modules.
- Introduced analysis.json, identities.json, inventory.csv, and plan.json to support enriched metadata and execution planning.
- Added CODE_IMPROVEMENTS.md to document identified code issues and proposed solutions for future enhancements.
- Updated README.md to include new enrichment features and configuration options.
- Removed unused dependency on ffmpeg-python from pyproject.toml.

These changes improve the overall functionality and maintainability of the Video Library Manager project.
2026-02-10 16:56:17 +08:00
windyboy 1705275e99 Initial commit: Video Library Manager
- Add core VLM modules (scanner, parser, planner, executor, analysis)
- Add CLI with quarantine, reports, rollback, and state management
- Add comprehensive test suite
- Add project configuration and documentation
- Add .gitignore for Python project
2026-02-09 17:43:35 +08:00