| 1 |
"""v3 → v4 migrator: additive `training.adapters` block. |
| 2 |
|
| 3 |
v4 introduces named multi-adapter composition: |
| 4 |
|
| 5 |
training: |
| 6 |
adapters: |
| 7 |
knowledge: {adapter: lora, lora_r: 8, ...} |
| 8 |
tone: {adapter: lora, lora_r: 4, ...} |
| 9 |
|
| 10 |
The flat `adapter`/`lora_*` keys stay the single-adapter shorthand and |
| 11 |
are not rewritten. A v3 document without `adapters` parses as v4 |
| 12 |
unchanged — this migrator is pure identity, present only to satisfy |
| 13 |
the migration-framework coverage contract. |
| 14 |
""" |
| 15 |
|
| 16 |
from __future__ import annotations |
| 17 |
|
| 18 |
|
| 19 |
def migrate(raw: dict[str, object]) -> dict[str, object]: |
| 20 |
return dict(raw) |