Skip to content

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 (CR-A07-010) #378

Open

Description

@cemililik

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.

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

No one assigned

    Labels

    area: complianceCode area: compliancebugSomething isn't workingseverity: highWrong behaviour or a false claim users rely onsource: review-2026-10Found by the October 2026 code and documentation reviewwave: 1Roadmap wave 1: high severity, small effort

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions