chore(rust): remove dead public APIs with Hawk - #4114
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughChangesThis PR adds Hawk lint tooling to CI and pre-commit, while broadly reducing exported Rust API surface across compiler, runtime, event, project, SAP, test, and SDK crates. It also adds project path metadata and replaces selected legacy lookup and iterator helpers. Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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):
|
Binary size checks passed✅ 7 passed
Generated by |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (5)
baml_language/crates/bex_events/src/prof/drain.rs (1)
127-153: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winPreserve the cooperative engine-close lifecycle.
CooperativeProfileDrainno longer has a close transition orclose_engineinvocation, whiletranscodestill checksclosed_enginesonly for post-close diagnostics. If WASM/browser drains need closed-engine finalization, add an internal close path and call it before cooperative cleanup; otherwise remove the deadclosed_engines/post-close-diagnostic handling for cooperative drains.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_events/src/prof/drain.rs` around lines 127 - 153, The cooperative drain lifecycle is incomplete because drain_until_idle does not finalize engines before cleanup while transcode retains closed-engine diagnostics. Add an internal close transition and invoke it before cooperative cleanup, including close_engine for each relevant engine; alternatively remove closed_engines and all post-close diagnostic handling from CooperativeProfileDrain if cooperative drains do not require finalization.baml_language/crates/bex_heap/src/heap.rs (1)
860-866: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winPreserve pointer validation before dereferencing
HeapPtr.
get_objectnow dereferencesidxbefore any epoch or pointer validation.heap_debugger/real.rscalls it directly fromdebug_assert_valid_value, so stale or from-space pointers may be dereferenced instead of rejected by the heap debugger. Restore validation in a shared path or validate every caller beforeget_object.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_heap/src/heap.rs` around lines 860 - 866, Update get_object to validate the HeapPtr before calling idx.get(), using the shared epoch/pointer-validation path already used by heap debugging. Ensure heap_debugger::real::debug_assert_valid_value rejects stale or from-space pointers before dereferencing, while preserving the existing sentinel assertion and object return behavior.baml_language/crates/bex_vm/src/vm.rs (2)
1616-1625: 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy liftKeep the GC-root API reachable from
bex_engine.This method is now private, but its contract says
bex_enginecalls it during GC root collection. Sincebex_engineis a separate crate, this is a cross-crate compile break unless root collection was moved elsewhere.Proposed fix
- fn collect_frame_roots(&self) -> Vec<HeapPtr> { + pub fn collect_frame_roots(&self) -> Vec<HeapPtr> {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_vm/src/vm.rs` around lines 1616 - 1625, Make Vm::collect_frame_roots publicly accessible so the separate bex_engine crate can invoke it during GC root collection. Preserve the existing root aggregation behavior for frame functions and native continuations.
2299-2300: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy liftPreserve the cleanup previously performed by
finalize.
thrown_value_causesdocuments that it is cleared byfinalize, whilenote_throw_originandrecord_throw_causecontinue accumulating state. Removingfinalizewithout an equivalent execution-boundary reset can leak memory and reuse stale error-capture/cause-chain state across calls on a reusable VM.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_vm/src/vm.rs` around lines 2299 - 2300, Restore the execution-boundary cleanup previously performed by finalize in the VM call lifecycle, ensuring thrown_value_causes, note_throw_origin state, and record_throw_cause state are reset before a reusable VM handles the next call. Keep get_unscheduled_future and its future-reference behavior unchanged, and use the existing finalize cleanup logic rather than duplicating it.baml_language/crates/bex_vm_types/src/bytecode.rs (1)
1931-1987: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRemove the stale
resolve_constantsdocumentation reference.
resolved_constantsis the only current reference toBytecode::resolve_constants, which no longer exists. Doc links are treated as warnings, so this can break builds under-D warningsand misstates where resolution occurs.Proposed fix
- /// Resolved constants (resolved from `constants` at load time via [`Bytecode::resolve_constants`]). + /// Resolved constants, populated by the program loader at load time.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_vm_types/src/bytecode.rs` around lines 1931 - 1987, Remove the stale documentation reference to Bytecode::resolve_constants, leaving the current resolved_constants field and surrounding Bytecode methods unchanged. Ensure no documentation or doc link refers to the nonexistent resolve_constants symbol.
🧹 Nitpick comments (3)
baml_language/crates/bex_sap/src/deserializer/types.rs (1)
153-153: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove now-empty
implblock.After removing
explanation_json/explanation_impl, thisimpl<N: TypeIdent> BamlValueWithFlags<'_, '_, '_, N> {}block is empty and serves no purpose.🧹 Proposed cleanup
-impl<N: TypeIdent> BamlValueWithFlags<'_, '_, '_, N> {} - #[allow(clippy::must_use_candidate)]🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_sap/src/deserializer/types.rs` at line 153, Remove the now-empty `impl<N: TypeIdent> BamlValueWithFlags<'_, '_, '_, N> {}` block from the `BamlValueWithFlags` implementation area, leaving the surrounding implementations unchanged.baml_language/crates/baml_base/src/core_types.rs (1)
301-303: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the unused
ModuleIdplaceholder.
ModuleIdis only declared here and in its emptyimpl, is not constructed or read bybaml_language, and has no public constructor/accessor — so it adds dead code/maintainability noise.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/baml_base/src/core_types.rs` around lines 301 - 303, Remove the unused ModuleId struct and its empty impl block from core_types.rs, ensuring no related placeholder declarations remain.baml_language/crates/baml_compiler2_mir/src/lower.rs (1)
1065-1065: 📐 Maintainability & Code Quality | 🔵 TrivialRun the required Rust library tests before merge.
As per coding guidelines, run
cargo test --libwhenever Rust code changes.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/baml_compiler2_mir/src/lower.rs` at line 1065, Before merging the Rust changes involving ty_to_template_from_resolved_ty, run the required library test suite with cargo test --lib and address any failures.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@baml_language/forks/aws-bedrock/src/lib.rs`:
- Around line 135-137: Preserve external construction of S3Location values with
a bucket owner by keeping bucket_owner publicly settable or adding a public
constructor/builder that accepts it. Update the S3Location construction API
around new while retaining serialization of Some(bucket_owner) for AWS requests.
---
Outside diff comments:
In `@baml_language/crates/bex_events/src/prof/drain.rs`:
- Around line 127-153: The cooperative drain lifecycle is incomplete because
drain_until_idle does not finalize engines before cleanup while transcode
retains closed-engine diagnostics. Add an internal close transition and invoke
it before cooperative cleanup, including close_engine for each relevant engine;
alternatively remove closed_engines and all post-close diagnostic handling from
CooperativeProfileDrain if cooperative drains do not require finalization.
In `@baml_language/crates/bex_heap/src/heap.rs`:
- Around line 860-866: Update get_object to validate the HeapPtr before calling
idx.get(), using the shared epoch/pointer-validation path already used by heap
debugging. Ensure heap_debugger::real::debug_assert_valid_value rejects stale or
from-space pointers before dereferencing, while preserving the existing sentinel
assertion and object return behavior.
In `@baml_language/crates/bex_vm_types/src/bytecode.rs`:
- Around line 1931-1987: Remove the stale documentation reference to
Bytecode::resolve_constants, leaving the current resolved_constants field and
surrounding Bytecode methods unchanged. Ensure no documentation or doc link
refers to the nonexistent resolve_constants symbol.
In `@baml_language/crates/bex_vm/src/vm.rs`:
- Around line 1616-1625: Make Vm::collect_frame_roots publicly accessible so the
separate bex_engine crate can invoke it during GC root collection. Preserve the
existing root aggregation behavior for frame functions and native continuations.
- Around line 2299-2300: Restore the execution-boundary cleanup previously
performed by finalize in the VM call lifecycle, ensuring thrown_value_causes,
note_throw_origin state, and record_throw_cause state are reset before a
reusable VM handles the next call. Keep get_unscheduled_future and its
future-reference behavior unchanged, and use the existing finalize cleanup logic
rather than duplicating it.
---
Nitpick comments:
In `@baml_language/crates/baml_base/src/core_types.rs`:
- Around line 301-303: Remove the unused ModuleId struct and its empty impl
block from core_types.rs, ensuring no related placeholder declarations remain.
In `@baml_language/crates/baml_compiler2_mir/src/lower.rs`:
- Line 1065: Before merging the Rust changes involving
ty_to_template_from_resolved_ty, run the required library test suite with cargo
test --lib and address any failures.
In `@baml_language/crates/bex_sap/src/deserializer/types.rs`:
- Line 153: Remove the now-empty `impl<N: TypeIdent> BamlValueWithFlags<'_, '_,
'_, N> {}` block from the `BamlValueWithFlags` implementation area, leaving the
surrounding implementations unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 60aa7596-2b93-4245-b674-1d6a9590e75c
📒 Files selected for processing (274)
.github/workflows/ci.yaml.pre-commit-config.yamlbaml_language/crates/baml_base/src/core_types.rsbaml_language/crates/baml_base/src/debug_log.rsbaml_language/crates/baml_base/src/lib.rsbaml_language/crates/baml_base/src/qualified_name.rsbaml_language/crates/baml_builtins2/src/adt.rsbaml_language/crates/baml_builtins2/src/lib.rsbaml_language/crates/baml_builtins2/src/media.rsbaml_language/crates/baml_builtins2_codegen/src/types.rsbaml_language/crates/baml_codegen_types/src/symbols.rsbaml_language/crates/baml_compiler2_ast/src/ast.rsbaml_language/crates/baml_compiler2_ast/src/cleanup_guard.rsbaml_language/crates/baml_compiler2_ast/src/docstring.rsbaml_language/crates/baml_compiler2_ast/src/lib.rsbaml_language/crates/baml_compiler2_ast/src/lower_cst.rsbaml_language/crates/baml_compiler2_ast/src/lower_expr_body.rsbaml_language/crates/baml_compiler2_emit/src/analysis.rsbaml_language/crates/baml_compiler2_hir/src/contributions.rsbaml_language/crates/baml_compiler2_hir/src/diagnostic.rsbaml_language/crates/baml_compiler2_hir/src/ids.rsbaml_language/crates/baml_compiler2_hir/src/item_tree/builder.rsbaml_language/crates/baml_compiler2_hir/src/item_tree/clients.rsbaml_language/crates/baml_compiler2_hir/src/item_tree/lets.rsbaml_language/crates/baml_compiler2_hir/src/lib.rsbaml_language/crates/baml_compiler2_hir/src/package.rsbaml_language/crates/baml_compiler2_hir/src/scope.rsbaml_language/crates/baml_compiler2_hir/src/semantic_index.rsbaml_language/crates/baml_compiler2_hir/src/type_ref.rsbaml_language/crates/baml_compiler2_mir/src/ir.rsbaml_language/crates/baml_compiler2_mir/src/lower.rsbaml_language/crates/baml_compiler2_mir/src/pretty.rsbaml_language/crates/baml_compiler2_ppir/src/expand.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/classes.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/clients.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/common.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/enums.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/functions.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/interfaces.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/lets.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/retry_policies.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/template_strings.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/type_aliases.rsbaml_language/crates/baml_compiler2_ppir/src/lib.rsbaml_language/crates/baml_compiler2_ppir/src/ty.rsbaml_language/crates/baml_compiler2_tir/src/analysis.rsbaml_language/crates/baml_compiler2_tir/src/builder.rsbaml_language/crates/baml_compiler2_tir/src/callable.rsbaml_language/crates/baml_compiler2_tir/src/cycle_detector.rsbaml_language/crates/baml_compiler2_tir/src/exhaustiveness.rsbaml_language/crates/baml_compiler2_tir/src/generics.rsbaml_language/crates/baml_compiler2_tir/src/infer_context.rsbaml_language/crates/baml_compiler2_tir/src/inference.rsbaml_language/crates/baml_compiler2_tir/src/interfaces.rsbaml_language/crates/baml_compiler2_tir/src/interfaces/coherence.rsbaml_language/crates/baml_compiler2_tir/src/interfaces/impl_rules.rsbaml_language/crates/baml_compiler2_tir/src/lib.rsbaml_language/crates/baml_compiler2_tir/src/lower_type_expr.rsbaml_language/crates/baml_compiler2_tir/src/narrowing.rsbaml_language/crates/baml_compiler2_tir/src/normalize.rsbaml_language/crates/baml_compiler2_tir/src/package_interface.rsbaml_language/crates/baml_compiler2_tir/src/pattern_lowering.rsbaml_language/crates/baml_compiler2_tir/src/self_type.rsbaml_language/crates/baml_compiler2_tir/src/signature.rsbaml_language/crates/baml_compiler2_tir/src/throw_inference.rsbaml_language/crates/baml_compiler2_visualization/src/control_flow/mod.rsbaml_language/crates/baml_compiler_diagnostics/src/diagnostic.rsbaml_language/crates/baml_compiler_diagnostics/src/errors/mod.rsbaml_language/crates/baml_compiler_diagnostics/src/lib.rsbaml_language/crates/baml_compiler_diagnostics/src/render.rsbaml_language/crates/baml_compiler_diagnostics/src/to_diagnostic.rsbaml_language/crates/baml_compiler_lexer/src/lib.rsbaml_language/crates/baml_compiler_parser/src/lib.rsbaml_language/crates/baml_compiler_parser/src/parser.rsbaml_language/crates/baml_compiler_syntax/src/ast.rsbaml_language/crates/baml_compiler_syntax/src/builder.rsbaml_language/crates/baml_compiler_syntax/src/lib.rsbaml_language/crates/baml_compiler_syntax/src/syntax_kind.rsbaml_language/crates/baml_compiler_syntax/src/traversal.rsbaml_language/crates/baml_exec/src/auto_cli.rsbaml_language/crates/baml_exec/src/dispatch.rsbaml_language/crates/baml_exec/src/lib.rsbaml_language/crates/baml_exec/src/output.rsbaml_language/crates/baml_fmt/src/ast/attributes.rsbaml_language/crates/baml_fmt/src/ast/declarations.rsbaml_language/crates/baml_fmt/src/ast/expressions.rsbaml_language/crates/baml_fmt/src/ast/mod.rsbaml_language/crates/baml_fmt/src/ast/pattern.rsbaml_language/crates/baml_fmt/src/ast/statements.rsbaml_language/crates/baml_fmt/src/ast/tokens.rsbaml_language/crates/baml_fmt/src/ast/types.rsbaml_language/crates/baml_fmt/src/lib.rsbaml_language/crates/baml_fmt/src/printer.rsbaml_language/crates/baml_fmt/src/trivia_classifier.rsbaml_language/crates/baml_lsp2_actions/src/describe.rsbaml_language/crates/baml_lsp2_actions/src/env_vars.rsbaml_language/crates/baml_lsp2_actions/src/fixes.rsbaml_language/crates/baml_lsp2_actions/src/grep.rsbaml_language/crates/baml_lsp2_actions/src/listing.rsbaml_language/crates/baml_lsp2_actions/src/testing.rsbaml_language/crates/baml_lsp2_actions/src/tokens/classify.rsbaml_language/crates/baml_lsp2_actions/src/type_info.rsbaml_language/crates/baml_lsp2_actions/src/utils.rsbaml_language/crates/baml_lsp2_actions_tests/src/parser.rsbaml_language/crates/baml_lsp2_actions_tests/src/runner.rsbaml_language/crates/baml_lsp_server/src/lib.rsbaml_language/crates/baml_lsp_server/src/lsp_ingress.rsbaml_language/crates/baml_lsp_server/src/lsp_runtime.rsbaml_language/crates/baml_lsp_server/src/playground_env.rsbaml_language/crates/baml_lsp_server/src/playground_http.rsbaml_language/crates/baml_lsp_server/src/playground_io.rsbaml_language/crates/baml_lsp_server/src/playground_runs.rsbaml_language/crates/baml_lsp_server/src/playground_sender.rsbaml_language/crates/baml_lsp_server/src/playground_server.rsbaml_language/crates/baml_lsp_server/src/playground_session.rsbaml_language/crates/baml_lsp_server/src/playground_ws.rsbaml_language/crates/baml_project/src/check.rsbaml_language/crates/baml_project/src/db.rsbaml_language/crates/baml_project/src/lib.rsbaml_language/crates/baml_project/src/position.rsbaml_language/crates/baml_project/src/symbols.rsbaml_language/crates/baml_release/src/lib.rsbaml_language/crates/baml_release/src/manifest.rsbaml_language/crates/baml_release/src/platforms.rsbaml_language/crates/baml_release/src/skills.rsbaml_language/crates/baml_tests/src/compiler2_tir/mod.rsbaml_language/crates/baml_tests/src/engine.rsbaml_language/crates/baml_tests/src/incremental/mod.rsbaml_language/crates/baml_tests/src/lib.rsbaml_language/crates/baml_tests/src/utils/mod.rsbaml_language/crates/baml_type/src/defs.rsbaml_language/crates/baml_type/src/family.rsbaml_language/crates/baml_type/src/lib.rsbaml_language/crates/baml_type/src/names.rsbaml_language/crates/baml_type/src/normalize.rsbaml_language/crates/baml_type/src/primitive.rsbaml_language/crates/baml_type/src/realized_ty.rsbaml_language/crates/baml_type/src/runtime_ty.rsbaml_language/crates/baml_type_runtime/src/lib.rsbaml_language/crates/baml_version/src/lib.rsbaml_language/crates/baml_workspace/src/lib.rsbaml_language/crates/bex_cache/src/lib.rsbaml_language/crates/bex_engine/src/conversion.rsbaml_language/crates/bex_engine/src/function_call_context.rsbaml_language/crates/bex_engine/src/future.rsbaml_language/crates/bex_engine/src/lib.rsbaml_language/crates/bex_engine/src/thread.rsbaml_language/crates/bex_engine/src/trace_heap.rsbaml_language/crates/bex_engine/src/value_capture.rsbaml_language/crates/bex_events/src/history/boundary_writer.rsbaml_language/crates/bex_events/src/history/mod.rsbaml_language/crates/bex_events/src/history/path.rsbaml_language/crates/bex_events/src/history/router.rsbaml_language/crates/bex_events/src/ids.rsbaml_language/crates/bex_events/src/lib.rsbaml_language/crates/bex_events/src/metadata.rsbaml_language/crates/bex_events/src/prof/artifact.rsbaml_language/crates/bex_events/src/prof/clock.rsbaml_language/crates/bex_events/src/prof/config.rsbaml_language/crates/bex_events/src/prof/consumer.rsbaml_language/crates/bex_events/src/prof/drain.rsbaml_language/crates/bex_events/src/prof/file.rsbaml_language/crates/bex_events/src/prof/mod.rsbaml_language/crates/bex_events/src/prof/read.rsbaml_language/crates/bex_events/src/prof/record.rsbaml_language/crates/bex_events/src/prof/transcode.rsbaml_language/crates/bex_events/src/run.rsbaml_language/crates/bex_events/src/span_id.rsbaml_language/crates/bex_events/src/value/artifact.rsbaml_language/crates/bex_events/src/value/encode.rsbaml_language/crates/bex_events/src/value/live_cache.rsbaml_language/crates/bex_events/src/value/mod.rsbaml_language/crates/bex_events/src/value/read.rsbaml_language/crates/bex_events/src/value/record.rsbaml_language/crates/bex_events/src/value/writer.rsbaml_language/crates/bex_external_types/src/bex_external_value.rsbaml_language/crates/bex_external_types/src/handle.rsbaml_language/crates/bex_external_types/src/host_return.rsbaml_language/crates/bex_external_types/src/lib.rsbaml_language/crates/bex_heap/src/accessor.rsbaml_language/crates/bex_heap/src/card_table.rsbaml_language/crates/bex_heap/src/gc.rsbaml_language/crates/bex_heap/src/heap.rsbaml_language/crates/bex_heap/src/heap_debugger/real.rsbaml_language/crates/bex_heap/src/heap_debugger/stub.rsbaml_language/crates/bex_heap/src/lib.rsbaml_language/crates/bex_heap/src/tlab.rsbaml_language/crates/bex_project/src/bex_lsp/mod.rsbaml_language/crates/bex_project/src/bex_lsp/multi_project/mod.rsbaml_language/crates/bex_project/src/bex_lsp/multi_project/request.rsbaml_language/crates/bex_project/src/bex_lsp/multi_project/wasm_helpers.rsbaml_language/crates/bex_project/src/fs.rsbaml_language/crates/bex_project/src/project.rsbaml_language/crates/bex_resource_types/src/host_value.rsbaml_language/crates/bex_resource_types/src/lib.rsbaml_language/crates/bex_sap/src/baml_value.rsbaml_language/crates/bex_sap/src/deserializer/coercer/coerce_enum.rsbaml_language/crates/bex_sap/src/deserializer/coercer/coerce_ty.rsbaml_language/crates/bex_sap/src/deserializer/coercer/mod.rsbaml_language/crates/bex_sap/src/deserializer/deserialize_flags.rsbaml_language/crates/bex_sap/src/deserializer/types.rsbaml_language/crates/bex_sap/src/jsonish/parser/dedent.rsbaml_language/crates/bex_sap/src/jsonish/parser/mod.rsbaml_language/crates/bex_sap/src/jsonish/value.rsbaml_language/crates/bex_sap/src/lib.rsbaml_language/crates/bex_sap/src/sap_model/convert.rsbaml_language/crates/bex_sap/src/sap_model/from_literal.rsbaml_language/crates/bex_sap/src/sap_model/mod.rsbaml_language/crates/bex_str/src/bex_str.rsbaml_language/crates/bex_vm/src/debug.rsbaml_language/crates/bex_vm/src/kperf.rsbaml_language/crates/bex_vm/src/lib.rsbaml_language/crates/bex_vm/src/package_baml/json.rsbaml_language/crates/bex_vm/src/package_baml/mod.rsbaml_language/crates/bex_vm/src/package_boundary/id.rsbaml_language/crates/bex_vm/src/package_boundary/mod.rsbaml_language/crates/bex_vm/src/package_load.rsbaml_language/crates/bex_vm/src/vm.rsbaml_language/crates/bex_vm_types/src/bytecode.rsbaml_language/crates/bex_vm_types/src/errors.rsbaml_language/crates/bex_vm_types/src/heap_ptr.rsbaml_language/crates/bex_vm_types/src/indexable.rsbaml_language/crates/bex_vm_types/src/lazy_biased_mutex.rsbaml_language/crates/bex_vm_types/src/lib.rsbaml_language/crates/bex_vm_types/src/types.rsbaml_language/crates/bex_vm_types/src/types/class.rsbaml_language/crates/bex_vm_types/src/types/containers.rsbaml_language/crates/bex_vm_types/src/types/function.rsbaml_language/crates/bex_vm_types/src/types/future.rsbaml_language/crates/bex_vm_types/src/types/interface.rsbaml_language/crates/bex_vm_types/src/types/value.rsbaml_language/crates/sys_glob/src/lib.rsbaml_language/crates/sys_jinja_types/src/evaluate_type/mod.rsbaml_language/crates/sys_jinja_types/src/evaluate_type/stmt.rsbaml_language/crates/sys_jinja_types/src/evaluate_type/types.rsbaml_language/crates/sys_jinja_types/src/lib.rsbaml_language/crates/sys_llm/src/baml_std.rsbaml_language/crates/sys_llm/src/build_request/google.rsbaml_language/crates/sys_llm/src/build_request/mod.rsbaml_language/crates/sys_llm/src/parse_response/mod.rsbaml_language/crates/sys_llm/src/types/output_format.rsbaml_language/crates/sys_llm/src/types/sap.rsbaml_language/crates/sys_native/src/host_dispatch.rsbaml_language/crates/sys_native/src/lib.rsbaml_language/crates/sys_native/src/registry.rsbaml_language/crates/sys_native/src/shell.rsbaml_language/crates/sys_ops/src/lib.rsbaml_language/crates/sys_types/src/lib.rsbaml_language/crates/tools_sap_visualizer/src/compile.rsbaml_language/crates/tools_sap_visualizer/src/state.rsbaml_language/crates/tools_sap_visualizer/src/ui.rsbaml_language/forks/aws-bedrock/src/lib.rsbaml_language/hawk.tomlbaml_language/scripts/hawkbaml_language/sdk_tests/harness_setup/src/lib.rsbaml_language/sdks/cpp/sdkgen_cpp/src/naming.rsbaml_language/sdks/java/sdkgen_java/src/emit.rsbaml_language/sdks/java/sdkgen_java/src/lib.rsbaml_language/sdks/java/sdkgen_java/src/routing.rsbaml_language/sdks/java/sdkgen_java/src/translate_ty.rsbaml_language/sdks/python/rust/sdkgen_python_pydantic2/src/emit/method.rsbaml_language/sdks/python/rust/sdkgen_python_pydantic2/src/leaf.rsbaml_language/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rsbaml_language/sdks/python/rust/sdkgen_python_pydantic2/src/routing.rsbaml_language/sdks/rust/sdkgen_rust/src/analyze.rsbaml_language/sdks/rust/sdkgen_rust/src/routing.rsbaml_language/sdks/rust/sdkgen_rust/src/translate_ty.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/emit/method.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/leaf.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/lib.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/routing.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript_web.rsmise.toml
💤 Files with no reviewable changes (12)
- baml_language/crates/bex_vm_types/src/errors.rs
- baml_language/crates/baml_version/src/lib.rs
- baml_language/crates/baml_builtins2/src/lib.rs
- baml_language/crates/bex_vm_types/src/heap_ptr.rs
- baml_language/crates/baml_compiler_syntax/src/syntax_kind.rs
- baml_language/crates/baml_compiler2_hir/src/lib.rs
- baml_language/crates/sys_jinja_types/src/lib.rs
- baml_language/crates/bex_vm_types/src/types/interface.rs
- baml_language/crates/baml_builtins2/src/media.rs
- baml_language/crates/baml_lsp2_actions/src/env_vars.rs
- baml_language/crates/baml_project/src/db.rs
- baml_language/crates/bex_heap/src/accessor.rs
| uri: String, | ||
| #[serde(skip_serializing_if = "Option::is_none")] | ||
| pub bucket_owner: Option<String>, | ||
| bucket_owner: Option<String>, |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Preserve a public construction path for bucket_owner.
S3Location remains public, but new accepts only uri; after this change, external callers cannot create a location with bucket_owner: Some(...). The field still serializes, so this removes a supported AWS request option rather than merely hiding dead API. Keep the field public or add a public constructor/builder for it.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@baml_language/forks/aws-bedrock/src/lib.rs` around lines 135 - 137, Preserve
external construction of S3Location values with a bucket owner by keeping
bucket_owner publicly settable or adding a public constructor/builder that
accepts it. Update the S3Location construction API around new while retaining
serialization of Some(bucket_owner) for AWS requests.
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
baml_language/crates/baml_tests/src/utils/mod.rs (1)
162-180: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRemoved incremental-parsing correctness/perf test utilities reduce coverage.
test_all_single_char_edits,assert_trees_equivalent,measure_node_reuse,EditPattern,test_common_edit_patterns, andmeasure_incremental_performanceare removed with no replacement. If incremental reparse correctness (node reuse, tree equivalence across single-char edits) was exercised only through these helpers, that coverage is now gone. Confirm this is intentional (e.g. superseded by other tests) rather than an unintended side effect of the dead-code sweep.Based on path instructions:
**/*.rs: Prefer writing Rust unit tests over integration tests where possible — removing existing unit-test coverage for incremental-parsing behavior should be a deliberate decision, not a byproduct of visibility cleanup.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/baml_tests/src/utils/mod.rs` around lines 162 - 180, Restore the removed incremental-parsing test utilities—test_all_single_char_edits, assert_trees_equivalent, measure_node_reuse, EditPattern, test_common_edit_patterns, and measure_incremental_performance—or replace them with equivalent Rust unit tests covering single-character edit correctness, tree equivalence, node reuse, and performance. Ensure the coverage is not lost as a side effect of the dead-code cleanup.Source: Path instructions
baml_language/crates/bex_vm_types/src/bytecode.rs (1)
1987-1988: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winUpdate the stale
resolve_constantsdocumentation link.
Bytecode::resolve_constantswas removed, but the documentation forBytecode::resolved_constantsstill links to it. That leaves a broken rustdoc intra-doc link and can fail documentation checks when broken links are denied.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_vm_types/src/bytecode.rs` around lines 1987 - 1988, Update the rustdoc for Bytecode::resolved_constants to remove or replace the stale link targeting the removed Bytecode::resolve_constants method. Ensure the documentation uses a valid existing symbol or plain text so rustdoc produces no broken intra-doc links.baml_language/crates/bex_vm_types/src/types/value.rs (1)
112-140: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRemove the stale checked-doc references.
tagged_int_add_checked/tagged_int_sub_checkeddocumentValue::tagged_int_addandValue::tagged_int_sub, but those unchecked helpers were removed. Rewrite the checked docs to describeNoneon i63 overflow and remove the broken intra-doc targets.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_vm_types/src/types/value.rs` around lines 112 - 140, Update the documentation for tagged_int_add_checked and tagged_int_sub_checked to describe their None-on-i63-overflow behavior without referencing the removed Value::tagged_int_add or Value::tagged_int_sub helpers. Remove all broken intra-doc links while preserving the existing safety and result-contract descriptions.
🧹 Nitpick comments (5)
baml_language/crates/baml_compiler2_tir/src/analysis.rs (1)
47-53: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider a small unit test for the
add_edgeself-registration behavior.The added
self.direct.entry(...).or_default()calls fix a real edge case (an edge endpoint that was neveradd_node-ed). A focused#[test]onAnalysisGraphdirectly (add an edge without a prioradd_node, then assert both endpoints appear inanalyze()'s output) would lock in this behavior.Based on path instructions:
**/*.rs: Prefer writing Rust unit tests over integration tests where possible.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/baml_compiler2_tir/src/analysis.rs` around lines 47 - 53, Add a focused Rust unit test for AnalysisGraph::add_edge that inserts an edge without calling add_node first, then verifies analyze() includes both endpoints. Keep the test scoped to the self-registration behavior and use the existing graph/node construction patterns.Source: Path instructions
baml_language/crates/bex_engine/src/lib.rs (1)
2096-2096: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUpdate the stale
start_rundocumentation reference.
BexEngine::start_runwas removed, butBexThreaddocumentation still advertises it. Replace that reference with the current entry API.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_engine/src/lib.rs` at line 2096, Update the BexThread documentation near call_function_bound_args to replace the stale BexEngine::start_run reference with the current entry API, preserving the surrounding documentation.baml_language/crates/bex_heap/src/gc.rs (1)
1001-1001: 📐 Maintainability & Code Quality | 🔵 TrivialRun the required Rust library tests before merge.
cd baml_language cargo test --libAs per coding guidelines, Rust changes require
cargo test --lib, and unit tests should be preferred over integration tests where practical.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_heap/src/gc.rs` at line 1001, Before merging changes to collect_garbage_minor, run the required Rust library test suite from the baml_language project using cargo test --lib, preferring unit-test coverage where practical.baml_language/crates/bex_heap/src/tlab.rs (1)
164-166: 📐 Maintainability & Code Quality | 🔵 TrivialRun the required Rust library tests before merging.
Run
cargo test --libfrom thebaml_languageworkspace and retain the result with the validation evidence.As per coding guidelines, “Always run
cargo test --libif you changed any Rust code.”🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_heap/src/tlab.rs` around lines 164 - 166, Run cargo test --lib from the baml_language workspace after the Rust change in alloc_float, and retain the test output as validation evidence before merging.Source: Coding guidelines
baml_language/crates/bex_sap/src/deserializer/types.rs (1)
153-153: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the leftover empty impl block.
This empty
impl BamlValueWithFlagsis an artifact of removing the explanation helpers and serves no purpose.♻️ Proposed cleanup
-impl<N: TypeIdent> BamlValueWithFlags<'_, '_, '_, N> {} - #[allow(clippy::must_use_candidate)] impl<'s, 'v, 't, T, N: TypeIdent> ValueWithFlags<'s, 'v, 't, T, N> {🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/bex_sap/src/deserializer/types.rs` at line 153, Remove the empty impl block for BamlValueWithFlags, including its generic TypeIdent declaration, since it contains no methods or associated items and serves no purpose.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@baml_language/crates/baml_compiler2_ppir/src/item_data/functions.rs`:
- Line 33: Restore public access to the return_type field in the relevant
function data structure so baml_compiler2_hir signature handling can continue
reading func_data.return_type, or provide a public accessor and update that
consumer accordingly. Then run the required Rust library tests with cargo test
--lib from the baml_language directory.
In `@baml_language/sdk_tests/harness_setup/src/lib.rs`:
- Around line 115-141: Restore an exported workspace-root helper alongside
fixtures_root_from_manifest, or update harness_runner’s run_go_test to use an
equivalent workspace-root resolution. Ensure the separate harness_runner crate
no longer references the removed workspace_root_from_manifest without an
available implementation.
---
Outside diff comments:
In `@baml_language/crates/baml_tests/src/utils/mod.rs`:
- Around line 162-180: Restore the removed incremental-parsing test
utilities—test_all_single_char_edits, assert_trees_equivalent,
measure_node_reuse, EditPattern, test_common_edit_patterns, and
measure_incremental_performance—or replace them with equivalent Rust unit tests
covering single-character edit correctness, tree equivalence, node reuse, and
performance. Ensure the coverage is not lost as a side effect of the dead-code
cleanup.
In `@baml_language/crates/bex_vm_types/src/bytecode.rs`:
- Around line 1987-1988: Update the rustdoc for Bytecode::resolved_constants to
remove or replace the stale link targeting the removed
Bytecode::resolve_constants method. Ensure the documentation uses a valid
existing symbol or plain text so rustdoc produces no broken intra-doc links.
In `@baml_language/crates/bex_vm_types/src/types/value.rs`:
- Around line 112-140: Update the documentation for tagged_int_add_checked and
tagged_int_sub_checked to describe their None-on-i63-overflow behavior without
referencing the removed Value::tagged_int_add or Value::tagged_int_sub helpers.
Remove all broken intra-doc links while preserving the existing safety and
result-contract descriptions.
---
Nitpick comments:
In `@baml_language/crates/baml_compiler2_tir/src/analysis.rs`:
- Around line 47-53: Add a focused Rust unit test for AnalysisGraph::add_edge
that inserts an edge without calling add_node first, then verifies analyze()
includes both endpoints. Keep the test scoped to the self-registration behavior
and use the existing graph/node construction patterns.
In `@baml_language/crates/bex_engine/src/lib.rs`:
- Line 2096: Update the BexThread documentation near call_function_bound_args to
replace the stale BexEngine::start_run reference with the current entry API,
preserving the surrounding documentation.
In `@baml_language/crates/bex_heap/src/gc.rs`:
- Line 1001: Before merging changes to collect_garbage_minor, run the required
Rust library test suite from the baml_language project using cargo test --lib,
preferring unit-test coverage where practical.
In `@baml_language/crates/bex_heap/src/tlab.rs`:
- Around line 164-166: Run cargo test --lib from the baml_language workspace
after the Rust change in alloc_float, and retain the test output as validation
evidence before merging.
In `@baml_language/crates/bex_sap/src/deserializer/types.rs`:
- Line 153: Remove the empty impl block for BamlValueWithFlags, including its
generic TypeIdent declaration, since it contains no methods or associated items
and serves no purpose.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 60aa7596-2b93-4245-b674-1d6a9590e75c
📒 Files selected for processing (274)
.github/workflows/ci.yaml.pre-commit-config.yamlbaml_language/crates/baml_base/src/core_types.rsbaml_language/crates/baml_base/src/debug_log.rsbaml_language/crates/baml_base/src/lib.rsbaml_language/crates/baml_base/src/qualified_name.rsbaml_language/crates/baml_builtins2/src/adt.rsbaml_language/crates/baml_builtins2/src/lib.rsbaml_language/crates/baml_builtins2/src/media.rsbaml_language/crates/baml_builtins2_codegen/src/types.rsbaml_language/crates/baml_codegen_types/src/symbols.rsbaml_language/crates/baml_compiler2_ast/src/ast.rsbaml_language/crates/baml_compiler2_ast/src/cleanup_guard.rsbaml_language/crates/baml_compiler2_ast/src/docstring.rsbaml_language/crates/baml_compiler2_ast/src/lib.rsbaml_language/crates/baml_compiler2_ast/src/lower_cst.rsbaml_language/crates/baml_compiler2_ast/src/lower_expr_body.rsbaml_language/crates/baml_compiler2_emit/src/analysis.rsbaml_language/crates/baml_compiler2_hir/src/contributions.rsbaml_language/crates/baml_compiler2_hir/src/diagnostic.rsbaml_language/crates/baml_compiler2_hir/src/ids.rsbaml_language/crates/baml_compiler2_hir/src/item_tree/builder.rsbaml_language/crates/baml_compiler2_hir/src/item_tree/clients.rsbaml_language/crates/baml_compiler2_hir/src/item_tree/lets.rsbaml_language/crates/baml_compiler2_hir/src/lib.rsbaml_language/crates/baml_compiler2_hir/src/package.rsbaml_language/crates/baml_compiler2_hir/src/scope.rsbaml_language/crates/baml_compiler2_hir/src/semantic_index.rsbaml_language/crates/baml_compiler2_hir/src/type_ref.rsbaml_language/crates/baml_compiler2_mir/src/ir.rsbaml_language/crates/baml_compiler2_mir/src/lower.rsbaml_language/crates/baml_compiler2_mir/src/pretty.rsbaml_language/crates/baml_compiler2_ppir/src/expand.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/classes.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/clients.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/common.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/enums.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/functions.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/interfaces.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/lets.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/retry_policies.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/template_strings.rsbaml_language/crates/baml_compiler2_ppir/src/item_data/type_aliases.rsbaml_language/crates/baml_compiler2_ppir/src/lib.rsbaml_language/crates/baml_compiler2_ppir/src/ty.rsbaml_language/crates/baml_compiler2_tir/src/analysis.rsbaml_language/crates/baml_compiler2_tir/src/builder.rsbaml_language/crates/baml_compiler2_tir/src/callable.rsbaml_language/crates/baml_compiler2_tir/src/cycle_detector.rsbaml_language/crates/baml_compiler2_tir/src/exhaustiveness.rsbaml_language/crates/baml_compiler2_tir/src/generics.rsbaml_language/crates/baml_compiler2_tir/src/infer_context.rsbaml_language/crates/baml_compiler2_tir/src/inference.rsbaml_language/crates/baml_compiler2_tir/src/interfaces.rsbaml_language/crates/baml_compiler2_tir/src/interfaces/coherence.rsbaml_language/crates/baml_compiler2_tir/src/interfaces/impl_rules.rsbaml_language/crates/baml_compiler2_tir/src/lib.rsbaml_language/crates/baml_compiler2_tir/src/lower_type_expr.rsbaml_language/crates/baml_compiler2_tir/src/narrowing.rsbaml_language/crates/baml_compiler2_tir/src/normalize.rsbaml_language/crates/baml_compiler2_tir/src/package_interface.rsbaml_language/crates/baml_compiler2_tir/src/pattern_lowering.rsbaml_language/crates/baml_compiler2_tir/src/self_type.rsbaml_language/crates/baml_compiler2_tir/src/signature.rsbaml_language/crates/baml_compiler2_tir/src/throw_inference.rsbaml_language/crates/baml_compiler2_visualization/src/control_flow/mod.rsbaml_language/crates/baml_compiler_diagnostics/src/diagnostic.rsbaml_language/crates/baml_compiler_diagnostics/src/errors/mod.rsbaml_language/crates/baml_compiler_diagnostics/src/lib.rsbaml_language/crates/baml_compiler_diagnostics/src/render.rsbaml_language/crates/baml_compiler_diagnostics/src/to_diagnostic.rsbaml_language/crates/baml_compiler_lexer/src/lib.rsbaml_language/crates/baml_compiler_parser/src/lib.rsbaml_language/crates/baml_compiler_parser/src/parser.rsbaml_language/crates/baml_compiler_syntax/src/ast.rsbaml_language/crates/baml_compiler_syntax/src/builder.rsbaml_language/crates/baml_compiler_syntax/src/lib.rsbaml_language/crates/baml_compiler_syntax/src/syntax_kind.rsbaml_language/crates/baml_compiler_syntax/src/traversal.rsbaml_language/crates/baml_exec/src/auto_cli.rsbaml_language/crates/baml_exec/src/dispatch.rsbaml_language/crates/baml_exec/src/lib.rsbaml_language/crates/baml_exec/src/output.rsbaml_language/crates/baml_fmt/src/ast/attributes.rsbaml_language/crates/baml_fmt/src/ast/declarations.rsbaml_language/crates/baml_fmt/src/ast/expressions.rsbaml_language/crates/baml_fmt/src/ast/mod.rsbaml_language/crates/baml_fmt/src/ast/pattern.rsbaml_language/crates/baml_fmt/src/ast/statements.rsbaml_language/crates/baml_fmt/src/ast/tokens.rsbaml_language/crates/baml_fmt/src/ast/types.rsbaml_language/crates/baml_fmt/src/lib.rsbaml_language/crates/baml_fmt/src/printer.rsbaml_language/crates/baml_fmt/src/trivia_classifier.rsbaml_language/crates/baml_lsp2_actions/src/describe.rsbaml_language/crates/baml_lsp2_actions/src/env_vars.rsbaml_language/crates/baml_lsp2_actions/src/fixes.rsbaml_language/crates/baml_lsp2_actions/src/grep.rsbaml_language/crates/baml_lsp2_actions/src/listing.rsbaml_language/crates/baml_lsp2_actions/src/testing.rsbaml_language/crates/baml_lsp2_actions/src/tokens/classify.rsbaml_language/crates/baml_lsp2_actions/src/type_info.rsbaml_language/crates/baml_lsp2_actions/src/utils.rsbaml_language/crates/baml_lsp2_actions_tests/src/parser.rsbaml_language/crates/baml_lsp2_actions_tests/src/runner.rsbaml_language/crates/baml_lsp_server/src/lib.rsbaml_language/crates/baml_lsp_server/src/lsp_ingress.rsbaml_language/crates/baml_lsp_server/src/lsp_runtime.rsbaml_language/crates/baml_lsp_server/src/playground_env.rsbaml_language/crates/baml_lsp_server/src/playground_http.rsbaml_language/crates/baml_lsp_server/src/playground_io.rsbaml_language/crates/baml_lsp_server/src/playground_runs.rsbaml_language/crates/baml_lsp_server/src/playground_sender.rsbaml_language/crates/baml_lsp_server/src/playground_server.rsbaml_language/crates/baml_lsp_server/src/playground_session.rsbaml_language/crates/baml_lsp_server/src/playground_ws.rsbaml_language/crates/baml_project/src/check.rsbaml_language/crates/baml_project/src/db.rsbaml_language/crates/baml_project/src/lib.rsbaml_language/crates/baml_project/src/position.rsbaml_language/crates/baml_project/src/symbols.rsbaml_language/crates/baml_release/src/lib.rsbaml_language/crates/baml_release/src/manifest.rsbaml_language/crates/baml_release/src/platforms.rsbaml_language/crates/baml_release/src/skills.rsbaml_language/crates/baml_tests/src/compiler2_tir/mod.rsbaml_language/crates/baml_tests/src/engine.rsbaml_language/crates/baml_tests/src/incremental/mod.rsbaml_language/crates/baml_tests/src/lib.rsbaml_language/crates/baml_tests/src/utils/mod.rsbaml_language/crates/baml_type/src/defs.rsbaml_language/crates/baml_type/src/family.rsbaml_language/crates/baml_type/src/lib.rsbaml_language/crates/baml_type/src/names.rsbaml_language/crates/baml_type/src/normalize.rsbaml_language/crates/baml_type/src/primitive.rsbaml_language/crates/baml_type/src/realized_ty.rsbaml_language/crates/baml_type/src/runtime_ty.rsbaml_language/crates/baml_type_runtime/src/lib.rsbaml_language/crates/baml_version/src/lib.rsbaml_language/crates/baml_workspace/src/lib.rsbaml_language/crates/bex_cache/src/lib.rsbaml_language/crates/bex_engine/src/conversion.rsbaml_language/crates/bex_engine/src/function_call_context.rsbaml_language/crates/bex_engine/src/future.rsbaml_language/crates/bex_engine/src/lib.rsbaml_language/crates/bex_engine/src/thread.rsbaml_language/crates/bex_engine/src/trace_heap.rsbaml_language/crates/bex_engine/src/value_capture.rsbaml_language/crates/bex_events/src/history/boundary_writer.rsbaml_language/crates/bex_events/src/history/mod.rsbaml_language/crates/bex_events/src/history/path.rsbaml_language/crates/bex_events/src/history/router.rsbaml_language/crates/bex_events/src/ids.rsbaml_language/crates/bex_events/src/lib.rsbaml_language/crates/bex_events/src/metadata.rsbaml_language/crates/bex_events/src/prof/artifact.rsbaml_language/crates/bex_events/src/prof/clock.rsbaml_language/crates/bex_events/src/prof/config.rsbaml_language/crates/bex_events/src/prof/consumer.rsbaml_language/crates/bex_events/src/prof/drain.rsbaml_language/crates/bex_events/src/prof/file.rsbaml_language/crates/bex_events/src/prof/mod.rsbaml_language/crates/bex_events/src/prof/read.rsbaml_language/crates/bex_events/src/prof/record.rsbaml_language/crates/bex_events/src/prof/transcode.rsbaml_language/crates/bex_events/src/run.rsbaml_language/crates/bex_events/src/span_id.rsbaml_language/crates/bex_events/src/value/artifact.rsbaml_language/crates/bex_events/src/value/encode.rsbaml_language/crates/bex_events/src/value/live_cache.rsbaml_language/crates/bex_events/src/value/mod.rsbaml_language/crates/bex_events/src/value/read.rsbaml_language/crates/bex_events/src/value/record.rsbaml_language/crates/bex_events/src/value/writer.rsbaml_language/crates/bex_external_types/src/bex_external_value.rsbaml_language/crates/bex_external_types/src/handle.rsbaml_language/crates/bex_external_types/src/host_return.rsbaml_language/crates/bex_external_types/src/lib.rsbaml_language/crates/bex_heap/src/accessor.rsbaml_language/crates/bex_heap/src/card_table.rsbaml_language/crates/bex_heap/src/gc.rsbaml_language/crates/bex_heap/src/heap.rsbaml_language/crates/bex_heap/src/heap_debugger/real.rsbaml_language/crates/bex_heap/src/heap_debugger/stub.rsbaml_language/crates/bex_heap/src/lib.rsbaml_language/crates/bex_heap/src/tlab.rsbaml_language/crates/bex_project/src/bex_lsp/mod.rsbaml_language/crates/bex_project/src/bex_lsp/multi_project/mod.rsbaml_language/crates/bex_project/src/bex_lsp/multi_project/request.rsbaml_language/crates/bex_project/src/bex_lsp/multi_project/wasm_helpers.rsbaml_language/crates/bex_project/src/fs.rsbaml_language/crates/bex_project/src/project.rsbaml_language/crates/bex_resource_types/src/host_value.rsbaml_language/crates/bex_resource_types/src/lib.rsbaml_language/crates/bex_sap/src/baml_value.rsbaml_language/crates/bex_sap/src/deserializer/coercer/coerce_enum.rsbaml_language/crates/bex_sap/src/deserializer/coercer/coerce_ty.rsbaml_language/crates/bex_sap/src/deserializer/coercer/mod.rsbaml_language/crates/bex_sap/src/deserializer/deserialize_flags.rsbaml_language/crates/bex_sap/src/deserializer/types.rsbaml_language/crates/bex_sap/src/jsonish/parser/dedent.rsbaml_language/crates/bex_sap/src/jsonish/parser/mod.rsbaml_language/crates/bex_sap/src/jsonish/value.rsbaml_language/crates/bex_sap/src/lib.rsbaml_language/crates/bex_sap/src/sap_model/convert.rsbaml_language/crates/bex_sap/src/sap_model/from_literal.rsbaml_language/crates/bex_sap/src/sap_model/mod.rsbaml_language/crates/bex_str/src/bex_str.rsbaml_language/crates/bex_vm/src/debug.rsbaml_language/crates/bex_vm/src/kperf.rsbaml_language/crates/bex_vm/src/lib.rsbaml_language/crates/bex_vm/src/package_baml/json.rsbaml_language/crates/bex_vm/src/package_baml/mod.rsbaml_language/crates/bex_vm/src/package_boundary/id.rsbaml_language/crates/bex_vm/src/package_boundary/mod.rsbaml_language/crates/bex_vm/src/package_load.rsbaml_language/crates/bex_vm/src/vm.rsbaml_language/crates/bex_vm_types/src/bytecode.rsbaml_language/crates/bex_vm_types/src/errors.rsbaml_language/crates/bex_vm_types/src/heap_ptr.rsbaml_language/crates/bex_vm_types/src/indexable.rsbaml_language/crates/bex_vm_types/src/lazy_biased_mutex.rsbaml_language/crates/bex_vm_types/src/lib.rsbaml_language/crates/bex_vm_types/src/types.rsbaml_language/crates/bex_vm_types/src/types/class.rsbaml_language/crates/bex_vm_types/src/types/containers.rsbaml_language/crates/bex_vm_types/src/types/function.rsbaml_language/crates/bex_vm_types/src/types/future.rsbaml_language/crates/bex_vm_types/src/types/interface.rsbaml_language/crates/bex_vm_types/src/types/value.rsbaml_language/crates/sys_glob/src/lib.rsbaml_language/crates/sys_jinja_types/src/evaluate_type/mod.rsbaml_language/crates/sys_jinja_types/src/evaluate_type/stmt.rsbaml_language/crates/sys_jinja_types/src/evaluate_type/types.rsbaml_language/crates/sys_jinja_types/src/lib.rsbaml_language/crates/sys_llm/src/baml_std.rsbaml_language/crates/sys_llm/src/build_request/google.rsbaml_language/crates/sys_llm/src/build_request/mod.rsbaml_language/crates/sys_llm/src/parse_response/mod.rsbaml_language/crates/sys_llm/src/types/output_format.rsbaml_language/crates/sys_llm/src/types/sap.rsbaml_language/crates/sys_native/src/host_dispatch.rsbaml_language/crates/sys_native/src/lib.rsbaml_language/crates/sys_native/src/registry.rsbaml_language/crates/sys_native/src/shell.rsbaml_language/crates/sys_ops/src/lib.rsbaml_language/crates/sys_types/src/lib.rsbaml_language/crates/tools_sap_visualizer/src/compile.rsbaml_language/crates/tools_sap_visualizer/src/state.rsbaml_language/crates/tools_sap_visualizer/src/ui.rsbaml_language/forks/aws-bedrock/src/lib.rsbaml_language/hawk.tomlbaml_language/scripts/hawkbaml_language/sdk_tests/harness_setup/src/lib.rsbaml_language/sdks/cpp/sdkgen_cpp/src/naming.rsbaml_language/sdks/java/sdkgen_java/src/emit.rsbaml_language/sdks/java/sdkgen_java/src/lib.rsbaml_language/sdks/java/sdkgen_java/src/routing.rsbaml_language/sdks/java/sdkgen_java/src/translate_ty.rsbaml_language/sdks/python/rust/sdkgen_python_pydantic2/src/emit/method.rsbaml_language/sdks/python/rust/sdkgen_python_pydantic2/src/leaf.rsbaml_language/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rsbaml_language/sdks/python/rust/sdkgen_python_pydantic2/src/routing.rsbaml_language/sdks/rust/sdkgen_rust/src/analyze.rsbaml_language/sdks/rust/sdkgen_rust/src/routing.rsbaml_language/sdks/rust/sdkgen_rust/src/translate_ty.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/emit/method.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/leaf.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/lib.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/routing.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript.rsbaml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript_web.rsmise.toml
💤 Files with no reviewable changes (12)
- baml_language/crates/baml_compiler_syntax/src/syntax_kind.rs
- baml_language/crates/baml_version/src/lib.rs
- baml_language/crates/bex_vm_types/src/errors.rs
- baml_language/crates/bex_vm_types/src/heap_ptr.rs
- baml_language/crates/sys_jinja_types/src/lib.rs
- baml_language/crates/baml_builtins2/src/media.rs
- baml_language/crates/baml_lsp2_actions/src/env_vars.rs
- baml_language/crates/baml_compiler2_hir/src/lib.rs
- baml_language/crates/bex_vm_types/src/types/interface.rs
- baml_language/crates/baml_builtins2/src/lib.rs
- baml_language/crates/baml_project/src/db.rs
- baml_language/crates/bex_heap/src/accessor.rs
babbd42 to
2628caa
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2628caa. Configure here.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
baml_language/crates/baml_compiler_diagnostics/src/diagnostic.rs (1)
567-568: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winAssign unique codes to the new diagnostics.
BuiltinInterfaceNotImplementableis assignedE0153, butGenericSysOpMethodInInterfaceImplalready usesE0153at Line 554. CLI output and downstream consumers cannot distinguish these diagnostic IDs. Shift the new pair to unused codes and update the accompanying comments/tests.Example fix
- DiagnosticId::BuiltinInterfaceNotImplementable => "E0153", - DiagnosticId::BuiltinInterfaceNotABound => "E0154", + DiagnosticId::BuiltinInterfaceNotImplementable => "E0154", + DiagnosticId::BuiltinInterfaceNotABound => "E0155",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@baml_language/crates/baml_compiler_diagnostics/src/diagnostic.rs` around lines 567 - 568, Update the DiagnosticId-to-code mapping so BuiltinInterfaceNotImplementable and BuiltinInterfaceNotABound use unused codes rather than conflicting with GenericSysOpMethodInInterfaceImpl; then update the associated comments and tests to expect the new unique codes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@baml_language/crates/baml_compiler_diagnostics/src/diagnostic.rs`:
- Around line 567-568: Update the DiagnosticId-to-code mapping so
BuiltinInterfaceNotImplementable and BuiltinInterfaceNotABound use unused codes
rather than conflicting with GenericSysOpMethodInInterfaceImpl; then update the
associated comments and tests to expect the new unique codes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: ffc994fe-0745-45ba-9a47-d7c7a8092f7b
📒 Files selected for processing (49)
.github/workflows/ci.yaml.pre-commit-config.yamlbaml_language/crates/baml_base/src/core_types.rsbaml_language/crates/baml_base/src/debug_log.rsbaml_language/crates/baml_base/src/lib.rsbaml_language/crates/baml_base/src/qualified_name.rsbaml_language/crates/baml_builtins2/src/lib.rsbaml_language/crates/baml_builtins2/src/media.rsbaml_language/crates/baml_codegen_types/src/symbols.rsbaml_language/crates/baml_codegen_types/src/ty.rsbaml_language/crates/baml_compiler2_ast/src/ast.rsbaml_language/crates/baml_compiler2_hir/src/lib.rsbaml_language/crates/baml_compiler2_hir/src/scope.rsbaml_language/crates/baml_compiler2_hir/src/semantic_index.rsbaml_language/crates/baml_compiler2_hir/src/type_ref.rsbaml_language/crates/baml_compiler2_mir/src/ir.rsbaml_language/crates/baml_compiler2_ppir/src/lib.rsbaml_language/crates/baml_compiler2_ppir/src/ty.rsbaml_language/crates/baml_compiler2_tir/src/analysis.rsbaml_language/crates/baml_compiler2_tir/src/cycle_detector.rsbaml_language/crates/baml_compiler2_tir/src/exhaustiveness.rsbaml_language/crates/baml_compiler2_tir/src/generics.rsbaml_language/crates/baml_compiler2_tir/src/infer_context.rsbaml_language/crates/baml_compiler2_tir/src/inference.rsbaml_language/crates/baml_compiler2_tir/src/interfaces.rsbaml_language/crates/baml_compiler2_tir/src/lib.rsbaml_language/crates/baml_compiler2_tir/src/package_interface.rsbaml_language/crates/baml_compiler2_tir/src/self_type.rsbaml_language/crates/baml_compiler2_tir/src/throw_inference.rsbaml_language/crates/baml_compiler2_visualization/src/control_flow/mod.rsbaml_language/crates/baml_compiler_diagnostics/src/diagnostic.rsbaml_language/crates/baml_compiler_diagnostics/src/lib.rsbaml_language/crates/baml_compiler_diagnostics/src/render.rsbaml_language/crates/baml_compiler_parser/src/lib.rsbaml_language/crates/baml_compiler_parser/src/parser.rsbaml_language/crates/baml_compiler_syntax/src/ast.rsbaml_language/crates/baml_compiler_syntax/src/syntax_kind.rsbaml_language/crates/baml_compiler_syntax/src/traversal.rsbaml_language/crates/baml_fmt/src/ast/expressions.rsbaml_language/crates/baml_fmt/src/ast/mod.rsbaml_language/crates/baml_fmt/src/ast/tokens.rsbaml_language/crates/baml_fmt/src/printer.rsbaml_language/crates/baml_lsp2_actions/src/env_vars.rsbaml_language/crates/baml_lsp_server/src/lsp_ingress.rsbaml_language/crates/baml_project/src/check.rsbaml_language/crates/baml_project/src/db.rsbaml_language/crates/baml_project/src/lib.rsbaml_language/crates/baml_project/src/position.rsbaml_language/crates/baml_project/src/symbols.rs
💤 Files with no reviewable changes (29)
- baml_language/crates/baml_builtins2/src/media.rs
- baml_language/crates/baml_compiler2_tir/src/throw_inference.rs
- baml_language/crates/baml_project/src/symbols.rs
- baml_language/crates/baml_base/src/debug_log.rs
- baml_language/crates/baml_compiler_syntax/src/syntax_kind.rs
- baml_language/crates/baml_compiler2_tir/src/cycle_detector.rs
- baml_language/crates/baml_fmt/src/ast/tokens.rs
- baml_language/crates/baml_compiler2_ppir/src/ty.rs
- baml_language/crates/baml_compiler2_visualization/src/control_flow/mod.rs
- baml_language/crates/baml_compiler2_hir/src/scope.rs
- baml_language/crates/baml_compiler2_tir/src/analysis.rs
- baml_language/crates/baml_compiler2_tir/src/generics.rs
- baml_language/crates/baml_builtins2/src/lib.rs
- baml_language/crates/baml_compiler_parser/src/parser.rs
- baml_language/crates/baml_lsp2_actions/src/env_vars.rs
- baml_language/crates/baml_project/src/check.rs
- baml_language/crates/baml_compiler2_tir/src/package_interface.rs
- baml_language/crates/baml_base/src/qualified_name.rs
- baml_language/crates/baml_fmt/src/ast/expressions.rs
- baml_language/crates/baml_base/src/core_types.rs
- baml_language/crates/baml_codegen_types/src/ty.rs
- baml_language/crates/baml_compiler2_tir/src/interfaces.rs
- baml_language/crates/baml_fmt/src/ast/mod.rs
- baml_language/crates/baml_compiler2_tir/src/exhaustiveness.rs
- baml_language/crates/baml_project/src/position.rs
- baml_language/crates/baml_compiler2_ast/src/ast.rs
- baml_language/crates/baml_lsp_server/src/lsp_ingress.rs
- baml_language/crates/baml_compiler2_tir/src/lib.rs
- baml_language/crates/baml_compiler2_tir/src/self_type.rs
🚧 Files skipped from review as they are similar to previous changes (4)
- baml_language/crates/baml_compiler_parser/src/lib.rs
- .pre-commit-config.yaml
- baml_language/crates/baml_compiler2_hir/src/lib.rs
- baml_language/crates/baml_project/src/db.rs
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@baml_language/crates/baml_compiler2_tir/src/lower_type_expr.rs`:
- Around line 887-889: Update the rustdoc for the function documented near the
class receiver type builder to replace the incorrect “firewall” reference with
“ClassData”; leave the surrounding documentation unchanged.
In `@baml_language/crates/baml_tests/tests/interfaces.rs`:
- Line 11419: Update the regression-test comment near the
BexExternalValue::Int(0) assertion to state that a.value + 1 would panic if
narrowing were incorrect, keeping the assertion unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 8f49f6a1-9533-4bdf-91f6-9eafd5a07b09
📒 Files selected for processing (10)
baml_language/crates/baml_base/src/debug_log.rsbaml_language/crates/baml_base/src/lib.rsbaml_language/crates/baml_compiler2_tir/src/interfaces.rsbaml_language/crates/baml_compiler2_tir/src/lower_type_expr.rsbaml_language/crates/baml_compiler2_tir/src/self_type.rsbaml_language/crates/baml_compiler_syntax/src/ast.rsbaml_language/crates/baml_tests/tests/interfaces.rsbaml_language/crates/bex_vm/src/vm.rsbaml_language/crates/bex_vm_types/src/bytecode.rsbaml_language/crates/bex_vm_types/src/types/value.rs
💤 Files with no reviewable changes (2)
- baml_language/crates/baml_base/src/debug_log.rs
- baml_language/crates/baml_base/src/lib.rs
🚧 Files skipped from review as they are similar to previous changes (1)
- baml_language/crates/baml_compiler2_tir/src/interfaces.rs

Summary
baml,baml-cli, andbaml-pack-hostbinariesdead-publicanalysis and remove findings to a fixed point, including private tails made unreachable by the public API removalsbex_vm/src/debug.rsutilities with a precise file exclusionscripts/hawkentry point and enforce it in prek and the required CI job42b09e72b2bf79f75aa8ce5f4563576f2dedf4c1with Rust 1.97.1 andrustc-devbecause the latest release does not yet support--only dead-publicWhy
The workspace had accumulated public Rust APIs that no configured production binary could reach. Rust's crate-local lints cannot determine those boundaries across the whole workspace, while running every Hawk lint would mix this focused cleanup with unrelated API-visibility work.
This PR therefore uses:
cargo +1.97.1 hawk check --only dead-public -D warningsThe configuration models shipped native binaries as roots and excludes only known external or generated boundaries. The scan is repeated until no cascading dead-public findings remain.
Impact
This intentionally reduces the source-level Rust API surface of internal
baml_languagecrates and removes about 4,700 lines of unreachable helpers. No runtime behavior change is intended. Bridge/wasm/fork boundaries and VM debugging utilities remain available.The native
File,Socket, andResponseregistry variants were removed together with their resource structs and register/get methods because they formed closed unused islands. The independent WebAssembly response registry is unchanged.Checks
scripts/hawk— 0 findings after rebasing ontoorigin/canarycargo check --workspace --all-featurescargo clippy --workspace --all-targets --all-features -- -D warnings-D warnings -W clippy::disallowed-typescargo fmt --all -- --checkcargo nextest run --all-features --workspace --exclude baml_tests --exclude 'sdk_test_*' --exclude baml_bridge -E 'not binary(=pack_e2e) and not binary(=exit_code_e2e)'— 4,974 passedcargo nextest run -p baml_tests --all-features— 2,868 passedcargo nextest run -p baml_compiler_diagnosticsafter resolving the canary rebase — 17 passedprek validate-config .pre-commit-config.yamlgit diff --checkSummary by CodeRabbit
Refactor
Chores
Note
Medium Risk
Very large, cross-cutting deletions in the compiler and project DB APIs could break out-of-tree callers or miss a still-needed public hook, though boundaries and tests are meant to limit that.
Overview
Introduces Hawk
dead-publicas a workspace gate:hawk.tomlroots on shipped binaries,scripts/hawk, a prek hook, and CI that installs Rust 1.97.1 withrustc-devplus the pinned Hawk binary.The bulk of the diff deletes public Rust APIs (and private code that became unreachable) across compiler crates—
baml_base, HIR/MIR/TIR/PPIR, diagnostics, syntax CST helpers, formatter/printer utilities, andProjectDatabasecompatibility shims—plus whole modules likedebug_logandcycle_detector. Incremental parse entryparse_file_with_cacheis dropped; onlyparse_fileremains exported.Codegen-type
validate_ty/ symbolvalidatepaths and many inference/query iterators are removed. No intended runtime or language behavior change; this shrinks the maintained surface for paths reachable from configured production binaries (with explicit exclusions for bridge/wasm/fork crates).Reviewed by Cursor Bugbot for commit f0ec293. Bugbot is set up for automated code reviews on this repo. Configure here.