Skip to content

fix: recognise applied AutoInclude in LC045#303

Open
georgepwall1991 wants to merge 13 commits into
masterfrom
fix/lc045-applied-autoinclude
Open

fix: recognise applied AutoInclude in LC045#303
georgepwall1991 wants to merge 13 commits into
masterfrom
fix/lc045-applied-autoinclude

Conversation

@georgepwall1991

@georgepwall1991 georgepwall1991 commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • recognise exact, unconditional parameterless ApplyConfiguration(new TConfiguration()) AutoInclude evidence for LC045
  • preserve context/entity/navigation scoping and invalidate proof for conditional/runtime settings, later disablement, unknown helpers, nested executable mutations, builder escapes, constructors, accessors, async Configure, and user-defined conversions anywhere in Configure
  • support lambda and constant-string Navigation paths while preserving final fluent AutoInclude ordering
  • document the supported configuration-class contract and deliberate conservative limits

TDD evidence

  • red: source-visible applied AutoInclude reported LC045 incorrectly
  • red: reverse fluent ordering, conditional disablement, source-defined helper lookalikes, string Navigation, nested helper ordering, captured aliases, field/property escapes, constructor/accessor consumers, suspended Configure, direct/nested/control-flow conversions, and constructor-fed configurations exposed stale or missing proof
  • green: exact symbol/type/assembly allowlists plus conservative whole-operation execution and escape boundaries cover every reproduced regression
  • controls preserve unrelated helpers and constructors

Verification

  • dotnet test tests/LinqContraband.Tests/LinqContraband.Tests.csproj --framework net10.0 --no-restore — 2,293/2,293
  • AnalyzerPerformanceTests — 7/7
  • Release solution build — 0 warnings, 0 errors
  • sample diagnostics verifier — 44 paths across net8.0, net9.0, and net10.0
  • changed-file whitespace format check — clean
  • GitHub Build and Test + CodeQL — green on the prior reviewed head; fresh head checks running
  • exact-head Codex review — requested

Meaningful improvement

Configuration classes are the standard way many EF Core projects organise models. LC045 can now distinguish proven model-level eager loading from a real missing Include without weakening its conservative false-negative boundaries.

Follow exact source-visible IEntityTypeConfiguration applications while preserving conservative invalidation for conditional, runtime, helper, disablement, and lookalike paths.

@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: 21afb4738f

ℹ️ 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 thread tests/LinqContraband.Tests/Architecture/AnalyzerModularizationTests.cs Outdated

Copy link
Copy Markdown
Owner Author

@codex review

Please review the current head f6f0fa84bcd1a82ddf79eafe040549e9ef5b3de3. The previous findings were addressed with TDD; focus on actionable correctness, regression, and false-positive/false-negative risks.

@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: f6f0fa84bc

ℹ️ 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".

Copy link
Copy Markdown
Owner Author

@codex review

Please review current head 226e23933ed054de9868939d83e7eb3757d391bc. The string Navigation finding is addressed with red-green regression and adversarial coverage. Report only actionable correctness or regression risks.

@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: 226e23933e

ℹ️ 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".

Copy link
Copy Markdown
Owner Author

@codex review

Please review current head 1323049523be6dbc32b80aae57a05c006a827d5f. The nested local-executable ordering finding is addressed with red-green regression plus a non-capturing control. Report only actionable correctness or regression risks.

@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: 1323049523

ℹ️ 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".

Copy link
Copy Markdown
Owner Author

@codex review

Please review current head d4f471f2ee798c7291cf99c47c42092766d9fe09. The captured EF-builder alias finding is addressed with red-green coverage. Report only actionable correctness or regression risks.

@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: d4f471f2ee

ℹ️ 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".

Copy link
Copy Markdown
Owner Author

@codex review

Please review current head 7f48532c16ca195a6c8ff2007ef36dcccddb2ef3. The builder field/property escape finding is addressed with red-green coverage. Report only actionable correctness or regression risks.

@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: 7f48532c16

ℹ️ 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".

Copy link
Copy Markdown
Owner Author

@codex review

Please review current head 5a4116574a8112e56d4d63927ac74d11f9a794d6. The builder-consuming constructor finding is addressed with red-green coverage for direct and aliased builders plus an unrelated-constructor control. Report only actionable correctness or regression risks.

@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: 5a4116574a

ℹ️ 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".

Copy link
Copy Markdown
Owner Author

@codex review

Please review current head 5976c030bfa28f6a71170d63e57df1038c8f4a47. The indexer-setter assignment-target finding is addressed with a red-green regression. Report only actionable correctness or regression risks.

@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: 5976c030bf

ℹ️ 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".

Copy link
Copy Markdown
Owner Author

@codex review

Please review current head d02cbec06dfe39ec3669cd54270a6ff79df624e8. The custom indexer-getter and suspended async Configure findings are addressed with red-green regressions. Report only actionable correctness or regression risks.

@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: d02cbec06d

ℹ️ 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".

Copy link
Copy Markdown
Owner Author

@codex review

Please review current head f5dcbe6f762379aa4946365db3cba140f2fec7a8. The builder-consuming user-defined conversion finding is addressed with red-green coverage for assignment and initializer forms. Report only actionable correctness or regression risks.

@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: f5dcbe6f76

ℹ️ 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".

Copy link
Copy Markdown
Owner Author

@codex review

Please review current head 61921ab22524e02ff5fffa640fe43a79730bd4f8. Nested builder-consuming user-defined conversions are now covered recursively with red-green assignment and initializer regressions. Report only actionable correctness or regression risks.

@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: 61921ab225

ℹ️ 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".

Copy link
Copy Markdown
Owner Author

@codex review

Please review current head d2edc262a9c180f8487ebc489dbd2ed905b1821e. Conversion proof now scans the entire Configure operation tree, and applied configurations require the documented parameterless constructor shape, with red-green regressions for both findings. Report only actionable correctness or regression risks.

@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: d2edc262a9

ℹ️ 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".

if (
configurationArgument?.Value.UnwrapConversions()
is not IObjectCreationOperation configurationCreation
|| configurationCreation.Arguments.Length != 0

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 Reject applied configurations with object initializers

When ApplyConfiguration receives new Config { Builder = modelBuilder.Entity<Order>() }, this check accepts it because the constructor has zero arguments. The initializer's property setter can call AutoInclude(false) before an otherwise empty Configure; TryApplyConfigurationAutoIncludes then returns true without clearing an earlier enable, so LC045 is suppressed even though the final model disables eager loading. Require the object creation to have no initializer, or analyze the initializer's effects.

Useful? React with 👍 / 👎.

}

foreach (
var invocationSyntax in syntax.DescendantNodes().OfType<InvocationExpressionSyntax>()

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 Inspect implicit collection-initializer calls

When Configure evaluates a custom collection initializer such as new BuilderSink { builder }, Roslyn represents Add(builder) as an implicit invocation without an InvocationExpressionSyntax, so this syntax-only loop never validates it. A user-defined Add can call AutoInclude(false) after the recorded enable, leaving LC045 incorrectly suppressed; traverse invocation operations in the complete operation tree, including implicit calls.

Useful? React with 👍 / 👎.

Comment on lines +282 to +288
operation is IConversionOperation { OperatorMethod: not null } conversion
&& ReferencesParameter(
conversion.Operand,
builderParameter,
cancellationToken
)
)

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 Reject other user-defined operators on the builder

When Configure uses an overloaded operator such as var ignored = builder + new Mutator();, the operator can disable the navigation but appears as an IBinaryOperation with an OperatorMethod, not as a conversion or invocation syntax. This scan therefore retains a preceding enable and can suppress LC045 incorrectly; treat all user-defined operator operations consuming the builder as unproven boundaries.

Useful? React with 👍 / 👎.

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