Skip to content

ADR-0021 Phase 2: dataset dual-form migration + reconciliation harness (#1658)#1671

Merged
os-zhuang merged 1 commit into
mainfrom
adr-0021-phase2-dataset-migration
Jun 9, 2026
Merged

ADR-0021 Phase 2: dataset dual-form migration + reconciliation harness (#1658)#1671
os-zhuang merged 1 commit into
mainfrom
adr-0021-phase2-dataset-migration

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

What

ADR-0021 Phase 2 (issue #1658): migrate inline analytics in app-todo / app-crm / app-showcase to the semantic dataset form (dual-form — kept side-by-side with the legacy inline query), and add a read-only reconciliation harness that asserts both forms return identical numbers. This is the hard gate before the legacy form is deleted.

Reconciliation harness — scripts/analytics-reconcile/

Boots each app's real kernel and runs legacy engine.aggregate() vs dataset queryDataset(), diffing numbers group-by-group; exits non-zero on mismatch. 52 surfaces reconcile green · 0 mismatch.

Two real runtime bugs the gate caught (both fixed + regression tests)

  1. ObjectQLStrategy overwrote same-field filter operators → a $gte/$lte range silently lost a bound.
  2. ObjectQLStrategy ignored timeDimensions → date dimensions never bucketed. Now lowers a granularity to a structured {field, dateGranularity} groupBy that engine.aggregate buckets.

Also

  • Record-list reports (overdue_tasks, task_list) → ListViews.
  • Joined report: added block-level dataset dual-form to JoinedReportBlockSchema; bound the analytics block (task_overview/open_block).
  • Fixed example bugs surfaced by reconciliation: created_datecreated_at, invalid date macros, crm sales_by_stage flat-list → real grouped sum.

Tests

  • @objectstack/spec: 6666 pass
  • @objectstack/service-analytics: 89 pass (incl. 2 new regression tests)

Not in this PR (follow-ups toward delete-old-form)

platform-objects system_overview; single-form convergence (delete inline fields + ListChartConfigSchema, blockssections); pnpm gen:schema; WS5 docs/skills.

🤖 Generated with Claude Code

…form + reconciliation harness

Migrate inline analytics (report/dashboard widgets) in app-todo, app-crm and
app-showcase to the semantic `dataset` form (dual-form, side-by-side with the
legacy inline query), and add a read-only reconciliation harness that asserts
both forms return identical numbers — the hard gate before deleting old form.

Harness (scripts/analytics-reconcile/): boots each app's real kernel and runs
legacy engine.aggregate() vs dataset queryDataset(), diffing numbers group by
group; exits non-zero on mismatch. 52 surfaces reconcile green, 0 mismatch.

Two real runtime bugs the gate caught, both fixed in ObjectQLStrategy (+regression tests):
- same-field filter-operator overwrite dropped a bound of a $gte/$lte range
- timeDimensions were ignored, so date dimensions never bucketed — now lowered
  to a structured {field, dateGranularity} groupBy that engine.aggregate buckets

Also:
- record-list reports (app-todo overdue_tasks, showcase task_list) -> ListViews
- joined report: added block-level dataset dual-form to JoinedReportBlockSchema
  and bound the analytics block (showcase task_overview/open_block)
- fixed example bugs surfaced by reconciliation (created_date->created_at,
  invalid date macros, crm sales_by_stage flat-list -> real grouped sum)

Spec: 6666 tests pass. service-analytics: 89 tests pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment Jun 9, 2026 10:18pm

Request Review

@os-zhuang os-zhuang merged commit fc2e9b7 into main Jun 9, 2026
9 of 11 checks passed
@os-zhuang os-zhuang deleted the adr-0021-phase2-dataset-migration branch June 9, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant