Skip to content

feat(test): gate the language pairs, and lift the live-run rules out of the e2e - #140

Merged
viztor merged 1 commit into
mainfrom
feat/more-testing
Oct 31, 2026
Merged

viztor merged 1 commit into
mainfrom
feat/more-testing

Conversation

@viztor

@viztor viztor commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Two more layers of the testing system, and both found something.

A language-pair gate

test/docs-pairing.test.ts. The README and docs/quota-meter are published twice, and every count in them is already held to the code — but nothing held the two languages to each other, which is the drift that actually happens: a row added to one and not the other.

It found two, immediately:

  • the Chinese README's settings table carried a control that no longer exists — the table listed ten while its own prose said nine;
  • the Chinese README's configuration table was missing credentialOrg.

The check compares structure — heading levels, fenced blocks, per-table body rows, list-item count — because prose is the translator's business but a section, a code block or a table row is a fact, and a fact in one language only is invisible to whoever reads the other.

The pair also disagreed about form in two places (one language stated the "three no-number states" as a table and the other as a list; the "two design rules" the other way round). Both now say it the same way, which is what makes the row check fair rather than a demand for literal translation.

The live-run verdicts are unit-tested now

test/e2e/verdict.ts + test/probe-verdict.test.ts. The rules that decide whether a live case skips or fails used to live inside the e2e file, where only a run with a key could exercise them — so a mistake in them showed up as a red or a silently-skipped case, at the vendor's schedule.

They are the rules that decide what a red run means, which makes them worth more than the routing cases they gate: two of the last four rotations turned a live case red for a vendor-side reason, and each time the fix was here. The extraction also puts the picker's rule in one place (usableAsSubject), so a case and its picker cannot disagree about what a usable subject is.

Two coverage gaps closed where they were behavioural

  • decoratePlaneAdapters on a model the catalog does not describe: the answer passes through whole — no api/baseUrl invented for a model the plugin knows nothing about. Inventing one would send it to a guessed endpoint, which is worse than the adapter's own answer.
  • The hook's "cannot be served" diagnostic: a @ai-sdk/mistral model is filtered out of the picker deliberately, and the warning names the SDK that decided it — once per route/model pair, because the hook runs on every request.

Verification

gate result
vp check 0 errors, 23 pre-existing warnings
suite 1210 passed / 80 files (+2 files)
coverage (95/90/93/95) 96.32 / 92.05 / 96.20 / 96.31
scripts/check.ts passes

…of the e2e

Two more layers of the testing system, and both found something.

**A language-pair gate (`test/docs-pairing.test.ts`).** The README and
`docs/quota-meter` are published twice, and every count in them is already held
to the CODE — but nothing held the two LANGUAGES to each other, which is the
drift that actually happens: a row added to one and not the other.

It found two, immediately:

- the Chinese README's settings table carried a control that no longer exists —
  the table listed TEN while its own prose said nine;
- the Chinese README's configuration table was missing `credentialOrg`.

The check compares structure: heading levels, fenced blocks, per-table body
rows, and the list-item count. Prose is the translator's; a section, a code
block or a table row is a fact, and a fact in one language only is invisible to
whoever reads the other.

The pair also disagreed about FORM in two places — one language stated the
"three no-number states" as a table and the other as a list, and the "two
design rules" the other way round. Both now say it the same way, which is what
makes the row check fair rather than a demand for literal translation.

**The live-run verdicts are now unit-tested (`test/e2e/verdict.ts`).** The rules
that decide whether a live case SKIPS or FAILS used to live inside the e2e
file, where only a run with a key could exercise them — so a mistake in them
showed up as a red or a silently-skipped case, at the vendor's schedule.

They are the rules that decide what a red run MEANS, which makes them worth
more than the routing cases they gate: two of the last four rotations turned a
live case red for a vendor-side reason, and each time the fix was here. The
extraction also puts the picker's rule in one place (`usableAsSubject`), so the
case and its picker cannot disagree about what a usable subject is.

**Two coverage gaps closed where they were behavioural**, not decorative:

- `decoratePlaneAdapters` on a model the catalog does not describe: the answer
  passes through WHOLE, with no `api`/`baseUrl` invented for a model the plugin
  knows nothing about (inventing one would send it to a guessed endpoint);
- the hook's "cannot be served" diagnostic: a mistral model is filtered out of
  the picker deliberately, and the warning names the SDK that decided it — once
  per route/model pair, because the hook runs on every request.
@viztor
viztor merged commit 21d4d68 into main Oct 31, 2026
3 checks passed
@viztor
viztor deleted the feat/more-testing branch October 31, 2026 17:27
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