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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ff28506
 
f1bcc76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ff28506
f1bcc76
ff28506
f1bcc76
ff28506
f1bcc76
 
 
 
 
 
 
 
 
 
 
 
ff28506
f1bcc76
ff28506
f1bcc76
 
 
 
 
ff28506
f1bcc76
ff28506
f1bcc76
 
 
 
 
ff28506
f1bcc76
 
 
ff28506
f1bcc76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ff28506
 
f1bcc76
 
 
 
 
 
 
ff28506
f1bcc76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
---
base_model: Qwen/Qwen2.5-Coder-7B-Instruct
library_name: peft
pipeline_tag: text-generation
license: apache-2.0
language:
  - en
tags:
  - jumplander
  - jx
  - qwen2.5
  - qwen2.5-coder
  - coding-agent
  - agentic-ai
  - software-engineering
  - repository-understanding
  - goal-grounding
  - tool-use
  - behavioral-policy
  - qlora
  - lora
  - peft
datasets:
  - jumplander/JL-AgentBehavior-10K
---

<div align="center">

<a href="https://jumplander.org">
  <img src="https://www.jumplander.org/assets/images/logo/logo-jumplander-v2.png" alt="JumpLander logo" width="130">
</a>

# JX Coder 7B Agent Behavior

### A specialized behavioral-policy adapter for controlled software-engineering agents

[![JumpLander](https://img.shields.io/badge/JumpLander-AI%20Research%20%26%20Engineering-28392b)](https://jumplander.org)
[![Base Model](https://img.shields.io/badge/Base-Qwen2.5--Coder--7B--Instruct-4b5d2a)](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct)
[![Dataset](https://img.shields.io/badge/Dataset-JL--AgentBehavior--10K-819e2e)](https://huggingface.co/datasets/jumplander/JL-AgentBehavior-10K)
[![Library](https://img.shields.io/badge/Library-PEFT-lightgrey)](https://github.com/huggingface/peft)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue)](https://www.apache.org/licenses/LICENSE-2.0)

[Website](https://jumplander.org) ·
[Hugging Face](https://huggingface.co/jumplander) ·
[Dataset](https://huggingface.co/datasets/jumplander/JL-AgentBehavior-10K) ·
[Base Model](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct)

</div>

---

## Table of Contents

- [Model Overview](#model-overview)
- [Why This Model Exists](#why-this-model-exists)
- [Release Positioning](#release-positioning)
- [Model Architecture](#model-architecture)
- [Training Data](#training-data)
- [Training Objective](#training-objective)
- [Behavioral Capabilities](#behavioral-capabilities)
- [Training Configuration](#training-configuration)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Four-Bit Loading](#four-bit-loading)
- [Chat Inference](#chat-inference)
- [Structured Agent Inference](#structured-agent-inference)
- [Merging the Adapter](#merging-the-adapter)
- [Using the Model in an Agent Runtime](#using-the-model-in-an-agent-runtime)
- [Recommended Prompts](#recommended-prompts)
- [Expected Output Behavior](#expected-output-behavior)
- [Limitations](#limitations)
- [Evaluation Status](#evaluation-status)
- [Safety and Deployment Notes](#safety-and-deployment-notes)
- [Versioning](#versioning)
- [Roadmap](#roadmap)
- [License and Attribution](#license-and-attribution)
- [Citation](#citation)
- [About JumpLander](#about-jumplander)

---

## Model Overview

**JX Coder 7B Agent Behavior** is a Parameter-Efficient Fine-Tuning adapter developed by [JumpLander](https://jumplander.org) for controlled software-engineering agents.

The release is built on top of:

- **Base model:** [`Qwen/Qwen2.5-Coder-7B-Instruct`](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct)
- **Fine-tuning method:** 4-bit QLoRA / PEFT
- **Primary dataset:** [`jumplander/JL-AgentBehavior-10K`](https://huggingface.co/datasets/jumplander/JL-AgentBehavior-10K)
- **Primary language:** English
- **Artifact type:** LoRA adapter
- **Primary purpose:** coding-agent behavioral policy
- **Developer:** [JumpLander](https://jumplander.org)

This repository contains the trained adapter weights, not a standalone copy of the full 7B base model.

At inference time, the adapter is loaded on top of Qwen2.5-Coder-7B-Instruct:

```text
Qwen2.5-Coder-7B-Instruct
            +
JX Coder 7B Agent Behavior Adapter
            =
JX Coder 7B Agent Behavior
```

The small adapter file size is expected. The base model provides general language and coding capability, while the JX adapter modifies the model toward a more controlled agent policy.

---

## Why This Model Exists

Many coding models are optimized to generate an answer or code block immediately after receiving a request.

That behavior is useful for code completion, but it is not sufficient for a reliable software-engineering agent operating on a real repository.

A repository-level agent must make a sequence of bounded decisions:

```text
user request

interpret the task

identify constraints and approval boundaries

inspect repository evidence

build a proportional plan

select the correct tool

make a scoped change

run relevant verification

diagnose failures

report only what evidence supports
```

The objective of this release is not to replace the coding ability of the base model. Qwen2.5-Coder already provides strong code-oriented language-model capabilities.

The objective is to specialize the model toward behaviors that matter inside an agent runtime:

- understanding the actual requested outcome;
- separating facts from assumptions;
- grounding repository references in available evidence;
- respecting explicit constraints;
- avoiding unrelated edits;
- requesting approval before sensitive operations;
- validating changes before claiming success;
- changing the hypothesis after a failed attempt;
- producing structured decisions that a runtime can execute.

JumpLander is developing JX as a controlled environment connecting language models to repositories, files, terminal commands, tests, memory, diffs, and user approval. This model is one component of that larger system.

Learn more about the project at [jumplander.org](https://jumplander.org).

---

## Release Positioning

This release should be understood as:

> A behavioral-policy warm-start for software-engineering agents.

It should not be described as:

- a model trained from random initialization;
- a fully autonomous coding agent;
- a runtime-verified repository repair model;
- a replacement for repository execution;
- a standalone benchmark winner;
- a fully bilingual English–Persian model.

The adapter is developed and fine-tuned by JumpLander, while the underlying language-model architecture and base weights come from Qwen2.5-Coder-7B-Instruct.

---

## Model Architecture

| Property | Value |
|---|---|
| Model family | JX Coder |
| Release name | JX Coder 7B Agent Behavior |
| Base model | Qwen2.5-Coder-7B-Instruct |
| Approximate base parameters | 7B |
| Adaptation method | QLoRA |
| Adapter framework | PEFT |
| Quantization during training | 4-bit NF4 |
| Adapter rank | 16 |
| Sequence length | 1,024 tokens |
| Output artifact | LoRA adapter |
| Primary modality | Text |
| Primary task | Structured coding-agent behavior |
| Primary language | English |
| Persian support | Experimental and limited |

The adapter is designed to be loaded with the [`peft`](https://github.com/huggingface/peft) library.

---

## Training Data

### Primary Dataset

The primary data source is:

### [`jumplander/JL-AgentBehavior-10K`](https://huggingface.co/datasets/jumplander/JL-AgentBehavior-10K)

JL-AgentBehavior-10K is a JumpLander research-preview dataset designed to study and train behavioral policy for repository-level coding agents.

The dataset emphasizes the process around software changes rather than only the final answer.

Its behavioral structure includes concepts such as:

```text
task
→ repository evidence
→ bounded plan
→ tool selection
→ scoped edit strategy
→ verification
→ failure diagnosis and repair
→ evidence-based final report
```

The dataset contains structured supervision for:

- trajectory decisions;
- selected and rejected behaviors;
- failure diagnosis and repair;
- repository grounding;
- tool selection;
- bounded editing;
- verification;
- approval boundaries;
- evidence-aware reporting.

### Local Training Snapshot

The local preprocessing pipeline used for this adapter produced:

| Item | Count |
|---|---:|
| Canonical records used by the local training snapshot | 7,500 |
| Generated supervised training views | 15,000 |
| Additional identity examples | 16 |
| Total prepared examples | 15,016 |
| Training examples | 14,265 |
| Validation examples | 751 |

The local snapshot and preprocessing view counts describe this training run. They should not be interpreted as replacing the official dataset card, package splits, or version history.

### Data Language

The behavioral supervision used in this release is primarily English.

Persian-language examples were not present at a scale sufficient to claim strong Persian generation quality.

### Data Evidence Level

The dataset is intended for behavioral-policy research and training. Synthetic tool descriptions, candidate commands, expected observations, or repair paths do not prove that real repository operations were executed.

Users should review the complete dataset documentation before making claims about runtime correctness:

- [Dataset card](https://huggingface.co/datasets/jumplander/JL-AgentBehavior-10K)
- [JumpLander organization](https://huggingface.co/jumplander)
- [JumpLander website](https://jumplander.org)

---

## Training Objective

The adapter was trained to make the base model more likely to follow a controlled software-engineering policy.

### Core Objectives

1. **Goal grounding**

   Identify the requested outcome instead of reacting only to keywords.

2. **Constraint extraction**

   Preserve restrictions such as:

   - do not modify unrelated files;
   - do not add dependencies;
   - keep the public API stable;
   - inspect before editing;
   - ask before destructive actions.

3. **Repository grounding**

   Avoid inventing files, functions, tests, command outputs, or repository state.

4. **Authority awareness**

   Distinguish actions that can proceed automatically from actions requiring explicit approval.

5. **Tool selection**

   Select a tool that matches the current information need.

6. **Bounded planning**

   Build a plan proportional to the task rather than producing unnecessary broad changes.

7. **Verification discipline**

   Avoid claiming a fix is complete without relevant evidence.

8. **Failure diagnosis**

   Update the hypothesis after a failed test or unexpected observation.

9. **Critique and repair**

   Identify why a trajectory was unsafe, unsupported, or ineffective and propose a bounded correction.

10. **Evidence-aware reporting**

    Clearly separate:

    - verified results;
    - observed facts;
    - assumptions;
    - unresolved risks;
    - suggested next actions.

---

## Behavioral Capabilities

This release is intended to improve policy behavior in the following areas.

### Goal Grounding

The model can structure an incoming task into an interpreted request, missing information, relevant constraints, and a next action.

### Repository-Aware Planning

When repository evidence is available, the model can use it to recommend an inspection or edit sequence.

### Tool-Oriented Decisions

The model can produce decisions suitable for mapping to runtime tools such as:

```text
search
list_directory
read_file
update_plan
apply_patch
run_tests
run_linter
git_diff
diagnose_failure
review_diff
request_approval
```

The runtime must map these abstract actions to its actual interfaces.

### Constraint Handling

The model is trained to treat user constraints as part of the task contract, not as optional preferences.

### Failure Recovery

The model can critique a failed attempt, revise the diagnosis, and suggest a more bounded repair sequence.

### Evidence-Based Completion

The model is intended to avoid unsupported statements such as “the issue is fixed” when no test or runtime evidence has been provided.

---

## Training Configuration

The following configuration describes the training setup used for this adapter.

| Setting | Value |
|---|---|
| Base model | `Qwen/Qwen2.5-Coder-7B-Instruct` |
| Training method | Supervised fine-tuning |
| PEFT method | QLoRA |
| Quantization | 4-bit |
| Quantization type | NF4 |
| Double quantization | Enabled |
| LoRA rank | 16 |
| Maximum sequence length | 1,024 |
| Per-device batch size | 1 |
| Gradient accumulation | 16 |
| Epochs | 1 |
| Optimizer steps | 892 |
| Reported training hardware | NVIDIA GeForce RTX 3090 24GB |
| Output format | PEFT LoRA adapter |

> **Hardware note:** RTX 3090 24GB is recorded here as the reported hardware for the release. Maintainers should reconcile this field with the archived training log before treating it as independently verified metadata.

### Training Behavior Observed

Training loss decreased rapidly and token-level training accuracy became very high.

This indicates that the adapter strongly learned the structured output patterns present in the training views. It also creates a risk of over-structuring: the model may emit agent-style JSON for ordinary conversational requests.

This behavior is documented as a limitation rather than hidden.

---

## Installation

Create a Python environment and install the required libraries:

```bash
pip install -U torch transformers accelerate peft bitsandbytes safetensors
```

Recommended versions should be selected according to the local CUDA and PyTorch environment.

Check CUDA availability:

```python
import torch

print("PyTorch:", torch.__version__)
print("CUDA available:", torch.cuda.is_available())

if torch.cuda.is_available():
    print("GPU:", torch.cuda.get_device_name(0))
```

---

## Quick Start

This adapter requires the base model.

Replace the adapter identifier below with the final Hugging Face repository ID if it differs.

```python
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

BASE_MODEL_ID = "Qwen/Qwen2.5-Coder-7B-Instruct"
ADAPTER_ID = "jumplander/JX-Coder-7B-Agent-Behavior"

tokenizer = AutoTokenizer.from_pretrained(
    ADAPTER_ID,
    trust_remote_code=True,
)

base_model = AutoModelForCausalLM.from_pretrained(
    BASE_MODEL_ID,
    torch_dtype="auto",
    device_map="auto",
    trust_remote_code=True,
)

model = PeftModel.from_pretrained(
    base_model,
    ADAPTER_ID,
)

model.eval()

messages = [
    {
        "role": "system",
        "content": (
            "You are JX Coder 7B Agent Behavior, developed by JumpLander "
            "on top of Qwen2.5-Coder-7B-Instruct. "
            "Ground decisions in available evidence. "
            "Do not claim that repository operations were executed unless "
            "the runtime provides execution results."
        ),
    },
    {
        "role": "user",
        "content": (
            "A user reports that authentication redirects back to the login "
            "page after a successful sign-in. Do not edit files yet. "
            "Explain what repository evidence should be inspected first."
        ),
    },
]

prompt = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
)

inputs = tokenizer(
    prompt,
    return_tensors="pt",
).to(model.device)

with torch.inference_mode():
    output_ids = model.generate(
        **inputs,
        max_new_tokens=512,
        temperature=0.2,
        do_sample=True,
        top_p=0.9,
        repetition_penalty=1.05,
    )

generated_ids = output_ids[0, inputs["input_ids"].shape[-1]:]

response = tokenizer.decode(
    generated_ids,
    skip_special_tokens=True,
)

print(response)
```

---

## Four-Bit Loading

For lower VRAM usage, load the base model in 4-bit.

```python
import torch
from peft import PeftModel
from transformers import (
    AutoModelForCausalLM,
    AutoTokenizer,
    BitsAndBytesConfig,
)

BASE_MODEL_ID = "Qwen/Qwen2.5-Coder-7B-Instruct"
ADAPTER_ID = "jumplander/JX-Coder-7B-Agent-Behavior"

compute_dtype = (
    torch.bfloat16
    if torch.cuda.is_available() and torch.cuda.is_bf16_supported()
    else torch.float16
)

quantization_config = BitsAndBytesConfig(
    load_in_4bit=True,
    bnb_4bit_quant_type="nf4",
    bnb_4bit_use_double_quant=True,
    bnb_4bit_compute_dtype=compute_dtype,
)

tokenizer = AutoTokenizer.from_pretrained(
    ADAPTER_ID,
    trust_remote_code=True,
)

base_model = AutoModelForCausalLM.from_pretrained(
    BASE_MODEL_ID,
    quantization_config=quantization_config,
    device_map="auto",
    trust_remote_code=True,
)

model = PeftModel.from_pretrained(
    base_model,
    ADAPTER_ID,
)

model.eval()
```

---

## Chat Inference

The adapter is strongly biased toward structured agent outputs.

For normal conversational usage, use an explicit chat-mode system instruction.

```python
CHAT_SYSTEM_PROMPT = """
You are JX Coder 7B Agent Behavior, developed by JumpLander.
Respond naturally and directly.
Do not return agent JSON unless the user explicitly requests structured output.
Do not claim to have accessed files, executed commands, or run tests.
"""

messages = [
    {"role": "system", "content": CHAT_SYSTEM_PROMPT},
    {"role": "user", "content": "Explain dependency injection in PHP."},
]
```

A system prompt can reduce unnecessary structuring, but it cannot fully remove behavior learned during fine-tuning.

For production use, JumpLander recommends a runtime-level mode selector.

```text
chat
coding
debug
review
agent
```

Each mode should use a distinct system prompt and output contract.

---

## Structured Agent Inference

Use an explicit schema when the output will be consumed by software.

```python
import json

AGENT_SYSTEM_PROMPT = """
You are JX Coder 7B Agent Behavior, a behavioral-policy model developed by JumpLander.

Return one valid JSON object with these keys:

- mode
- interpreted_request
- constraints
- missing_information
- recommended_action
- tool
- arguments
- evidence_required
- approval_required
- completion_status

Rules:
1. Do not invent repository evidence.
2. Do not claim that a command was executed.
3. Prefer inspection before mutation.
4. Respect the user's explicit scope.
5. Request approval before sensitive or destructive actions.
6. completion_status must be "pending" unless fresh evidence proves completion.
"""

messages = [
    {"role": "system", "content": AGENT_SYSTEM_PROMPT},
    {
        "role": "user",
        "content": (
            "Fix the PHP login redirect loop. Preserve the public API, "
            "do not add dependencies, and do not modify unrelated files. "
            "No repository files have been provided yet."
        ),
    },
]
```

Example target shape:

```json
{
  "mode": "repository_grounding",
  "interpreted_request": {
    "goal": "Diagnose and repair the PHP login redirect loop",
    "task_type": "bug_fix"
  },
  "constraints": [
    "Preserve the public API",
    "Do not add dependencies",
    "Do not modify unrelated files"
  ],
  "missing_information": [
    "Authentication controller or handler",
    "Session initialization code",
    "Login success redirect logic",
    "Relevant route or middleware configuration"
  ],
  "recommended_action": "Inspect authentication and session flow before editing",
  "tool": "search",
  "arguments": {
    "query": "login session redirect authentication middleware"
  },
  "evidence_required": [
    "Relevant file paths",
    "Session creation path",
    "Redirect condition",
    "Existing authentication tests"
  ],
  "approval_required": false,
  "completion_status": "pending"
}
```

The generated output may not always conform perfectly to a schema. Production systems should validate and repair model output before tool execution.

---

## Merging the Adapter

The published artifact is an adapter.

To create a merged model locally:

```python
import torch
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer

BASE_MODEL_ID = "Qwen/Qwen2.5-Coder-7B-Instruct"
ADAPTER_ID = "jumplander/JX-Coder-7B-Agent-Behavior"
OUTPUT_DIR = "./jx-coder-7b-agent-behavior-merged"

tokenizer = AutoTokenizer.from_pretrained(
    BASE_MODEL_ID,
    trust_remote_code=True,
)

base_model = AutoModelForCausalLM.from_pretrained(
    BASE_MODEL_ID,
    torch_dtype=torch.float16,
    device_map="cpu",
    trust_remote_code=True,
)

model = PeftModel.from_pretrained(
    base_model,
    ADAPTER_ID,
)

merged_model = model.merge_and_unload()

merged_model.save_pretrained(
    OUTPUT_DIR,
    safe_serialization=True,
    max_shard_size="4GB",
)

tokenizer.save_pretrained(OUTPUT_DIR)

print(f"Merged model saved to: {OUTPUT_DIR}")
```

### Important Notes

- Merging requires enough system RAM or VRAM.
- The merged output will be much larger than the adapter.
- The merged model remains a derivative of Qwen2.5-Coder-7B-Instruct.
- Review the base-model license before redistribution.
- Validate the merged model before publishing it as a separate repository.

---

## Using the Model in an Agent Runtime

This adapter does not provide repository access by itself.

A complete runtime should supply tools, state, permission controls, and validation.

### Recommended Runtime Layers

```text
User Interface

Mode Router

Prompt and Context Builder

JX Coder 7B Agent Behavior

Schema Validator

Permission Gateway

Tool Runtime

Repository / Terminal / Tests

Observation Normalizer

Model Re-evaluation

Evidence-Based Final Report
```

### Recommended Tool Interface

A runtime may expose tools such as:

```json
{
  "name": "read_file",
  "description": "Read a repository file without modifying it.",
  "parameters": {
    "path": "string",
    "start_line": "integer or null",
    "end_line": "integer or null"
  }
}
```

```json
{
  "name": "apply_patch",
  "description": "Apply a bounded patch to an allowed repository file.",
  "parameters": {
    "path": "string",
    "patch": "unified diff string"
  }
}
```

```json
{
  "name": "run_tests",
  "description": "Run an approved test command and return structured output.",
  "parameters": {
    "command": "string",
    "timeout_seconds": "integer"
  }
}
```

### Runtime Responsibilities

The runtime, not the model, must enforce:

- allowed directories;
- command allowlists;
- network permissions;
- secret handling;
- approval boundaries;
- timeouts;
- process isolation;
- patch-size limits;
- test execution;
- log capture;
- rollback;
- output-schema validation.

Never execute model-generated commands without validation.

---

## Recommended Prompts

### Repository Grounding

```text
A user reports that updating a session returns stale state.

Constraints:
- Preserve the public API.
- Do not add dependencies.
- Do not edit files yet.

List the repository evidence required before proposing a patch.
```

### Bounded Planning

```text
Create a minimal plan for fixing a login redirect loop.

Known files:
- auth/login.php
- auth/session.php
- middleware/guest.php
- tests/auth/LoginTest.php

Do not produce code. Identify the likely inspection order and the evidence needed.
```

### Failure Diagnosis

```text
The targeted authentication test still fails after the first patch.

Observed result:
Expected redirect: /panel
Actual redirect: /login

The session cookie is present.

Revise the hypothesis and propose the next diagnostic action.
```

### Diff Review

```text
Review the following patch for:
- unrelated changes;
- public API breakage;
- missing tests;
- unsupported success claims;
- security risks.

Return findings in severity order.
```

### Approval Boundary

```text
The proposed fix requires deleting cached session files in production.

Determine whether approval is required and explain the safest next action.
```

---

## Expected Output Behavior

The model may produce structured objects containing fields such as:

```text
mode
interaction
user_input
interpreted_request
constraints
missing_information
response
recommended_action
tool
arguments
request_user_action
```

This is expected because the adapter was trained primarily on structured behavioral supervision.

### Recommended Deployment Strategy

Use separate modes:

| Mode | Purpose | Output Style |
|---|---|---|
| Chat | Natural technical conversation | Plain text |
| Coding | Code generation from a sufficiently specified task | Code plus concise explanation |
| Debug | Evidence-oriented diagnosis | Hypotheses and next checks |
| Review | Diff, architecture, or security review | Structured findings |
| Agent | Tool-oriented repository workflow | Validated JSON |

Mode selection should happen in the application layer rather than relying entirely on the model to infer the desired format.

---

## Limitations

### 1. English-First Release

The primary training data is English.

Persian understanding and generation are experimental and limited. The model may:

- answer in English after a Persian request;
- generate broken Persian;
- misinterpret Persian technical instructions;
- return structured JSON instead of natural Persian.

Do not market this release as fully bilingual.

### 2. Over-Structured Responses

The model may return agent-style JSON for simple questions.

This is a direct consequence of the training objective and data distribution.

### 3. No Native Tool Execution

The model cannot independently:

- read repository files;
- apply patches;
- run terminal commands;
- execute tests;
- inspect a browser;
- access private systems;
- verify production state.

These capabilities require an external runtime.

### 4. Synthetic Behavioral Data

Synthetic trajectories can teach useful policies, but they do not replace:

- real repository snapshots;
- executed patches;
- hidden tests;
- human code review;
- production incident evidence;
- contamination analysis;
- independent benchmarks.

### 5. No Standalone Correctness Claim

This release has not established general repository-repair correctness.

A model can produce a plausible plan while still being wrong.

### 6. Template Memorization Risk

Rapid loss reduction and high token-level training accuracy indicate strong adaptation to training templates.

This may reduce output diversity and increase schema repetition.

### 7. Base-Model Dependency

The adapter requires a compatible Qwen2.5-Coder-7B-Instruct base model.

Behavior can vary across:

- Transformers versions;
- PEFT versions;
- quantization settings;
- generation parameters;
- chat templates;
- runtime prompts.

### 8. Context Length Used During Fine-Tuning

The adapter was trained with a maximum sequence length of 1,024 tokens.

Long repository contexts were not directly represented at their full deployment length during this training run.

---

## Evaluation Status

This release is a research and engineering artifact.

At publication time, claims should remain limited to:

- successful adapter training;
- strong learning of structured behavioral formats;
- observed identity and agent-policy adaptation;
- compatibility with the declared base model;
- local inference through PEFT.

The release does not yet provide a complete independent benchmark report covering:

- HumanEval;
- MBPP;
- MultiPL-E;
- SWE-bench;
- repository-level executable repair;
- tool-call accuracy;
- schema-validity rate;
- Persian benchmarks;
- safety-policy adherence;
- regression against the unmodified base model.

### Recommended Evaluation Plan

Future evaluation should compare:

```text
Base Qwen2.5-Coder-7B-Instruct
vs.
Base + JX Agent Behavior Adapter
```

Suggested metrics:

- goal extraction accuracy;
- constraint retention;
- repository hallucination rate;
- correct first tool choice;
- invalid tool-argument rate;
- approval-boundary accuracy;
- success-claim calibration;
- failure-recovery quality;
- JSON schema validity;
- patch-scope compliance;
- targeted test selection;
- natural-chat degradation.

---

## Safety and Deployment Notes

This model can generate code, shell commands, configuration changes, and operational instructions.

Deployment systems should:

1. treat generated content as untrusted;
2. validate all JSON outputs;
3. restrict filesystem access;
4. restrict command execution;
5. isolate processes;
6. protect credentials and secrets;
7. require approval for destructive actions;
8. log tool calls and observations;
9. run targeted tests;
10. review diffs before application;
11. separate model proposals from verified results;
12. provide rollback.

The model should never be the sole authority for production deployment, security remediation, database migration, credential rotation, destructive file operations, or other high-impact actions.

---

## Versioning

### Model Release

Recommended repository name:

```text
jumplander/JX-Coder-7B-Agent-Behavior
```

Recommended initial release label:

```text
1.0 Research Preview
```

This label communicates that:

- the adapter is a real public release;
- the behavioral specialization is defined;
- the model is still under active evaluation;
- runtime-level capabilities remain outside the adapter;
- future revisions may change data balance, schemas, and inference behavior.

### Suggested Version Policy

| Change | Version Increment |
|---|---|
| Documentation or metadata fix | Patch |
| Compatible data expansion or improved prompt templates | Minor |
| New output contract or materially different training objective | Major |

---

## Roadmap

Planned research directions for the JX model family include:

- conversational and agent mode switching;
- Persian technical alignment;
- repository-grounded code repair;
- executable tool calling;
- schema-constrained decoding;
- tool-result interpretation;
- patch generation and review;
- test selection;
- failure recovery loops;
- long-context repository understanding;
- memory-aware agent behavior;
- human approval policy;
- evaluation against real repository tasks;
- smaller specialized JX models for routing, debugging, review, and verification.

Follow development through:

- [JumpLander](https://jumplander.org)
- [JumpLander on Hugging Face](https://huggingface.co/jumplander)
- [JL-AgentBehavior-10K](https://huggingface.co/datasets/jumplander/JL-AgentBehavior-10K)

---

## License and Attribution

### Adapter

This repository is released under the license declared in the Hugging Face metadata and repository files.

### Base Model

The adapter is derived from:

[`Qwen/Qwen2.5-Coder-7B-Instruct`](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct)

Users must review and comply with the base model's license and usage terms.

### Dataset

The primary JumpLander dataset is:

[`jumplander/JL-AgentBehavior-10K`](https://huggingface.co/datasets/jumplander/JL-AgentBehavior-10K)

Users should review the dataset card, provenance statements, limitations, and license before use.

### Required Technical Description

When describing the model, use language similar to:

> JX Coder 7B Agent Behavior is a PEFT/QLoRA adapter developed by JumpLander on top of Qwen2.5-Coder-7B-Instruct and trained with behavioral supervision derived from JL-AgentBehavior-10K.

Do not describe the adapter as a 7B model trained from scratch by JumpLander.

---

## Citation

### Model

```bibtex
@software{jumplander_jx_coder_7b_agent_behavior_2026,
  author       = {JumpLander},
  title        = {JX Coder 7B Agent Behavior},
  year         = {2026},
  version      = {1.0-research-preview},
  publisher    = {Hugging Face},
  url          = {https://huggingface.co/jumplander/JX-Coder-7B-Agent-Behavior},
  base_model   = {Qwen/Qwen2.5-Coder-7B-Instruct}
}
```

### Dataset

```bibtex
@dataset{jumplander_agentbehavior_10k_2026,
  author       = {JumpLander},
  title        = {JL-AgentBehavior-10K: Structured Behavioral Supervision for Coding Agents},
  year         = {2026},
  version      = {1.0.0},
  publisher    = {Hugging Face},
  url          = {https://huggingface.co/datasets/jumplander/JL-AgentBehavior-10K}
}
```

---

## About JumpLander

[JumpLander](https://jumplander.org) is an AI research and engineering project focused on:

- agent systems;
- specialized models and training;
- agentic datasets and evaluation;
- intelligent software engineering;
- repository intelligence;
- controlled tool execution;
- knowledge systems;
- developer infrastructure.

JX is JumpLander's controlled software-engineering agent environment. Its purpose is to connect models to repositories, files, diffs, tools, terminal commands, tests, memory, and human approval through an observable and bounded workflow.

<div align="center">

### Build. Learn. Research. Innovate.

[Visit JumpLander](https://jumplander.org) ·
[Explore the Dataset](https://huggingface.co/datasets/jumplander/JL-AgentBehavior-10K) ·
[View the Base Model](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct)

</div>