fix(valid-detection-benchmark): normalize mixed-case .git suffixes in reservation identity

A reference such as OWNER/REPO.GIT escaped the reserved-identity check at both reservation sites because the suffix was stripped case-sensitively. One shared strip now handles the suffix case-insensitively; identities without a mixed-case suffix are byte-identical.
This commit is contained in:
Marius Ciepluch
2026-11-23 11:40:09 +01:00
parent f2093a5380
commit 7e6da2efae
4 changed files with 118 additions and 2 deletions
+2 -1
View File
@@ -23,6 +23,7 @@ from benchmarks.valid.reservation import (
census_bytes,
)
from benchmarks.valid.reservation_guard_sources import PINNED_LEGACY_RESERVATION_SOURCE_DIGESTS
from benchmarks.valid.reservation_identity import strip_git_suffix
from openultrasast.core.canonical import JsonValue, content_digest
GUARD_REPORT_SCHEMA = "openultrasast.valid-detection-benchmark.reservation-guard.v1"
@@ -175,7 +176,7 @@ def _historical_paths(root: Path, withdrawal: HistoricalWithdrawalV1 | None) ->
def _repository_matches(content: bytes) -> tuple[str, ...]:
values = {match.group(1).decode("ascii").removesuffix(".git") for match in _REPOSITORY.finditer(content)}
values = {strip_git_suffix(match.group(1).decode("ascii")) for match in _REPOSITORY.finditer(content)}
return tuple(sorted(f"https://github.com/{value}" for value in values))