Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

Commit 7bf133d

Browse files
baozhoutaoclaude
andauthored
test(i18n-gate): pin the factory half's abstention counters on main, as the hand-rolled half already is (#8605)
`scripts/check-i18n-call-site-keys.mjs` keeps two parallel halves of one class — the factory walk (objectui#7567) and the declared hand-rolled registry (objectui#7877) — with parallel counters. Their MAIN-LINE pin cases in `scripts/__tests__/check-i18n-call-site-keys.test.ts` were not parallel. 'and main is measured, not merely green' pins all four of the hand-rolled abstentions including `handRolledMatchingRows === handRolledComparedRows`. 'main carries no factory drift, over a surface big enough for that to mean something' pinned two of four — `factoryUnreadableTables` and `factoryUnreadableRows` — and neither `factoryRowsNoEnKey`, `factoryUnjudgedRows`, nor the matching/compared equality. That is the wrong half to leave unpinned: the factory half takes its population from the SOURCE, so it absorbs a new table without anybody choosing to. `factoryRowsNoEnKey` went 5 to 0 when objectui#7887 retired the `timeline.relative.*` rows and nothing in this repository failed, because the only carriers of that number were comments. The three missing lines are now mirrored into the factory case. Measured on this tree before pinning (`analyze(repoRoot)`, the same call the case reads): factoryTables 32, factorySites 32, factoryRows 846, factoryComparedRows 846, factoryMatchingRows 846, factoryRowsNoEnKey 0, factoryUnjudgedRows 0, factoryUnreadableTables 0, factoryUnreadableRows 0 — so all three read clean and no observed non-zero was pinned to make anything green. The existing `factoryTables > 25` and `factoryComparedRows > 500` lower bounds are kept unchanged: without them a zero degrades from a reading into "the scan found nothing". No threshold lowered, no assertion removed, no test skipped. Note for a future reader: `factoryRowsNoEnKey` and `factoryUnjudgedRows` are also asserted `.toBe(1)` further up the same file, by two SYNTHETIC fixture cases. Those prove the counters can move; they are not a reading on main. A grep that only asks whether the symbol is ever expected somewhere conflates the two. Fixes #8423 Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr Co-authored-by: Claude <noreply@anthropic.com>
1 parent 5cc8c28 commit 7bf133d

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
---
3+
4+
Pin the i18n call-site gate's factory abstention counters on `main`
5+
(objectui#8423). The factory half of `scripts/check-i18n-call-site-keys.mjs`
6+
prints `factoryRowsNoEnKey`, `factoryUnjudgedRows` and its matching/compared
7+
pair on every run and held none of them to anything, so `factoryRowsNoEnKey`
8+
moved 5 to 0 when objectui#7887 retired the `timeline.relative.*` rows and
9+
nothing failed. The main-line case now mirrors the three lines the hand-rolled
10+
half already pins, keeping the existing `factoryTables > 25` and
11+
`factoryComparedRows > 500` lower bounds so the zeros stay readings rather than
12+
"the scan found nothing". Test only; no package is released by this change.

‎scripts/__tests__/check-i18n-call-site-keys.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,6 +1502,23 @@ export const useBTranslation = createSafeTranslation({ ...ELSEWHERE }, 'common.s
15021502
// should never grow unnoticed.
15031503
expect(counters.factoryUnreadableTables).toBe(0);
15041504
expect(counters.factoryUnreadableRows).toBe(0);
1505+
// objectui#8423 — the abstention lines the hand-rolled half already pins in
1506+
// 'and main is measured, not merely green', mirrored onto the half that
1507+
// actually moves. This half takes its population from the SOURCE, so it
1508+
// absorbs a new table without anybody choosing to: when objectui#7887
1509+
// retired the `timeline.relative.*` rows, `factoryRowsNoEnKey` went 5 to 0
1510+
// and nothing in this repository failed, because the only carriers of that
1511+
// number were comments. Zero is a READING here only because the two lower
1512+
// bounds above say the scan had something to judge — measured on this tree,
1513+
// 32 tables and 846 rows compared, 846 of them matching. ⛔ Do not read the
1514+
// `.toBe(1)` assertions on these two counters further up this file as this
1515+
// pin: those are synthetic fixtures ('leaves a key en does not define to
1516+
// class 1' and 'counts rather than judges a plural family'), they prove the
1517+
// counters CAN move, and a grep that only asks whether the symbol is ever
1518+
// expected somewhere confuses them with a reading taken on main.
1519+
expect(counters.factoryRowsNoEnKey).toBe(0);
1520+
expect(counters.factoryUnjudgedRows).toBe(0);
1521+
expect(counters.factoryMatchingRows).toBe(counters.factoryComparedRows);
15051522
});
15061523

15071524
it('the factory-name set is the one the objectui#3512 test uses, not a second opinion', () => {

0 commit comments

Comments
 (0)