Report [project] baml.toml table as [package] typo#3715
Conversation
Co-authored-by: Dhilan Shah <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
⏭️ Performance benchmarks were skippedPerf benchmarks (CodSpeed) are opt-in on pull requests — they no longer run on every push. They always run automatically after merge to To run them on this PR, do any of the following, then push a commit (or re-run CI):
|
|
No description provided. |
The error
A
baml.tomlcopied with a Python-style[project]table is not a valid BAML manifest:Before this change, running:
failed with a generic manifest error like:
That message did not mention that
[project]was present, so the user/agent had no direct hint that the intended BAML table is[package].Root cause
baml_language/crates/baml_cli/src/project_load.rs::validate_baml_tomlonly looked uptable.get("package")and emitted the generic missing-table diagnostic when it was absent. It did not inspect the parsed TOML for a top-level[project]table before producing that fallback.The read-only/introspection path,
load_project_or_default, intentionally skips most manifest validation for commands likebaml describe, so it also needed a narrow check for this known typo to avoid silently loading a project with a broken manifest header.Separately,
baml_language/crates/baml_cli/src/agent_command.rs::normalize_direct_skill_referencesnormalized skill names from the external BAML skill archive but did not correct a badbaml.tomltemplate if one contains[project].The fix
Added a shared
[project]-without-[package]diagnostic helper inproject_load.rs:Used that helper in strict manifest validation so
run/test/generate/packget the targeted error instead of the generic missing[package]message.Added the same narrow typo check to
load_project_or_default, preserving generaldescribeleniency while still surfacing this actionable manifest mistake.Added context-aware skill content normalization so an installed BAML skill template that mentions
baml.tomlrewrites[project]to[package]without changing unrelated TOML snippets likepyproject.toml.Added unit and e2e coverage for the strict loader, the introspection loader, the skill normalization, and the CLI
describereproduction.Verification
Focused regressions:
Output:
cargo test -p baml_cli skill_baml_toml_template_uses_package_tableOutput:
cargo test -p baml_cli --test exit_code_e2e describe_with_project_table_reports_package_hintOutput:
Required Rust library tests:
Output ended with all library test binaries passing, including:
Full workspace suite (using the repository's configured nextest setup scripts for SDK fixtures):
Output:
Manual reproduction after the change:
Output:
Issue Reference
Changes
See The fix above.
Testing
Screenshots
Not applicable.
PR Checklist
Additional Notes
All source changes are scoped to
baml_language/. The legacyengine/directory was not modified.