Compare commits

...
Author SHA1 Message Date
poli0981andClaude Opus 5.5 69b380fc1e test(infra): the build-id mismatch check uses another id of the same length, not one longer than the field (beta.14)
ShmHandshakeValidatorTests.TheGuardReportsThisInstallsBuildId appended "x" to this install's build id and expected a
mismatch. The handshake's buildId holds 31 characters plus NUL, and the helper cuts at 31: once `git describe` is 31
characters long - ten commits after a tag, v0.1.0-beta.13-10-g15ec7c1c5fd4 in a local gate on 2026-10-06 - the cut id
equals the real one and the check read Ok. It passed for the first nine commits after every tag and failed from the
tenth, locally and on CI alike.

The mismatch is now another id of the same length (the last character changed), which can never be cut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 02:29:54 +07:00
@@ -186,6 +186,11 @@ public sealed class ShmHandshakeValidatorTests
// And it must actually work as the comparison input, not merely be non-empty.
ShmHandshakeValidator.Validate(Handshake(id), id, _mapped).Should().Be(ShmAttachRefusal.Ok);
ShmHandshakeValidator.Validate(Handshake(id + "x"), id, _mapped).Should().Be(ShmAttachRefusal.BuildIdMismatch);
// Another id of the SAME length. An appended character is cut at 31 and compares equal once the id is 31 characters
// long — which `git describe` reaches ten commits after a tag (v0.1.0-beta.13-10-g15ec7c1c5fd4, a local gate on
// 2026-10-06) — so "id + x" passed for nine commits and then read as Ok.
string other = id[..^1] + (id[^1] == 'x' ? 'y' : 'x');
ShmHandshakeValidator.Validate(Handshake(other), id, _mapped).Should().Be(ShmAttachRefusal.BuildIdMismatch);
}
}