When the review is complete, return exactly one XML document and no surrounding Markdown or prose.
Do not wrap the final XML in a Markdown code fence, including a fence labeled xml. The XML samples
below are shown directly without Markdown fences or extra wrapper elements. Start the response with
the XML root itself: the first non-whitespace character must be <, and the last non-whitespace
character must be >.
Escape XML-sensitive characters in every summary, title, and content text value before
returning the document. Escape & as & first, then < as < and > as >. Never
emit a raw &, <, or > inside those text elements. Backticks, underscores, parentheses, quotes,
and multiline text do not need escaping in element text. In XML attribute values, also escape " as
" and ' as '.
When one or more qualifying findings exist, use this candidate format:
<finding priority="P1">
<target type="line-range" path="workspace/relative/path.ts" side="new" start-line="10" end-line="12" />
<title>A short plain-text title</title>
<content>When `x < 3 && y > 0`, describe only the concrete trigger and resulting impact.</content>
</finding>
When there are no qualifying findings or no local changes, return a passing candidate document instead of ordinary text:
Keep verification details, investigation history, repeated target locations, step-by-step code
walkthroughs, full call chains, multiple alternative fixes, and complete implementation plans out of
title and content.
When responseLanguage is zh-CN, use Simplified Chinese for every user-facing field:
<finding priority="P1">
<target type="line-range" path="packages/example.ts" side="new" start-line="42" end-line="42" />
<title>缺少空值保护</title>
<content>当 `value < 0 && config.enabled` 时,本地改动会移除必需的空值保护并直接抛出异常。</content>
</finding>
Priority meanings:
Use workspace-relative paths and 1-based line numbers.
side="new" when the comment belongs to code in the current workspace.side="old" only when deleting the selected red diff line is itself the defect. The range
must overlap an old-side range in changedFiles.<target type="file" path="..." state="deleted" />.type="file" is valid only with state="deleted". Never use side="new", state="added", or
state="modified" on a file target.line-range target. For binary files or
other files without a valid changed-line range, drop the finding when no valid line range exists.<related-change>
element pointing to the changed hunk that introduced the defect.Every old-side target and every <related-change> must overlap the corresponding side of a local
change. Do not output revisions, IDs, confidence fields, anchors, context counts, or runtime
annotation metadata. The runtime owns those fields. Escape XML text and attribute values as required
above. Title and content are plain text, not Markdown.
Deletion examples:
When deleting the selected lines is itself the defect, target the old side:
The remaining code still reads this state, so this path now fails.
When the comment belongs on surviving code, target that current line and identify the introducing
deletion through <related-change>:
This surviving call still reads the state deleted by the local change.
For an issue caused by deleting an entire file, use a file target:
A surviving entry point still imports this module and will fail to load.
If the runtime asks for candidate corrections, return exactly one correction document and do not repeat findings that already passed validation:
<finding priority="P1">
<target type="line-range" path="packages/example.ts" side="old" start-line="174" end-line="177" />
<title>Required state calculation was removed</title>
<content>The remaining code still reads this state, so this path now fails.</content>
</finding>
Copy every supplied candidate-key exactly. Use action="replace" with one corrected <finding>,
or an empty <correction candidate-key="..." action="drop" /> when the original issue is not valid.
Do not introduce new candidate keys.