Skip to content

Commit ad54eb3

Browse files
claude[bot]claude
andauthored
feat(tooling): onboard packages/plugins/** into check:test-typecheck (#14062) (#14420)
* feat(tooling): onboard packages/plugins/** into check:test-typecheck (#14062) All 14 `packages/plugins/**` packages now have a `tsconfig.test.json` compiled by the shared `check:test-typecheck` gate, with the four that measure non-zero carrying a generated, EXACT, shrink-only starting ledger. Before this the ratchet said nothing about a third of the repo's runtime surface: 14 packages, 1 `tsconfig.test.json`, 0 `check:test-typecheck` scripts. Measured at e808890, workspace closure built first — plugin-approvals 324 errors over 8 files (345 under build semantics; the 21 difference is the config tier), plugin-auth 94 over 10, plugin-sharing 3 over 2, knowledge-ragflow 3 over 1, and zero for the other ten. No test file is edited: opening the ratchet is not the same job as paying it down. Onboarded as a family by the director ruling of 2026-09-01 on #14062, which carries the #5286 maintainer authority for the starting ledgers. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV * feat(tooling): retire the graduated per-package debt entries and re-baseline the source-resolution registry (#14062) `check:type-check-coverage` — plugin-approvals (345), plugin-auth (94) and plugin-sharing (3) leave TEST_DEBT, and knowledge-ragflow (4) leaves DEBT. None was paid down: the same errors are now held one level finer, per file and per signature, in each package's own `test-typecheck-debt.json`. That is the graduation the gate's own message asks for. `check:type-source-resolution` — the thirteen new `tsconfig.test.json` move the program set, which #11490 made a package's prerogative. Re-baselined on the registry's documented onboarding limb: every dep admitted is annotated `via tsconfig.test.json`, and the before/after numbers are stated in place (96 -> 109 programs, 54 -> 55 entries, 242 -> 269 pairs). `knowledge-ragflow` additionally splits its build config, because `check:type-check-coverage` refuses a `typecheck` that never invokes tsc and the package had no `typecheck` script at all before this card. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV * docs(tooling): state the source-resolution re-baseline against this branch's merge base (#14062) The absolute program totals moved under the branch because #13284 landed two `tsconfig.typecheck.json` on main in between; the delta this change is responsible for (+13 programs, +1 entry, +27 pairs) did not. Both readings are recorded so the number in the file matches what `--list` prints today. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WLJQhde67SeTccsmnBVarV --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 54a1125 commit ad54eb3

38 files changed

Lines changed: 1387 additions & 112 deletions
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
"@objectstack/embedder-openai": patch
3+
"@objectstack/knowledge-memory": patch
4+
"@objectstack/knowledge-ragflow": patch
5+
"@objectstack/plugin-approvals": patch
6+
"@objectstack/plugin-audit": patch
7+
"@objectstack/plugin-auth": patch
8+
"@objectstack/plugin-dev": patch
9+
"@objectstack/plugin-email": patch
10+
"@objectstack/plugin-hono-server": patch
11+
"@objectstack/plugin-pinyin-search": patch
12+
"@objectstack/plugin-reports": patch
13+
"@objectstack/plugin-security": patch
14+
"@objectstack/plugin-sharing": patch
15+
"@objectstack/plugin-webhooks": patch
16+
---
17+
18+
feat(tooling): onboard all 14 `packages/plugins/**` packages into `check:test-typecheck` (#14062)
19+
20+
Every plugin package now has a `tsconfig.test.json` compiled by the shared
21+
`check:test-typecheck` gate, and its `typecheck` script names it. Before this,
22+
the shrink-only `test-typecheck-debt.json` ratchet said **nothing** about a
23+
third of the repo's runtime surface: 14 packages, 1 `tsconfig.test.json`
24+
(`plugin-security`, wired directly to `tsc` rather than to the instrument), and
25+
0 `check:test-typecheck` scripts.
26+
27+
Onboarded as a family by the director ruling of 2026-09-01 on #14062
28+
(maintainer verbatim: 「同意」), which also carries the #5286 maintainer
29+
authority the starting ledgers need. The smaller branch triage recommended —
30+
declare the instrument's scope and re-site the two compile-time pins — was
31+
recorded as considered and not taken: an instrument silent over a third of the
32+
runtime surface is a hole readers generalise across, and that costs more than
33+
fourteen tsconfigs.
34+
35+
**Measured, not assumed** (at `e80889095`, workspace closure built first). Four
36+
packages carry residue and therefore a starting ledger — plugin-approvals 324
37+
over 8 files, plugin-auth 94 over 10, plugin-sharing 3 over 2,
38+
knowledge-ragflow 3 over 1. The other ten measure **zero** and deliberately get
39+
no ledger file at all: the gate reads a missing ledger as `{ entries: {} }`, so
40+
any error there is red immediately with no entry to be added to — strictly
41+
stronger than a ledger holding nothing, and the call `plugin-security` had
42+
already recorded for itself.
43+
44+
**This does not repair 345 type errors.** Per ruling item 3 it makes the
45+
ratchet able to *see* them; paydown follows the ratchet's own shrink-only
46+
discipline on its own cards. No test file is edited here.
47+
48+
Two corrections to the finding's own prose, both measured: the exclusion is
49+
narrower than "no plugin package compiles its tests" — 9 of the 14 already
50+
compiled their tests inside the `typecheck`-invoked build config, at zero
51+
errors — and `exec-context-annotation.pin.ts` is a `.pin.ts`, which
52+
`**/*.test.ts` never excluded, so its directives were already live. The pin
53+
this change genuinely makes real is
54+
`plugin-approvals/src/manager-org-screen-parity.contract.test.ts`, which no tsc
55+
program had ever read.

packages/plugins/embedder-openai/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,15 @@
1616
"build": "tsup --config ../../../tsup.config.ts && node ../../../scripts/check-dts-emitted.mjs",
1717
"dev": "tsc -w",
1818
"test": "vitest run",
19-
"typecheck": "tsc --noEmit"
19+
"typecheck": "tsc --noEmit && pnpm check:test-typecheck",
20+
"check:test-typecheck": "tsx ../../../scripts/check-test-typecheck.mts --self-test && tsx ../../../scripts/check-test-typecheck.mts --package packages/plugins/embedder-openai --project tsconfig.test.json"
2021
},
2122
"dependencies": {
2223
"@objectstack/spec": "workspace:*"
2324
},
2425
"devDependencies": {
2526
"@types/node": "^26.2.0",
27+
"tsx": "^4.23.12",
2628
"typescript": "^6.0.3",
2729
"vitest": "^4.1.10"
2830
},
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// The TEST-layer type-check program (#14062 — the `packages/plugins/**` family
2+
// adopting the mechanism #5286 set for `packages/spec`, #5449 generalised,
3+
// #12542 carried to `packages/rest` and #13176 to `packages/plugins/
4+
// plugin-security`). `tsconfig.json` beside this one stays exactly as it is: it
5+
// is the BUILD config. This sibling puts the test layer in front of tsc under
6+
// the module semantics vitest really executes it with, and `package.json`'s
7+
// `typecheck` script NAMES it (via `check:test-typecheck --project`), because a
8+
// config no script invokes is exactly the phantom this whole change is about.
9+
//
10+
// The family was onboarded as a family by the director ruling of 2026-09-01 on
11+
// #14062 (maintainer verbatim: 「同意」), which also carries the #5286
12+
// maintainer authority for the starting ledgers. The reason it is a family and
13+
// not one package: the ledger's shrink-only guarantee said NOTHING about a
14+
// third of the repo's runtime surface, and a guarantee with a silent hole is
15+
// worse than a narrower one honestly drawn, because readers generalise it.
16+
//
17+
// What differs from the build config, and what deliberately does NOT:
18+
// - MODULE SEMANTICS ONLY, plus `lib`. The tests are written and executed as
19+
// ESM by vitest (esbuild/vite). Matching that is FIDELITY, not laxity: it is the
20+
// same subtraction `packages/spec`, `packages/rest` and `plugin-security`
21+
// each made, and it removes a config-tier error pile that says nothing
22+
// about the tests.
23+
// - ⛔ STRICTNESS IS UNTOUCHED. `strict`, `noUnusedLocals`,
24+
// `noUnusedParameters`, `noImplicitReturns`, `noFallthroughCasesInSwitch`,
25+
// `rootDir`, `paths` and `types` are all INHERITED from `tsconfig.json`
26+
// (and through it the root config), and none of them is re-declared here.
27+
// ⚠️ A child that declared its own `paths` would REPLACE the parent map
28+
// rather than merge into it, silently sending a source-resolved specifier
29+
// back to `dist/` — a BUILD ARTIFACT — so this file declares none.
30+
// Nothing here may loosen a type rule; if a test does not compile, that is
31+
// the finding.
32+
//
33+
// - `lib: ["ES2022"]`, for the same reason `packages/rest` states: the root
34+
// config's `lib` is ES2020 and vitest runs on a Node that has es2022
35+
// builtins, so the gap is reported as TS2550 about the CHECK. No `DOM`:
36+
// nothing in this layer touches a browser global.
37+
//
38+
// MEASURED at e80889095, workspace closure built first (`tsc --noEmit --pretty false
39+
// --listFiles -p tsconfig.test.json`, and the same command without `--listFiles`):
40+
//
41+
// files in this program 371
42+
// own `src/**/*.test.ts` in it 1
43+
// errors under BUILD semantics 0
44+
// errors under THIS config 0
45+
//
46+
// The two readings agree, so this package carried no config-tier pile at all.
47+
//
48+
// BEFORE THIS FILE: the build config does NOT exclude tests, so `tsc
49+
// --noEmit` already read this one file. This program is the family's
50+
// uniform instrument over the same file, not a new reader of it.
51+
//
52+
// There is NO `test-typecheck-debt.json` beside this config, and its ABSENCE is the
53+
// zero: `check:test-typecheck` reads a missing ledger as `{ entries: {} }`, under which
54+
// ANY error in ANY file here is red immediately, with no entry to be added to. That is
55+
// strictly stronger than a ledger holding nothing, and it is the same call
56+
// `plugin-security` recorded for itself in #13176. If this package ever acquires
57+
// residue that cannot be fixed in the PR that causes it, THAT is when a ledger and a
58+
// `gen:test-typecheck-debt` script are owed — and adding one is maintainer-only
59+
// (#5286), exactly as the gate says when it refuses.
60+
{
61+
"extends": "./tsconfig.json",
62+
"compilerOptions": {
63+
"noEmit": true,
64+
"module": "esnext",
65+
"moduleResolution": "bundler",
66+
"lib": ["ES2022"]
67+
},
68+
"include": ["src/**/*"],
69+
"exclude": ["node_modules", "dist"]
70+
}

packages/plugins/knowledge-memory/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"build": "tsup --config ../../../tsup.config.ts && node ../../../scripts/check-dts-emitted.mjs",
1717
"dev": "tsc -w",
1818
"test": "vitest run",
19-
"typecheck": "tsc --noEmit"
19+
"typecheck": "tsc --noEmit && pnpm check:test-typecheck",
20+
"check:test-typecheck": "tsx ../../../scripts/check-test-typecheck.mts --self-test && tsx ../../../scripts/check-test-typecheck.mts --package packages/plugins/knowledge-memory --project tsconfig.test.json"
2021
},
2122
"dependencies": {
2223
"@objectstack/core": "workspace:*",
@@ -25,6 +26,7 @@
2526
},
2627
"devDependencies": {
2728
"@types/node": "^26.2.0",
29+
"tsx": "^4.23.12",
2830
"typescript": "^6.0.3",
2931
"vitest": "^4.1.10"
3032
},
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// The TEST-layer type-check program (#14062 — the `packages/plugins/**` family
2+
// adopting the mechanism #5286 set for `packages/spec`, #5449 generalised,
3+
// #12542 carried to `packages/rest` and #13176 to `packages/plugins/
4+
// plugin-security`). `tsconfig.json` beside this one stays exactly as it is: it
5+
// is the BUILD config. This sibling puts the test layer in front of tsc under
6+
// the module semantics vitest really executes it with, and `package.json`'s
7+
// `typecheck` script NAMES it (via `check:test-typecheck --project`), because a
8+
// config no script invokes is exactly the phantom this whole change is about.
9+
//
10+
// The family was onboarded as a family by the director ruling of 2026-09-01 on
11+
// #14062 (maintainer verbatim: 「同意」), which also carries the #5286
12+
// maintainer authority for the starting ledgers. The reason it is a family and
13+
// not one package: the ledger's shrink-only guarantee said NOTHING about a
14+
// third of the repo's runtime surface, and a guarantee with a silent hole is
15+
// worse than a narrower one honestly drawn, because readers generalise it.
16+
//
17+
// What differs from the build config, and what deliberately does NOT:
18+
// - MODULE SEMANTICS ONLY, plus `lib`. The tests are written and executed as
19+
// ESM by vitest (esbuild/vite). Matching that is FIDELITY, not laxity: it is the
20+
// same subtraction `packages/spec`, `packages/rest` and `plugin-security`
21+
// each made, and it removes a config-tier error pile that says nothing
22+
// about the tests.
23+
// - ⛔ STRICTNESS IS UNTOUCHED. `strict`, `noUnusedLocals`,
24+
// `noUnusedParameters`, `noImplicitReturns`, `noFallthroughCasesInSwitch`,
25+
// `rootDir`, `paths` and `types` are all INHERITED from `tsconfig.json`
26+
// (and through it the root config), and none of them is re-declared here.
27+
// ⚠️ A child that declared its own `paths` would REPLACE the parent map
28+
// rather than merge into it, silently sending a source-resolved specifier
29+
// back to `dist/` — a BUILD ARTIFACT — so this file declares none.
30+
// Nothing here may loosen a type rule; if a test does not compile, that is
31+
// the finding.
32+
//
33+
// - `lib: ["ES2022"]`, for the same reason `packages/rest` states: the root
34+
// config's `lib` is ES2020 and vitest runs on a Node that has es2022
35+
// builtins, so the gap is reported as TS2550 about the CHECK. No `DOM`:
36+
// nothing in this layer touches a browser global.
37+
//
38+
// MEASURED at e80889095, workspace closure built first (`tsc --noEmit --pretty false
39+
// --listFiles -p tsconfig.test.json`, and the same command without `--listFiles`):
40+
//
41+
// files in this program 388
42+
// own `src/**/*.test.ts` in it 1
43+
// errors under BUILD semantics 0
44+
// errors under THIS config 0
45+
//
46+
// The two readings agree, so this package carried no config-tier pile at all.
47+
//
48+
// BEFORE THIS FILE: the build config does NOT exclude tests, so `tsc
49+
// --noEmit` already read this one file. This program is the family's
50+
// uniform instrument over the same file, not a new reader of it.
51+
//
52+
// There is NO `test-typecheck-debt.json` beside this config, and its ABSENCE is the
53+
// zero: `check:test-typecheck` reads a missing ledger as `{ entries: {} }`, under which
54+
// ANY error in ANY file here is red immediately, with no entry to be added to. That is
55+
// strictly stronger than a ledger holding nothing, and it is the same call
56+
// `plugin-security` recorded for itself in #13176. If this package ever acquires
57+
// residue that cannot be fixed in the PR that causes it, THAT is when a ledger and a
58+
// `gen:test-typecheck-debt` script are owed — and adding one is maintainer-only
59+
// (#5286), exactly as the gate says when it refuses.
60+
{
61+
"extends": "./tsconfig.json",
62+
"compilerOptions": {
63+
"noEmit": true,
64+
"module": "esnext",
65+
"moduleResolution": "bundler",
66+
"lib": ["ES2022"]
67+
},
68+
"include": ["src/**/*"],
69+
"exclude": ["node_modules", "dist"]
70+
}

packages/plugins/knowledge-ragflow/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
"scripts": {
1616
"build": "tsup --config ../../../tsup.config.ts && node ../../../scripts/check-dts-emitted.mjs",
1717
"dev": "tsc -w",
18-
"test": "vitest run"
18+
"test": "vitest run",
19+
"typecheck": "tsc --noEmit && pnpm check:test-typecheck",
20+
"check:test-typecheck": "tsx ../../../scripts/check-test-typecheck.mts --self-test && tsx ../../../scripts/check-test-typecheck.mts --package packages/plugins/knowledge-ragflow --project tsconfig.test.json",
21+
"gen:test-typecheck-debt": "tsx ../../../scripts/check-test-typecheck.mts --update --package packages/plugins/knowledge-ragflow --project tsconfig.test.json"
1922
},
2023
"dependencies": {
2124
"@objectstack/core": "workspace:*",
@@ -24,6 +27,7 @@
2427
},
2528
"devDependencies": {
2629
"@types/node": "^26.2.0",
30+
"tsx": "^4.23.12",
2731
"typescript": "^6.0.3",
2832
"vitest": "^4.1.10"
2933
},
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"_comment": "Per-file tsc error debt of the @objectstack/knowledge-ragflow TEST layer (#5286). `tsconfig.test.json` compiles `src/**/*.test.ts` — which `tsconfig.json` excludes and therefore no gate ever read — and every file below still carries errors from before that gate existed. THIS FIELD IS GENERATED: every regeneration rewrites it from scripts/check-test-typecheck.mts, and the EXACT ratchet below requires a regeneration on every repair — so an edit made here is gone by the next one. Anything true of THIS package goes in the sibling `_note` field, which is authored, is preserved verbatim, and is never written by the generator (#12624). This comment states NO cause for the errors, deliberately: the classes differ per package and per file, they move as the debt is paid down, and a cause written here is rewritten verbatim into every ledger by every regeneration — so it outlives its own repair and cannot be corrected in the file where it is read. Measure instead, before repairing anything: `tsc --noEmit --pretty false -p tsconfig.test.json` in the package prints the real classes with their TS codes. Each entry maps a file to its per-SIGNATURE error counts, never to a bare total (#13470): a signature is the TS code plus the diagnostic message with structural type blobs collapsed, and it carries NO line or column — so the pin survives edits that move code around, and only stops matching when the error itself becomes a different error. EXACT ratchet, judged by re-running tsc: a file that gains errors is red, a file that loses them is red until its number is re-recorded, a file that reaches zero is red until its entry is deleted, a signature that ARRIVES or VANISHES is red even when the file total is unchanged, and a file NOT listed here may have no errors at all. Regenerate with: pnpm --filter @objectstack/knowledge-ragflow gen:test-typecheck-debt",
3+
"_note": "STARTING LEDGER, opened by #14062 under the director ruling of 2026-09-01 (maintainer verbatim: 「同意」), which carries the #5286 maintainer authority for it. 3 errors in 1 file, all PRE-EXISTING — and this package was silent for a DIFFERENT reason than its siblings: its `tsconfig.json` never excluded tests, so a tsc program would have read them, but the package declared NO `typecheck` script at all, and `turbo run typecheck` cannot run a script that does not exist. #14062 added one naming this gate. ⛔ That is not the repo-wide 'packages missing a `typecheck` script' carry-over, which the same ruling holds separate (item 5): this is the one invocation path #14062's own instrument needs in order to run here at all.",
4+
"entries": {
5+
"src/__tests__/ragflow-adapter.test.ts": {
6+
"TS2353: Object literal may only specify known properties, and 'options' does not exist in type '…'.": 3
7+
}
8+
}
9+
}

packages/plugins/knowledge-ragflow/tsconfig.json

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,24 @@
1616
"rootDir": "./src"
1717
},
1818
"include": ["src/**/*"],
19-
"exclude": ["node_modules", "dist"]
19+
// [#14062] `**/*.test.ts` moved OUT of this program and INTO the sibling
20+
// `tsconfig.test.json`, which `typecheck` names via `check:test-typecheck`.
21+
// Read the direction carefully — this is not a package hiding its tests:
22+
//
23+
// This package declared NO `typecheck` script at all until #14062, so the
24+
// fact that its tests were inside the BUILD program bought nothing; no tsc
25+
// program was ever RUN over them, and the 3 errors they carry sat there
26+
// unseen. Adding the script is what makes the program real, and it must
27+
// invoke tsc (`check:type-check-coverage` refuses a `typecheck` that never
28+
// type-checks). With the tests still here, that first limb would be red on
29+
// arrival at debt this card is explicitly NOT chartered to repair — the
30+
// ruling of 2026-09-01 says the job is to let the ratchet SEE the errors, and
31+
// that repair follows the ratchet's own shrink-only discipline afterwards.
32+
//
33+
// So the split is the family's shape, not an exemption: `tsc --noEmit` here
34+
// judges the shipped source, and every test file is judged one command later
35+
// by `check:test-typecheck` against an EXACT, shrink-only per-signature
36+
// ledger. Nothing stops being compiled; the two halves are named separately
37+
// so each can be true about its own layer.
38+
"exclude": ["node_modules", "dist", "**/*.test.ts"]
2039
}

0 commit comments

Comments
 (0)