Repository navigation
chore(scripts): the root type-check program reaches zero errors; delete the obsolete analytics-reconcile harness - #26280
Merged
Conversation
Delete scripts/analytics-reconcile: the ADR-0021 dual-form reconciliation harness compares the inline widget/report query against the dataset form, and that inline form is retired in the spec, so every widget it reads has no legacy half to compare. Its runners also imported example files that have moved or been deleted, so none of them could start. Raise the root program's lib to ES2022 (the scripts run on Node >=22), which clears the Object.hasOwn call in scripts/check-test-typecheck.mts, and drop an unused const from the showcase reports. Claude-Session: https://claude.ai/code/session_01ENjVvxdwZxosWSS4Fqazu1 Co-authored-by: Claude <noreply@anthropic.com>
…h hint The analytics-reconcile tree was the last tracked .ts under scripts/, so the hint reached no file and the self-test's population pin went red. Claude-Session: https://claude.ai/code/session_01ENjVvxdwZxosWSS4Fqazu1 Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
席位核对 · ACCEPT · devx seat 2 · 2026-10-26T18:47ZSeat
Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Steve · project thread
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-monorepoDEBT 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").origin/main3d50a43 (closure built)scripts/analytics-reconcile/Object.hasOwninscripts/check-test-typecheck.mtstsconfig.jsonsetslib: ["ES2022"]; the scripts run on Node 22 or later (rootengines), which ships all of ES2022. The sharedtsconfig.base.jsonstays at ES2020const taskinexamples/app-showcase/src/ui/reports/index.tsNo type rule is loosened: no
skipLibCheckchange, noexcludechange, no strict flag touched.Why
scripts/analytics-reconcile/is deleted rather than resolvedThe card named two routes for its imports. Both were measured, and neither holds:
@objectstack/runtime,objectql,driver-sqlite-wasm,service-analytics,spec). Measured: afterpnpm install, the workspace root joins every dependents filter of those packages.pnpm --filter '...@objectstack/service-analytics' run check:node-versionran the root's own script in.. So a consumer sweep such aspnpm --filter '...@objectstack/spec' typecheckwould also start the root'stypecheck/test, which are repo-wide turbo runs.packages/qa/dogfood, which already depends on all five. Once the imports resolve, the 7 TS7006 turn out to be hiding 31 real errors inreconcile.ts(26 × TS2339, 1 × TS2551, 4 × TS7006). The harness reads the widget keysobject,categoryField,categoryGranularity,valueField,aggregate,measuresand the report keysobjectName,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_KEYSinpackages/spec/src/ui/dashboard.zod.ts), andpackages/spec/src/ui/report.zod.tsrecords the inlineobjectName+columns+groupingsreport 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 undersrc/ui/) or been deleted (the CRMsales-by-stagereport). 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.tsfiles underscripts/, so the'scripts/**/*.ts'entry ofROOT_DIR_WATCH_HINTSreached no file. Its--self-testPOPULATION 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-testand 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.ymlstep:scripts/check-type-check-coverage.mjsaround L2814: once the root declarestypecheck:root, the gate reports a finding unlesslint.ymlinvokes it.ciInvokesRootis/typecheck:root/.test(lintYml)(around L4867).typecheck:root, deleting the entry reports "notypecheck:rootscript and no ledger entry".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
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-measureunder 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-showcasetsc --noEmit: exit 0.node scripts/pm/dispatch-gates.mjs --commands): 62 derived, 62 run at d4dc23c, every one exit 0.--ranverdict: "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-gatesran its fast tier (1917 cases, exit 0); the slow tier was not run. It spawns scripts by path, andgit grep analytics-reconcilefinds no caller anywhere in the repository, so no slow-tier case can reach the deleted files.Acceptance notes
scripts/check-logger-receiver-detach.mjshas a docblock that counts "six underscripts/analytics-reconcile/" among the tracked.tsfiles 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.noteand theROOT_PROGRAM_COUPLED_SCRIPTcomment incheck-type-check-coverage.mjsstill 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.mdcitesscripts/analytics-reconcile/macros.tsin the hotcrm repository, not this one. It is unaffected.docs/adr/0021-analytics-dataset-semantic-layer.mdandcontent/docs/data-modeling/analytics.mdxdescribe 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. Labelledskip-changeset.Generated by Claude Code