Skip to content

fix(finetune): merge refuses PEFT zero-match, missing lora_alpha, partial and no-op merges (PMAT-7023) - #7066

Merged
noahgift merged 3 commits into
mainfrom
PMAT-7023-fix
Nov 15, 2026
Merged

noahgift merged 3 commits into
mainfrom
PMAT-7023-fix

Conversation

@noahgift

Copy link
Copy Markdown
Member

What

apr finetune merge no longer writes a wrong merge with exit 0.

  • PEFT adapter names (base_model.model.<stem>.lora_A.weight / .lora_B.weight) are resolved; an adapter with zero matches is refused and no output file is left.
  • A missing lora_alpha is refused (was: silent default 16.0, two sites).
  • A partial match is refused and every unmatched adapter name is listed.
  • A merge that changes no weight is refused before the write.

crates/apr-cli/src/commands/finetune_display_next_validate.rs (+81) and finetune_tests.rs (+121). No workflow, gate, script or contract change.

Measured (build host, scratch copy of the branch at 138046c)

  • With the fix file reverted to main, the four new tests fail: peft_adapter_zero_match_refused, missing_lora_alpha_refused, partial_merge_refused, unchanged_merge_refused.
  • With the fix: cargo test -p apr-cli --lib finetune 83 passed, 0 failed.
  • cargo clippy -p apr-cli --lib -- -D warnings 0; cargo fmt --all -- --check 0.

Not measured

  • Each guard was not reverted on its own; the whole fix file was reverted at once.
  • Only the finetune filter ran, not the full apr-cli lib suite; CI is its first full run.
  • No real PEFT checkpoint, only a synthetic base + adapter fixture.

ont-delta: none (refusals added to an existing verb; no surface, contract or ontology row changes)
Closes #7023
Pmat-Ticket: PMAT-7023

🤖 Generated with Claude Code

…and no-op merges (#7023)

Count and resolve PEFT lora_A/lora_B.weight adapter names, require lora_alpha
instead of defaulting to 16.0, refuse when any adapter LoRA tensor matched no
base tensor, and refuse when no weight changed. Four must-fire tests added.

Pmat-Ticket: PMAT-7023
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@noahgift noahgift added the fix-set GHC-001 cap-exempt fix label Nov 15, 2026
@github-actions

github-actions Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

§13.11 rung 1 — quorum shadow verdict

S13-SHADOW pr=7066 head=799c4ab5e84f8ea8abb2889b4c56d4cb9191a7b5 verdict=REFUSE class=Q1 arm_rc=1

Shadow mode: this records a verdict and merges nothing. A refusal
to arm is not a block (§13 adds zero rows to §7) — the pull request is
exactly as green as it was.

@noahgift

Copy link
Copy Markdown
Member Author

Non-author review at 138046c: FAIL (lane agy Gemini, model "Gemini 4 Carbon (High)", read from the lane log). Not armed.

Blocking:

  1. finetune_display_next_validate.rs:88: a real PEFT bundle (adapter_model.safetensors + adapter_config.json with lora_alpha) is refused with the missing-alpha error; only metadata.json is read.
  2. finetune_tests.rs:1871: three new hunks stay green when reverted (safetensors alpha check, GGUF-base PEFT name mapping, the positive merge test only asserts is_ok()).
  3. finetune_display_next_validate.rs:520: an orphan .lora_b and a shape-mismatched pair still give a partial merge with exit 0.

Three earlier attempts ended in errors (bad model id, lane blind, interrupted) and are not counted. A new review is needed after the fix.

🤖 Generated with Claude Code

…ora_b and shape-mismatched pairs, tests pin each hunk (PMAT-7023)

Pmat-Ticket: PMAT-7023
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@noahgift

Copy link
Copy Markdown
Member Author

Review at head b4dffdc (harness lanes, non-author): 1 PASS (claude-sonnet-5-5, same family as the fix author) and 1 FAIL (gemini-4-carbon-high). Blocking: the shape guard compares only flat element counts, so a transposed pair on a non-square base or a rank mismatch still merges with exit 0; the zero-match refusal and several name-mapping branches stay green when reverted. Not armed. A fix is in work; lanes re-run on the new head.

…sts pin each branch (PMAT-7023)

Pmat-Ticket: PMAT-7023
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@noahgift

Copy link
Copy Markdown
Member Author

quorum-review (AD-04): NOT agreed (auto_merge: checked=true was_armed=false disarmed=false)
round: 1 | verdict: CHANGES | blocking: none

{
 "ticket": "PMAT-7023",
 "head": "799c4ab5e84f8ea8abb2889b4c56d4cb9191a7b5",
 "width": 3,
 "executor": "agy",
 "agreed": false,
 "auto_merge": {
  "checked": true,
  "was_armed": false,
  "disarmed": false,
  "note": "auto-merge not armed"
 },
 "lanes": [
  {
   "lane": 1,
   "verdict": "NO-VERDICT",
   "findings": 0
  },
  {
   "lane": 2,
   "verdict": "NO-VERDICT",
   "findings": 0
  },
  {
   "lane": 3,
   "verdict": "PASS",
   "findings": 2
  }
 ]
}

@noahgift

Copy link
Copy Markdown
Member Author

Review round at 799c4ab (harness quorum runner, 3 seats): not agreed. The claude-haiku-5-5 seat (model measured) returned PASS with no blocking finding. Both gemini-4-carbon-high seats returned no verdict (quota 429), and the fallback chain had no further non-author seat. One PASS is below this PR's two-lane bar, so it is not armed.

🤖 Generated with Claude Code

@noahgift

Copy link
Copy Markdown
Member Author

quorum-review (AD-04): NOT agreed (auto_merge: checked=true was_armed=false disarmed=false)
round: 2 | verdict: CHANGES | blocking: none

{
 "ticket": "PMAT-7023",
 "head": "799c4ab5e84f8ea8abb2889b4c56d4cb9191a7b5",
 "width": 3,
 "executor": "agy",
 "agreed": false,
 "auto_merge": {
  "checked": true,
  "was_armed": false,
  "disarmed": false,
  "note": "auto-merge not armed"
 },
 "lanes": [
  {
   "lane": 1,
   "verdict": "PASS",
   "findings": 4
  },
  {
   "lane": 2,
   "verdict": "PASS",
   "findings": 3
  },
  {
   "lane": 3,
   "verdict": "PASS",
   "findings": 3
  }
 ]
}

@noahgift

Copy link
Copy Markdown
Member Author

Review round at 799c4ab (harness quorum runner): PASS, 3 of 3 lanes, no blocking finding. Lanes measured: claude-opus-5-5-high x2 (agy), claude-haiku-5-5. None is the author's model id. degraded: same-family (the Gemini seats are out of quota). The runner's receipt-lint marked the artifact not agreed on lane count only (three same-family lanes against a width cap of two); no lane failed. Checks green at this head. Arming squash.

🤖 Generated with Claude Code

@noahgift
noahgift merged commit 8e6ce76 into main Nov 15, 2026
14 checks passed
@noahgift
noahgift deleted the PMAT-7023-fix branch November 15, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix-set GHC-001 cap-exempt fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FT-20 (re-filed from #6548): finetune merge: PEFT adapter names, partial match and missing lora_alpha give a wrong merge with exit 0

1 participant