Skip to content

refactor(registry): generate bootstrap and health dataset registries#4

Closed
lspassos1 wants to merge 1 commit intomainfrom
refactor/dataset-registry-rollout
Closed

refactor(registry): generate bootstrap and health dataset registries#4
lspassos1 wants to merge 1 commit intomainfrom
refactor/dataset-registry-rollout

Conversation

@lspassos1
Copy link
Copy Markdown
Owner

@lspassos1 lspassos1 commented Apr 11, 2026

Summary

This moves bootstrap and health dataset registration behind a generated contract registry in the fork. The runtime behavior stays aligned with the existing bootstrap and health semantics, while the source of truth moves to registry/datasets.ts and drift is enforced in CI and pre-push.

Related issue: #5.

Root cause

Bootstrap keys, health keys, seed metadata, and tier definitions had drifted across manual maps in api/bootstrap.js, api/health.js, server/_shared/cache-keys.ts, and multiple tests. That made parity fixes and new dataset additions depend on synchronized edits across unrelated files.

Changes

  • add registry/datasets.ts plus scripts/generate-dataset-registry.ts and scripts/check-dataset-registry.mjs
  • generate api/_generated/dataset-registry.js, api/_generated/health-registry.js, and server/_shared/_generated/bootstrap-registry.ts
  • restore the missing consumerPricesOverview, consumerPricesCategories, consumerPricesMovers, and consumerPricesSpread bootstrap aliases
  • switch api/health.js to generated health registries while preserving bootstrap/standalone grouping, seed status handling, cascade logic, and compact mode behavior
  • re-export canonical bootstrap keys from server/_shared/cache-keys.ts
  • update bootstrap, market breadth, resilience static, customs revenue, and supply-chain tests to assert against generated registries
  • run npm run registry:check in .husky/pre-push and .github/workflows/typecheck.yml
  • document the registry workflow in docs/architecture/dataset-registry.md

Validation

  • npm run registry:check
  • node --test tests/bootstrap.test.mjs
  • node --test tests/edge-functions.test.mjs
  • npm run test:data
  • npm run typecheck
  • npm run typecheck:api

Risk

Low to moderate. The runtime code path is intentionally conservative, but the generated registry now feeds both bootstrap and health, so future contract edits can affect both endpoints at once.

Bootstrap and health registrations had drifted across manual maps in api/bootstrap.js, api/health.js, tests, and cache key exports.

Move the dataset contracts into registry/datasets.ts, generate the edge/server artifacts, and wire the health and bootstrap endpoints to consume those outputs. Also add registry freshness checks to pre-push and the typecheck workflow.

Validation:
- npm run registry:check
- node --test tests/bootstrap.test.mjs
- node --test tests/edge-functions.test.mjs
- npm run test:data
- npm run typecheck
- npm run typecheck:api
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
worldmonitor Ignored Ignored Apr 11, 2026 5:28pm

@lspassos1
Copy link
Copy Markdown
Owner Author

Superseded by the stacked registry rollout in #10, #11, #12, and #13 so each slice can be reviewed independently.

@lspassos1 lspassos1 closed this Apr 11, 2026
@lspassos1 lspassos1 deleted the refactor/dataset-registry-rollout branch April 11, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant