From 54032c4b5ce36c9bfb8c6340809cf07a623e8ca5 Mon Sep 17 00:00:00 2001 From: Leo Date: Sun, 1 Nov 2026 01:44:49 +0800 Subject: [PATCH] docs(testing): the scripts' pure halves, and why they moved out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three gates are scripts, and a script that runs at import time cannot be tested. This session moved the decision out of three of them; the table records which, and what each test holds: - `generate-go-limits.ts` → `scripts/go-limits-html.ts`: which table is an allowance (by header, not position), the refusal when the page carries none, and the round trip through the real parser; - `check-vendor-version.ts` → `scripts/vendor-version.ts`: the constant is found, and "read nothing" is distinguishable from "passed"; - `publish-scoped.ts` → `scripts/wrapper-forwarder.ts`: the retired alias's entry LINKS against the built barrel in a real Node process. Two of the three had already passed while wrong — the version gate twice, and the Go-limits reader when the docs moved to HTML — which is the argument: **a decision that lives in a top-level-await script is exercised only by the vendor's schedule.** It is the same pattern the `utils/` gate enforces inside `src/`, applied to the one place it had not reached. --- docs/testing.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/testing.md b/docs/testing.md index c885797..c9d8c37 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -48,6 +48,18 @@ Two entry points: **A model with no price in a fixture is PAID at a nominal rate, not free.** The parser derives `is_free` from a zero cost, so a "no price" default would silently turn every fixture model into a free tier. +## The scripts' pure halves + +A gate is a script, and a script that runs at import time cannot be tested — so its decisions move out of it: + +| script | the decision, extracted | what the test holds | +| :-- | :-- | :-- | +| `generate-go-limits.ts` | `scripts/go-limits-html.ts` | which table is an allowance (by header, not position), the refusal when the page carries none, and the round trip through the real parser | +| `check-vendor-version.ts` | `scripts/vendor-version.ts` | the constant is found, and "read nothing" is distinguishable from "passed" | +| `publish-scoped.ts` | `scripts/wrapper-forwarder.ts` | the retired alias's entry LINKS against the built barrel in a real Node process | + +The pattern is the same one the `utils/` gate enforces inside `src/`, applied to the one place it had not reached: **a decision that lives in a top-level-await script is exercised only by the vendor's schedule**. Two of the three above had already passed while wrong — the version gate twice, the Go-limits reader when the docs moved to HTML. + ## Two habits ### Plant the violation