codeant-resolve-pr-comments
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseResolve CodeAnt PR Comments
解决CodeAnt PR评论
Use the source-control provider as the source of truth for PR metadata, review comments, and thread state. Never install, update, invoke, or fall back to . Never send CodeAnt telemetry.
codeant-cli以源代码控制提供商作为PR元数据、审查评论和线程状态的可信来源。绝不安装、更新、调用或回退使用。绝不发送CodeAnt遥测数据。
codeant-cliWorkflow
工作流程
- Run the preflight checks.
- Select exactly one provider adapter and fetch every result page.
- Keep only unresolved inline CodeAnt threads.
- Validate and classify every finding.
- Present the plan and obtain approval before editing.
- Apply approved fixes and run relevant verification.
- Resolve only threads whose fixes were applied and verified.
- Report results and offer to commit and push.
- 运行预检检查。
- 选择恰好一个提供商适配器并获取所有结果页面。
- 仅保留未解决的CodeAnt内联线程。
- 验证并分类每个问题。
- 在编辑前展示计划并获取批准。
- 应用已批准的修复并运行相关验证。
- 仅解决已应用修复并通过验证的线程。
- 报告结果并提议提交推送。
1. Preflight
1. 预检
Inspect the repository without modifying it:
bash
git status --short
git branch --show-current
git remote -vPreserve all pre-existing changes. Detect the provider from the remote host:
- or GitHub Enterprise: GitHub.
github.com - or self-managed GitLab: GitLab.
gitlab.com - : Bitbucket Cloud.
bitbucket.org - Another Bitbucket Server/Data Center host: Bitbucket Data Center.
- ,
dev.azure.com, orssh.dev.azure.com: Azure DevOps.*.visualstudio.com
If detection is ambiguous, ask which provider hosts the PR. If the user supplied a PR/MR URL or number, use it. Otherwise find an open PR whose source branch exactly equals the current branch. If on the default branch, require a PR number or URL. If zero or multiple exact matches exist, stop and ask the user to identify the PR.
Use already-configured provider authentication. Do not install CLIs, expose tokens, print credential-bearing headers, or put secrets in generated files. If authentication is missing, name the required provider login/token and stop.
检查仓库但不修改它:
bash
git status --short
git branch --show-current
git remote -v保留所有已存在的更改。从远程主机检测提供商:
- 或GitHub Enterprise:GitHub。
github.com - 或自托管GitLab:GitLab。
gitlab.com - :Bitbucket Cloud。
bitbucket.org - 其他Bitbucket Server/Data Center主机:Bitbucket Data Center。
- 、
dev.azure.com或ssh.dev.azure.com:Azure DevOps。*.visualstudio.com
如果检测结果不明确,询问用户PR托管在哪个提供商。如果用户提供了PR/MR URL或编号,直接使用。否则查找一个源分支与当前分支完全匹配的开放PR。如果当前是默认分支,需要提供PR编号或URL。如果没有匹配项或存在多个匹配项,停止操作并请用户指定PR。
使用已配置的提供商认证信息。不要安装CLI工具、暴露令牌、打印含凭证的头部信息,也不要将机密信息放入生成的文件中。如果缺少认证信息,说明所需的提供商登录/令牌并停止操作。
Filter CodeAnt suggestions
筛选CodeAnt建议
After fetching the PR's review comments, retain only unresolved inline suggestions generated by CodeAnt. Treat an inline comment as CodeAnt-generated when either condition is true:
- Its author login, username, nickname, or display name case-insensitively equals ,
codeant-ai,codeant-ai[bot], orcodeant-bot.CodeAnt AI - Its body contains a CodeAnt action URL beginning with or
https://app.codeant.ai/fix-in-ide.https://app.codeant.ai/feedback
Use the body signature because GitLab and Azure DevOps can attribute CodeAnt comments to the connected human account. Do not require a bot author when the body signature matches, and do not run a separate identity-discovery or confirmation step. Do not classify a comment from the word alone; require an exact service-account name or CodeAnt action URL.
CodeAntSkip general PR comments, summaries, quality-gate reports, system messages, deleted comments, drafts, and replies that do not begin an inline finding. If no matching suggestions remain, report that the PR has no unresolved CodeAnt inline suggestions and stop. Otherwise continue directly to validation.
获取PR的审查评论后,仅保留由CodeAnt生成的未解决内联建议。当满足以下任一条件时,将内联评论视为CodeAnt生成:
- 其作者登录名、用户名、昵称或显示名不区分大小写等于、
codeant-ai、codeant-ai[bot]或codeant-bot。CodeAnt AI - 评论内容包含以或
https://app.codeant.ai/fix-in-ide开头的CodeAnt操作URL。https://app.codeant.ai/feedback
使用内容特征进行判断,因为GitLab和Azure DevOps可能将CodeAnt评论归属到关联的人类账户。当内容特征匹配时,不需要要求作者是机器人账号,也不需要运行单独的身份发现或确认步骤。仅出现一词不足以分类为CodeAnt评论;需要精确的服务账户名称或CodeAnt操作URL。
CodeAnt跳过一般性PR评论、摘要、质量门报告、系统消息、已删除评论、草稿以及并非内联问题起始的回复。如果没有匹配的建议,报告PR中没有未解决的CodeAnt内联建议并停止操作。否则直接进入验证步骤。
2. Provider adapters
2. 提供商适配器
Choose only the matching adapter. Normalize each actionable item to:
text
thread_id, comment_id, author_id, body, path, line, url,
resolved, outdated_or_stale, providerRetain provider-native IDs exactly because they are required for resolution.
仅选择匹配的适配器。将每个可操作项标准化为:
text
thread_id, comment_id, author_id, body, path, line, url,
resolved, outdated_or_stale, provider精确保留提供商原生ID,因为它们是解决线程所必需的。
GitHub
GitHub
Require authenticated . Determine the PR and repository:
ghbash
gh auth status
gh pr view <number-or-url> --json number,title,url,state,headRefName,baseRefName
gh repo view --json nameWithOwner --jq .nameWithOwnerWithout a PR number, try on the current branch. If necessary, list exact branch matches:
gh pr viewbash
gh pr list --head "<branch>" --state open \
--json number,title,url,state,headRefName,baseRefNameFetch and paginate review threads with GitHub GraphQL. Use ; the pagination variable must be named :
--paginate --slurp$endCursorbash
gh api graphql --paginate --slurp \
-f owner='<owner>' \
-f name='<repository>' \
-F number=<pr-number> \
-f query='query($owner: String!, $name: String!, $number: Int!, $endCursor: String) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
number title url
reviewThreads(first: 100, after: $endCursor) {
nodes {
id isResolved isOutdated
comments(first: 100) {
nodes {
databaseId
author { login }
body path line originalLine createdAt url
}
}
}
pageInfo { hasNextPage endCursor }
}
}
}
}'Retry this read-only fetch up to three times for transient HTTP 429, 502, 503, or 504 responses, honoring when present. Do not retry authentication, authorization, schema, or validation errors.
Retry-AfterAcross every returned page, keep a thread only when:
- is
isResolved.false - The root comment matches the CodeAnt author-or-body filtering rule.
- The root comment has a non-null ; use
path, falling back tolineonly to locate historical context.originalLine
Carry into stale validation. Resolve a successfully fixed thread with its GraphQL thread node ID, not the numeric comment ID:
isOutdatedbash
gh api graphql \
-f threadId='<thread-node-id>' \
-f query='mutation($threadId: ID!) {
resolveReviewThread(input: {threadId: $threadId}) {
thread { id isResolved }
}
}'Require the response to confirm .
isResolved: true需要已认证的工具。确定PR和仓库:
ghbash
gh auth status
gh pr view <number-or-url> --json number,title,url,state,headRefName,baseRefName
gh repo view --json nameWithOwner --jq .nameWithOwner如果没有PR编号,尝试对当前分支执行。如有必要,列出精确分支匹配项:
gh pr viewbash
gh pr list --head "<branch>" --state open \
--json number,title,url,state,headRefName,baseRefName使用GitHub GraphQL获取并分页审查线程。使用;分页变量必须命名为:
--paginate --slurp$endCursorbash
gh api graphql --paginate --slurp \
-f owner='<owner>' \
-f name='<repository>' \
-F number=<pr-number> \
-f query='query($owner: String!, $name: String!, $number: Int!, $endCursor: String) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
number title url
reviewThreads(first: 100, after: $endCursor) {
nodes {
id isResolved isOutdated
comments(first: 100) {
nodes {
databaseId
author { login }
body path line originalLine createdAt url
}
}
}
pageInfo { hasNextPage endCursor }
}
}
}
}'对于临时HTTP 429、502、503或504响应,最多重试此只读请求三次,当存在头部时遵守该指示。不要重试认证、授权、架构或验证错误。
Retry-After在所有返回的页面中,仅保留满足以下条件的线程:
- 为
isResolved。false - 根评论符合CodeAnt作者或内容筛选规则。
- 根评论的不为空;使用
path,仅在需要定位历史上下文时回退使用line。originalLine
将用于过时验证。使用GraphQL线程节点ID而非数字评论ID来解决已成功修复的线程:
isOutdatedbash
gh api graphql \
-f threadId='<thread-node-id>' \
-f query='mutation($threadId: ID!) {
resolveReviewThread(input: {threadId: $threadId}) {
thread { id isResolved }
}
}'要求响应确认。
isResolved: trueGitLab
GitLab
Require authenticated . A GitLab merge request IID is project-local; do not confuse it with a global database ID.
glabbash
glab auth status
glab mr view <iid-or-url> --output json
glab repo view --output jsonWithout an IID, find the sole open MR whose exactly matches the current branch:
source_branchbash
glab mr list --source-branch "<branch>" --state opened --output jsonUse the numeric project ID returned by to avoid path-encoding errors. Fetch all discussion pages:
glab repo viewbash
glab api --paginate \
"projects/<project-id>/merge_requests/<mr-iid>/discussions?per_page=100"Keep a discussion only when:
- is
individual_note.false - Its root note matches the CodeAnt author-or-body filtering rule. GitLab may show the connected human user as the author, so accept a matching CodeAnt action URL in .
body - The CodeAnt root note is and
resolvable: true.resolved: false - The note has a diff with
positionornew_path; preferold_path, otherwise usenew_linefor context.old_line
Carry the discussion as and the root note as . Resolve a successfully fixed discussion:
idthread_ididcomment_idbash
glab api --method PUT \
"projects/<project-id>/merge_requests/<mr-iid>/discussions/<discussion-id>" \
-f resolved=trueRequire the returned discussion to show the relevant resolvable note as resolved.
需要已认证的工具。GitLab合并请求IID是项目本地的;不要将其与全局数据库ID混淆。
glabbash
glab auth status
glab mr view <iid-or-url> --output json
glab repo view --output json如果没有IID,找到唯一的开放MR,其与当前分支完全匹配:
source_branchbash
glab mr list --source-branch "<branch>" --state opened --output json使用返回的数字项目ID以避免路径编码错误。获取所有讨论页面:
glab repo viewbash
glab api --paginate \
"projects/<project-id>/merge_requests/<mr-iid>/discussions?per_page=100"仅保留满足以下条件的讨论:
- 为
individual_note。false - 其根评论符合CodeAnt作者或内容筛选规则。GitLab可能显示关联的人类用户作为作者,因此接受内容中匹配的CodeAnt操作URL。
- CodeAnt根评论的且
resolvable: true。resolved: false - 评论包含带或
new_path的差异old_path;优先使用position,否则使用new_line作为上下文。old_line
将讨论作为,根评论作为。解决已成功修复的讨论:
idthread_ididcomment_idbash
glab api --method PUT \
"projects/<project-id>/merge_requests/<mr-iid>/discussions/<discussion-id>" \
-f resolved=true要求返回的讨论显示相关可解决的评论已被标记为已解决。
Bitbucket Cloud
Bitbucket Cloud
Use the Bitbucket Cloud REST API 2.0 with existing OAuth, access-token, or API-token authentication. Parse from the remote or PR URL. Never echo the credential.
<workspace>/<repo-slug>If no PR number was supplied, list open PRs and select the sole exact match. Use URL encoding for query values:
source.branch.nametext
GET https://api.bitbucket.org/2.0/repositories/<workspace>/<repo-slug>/pullrequests
?state=OPEN&pagelen=100Fetch all comment pages and follow the response's URL until it is absent:
nexttext
GET https://api.bitbucket.org/2.0/repositories/<workspace>/<repo-slug>/pullrequests/<pr-id>/comments
?pagelen=100Keep a comment only when:
- is not
deletedandtrueis notpending.true - It is a root comment, not a reply.
- is present; use
inline.pathfor the new-file line orinline.tofor the old-file line.inline.from - is null or absent.
resolution - The comment matches the CodeAnt author-or-body filtering rule using ,
user.nickname, oruser.display_name.content.raw
Retain the root comment . Resolve a successfully fixed thread:
idtext
POST https://api.bitbucket.org/2.0/repositories/<workspace>/<repo-slug>/pullrequests/<pr-id>/comments/<comment-id>/resolve
Accept: application/jsonRequire HTTP 200 and a returned resolution object. Never delete the comment as a substitute for resolving it.
使用Bitbucket Cloud REST API 2.0及现有OAuth、访问令牌或API令牌认证。从远程或PR URL解析。绝不回显凭证信息。
<workspace>/<repo-slug>如果没有提供PR编号,列出开放PR并选择唯一与精确匹配的项。对查询值使用URL编码:
source.branch.nametext
GET https://api.bitbucket.org/2.0/repositories/<workspace>/<repo-slug>/pullrequests
?state=OPEN&pagelen=100获取所有评论页面并跟随响应的 URL直到不存在:
nexttext
GET https://api.bitbucket.org/2.0/repositories/<workspace>/<repo-slug>/pullrequests/<pr-id>/comments
?pagelen=100仅保留满足以下条件的评论:
- 不为
deleted且true不为pending。true - 它是根评论,而非回复。
- 存在;使用
inline.path作为新文件行号或inline.to作为旧文件行号。inline.from - 为null或不存在。
resolution - 评论使用、
user.nickname或user.display_name匹配CodeAnt作者或内容筛选规则。content.raw
保留根评论。解决已成功修复的线程:
idtext
POST https://api.bitbucket.org/2.0/repositories/<workspace>/<repo-slug>/pullrequests/<pr-id>/comments/<comment-id>/resolve
Accept: application/json要求HTTP 200响应并返回解析对象。绝不删除评论作为解决的替代方式。
Bitbucket Data Center
Bitbucket Data Center
Use the host's API with existing bearer, personal-access-token, or session authentication. Parse , , and from the remote or PR URL.
/rest/api/latest<base-url><project-key><repo-slug>If no PR ID was supplied, paginate open PRs and select the sole item whose exactly matches the current branch:
fromRef.displayIdtext
GET <base-url>/rest/api/latest/projects/<project-key>/repos/<repo-slug>/pull-requests
?state=OPEN&limit=100&start=<offset>Follow until is true. Fetch all comment pages the same way:
nextPageStartisLastPagetext
GET <base-url>/rest/api/latest/projects/<project-key>/repos/<repo-slug>/pull-requests/<pr-id>/comments
?limit=100&start=<offset>Keep root comments that match the CodeAnt author-or-body filtering rule using , , , or , and whose is present, is not true, is , and is false. Use and the full anchored path.
author.nameauthor.slugauthor.displayNametextanchor.pathpendingstateOPENthreadResolvedanchor.lineTo resolve a successfully fixed thread, first refetch the comment to obtain its current , then update it with optimistic concurrency:
versiontext
PUT <base-url>/rest/api/latest/projects/<project-key>/repos/<repo-slug>/pull-requests/<pr-id>/comments/<comment-id>
Content-Type: application/json
{
"id": <comment-id>,
"version": <current-version>,
"text": <unchanged-current-text>,
"state": "OPEN",
"severity": <unchanged-current-severity>,
"threadResolved": true
}Preserve the current text, state, severity, and required properties. On HTTP 409, refetch and retry only if the thread is still the same unresolved comment. Require the response to show .
threadResolved: true使用主机的 API及现有bearer令牌、个人访问令牌或会话认证。从远程或PR URL解析、和。
/rest/api/latest<base-url><project-key><repo-slug>如果没有提供PR ID,分页开放PR并选择唯一与当前分支完全匹配的项:
fromRef.displayIdtext
GET <base-url>/rest/api/latest/projects/<project-key>/repos/<repo-slug>/pull-requests
?state=OPEN&limit=100&start=<offset>跟随直到为true。以相同方式获取所有评论页面:
nextPageStartisLastPagetext
GET <base-url>/rest/api/latest/projects/<project-key>/repos/<repo-slug>/pull-requests/<pr-id>/comments
?limit=100&start=<offset>保留符合以下条件的根评论:使用、、或匹配CodeAnt作者或内容筛选规则,且存在、不为true、为、为false。使用和完整锚定路径。
author.nameauthor.slugauthor.displayNametextanchor.pathpendingstateOPENthreadResolvedanchor.line要解决已成功修复的线程,先重新获取评论以获取其当前,然后使用乐观并发进行更新:
versiontext
PUT <base-url>/rest/api/latest/projects/<project-key>/repos/<repo-slug>/pull-requests/<pr-id>/comments/<comment-id>
Content-Type: application/json
{
"id": <comment-id>,
"version": <current-version>,
"text": <unchanged-current-text>,
"state": "OPEN",
"severity": <unchanged-current-severity>,
"threadResolved": true
}保留当前文本、状态、严重性和必填属性。如果收到HTTP 409响应,仅当线程仍是相同的未解决评论时重新获取并重试。要求响应显示。
threadResolved: trueAzure DevOps (ADO)
Azure DevOps (ADO)
Use Azure DevOps REST API 7.1 with existing OAuth or PAT authentication. Parse the organization, project, and repository from the remote or PR URL. Prefer immutable repository and identity IDs. Do not log the header.
AuthorizationIf no PR ID was supplied, URL-encode the full source ref and select the sole active exact match:
text
GET https://dev.azure.com/<organization>/<project>/_apis/git/repositories/<repository-id>/pullrequests
?searchCriteria.status=active
&searchCriteria.sourceRefName=refs/heads/<branch>
&$top=100
&api-version=7.1Fetch PR threads:
text
GET https://dev.azure.com/<organization>/<project>/_apis/git/repositories/<repository-id>/pullRequests/<pr-id>/threads
?api-version=7.1Keep a thread only when:
- is
statusoractive.pending - is present; use
threadContext.filePath, otherwiserightFileStart.line.leftFileStart.line - Its root non-system, non-deleted comment has .
commentType: text - The root comment matches the CodeAnt author-or-body filtering rule using ,
author.uniqueName, orauthor.displayName. Azure DevOps may show the connected human user as the author.content
Carry the numeric thread and root comment . Resolve a successfully fixed thread by marking it fixed:
ididtext
PATCH https://dev.azure.com/<organization>/<project>/_apis/git/repositories/<repository-id>/pullRequests/<pr-id>/threads/<thread-id>
Content-Type: application/json
{"status":"fixed"}Use and require the returned thread to show . Do not use , , or for an applied fix.
api-version=7.1status: fixedclosedwontFixbyDesign使用Azure DevOps REST API 7.1及现有OAuth或PAT认证。从远程或PR URL解析组织、项目和仓库。优先使用不可变的仓库和身份ID。不要记录头部。
Authorization如果没有提供PR ID,对完整源引用进行URL编码并选择唯一的精确匹配项:
text
GET https://dev.azure.com/<organization>/<project>/_apis/git/repositories/<repository-id>/pullrequests
?searchCriteria.status=active
&searchCriteria.sourceRefName=refs/heads/<branch>
&$top=100
&api-version=7.1获取PR线程:
text
GET https://dev.azure.com/<organization>/<project>/_apis/git/repositories/<repository-id>/pullRequests/<pr-id>/threads
?api-version=7.1仅保留满足以下条件的线程:
- 为
status或active。pending - 存在;使用
threadContext.filePath,否则使用rightFileStart.line。leftFileStart.line - 其根评论为非系统、非删除评论且。
commentType: text - 根评论使用、
author.uniqueName或author.displayName匹配CodeAnt作者或内容筛选规则。Azure DevOps可能显示关联的人类用户作为作者。content
保存数字线程和根评论。通过标记为已修复来解决已成功修复的线程:
ididtext
PATCH https://dev.azure.com/<organization>/<project>/_apis/git/repositories/<repository-id>/pullRequests/<pr-id>/threads/<thread-id>
Content-Type: application/json
{"status":"fixed"}使用并要求返回的线程显示。对于已应用的修复,不要使用、或状态。
api-version=7.1status: fixedclosedwontFixbyDesign3. Validate every finding
3. 验证每个问题
Group findings by file. For each finding:
- Read the complete comment and at least 30 lines above and below the referenced line.
- Inspect definitions, callers, tests, and repository guidance needed to understand the claimed behavior.
- Identify the defect, expected behavior, reproduction path, and any fenced suggestion.
- If the provider marks the position outdated, the file is gone, or current code no longer matches the claim, assign unless the same defect clearly remains at the referenced code.
STALE - Treat Architect Review and Logical Review comments as actionable. Read the complete section and draft a localized fix when no suggestion is supplied.
Prompt for AI Agent - Validate syntax, scope, imports, types, error handling, public interfaces, edge cases, concurrency, and compatibility with callers.
- Prefer the smallest correct fix. Do not refactor adjacent code for style.
Assign exactly one verdict:
- : The defect is real and the localized fix is safe without changing a public contract or weakening handling.
ACCEPT - : The fix is sound, but a behavior change may affect callers or requires targeted validation.
LIKELY ACCEPT - : The proposal is unsafe, unjustified, depends on unavailable APIs, or requires broader design work than a focused patch can safely provide.
DO NOT ACCEPT - : The referenced code or defect is no longer present.
STALE
Do not reject an Architect or Logical Review solely because it lacks a ready-made patch.
按文件分组问题。对于每个问题:
- 阅读完整评论及引用行上下至少30行代码。
- 检查理解声称行为所需的定义、调用者、测试和仓库指南。
- 识别缺陷、预期行为、复现路径和任何 fenced 建议。
- 如果提供商标记位置已过时、文件已删除或当前代码不再匹配声称内容,除非相同缺陷仍明显存在于引用代码处,否则标记为。
STALE - 将架构审查和逻辑审查评论视为可操作项。当没有提供建议时,阅读完整的部分并起草本地化修复方案。
Prompt for AI Agent - 验证语法、范围、导入、类型、错误处理、公共接口、边缘情况、并发以及与调用者的兼容性。
- 优先选择最小化的正确修复。不要为了风格重构相邻代码。
分配恰好一个结论:
- :缺陷真实存在,本地化修复安全且不会更改公共契约或削弱处理逻辑。
ACCEPT - :修复合理,但行为变更可能影响调用者或需要针对性验证。
LIKELY ACCEPT - :提案不安全、无正当理由、依赖不可用API,或需要超出聚焦补丁范围的更广泛设计工作。
DO NOT ACCEPT - :引用的代码或缺陷已不存在。
STALE
不要仅因为缺少现成补丁就拒绝架构或逻辑审查建议。
4. Present the plan before editing
4. 编辑前展示计划
Report the provider, PR number, title, link, and unresolved CodeAnt inline-thread count. Group every finding by verdict. For each, include:
- File and line.
- One-line issue summary.
- Validation rationale.
- Intended before/after change when applicable.
- For , the exact callers, tests, or behavior needing verification.
LIKELY ACCEPT
State that fixes are ready and ask whether to include named fixes. Do not edit before approval. Never apply or findings.
ACCEPTLIKELY ACCEPTDO NOT ACCEPTSTALE报告提供商、PR编号、标题、链接以及未解决的CodeAnt内联线程数量。按结论对每个问题进行分组。对于每个问题,包含:
- 文件和行号。
- 一行问题摘要。
- 验证理由。
- 适用时的预期变更前后对比。
- 对于,需要验证的具体调用者、测试或行为。
LIKELY ACCEPT
说明级别的修复已准备就绪,并询问是否包含指定的级修复。未经批准不得编辑。绝不应用或级别的问题。
ACCEPTLIKELY ACCEPTDO NOT ACCEPTSTALE5. Apply and verify
5. 应用并验证
After approval:
- Recheck and preserve pre-existing edits.
git status --short - Apply only confirmed fixes to files referenced by comments, except narrowly required tests or imports.
- Review the diff for accidental changes and interactions between fixes.
- Run the narrowest relevant formatter, static checks, and tests; expand when shared behavior changed.
- Repair only failures caused by these edits. If a fix cannot be verified, revert only that fix if safely separable, leave its thread unresolved, and report it.
获得批准后:
- 重新检查并保留已存在的编辑内容。
git status --short - 仅对评论引用的文件应用已确认的修复,除了严格必要的测试或导入。
- 检查差异以避免意外变更和修复之间的相互影响。
- 运行最相关的格式化工具、静态检查和测试;当共享行为变更时扩大范围。
- 仅修复由这些编辑导致的失败。如果某个修复无法验证,在可安全分离的情况下仅回滚该修复,保留其线程未解决并报告。
6. Resolve and report
6. 解决并报告
Resolving a thread is an external mutation. Resolve threads sequentially only after the user approved the corresponding fix and local verification passed. Continue after individual resolution failures.
Never resolve , , skipped, partially fixed, or unverified findings. Refetch thread state after resolution when the provider response is ambiguous.
DO NOT ACCEPTSTALEFinal report:
- Applied and verified fixes with file, line, verdict, and test result.
- Unapplied findings with verdict and reason.
- Provider thread IDs resolved and any resolution failures.
- Final and files changed by this workflow.
git status --short
Offer to commit and push selected files. Do not commit or push without explicit approval.
解决线程是外部变更操作。仅在用户批准对应修复且本地验证通过后,按顺序解决线程。单个解决失败后继续执行后续操作。
绝不解决、、跳过、部分修复或未验证的问题。当提供商响应不明确时,解决后重新获取线程状态。
DO NOT ACCEPTSTALE最终报告:
- 已应用并通过验证的修复,包含文件、行号、结论和测试结果。
- 未应用的问题,包含结论和原因。
- 已解决的提供商线程ID及任何解决失败情况。
- 最终的和此工作流程更改的文件。
git status --short
提议提交推送选定的文件。未经明确批准不得提交或推送。
Guardrails
防护规则
- Fetch every pagination page before claiming the list is complete.
- Treat provider-native thread state as authoritative.
- Validate suggestions individually; never batch-apply blindly.
- Preserve unrelated user changes and avoid unrelated files.
- Flag conflicting comments rather than choosing silently.
- Never disclose access tokens, PATs, cookies, or verbose auth output.
- Never install, invoke, or rely on for any step.
codeant-cli
- 在声称列表完整前获取所有分页页面。
- 将提供商原生线程状态视为权威。
- 单独验证建议;绝不盲目批量应用。
- 保留无关的用户变更并避免触及无关文件。
- 标记冲突评论而非静默选择。
- 绝不泄露访问令牌、PAT、Cookie或详细的认证输出。
- 绝不安装、调用或依赖执行任何步骤。
codeant-cli