Codegen và Patches
Trang này mô tả code build, code gen, và code apply.
Code build
Lệnh:
midicoder code build
Output:
.midicoder/versions/<ver>/plans/
index.json
commands/*.code-plan.json
workflows/*.code-plan.json
api/*.code-plan.json
Plans là pseudo code FastAPI deterministic để dùng cho patch planning.
Code gen
Lệnh:
midicoder code gen
Step 1 (model high): chọn file, anchor, operation. Step 2 (model cheap): convert pseudo sang stack đích nếu cần.
Output:
.midicoder/versions/<ver>/patches/
plans/
index.json
commands/*.patch-plan.json
workflows/*.patch-plan.json
Cấu trúc patch plan
Mỗi *.patch-plan.json bao gồm:
pathoperation(write, edit, delete)anchorvàmodecho editcontentlà code cuối
Code apply
Lệnh:
midicoder code apply
Apply patch, tạo snapshot, và ghi:
ops.json- unified diff
.patch
Các file nằm trong .midicoder/runs/ và .midicoder/versions/<ver>/patches/.