Port checkpoint path validation and symlink consistency to main
Problem
The checkpoint path validation from Isaac Yang's 2.9 PR #5427 is not yet on main. FedAvg joins save_filename directly to the run directory, and PTFileModelPersistor joins its checkpoint directory and filenames directly to the application root. Absolute paths, parent traversal, or symlink resolution can therefore select a checkpoint destination outside the intended root. Checkpoint aliases and metadata sidecars also need consistent filesystem resolution.
Proposed scope
Port only the seven checkpoint implementation/test files from commit 54e18050351bb57ded2a4e09060296acfbf016f6:
- Validate FedAvg's configured model path beneath its run directory.
- Validate PTFileModelPersistor's checkpoint directory and filenames, retaining allowed aliases inside the application root.
- Validate PTFedAvg metadata sidecars and preserve checkpoint alias names and directory-symlink/parent resolution.
- Include the corresponding path, persistence, inventory, and metadata regressions.
This is independent of foundation PR #5506. The CVM Builder and acceptance portions of #5427, other authors' prerequisites, and GPU/Trustee changes are outside this issue.
Compatibility
Invalid output-path configurations will be rejected. PTFedAvg file serialization methods will require a configured run directory through an active run context or an overridden get_run_dir. Existing checkpoint and metadata formats can be reused.
Current preparation evidence
The seven-file port applies cleanly to main at d9dc371a4, preserving its newer FedAvg aggregation changes. The affected and related regression suites report 303 passed and two CUDA-only skips; scoped formatting, lint, license, and whitespace checks pass.