Skip to content

refactor(codegen): make Display the only OutputType spelling authority - #4393

Open
hellovai wants to merge 3 commits into
vbv/b-1145-drop-featuresfrom
vbv/b-1145-output-type
Open

hellovai wants to merge 3 commits into
vbv/b-1145-drop-featuresfrom
vbv/b-1145-output-type

Conversation

@hellovai

@hellovai hellovai commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Three spellings described the same Python target: baml.toml wanted python/pydantic, baml generate add wanted python/pydantic2, and the enum carried a PythonPydanticV1 variant. This collapses them to one.

add_name() is gone. Display now produces the canonical name written to baml.toml, FromStr reads every canonical name back, and canonical() is the same string with a 'static lifetime for clap's PossibleValue. Tests assert the two agree and that every canonical name round-trips — a name Display writes but FromStr cannot read would silently corrupt the manifest.

python and typescript are accepted as aliases for the canonical Python and Node targets. They parse but are hidden from the possible-values list, so that list names exactly what lands in baml.toml; the argument's help text names the aliases instead.

OutputType::PythonPydanticV1 is deleted. It shared a dispatch arm with PythonPydantic and passed identical arguments, so the v1 spelling silently emitted Pydantic v2 code. Nothing else in the tree referenced it. It is now an unknown value with clap's did-you-mean suggestion, which is strictly better than wrong output.

Second of three stacked PRs for B-1145. Based on #4392 — review that first. Next: #4394

🤖 Generated with Claude Code

https://claude.ai/code/session_018Jm6FCeSHxhtM2S6oTQR5B

@linear

linear Bot commented Aug 13, 2026

Copy link
Copy Markdown

B-1145

@vercel

vercel Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
beps Ready Ready Preview Aug 19, 2026 10:03pm
promptfiddle2 Ready Ready Preview Aug 19, 2026 10:03pm

Request Review

@github-actions

Copy link
Copy Markdown

⏭️ Performance benchmarks were skipped

Perf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to canary/main.

To run them on this PR, do any of the following, then push a commit (or re-run CI):

  • Add RUN_CODSPEED=1 to the PR description, or
  • Include run-perf or /perf in the PR title or any commit message.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 79f6cb35-64d2-4d4b-b16d-511564b4566f

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 13, 2026 06:32 Inactive
@github-actions

github-actions Bot commented Aug 13, 2026 •

Copy link
Copy Markdown

Binary size checks passed

✅ 7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 31.8 MB 12.6 MB file 31.7 MB +138.4 KB (+0.4%) OK
✅ packed-program Linux 🔒 25.0 MB 9.2 MB file 24.9 MB +176.8 KB (+0.7%) OK
✅ baml-cli macOS 🔒 25.5 MB 11.2 MB file 25.5 MB +65.4 KB (+0.3%) OK
✅ packed-program macOS 🔒 20.8 MB 8.2 MB file 20.6 MB +207.1 KB (+1.0%) OK
✅ baml-cli Windows 🔒 27.3 MB 11.3 MB file 27.2 MB +136.1 KB (+0.5%) OK
✅ packed-program Windows 🔒 21.9 MB 8.3 MB file 21.7 MB +151.0 KB (+0.7%) OK
✅ bridge_wasm WASM 21.4 MB 🔒 5.4 MB gzip 5.3 MB +70.4 KB (+1.3%) OK

🔒 = the size this artifact is GATED on (ceiling + delta). Binaries gate on file size (installed binary); WASM gates on gzip (download size). The other size is shown for information only.


Generated by cargo size-gate · workflow run

@hellovai
hellovai force-pushed the vbv/b-1145-output-type branch from 4e79a13 to 9070cbc Compare August 13, 2026 06:53
@vercel
vercel Bot temporarily deployed to Preview – beps August 13, 2026 06:54 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 13, 2026 07:00 Inactive
@hellovai
hellovai force-pushed the vbv/b-1145-output-type branch from 9070cbc to 6c761d5 Compare August 13, 2026 15:47
@vercel
vercel Bot temporarily deployed to Preview – beps August 13, 2026 15:48 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 13, 2026 15:55 Inactive
@blacksmith-sh

This comment has been minimized.

@hellovai
hellovai force-pushed the vbv/b-1145-output-type branch from 6c761d5 to 52aca0a Compare August 13, 2026 17:26
@vercel
vercel Bot temporarily deployed to Preview – beps August 13, 2026 17:27 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 13, 2026 17:34 Inactive
@hellovai
hellovai force-pushed the vbv/b-1145-output-type branch from 52aca0a to 4fef9fe Compare August 13, 2026 17:45
@hellovai
hellovai temporarily deployed to boundary-tools-prod August 13, 2026 17:45 — with GitHub Actions Inactive
@hellovai
hellovai temporarily deployed to boundary-tools-prod August 13, 2026 17:45 — with GitHub Actions Inactive
@vercel
vercel Bot temporarily deployed to Preview – beps August 13, 2026 17:46 Inactive
@hellovai
hellovai force-pushed the vbv/b-1145-output-type branch from 4fef9fe to e793c8d Compare August 13, 2026 17:48
@vercel
vercel Bot temporarily deployed to Preview – beps August 13, 2026 17:49 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 13, 2026 17:54 Inactive
@hellovai
hellovai force-pushed the vbv/b-1145-output-type branch from e793c8d to 785d799 Compare August 13, 2026 22:13
@vercel
vercel Bot temporarily deployed to Preview – beps August 13, 2026 22:15 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 13, 2026 22:21 Inactive
@hellovai
hellovai force-pushed the vbv/b-1145-output-type branch from 785d799 to aed372d Compare August 14, 2026 07:56
@vercel
vercel Bot temporarily deployed to Preview – beps August 14, 2026 07:57 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 14, 2026 08:04 Inactive
@hellovai
hellovai force-pushed the vbv/b-1145-output-type branch from aed372d to 17b3089 Compare August 15, 2026 00:31
@vercel
vercel Bot temporarily deployed to Preview – beps August 15, 2026 00:32 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 15, 2026 00:41 Inactive
Three spellings described the same Python target: `baml.toml` wanted
`python/pydantic`, `baml generate add` wanted `python/pydantic2`, and the
enum carried a `PythonPydanticV1` variant. Collapse them to one.

`add_name()` is gone. `Display` now produces the canonical name that gets
written to `baml.toml`, `FromStr` reads every canonical name back, and
`canonical()` is the same string with a `'static` lifetime for clap's
`PossibleValue`. A test asserts the two agree and that every canonical name
round-trips, since a name `Display` writes but `FromStr` cannot read would
silently corrupt the manifest.

`python` and `typescript` are accepted as aliases for the canonical Python
and Node targets. They parse but are hidden from the possible-values list,
so that list names exactly what lands in `baml.toml`; the argument's help
text names the aliases instead.

`OutputType::PythonPydanticV1` is deleted. It shared a dispatch arm with
`PythonPydantic` and passed identical arguments, so the v1 spelling silently
emitted Pydantic v2 code. Nothing else in the tree referenced it. It is now
an unknown value with clap's did-you-mean suggestion, which is strictly
better than wrong output.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_018Jm6FCeSHxhtM2S6oTQR5B
@hellovai
hellovai force-pushed the vbv/b-1145-output-type branch from 17b3089 to b734c62 Compare August 16, 2026 20:19
@vercel
vercel Bot temporarily deployed to Preview – beps August 16, 2026 20:21 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 16, 2026 20:30 Inactive
@vercel
vercel Bot temporarily deployed to Preview – beps August 19, 2026 20:13 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 19, 2026 20:21 Inactive
@blacksmith-sh

This comment has been minimized.

@vercel
vercel Bot temporarily deployed to Preview – beps August 19, 2026 21:56 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 19, 2026 22:03 Inactive

This branch was previously deployed

3 inactive (1 outdated) deployments
Preview – promptfiddle2 — 6eb40411 Deployed Aug 19, 2026 by vercel[bot]
Preview – beps — 6eb40411 Deployed Aug 19, 2026 by vercel[bot]
boundary-tools-prod — 4fef9fe7 Deployed Aug 13, 2026 by hellovai via review #36
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.

2 participants