Skip to content

Commit 6639bae

Browse files
committed
fix(contract): catch badge-form language counts, correct the README badge
The language-count contract shipped this morning in DeusData#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>
1 parent f452da3 commit 6639bae

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
55
[![CI](https://img.shields.io/github/actions/workflow/status/DeusData/codebase-memory-mcp/dry-run.yml?label=CI)](https://github.com/DeusData/codebase-memory-mcp/actions/workflows/dry-run.yml)
66
[![Tests](https://img.shields.io/badge/tests-6768_passing-brightgreen)](https://github.com/DeusData/codebase-memory-mcp)
7-
[![Languages](https://img.shields.io/badge/languages-158-orange)](https://github.com/DeusData/codebase-memory-mcp)
7+
[![Languages](https://img.shields.io/badge/languages-161-orange)](https://github.com/DeusData/codebase-memory-mcp)
88
[![Hybrid LSP](https://img.shields.io/badge/Hybrid_LSP-10_languages-blue)](#hybrid-lsp)
99
[![Agents](https://img.shields.io/badge/agent_surfaces-43-purple)](https://github.com/DeusData/codebase-memory-mcp)
1010
[![Pure C](https://img.shields.io/badge/pure_C-no_language_runtime-blue)](https://github.com/DeusData/codebase-memory-mcp)

‎tests/repro/repro_call_argument_matrix_b.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Exhaustive call-argument reproduction matrix, CBMLanguage 80..163.
2+
* Exhaustive call-argument reproduction matrix, CBMLanguage 80..164.
33
*
44
* Every language in this numeric range whose live spec has call-node metadata
55
* owns one TEST row below. Semantic applications are exercised twice: once as

‎tests/test_language_count_contract.sh‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,15 @@ for path in "${SURFACES[@]}"; do
8181
failures=$((failures + 1))
8282
continue
8383
fi
84-
hits=$(grep -oE '[0-9]{2,3} languages' "$path" | grep -oE '^[0-9]+' | sort -u || true)
84+
# Two claim forms. Prose says "<N> languages"; a shields.io badge says
85+
# "languages-<N>-colour". The badge was MISSED by the first version of this
86+
# contract: it gated only the prose form, so README's badge sat three behind
87+
# the prose in the same file while this test reported success. The lesson is
88+
# that the enumeration and the gate must not share a regex — if they do, the
89+
# gate can only ever confirm what the enumeration already saw.
90+
hits=$( { grep -oE '[0-9]{2,3} languages' "$path" | grep -oE '^[0-9]+'
91+
grep -oiE 'languages-[0-9]{2,3}' "$path" | grep -oE '[0-9]+$'
92+
} | sort -u || true)
8593
if [[ -z "$hits" ]]; then
8694
echo "FAIL: $path is registered as a language-count surface but states no" \
8795
"count — either it lost the claim (drop it from SURFACES) or the" \
@@ -113,7 +121,7 @@ while IFS= read -r path; do
113121
"SURFACES so it stays in step with the registry, or to EXEMPT with a" \
114122
"note saying what its number actually counts." >&2
115123
failures=$((failures + 1))
116-
done < <(git grep -IlE '[0-9]{2,3} languages' || true)
124+
done < <(git grep -IlE '[0-9]{2,3} languages|languages-[0-9]{2,3}' || true)
117125

118126
if ((failures > 0)); then
119127
echo "FAIL: $failures language-count contract violation(s)" >&2

0 commit comments

Comments
 (0)