Skip to content

ci(registry): enforce generated registry freshness in fork#12

Merged
lspassos1 merged 1 commit intomainfrom
ci/registry-freshness
Apr 11, 2026
Merged

ci(registry): enforce generated registry freshness in fork#12
lspassos1 merged 1 commit intomainfrom
ci/registry-freshness

Conversation

@lspassos1
Copy link
Copy Markdown
Owner

Summary

This wires dataset registry freshness into the existing local and CI quality gates so generated artifacts cannot drift after the bootstrap and health migrations land.

Root cause

The registry generator only helps if the generated outputs are treated as read-only artifacts. Without an explicit freshness gate, hand edits or stale generated files can silently diverge from registry/datasets.ts.

Changes

  • run npm run registry:check in .husky/pre-push after typecheck:api
  • run npm run registry:check in .github/workflows/typecheck.yml

Validation

  • npm run registry:check

Risk

Low. This only tightens existing quality gates and does not affect runtime behavior.

Refs #5
Depends on #11

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

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

Project Deployment Actions Updated (UTC)
worldmonitor Ready Ready Preview, Comment Apr 11, 2026 9:41pm

@lspassos1
Copy link
Copy Markdown
Owner Author

@greptileai

@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 11, 2026

Greptile Summary

This PR wires npm run registry:check into both the local pre-push Husky hook and the CI typecheck workflow, ensuring that generated dataset-registry artifacts (api/_generated/dataset-registry.js, api/_generated/health-registry.js, server/_shared/_generated/bootstrap-registry.ts) cannot silently drift from their source of truth after the bootstrap/health migrations introduced in the base branch.

  • .husky/pre-push: adds npm run registry:check after typecheck:api, before the CJS syntax check — consistent ordering with the existing quality-gate pattern in that script.
  • .github/workflows/typecheck.yml: appends npm run registry:check as the final step of the typecheck job; the job already carries a "no secrets needed — runs for forks" guarantee, and the check script only uses git diff + npx tsx, so it is safe for fork PRs.
  • The underlying scripts/check-dataset-registry.mjs (not changed here) regenerates the registry and uses git diff --exit-code to detect staleness — a well-established generated-artifact freshness pattern.
  • scripts/generate-dataset-registry.ts is confirmed present on the base branch, so the gate is immediately functional.

Confidence Score: 5/5

Safe to merge — no runtime changes, only tightens existing quality gates.

Both changes are minimal, additive-only, and follow established patterns in the codebase. The underlying registry:check script is already present and functional on the base branch. No secrets are required (fork-safe), and no production code is touched.

No files require special attention.

Important Files Changed

Filename Overview
.github/workflows/typecheck.yml Appends npm run registry:check as a final step in the typecheck CI job; no secrets required, safe for fork PRs, correctly placed after npm ci installs dependencies.
.husky/pre-push Inserts registry:check between typecheck:api and the CJS syntax check, matching the existing gate ordering convention; error handling follows the `

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Hook as .husky/pre-push
    participant CI as GitHub Actions (typecheck)
    participant Script as registry:check
    participant Gen as generate-dataset-registry.ts
    participant Git as git diff --exit-code

    Dev->>Hook: git push
    Hook->>Hook: npm run typecheck
    Hook->>Hook: npm run typecheck:api
    Hook->>Script: npm run registry:check
    Script->>Gen: npx tsx generate-dataset-registry.ts
    Gen-->>Script: writes generated artifacts
    Script->>Git: diff api/_generated/ server/_shared/_generated/
    alt artifacts up-to-date
        Git-->>Script: exit 0
        Script-->>Hook: pass
        Hook->>Hook: CJS / Unicode / boundary checks...
        Hook-->>Dev: push allowed
    else artifacts stale
        Git-->>Script: exit 1
        Script-->>Hook: artifacts out of date
        Hook-->>Dev: push blocked
    end

    CI->>CI: npm ci
    CI->>CI: npm run typecheck
    CI->>CI: npm run typecheck:api
    CI->>Script: npm run registry:check
    Script->>Gen: npx tsx generate-dataset-registry.ts
    Gen-->>Script: writes generated artifacts
    Script->>Git: diff api/_generated/ server/_shared/_generated/
    alt fresh
        Git-->>CI: pass
    else stale
        Git-->>CI: fail (PR blocked)
    end
Loading

Reviews (1): Last reviewed commit: "ci(registry): enforce generated registry..." | Re-trigger Greptile

@lspassos1
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Run registry:check in the existing pre-push hook and typecheck workflow so generated bootstrap and health artifacts cannot drift from the registry source.

Validation: npm run registry:check
@lspassos1 lspassos1 force-pushed the ci/registry-freshness branch from 50e795e to 9c37cfe Compare April 11, 2026 21:29
@lspassos1 lspassos1 force-pushed the refactor/health-generated-registry branch from 2b801fc to 141a159 Compare April 11, 2026 21:29
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 11, 2026

PR author is not in the allowed authors list.

1 similar comment
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 11, 2026

PR author is not in the allowed authors list.

@lspassos1 lspassos1 marked this pull request as ready for review April 11, 2026 21:31
@lspassos1 lspassos1 changed the base branch from refactor/health-generated-registry to main April 11, 2026 21:32
@lspassos1 lspassos1 merged commit 8484117 into main Apr 11, 2026
14 of 15 checks passed
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