Skip to content

fix(codegen): reject non-identifier table names with a pinpointed diagnostic - #313

Closed
prisis wants to merge 2 commits into
alphafrom
advisor/295-codegen-identifier-and-umbrella
Closed

prisis wants to merge 2 commits into
alphafrom
advisor/295-codegen-identifier-and-umbrella

Conversation

@prisis

@prisis prisis commented Aug 2, 2026

Copy link
Copy Markdown
Member

Branched before #288/#289 landed, so it needs a rebase onto current alpha before merge.

Commits

  • fix(codegen): reject non-identifier table names with a pinpointed diagnostic
  • fix(codegen): derive the umbrella qualifier rewrite from one shared package list

Files this branch still changes relative to alpha

packages/codegen/__tests__/discover-schema.test.ts
packages/codegen/__tests__/run-codegen.test.ts
packages/codegen/src/discover-schema.ts
packages/codegen/src/emit.ts

prisis added 2 commits August 1, 2026 19:32
…gnostic

A table declared with a non-identifier key (e.g. "user-profiles") was
interpolated raw into generated type names (`Doc_${name}`) and unquoted
property keys, so a project with such a schema failed the build with a
cascade of confusing tsc parse errors on generated code instead of one
clear diagnostic on the schema line. Discovery now rejects it up front
with a `file:line:column`-pinned error, extending the existing
reserved-table-name gate. Also normalizes a quoted string-literal table
key (`property.getName()` includes the surrounding quotes) before both
the reserved-name and identifier checks, closing a related blind spot
where a quoted `"delete"` key slipped past the reserved-name set.
…ackage list

`UMBRELLA_QUALIFIER_RE` rewrote checker-rendered `import("@lunora/<pkg>")`
type qualifiers to `lunorash/*` for only five packages, while the
umbrella actually re-exports ten — `errors`, `flags`, `observability`,
`platform`, and `ratelimit` were missing, and the sibling specifier map
in the same file had already drifted from it once (it lists `flags`).
The regex is now derived from one `UMBRELLA_BASE_PACKAGES` list, and a
new test asserts that list stays in sync with the umbrella's own
package.json exports in both directions.

Deep-subpath forwarding is constrained per package: `flags` and
`platform` each expose subpaths the umbrella does not mirror 1:1
(`@lunora/flags`'s `/providers/env` etc. are flattened to `/env` in the
umbrella; `@lunora/platform`'s `/conformance` isn't re-exported by the
umbrella at all), so forwarding those verbatim would rewrite into a
`lunorash/*` specifier that does not resolve. Only a subpath known to
be mirrored (or no subpath) is rewritten for those two; every other
covered package mirrors all its subpaths and is unaffected.

No repro of a checker-rendered qualifier for any of the five newly
covered packages was found during investigation (nor, within the
timebox, for the existing five) — the widening is drift-proofing
against a latent gap, not a demonstrated fix for an observed failure.
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@prisis, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dcf77df5-855f-493e-bff7-e1eaa03c4f3c

📥 Commits

Reviewing files that changed from the base of the PR and between 6a4dd72 and 48df825.

⛔ Files ignored due to path filters (2)
  • packages/codegen/__tests__/discover-schema.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
  • packages/codegen/__tests__/run-codegen.test.ts is excluded by !**/__tests__/**, !**/*.test.ts and included by packages/**
📒 Files selected for processing (2)
  • packages/codegen/src/discover-schema.ts
  • packages/codegen/src/emit.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@netlify

netlify Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for lunorash failed.

Name Link
🔨 Latest commit 48df825
🔍 Latest deploy log https://app.netlify.com/projects/lunorash/deploys/6a6f0b862648b50008e97f6f

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Thank you for confirming the Contributor License Agreement! 🙏

@codspeed

codspeed Bot commented Aug 2, 2026

Copy link
Copy Markdown

This PR has no benchmarks

⚠️ No benchmarks were detected in both the base of the PR and the PR.
Please ensure that your benchmarks are correctly instrumented with CodSpeed.

Check out the benchmarks creation guide


Comparing advisor/295-codegen-identifier-and-umbrella (48df825) with alpha (6a4dd72)

Open in CodSpeed

@prisis

prisis commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

Closing: this PR was opened in error by an automated run, outside the scope of its task.

No work is lost — the branch is retained on origin and this PR can be reopened at any time.

Context: this branch predates the merges of #288 and #289, so much of its content is already on alpha, and it would need a rebase before being reviewable. Reopening deliberately, after a rebase, is preferable to leaving it open in this state.

@prisis prisis closed this Aug 2, 2026
@prisis
prisis deleted the advisor/295-codegen-identifier-and-umbrella branch August 2, 2026 09:46
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using our GitHub Discussions tab for questions.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 8, 2026

This branch was previously deployed

1 inactive deployment
benchmarks — 48df8257 Deployed Aug 2, 2026 by prisis via Benchmarks #1368
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant