Repository navigation
Description
Wave 1 · theme D1-2: Audit chain, integrity manifest and verifier robustness · highest severity High · 1 finding(s) · effort small
Summary
An interrupted run is resumed with --resume, or a pipeline with --resume-from. The new final_model can never pass verify-integrity (exit 6), whatever is done to it, until the directory is wiped.
Primary finding
CR-A07-010 — generate_model_integrity records a pre-existing model_integrity.json (and the stale deployer doc) as artifacts, so a re-run or resume into the same final_model can never verify
severity High · reachability default · intent contract-violation · confidence confirmed · independently confirmed · reproduced end to end
What happens. generate_model_integrity walks the whole final_path (forgelm/compliance.py:787-805) without excluding its own manifest. The trainer then overwrites model_integrity.json and deployer_instructions.md (trainer.py:2162-2166), so their recorded hashes cannot match. verify_integrity excludes the manifest only from the added-file walk (_model_integrity.py:203), not from recorded entries, and reports 'changed' (exit 6).
Where.
forgelm/compliance.py:787-805(walk, no manifest exclusion; the cited :787 is inside the loop)forgelm/trainer.py:2157-2166forgelm/verify/_model_integrity.py:201-205forgelm/verify/_model_integrity.py:199-206(added walk with the _MANIFEST_NAME skip at :203)forgelm/compliance.py:787-805(confirmed)forgelm/trainer.py:2162-2166(confirmed)forgelm/verify/_model_integrity.py:153-205forgelm/trainer.py:1502-1505(call order: model card, manifest, deployer instructions)forgelm/compliance.py:1761forgelm/trainer.py:1713
Evidence.
- After the cab2947 --resume of the v0.11.0 SFT run: outputs/.../logs_ver/out_vi_resumed.txt ('2 changed: deployer_instructions.md, model_integrity.json'). After the cab2947 --resume-from dpo_stage: out_vi_st2_after_resume.txt (same). The post-resume model_integrity.json is in artefacts_v110_after_cab_resume/sft_out/final_model/model_integrity.json.
- repro_e_rerun.py uses only the real ForgeTrainer._generate_model_integrity. Run 1 on a fresh dir: exit 0. Run 2 (weights re-saved into the same dir): exit 6, 'changed: model_integrity.json'.
Recommended fix. Skip _MANIFEST_NAME in generate_model_integrity. Also make the verifier refuse or ignore a recorded entry named model_integrity.json, so legacy manifests do not false-alarm.
Acceptance criteria
- A regression test reproduces the failure scenario and asserts the corrected behaviour.
- Documentation listed above is corrected in English and in its Turkish mirror in the same PR.
- Every finding in this issue is resolved or explicitly closed with a reason.
Found by the October 2026 ForgeLM code and documentation review against commit cab2947. Code links point at that commit; line numbers may have moved since. Finding IDs (CR-…, DOC-…, TECH-…) are stable references for this backlog.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity