Skip to content

Phase 2: backfill all summaries to schema 1.1 + drift verification #620

Closed

Description

@neuromechanist

Sub-task of #618 (epic). Driver: #616 backfill prerequisite + continuous-migration ask.

Blocked by Phase 1 (#TBD). Backfill is only meaningful after the generator change ships.

Scope

Backfill (one-shot)

Script: scripts/backfill-summaries.ts (Bun) that:

  1. Reads all rows from dataset_versions table (D1) where published_at IS NOT NULL.
  2. For each (dataset_id, version), checks data.nemar.org/<id>/<v>/summary.json. Reads schema_version. If < 1.1 or missing, fires workflow_dispatch[generate-manifest] at nemarDatasets/.github with {dataset_id, version, skip_callback: true}.
  3. Throttles: max 5 in-flight, sleep on 429.
  4. Reports: list of dispatched + list of skipped (already 1.1) + list of failed.

Run modes:

  • --dry-run (default): list only, no dispatches.
  • --apply: actually dispatch.
  • --only on* / --only nm* / --id <id>: scope.

Drift verification (ongoing)

New CLI command: nemar admin summary check [--fix].

  • Without --fix: walks all published versions, prints any whose summary.json is missing or below schema 1.1.
  • With --fix: dispatches workflow_dispatch[generate-manifest] for stale ones.

Also: GitHub Actions cron .github/workflows/check-summary-drift.yml runs nemar admin summary check weekly and opens an issue if drift detected.

Tests

  • Unit: scripts/backfill-summaries.test.ts — fake D1, fake fetch, verify dispatch payload + dry-run / apply switching.
  • Unit: nemar admin summary check parser handles 1.0, 1.1, missing, malformed.

Acceptance

  • bun scripts/backfill-summaries.ts --dry-run lists every stale version.
  • --apply run completes; sample of 5 verifies new summary at schema 1.1.
  • nemar admin summary check reports zero drift after backfill completes.
  • Cron workflow scheduled, no false positives.

Activity

  1. added
    P1
    feature
    backend
    cli
    on May 26, 2026
  2. added 2 commits that reference this issue on May 26, 2026
    0c4e252
    f9ae17d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1backendclifeature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions