AI-generated audit finding — this issue was opened from an automated security/correctness audit. It has not been triaged by a human yet; verify the reasoning, reproducibility, and severity before acting on it.
Medium: orphaned generated .cs files survive source or metadata changes and can keep compiling — NEW
Affected code:
Verification:
Confirmed by inspection. The package has no mechanism to discover and remove previously generated outputs that are no longer represented by the current SliceFile item set.
This creates several concrete stale-output paths:
- a
.slice file is deleted or removed from the project,
- a
SliceFile changes OutputDir, leaving the old generated path behind,
- a
SliceFile changes IceRpc from true to false, leaving the old .IceRpc.cs behind.
Because the default output directory is under the project root (generated), these stale .cs files continue to match the SDK's default C# include glob in ordinary SDK-style projects. That means the build can continue compiling types generated from a Slice file that no longer exists or from an IceRPC generator pass that has been disabled.
Impact:
- Build drift: removed or reconfigured Slice inputs can leave ghost generated code in the compilation.
- Confusing failures or false success after schema cleanup, renames, or metadata changes.
Recommendation:
- Track generated outputs with a manifest or stamp file and remove obsolete outputs before or during
Slicec.
- At minimum, extend
SlicecClean to delete previously recorded outputs, not just outputs computed from the current SliceFile items.
- Add an integration test that builds once, removes or reconfigures a
.slice file, rebuilds, and verifies that stale generated files are not still compiled.
Status: Valid, Medium severity.
Source report: src-IceRpc.Slice.Tools-audit-2026-04-14.md (finding orphaned generated .cs files survive source or metadata changes and can keep compiling — **NEW**)
Severity (auditor-assigned): Medium
Medium: orphaned generated
.csfiles survive source or metadata changes and can keep compiling — NEWAffected code:
$(MSBuildProjectDirectory)/generatedSliceFileset onlySliceFileitemsSlicecCleandeletes only the outputs of the currentSliceFileitemsVerification:
Confirmed by inspection. The package has no mechanism to discover and remove previously generated outputs that are no longer represented by the current
SliceFileitem set.This creates several concrete stale-output paths:
.slicefile is deleted or removed from the project,SliceFilechangesOutputDir, leaving the old generated path behind,SliceFilechangesIceRpcfromtruetofalse, leaving the old.IceRpc.csbehind.Because the default output directory is under the project root (
generated), these stale.csfiles continue to match the SDK's default C# include glob in ordinary SDK-style projects. That means the build can continue compiling types generated from a Slice file that no longer exists or from an IceRPC generator pass that has been disabled.Impact:
Recommendation:
Slicec.SlicecCleanto delete previously recorded outputs, not just outputs computed from the currentSliceFileitems..slicefile, rebuilds, and verifies that stale generated files are not still compiled.Status: Valid, Medium severity.
Source report: src-IceRpc.Slice.Tools-audit-2026-04-14.md (finding
orphaned generated.csfiles survive source or metadata changes and can keep compiling — **NEW**)Severity (auditor-assigned): Medium