Repository navigation
fix(codegen): make procedure names merge-local - #471
Conversation
🦋 Changeset detectedLatest commit: 3140474 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bc59c3cd3c
ℹ️ 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".
| .join('\n'); | ||
|
|
||
| return ` ${JSON.stringify(file)}: [${items}],`; | ||
| return ` ${JSON.stringify(file)}: [\n${items}\n ],`; |
There was a problem hiding this comment.
Make concurrent same-gap additions independently mergeable
When two branches each add a procedure at the same insertion point in this array—commonly when both append after the existing last export—their generated lines are both inserted immediately before the same ], anchor, so a three-way Git merge still conflicts. Emitting one entry per line only localizes that conflict and does not satisfy the independently mergeable outcome; the added test checks physical line count but never exercises a merge. Add a three-way merge regression and use a representation or generation strategy that gives concurrent additions independent anchors.
AGENTS.md reference: AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
| const entry = findBestEntry(entries, location); | ||
| if (!entry) { | ||
| warnAboutStaleLookup(relativeFilePath, location); |
There was a problem hiding this comment.
Avoid warning for intentionally omitted procedures
When a module contains at least one generated procedure plus a procedure export prefixed with _, constructing the private procedure reaches this branch and emits the always-on stale-state warning even after a successful codegen run. parseModuleRuntime intentionally skips every underscore-prefixed export (codegen.ts:2137-2138), so no matching lookup entry can ever be generated and the suggested remediation cannot resolve the warning. Distinguish intentionally unregistered procedures from genuinely stale lookup misses before warning.
Useful? React with 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🐛 Fixes #466
🧭 Task plan: docs/plans/466-fix-procedure-name-codegen-merge-conflicts.md
🟢 95-100% confidence
✅ Outcome
Generated procedure-name lookup entries occupy independent physical lines, so unrelated same-module additions no longer rewrite the whole module entry. A stale lookup for a known module emits one actionable warning instead of silently losing procedure identity.
Convex function bundles hard-code
process.env.NODE_ENVtoproduction, including local development. The stale-map warning is therefore always-on for this impossible state and deduplicated once per module; modules absent from the generated lookup remain silent.🏗️ Design
The CLI serializer owns diff locality, while the server lookup boundary owns stale-state diagnosis. Exact generated positions remain the identity mechanism because a procedure builder does not know its eventual export binding and Convex registration does not expose a function-name symbol at construction time.
No public API, type signature, export, dependency, or Convex entry import graph changes. Includes regenerated fixtures and a
kitcnpatch changeset.🧪 Verified
bun checkpassbun --cwd packages/kitcn build,bun typecheck,bun lint:fix, fixture sync/check, zero slop delta, changeset status, and dirty-local autoreview all pass. Autoreview reported no accepted/actionable findings.