Skip to content

Commit 34c3c38

Browse files
committed
update instructions to emphasize deletion comments
1 parent 4943a0a commit 34c3c38

File tree

4 files changed

+143
-20
lines changed

4 files changed

+143
-20
lines changed

backend/src/__tests__/__snapshots__/tools.test.ts.snap

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ Indicate the location and nature of the modifications (additions and deletions)
499499
500500
Make sure that you preserve the indentation and code structure of exactly how you believe the final code will look like (do not output lines that will not be in the final code after they are merged).
501501
502+
##### **IMPORTANT** Deletion Comments
503+
502504
**CRITICAL FOR DELETIONS** If you plan on deleting a section, you MUST provide a comment giving the relevant context such that the code is understood to be removed. This is REQUIRED for the fast-apply model to understand what to delete.
503505
504506
Examples:
@@ -518,7 +520,9 @@ Block 3
518520
// rest of code
519521
\`\`\`
520522
521-
**YOU MUST ALWAYS INCLUDE DELETION COMMENTS** when removing code blocks, functions, variables, or any other code elements. The fast-apply model cannot understand deletions without these explicit comments.
523+
**YOU MUST ALWAYS INCLUDE DELETION COMMENTS** when removing **anything**: single lines, code blocks, functions, variables, or any other code elements. The fast-apply model cannot understand deletions without these explicit comments.
524+
525+
Merely omitting the code block may or may not work. In order to guarantee the deletion of the code, you must include a deletion comment.
522526
523527
#### Additional Info
524528
@@ -547,17 +551,19 @@ Example 1 - Simple file creation:
547551
Example 2 - Editing with placeholder comments:
548552
<write_file>
549553
<path>foo.ts</path>
550-
<content>// no change to imports
554+
<content>// ... existing code ...
551555
552556
function foo() {
553557
console.log('foo');
554558
for (let i = 0; i < 10; i++) {
555559
console.log(i);
556560
}
557561
doSomething();
562+
563+
// Delete the console.log line from here
558564
}
559565
560-
// rest of code</content>
566+
// ... existing code ...</content>
561567
</write_file>
562568
563569
### str_replace
@@ -1047,6 +1053,8 @@ Indicate the location and nature of the modifications (additions and deletions)
10471053
10481054
Make sure that you preserve the indentation and code structure of exactly how you believe the final code will look like (do not output lines that will not be in the final code after they are merged).
10491055
1056+
##### **IMPORTANT** Deletion Comments
1057+
10501058
**CRITICAL FOR DELETIONS** If you plan on deleting a section, you MUST provide a comment giving the relevant context such that the code is understood to be removed. This is REQUIRED for the fast-apply model to understand what to delete.
10511059
10521060
Examples:
@@ -1066,7 +1074,9 @@ Block 3
10661074
// rest of code
10671075
\`\`\`
10681076
1069-
**YOU MUST ALWAYS INCLUDE DELETION COMMENTS** when removing code blocks, functions, variables, or any other code elements. The fast-apply model cannot understand deletions without these explicit comments.
1077+
**YOU MUST ALWAYS INCLUDE DELETION COMMENTS** when removing **anything**: single lines, code blocks, functions, variables, or any other code elements. The fast-apply model cannot understand deletions without these explicit comments.
1078+
1079+
Merely omitting the code block may or may not work. In order to guarantee the deletion of the code, you must include a deletion comment.
10701080
10711081
#### Additional Info
10721082
@@ -1095,17 +1105,19 @@ Example 1 - Simple file creation:
10951105
Example 2 - Editing with placeholder comments:
10961106
<write_file>
10971107
<path>foo.ts</path>
1098-
<content>// no change to imports
1108+
<content>// ... existing code ...
10991109
11001110
function foo() {
11011111
console.log('foo');
11021112
for (let i = 0; i < 10; i++) {
11031113
console.log(i);
11041114
}
11051115
doSomething();
1116+
1117+
// Delete the console.log line from here
11061118
}
11071119
1108-
// rest of code</content>
1120+
// ... existing code ...</content>
11091121
</write_file>
11101122
11111123
### str_replace
@@ -1595,6 +1607,8 @@ Indicate the location and nature of the modifications (additions and deletions)
15951607
15961608
Make sure that you preserve the indentation and code structure of exactly how you believe the final code will look like (do not output lines that will not be in the final code after they are merged).
15971609
1610+
##### **IMPORTANT** Deletion Comments
1611+
15981612
**CRITICAL FOR DELETIONS** If you plan on deleting a section, you MUST provide a comment giving the relevant context such that the code is understood to be removed. This is REQUIRED for the fast-apply model to understand what to delete.
15991613
16001614
Examples:
@@ -1614,7 +1628,9 @@ Block 3
16141628
// rest of code
16151629
\`\`\`
16161630
1617-
**YOU MUST ALWAYS INCLUDE DELETION COMMENTS** when removing code blocks, functions, variables, or any other code elements. The fast-apply model cannot understand deletions without these explicit comments.
1631+
**YOU MUST ALWAYS INCLUDE DELETION COMMENTS** when removing **anything**: single lines, code blocks, functions, variables, or any other code elements. The fast-apply model cannot understand deletions without these explicit comments.
1632+
1633+
Merely omitting the code block may or may not work. In order to guarantee the deletion of the code, you must include a deletion comment.
16181634
16191635
#### Additional Info
16201636
@@ -1643,17 +1659,19 @@ Example 1 - Simple file creation:
16431659
Example 2 - Editing with placeholder comments:
16441660
<write_file>
16451661
<path>foo.ts</path>
1646-
<content>// no change to imports
1662+
<content>// ... existing code ...
16471663
16481664
function foo() {
16491665
console.log('foo');
16501666
for (let i = 0; i < 10; i++) {
16511667
console.log(i);
16521668
}
16531669
doSomething();
1670+
1671+
// Delete the console.log line from here
16541672
}
16551673
1656-
// rest of code</content>
1674+
// ... existing code ...</content>
16571675
</write_file>
16581676
16591677
### str_replace
@@ -2143,6 +2161,8 @@ Indicate the location and nature of the modifications (additions and deletions)
21432161
21442162
Make sure that you preserve the indentation and code structure of exactly how you believe the final code will look like (do not output lines that will not be in the final code after they are merged).
21452163
2164+
##### **IMPORTANT** Deletion Comments
2165+
21462166
**CRITICAL FOR DELETIONS** If you plan on deleting a section, you MUST provide a comment giving the relevant context such that the code is understood to be removed. This is REQUIRED for the fast-apply model to understand what to delete.
21472167
21482168
Examples:
@@ -2162,7 +2182,9 @@ Block 3
21622182
// rest of code
21632183
\`\`\`
21642184
2165-
**YOU MUST ALWAYS INCLUDE DELETION COMMENTS** when removing code blocks, functions, variables, or any other code elements. The fast-apply model cannot understand deletions without these explicit comments.
2185+
**YOU MUST ALWAYS INCLUDE DELETION COMMENTS** when removing **anything**: single lines, code blocks, functions, variables, or any other code elements. The fast-apply model cannot understand deletions without these explicit comments.
2186+
2187+
Merely omitting the code block may or may not work. In order to guarantee the deletion of the code, you must include a deletion comment.
21662188
21672189
#### Additional Info
21682190
@@ -2191,17 +2213,19 @@ Example 1 - Simple file creation:
21912213
Example 2 - Editing with placeholder comments:
21922214
<write_file>
21932215
<path>foo.ts</path>
2194-
<content>// no change to imports
2216+
<content>// ... existing code ...
21952217
21962218
function foo() {
21972219
console.log('foo');
21982220
for (let i = 0; i < 10; i++) {
21992221
console.log(i);
22002222
}
22012223
doSomething();
2224+
2225+
// Delete the console.log line from here
22022226
}
22032227
2204-
// rest of code</content>
2228+
// ... existing code ...</content>
22052229
</write_file>
22062230
22072231
### str_replace

0 commit comments

Comments
 (0)