[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RestructureDatasetSchema
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""DistilGPT2 causal-LM fine-tuning on 300 lines of WikiText (text generation)."""
from transformers import (
    AutoTokenizer,
    AutoModelForCausalLM,
    Trainer,
    TrainingArguments,
    DataCollatorForLanguageModeling,
)
from datasets import load_dataset

dataset = load_dataset("wikitext", "wikitext-2-raw-v1", split="train[:300]")
tokenizer = AutoTokenizer.from_pretrained("distilgpt2")
tokenizer.pad_token = tokenizer.eos_token

def tokenize(examples):
    return tokenizer(examples["text"], truncation=True, max_length=64)

dataset = dataset.map(tokenize, batched=True, remove_columns=dataset.column_names)

model = AutoModelForCausalLM.from_pretrained("distilgpt2")

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DataCollatorForLanguageModeling(tokenizer, mlm=False),
)

trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RestructureDatasetSchema",
  "params": {
    "old_column": "text",
    "new_column": "input_text"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: ChangeTokenizerBehavior
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""DistilGPT2 causal-LM fine-tuning on 300 lines of WikiText (text generation)."""
from transformers import (
    AutoTokenizer,
    AutoModelForCausalLM,
    Trainer,
    TrainingArguments,
    DataCollatorForLanguageModeling,
)
from datasets import load_dataset

dataset = load_dataset("wikitext", "wikitext-2-raw-v1", split="train[:300]")
tokenizer = AutoTokenizer.from_pretrained("distilgpt2")
tokenizer.pad_token = tokenizer.eos_token

def tokenize(examples):
    return tokenizer(examples["text"], truncation=True, max_length=64)

dataset = dataset.map(tokenize, batched=True, remove_columns=dataset.column_names)

model = AutoModelForCausalLM.from_pretrained("distilgpt2")

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DataCollatorForLanguageModeling(tokenizer, mlm=False),
)

trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "ChangeTokenizerBehavior",
  "params": {
    "old_kwarg": "truncation",
    "old_value": "True",
    "new_kwarg": "truncate",
    "new_value": "True"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RemoveDeprecatedMethod
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""DistilGPT2 causal-LM fine-tuning on 300 lines of WikiText (text generation)."""
from transformers import (
    AutoTokenizer,
    AutoModelForCausalLM,
    Trainer,
    TrainingArguments,
    DataCollatorForLanguageModeling,
)
from datasets import load_dataset

dataset = load_dataset("wikitext", "wikitext-2-raw-v1", split="train[:300]")
tokenizer = AutoTokenizer.from_pretrained("distilgpt2")
tokenizer.pad_token = tokenizer.eos_token

def tokenize(examples):
    return tokenizer(examples["text"], truncation=True, max_length=64)

dataset = dataset.map(tokenize, batched=True, remove_columns=dataset.column_names)

model = AutoModelForCausalLM.from_pretrained("distilgpt2")

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DataCollatorForLanguageModeling(tokenizer, mlm=False),
)

trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RemoveDeprecatedMethod",
  "params": {
    "class_name": "Trainer",
    "method_name": "save_model",
    "replacement": "save_to_hub"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""DistilRoberta sentiment classification on 400-sample IMDB subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForSequenceClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("imdb", split="train[:400]")
tokenizer = AutoTokenizer.from_pretrained("distilroberta-base")

def tokenize(examples):
    return tokenizer(
        examples["text"],
        padding="max_length",
        truncation=True,
        max_length=64,
    )

dataset = dataset.map(tokenize, batched=True)
dataset = dataset.rename_column("label", "labels")
dataset.set_format("torch", columns=["input_ids", "attention_mask", "labels"])

model = AutoModelForSequenceClassification.from_pretrained(
    "distilroberta-base", num_labels=2
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=8,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "trainer.train",
    "new_name": "trainer.start_training"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""DistilRoberta sentiment classification on 400-sample IMDB subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForSequenceClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("imdb", split="train[:400]")
tokenizer = AutoTokenizer.from_pretrained("distilroberta-base")

def tokenize(examples):
    return tokenizer(
        examples["text"],
        padding="max_length",
        truncation=True,
        max_length=64,
    )

dataset = dataset.map(tokenize, batched=True)
dataset = dataset.rename_column("label", "labels")
dataset.set_format("torch", columns=["input_ids", "attention_mask", "labels"])

model = AutoModelForSequenceClassification.from_pretrained(
    "distilroberta-base", num_labels=2
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=8,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "from_pretrained",
    "new_name": "load_from_hub"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: ChangeArgumentSignature
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""DistilRoberta sentiment classification on 400-sample IMDB subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForSequenceClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("imdb", split="train[:400]")
tokenizer = AutoTokenizer.from_pretrained("distilroberta-base")

def tokenize(examples):
    return tokenizer(
        examples["text"],
        padding="max_length",
        truncation=True,
        max_length=64,
    )

dataset = dataset.map(tokenize, batched=True)
dataset = dataset.rename_column("label", "labels")
dataset.set_format("torch", columns=["input_ids", "attention_mask", "labels"])

model = AutoModelForSequenceClassification.from_pretrained(
    "distilroberta-base", num_labels=2
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=8,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "ChangeArgumentSignature",
  "params": {
    "function_name": "TrainingArguments",
    "removed_arg": "num_train_epochs",
    "added_arg": "max_steps",
    "added_value": "1000"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: ModifyConfigField
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""DistilRoberta sentiment classification on 400-sample IMDB subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForSequenceClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("imdb", split="train[:400]")
tokenizer = AutoTokenizer.from_pretrained("distilroberta-base")

def tokenize(examples):
    return tokenizer(
        examples["text"],
        padding="max_length",
        truncation=True,
        max_length=64,
    )

dataset = dataset.map(tokenize, batched=True)
dataset = dataset.rename_column("label", "labels")
dataset.set_format("torch", columns=["input_ids", "attention_mask", "labels"])

model = AutoModelForSequenceClassification.from_pretrained(
    "distilroberta-base", num_labels=2
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=8,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "ModifyConfigField",
  "params": {
    "config_class": "TrainingArguments",
    "field_name": "per_device_train_batch_size",
    "new_value": "1"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RestructureDatasetSchema
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""DistilRoberta sentiment classification on 400-sample IMDB subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForSequenceClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("imdb", split="train[:400]")
tokenizer = AutoTokenizer.from_pretrained("distilroberta-base")

def tokenize(examples):
    return tokenizer(
        examples["text"],
        padding="max_length",
        truncation=True,
        max_length=64,
    )

dataset = dataset.map(tokenize, batched=True)
dataset = dataset.rename_column("label", "labels")
dataset.set_format("torch", columns=["input_ids", "attention_mask", "labels"])

model = AutoModelForSequenceClassification.from_pretrained(
    "distilroberta-base", num_labels=2
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=8,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RestructureDatasetSchema",
  "params": {
    "old_column": "text",
    "new_column": "input_text"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RestructureDatasetSchema
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""DistilRoberta sentiment classification on 400-sample IMDB subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForSequenceClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("imdb", split="train[:400]")
tokenizer = AutoTokenizer.from_pretrained("distilroberta-base")

def tokenize(examples):
    return tokenizer(
        examples["text"],
        padding="max_length",
        truncation=True,
        max_length=64,
    )

dataset = dataset.map(tokenize, batched=True)
dataset = dataset.rename_column("label", "labels")
dataset.set_format("torch", columns=["input_ids", "attention_mask", "labels"])

model = AutoModelForSequenceClassification.from_pretrained(
    "distilroberta-base", num_labels=2
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=8,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RestructureDatasetSchema",
  "params": {
    "old_column": "label",
    "new_column": "labels"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: ChangeTokenizerBehavior
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""DistilRoberta sentiment classification on 400-sample IMDB subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForSequenceClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("imdb", split="train[:400]")
tokenizer = AutoTokenizer.from_pretrained("distilroberta-base")

def tokenize(examples):
    return tokenizer(
        examples["text"],
        padding="max_length",
        truncation=True,
        max_length=64,
    )

dataset = dataset.map(tokenize, batched=True)
dataset = dataset.rename_column("label", "labels")
dataset.set_format("torch", columns=["input_ids", "attention_mask", "labels"])

model = AutoModelForSequenceClassification.from_pretrained(
    "distilroberta-base", num_labels=2
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=8,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "ChangeTokenizerBehavior",
  "params": {
    "old_kwarg": "truncation",
    "old_value": "True",
    "new_kwarg": "truncate",
    "new_value": "True"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RemoveDeprecatedMethod
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""DistilRoberta sentiment classification on 400-sample IMDB subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForSequenceClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("imdb", split="train[:400]")
tokenizer = AutoTokenizer.from_pretrained("distilroberta-base")

def tokenize(examples):
    return tokenizer(
        examples["text"],
        padding="max_length",
        truncation=True,
        max_length=64,
    )

dataset = dataset.map(tokenize, batched=True)
dataset = dataset.rename_column("label", "labels")
dataset.set_format("torch", columns=["input_ids", "attention_mask", "labels"])

model = AutoModelForSequenceClassification.from_pretrained(
    "distilroberta-base", num_labels=2
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=8,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RemoveDeprecatedMethod",
  "params": {
    "class_name": "Trainer",
    "method_name": "save_model",
    "replacement": "save_to_hub"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny T5 fine-tuning for summarization on 100-sample CNN/DailyMail."""
from transformers import (
    AutoTokenizer,
    AutoModelForSeq2SeqLM,
    DataCollatorForSeq2Seq,
    Seq2SeqTrainer,
    Seq2SeqTrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("cnn_dailymail", "3.0.0", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")

def preprocess(examples):
    inputs = tokenizer(
        ["summarize: " + a for a in examples["article"]],
        max_length=128,
        truncation=True,
        padding="max_length",
    )
    targets = tokenizer(
        examples["highlights"],
        max_length=32,
        truncation=True,
        padding="max_length",
    )
    inputs["labels"] = targets["input_ids"]
    return inputs

dataset = dataset.map(preprocess, batched=True, remove_columns=dataset.column_names)

model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small")

training_args = Seq2SeqTrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
    predict_with_generate=False,
)

trainer = Seq2SeqTrainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DataCollatorForSeq2Seq(tokenizer, model=model),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "trainer.train",
    "new_name": "trainer.start_training"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny T5 fine-tuning for summarization on 100-sample CNN/DailyMail."""
from transformers import (
    AutoTokenizer,
    AutoModelForSeq2SeqLM,
    DataCollatorForSeq2Seq,
    Seq2SeqTrainer,
    Seq2SeqTrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("cnn_dailymail", "3.0.0", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")

def preprocess(examples):
    inputs = tokenizer(
        ["summarize: " + a for a in examples["article"]],
        max_length=128,
        truncation=True,
        padding="max_length",
    )
    targets = tokenizer(
        examples["highlights"],
        max_length=32,
        truncation=True,
        padding="max_length",
    )
    inputs["labels"] = targets["input_ids"]
    return inputs

dataset = dataset.map(preprocess, batched=True, remove_columns=dataset.column_names)

model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small")

training_args = Seq2SeqTrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
    predict_with_generate=False,
)

trainer = Seq2SeqTrainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DataCollatorForSeq2Seq(tokenizer, model=model),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "from_pretrained",
    "new_name": "load_from_hub"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: ChangeArgumentSignature
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny T5 fine-tuning for summarization on 100-sample CNN/DailyMail."""
from transformers import (
    AutoTokenizer,
    AutoModelForSeq2SeqLM,
    DataCollatorForSeq2Seq,
    Seq2SeqTrainer,
    Seq2SeqTrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("cnn_dailymail", "3.0.0", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")

def preprocess(examples):
    inputs = tokenizer(
        ["summarize: " + a for a in examples["article"]],
        max_length=128,
        truncation=True,
        padding="max_length",
    )
    targets = tokenizer(
        examples["highlights"],
        max_length=32,
        truncation=True,
        padding="max_length",
    )
    inputs["labels"] = targets["input_ids"]
    return inputs

dataset = dataset.map(preprocess, batched=True, remove_columns=dataset.column_names)

model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small")

training_args = Seq2SeqTrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
    predict_with_generate=False,
)

trainer = Seq2SeqTrainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DataCollatorForSeq2Seq(tokenizer, model=model),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "ChangeArgumentSignature",
  "params": {
    "function_name": "TrainingArguments",
    "removed_arg": "num_train_epochs",
    "added_arg": "max_steps",
    "added_value": "1000"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: ModifyConfigField
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny T5 fine-tuning for summarization on 100-sample CNN/DailyMail."""
from transformers import (
    AutoTokenizer,
    AutoModelForSeq2SeqLM,
    DataCollatorForSeq2Seq,
    Seq2SeqTrainer,
    Seq2SeqTrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("cnn_dailymail", "3.0.0", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")

def preprocess(examples):
    inputs = tokenizer(
        ["summarize: " + a for a in examples["article"]],
        max_length=128,
        truncation=True,
        padding="max_length",
    )
    targets = tokenizer(
        examples["highlights"],
        max_length=32,
        truncation=True,
        padding="max_length",
    )
    inputs["labels"] = targets["input_ids"]
    return inputs

dataset = dataset.map(preprocess, batched=True, remove_columns=dataset.column_names)

model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small")

training_args = Seq2SeqTrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
    predict_with_generate=False,
)

trainer = Seq2SeqTrainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DataCollatorForSeq2Seq(tokenizer, model=model),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "ModifyConfigField",
  "params": {
    "config_class": "TrainingArguments",
    "field_name": "per_device_train_batch_size",
    "new_value": "1"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: ChangeTokenizerBehavior
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny T5 fine-tuning for summarization on 100-sample CNN/DailyMail."""
from transformers import (
    AutoTokenizer,
    AutoModelForSeq2SeqLM,
    DataCollatorForSeq2Seq,
    Seq2SeqTrainer,
    Seq2SeqTrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("cnn_dailymail", "3.0.0", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")

def preprocess(examples):
    inputs = tokenizer(
        ["summarize: " + a for a in examples["article"]],
        max_length=128,
        truncation=True,
        padding="max_length",
    )
    targets = tokenizer(
        examples["highlights"],
        max_length=32,
        truncation=True,
        padding="max_length",
    )
    inputs["labels"] = targets["input_ids"]
    return inputs

dataset = dataset.map(preprocess, batched=True, remove_columns=dataset.column_names)

model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small")

training_args = Seq2SeqTrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
    predict_with_generate=False,
)

trainer = Seq2SeqTrainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DataCollatorForSeq2Seq(tokenizer, model=model),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "ChangeTokenizerBehavior",
  "params": {
    "old_kwarg": "truncation",
    "old_value": "True",
    "new_kwarg": "truncate",
    "new_value": "True"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RemoveDeprecatedMethod
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny T5 fine-tuning for summarization on 100-sample CNN/DailyMail."""
from transformers import (
    AutoTokenizer,
    AutoModelForSeq2SeqLM,
    DataCollatorForSeq2Seq,
    Seq2SeqTrainer,
    Seq2SeqTrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("cnn_dailymail", "3.0.0", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")

def preprocess(examples):
    inputs = tokenizer(
        ["summarize: " + a for a in examples["article"]],
        max_length=128,
        truncation=True,
        padding="max_length",
    )
    targets = tokenizer(
        examples["highlights"],
        max_length=32,
        truncation=True,
        padding="max_length",
    )
    inputs["labels"] = targets["input_ids"]
    return inputs

dataset = dataset.map(preprocess, batched=True, remove_columns=dataset.column_names)

model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small")

training_args = Seq2SeqTrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
    predict_with_generate=False,
)

trainer = Seq2SeqTrainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DataCollatorForSeq2Seq(tokenizer, model=model),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RemoveDeprecatedMethod",
  "params": {
    "class_name": "Trainer",
    "method_name": "save_model",
    "replacement": "save_to_hub"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: ChangeReturnType
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny T5 fine-tuning for summarization on 100-sample CNN/DailyMail."""
from transformers import (
    AutoTokenizer,
    AutoModelForSeq2SeqLM,
    DataCollatorForSeq2Seq,
    Seq2SeqTrainer,
    Seq2SeqTrainingArguments,
)
from datasets import load_dataset

dataset = load_dataset("cnn_dailymail", "3.0.0", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("google/flan-t5-small")

def preprocess(examples):
    inputs = tokenizer(
        ["summarize: " + a for a in examples["article"]],
        max_length=128,
        truncation=True,
        padding="max_length",
    )
    targets = tokenizer(
        examples["highlights"],
        max_length=32,
        truncation=True,
        padding="max_length",
    )
    inputs["labels"] = targets["input_ids"]
    return inputs

dataset = dataset.map(preprocess, batched=True, remove_columns=dataset.column_names)

model = AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-small")

training_args = Seq2SeqTrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
    predict_with_generate=False,
)

trainer = Seq2SeqTrainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DataCollatorForSeq2Seq(tokenizer, model=model),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "ChangeReturnType",
  "params": {
    "function_name": "tokenizer",
    "old_access": "[\"input_ids\"]",
    "new_access": ".input_ids"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RestructureDatasetSchema
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny PyTorch MLP on a 1000-sample MNIST subset (image classification baseline)."""
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from datasets import load_dataset

dataset = load_dataset("mnist", split="train[:1000]")
dataset = dataset.with_format("torch")

def collate(batch):
    pixel = torch.stack([b["image"].float().flatten() / 255.0 for b in batch])
    labels = torch.tensor([b["label"] for b in batch])
    return pixel, labels

loader = DataLoader(dataset, batch_size=32, shuffle=True, collate_fn=collate)

model = nn.Sequential(
    nn.Linear(784, 64),
    nn.ReLU(),
    nn.Linear(64, 10),
)

optimizer = torch.optim.Adam(model.parameters(), lr=1e-3)
criterion = nn.CrossEntropyLoss()

for epoch in range(2):
    for step, (x, y) in enumerate(loader, start=1):
        optimizer.zero_grad()
        loss = criterion(model(x), y)
        loss.backward()
        optimizer.step()
        if step % 5 == 0:
            print(f"step={step} loss={loss.item():.4f}")

torch.save(model.state_dict(), "/tmp/forge_output/checkpoint/mlp.pt")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RestructureDatasetSchema",
  "params": {
    "old_column": "label",
    "new_column": "labels"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny ViT image classification on 200-sample CIFAR-10 subset."""
from transformers import (
    AutoImageProcessor,
    AutoModelForImageClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset
import torch

dataset = load_dataset("cifar10", split="train[:200]")
processor = AutoImageProcessor.from_pretrained("WinKawaks/vit-tiny-patch16-224")

def transform(batch):
    images = [img.convert("RGB") for img in batch["img"]]
    inputs = processor(images=images, return_tensors="pt")
    inputs["labels"] = torch.tensor(batch["label"])
    return inputs

dataset = dataset.with_transform(transform)

model = AutoModelForImageClassification.from_pretrained(
    "WinKawaks/vit-tiny-patch16-224", num_labels=10, ignore_mismatched_sizes=True
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "trainer.train",
    "new_name": "trainer.start_training"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny ViT image classification on 200-sample CIFAR-10 subset."""
from transformers import (
    AutoImageProcessor,
    AutoModelForImageClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset
import torch

dataset = load_dataset("cifar10", split="train[:200]")
processor = AutoImageProcessor.from_pretrained("WinKawaks/vit-tiny-patch16-224")

def transform(batch):
    images = [img.convert("RGB") for img in batch["img"]]
    inputs = processor(images=images, return_tensors="pt")
    inputs["labels"] = torch.tensor(batch["label"])
    return inputs

dataset = dataset.with_transform(transform)

model = AutoModelForImageClassification.from_pretrained(
    "WinKawaks/vit-tiny-patch16-224", num_labels=10, ignore_mismatched_sizes=True
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "from_pretrained",
    "new_name": "load_from_hub"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: ChangeArgumentSignature
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny ViT image classification on 200-sample CIFAR-10 subset."""
from transformers import (
    AutoImageProcessor,
    AutoModelForImageClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset
import torch

dataset = load_dataset("cifar10", split="train[:200]")
processor = AutoImageProcessor.from_pretrained("WinKawaks/vit-tiny-patch16-224")

def transform(batch):
    images = [img.convert("RGB") for img in batch["img"]]
    inputs = processor(images=images, return_tensors="pt")
    inputs["labels"] = torch.tensor(batch["label"])
    return inputs

dataset = dataset.with_transform(transform)

model = AutoModelForImageClassification.from_pretrained(
    "WinKawaks/vit-tiny-patch16-224", num_labels=10, ignore_mismatched_sizes=True
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "ChangeArgumentSignature",
  "params": {
    "function_name": "TrainingArguments",
    "removed_arg": "num_train_epochs",
    "added_arg": "max_steps",
    "added_value": "1000"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: ModifyConfigField
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny ViT image classification on 200-sample CIFAR-10 subset."""
from transformers import (
    AutoImageProcessor,
    AutoModelForImageClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset
import torch

dataset = load_dataset("cifar10", split="train[:200]")
processor = AutoImageProcessor.from_pretrained("WinKawaks/vit-tiny-patch16-224")

def transform(batch):
    images = [img.convert("RGB") for img in batch["img"]]
    inputs = processor(images=images, return_tensors="pt")
    inputs["labels"] = torch.tensor(batch["label"])
    return inputs

dataset = dataset.with_transform(transform)

model = AutoModelForImageClassification.from_pretrained(
    "WinKawaks/vit-tiny-patch16-224", num_labels=10, ignore_mismatched_sizes=True
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "ModifyConfigField",
  "params": {
    "config_class": "TrainingArguments",
    "field_name": "per_device_train_batch_size",
    "new_value": "1"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RestructureDatasetSchema
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny ViT image classification on 200-sample CIFAR-10 subset."""
from transformers import (
    AutoImageProcessor,
    AutoModelForImageClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset
import torch

dataset = load_dataset("cifar10", split="train[:200]")
processor = AutoImageProcessor.from_pretrained("WinKawaks/vit-tiny-patch16-224")

def transform(batch):
    images = [img.convert("RGB") for img in batch["img"]]
    inputs = processor(images=images, return_tensors="pt")
    inputs["labels"] = torch.tensor(batch["label"])
    return inputs

dataset = dataset.with_transform(transform)

model = AutoModelForImageClassification.from_pretrained(
    "WinKawaks/vit-tiny-patch16-224", num_labels=10, ignore_mismatched_sizes=True
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RestructureDatasetSchema",
  "params": {
    "old_column": "label",
    "new_column": "labels"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RemoveDeprecatedMethod
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""Tiny ViT image classification on 200-sample CIFAR-10 subset."""
from transformers import (
    AutoImageProcessor,
    AutoModelForImageClassification,
    Trainer,
    TrainingArguments,
)
from datasets import load_dataset
import torch

dataset = load_dataset("cifar10", split="train[:200]")
processor = AutoImageProcessor.from_pretrained("WinKawaks/vit-tiny-patch16-224")

def transform(batch):
    images = [img.convert("RGB") for img in batch["img"]]
    inputs = processor(images=images, return_tensors="pt")
    inputs["labels"] = torch.tensor(batch["label"])
    return inputs

dataset = dataset.with_transform(transform)

model = AutoModelForImageClassification.from_pretrained(
    "WinKawaks/vit-tiny-patch16-224", num_labels=10, ignore_mismatched_sizes=True
)

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(model=model, args=training_args, train_dataset=dataset)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RemoveDeprecatedMethod",
  "params": {
    "class_name": "Trainer",
    "method_name": "save_model",
    "replacement": "save_to_hub"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""ALBERT-tiny extractive QA on 100-sample SQuAD subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForQuestionAnswering,
    Trainer,
    TrainingArguments,
    DefaultDataCollator,
)
from datasets import load_dataset

dataset = load_dataset("squad", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("albert-base-v2")

def prepare(examples):
    enc = tokenizer(
        examples["question"],
        examples["context"],
        max_length=128,
        truncation="only_second",
        padding="max_length",
        return_offsets_mapping=True,
    )
    start_positions, end_positions = [], []
    for i, offsets in enumerate(enc["offset_mapping"]):
        answer = examples["answers"][i]
        start_char = answer["answer_start"][0]
        end_char = start_char + len(answer["text"][0])

        token_start = next(
            (idx for idx, (a, b) in enumerate(offsets) if a <= start_char < b), 0
        )
        token_end = next(
            (idx for idx, (a, b) in enumerate(offsets) if a < end_char <= b), token_start
        )
        start_positions.append(token_start)
        end_positions.append(token_end)

    enc["start_positions"] = start_positions
    enc["end_positions"] = end_positions
    enc.pop("offset_mapping")
    return enc

dataset = dataset.map(prepare, batched=True, remove_columns=dataset.column_names)

model = AutoModelForQuestionAnswering.from_pretrained("albert-base-v2")

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DefaultDataCollator(),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "trainer.train",
    "new_name": "trainer.start_training"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""ALBERT-tiny extractive QA on 100-sample SQuAD subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForQuestionAnswering,
    Trainer,
    TrainingArguments,
    DefaultDataCollator,
)
from datasets import load_dataset

dataset = load_dataset("squad", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("albert-base-v2")

def prepare(examples):
    enc = tokenizer(
        examples["question"],
        examples["context"],
        max_length=128,
        truncation="only_second",
        padding="max_length",
        return_offsets_mapping=True,
    )
    start_positions, end_positions = [], []
    for i, offsets in enumerate(enc["offset_mapping"]):
        answer = examples["answers"][i]
        start_char = answer["answer_start"][0]
        end_char = start_char + len(answer["text"][0])

        token_start = next(
            (idx for idx, (a, b) in enumerate(offsets) if a <= start_char < b), 0
        )
        token_end = next(
            (idx for idx, (a, b) in enumerate(offsets) if a < end_char <= b), token_start
        )
        start_positions.append(token_start)
        end_positions.append(token_end)

    enc["start_positions"] = start_positions
    enc["end_positions"] = end_positions
    enc.pop("offset_mapping")
    return enc

dataset = dataset.map(prepare, batched=True, remove_columns=dataset.column_names)

model = AutoModelForQuestionAnswering.from_pretrained("albert-base-v2")

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DefaultDataCollator(),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "trainer.train",
    "new_name": "trainer.start_training"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""ALBERT-tiny extractive QA on 100-sample SQuAD subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForQuestionAnswering,
    Trainer,
    TrainingArguments,
    DefaultDataCollator,
)
from datasets import load_dataset

dataset = load_dataset("squad", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("albert-base-v2")

def prepare(examples):
    enc = tokenizer(
        examples["question"],
        examples["context"],
        max_length=128,
        truncation="only_second",
        padding="max_length",
        return_offsets_mapping=True,
    )
    start_positions, end_positions = [], []
    for i, offsets in enumerate(enc["offset_mapping"]):
        answer = examples["answers"][i]
        start_char = answer["answer_start"][0]
        end_char = start_char + len(answer["text"][0])

        token_start = next(
            (idx for idx, (a, b) in enumerate(offsets) if a <= start_char < b), 0
        )
        token_end = next(
            (idx for idx, (a, b) in enumerate(offsets) if a < end_char <= b), token_start
        )
        start_positions.append(token_start)
        end_positions.append(token_end)

    enc["start_positions"] = start_positions
    enc["end_positions"] = end_positions
    enc.pop("offset_mapping")
    return enc

dataset = dataset.map(prepare, batched=True, remove_columns=dataset.column_names)

model = AutoModelForQuestionAnswering.from_pretrained("albert-base-v2")

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DefaultDataCollator(),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "trainer.train",
    "new_name": "trainer.start_training"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""ALBERT-tiny extractive QA on 100-sample SQuAD subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForQuestionAnswering,
    Trainer,
    TrainingArguments,
    DefaultDataCollator,
)
from datasets import load_dataset

dataset = load_dataset("squad", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("albert-base-v2")

def prepare(examples):
    enc = tokenizer(
        examples["question"],
        examples["context"],
        max_length=128,
        truncation="only_second",
        padding="max_length",
        return_offsets_mapping=True,
    )
    start_positions, end_positions = [], []
    for i, offsets in enumerate(enc["offset_mapping"]):
        answer = examples["answers"][i]
        start_char = answer["answer_start"][0]
        end_char = start_char + len(answer["text"][0])

        token_start = next(
            (idx for idx, (a, b) in enumerate(offsets) if a <= start_char < b), 0
        )
        token_end = next(
            (idx for idx, (a, b) in enumerate(offsets) if a < end_char <= b), token_start
        )
        start_positions.append(token_start)
        end_positions.append(token_end)

    enc["start_positions"] = start_positions
    enc["end_positions"] = end_positions
    enc.pop("offset_mapping")
    return enc

dataset = dataset.map(prepare, batched=True, remove_columns=dataset.column_names)

model = AutoModelForQuestionAnswering.from_pretrained("albert-base-v2")

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DefaultDataCollator(),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "trainer.train",
    "new_name": "trainer.start_training"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""ALBERT-tiny extractive QA on 100-sample SQuAD subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForQuestionAnswering,
    Trainer,
    TrainingArguments,
    DefaultDataCollator,
)
from datasets import load_dataset

dataset = load_dataset("squad", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("albert-base-v2")

def prepare(examples):
    enc = tokenizer(
        examples["question"],
        examples["context"],
        max_length=128,
        truncation="only_second",
        padding="max_length",
        return_offsets_mapping=True,
    )
    start_positions, end_positions = [], []
    for i, offsets in enumerate(enc["offset_mapping"]):
        answer = examples["answers"][i]
        start_char = answer["answer_start"][0]
        end_char = start_char + len(answer["text"][0])

        token_start = next(
            (idx for idx, (a, b) in enumerate(offsets) if a <= start_char < b), 0
        )
        token_end = next(
            (idx for idx, (a, b) in enumerate(offsets) if a < end_char <= b), token_start
        )
        start_positions.append(token_start)
        end_positions.append(token_end)

    enc["start_positions"] = start_positions
    enc["end_positions"] = end_positions
    enc.pop("offset_mapping")
    return enc

dataset = dataset.map(prepare, batched=True, remove_columns=dataset.column_names)

model = AutoModelForQuestionAnswering.from_pretrained("albert-base-v2")

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DefaultDataCollator(),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "trainer.train",
    "new_name": "trainer.start_training"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""ALBERT-tiny extractive QA on 100-sample SQuAD subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForQuestionAnswering,
    Trainer,
    TrainingArguments,
    DefaultDataCollator,
)
from datasets import load_dataset

dataset = load_dataset("squad", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("albert-base-v2")

def prepare(examples):
    enc = tokenizer(
        examples["question"],
        examples["context"],
        max_length=128,
        truncation="only_second",
        padding="max_length",
        return_offsets_mapping=True,
    )
    start_positions, end_positions = [], []
    for i, offsets in enumerate(enc["offset_mapping"]):
        answer = examples["answers"][i]
        start_char = answer["answer_start"][0]
        end_char = start_char + len(answer["text"][0])

        token_start = next(
            (idx for idx, (a, b) in enumerate(offsets) if a <= start_char < b), 0
        )
        token_end = next(
            (idx for idx, (a, b) in enumerate(offsets) if a < end_char <= b), token_start
        )
        start_positions.append(token_start)
        end_positions.append(token_end)

    enc["start_positions"] = start_positions
    enc["end_positions"] = end_positions
    enc.pop("offset_mapping")
    return enc

dataset = dataset.map(prepare, batched=True, remove_columns=dataset.column_names)

model = AutoModelForQuestionAnswering.from_pretrained("albert-base-v2")

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DefaultDataCollator(),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "trainer.train",
    "new_name": "trainer.start_training"
  }
}


[System]
You are the Drift Generator.
You see a working HuggingFace training script and the curriculum target category.
Output exactly one JSON object describing a breakage primitive that simulates
realistic library version drift. The primitive must:
1. Be PLAUSIBLE — match the kind of breakage that happens between real
   transformers/datasets/trl releases.
2. Be SOLVABLE — the Repair Agent should be able to fix it from the error trace alone.
3. Match the requested target_category.

Output schema:
{"primitive_type": "<one of the 8 types>", "params": { ... }}

Available primitive types and parameter schemas:
- RenameApiCall: {"old_name": str, "new_name": str}
- DeprecateImport: {"old_module": str, "new_module": str}
- ChangeArgumentSignature: {"function_name": str, "removed_arg": str, "added_arg": str, "added_value": str}
- ModifyConfigField: {"config_class": str, "field_name": str, "new_value": str}
- RestructureDatasetSchema: {"old_column": str, "new_column": str}
- ChangeTokenizerBehavior: {"old_kwarg": str, "old_value": str, "new_kwarg": str, "new_value": str}
- RemoveDeprecatedMethod: {"class_name": str, "method_name": str, "replacement": str}
- ChangeReturnType: {"function_name": str, "old_access": str, "new_access": str}

Output ONLY the JSON object — no commentary, no markdown fences.

[User]
Target category: RenameApiCall
Library versions: transformers=4.40.0, datasets=2.18.0, trl=0.10.0

Working script:
```python
"""ALBERT-tiny extractive QA on 100-sample SQuAD subset."""
from transformers import (
    AutoTokenizer,
    AutoModelForQuestionAnswering,
    Trainer,
    TrainingArguments,
    DefaultDataCollator,
)
from datasets import load_dataset

dataset = load_dataset("squad", split="train[:100]")
tokenizer = AutoTokenizer.from_pretrained("albert-base-v2")

def prepare(examples):
    enc = tokenizer(
        examples["question"],
        examples["context"],
        max_length=128,
        truncation="only_second",
        padding="max_length",
        return_offsets_mapping=True,
    )
    start_positions, end_positions = [], []
    for i, offsets in enumerate(enc["offset_mapping"]):
        answer = examples["answers"][i]
        start_char = answer["answer_start"][0]
        end_char = start_char + len(answer["text"][0])

        token_start = next(
            (idx for idx, (a, b) in enumerate(offsets) if a <= start_char < b), 0
        )
        token_end = next(
            (idx for idx, (a, b) in enumerate(offsets) if a < end_char <= b), token_start
        )
        start_positions.append(token_start)
        end_positions.append(token_end)

    enc["start_positions"] = start_positions
    enc["end_positions"] = end_positions
    enc.pop("offset_mapping")
    return enc

dataset = dataset.map(prepare, batched=True, remove_columns=dataset.column_names)

model = AutoModelForQuestionAnswering.from_pretrained("albert-base-v2")

training_args = TrainingArguments(
    output_dir="/tmp/forge_output/checkpoint",
    num_train_epochs=1,
    per_device_train_batch_size=4,
    logging_steps=5,
    save_strategy="epoch",
    no_cuda=True,
    report_to="none",
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=dataset,
    data_collator=DefaultDataCollator(),
)
trainer.train()
trainer.save_model("/tmp/forge_output/checkpoint")
print("TRAINING_COMPLETE")

```

Output JSON breakage primitive:

[Assistant]
{
  "primitive_type": "RenameApiCall",
  "params": {
    "old_name": "trainer.train",
    "new_name": "trainer.start_training"
  }
}