Skip to content

fix(contract): catch badge-form language counts, correct the README badge - #1863

Merged
DeusData merged 1 commit into
mainfrom
fix/language-count-badge-gap
Aug 27, 2026
Merged

DeusData merged 1 commit into
mainfrom
fix/language-count-badge-gap

Conversation

@DeusData

Copy link
Copy Markdown
Owner

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 written languages-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:2 described the matrix as CBMLanguage 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 rows and RACKET..PLSQL ... exactly 47.

Scope

Three files, +12/−4. No behaviour change outside the contract script — the C edit is a comment.

…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>
@DeusData
DeusData merged commit e65ace1 into main Aug 27, 2026
34 checks passed
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