You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SortEmail_Tests test of TrySaveAttachmentAsync (UtilitiesCS.Test/EmailIntelligence/SortEmail_Tests.cs lines ~237-249) passes a path under the real repository root. It reaches Directory.CreateDirectory in UtilitiesCS/EmailIntelligence/EmailParsingSorting/SortEmail.cs (line ~896), so the unit test creates a directory in the working tree. The repository policy prohibits this, and it is the same defect class as #931 and #940.
Environment
OS/version: Windows 11 / windows-latest
Python version: n/a (C# / MSTest)
Command/flags used: standard MSTest coverage route
Data source or fixture: GetRepositoryRoot() helper in SortEmail_Tests.cs (lines ~393-415)
Steps to Reproduce
Run the TrySaveAttachmentAsync test in SortEmail_Tests.
Inspect the repository root for a newly created directory.
Expected Behavior
The test exercises the save path without touching the real file system, through a seam or a mock, and creates no directory or file.
Actual Behavior
Directory.CreateDirectory runs against a path derived from the repository root.
Restoring sections dropped by the promotion tooling.
Suspected Cause / Notes
TrySaveAttachmentAsync (UtilitiesCS/EmailIntelligence/EmailParsingSorting/SortEmail.cs line ~889) is marked [ExcludeFromCodeCoverage] (line ~888) and has no injectable file-system seam, so the test at UtilitiesCS.Test/EmailIntelligence/SortEmail_Tests.cs lines ~237-249 drives the real Directory.CreateDirectory (line ~896) against a path derived from the repository root. #940 classifies this site but deliberately does not modify it.
Source: #940 research, section 5 and open question 10.
Proposed Fix / Validation Ideas
Introduce an injectable file-system abstraction for the directory-creation step, reusing the existing IFileSystem-style seams in UtilitiesCS, and mock it in the test.
Assert that no real directory is created, using a strict mock with VerifyNoOtherCalls.
Negative control: the rewritten test fails if the production code bypasses the seam.
Delivered by PR 957 (merge commit 9b3eea5), parallel run bugs-2026-09-28. All 8 acceptance criteria in issue.md are checked off; all seven checks green on head 812c7cd (run 36849045538) before merge. Follow-ups are filed separately by the run coordinator.
Activity
drmoisan commentedon Sep 30, 2026
Restoring sections dropped by the promotion tooling.
Suspected Cause / Notes
TrySaveAttachmentAsync(UtilitiesCS/EmailIntelligence/EmailParsingSorting/SortEmail.csline ~889) is marked[ExcludeFromCodeCoverage](line ~888) and has no injectable file-system seam, so the test atUtilitiesCS.Test/EmailIntelligence/SortEmail_Tests.cslines ~237-249 drives the realDirectory.CreateDirectory(line ~896) against a path derived from the repository root. #940 classifies this site but deliberately does not modify it.Source: #940 research, section 5 and open question 10.
Proposed Fix / Validation Ideas
IFileSystem-style seams in UtilitiesCS, and mock it in the test.VerifyNoOtherCalls.drmoisan commentedon Oct 1, 2026
Delivered by PR 957 (merge commit 9b3eea5), parallel run bugs-2026-09-28. All 8 acceptance criteria in issue.md are checked off; all seven checks green on head 812c7cd (run 36849045538) before merge. Follow-ups are filed separately by the run coordinator.