fix(quickfiler-test): remove dead live-Form types from QuickFiler.Test and add a permanent structural guard (#491) - #588
Merged
drmoisan merged 7 commits intoAug 22, 2026
Conversation
drmoisan
merged commit Aug 22, 2026
b8b4a9e
into
epic/quickfiler-suite-determinism-foundation-integrationdrmoisan added a commit
that referenced
this pull request
Aug 22, 2026
Children 449 (PR #585, follow-up #590), 445 (PR #587), and 491 (PR #588) are merged; each merge commit was confirmed reachable from the fetched integration head rather than taken from a completion notification. Child 511 remains in atomic execution. Records seven carried findings, two of which correct this epic's own inputs: epic.md misattributed QuickFiler/Legacy/QuickFileController.cs's 1,065 lines to QuickFiler/Controllers/QfcExplorerController.cs (182 lines after change, and the legacy file has zero compile references), and collect_pr_context writes into the shared main checkout, letting one child overwrite a sibling's PR context (issue #589). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UHj7wjLweuwfAP8NDA4iiP
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 freeto 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
fix(quickfiler-test): remove dead live-Form types from QuickFiler.Test and add a permanent structural guard (#491)
Summary
QuickFiler.Test.Form1type (Form1.cs,Form1.Designer.cs,Form1.resx) and its three compile/embedded-resource entries inQuickFiler.Test.csproj. No test constructed it; it was compiled but unused.NoLiveFormInTestAssemblyTests.ExecutingAssembly_ContainsNoFormDerivedType, that fails the build the next time anySystem.Windows.Forms.Form-derived type is compiled intoQuickFiler.Test.QfcFormViewerDerived : QfcFormViewerinQuickFiler.Test/Controllers/QfcHomeControllerTests.cs, unrelated toForm1and never instantiated anywhere in the repository (verified by repo-wide search). That dead class is also removed in this PR (remediation cycle 1).UtilitiesCS.Test/ResourceTests.cs:20,Form1 frm = new Form1();) and is explicitly out of scope for this PR; it is tracked as its own issue, Bug: utilitiescs-test-form1-live-form #586.internalmembers ofItemViewer.Breadcrumb.cs) as an explicit tracking deferral to the ItemViewer-owning epic child, posted as a comment on Bug: quickfiler-test-form1-live-form #491.Why
QuickFiler.Test/Form1.csandForm1.Designer.csdeclared aSystem.Windows.Forms.Form-derived type compiled into the unit-test assembly with no test referencing it..claude/rules/general-unit-test.mdand this epic's "never construct live forms in unit tests" invariant treat this as dead weight onenew Form1()away from becoming a live policy violation. The fix removes the type and adds a guard that makes a future reintroduction fail the build immediately, rather than relying on manual review to catch it again.During execution, the new guard test (which scopes to every
Form-derived type in the executing assembly, exactly as designed) also caught a second, unrelated dead type that predates this PR (QfcFormViewerDerived, first present 2025-02-01). It was deleted in a remediation cycle because it is the same defect class this PR exists to eliminate, has zero callers anywhere in the repository, and lives in the same assembly this PR's guard test targets, directly blocking that guard's acceptance criteria.What Changed
Core change
QuickFiler.Test/Form1.cs,QuickFiler.Test/Form1.Designer.cs,QuickFiler.Test/Form1.resx.QfcFormViewerDerivedinQuickFiler.Test/Controllers/QfcHomeControllerTests.cs(11 lines; no other change to that file).QuickFiler.Test/NoLiveFormInTestAssemblyTests.cs— reflection-only guard, scoped to the executing assembly only (does not flag the unrelated, legitimate production typeQuickFiler.Viewers.Form1in the referencedQuickFilerassembly).QuickFiler.Test/QuickFiler.Test.csproj: confined edit to the two owned regions (Form1 compile entries, Form1.resx item group) — 1 line added, 11 lines deleted across 2 hunks. No other region of this 116-entry legacy project file was touched (three sibling epic children edit other regions of the same file concurrently).Tests / tooling
Docs
docs/features/active/2026-08-07-quickfiler-test-form1-live-form-491/spec.md: 10 of 11 acceptance criteria checked off with cited evidence (see Verification below for the 11th).docs/features/active/2026-08-07-quickfiler-test-form1-live-form-491/evidence/(baseline, regression-testing, qa-gates, issue-updates, other) pluspolicy-audit,code-review, andfeature-auditartifacts from an independent feature-review pass.UtilitiesCS.Test/Form1finding: issue Bug: utilitiescs-test-form1-live-form #586.Architecture / How It Fits Together
NoLiveFormInTestAssemblyTestsis a pure MSTest structural guard: it callsAssembly.GetExecutingAssembly(), enumerates loadable types viaGetTypes()(guarding againstReflectionTypeLoadExceptionso one unloadable unrelated type cannot leave the guard permanently red), and asserts via FluentAssertions that no type is assignable toSystem.Windows.Forms.Form. It constructs nothing — no form, no control, noBackgroundWorker— so it introduces no new visible-window risk itself; it exists specifically to prevent one.Verification
Completed (from evidence artifacts committed on this branch):
/p:EnableNETAnalyzers=true /p:EnforceCodeStyleInBuild=true): exit 0, 0 errors, non-vacuous rebuild confirmed (CoreCompileinvoked,Skipping target "CoreCompile"count 0)./p:TreatWarningsAsErrors=true, no/p:Nullable=enable): exit 0, 0 errors.vstestwith/EnableCodeCoverage /InIsolation /TestCaseFilter:"TestCategory!=LiveOutlook": baseline 6437 total / 6436 passed / 1 failed (pre-existing unrelated flaky STA-timing test) / 0 skipped -> post-change 6438 total / 6438 passed / 0 failed / 0 skipped. No pre-existing test regressed; the one new guard test is the only addition, and it is green.Form1(primary cycle) and againstQfcFormViewerDerived(remediation cycle), proving it is load-bearing rather than vacuous.QuickFiler.Testclass appears in either coverage file, consistent with the harness's.Test-assembly exclusion), and the shortfall is attributable to two specific, unrelated, untouched production files (UtilitiesCS/HelperClasses/SegmentStopWatch.cs,UtilitiesCS/OutlookObjects/Table/OlTableExtensions.Etl.cs). Both readings individually clear the repository's 85% floor. This is the one acceptance criterion (of 11) left unchecked inspec.md; feature-review dispositioned it non-blocking on this independently verified evidence.Recommended (for a reviewer who wants to re-run locally):
dotnet tool run csharpier check .msbuild TaskMaster.sln /t:Rebuild /m /p:Configuration=Debug "/p:Platform=Any CPU" /p:EnableNETAnalyzers=true /p:EnforceCodeStyleInBuild=truemsbuild TaskMaster.sln /t:Rebuild /m /p:Configuration=Debug "/p:Platform=Any CPU" /p:TreatWarningsAsErrors=truevstest.console.exe QuickFiler.Test\bin\Debug\QuickFiler.Test.dll /EnableCodeCoverage /InIsolation /TestCaseFilter:"TestCategory!=LiveOutlook&FullyQualifiedName~NoLiveFormInTestAssemblyTests"Not verified in this PR: this epic's PRs against the integration branch receive no automated CI checks (
.github/workflows/ci.ymltriggers only onmain/development), so the verification above is the full local toolchain, not a CI run.Backward Compatibility / Migration Notes
No public API changes.
QuickFiler.Test.Form1andQuickFiler.Test.Form1.Designerare removed; nothing outside their own two files referenced them (verified by repo-wide search before removal). No breaking change to any production assembly.Risks and Mitigations
Form-derived type without ever showing it (asQfcFormViewerDeriveddid, though unused). Mitigation: the guard was deliberately left broad rather than narrowed with an exemption list, per repository convention of fixing dead code rather than special-casing coverage/policy gates; a future legitimate case would need its own design decision, not a silent allowlist.feature-audit.2026-08-22T15-26.md.Review Guide
Suggested order:
QuickFiler.Test/NoLiveFormInTestAssemblyTests.cs— the new guard, small and self-contained.QuickFiler.Test/QuickFiler.Test.csprojdiff — confirm the edit is confined to the two owned regions.QuickFiler.Test/Controllers/QfcHomeControllerTests.csdiff — confirm only the dead nested class was removed (11 lines, no other change).docs/features/active/2026-08-07-quickfiler-test-form1-live-form-491/spec.mdand the three review artifacts (policy-audit,code-review,feature-audit) for the full acceptance-criteria and audit trail.Noisy/mechanical: the committed raw Cobertura XML evidence files (
coverage-baseline.cobertura.xml,coverage-postchange-remediation.cobertura.xml) are large and can be skipped in review; their headline numbers are summarized in the QA-gate.mdartifacts alongside them.Follow-ups
Form1construction inUtilitiesCS.Test/ResourceTests.cs:20, in a different assembly, out of scope for this PR.internalmembers ofQuickFiler/Viewers/ItemViewer.Breadcrumb.cs) remains deferred to the ItemViewer-owning epic child; tracked via a comment on Bug: quickfiler-test-form1-live-form #491.GitHub Auto-close