Skip to content

Commit 817e38e

Browse files
committed
ci(typecheck): graduate the workspace root from the type-check DEBT ledger
The root program (tsconfig.json: scripts/ and the top-level configs) measures 0 errors, so its @objectstack/spec-monorepo DEBT entry is deleted. The root gains a typecheck:root script, and the Type Check source-gates lane runs it, which the coverage gate's root branch requires once the script exists. Claude-Session: https://claude.ai/code/session_01ENjVvxdwZxosWSS4Fqazu1 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 817cb89 commit 817e38e

3 files changed

Lines changed: 28 additions & 22 deletions

File tree

‎.github/workflows/lint.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5106,6 +5106,16 @@ jobs:
51065106
continue-on-error: true
51075107
run: pnpm check:type-check-coverage
51085108

5109+
# The workspace ROOT's own program (`tsconfig.json`: `scripts/` and the
5110+
# top-level configs) is outside every package's `typecheck`, so the turbo
5111+
# typecheck never reads it. This step does (#26236), and the coverage gate
5112+
# above requires it once `typecheck:root` exists. The program imports no
5113+
# built `dist/`, so it needs no build. Sub-second to a few seconds.
5114+
- name: Type-check the workspace root program
5115+
id: type-check-the-workspace-root-program
5116+
continue-on-error: true
5117+
run: pnpm typecheck:root
5118+
51095119
# Conformance meta-gate (#4363): `spec/src/data/*-conformance.ts` holds the
51105120
# shared case-sets that exist so the independent drivers answer ONE
51115121
# standard, and three separate changesets claimed a future driver "is held

‎package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"test": "VITEST_MAX_WORKERS=$(node scripts/vitest-worker-cap.mjs) turbo run test test:repo --concurrency=50%",
1414
"test:smoke": "turbo run test:smoke",
1515
"typecheck": "turbo run typecheck",
16+
"typecheck:root": "tsc --noEmit -p tsconfig.json",
1617
"clean": "turbo run clean && rm -rf dist",
1718
"setup": "pnpm install && pnpm --filter @objectstack/spec build",
1819
"prepare": "node scripts/setup-git-hooks.mjs",

‎scripts/check-type-check-coverage.mjs‎

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -663,12 +663,12 @@ const SPEC_SCRIPTS_PRECEDENT = 'packages/spec/tsconfig.scripts.json';
663663
const TEST_ROOTDIR_PRECEDENT = '`packages/client/tsconfig.test.json` and `packages/cli/tsconfig.test.json`';
664664
const GENERATED_INCLUDE_ISSUE = 'https://github.com/objectstack-ai/objectstack/issues/10880';
665665

666-
// A path in the root program whose edits move the `@objectstack/spec-monorepo`
667-
// count below, declared as a bare, whole-literal path so the dispatch
668-
// derivation can read it. It accounted for 29 of that entry's 80, and is 1 of
669-
// the 26 standing now -- still the root script an ordinary card edits. The note on
670-
// that entry carries the accounting and references this constant instead of
671-
// spelling the path inside its sentence.
666+
// A path in the root program, declared as a bare, whole-literal path so the
667+
// dispatch derivation can read it. It accounted for 29 of the
668+
// `@objectstack/spec-monorepo` DEBT entry's 80 errors, and for 1 of the 26 left
669+
// when that entry graduated (#26236). The root program is now type-checked by the
670+
// root's `typecheck:root` script, which lint.yml runs, and this is still the
671+
// root script an ordinary card edits.
672672
//
673673
// Why the SHAPE and not just the mention: scripts/pm/dispatch-gates.mjs scans
674674
// each gate's own module body for path literals and accepts one only when the
@@ -832,22 +832,17 @@ const ROOT_PROGRAM_COUPLED_SCRIPT = 'scripts/check-test-typecheck.mts';
832832
// fixed the test config showed 4 more (TS2883 on the `vi.fn()` fields of
833833
// `src/__mocks__/runtime.ts`, annotated `Mock`) that the build config never shows.
834834
// No cast, no `@ts-expect-error`, no `src` signature widened.
835-
const DEBT = {
836-
'@objectstack/spec-monorepo': {
837-
errors: 26,
838-
note: 'the workspace root itself: config-tier 18 (TS2307 x17, TS2550 x1); noise 8 (TS7006 x7, '
839-
+ 'TS6133 x1). The root `tsconfig.json` is the program for `scripts/` and the top-level configs and '
840-
+ 'declares `types:["node"]`; packages extend `tsconfig.base.json` instead. Declaring the Node types '
841-
+ 'moved this count by zero -- the TS2591 / TS2584 pile an older note blamed on their absence was '
842-
+ 'already gone. What stands: the analytics-reconcile tree imports `@objectstack/*` and example '
843-
+ 'sources the root program cannot resolve (the root package declares no workspace dependency), '
844-
+ 'which is all 17 TS2307 and the 7 TS7006 they cascade into; ' + ROOT_PROGRAM_COUPLED_SCRIPT
845-
+ ' calls `Object.hasOwn` under lib ES2020 (TS2550); and `exclude` only drops files from the '
846-
+ 'initial walk, so an example source a script imports is still compiled here -- the TS6133 is in '
847-
+ 'examples/app-showcase/src, and this entry moves with the showcase as well as with scripts/. '
848-
+ 'Graduating also needs a `typecheck:root` script and its step in .github/workflows/lint.yml.',
849-
},
850-
};
835+
//
836+
// `@objectstack/spec-monorepo` -- the workspace ROOT itself -- GRADUATED from this
837+
// ledger (#26236; entry: 26 raw, repaired to 0). Its program is the root
838+
// `tsconfig.json`: `scripts/` and the top-level configs. 24 of the 26 were the
839+
// obsolete ADR-0021 analytics-reconcile harness, which was deleted (its imports hid
840+
// 31 more errors on keys the spec had removed). The other two were `Object.hasOwn`
841+
// under lib ES2020, fixed by giving the root program lib ES2022, and an unused
842+
// const in an example source a script imported. Graduated the root's way: a
843+
// `typecheck:root` script plus its step in .github/workflows/lint.yml, both of
844+
// which the root branch of `evaluate` requires.
845+
const DEBT = {};
851846

852847
// Package name -> why running tsc over it is not applicable at all. An EXEMPT
853848
// entry is a statement about the package's nature, not about its debt; if the

0 commit comments

Comments
 (0)