Skip to main content

CODITECT Checkpoint Archival System

Automatically archives old checkpoints according to checkpoint.config.json settings. Implements never-delete policy with audit trail.

Features:

  • Automatic archival based on age thresholds
  • Year-based organization for historical data
  • Audit logging for all operations
  • Optional compression for very old files
  • Config-driven retention policies

Usage: python3 scripts/core/archive-checkpoints.py [--dry-run] [--force-compress] python3 scripts/core/archive-checkpoints.py --check # Preview what would be archived

Author: AZ1.AI CODITECT Team Framework: MEMORY-CONTEXT Date: 2025-11-16

File: archive-checkpoints.py

Classes

CheckpointArchiver

Automatically archives checkpoints according to retention policies.

Functions

main()

CLI entry point.

find_files_to_archive(directory, archive_after_days)

Find files older than threshold.

archive_file(file_path, archive_base_dir, organize_by_year, dry_run)

Archive a single file.

compress_file(file_path, dry_run)

Compress a file using gzip.

find_files_to_compress(archive_dir, compress_after_days)

Find archived files old enough to compress.

archive_checkpoints(dry_run)

Archive old checkpoints according to config.

compress_old_archives(dry_run, force)

Compress very old archived files.

run(dry_run, compress, force_compress)

Run complete archival workflow.

Usage

python archive-checkpoints.py