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>
This commit is contained in:
windyboy
2026-02-13 09:54:11 +08:00
co-authored by Claude Sonnet 4.5
parent e3069a287e
commit 71e67ab65c
4 changed files with 4 additions and 0 deletions
+1
View File
@@ -365,6 +365,7 @@ class ExecutionEngine:
"""
# Convert rollback log to JSON-serializable format
log_data = {
"vlm_schema_version": "1.0",
"log_id": rollback_log.log_id,
"execution_plan_id": rollback_log.execution_plan_id,
"executed_at": rollback_log.executed_at.isoformat(),