Archive experiment

From niznik-dev/cruijff_kit · View interactive version

Archive experiment is an AI agent skill from the GitHub repository niznik-dev/cruijff_kit. Archive a completed experiment, preserving all experiment files while deleting bulk checkpoint artifacts. Use after summarize-experiment or explore-experiment when an experiment is complete and results have been reviewed.

How to use this skill

Skill file

Archive Experiment

Archive a completed experiment by copying the entire experiment directory and deleting only the large checkpoint directories (*/artifacts/).

Your Task

Archive an experiment by:

  1. Locating the experiment and validating completeness
  2. Running a dry-run inventory showing what will be kept vs deleted
  3. Resolving findings.md (prompting user if needed)
  4. Getting user confirmation
  5. Executing the archive (copy → verify → delete)
  6. Logging the process

Prerequisites

Workflow

1. Locate Experiment

Find the experiment directory:

Read experiment_summary.yaml to determine:

2. Dry Run Preview

Run the archive script in dry-run mode:

python src/tools/experiment/archive_experiment.py <experiment_dir> --dry-run --pretty

If the default archive location is wrong, the user can specify --archive-base <path>.

Default archive location: ck-archive/{project}/{experiment_name}/ as sibling of the experiment's grandparent directory. For an experiment at __SCRATCH__/ck-projects/{project}/my_experiment/, the archive lands at __SCRATCH__/ck-archive/{project}/my_experiment/. The project layer is required — experiment.project must be set in experiment_summary.yaml.

Show the user:

3. Resolve findings.md

Check the dry-run output for findings_source:

  1. If a source was found — tell the user which file will be copied as findings.md
  2. If no source was found (findings_source: null) — ask the user:

4. Confirm with User

Present the plan clearly:

Archive plan for: {experiment_name}
  Archive: {N} files ({X} MB) → {archive_dir}
  Delete:  {M} checkpoint dirs ({Y} MB)

Proceed? (y/n)

Use AskUserQuestion to get explicit confirmation before proceeding.

5. Execute Archive

Run the archive script without dry-run:

python src/tools/experiment/archive_experiment.py <experiment_dir> [--force] [--archive-base <path>] --pretty

The script will:

  1. Copy the entire experiment directory to the archive
  2. Verify the archive (file existence + size check)
  3. Delete originals: checkpoint directories (*/artifacts/) and experiment directory
  4. Report results

6. Report Results

Show the user:

7. Create Log

Write archive-experiment.log to the archive directory:

{archive_dir}/archive.log

See logging.md for action types and format.

What Gets Kept

The entire experiment directory is copied to the archive, preserving its original structure. This includes configs, SLURM scripts, eval logs, exploration, logs, and any other files. Since these are all small (KB-scale), there's no reason to selectively delete them.

What Gets Deleted

| Artifact | Why Safe |

|----------|---------|

| Model checkpoints (*/artifacts/) | Reproducible via fine-tuning; these are the only large artifacts |

Error Handling

Incomplete experiment (no --force)

Archive directory already exists

Verification failure

experiment_summary.yaml missing or invalid

Output Files

The archive mirrors the original experiment directory structure, nested under

the project name:

{archive_base}/{project}/{experiment_name}/
├── experiment_summary.yaml
├── findings.md
├── summary.md
├── {dataset}.json
├── logs/
│   ├── design-experiment.log
│   ├── scaffold-torchtune.log
│   └── ...
├── {run_name}/
│   ├── finetune.yaml
│   ├── finetune.slurm
│   ├── setup_finetune.yaml
│   └── eval/
│       └── {task}_epoch{N}/       # One cell per (task, epoch) — issue #498
│           ├── eval.yaml
│           ├── cell.slurm
│           └── logs/*.eval
├── exploration/
│   ├── report.md
│   └── *.html
└── archive.log

Per-run artifacts/ directories are deleted, not archived — those are the only

large items, and they can be regenerated by re-running fine-tuning.

Relationship to Other Skills

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.