codeant-resolve-pr-comments

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Resolve 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
codeant-cli
. Never send CodeAnt telemetry.
以源代码控制提供商作为PR元数据、审查评论和线程状态的可信来源。绝不安装、更新、调用或回退使用
codeant-cli
。绝不发送CodeAnt遥测数据。

Workflow

工作流程

  1. Run the preflight checks.
  2. Select exactly one provider adapter and fetch every result page.
  3. Keep only unresolved inline CodeAnt threads.
  4. Validate and classify every finding.
  5. Present the plan and obtain approval before editing.
  6. Apply approved fixes and run relevant verification.
  7. Resolve only threads whose fixes were applied and verified.
  8. Report results and offer to commit and push.
  1. 运行预检检查。
  2. 选择恰好一个提供商适配器并获取所有结果页面。
  3. 仅保留未解决的CodeAnt内联线程。
  4. 验证并分类每个问题。
  5. 在编辑前展示计划并获取批准。
  6. 应用已批准的修复并运行相关验证。
  7. 仅解决已应用修复并通过验证的线程。
  8. 报告结果并提议提交推送。

1. Preflight

1. 预检

Inspect the repository without modifying it:
bash
git status --short
git branch --show-current
git remote -v
Preserve all pre-existing changes. Detect the provider from the remote host:
  • github.com
    or GitHub Enterprise: GitHub.
  • gitlab.com
    or self-managed GitLab: GitLab.
  • bitbucket.org
    : Bitbucket Cloud.
  • Another Bitbucket Server/Data Center host: Bitbucket Data Center.
  • dev.azure.com
    ,
    ssh.dev.azure.com
    , or
    *.visualstudio.com
    : Azure DevOps.
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.com
    或GitHub Enterprise:GitHub。
  • gitlab.com
    或自托管GitLab:GitLab。
  • bitbucket.org
    :Bitbucket Cloud。
  • 其他Bitbucket Server/Data Center主机:Bitbucket Data Center。
  • dev.azure.com
    ssh.dev.azure.com
    *.visualstudio.com
    :Azure DevOps。
如果检测结果不明确,询问用户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]
    ,
    codeant-bot
    , or
    CodeAnt AI
    .
  • Its body contains a CodeAnt action URL beginning with
    https://app.codeant.ai/fix-in-ide
    or
    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
CodeAnt
alone; require an exact service-account name or CodeAnt action URL.
Skip 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
    https://app.codeant.ai/feedback
    开头的CodeAnt操作URL。
使用内容特征进行判断,因为GitLab和Azure DevOps可能将CodeAnt评论归属到关联的人类账户。当内容特征匹配时,不需要要求作者是机器人账号,也不需要运行单独的身份发现或确认步骤。仅出现
CodeAnt
一词不足以分类为CodeAnt评论;需要精确的服务账户名称或CodeAnt操作URL。
跳过一般性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, provider
Retain 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
gh
. Determine the PR and repository:
bash
gh auth status
gh pr view <number-or-url> --json number,title,url,state,headRefName,baseRefName
gh repo view --json nameWithOwner --jq .nameWithOwner
Without a PR number, try
gh pr view
on the current branch. If necessary, list exact branch matches:
bash
gh pr list --head "<branch>" --state open \
  --json number,title,url,state,headRefName,baseRefName
Fetch and paginate review threads with GitHub GraphQL. Use
--paginate --slurp
; the pagination variable must be named
$endCursor
:
bash
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
Retry-After
when present. Do not retry authentication, authorization, schema, or validation errors.
Across every returned page, keep a thread only when:
  • isResolved
    is
    false
    .
  • The root comment matches the CodeAnt author-or-body filtering rule.
  • The root comment has a non-null
    path
    ; use
    line
    , falling back to
    originalLine
    only to locate historical context.
Carry
isOutdated
into stale validation. Resolve a successfully fixed thread with its GraphQL thread node ID, not the numeric comment ID:
bash
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
.
需要已认证的
gh
工具。确定PR和仓库:
bash
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 view
。如有必要,列出精确分支匹配项:
bash
gh pr list --head "<branch>" --state open \
  --json number,title,url,state,headRefName,baseRefName
使用GitHub GraphQL获取并分页审查线程。使用
--paginate --slurp
;分页变量必须命名为
$endCursor
bash
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
isOutdated
用于过时验证。使用GraphQL线程节点ID而非数字评论ID来解决已成功修复的线程:
bash
gh api graphql \
  -f threadId='<thread-node-id>' \
  -f query='mutation($threadId: ID!) {
    resolveReviewThread(input: {threadId: $threadId}) {
      thread { id isResolved }
    }
  }'
要求响应确认
isResolved: true

GitLab

GitLab

Require authenticated
glab
. A GitLab merge request IID is project-local; do not confuse it with a global database ID.
bash
glab auth status
glab mr view <iid-or-url> --output json
glab repo view --output json
Without an IID, find the sole open MR whose
source_branch
exactly matches the current branch:
bash
glab mr list --source-branch "<branch>" --state opened --output json
Use the numeric project ID returned by
glab repo view
to avoid path-encoding errors. Fetch all discussion pages:
bash
glab api --paginate \
  "projects/<project-id>/merge_requests/<mr-iid>/discussions?per_page=100"
Keep a discussion only when:
  • individual_note
    is
    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
    resolvable: true
    and
    resolved: false
    .
  • The note has a diff
    position
    with
    new_path
    or
    old_path
    ; prefer
    new_line
    , otherwise use
    old_line
    for context.
Carry the discussion
id
as
thread_id
and the root note
id
as
comment_id
. Resolve a successfully fixed discussion:
bash
glab api --method PUT \
  "projects/<project-id>/merge_requests/<mr-iid>/discussions/<discussion-id>" \
  -f resolved=true
Require the returned discussion to show the relevant resolvable note as resolved.
需要已认证的
glab
工具。GitLab合并请求IID是项目本地的;不要将其与全局数据库ID混淆。
bash
glab auth status
glab mr view <iid-or-url> --output json
glab repo view --output json
如果没有IID,找到唯一的开放MR,其
source_branch
与当前分支完全匹配:
bash
glab mr list --source-branch "<branch>" --state opened --output json
使用
glab repo view
返回的数字项目ID以避免路径编码错误。获取所有讨论页面:
bash
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
    作为上下文。
将讨论
id
作为
thread_id
,根评论
id
作为
comment_id
。解决已成功修复的讨论:
bash
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
<workspace>/<repo-slug>
from the remote or PR URL. Never echo the credential.
If no PR number was supplied, list open PRs and select the sole exact
source.branch.name
match. Use URL encoding for query values:
text
GET https://api.bitbucket.org/2.0/repositories/<workspace>/<repo-slug>/pullrequests
    ?state=OPEN&pagelen=100
Fetch all comment pages and follow the response's
next
URL until it is absent:
text
GET https://api.bitbucket.org/2.0/repositories/<workspace>/<repo-slug>/pullrequests/<pr-id>/comments
    ?pagelen=100
Keep a comment only when:
  • deleted
    is not
    true
    and
    pending
    is not
    true
    .
  • It is a root comment, not a reply.
  • inline.path
    is present; use
    inline.to
    for the new-file line or
    inline.from
    for the old-file line.
  • resolution
    is null or absent.
  • The comment matches the CodeAnt author-or-body filtering rule using
    user.nickname
    ,
    user.display_name
    , or
    content.raw
    .
Retain the root comment
id
. Resolve a successfully fixed thread:
text
POST https://api.bitbucket.org/2.0/repositories/<workspace>/<repo-slug>/pullrequests/<pr-id>/comments/<comment-id>/resolve
Accept: application/json
Require 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并选择唯一与
source.branch.name
精确匹配的项。对查询值使用URL编码:
text
GET https://api.bitbucket.org/2.0/repositories/<workspace>/<repo-slug>/pullrequests
    ?state=OPEN&pagelen=100
获取所有评论页面并跟随响应的
next
URL直到不存在:
text
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
    作为旧文件行号。
  • resolution
    为null或不存在。
  • 评论使用
    user.nickname
    user.display_name
    content.raw
    匹配CodeAnt作者或内容筛选规则。
保留根评论
id
。解决已成功修复的线程:
text
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
/rest/api/latest
API with existing bearer, personal-access-token, or session authentication. Parse
<base-url>
,
<project-key>
, and
<repo-slug>
from the remote or PR URL.
If no PR ID was supplied, paginate open PRs and select the sole item whose
fromRef.displayId
exactly matches the current branch:
text
GET <base-url>/rest/api/latest/projects/<project-key>/repos/<repo-slug>/pull-requests
    ?state=OPEN&limit=100&start=<offset>
Follow
nextPageStart
until
isLastPage
is true. Fetch all comment pages the same way:
text
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
author.name
,
author.slug
,
author.displayName
, or
text
, and whose
anchor.path
is present,
pending
is not true,
state
is
OPEN
, and
threadResolved
is false. Use
anchor.line
and the full anchored path.
To resolve a successfully fixed thread, first refetch the comment to obtain its current
version
, then update it with optimistic concurrency:
text
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
.
使用主机的
/rest/api/latest
API及现有bearer令牌、个人访问令牌或会话认证。从远程或PR URL解析
<base-url>
<project-key>
<repo-slug>
如果没有提供PR ID,分页开放PR并选择唯一
fromRef.displayId
与当前分支完全匹配的项:
text
GET <base-url>/rest/api/latest/projects/<project-key>/repos/<repo-slug>/pull-requests
    ?state=OPEN&limit=100&start=<offset>
跟随
nextPageStart
直到
isLastPage
为true。以相同方式获取所有评论页面:
text
GET <base-url>/rest/api/latest/projects/<project-key>/repos/<repo-slug>/pull-requests/<pr-id>/comments
    ?limit=100&start=<offset>
保留符合以下条件的根评论:使用
author.name
author.slug
author.displayName
text
匹配CodeAnt作者或内容筛选规则,且
anchor.path
存在、
pending
不为true、
state
OPEN
threadResolved
为false。使用
anchor.line
和完整锚定路径。
要解决已成功修复的线程,先重新获取评论以获取其当前
version
,然后使用乐观并发进行更新:
text
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: true

Azure 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
Authorization
header.
If 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.1
Fetch PR threads:
text
GET https://dev.azure.com/<organization>/<project>/_apis/git/repositories/<repository-id>/pullRequests/<pr-id>/threads
    ?api-version=7.1
Keep a thread only when:
  • status
    is
    active
    or
    pending
    .
  • threadContext.filePath
    is present; use
    rightFileStart.line
    , otherwise
    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
    ,
    author.displayName
    , or
    content
    . Azure DevOps may show the connected human user as the author.
Carry the numeric thread
id
and root comment
id
. Resolve a successfully fixed thread by marking it fixed:
text
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
api-version=7.1
and require the returned thread to show
status: fixed
. Do not use
closed
,
wontFix
, or
byDesign
for an applied fix.
使用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
    content
    匹配CodeAnt作者或内容筛选规则。Azure DevOps可能显示关联的人类用户作为作者。
保存数字线程
id
和根评论
id
。通过标记为已修复来解决已成功修复的线程:
text
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.1
并要求返回的线程显示
status: fixed
。对于已应用的修复,不要使用
closed
wontFix
byDesign
状态。

3. Validate every finding

3. 验证每个问题

Group findings by file. For each finding:
  1. Read the complete comment and at least 30 lines above and below the referenced line.
  2. Inspect definitions, callers, tests, and repository guidance needed to understand the claimed behavior.
  3. Identify the defect, expected behavior, reproduction path, and any fenced suggestion.
  4. If the provider marks the position outdated, the file is gone, or current code no longer matches the claim, assign
    STALE
    unless the same defect clearly remains at the referenced code.
  5. Treat Architect Review and Logical Review comments as actionable. Read the complete
    Prompt for AI Agent
    section and draft a localized fix when no suggestion is supplied.
  6. Validate syntax, scope, imports, types, error handling, public interfaces, edge cases, concurrency, and compatibility with callers.
  7. Prefer the smallest correct fix. Do not refactor adjacent code for style.
Assign exactly one verdict:
  • ACCEPT
    : The defect is real and the localized fix is safe without changing a public contract or weakening handling.
  • LIKELY ACCEPT
    : The fix is sound, but a behavior change may affect callers or requires targeted validation.
  • DO NOT ACCEPT
    : The proposal is unsafe, unjustified, depends on unavailable APIs, or requires broader design work than a focused patch can safely provide.
  • STALE
    : The referenced code or defect is no longer present.
Do not reject an Architect or Logical Review solely because it lacks a ready-made patch.
按文件分组问题。对于每个问题:
  1. 阅读完整评论及引用行上下至少30行代码。
  2. 检查理解声称行为所需的定义、调用者、测试和仓库指南。
  3. 识别缺陷、预期行为、复现路径和任何 fenced 建议。
  4. 如果提供商标记位置已过时、文件已删除或当前代码不再匹配声称内容,除非相同缺陷仍明显存在于引用代码处,否则标记为
    STALE
  5. 将架构审查和逻辑审查评论视为可操作项。当没有提供建议时,阅读完整的
    Prompt for AI Agent
    部分并起草本地化修复方案。
  6. 验证语法、范围、导入、类型、错误处理、公共接口、边缘情况、并发以及与调用者的兼容性。
  7. 优先选择最小化的正确修复。不要为了风格重构相邻代码。
分配恰好一个结论:
  • ACCEPT
    :缺陷真实存在,本地化修复安全且不会更改公共契约或削弱处理逻辑。
  • LIKELY ACCEPT
    :修复合理,但行为变更可能影响调用者或需要针对性验证。
  • DO NOT ACCEPT
    :提案不安全、无正当理由、依赖不可用API,或需要超出聚焦补丁范围的更广泛设计工作。
  • 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
    LIKELY ACCEPT
    , the exact callers, tests, or behavior needing verification.
State that
ACCEPT
fixes are ready and ask whether to include named
LIKELY ACCEPT
fixes. Do not edit before approval. Never apply
DO NOT ACCEPT
or
STALE
findings.
报告提供商、PR编号、标题、链接以及未解决的CodeAnt内联线程数量。按结论对每个问题进行分组。对于每个问题,包含:
  • 文件和行号。
  • 一行问题摘要。
  • 验证理由。
  • 适用时的预期变更前后对比。
  • 对于
    LIKELY ACCEPT
    ,需要验证的具体调用者、测试或行为。
说明
ACCEPT
级别的修复已准备就绪,并询问是否包含指定的
LIKELY ACCEPT
级修复。未经批准不得编辑。绝不应用
DO NOT ACCEPT
STALE
级别的问题。

5. Apply and verify

5. 应用并验证

After approval:
  1. Recheck
    git status --short
    and preserve pre-existing edits.
  2. Apply only confirmed fixes to files referenced by comments, except narrowly required tests or imports.
  3. Review the diff for accidental changes and interactions between fixes.
  4. Run the narrowest relevant formatter, static checks, and tests; expand when shared behavior changed.
  5. 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.
获得批准后:
  1. 重新检查
    git status --short
    并保留已存在的编辑内容。
  2. 仅对评论引用的文件应用已确认的修复,除了严格必要的测试或导入。
  3. 检查差异以避免意外变更和修复之间的相互影响。
  4. 运行最相关的格式化工具、静态检查和测试;当共享行为变更时扩大范围。
  5. 仅修复由这些编辑导致的失败。如果某个修复无法验证,在可安全分离的情况下仅回滚该修复,保留其线程未解决并报告。

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
DO NOT ACCEPT
,
STALE
, skipped, partially fixed, or unverified findings. Refetch thread state after resolution when the provider response is ambiguous.
Final 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
    git status --short
    and files changed by this workflow.
Offer to commit and push selected files. Do not commit or push without explicit approval.
解决线程是外部变更操作。仅在用户批准对应修复且本地验证通过后,按顺序解决线程。单个解决失败后继续执行后续操作。
绝不解决
DO NOT ACCEPT
STALE
、跳过、部分修复或未验证的问题。当提供商响应不明确时,解决后重新获取线程状态。
最终报告:
  • 已应用并通过验证的修复,包含文件、行号、结论和测试结果。
  • 未应用的问题,包含结论和原因。
  • 已解决的提供商线程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
    codeant-cli
    for any step.
  • 在声称列表完整前获取所有分页页面。
  • 将提供商原生线程状态视为权威。
  • 单独验证建议;绝不盲目批量应用。
  • 保留无关的用户变更并避免触及无关文件。
  • 标记冲突评论而非静默选择。
  • 绝不泄露访问令牌、PAT、Cookie或详细的认证输出。
  • 绝不安装、调用或依赖
    codeant-cli
    执行任何步骤。