Repository navigation
fix(contract): catch badge-form language counts, correct the README badge - #1863
Merged
Merged
Conversation
…adge The language-count contract shipped this morning in #1859 had a hole: it matched only the prose form "<N> languages", so README's shields badge ("languages-158-orange") never matched and the gate reported success while the badge sat three behind the prose in the same file. The cause is worth recording. The surfaces were enumerated with the same regex the gate then used, so the verification could only ever confirm what the enumeration had already seen. A gate and its own completeness check must not share a pattern. Both claim forms are now matched, in the per-surface check and in the unregistered-file sweep, so a new file stating a count in either form still fails. README's badge is corrected to 161. Also corrects a stale range comment left by the PL/SQL merge: matrix B's header said "CBMLanguage 80..163" when PL/SQL had made it 164. That is the comment variant of the additive-counter trap — the numeric constants were audited across that rebase, the prose describing them was not. The two sibling range descriptors (GO..ARKTS = 68 rows, RACKET..PLSQL = 47 rows) were checked and are correct. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
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 free
to 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.
Follow-up to #1859, which shipped a language-count contract with a hole in it.
The hole
The contract matched only the prose form
<N> languages. README's shields badge is writtenlanguages-158-orange— the number comes before the word — so it never matched. The gate reported success while the badge in the README displayed 158 against prose saying 161, in the same file.Why it was missed is the part worth recording. The seven surfaces were enumerated with
git grep -IlE '[0-9]{2,3} languages'— and then the gate was built on that same pattern. A verification that shares its regex with the thing it verifies can only ever confirm what the enumeration already saw. The badge was invisible to both steps for the same reason, so "7 surfaces, all agree" was true and useless.Found because a review of #1179 (VB.NET) checked main independently rather than trusting the green gate.
The fix
Both claim forms are matched now, in the per-surface check and in the unregistered-file sweep, so a new file stating a count in either form still fails. Verified in both directions: with the widened pattern the gate immediately fails on the un-corrected badge, and passes once corrected.
The README badge is corrected to 161.
Also: a stale comment from the PL/SQL merge
tests/repro/repro_call_argument_matrix_b.c:2described the matrix asCBMLanguage 80..163; PL/SQL had made it 164.That is the comment variant of the additive-counter trap. When PL/SQL was rebased across ArkTS, every numeric constant was audited for silent additive merges — one had genuinely merged clean and wrong (
EXPECTED_CALL_CAPABLE_LANGUAGES, 111 base, both sides 112, truth 113). The prose describing those constants was not audited, and it drifted the same way.The two sibling range descriptors were checked and are correct:
GO..ARKTS ... exactly 68 language rowsandRACKET..PLSQL ... exactly 47.Scope
Three files, +12/−4. No behaviour change outside the contract script — the C edit is a comment.