Skip to content

fix(oracle): build the product library (not tests/benchmarks) so Infer# succeeds - #24

Merged
PhysShell merged 2 commits into
mainfrom
claude/zen-pasteur-76hfs1
Jun 17, 2026
Merged

fix(oracle): build the product library (not tests/benchmarks) so Infer# succeeds#24
PhysShell merged 2 commits into
mainfrom
claude/zen-pasteur-76hfs1

Conversation

@PhysShell

@PhysShellPhysShell commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Build the product library, not the whole solution

Third Dapper iteration. With .slnx matching (#23) and the shallow-clone deepen (#23) in, the build finally reached the projects — the core Dapper/Dapper.csproj and Dapper.SqlBuilder compiled fine. It then failed on the test/benchmark projects of the solution:

  • MSB3021Dapper.Tests pulls Microsoft.Data.SqlClient.SNI, whose native-copy step is denied (/bin).
  • CS1705 — the net472 benchmark (Dapper.Tests.Performance) hits a System.Runtime version skew.

Neither is the library. An Infer# leak scan wants the product code, not its test suite — and the tests/benchmarks are often unbuildable in a bare CI (no SQL Server, multi-TFM, native deps).

The fix

When no build input is given, prefer the product library over the solution:

  1. a unique <repo>.csproj (repo basename) outsidetest/ tests/ benchmark* sample* example*
  2. else a lone root*.sln/*.slnx
  3. else a lone solution anywhere →
  4. else the dir (continue-on-error → partial report).

Dapper's layout has no src/ (I verified against Dapper.slnx): the library is Dapper/Dapper.csproj at the repo root, which find -name "$name.csproj" selects uniquely (tests, benchmarks, and Dapper.SqlBuilder are excluded by name/path). The build input still overrides for anything unusual.

Verified

A Dapper-shaped fixture resolves to Dapper/Dapper.csproj; a name-mismatch repo falls back to the lone .slnx; an explicit build is respected. oracle.yml valid YAML · build-step bash parses · no comparator change (--selftest still 12/12).

After merge

Re-dispatch oracle (cross-tool), repo = DapperLib/Dapper, no build inputDapper/Dapper.csproj is auto-selected, so Infer# should finally produce SARIF and we get the real three-way own / CodeQL(security-and-quality) / Infer# report.

🤖 Generated with Claude Code


Generated by Claude Code

Summary by CodeRabbit

  • Chores

    • Improved CI/CD build target selection when no explicit build target is provided, preferring a uniquely named product-library <repo>.csproj (outside test/benchmark paths) before falling back to solutions or the target directory.
  • Documentation

    • Updated the Infer# build-selection documentation to reflect the new prioritized fallback order and reaffirm that the build input overrides selection, including clarification of shallow-clone deepening behavior.

…nfer#
Third Dapper iteration: with .slnx + nbgv fixed, the build reached the projects
but failed on the *test/benchmark* projects of the solution — Dapper.Tests pulls
Microsoft.Data.SqlClient.SNI (native copy denied to /bin) and the net472
benchmark hits CS1705 (System.Runtime version skew). The core library itself
(Dapper/Dapper.csproj) built fine — and that is exactly what an Infer# leak scan
wants; its tests/benchmarks are off-target and often unbuildable bare.
So when no `build` input is given, prefer the product library over the solution:
a unique `<repo>.csproj` (repo basename) outside the test/benchmark/sample trees;
else a lone root solution; else a lone solution anywhere; else the dir. Dapper's
layout has no `src/` — the library is `Dapper/Dapper.csproj` at the root (verified
against Dapper.slnx), which `find -name "$name.csproj"` selects uniquely. The
`build` input still overrides.
Verified: a Dapper-shaped fixture resolves to `Dapper/Dapper.csproj` (tests,
benchmarks, Dapper.SqlBuilder excluded); name-mismatch falls back to the lone
.slnx; explicit build respected. oracle.yml valid YAML; build-step bash parses;
no comparator change (--selftest still 12/12).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitaiBot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2fb11b92-f1e4-44db-91a5-508819c42a29

📥 Commits

Reviewing files that changed from the base of the PR and between b579253 and 994d39a.

📒 Files selected for processing (2)
  • .github/workflows/oracle.yml
  • docs/notes/oracle.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • docs/notes/oracle.md
  • .github/workflows/oracle.yml

📝 Walkthrough

Walkthrough

The Infer# "Build the target" step in the Oracle workflow gains a new first-preference branch: when inputs.build is not provided, it searches for a uniquely named <repo>.csproj outside test/benchmark/sample/example directories before falling back to solution files or the target directory. The oracle documentation is updated to reflect this priority order.

Changes

Infer# build-target selection refinement

Layer / File(s)Summary
Infer# build-target selection logic and docs
.github/workflows/oracle.yml, docs/notes/oracle.md
Workflow adds a csproj-priority branch (lines 107–137) that finds a unique <repo>.csproj outside test/benchmark/sample/example paths when inputs.build is empty, falling back to unique root solutions, any unique solution, then the target directory with an updated disambiguation note. Documentation updates the fallback-behavior description to match this priority order and notes that shallow-clone deepening precedes the build.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • PhysShell/Own.NET#22: Modifies the same Infer# auto-target selection block in .github/workflows/oracle.yml and updates docs/notes/oracle.md with the same selection/failure behavior description.
  • PhysShell/Own.NET#23: Also modifies the Infer# auto-build target selection logic in .github/workflows/oracle.yml, including the git fetch --unshallow --tags shallow-clone deepening step referenced in the docs.

Poem

🐇 Hop past the tests, skip the benchmarks too,
A lone .csproj is the first thing I'll pursue!
If none is unique, I'll sniff out a .sln,
And if all else fails — the target's the one.
🌿 Build smart, build clean, no ambiguity here,
The rabbit has spoken, the path is now clear!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe title clearly and specifically summarizes the main change: modifying the build target selection to prefer the product library over tests/benchmarks to ensure Infer# analysis succeeds.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/zen-pasteur-76hfs1

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitaicoderabbitaiBot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/oracle.yml:
- Around line 123-125: The find command using -not -path filters is
case-sensitive, so paths with capitalized directory names like Tests/,
Benchmarks/, Samples/, or Examples/ will not be excluded. Replace the -path
options with -ipath in all four exclusion filters (for test, tests, benchmark,
sample, and example directories) to make the pattern matching case-insensitive,
ensuring that project directories with any capitalization variant are properly
excluded from the selection.
In `@docs/notes/oracle.md`:
- Around line 39-44: The documentation in the oracle.md file is incomplete and
does not reflect all implemented selection rules for build artifacts. Update the
paragraph describing the Infer# workflow (starting around line 39) to include
two missing behaviors: first, clarify that sample and example directory trees
are excluded from the build selection process, and second, add the
root-solution-first fallback tier to the fallback hierarchy, explaining that it
attempts to use a solution file at the repository root before falling back to
repo-wide solutions. This will ensure the documentation accurately reflects the
complete implementation.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 49a6eaf8-54f3-4c6f-85c8-6ebe1d7eca2c

📥 Commits

Reviewing files that changed from the base of the PR and between 32ad714 and b579253.

📒 Files selected for processing (2)
  • .github/workflows/oracle.yml
  • docs/notes/oracle.md

Comment thread.github/workflows/oracle.yml Outdated
Comment threaddocs/notes/oracle.md
…deRabbit #24)
- oracle.yml (Major): the `-not -path` exclusions are case-sensitive, so a
`<repo>.csproj` under a capitalized `Tests/`/`Benchmarks/`/`Samples/` could slip
into the product-library pick. Switch to `-ipath` (kept the broad
`benchmark*`/`sample*`/`example*` globs rather than a singular/plural split) and
add `-type f`. Verified: a `Tests/DapperX/Dapper.csproj` decoy is now excluded,
so Dapper still resolves to `Dapper/Dapper.csproj`.
- docs/notes/oracle.md (Minor): the prose had drifted from the implementation —
now states the sample/example exclusion and the full fallback order (root
solution -> any solution -> dir).
oracle.yml valid YAML; fixture check passes; no comparator change.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED
@PhysShell
PhysShell merged commit 4e91af7 into mainJun 17, 2026
17 checks passed
PhysShell pushed a commit that referenced this pull request Jun 17, 2026
The first real three-way run (DapperLib/Dapper) exposed two issues:
1. Infer# reported 0 leaks in the comparison, but it actually found 3 — modern
Infer# (Pulse engine, v1.2+) emits `PULSE_RESOURCE_LEAK`, not the older
`RESOURCE_LEAK`, so the comparator's INFER_LEAK set missed them and they were
mis-filed under "out of scope" context. Now match the Infer leak family by
substring (`*RESOURCE_LEAK*` / `*MEMORY_LEAK*`), robust to version drift.
2. Scope asymmetry: Infer# builds only the product project (the #24 heuristic),
while own-check and CodeQL scan the whole source tree — so their leak counts
were inflated by test/benchmark code the others never saw (agree was depressed
accordingly). Add `--exclude-tests` (comparator) + an `include_tests` workflow
input (default off => product-only). The exclusion is applied uniformly to all
tools in the comparator rather than per-tool, because CodeQL's `paths-ignore`
is unreliable for compiled C# with `build-mode: none`. Report header notes the
scope.
docs/notes/oracle.md updated (scope note + the input). selftest now 15/15
(adds PULSE classification + the exclude-tests predicate); ruff clean;
run_tests.py exit 0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rg8kSk1YT14x7A1vo5zgED
Sign up for freeto 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.

2 participants

@PhysShell@claude