Skip to content

chore(scripts): the root type-check program reaches zero errors; delete the obsolete analytics-reconcile harness - #26280

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-vq6idt
Oct 26, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-vq6idt

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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-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

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>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Oct 26, 2026
@github-actions github-actions Bot added size/l tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

席位核对 · ACCEPT · devx seat 2 · 2026-10-26T18:47Z

Seat domain:devx#2 (#20163) · session_01Q4MDXRbEJCNdPAP4SiXwp9 · reviewed head d4dc23c0f5 · card #26236, claim 6422728461 (delta O, amended to Wanted 1 only). PR carries Part of #26236.

  • Scope: 9 files, +5/−701. Not governed. Nothing under ui/.
  • Root program 26 → 0, with no rule loosened.
    • scripts/analytics-reconcile/ (6 files) is deleted, not repaired. It is ADR-0021's Phase 1 dual-shape tool. Its example imports point at moved or deleted files, and the inline shapes it reads are retired keys, so it cannot run on main. Both repair routes were measured and fail; the PR body records why. It is held at 3d50a43b, which is on main.
    • The root tsconfig.json (the scripts/ program only) sets lib: ["ES2022"]. That replaces the base's ES2020, which carries no DOM either, and Node ≥22 ships all of it. The shared tsconfig.base.json is untouched.
    • examples/app-showcase/src/ui/reports/index.ts drops an unused task const. I confirmed nothing on this head reads it.
  • Fix-in-place accepted: check-whole-set-label-write.mjs drops the scripts/**/*.ts watch hint, which went dead with the last tracked .ts under scripts/. Its POPULATION self-test pins the live set both ways and went red without the change.
  • Remaining mentions are fine. check-logger-receiver-detach.mjs:177 is a stale comment that the gate still passes, and it is listed in the report. The check-type-check-coverage.mjs DEBT note goes with the entry in PR 2.
  • DEBT entry kept on purpose. Wanted 2 (delete the entry) cannot go green without Wanted 3 (the lint.yml step): check-type-check-coverage.mjs ~L2814 and L4867. Both ride a second, Tier H PR on this branch. Until then the gate reports a graduation candidate with surplus 26, which is not a red.
  • Narrowing accepted: check:pm-dispatch-gates ran the fast tier only (1917 cases). No path-based caller exists, and CI runs the full tier.
  • Landing: ready + auto-merge once every check on this head is green or skipped.

Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 26, 2026 19:19
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 26, 2026 19:19
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 26, 2026
Merged via the queue into main with commit 6633075 Oct 26, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-vq6idt branch October 26, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l skip-changeset PR has no user-facing published change; bypasses the changeset gate tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants