Skip to content

feat: HCR060 withholds using-declaration fix when the response escapes scope - #218

Open
georgepwall1991 wants to merge 1 commit into
mainfrom
codex/iteration-21-hcr060-escape-guard
Open

georgepwall1991 wants to merge 1 commit into
mainfrom
codex/iteration-21-hcr060-escape-guard

Conversation

@georgepwall1991

Copy link
Copy Markdown
Owner

Iteration 21. Guards all three HCR060 fix paths (direct, block-merge, top-level) with VariableEscapesScope: no using-declaration fix when the response is returned or stored into a member/container. Tests: member-store offers no fix; returned response reports no diagnostic. Local gates: dotnet format clean, 953/953 tests pass. Review gate: codex CLI (attempted 2026-09-07, usage-limited until Sep 12; see PR comments for gate transcript).

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 7, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T17:05:51.187952Z b28c355 PR opened
🔒 Security Review Completed 2026-09-07T17:06:33.662303Z b28c355 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b28c355c08

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +179 to +182
AssignmentExpressionSyntax assignment when assignment.Left is not IdentifierNameSyntax =>
assignment.Right.DescendantNodesAndSelf()
.OfType<IdentifierNameSyntax>()
.Any(identifier => identifier.Identifier.ValueText == variableName),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restrict escape matching to transfers of the response itself

When code merely copies data from the response into a member, such as this.lastStatusCode = response.StatusCode, this descendant-name search treats the response as escaping and suppresses the using-declaration fix. The response object remains local and still needs disposal, so the newly added guard removes a valid fix for a common pattern; match an ownership-transferring expression rather than any occurrence of the identifier within the right-hand side.

Useful? React with 👍 / 👎.

…s scope

If the response local is returned or stored into a member/container,
disposing at block end would break callers, so no automatic fix is
offered. Guards all three fix paths (direct, block-merge, top-level).
@georgepwall1991
georgepwall1991 force-pushed the codex/iteration-21-hcr060-escape-guard branch from b28c355 to 5e2513b Compare September 7, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant