test(940): remove repository-root and TaskMaster.sln dependence from the file-system wrapper tests - #955
Merged
drmoisan merged 9 commits intoSep 30, 2026
Conversation
…C, cleared plan) Adds the active minor-audit folder for issue 940: issue.md with explicit Acceptance Criteria AC1-AC8, research, the atomic plan cleared by three atomic-executor preflight rounds (PREFLIGHT: ALL CLEAR), and the preflight clearance record. Restores the promoted potential record from the session branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GG13mBq6qiRbu6ZDYRyBn9
… fix Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
…es instead of the repository solution file Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
…, control records and plan check-offs Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
…r-tests-open-repository-solution-file-940
…or per-file coverage ruling Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
…-system wrapper test fix Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
…(0 blocking) Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
…r-tests-open-repository-solution-file-940
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Suggested title
test(940): remove repository-root and TaskMaster.sln dependence from the file-system wrapper tests
Summary
UtilitiesCS.Test/HelperClasses/PhysicalFileSystemAdapters_Tests.csandUtilitiesCS.Test/HelperClasses/DirectoryInfoWrapper_Tests.csso that no test locates the repository root or opens, enumerates or mutatesTaskMaster.slnor any other tracked repository file.IOExceptionswallowing that hid file-handle contention instead of removing it.PhysicalDirectoryInfoAdapter.cs,PhysicalFileInfoAdapter.cs,DirectoryInfoWrapper.cs) are byte-identical to main.Why
The wrapper tests walked up to the repository root and used the real
TaskMaster.slnas their fixture. Their outcome therefore depended on the repository layout and on whether another process (a resident MSBuild node or an IDE) held the solution file open with a share mode that excludes readers. This is the same defect class that #931 (PR #939) removed fromFileInfoWrapper_Tests. Several tests also caughtIOException, which tolerated the contention rather than eliminating it. Tests must run in parallel (Workers=0, ClassLevel), so the fix does not serialise the run.What Changed
Tests
PhysicalFileSystemAdapters_Tests.cs: theGetRepositoryRootandGetSolutionFilehelpers are removed. Read-only members are exercised against the test assembly's own loaded image and output directory. Mutating members (timestamps, attributes, read-only flag, access control, create, copy, replace, move, delete) are exercised only against a path under the output directory that is asserted not to exist before the call, or against an existing owned entry on which the call is a no-op by construction. Three test methods were added to keep every previously exercised member covered.DirectoryInfoWrapper_Tests.cs: the repository-root walk is removed; enumeration delegation is asserted through Moq-basedIDirectoryInfomocks and a rooted fixture path.DoNotParallelize, worker-count or scope change, retry, sleep or timeout is introduced.Documentation and evidence
docs/features/active/2026-09-29-filesystem-wrapper-tests-open-repository-solution-file-940/: issue, research, atomic plan (version 1.3), Phase 0 baselines, fail-before exception dossier, the eleven mutation controls, final QC evidence and the reduced-audit artifacts.issue.mdwas amended on 2026-09-30 per a coordinator ruling (dated note under the acceptance criteria): the package-level and repository-level not-lower coverage comparison was replaced by a per-file no-regression rule, for covered lines and covered branches, over the three changed wrapper and adapter files, with the first-party floors unchanged (line at least 80 percent, branch at least 75 percent). Two identical coverage runs of the same committed tree had shown run-to-run variance in files this change does not touch (PropertyStore.cs,OlTableExtensions.Etl.cs,SubjectMapSco.Orchestration.cs).Architecture / How It Fits Together
The production seams are unchanged.
PhysicalDirectoryInfoAdapterandPhysicalFileInfoAdapterwrapSystem.IO.DirectoryInfoandSystem.IO.FileInfobehind the internalIDirectoryInfoandIFileInfointerfaces, andDirectoryInfoWrapperdelegates to anIDirectoryInfo. The tests now supply either a mock of those interfaces or a realDirectoryInfo/FileInfowhose target the test assembly owns, so delegation is verified without depending on repository layout or on other processes.Verification
Completed (evidence committed under the feature folder)
evidence/qa-gates/toolchain-pass.md,LOOP: CLEAN PASS, one iteration):dotnet tool run csharpier format .(0 files rewritten) anddotnet tool run csharpier check .exit 0; analyzer rebuild (msbuild TaskMaster.sln /t:Rebuild ... /p:EnableNETAnalyzers=true /p:EnforceCodeStyleInBuild=true) and nullable rebuild (... /p:TreatWarningsAsErrors=true) exit 0 with 0 errors and 0 skipped CoreCompile targets, re-run after merging main.evidence/regression-testing/test-run-final.md).evidence/qa-gates/coverage-final.md).PhysicalDirectoryInfoAdapter.cs: lines 81/91 to 91/91, branches 36/42 to 36/42.PhysicalFileInfoAdapter.cs: lines 69/75 to 71/75, branches 6/12 to 6/12.DirectoryInfoWrapper.cs: lines 123/123 to 123/123, branches 3/4 to 3/4.NOT-LOWER=Falsein every case; the coverage document hash is unchanged before and after.evidence/regression-testing/mutation-*.md,p1-t31-post-control-clean-tree).p2-t10-scope-boundary,p2-t11-hygiene-sweep,p2-t20-closure).OSBrowser_Teststhrough a fixed filter because they stall on the local workstation (reproduced on main); CI runs them.Recommended
Backward Compatibility / Migration Notes
None. Only test code changed; no public API, production behaviour, build configuration or runsettings file changed.
Risks and Mitigations
SetAccessControlwith an unmodified security object is a real, idempotent write on the owned output directory and loaded image. Mitigation: it is admitted by the amended AC3/AC4 wording as a no-op by construction; seaming it is listed as a follow-up.Debug-named directory. Mitigation: this matches the standard build layout locally and in CI; recorded as a non-blocking review finding.Review Guide
UtilitiesCS.Test/HelperClasses/PhysicalFileSystemAdapters_Tests.cs(the main rewrite).UtilitiesCS.Test/HelperClasses/DirectoryInfoWrapper_Tests.cs.issue.mdacceptance criteria and the AC8 dated note.evidence/qa-gates/coverage-final.md(MEASUREMENT 3, per-file comparison, negative control, variance tables).Follow-ups
To be filed by the coordinator; not filed from this branch.
UtilitiesCS.Test/EmailIntelligence/SortEmail_Tests.csTrySaveAttachmentAsync_WhenSaveSucceeds_ReturnsTrueAndCallsSaveAsFileis classified as the same defect class (productionDirectory.CreateDirectoryunder the repository root); left unmodified as required.SetAccessControlon both physical adapters so the tests need no real DACL write.PhysicalFileInfoAdapterconstructor null-guard branches remain uncovered (6 of 12 branches, pre-existing).PropertyStore.cs,OlTableExtensions.Etl.csandSubjectMapSco.Orchestration.csvaries between identical runs, which makes package-level and repository-level not-lower comparisons unreliable as gates.DirectoryInfoWrappertests, redundant sentinel stream opens).GitHub Auto-close
🤖 Generated with Claude Code