Repository navigation
Commit 6633075
chore(scripts): the root type-check program reaches zero errors; delete the obsolete analytics-reconcile harness (#26280)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi95T4eukLFQZWx7jmjMoEvhv)_
Part of #26236
Clause-②: no
Metadata-protocol: none
## What this does
The workspace root's own type-check program (`tsc --noEmit -p
tsconfig.json`) goes from 26 errors to 0. This is Wanted 1 of the card
only. The `@objectstack/spec-monorepo` DEBT entry stays in this PR on
purpose; Wanted 2 and 3 land together in a second PR on this branch (see
"Why Wanted 2 is not here").
| Errors on `origin/main` 3d50a43 (closure built) | Fix in this PR |
|:---|:---|
| 17 × TS2307 + 7 × TS7006 in `scripts/analytics-reconcile/` | delete
the tree (below) |
| 1 × TS2550, `Object.hasOwn` in `scripts/check-test-typecheck.mts` |
root `tsconfig.json` sets `lib: ["ES2022"]`; the scripts run on Node 22
or later (root `engines`), which ships all of ES2022. The shared
`tsconfig.base.json` stays at ES2020 |
| 1 × TS6133, unused `const task` in
`examples/app-showcase/src/ui/reports/index.ts` | delete the const |
No type rule is loosened: no `skipLibCheck` change, no `exclude` change,
no strict flag touched.
## Why `scripts/analytics-reconcile/` is deleted rather than resolved
The card named two routes for its imports. Both were measured, and
neither holds:
1. **A root workspace devDependency** (`@objectstack/runtime`,
`objectql`, `driver-sqlite-wasm`, `service-analytics`, `spec`).
Measured: after `pnpm install`, the workspace root joins every
dependents filter of those packages. `pnpm --filter
'...@objectstack/service-analytics' run check:node-version` ran the
root's own script in `.`. So a consumer sweep such as `pnpm --filter
'...@objectstack/spec' typecheck` would also start the root's
`typecheck` / `test`, which are repo-wide turbo runs.
2. **Move the tree under `packages/qa/dogfood`**, which already depends
on all five. Once the imports resolve, the 7 TS7006 turn out to be
hiding 31 real errors in `reconcile.ts` (26 × TS2339, 1 × TS2551, 4 ×
TS7006). The harness reads the widget keys `object`, `categoryField`,
`categoryGranularity`, `valueField`, `aggregate`, `measures` and the
report keys `objectName`, `groupingsDown`. The spec removed all of them
at the ADR-0021 single-form cutover. The widget schema refuses the
widget keys with a prescription (`LEGACY_WIDGET_ANALYTICS_KEYS` in
`packages/spec/src/ui/dashboard.zod.ts`), and
`packages/spec/src/ui/report.zod.ts` records the inline `objectName` +
`columns` + `groupings` report query as removed.
The tree is the read-only dual-form reconciliation harness of ADR-0021
Phase 1: it compares a widget's inline query with its dataset binding.
ADR-0021 records the cutover that deleted the inline form as merged, so
no widget has a legacy half left to compare. The runners also could not
start on `main`: four imports named example files that have moved
(`app-showcase/src/{dashboards,datasets,reports}` now live under
`src/ui/`) or been deleted (the CRM `sales-by-stage` report). No script,
workflow, package or doc invokes the tree.
The deleted files are kept in history at commit
3d50a43
(`scripts/analytics-reconcile/`).
## In-place fix the deletion forces
`scripts/check-whole-set-label-write.mjs`: the six deleted files were
the last tracked `.ts` files under `scripts/`, so the
`'scripts/**/*.ts'` entry of `ROOT_DIR_WATCH_HINTS` reached no file. Its
`--self-test` POPULATION case ("every declared hint reaches a file this
gate walks") went red at exit 1. This PR removes that one entry, as the
gate's own docblock prescribes for an extension the tree does not hold.
After the change, `--self-test` and the scan both exit 0. The claim's
file surface was amended to include this file.
## Why Wanted 2 is not here
Deleting the DEBT entry cannot land green without Wanted 3's
`.github/workflows/lint.yml` step:
- `scripts/check-type-check-coverage.mjs` around L2814: once the root
declares `typecheck:root`, the gate reports a finding unless `lint.yml`
invokes it. `ciInvokesRoot` is `/typecheck:root/.test(lintYml)` (around
L4867).
- Without `typecheck:root`, deleting the entry reports "no
`typecheck:root` script and no ledger entry".
- An entry recording 0 is refused by the structural half.
So the entry, the script and the workflow step move together, in one
Tier H PR that waits for an authorized approval. Until then, the
re-measure reports the root as a graduation candidate ("DEBT records 26,
and tsc now reports 0") and prints the 26-error surplus, which is never
red.
## Acceptance
- Root `npx tsc --noEmit -p tsconfig.json`: exit 0, 0 errors at d4dc23c
(26 at 3d50a43 with the closure built).
- `pnpm check:type-check-debt` (self-test, then `--re-measure` under the
verify lock): exit 0. Re-measure line: "0 raw tsc error(s) total, none
above its recorded number".
- `node scripts/check-type-check-coverage.mjs`: exit 0.
- `examples/app-showcase` `tsc --noEmit`: exit 0.
- Derived gate families (`node scripts/pm/dispatch-gates.mjs
--commands`): 62 derived, 62 run at d4dc23c, every one exit 0. `--ran`
verdict: "62 derived famil(ies) accounted for — 62 run, 0 NOT-MEASURED
(a DERIVED zero — all 62 recorded an exit code and none of them is 3)".
One deviation: `check:pm-dispatch-gates` ran its fast tier (1917 cases,
exit 0); the slow tier was not run. It spawns scripts by path, and `git
grep analytics-reconcile` finds no caller anywhere in the repository, so
no slow-tier case can reach the deleted files.
## Acceptance notes
- `scripts/check-logger-receiver-detach.mjs` has a docblock that counts
"six under `scripts/analytics-reconcile/`" among the tracked `.ts` files
outside its scan roots. That count is now stale. The gate's scan is
green and the comment carries no assertion, so it is left as it is.
- The DEBT entry's `note` and the `ROOT_PROGRAM_COUPLED_SCRIPT` comment
in `check-type-check-coverage.mjs` still describe the 26. Both go in the
Wanted 2+3 PR, which deletes the entry.
- `ui/docs/audits/2026-09-plugin-detail-downstream-consumer-census.md`
cites `scripts/analytics-reconcile/macros.ts` in the hotcrm repository,
not this one. It is unaffected.
- `docs/adr/0021-analytics-dataset-semantic-layer.md` and
`content/docs/data-modeling/analytics.mdx` describe the reconciliation
harness in the past tense, as history. Neither names the path, and
neither is changed.
Changeset: none. The diff touches the root program, root `scripts/` and
a private example (`@objectstack/example-showcase`), so nothing
publishes. Labelled `skip-changeset`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01ENjVvxdwZxosWSS4Fqazu1)_
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 5cb1c1a commit 6633075
9 files changed
Lines changed: 5 additions & 701 deletions
File tree
- examples/app-showcase/src/ui/reports
- scripts
- analytics-reconcile
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | 5 | | |
8 | 6 | | |
9 | 7 | | |
| |||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments