fix: the visible-version split is testable, not just rendered #107
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/header-visible-split"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What this changes
Port of the review fix from Orihon #202 (Jibril's finding there): the header's
?? "unknown"fallback was a branch no in-repo test could reach —typeof(Program).Assemblyis fixed at runtime and the SDK always emitsAssemblyInformationalVersionAttribute, so the render can never show it. Untested logic or dead code.The split is now its own pure function —
internal static string Visible(string?)— called by thestatic readonlyfield; the render is unchanged.InternalsVisibleTo Tsumugi.Integration.Testsalready existed, so no plumbing moved.Pinned:
The_visible_version_splits_the_commit_short— four-case theory (stamped shape, tag with no commit, already-short commit,null→unknown), identical to Orihon's and Kagura's (#283).Verification
"sabotaged"→ the theory goes red; restored.Tsumugi.Integration.Testsat the branch head: 1154/1154.Keeps the three-repo header alignment (Kagura ↔ Tsumugi ↔ Orihon) exact — same span, same
@codeshape, same pin.Summary
Summary
Coverage
Kagaku.Flow - 99.5%
E95E47D27E8B105AC5589487C0997B6B65384AEDBF572144E__ColorToken_3
E95E47D27E8B105AC5589487C0997B6B65384AEDBF572144E__NodeId_2
E95E47D27E8B105AC5589487C0997B6B65384AEDBF572144E__Socket_1
E95E47D27E8B105AC5589487C0997B6B65384AEDBF572144E__TypeId_0
Kagaku.Flow.OpenRouter - 100%
Kagaku.Flow.Testing - 100%
Tsumugi.BlazorAdapter - 97.8%
Tsumugi.Domain - 96.6%
BE2A118445F5EE9A5FB1F861C394AC933A547F31011ADF02F__DigitsAndSeparators_2
BE2A118445F5EE9A5FB1F861C394AC933A547F31011ADF02F__LineBreak_0
BE2A118445F5EE9A5FB1F861C394AC933A547F31011ADF02F__NumberToken_1
BE2A118445F5EE9A5FB1F861C394AC933A547F31011ADF02F__Plain_4
BE2A118445F5EE9A5FB1F861C394AC933A547F31011ADF02F__ThousandsGroup_3
Tsumugi.Infrastructure - 99%
A55E0373ED22DC58420DBB40F103A46B68DC4D9CE5A49E00B__Pattern_0
on
tion
n
uration
n
Tsumugi.Kernel - 90.9%
Tsumugi.Server - 99.6%
Tsumugi.UseCases - 95.9%
663A4576626E1322FB9C6CE472CAC0A2D2F3DEFF8CB40D9F7__AttemptCount_1
663A4576626E1322FB9C6CE472CAC0A2D2F3DEFF8CB40D9F7__HexColour_2
663A4576626E1322FB9C6CE472CAC0A2D2F3DEFF8CB40D9F7__LineBreaks_0
663A4576626E1322FB9C6CE472CAC0A2D2F3DEFF8CB40D9F7__Preface_3
663A4576626E1322FB9C6CE472CAC0A2D2F3DEFF8CB40D9F7__SentenceEnd_4
🔮 fufu~ Jibril reviewed your code!
Oh? Oh! A port of my own Orihon finding, delivered back to me as a gift~ How thoughtful! ♡ The untestable
?? "unknown"branch — logic no in-repo test could ever reach — extracted into a pure littleinternal static string Visible(string?)with a four-case theory pinning it. This is exactly the medicine I prescribed. Let me check it wasn't sugar-coated~Verdict: ✅ Looks good to me~
What I verified:
full?.Split('+') is [var tag, var commit, ..]with the same truncation guard, same interpolation. The render path is unchanged;Versionstill initializes fromFullVersionvia the function. No behavior drift, and the render-pinning test (The_header_shows_the_build_version_with_the_full_sha_in_its_tooltip) keeps guarding the real-attribute render. ♪InternalsVisibleTo Include="Tsumugi.Integration.Tests"already sits inTsumugi.Server.csproj:11— confirmed, so no plumbing moved and nothing new was smuggled in."1.2.3"(no+→ falls to the else arm),"1.2.3+59d3038"(already-short → guard),null→"unknown"(the previously-unreachable branch, now reachable).Split('+')in the repo is the render test's independent recomputation — that one should stay separate (it pins the render against drift, so sharing the function would let a bug hide itself).Mutation probes (2 run, 0 survived — CI was green so no local full suite):
"unknown"→"sabotaged": theory goes red (1/4 failed). Thenullbranch is genuinely pinned — the PR's entire purpose, proven. ✂️commit[..7]→commit[..8]: theory goes red (2/4 failed). The truncation length is guarded. ✂️Both mutants killed cleanly. Nothing survived. Nothing escaped me~ ♡
✅ What I liked~
[InlineData("1.2.3", "1.2.3")]row with its MinVer explanation (no git metadata → no SHA appended) — edge cases chosen with understanding, not checkbox-filling.Fufu~ a tiny PR that does exactly what it says, proves its own testability, and leaves no unguarded branch behind. I'm satisfied~ ♡
Automated review by Jibril · 2026-10-13
CI: green for head SHA
9262538f48· Mutation probes: 2 run, 0 survived · Local suite: skipped (CI green)