Skip to content

test(tests): nullable-cleanup Slice C-3 — MindmapGeneration SVG cluster (#710, x0ykyn) - #731

Merged
jsboige merged 1 commit into
masterfrom
fix/tests-nullable-slice-c3
Jul 6, 2026
Merged

test(tests): nullable-cleanup Slice C-3 — MindmapGeneration SVG cluster (#710, x0ykyn)#731
jsboige merged 1 commit into
masterfrom
fix/tests-nullable-slice-c3

Conversation

@jsboige

@jsboige jsboige commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Slice C-3 of #710 nullable-cleanup — MindmapGeneration SVG cluster (4 warnings)

Third sub-lot of Slice C (CS86xx nullable-flow). Follows Slice A (#727), B (#728), C-1 (#729), C-2 (#730).

Scope — all 4 remaining CS86xx in the MindmapGeneration SVG cluster (3 files)

This cluster sits in CLAUDE.md "Known Fragile Area #1 — SVG disambiguation" territory, so each fix is the most conservative honest annotation, not a logic change.

File Line Code Fix Rationale
SvgConversionIntegrationTests.cs L59-60 CS8602 + CS8605 Assert.NotNull(method) + method!.Invoke(...)! GetMethodMethodInfo?, Invokeobject?. Test is [Fact(Skip=...)] — the #719 Magick.NET skip, root-caused OBSOLETE by #722 (path replaced by FreeMind GUI + Batik). Skipped test never runs; annotation just satisfies the compiler. No behavioral change
SvgDisambiguationContractTests.cs L37 CS8625 G(string text, string? id = null) Body already null-checks (if (id != null)) before SetAttributeValuestring? is the honest type. Fixture callers pass null to build <g> without an id — intentional
SvgPostProcessingTests.cs L33 CS8604 Path.GetDirectoryName(...Location)! GetDirectoryName returns string?; in a running test the assembly location is non-null → ! documents that invariant

DoD (measured on this branch, base master 240511c8)

CsvHelper safety (#710 §3)

NOT IN SCOPE. None of these files is a CsvHelper-mapped entity or exercises the CSV load path. The mapping-risk suites are untouched.

Slice C remaining (~11 distinct CS86xx, subsequent sub-lots)

CsvGridConversion, ImageFileGenerator×2, SimpleImageGenerator, OwlE2E, FallacyLinkFallback×3, LoggerMarkup, UtilityExtensions, PKHierarchical.

Non-goals

  • 0 write under Cards/. 0 production / card-rendering code changed. Tests-only.
  • 0 CsvHelper-mapped type changed. 0 logic change in the SVG fragile area (annotation-only).

Base 240511c8. Dispatch x0ykyn PRIMARY (Slice C-3). Independent of #727/#728/#729/#730 (different files; this branch off master).

🤖 Generated with Claude Code

Co-authored-by: Claude-Code noreply@anthropic.com

…er (4 warnings)

Third sub-lot of Slice C (CS86xx nullable-flow) of the #710 nullable-cleanup plan
(dispatch x0ykyn PRIMARY; follows Slice A #727, B #728, C-1 #729, C-2 #730).

Cohesive sub-lot by area: all 4 remaining CS86xx in the MindmapGeneration SVG cluster
(3 files). This cluster sits in CLAUDE.md "Known Fragile Area #1 — SVG disambiguation" territory,
so each fix is the most conservative honest annotation, not a logic change.

Fixes (4 warnings):

- SvgConversionIntegrationTests.cs L59-60 (CS8602 method-null deref + CS8605 nullable unbox):
  `GetMethod` returns `MethodInfo?` and `Invoke` returns `object?`. The test is `[Fact(Skip=...)]`
  (the #719 Magick.NET skip — root-caused OBSOLETE by #722: the path was replaced by FreeMind GUI
  + Batik). Added `Assert.NotNull(method)` + `method!.Invoke(...)!` so the cast is honest. The
  skipped test never runs; the annotation just satisfies the compiler. NO behavioral change.
- SvgDisambiguationContractTests.cs L37 (CS8625): `G(string text, string id = null)` →
  `G(string text, string? id = null)`. The body already null-checks (`if (id != null)`) before
  `SetAttributeValue`, so `string?` is the honest param type. Caller fixture sites pass null to
  build <g> elements without an id — intentional.
- SvgPostProcessingTests.cs L33 (CS8604): `Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!`
  — GetDirectoryName returns `string?` (Location can in theory be empty); in a running test the
  assembly location is non-null, so the `!` documents that invariant.

DoD (measured on this branch, base master 240511c):
- dotnet build Tests.csproj --no-incremental: the 3 target files emit 0 CS86xx (4→0). 0 errors.
- dotnet test --filter MindmapGeneration: 85 pass / 1 skip (the Magick test, expected). 0 regression.
- dotnet test (full): 587 pass / 1 fail (OWL #133 permanent) / 5 skip (#719). 0 regression.

CsvHelper safety (#710 §3): NOT IN SCOPE — none of these files is a CsvHelper-mapped entity or
exercises the CSV load path. The mapping-risk suites are untouched.

Slice C remaining: 11 distinct CS86xx across 8 files (CsvGridConversion, ImageFileGenerator×2,
SimpleImageGenerator, OwlE2E, FallacyLinkFallback×3, LoggerMarkup, UtilityExtensions,
PKHierarchical). Follow in subsequent sub-lots.

Base 240511c. 0 Cards/ write, 0 rendering code change.

Dispatch x0ykyn (PRIMARY, Slice C-3). Base 240511c.

Co-authored-by: Claude-Code <noreply@anthropic.com>
@jsboige
jsboige merged commit 69b8968 into master Jul 6, 2026
3 checks passed
@jsboige
jsboige deleted the fix/tests-nullable-slice-c3 branch July 6, 2026 17:10
jsboige added a commit that referenced this pull request Jul 6, 2026
…warnings) (#732)

Fourth sub-lot of Slice C (CS86xx nullable-flow) of the #710 nullable-cleanup plan
(dispatch x0ykyn PRIMARY; follows Slice A #727, B #728, C-1 #729, C-2 #730, C-3 #731).

Cohesive sub-lot by area: all 3 remaining CS86xx in ImageGeneration/ (2 files).
None is a CsvHelper-mapped entity or exercises the CSV load path.

Fixes (3 warnings):

- ImageFileGeneratorTests.cs L65 (CS8604): `Path.GetDirectoryName(fakeImagePath)!` — GetDirectoryName
  returns `string?`; the fake-image path is built by ImageHelper from a known config so the dir part
  is non-null. `!` documents that invariant.
- ImageFileGeneratorTests.cs L166 (CS8600): `result = null!` — the ConcurrentDictionary is the
  classic closure-capture pattern: declared null, assigned inside the `Action act = () => result =
  sut.GenerateDocumentImages(...)`, then asserted `result.Should().NotBeNull()` at L172 before use.
  `null!` is the honest initializer.
- SimpleImageGeneratorTests.cs L40-43 (CS8602): `JsonSerializer.Deserialize` returns
  `AssetConverterConfig?`. Added `config.Should().NotBeNull(...)` (committed test-config.json must
  deserialize) + `config!.BaseTargetDirectoryName`. The FluentAssertions guard + `!` together satisfy
  the flow analysis (0 residual CS8603 at the `return config;`).

DoD (measured on this branch, base master 240511c):
- dotnet build Tests.csproj --no-incremental: the 2 target files emit 0 CS86xx (3→0). 0 errors.
- dotnet test --filter ImageGeneration: 8/8 pass. 0 regression.
- dotnet test (full): 587 pass / 1 fail (OWL #133 permanent) / 5 skip (#719). 0 regression.

CsvHelper safety (#710 §3): NOT IN SCOPE — neither file is a CsvHelper-mapped entity or exercises
the CSV load path.

Slice C remaining: 8 distinct CS86xx across 6 files (CsvGridConversion, OwlE2E,
FallacyLinkFallback×3, LoggerMarkup, UtilityExtensions, PKHierarchical). Follow in subsequent sub-lots.

Base 240511c. 0 Cards/ write, 0 rendering code change.

Dispatch x0ykyn (PRIMARY, Slice C-4). Base 240511c.

Co-authored-by: Your <your.email@example.com>
Co-authored-by: Claude-Code <noreply@anthropic.com>
jsboige added a commit that referenced this pull request Jul 6, 2026
… null (3 warnings) (#733)

Fifth sub-lot of Slice C (CS86xx nullable-flow) of the #710 nullable-cleanup plan
(dispatch x0ykyn PRIMARY; follows Slice A #727, B #728, C-1 #729, C-2 #730, C-3 #731, C-4 #732).

Single-signature fix: 3 CS8625 (L115/135/152) all stem from `SetLink(f, linkProp, null)` where the
helper was declared `SetLink(Fallacy f, string propName, string value)`. The null is INTENTIONAL —
the FallacyLinkFallback test suite deliberately clears a non-source language link to exercise the
mind-map link fallback cascade (non-source null → EN → FR source-floor → null floor). `string? value`
is the honest param type; the body `SetValue(f, value)` accepts object so null is runtime-legal.

This is the fragile-area link-fallback contract pinned by this suite (CLAUDE.md mind-map
localization) — the annotation changes nothing about the cascade behavior, only the declared
parameter type. Direct confirmation: all 29 FallacyLinkFallback tests pass unchanged.

DoD (measured on this branch, base master 240511c):
- dotnet build Tests.csproj --no-incremental: FallacyLinkFallback emits 0 CS86xx (3→0). 0 errors.
- dotnet test --filter FallacyLinkFallback: 29/29 pass.
- dotnet test (full): 587 pass / 1 fail (OWL #133 permanent) / 5 skip (#719). 0 regression.

CsvHelper safety (#710 §3): NOT IN SCOPE — FallacyLinkFallback exercises the link-fallback cascade
via reflection on Fallacy entities, not the CsvHelper CSV load path.

Slice C remaining: 5 distinct CS86xx across 5 files (CsvGridConversion, OwlE2E, LoggerMarkup,
UtilityExtensions, PKHierarchical) — singletons, bundle into a final C-final lot.

Base 240511c. 0 Cards/ write, 0 rendering code change.

Dispatch x0ykyn (PRIMARY, Slice C-5). Base 240511c.

Co-authored-by: Your <your.email@example.com>
Co-authored-by: Claude-Code <noreply@anthropic.com>
jsboige added a commit that referenced this pull request Jul 6, 2026
…omplete (#710) (#734)

Final sub-lot of Slice C (CS86xx nullable-flow) of the #710 nullable-cleanup plan
(dispatch x0ykyn PRIMARY; follows Slice A #727, B #728, C-1 #729, C-2 #730, C-3 #731, C-4 #732,
C-5 #733). This completes Slice C: all 32 distinct CS86xx in Tests/ are addressed across the
7 sub-lots C-1..C-final (merged set), leaving 0 CS86xx once all slice PRs are merged.

The 5 singletons (one warning per file, 5 different areas):

- CsvGridConversionContractTests.cs L176 (CS8625): `new List<object> { "a", null!, "c" }` — the null
  cell is INTENTIONAL (test name "GridToCsv_NullCells_BecomeEmptyStrings", pins the `cell?.ToString()
  ?? ""` guard). `null!` is the honest suppression (runtime-legal null cell, annotation-strict).
- OwlE2EGenerationValidationTests.cs L60 (CS8603): `private static string? ResolveRepoFile(...)` —
  path-finder helper legitimately returns null when the ontology file isn't found walking up from
  the bin dir (same idiom as #715 FindRepoVirtuesCsv). The sole caller (L47) already null-checks and
  throws FileNotFoundException (L48-54); the throw guarantees `path` non-null at L55 FromFile, so no
  caller `!` needed.
- LoggerMarkupSafetyTests.cs L58 (CS8600): `string output = null!;` — closure-capture pattern
  (assigned in the lambda at L59, asserted at L62). `null!` is the honest initializer.
- UtilityExtensionsLayoutTests.cs L142 (CS8600): `((string)null!).PathIsUrl()` — the null is
  INTENTIONAL (test name "PathIsUrl_Returns_False_For_Null", pins the null-guard so a regression
  that dropped it would NRE). The `null!` documents that intent.
- PKHierarchicalGroupingTests.cs L25 (CS8619): `.Select(record => record["path"].ToString()!)` —
  the path key is always set by BuildRecords (L22), so ToString on the boxed string is non-null;
  `!` documents that invariant for the ToHashSet<string>() return type.

DoD (measured on this branch, base master 240511c):
- dotnet build Tests.csproj --no-incremental: the 5 target files emit 0 CS86xx (5→0). 0 errors.
- dotnet test (targeted GSheetSync+Ontology+Utility+PKHierarchical): 52 pass / 1 fail
  (OWL #133 permanent known-fail, pre-existing — not a regression; the 3 OTHER OwlE2E tests pass).
- dotnet test (full): 587 pass / 1 fail (OWL #133) / 5 skip (#719). 0 regression.

CsvHelper safety (#710 §3): NOT IN SCOPE — none of these 5 files is a CsvHelper-mapped entity or
exercises the CSV load path (GSheet grid round-trip, OWL ontology load via OwlAdapter, Logger
markup, path utility, PK grouping reflection).

#710 plan status once all 8 PR (#727-733 + this) merged: Tests/ CS86xx from 98 raw (49 distinct)
to 0. Slice A (6 raw CS0108/CS0219) + Slice B (20 raw CS8618) + Slice C (32 distinct CS86xx) = the
full 98-raw baseline. The #715 drift (CS8603, 96→98) closed at C-2.

Base 240511c. 0 Cards/ write, 0 rendering code change.

Dispatch x0ykyn (PRIMARY, Slice C-final — Slice C complete). Base 240511c.

Co-authored-by: Your <your.email@example.com>
Co-authored-by: Claude-Code <noreply@anthropic.com>
Sign up for free to 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.

1 participant