Skip to content

chore(rust): remove dead public APIs with Hawk - #4114

Merged
aaronvg merged 4 commits into
canaryfrom
codex/hawk-baml-language
Jul 23, 2026
Merged

chore(rust): remove dead public APIs with Hawk#4114
aaronvg merged 4 commits into
canaryfrom
codex/hawk-baml-language

Conversation

@aaronvg

@aaronvg aaronvg commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a Hawk configuration for the shipped baml, baml-cli, and baml-pack-host binaries
  • run only Hawk's dead-public analysis and remove findings to a fixed point, including private tails made unreachable by the public API removals
  • keep bridge, WebAssembly, Google fork, and AWS SigV4 crates as explicit external boundaries
  • preserve the developer-facing bex_vm/src/debug.rs utilities with a precise file exclusion
  • add a scripts/hawk entry point and enforce it in prek and the required CI job
  • pin Hawk at 42b09e72b2bf79f75aa8ce5f4563576f2dedf4c1 with Rust 1.97.1 and rustc-dev because the latest release does not yet support --only dead-public

Why

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 warnings

The 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_language crates 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, and Response registry 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 onto origin/canary
  • cargo check --workspace --all-features
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • WASM workspace clippy with -D warnings -W clippy::disallowed-types
  • cargo fmt --all -- --check
  • cargo 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 passed
  • cargo nextest run -p baml_tests --all-features — 2,868 passed
  • cargo nextest run -p baml_compiler_diagnostics after resolving the canary rebase — 17 passed
  • prek validate-config .pre-commit-config.yaml
  • git diff --check

Summary by CodeRabbit

  • Refactor

    • Reduced and streamlined internal/public library APIs across the compiler, runtime, diagnostics, formatter, project tooling, and SDK generators, removing various convenience helpers.
    • Project checks now return source file paths in addition to source contents, enabling path-based diagnostic/link rendering.
    • Simplified debug/log and diagnostic helpers by narrowing what’s available in debug and removing some previously exposed utilities.
  • Chores

    • Added Hawk lint configuration and a workspace command wrapper.
    • Updated CI toolchain setup to install an additional pinned Rust version and expanded automated tooling installation.

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-public as a workspace gate: hawk.toml roots on shipped binaries, scripts/hawk, a prek hook, and CI that installs Rust 1.97.1 with rustc-dev plus 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, and ProjectDatabase compatibility shims—plus whole modules like debug_log and cycle_detector. Incremental parse entry parse_file_with_cache is dropped; only parse_file remains exported.

Codegen-type validate_ty / symbol validate paths 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.

@vercel

vercel Bot commented Jul 22, 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, Comment Jul 23, 2026 1:50am
promptfiddle Ready Ready Preview, Comment Jul 23, 2026 1:50am
promptfiddle2 Ready Ready Preview, Comment Jul 23, 2026 1:50am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

This 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

A rabbit trims APIs with care,
While Hawk patrols the tooling air.
Rust paths narrow, checks take flight,
CI keeps every boundary tight.
Hop, hop—the workspace shines!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: removing dead public Rust APIs and using Hawk to drive the cleanup.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/hawk-baml-language

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 – beps July 22, 2026 00:27 Inactive
@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.

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 22, 2026 00:34 Inactive
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Binary size checks passed

7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
baml-cli Linux 🔒 25.6 MB 10.9 MB file 25.3 MB +358.3 KB (+1.4%) OK
packed-program Linux 🔒 17.2 MB 7.1 MB file 17.0 MB +172.5 KB (+1.0%) OK
baml-cli macOS 🔒 19.9 MB 9.5 MB file 19.6 MB +281.3 KB (+1.4%) OK
packed-program macOS 🔒 13.4 MB 6.2 MB file 13.2 MB +198.4 KB (+1.5%) OK
baml-cli Windows 🔒 21.4 MB 9.7 MB file 21.1 MB +310.8 KB (+1.5%) OK
packed-program Windows 🔒 14.3 MB 6.3 MB file 14.2 MB +166.4 KB (+1.2%) OK
bridge_wasm WASM 16.2 MB 🔒 4.4 MB gzip 4.4 MB +15.9 KB (+0.4%) 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

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 22, 2026 00:54 Inactive
@vercel
vercel Bot temporarily deployed to Preview – beps July 22, 2026 19:48 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 22, 2026 19:56 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 22, 2026 20:10 Inactive
@aaronvg
aaronvg marked this pull request as ready for review July 22, 2026 21:03

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Preserve the cooperative engine-close lifecycle.

CooperativeProfileDrain no longer has a close transition or close_engine invocation, while transcode still checks closed_engines only 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 dead closed_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 win

Preserve pointer validation before dereferencing HeapPtr.

get_object now dereferences idx before any epoch or pointer validation. heap_debugger/real.rs calls it directly from debug_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 before get_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 lift

Keep the GC-root API reachable from bex_engine.

This method is now private, but its contract says bex_engine calls it during GC root collection. Since bex_engine is 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 lift

Preserve the cleanup previously performed by finalize.

thrown_value_causes documents that it is cleared by finalize, while note_throw_origin and record_throw_cause continue accumulating state. Removing finalize without 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 win

Remove the stale resolve_constants documentation reference.

resolved_constants is the only current reference to Bytecode::resolve_constants, which no longer exists. Doc links are treated as warnings, so this can break builds under -D warnings and 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 value

Remove now-empty impl block.

After removing explanation_json/explanation_impl, this impl<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 value

Remove the unused ModuleId placeholder.

ModuleId is only declared here and in its empty impl, is not constructed or read by baml_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 | 🔵 Trivial

Run the required Rust library tests before merge.

As per coding guidelines, run cargo test --lib whenever 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

📥 Commits

Reviewing files that changed from the base of the PR and between e318148 and babbd42.

📒 Files selected for processing (274)
  • .github/workflows/ci.yaml
  • .pre-commit-config.yaml
  • baml_language/crates/baml_base/src/core_types.rs
  • baml_language/crates/baml_base/src/debug_log.rs
  • baml_language/crates/baml_base/src/lib.rs
  • baml_language/crates/baml_base/src/qualified_name.rs
  • baml_language/crates/baml_builtins2/src/adt.rs
  • baml_language/crates/baml_builtins2/src/lib.rs
  • baml_language/crates/baml_builtins2/src/media.rs
  • baml_language/crates/baml_builtins2_codegen/src/types.rs
  • baml_language/crates/baml_codegen_types/src/symbols.rs
  • baml_language/crates/baml_compiler2_ast/src/ast.rs
  • baml_language/crates/baml_compiler2_ast/src/cleanup_guard.rs
  • baml_language/crates/baml_compiler2_ast/src/docstring.rs
  • baml_language/crates/baml_compiler2_ast/src/lib.rs
  • baml_language/crates/baml_compiler2_ast/src/lower_cst.rs
  • baml_language/crates/baml_compiler2_ast/src/lower_expr_body.rs
  • baml_language/crates/baml_compiler2_emit/src/analysis.rs
  • baml_language/crates/baml_compiler2_hir/src/contributions.rs
  • baml_language/crates/baml_compiler2_hir/src/diagnostic.rs
  • baml_language/crates/baml_compiler2_hir/src/ids.rs
  • baml_language/crates/baml_compiler2_hir/src/item_tree/builder.rs
  • baml_language/crates/baml_compiler2_hir/src/item_tree/clients.rs
  • baml_language/crates/baml_compiler2_hir/src/item_tree/lets.rs
  • baml_language/crates/baml_compiler2_hir/src/lib.rs
  • baml_language/crates/baml_compiler2_hir/src/package.rs
  • baml_language/crates/baml_compiler2_hir/src/scope.rs
  • baml_language/crates/baml_compiler2_hir/src/semantic_index.rs
  • baml_language/crates/baml_compiler2_hir/src/type_ref.rs
  • baml_language/crates/baml_compiler2_mir/src/ir.rs
  • baml_language/crates/baml_compiler2_mir/src/lower.rs
  • baml_language/crates/baml_compiler2_mir/src/pretty.rs
  • baml_language/crates/baml_compiler2_ppir/src/expand.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/classes.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/clients.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/common.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/enums.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/functions.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/interfaces.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/lets.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/retry_policies.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/template_strings.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/type_aliases.rs
  • baml_language/crates/baml_compiler2_ppir/src/lib.rs
  • baml_language/crates/baml_compiler2_ppir/src/ty.rs
  • baml_language/crates/baml_compiler2_tir/src/analysis.rs
  • baml_language/crates/baml_compiler2_tir/src/builder.rs
  • baml_language/crates/baml_compiler2_tir/src/callable.rs
  • baml_language/crates/baml_compiler2_tir/src/cycle_detector.rs
  • baml_language/crates/baml_compiler2_tir/src/exhaustiveness.rs
  • baml_language/crates/baml_compiler2_tir/src/generics.rs
  • baml_language/crates/baml_compiler2_tir/src/infer_context.rs
  • baml_language/crates/baml_compiler2_tir/src/inference.rs
  • baml_language/crates/baml_compiler2_tir/src/interfaces.rs
  • baml_language/crates/baml_compiler2_tir/src/interfaces/coherence.rs
  • baml_language/crates/baml_compiler2_tir/src/interfaces/impl_rules.rs
  • baml_language/crates/baml_compiler2_tir/src/lib.rs
  • baml_language/crates/baml_compiler2_tir/src/lower_type_expr.rs
  • baml_language/crates/baml_compiler2_tir/src/narrowing.rs
  • baml_language/crates/baml_compiler2_tir/src/normalize.rs
  • baml_language/crates/baml_compiler2_tir/src/package_interface.rs
  • baml_language/crates/baml_compiler2_tir/src/pattern_lowering.rs
  • baml_language/crates/baml_compiler2_tir/src/self_type.rs
  • baml_language/crates/baml_compiler2_tir/src/signature.rs
  • baml_language/crates/baml_compiler2_tir/src/throw_inference.rs
  • baml_language/crates/baml_compiler2_visualization/src/control_flow/mod.rs
  • baml_language/crates/baml_compiler_diagnostics/src/diagnostic.rs
  • baml_language/crates/baml_compiler_diagnostics/src/errors/mod.rs
  • baml_language/crates/baml_compiler_diagnostics/src/lib.rs
  • baml_language/crates/baml_compiler_diagnostics/src/render.rs
  • baml_language/crates/baml_compiler_diagnostics/src/to_diagnostic.rs
  • baml_language/crates/baml_compiler_lexer/src/lib.rs
  • baml_language/crates/baml_compiler_parser/src/lib.rs
  • baml_language/crates/baml_compiler_parser/src/parser.rs
  • baml_language/crates/baml_compiler_syntax/src/ast.rs
  • baml_language/crates/baml_compiler_syntax/src/builder.rs
  • baml_language/crates/baml_compiler_syntax/src/lib.rs
  • baml_language/crates/baml_compiler_syntax/src/syntax_kind.rs
  • baml_language/crates/baml_compiler_syntax/src/traversal.rs
  • baml_language/crates/baml_exec/src/auto_cli.rs
  • baml_language/crates/baml_exec/src/dispatch.rs
  • baml_language/crates/baml_exec/src/lib.rs
  • baml_language/crates/baml_exec/src/output.rs
  • baml_language/crates/baml_fmt/src/ast/attributes.rs
  • baml_language/crates/baml_fmt/src/ast/declarations.rs
  • baml_language/crates/baml_fmt/src/ast/expressions.rs
  • baml_language/crates/baml_fmt/src/ast/mod.rs
  • baml_language/crates/baml_fmt/src/ast/pattern.rs
  • baml_language/crates/baml_fmt/src/ast/statements.rs
  • baml_language/crates/baml_fmt/src/ast/tokens.rs
  • baml_language/crates/baml_fmt/src/ast/types.rs
  • baml_language/crates/baml_fmt/src/lib.rs
  • baml_language/crates/baml_fmt/src/printer.rs
  • baml_language/crates/baml_fmt/src/trivia_classifier.rs
  • baml_language/crates/baml_lsp2_actions/src/describe.rs
  • baml_language/crates/baml_lsp2_actions/src/env_vars.rs
  • baml_language/crates/baml_lsp2_actions/src/fixes.rs
  • baml_language/crates/baml_lsp2_actions/src/grep.rs
  • baml_language/crates/baml_lsp2_actions/src/listing.rs
  • baml_language/crates/baml_lsp2_actions/src/testing.rs
  • baml_language/crates/baml_lsp2_actions/src/tokens/classify.rs
  • baml_language/crates/baml_lsp2_actions/src/type_info.rs
  • baml_language/crates/baml_lsp2_actions/src/utils.rs
  • baml_language/crates/baml_lsp2_actions_tests/src/parser.rs
  • baml_language/crates/baml_lsp2_actions_tests/src/runner.rs
  • baml_language/crates/baml_lsp_server/src/lib.rs
  • baml_language/crates/baml_lsp_server/src/lsp_ingress.rs
  • baml_language/crates/baml_lsp_server/src/lsp_runtime.rs
  • baml_language/crates/baml_lsp_server/src/playground_env.rs
  • baml_language/crates/baml_lsp_server/src/playground_http.rs
  • baml_language/crates/baml_lsp_server/src/playground_io.rs
  • baml_language/crates/baml_lsp_server/src/playground_runs.rs
  • baml_language/crates/baml_lsp_server/src/playground_sender.rs
  • baml_language/crates/baml_lsp_server/src/playground_server.rs
  • baml_language/crates/baml_lsp_server/src/playground_session.rs
  • baml_language/crates/baml_lsp_server/src/playground_ws.rs
  • baml_language/crates/baml_project/src/check.rs
  • baml_language/crates/baml_project/src/db.rs
  • baml_language/crates/baml_project/src/lib.rs
  • baml_language/crates/baml_project/src/position.rs
  • baml_language/crates/baml_project/src/symbols.rs
  • baml_language/crates/baml_release/src/lib.rs
  • baml_language/crates/baml_release/src/manifest.rs
  • baml_language/crates/baml_release/src/platforms.rs
  • baml_language/crates/baml_release/src/skills.rs
  • baml_language/crates/baml_tests/src/compiler2_tir/mod.rs
  • baml_language/crates/baml_tests/src/engine.rs
  • baml_language/crates/baml_tests/src/incremental/mod.rs
  • baml_language/crates/baml_tests/src/lib.rs
  • baml_language/crates/baml_tests/src/utils/mod.rs
  • baml_language/crates/baml_type/src/defs.rs
  • baml_language/crates/baml_type/src/family.rs
  • baml_language/crates/baml_type/src/lib.rs
  • baml_language/crates/baml_type/src/names.rs
  • baml_language/crates/baml_type/src/normalize.rs
  • baml_language/crates/baml_type/src/primitive.rs
  • baml_language/crates/baml_type/src/realized_ty.rs
  • baml_language/crates/baml_type/src/runtime_ty.rs
  • baml_language/crates/baml_type_runtime/src/lib.rs
  • baml_language/crates/baml_version/src/lib.rs
  • baml_language/crates/baml_workspace/src/lib.rs
  • baml_language/crates/bex_cache/src/lib.rs
  • baml_language/crates/bex_engine/src/conversion.rs
  • baml_language/crates/bex_engine/src/function_call_context.rs
  • baml_language/crates/bex_engine/src/future.rs
  • baml_language/crates/bex_engine/src/lib.rs
  • baml_language/crates/bex_engine/src/thread.rs
  • baml_language/crates/bex_engine/src/trace_heap.rs
  • baml_language/crates/bex_engine/src/value_capture.rs
  • baml_language/crates/bex_events/src/history/boundary_writer.rs
  • baml_language/crates/bex_events/src/history/mod.rs
  • baml_language/crates/bex_events/src/history/path.rs
  • baml_language/crates/bex_events/src/history/router.rs
  • baml_language/crates/bex_events/src/ids.rs
  • baml_language/crates/bex_events/src/lib.rs
  • baml_language/crates/bex_events/src/metadata.rs
  • baml_language/crates/bex_events/src/prof/artifact.rs
  • baml_language/crates/bex_events/src/prof/clock.rs
  • baml_language/crates/bex_events/src/prof/config.rs
  • baml_language/crates/bex_events/src/prof/consumer.rs
  • baml_language/crates/bex_events/src/prof/drain.rs
  • baml_language/crates/bex_events/src/prof/file.rs
  • baml_language/crates/bex_events/src/prof/mod.rs
  • baml_language/crates/bex_events/src/prof/read.rs
  • baml_language/crates/bex_events/src/prof/record.rs
  • baml_language/crates/bex_events/src/prof/transcode.rs
  • baml_language/crates/bex_events/src/run.rs
  • baml_language/crates/bex_events/src/span_id.rs
  • baml_language/crates/bex_events/src/value/artifact.rs
  • baml_language/crates/bex_events/src/value/encode.rs
  • baml_language/crates/bex_events/src/value/live_cache.rs
  • baml_language/crates/bex_events/src/value/mod.rs
  • baml_language/crates/bex_events/src/value/read.rs
  • baml_language/crates/bex_events/src/value/record.rs
  • baml_language/crates/bex_events/src/value/writer.rs
  • baml_language/crates/bex_external_types/src/bex_external_value.rs
  • baml_language/crates/bex_external_types/src/handle.rs
  • baml_language/crates/bex_external_types/src/host_return.rs
  • baml_language/crates/bex_external_types/src/lib.rs
  • baml_language/crates/bex_heap/src/accessor.rs
  • baml_language/crates/bex_heap/src/card_table.rs
  • baml_language/crates/bex_heap/src/gc.rs
  • baml_language/crates/bex_heap/src/heap.rs
  • baml_language/crates/bex_heap/src/heap_debugger/real.rs
  • baml_language/crates/bex_heap/src/heap_debugger/stub.rs
  • baml_language/crates/bex_heap/src/lib.rs
  • baml_language/crates/bex_heap/src/tlab.rs
  • baml_language/crates/bex_project/src/bex_lsp/mod.rs
  • baml_language/crates/bex_project/src/bex_lsp/multi_project/mod.rs
  • baml_language/crates/bex_project/src/bex_lsp/multi_project/request.rs
  • baml_language/crates/bex_project/src/bex_lsp/multi_project/wasm_helpers.rs
  • baml_language/crates/bex_project/src/fs.rs
  • baml_language/crates/bex_project/src/project.rs
  • baml_language/crates/bex_resource_types/src/host_value.rs
  • baml_language/crates/bex_resource_types/src/lib.rs
  • baml_language/crates/bex_sap/src/baml_value.rs
  • baml_language/crates/bex_sap/src/deserializer/coercer/coerce_enum.rs
  • baml_language/crates/bex_sap/src/deserializer/coercer/coerce_ty.rs
  • baml_language/crates/bex_sap/src/deserializer/coercer/mod.rs
  • baml_language/crates/bex_sap/src/deserializer/deserialize_flags.rs
  • baml_language/crates/bex_sap/src/deserializer/types.rs
  • baml_language/crates/bex_sap/src/jsonish/parser/dedent.rs
  • baml_language/crates/bex_sap/src/jsonish/parser/mod.rs
  • baml_language/crates/bex_sap/src/jsonish/value.rs
  • baml_language/crates/bex_sap/src/lib.rs
  • baml_language/crates/bex_sap/src/sap_model/convert.rs
  • baml_language/crates/bex_sap/src/sap_model/from_literal.rs
  • baml_language/crates/bex_sap/src/sap_model/mod.rs
  • baml_language/crates/bex_str/src/bex_str.rs
  • baml_language/crates/bex_vm/src/debug.rs
  • baml_language/crates/bex_vm/src/kperf.rs
  • baml_language/crates/bex_vm/src/lib.rs
  • baml_language/crates/bex_vm/src/package_baml/json.rs
  • baml_language/crates/bex_vm/src/package_baml/mod.rs
  • baml_language/crates/bex_vm/src/package_boundary/id.rs
  • baml_language/crates/bex_vm/src/package_boundary/mod.rs
  • baml_language/crates/bex_vm/src/package_load.rs
  • baml_language/crates/bex_vm/src/vm.rs
  • baml_language/crates/bex_vm_types/src/bytecode.rs
  • baml_language/crates/bex_vm_types/src/errors.rs
  • baml_language/crates/bex_vm_types/src/heap_ptr.rs
  • baml_language/crates/bex_vm_types/src/indexable.rs
  • baml_language/crates/bex_vm_types/src/lazy_biased_mutex.rs
  • baml_language/crates/bex_vm_types/src/lib.rs
  • baml_language/crates/bex_vm_types/src/types.rs
  • baml_language/crates/bex_vm_types/src/types/class.rs
  • baml_language/crates/bex_vm_types/src/types/containers.rs
  • baml_language/crates/bex_vm_types/src/types/function.rs
  • baml_language/crates/bex_vm_types/src/types/future.rs
  • baml_language/crates/bex_vm_types/src/types/interface.rs
  • baml_language/crates/bex_vm_types/src/types/value.rs
  • baml_language/crates/sys_glob/src/lib.rs
  • baml_language/crates/sys_jinja_types/src/evaluate_type/mod.rs
  • baml_language/crates/sys_jinja_types/src/evaluate_type/stmt.rs
  • baml_language/crates/sys_jinja_types/src/evaluate_type/types.rs
  • baml_language/crates/sys_jinja_types/src/lib.rs
  • baml_language/crates/sys_llm/src/baml_std.rs
  • baml_language/crates/sys_llm/src/build_request/google.rs
  • baml_language/crates/sys_llm/src/build_request/mod.rs
  • baml_language/crates/sys_llm/src/parse_response/mod.rs
  • baml_language/crates/sys_llm/src/types/output_format.rs
  • baml_language/crates/sys_llm/src/types/sap.rs
  • baml_language/crates/sys_native/src/host_dispatch.rs
  • baml_language/crates/sys_native/src/lib.rs
  • baml_language/crates/sys_native/src/registry.rs
  • baml_language/crates/sys_native/src/shell.rs
  • baml_language/crates/sys_ops/src/lib.rs
  • baml_language/crates/sys_types/src/lib.rs
  • baml_language/crates/tools_sap_visualizer/src/compile.rs
  • baml_language/crates/tools_sap_visualizer/src/state.rs
  • baml_language/crates/tools_sap_visualizer/src/ui.rs
  • baml_language/forks/aws-bedrock/src/lib.rs
  • baml_language/hawk.toml
  • baml_language/scripts/hawk
  • baml_language/sdk_tests/harness_setup/src/lib.rs
  • baml_language/sdks/cpp/sdkgen_cpp/src/naming.rs
  • baml_language/sdks/java/sdkgen_java/src/emit.rs
  • baml_language/sdks/java/sdkgen_java/src/lib.rs
  • baml_language/sdks/java/sdkgen_java/src/routing.rs
  • baml_language/sdks/java/sdkgen_java/src/translate_ty.rs
  • baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/emit/method.rs
  • baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/leaf.rs
  • baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rs
  • baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/routing.rs
  • baml_language/sdks/rust/sdkgen_rust/src/analyze.rs
  • baml_language/sdks/rust/sdkgen_rust/src/routing.rs
  • baml_language/sdks/rust/sdkgen_rust/src/translate_ty.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/emit/method.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/leaf.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/lib.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/routing.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript_web.rs
  • mise.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

Comment on lines +135 to +137
uri: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub bucket_owner: Option<String>,
bucket_owner: Option<String>,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Removed incremental-parsing correctness/perf test utilities reduce coverage.

test_all_single_char_edits, assert_trees_equivalent, measure_node_reuse, EditPattern, test_common_edit_patterns, and measure_incremental_performance are 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 win

Update the stale resolve_constants documentation link.

Bytecode::resolve_constants was removed, but the documentation for Bytecode::resolved_constants still 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 win

Remove the stale checked-doc references.

tagged_int_add_checked/tagged_int_sub_checked document Value::tagged_int_add and Value::tagged_int_sub, but those unchecked helpers were removed. Rewrite the checked docs to describe None on 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 value

Consider a small unit test for the add_edge self-registration behavior.

The added self.direct.entry(...).or_default() calls fix a real edge case (an edge endpoint that was never add_node-ed). A focused #[test] on AnalysisGraph directly (add an edge without a prior add_node, then assert both endpoints appear in analyze()'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 win

Update the stale start_run documentation reference.

BexEngine::start_run was removed, but BexThread documentation 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 | 🔵 Trivial

Run the required Rust library tests before merge.

cd baml_language
cargo test --lib

As 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 | 🔵 Trivial

Run the required Rust library tests before merging.

Run cargo test --lib from the baml_language workspace and retain the result with the validation evidence.

As per coding guidelines, “Always run cargo test --lib if 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 value

Remove the leftover empty impl block.

This empty impl BamlValueWithFlags is 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

📥 Commits

Reviewing files that changed from the base of the PR and between e318148 and babbd42.

📒 Files selected for processing (274)
  • .github/workflows/ci.yaml
  • .pre-commit-config.yaml
  • baml_language/crates/baml_base/src/core_types.rs
  • baml_language/crates/baml_base/src/debug_log.rs
  • baml_language/crates/baml_base/src/lib.rs
  • baml_language/crates/baml_base/src/qualified_name.rs
  • baml_language/crates/baml_builtins2/src/adt.rs
  • baml_language/crates/baml_builtins2/src/lib.rs
  • baml_language/crates/baml_builtins2/src/media.rs
  • baml_language/crates/baml_builtins2_codegen/src/types.rs
  • baml_language/crates/baml_codegen_types/src/symbols.rs
  • baml_language/crates/baml_compiler2_ast/src/ast.rs
  • baml_language/crates/baml_compiler2_ast/src/cleanup_guard.rs
  • baml_language/crates/baml_compiler2_ast/src/docstring.rs
  • baml_language/crates/baml_compiler2_ast/src/lib.rs
  • baml_language/crates/baml_compiler2_ast/src/lower_cst.rs
  • baml_language/crates/baml_compiler2_ast/src/lower_expr_body.rs
  • baml_language/crates/baml_compiler2_emit/src/analysis.rs
  • baml_language/crates/baml_compiler2_hir/src/contributions.rs
  • baml_language/crates/baml_compiler2_hir/src/diagnostic.rs
  • baml_language/crates/baml_compiler2_hir/src/ids.rs
  • baml_language/crates/baml_compiler2_hir/src/item_tree/builder.rs
  • baml_language/crates/baml_compiler2_hir/src/item_tree/clients.rs
  • baml_language/crates/baml_compiler2_hir/src/item_tree/lets.rs
  • baml_language/crates/baml_compiler2_hir/src/lib.rs
  • baml_language/crates/baml_compiler2_hir/src/package.rs
  • baml_language/crates/baml_compiler2_hir/src/scope.rs
  • baml_language/crates/baml_compiler2_hir/src/semantic_index.rs
  • baml_language/crates/baml_compiler2_hir/src/type_ref.rs
  • baml_language/crates/baml_compiler2_mir/src/ir.rs
  • baml_language/crates/baml_compiler2_mir/src/lower.rs
  • baml_language/crates/baml_compiler2_mir/src/pretty.rs
  • baml_language/crates/baml_compiler2_ppir/src/expand.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/classes.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/clients.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/common.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/enums.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/functions.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/interfaces.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/lets.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/retry_policies.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/template_strings.rs
  • baml_language/crates/baml_compiler2_ppir/src/item_data/type_aliases.rs
  • baml_language/crates/baml_compiler2_ppir/src/lib.rs
  • baml_language/crates/baml_compiler2_ppir/src/ty.rs
  • baml_language/crates/baml_compiler2_tir/src/analysis.rs
  • baml_language/crates/baml_compiler2_tir/src/builder.rs
  • baml_language/crates/baml_compiler2_tir/src/callable.rs
  • baml_language/crates/baml_compiler2_tir/src/cycle_detector.rs
  • baml_language/crates/baml_compiler2_tir/src/exhaustiveness.rs
  • baml_language/crates/baml_compiler2_tir/src/generics.rs
  • baml_language/crates/baml_compiler2_tir/src/infer_context.rs
  • baml_language/crates/baml_compiler2_tir/src/inference.rs
  • baml_language/crates/baml_compiler2_tir/src/interfaces.rs
  • baml_language/crates/baml_compiler2_tir/src/interfaces/coherence.rs
  • baml_language/crates/baml_compiler2_tir/src/interfaces/impl_rules.rs
  • baml_language/crates/baml_compiler2_tir/src/lib.rs
  • baml_language/crates/baml_compiler2_tir/src/lower_type_expr.rs
  • baml_language/crates/baml_compiler2_tir/src/narrowing.rs
  • baml_language/crates/baml_compiler2_tir/src/normalize.rs
  • baml_language/crates/baml_compiler2_tir/src/package_interface.rs
  • baml_language/crates/baml_compiler2_tir/src/pattern_lowering.rs
  • baml_language/crates/baml_compiler2_tir/src/self_type.rs
  • baml_language/crates/baml_compiler2_tir/src/signature.rs
  • baml_language/crates/baml_compiler2_tir/src/throw_inference.rs
  • baml_language/crates/baml_compiler2_visualization/src/control_flow/mod.rs
  • baml_language/crates/baml_compiler_diagnostics/src/diagnostic.rs
  • baml_language/crates/baml_compiler_diagnostics/src/errors/mod.rs
  • baml_language/crates/baml_compiler_diagnostics/src/lib.rs
  • baml_language/crates/baml_compiler_diagnostics/src/render.rs
  • baml_language/crates/baml_compiler_diagnostics/src/to_diagnostic.rs
  • baml_language/crates/baml_compiler_lexer/src/lib.rs
  • baml_language/crates/baml_compiler_parser/src/lib.rs
  • baml_language/crates/baml_compiler_parser/src/parser.rs
  • baml_language/crates/baml_compiler_syntax/src/ast.rs
  • baml_language/crates/baml_compiler_syntax/src/builder.rs
  • baml_language/crates/baml_compiler_syntax/src/lib.rs
  • baml_language/crates/baml_compiler_syntax/src/syntax_kind.rs
  • baml_language/crates/baml_compiler_syntax/src/traversal.rs
  • baml_language/crates/baml_exec/src/auto_cli.rs
  • baml_language/crates/baml_exec/src/dispatch.rs
  • baml_language/crates/baml_exec/src/lib.rs
  • baml_language/crates/baml_exec/src/output.rs
  • baml_language/crates/baml_fmt/src/ast/attributes.rs
  • baml_language/crates/baml_fmt/src/ast/declarations.rs
  • baml_language/crates/baml_fmt/src/ast/expressions.rs
  • baml_language/crates/baml_fmt/src/ast/mod.rs
  • baml_language/crates/baml_fmt/src/ast/pattern.rs
  • baml_language/crates/baml_fmt/src/ast/statements.rs
  • baml_language/crates/baml_fmt/src/ast/tokens.rs
  • baml_language/crates/baml_fmt/src/ast/types.rs
  • baml_language/crates/baml_fmt/src/lib.rs
  • baml_language/crates/baml_fmt/src/printer.rs
  • baml_language/crates/baml_fmt/src/trivia_classifier.rs
  • baml_language/crates/baml_lsp2_actions/src/describe.rs
  • baml_language/crates/baml_lsp2_actions/src/env_vars.rs
  • baml_language/crates/baml_lsp2_actions/src/fixes.rs
  • baml_language/crates/baml_lsp2_actions/src/grep.rs
  • baml_language/crates/baml_lsp2_actions/src/listing.rs
  • baml_language/crates/baml_lsp2_actions/src/testing.rs
  • baml_language/crates/baml_lsp2_actions/src/tokens/classify.rs
  • baml_language/crates/baml_lsp2_actions/src/type_info.rs
  • baml_language/crates/baml_lsp2_actions/src/utils.rs
  • baml_language/crates/baml_lsp2_actions_tests/src/parser.rs
  • baml_language/crates/baml_lsp2_actions_tests/src/runner.rs
  • baml_language/crates/baml_lsp_server/src/lib.rs
  • baml_language/crates/baml_lsp_server/src/lsp_ingress.rs
  • baml_language/crates/baml_lsp_server/src/lsp_runtime.rs
  • baml_language/crates/baml_lsp_server/src/playground_env.rs
  • baml_language/crates/baml_lsp_server/src/playground_http.rs
  • baml_language/crates/baml_lsp_server/src/playground_io.rs
  • baml_language/crates/baml_lsp_server/src/playground_runs.rs
  • baml_language/crates/baml_lsp_server/src/playground_sender.rs
  • baml_language/crates/baml_lsp_server/src/playground_server.rs
  • baml_language/crates/baml_lsp_server/src/playground_session.rs
  • baml_language/crates/baml_lsp_server/src/playground_ws.rs
  • baml_language/crates/baml_project/src/check.rs
  • baml_language/crates/baml_project/src/db.rs
  • baml_language/crates/baml_project/src/lib.rs
  • baml_language/crates/baml_project/src/position.rs
  • baml_language/crates/baml_project/src/symbols.rs
  • baml_language/crates/baml_release/src/lib.rs
  • baml_language/crates/baml_release/src/manifest.rs
  • baml_language/crates/baml_release/src/platforms.rs
  • baml_language/crates/baml_release/src/skills.rs
  • baml_language/crates/baml_tests/src/compiler2_tir/mod.rs
  • baml_language/crates/baml_tests/src/engine.rs
  • baml_language/crates/baml_tests/src/incremental/mod.rs
  • baml_language/crates/baml_tests/src/lib.rs
  • baml_language/crates/baml_tests/src/utils/mod.rs
  • baml_language/crates/baml_type/src/defs.rs
  • baml_language/crates/baml_type/src/family.rs
  • baml_language/crates/baml_type/src/lib.rs
  • baml_language/crates/baml_type/src/names.rs
  • baml_language/crates/baml_type/src/normalize.rs
  • baml_language/crates/baml_type/src/primitive.rs
  • baml_language/crates/baml_type/src/realized_ty.rs
  • baml_language/crates/baml_type/src/runtime_ty.rs
  • baml_language/crates/baml_type_runtime/src/lib.rs
  • baml_language/crates/baml_version/src/lib.rs
  • baml_language/crates/baml_workspace/src/lib.rs
  • baml_language/crates/bex_cache/src/lib.rs
  • baml_language/crates/bex_engine/src/conversion.rs
  • baml_language/crates/bex_engine/src/function_call_context.rs
  • baml_language/crates/bex_engine/src/future.rs
  • baml_language/crates/bex_engine/src/lib.rs
  • baml_language/crates/bex_engine/src/thread.rs
  • baml_language/crates/bex_engine/src/trace_heap.rs
  • baml_language/crates/bex_engine/src/value_capture.rs
  • baml_language/crates/bex_events/src/history/boundary_writer.rs
  • baml_language/crates/bex_events/src/history/mod.rs
  • baml_language/crates/bex_events/src/history/path.rs
  • baml_language/crates/bex_events/src/history/router.rs
  • baml_language/crates/bex_events/src/ids.rs
  • baml_language/crates/bex_events/src/lib.rs
  • baml_language/crates/bex_events/src/metadata.rs
  • baml_language/crates/bex_events/src/prof/artifact.rs
  • baml_language/crates/bex_events/src/prof/clock.rs
  • baml_language/crates/bex_events/src/prof/config.rs
  • baml_language/crates/bex_events/src/prof/consumer.rs
  • baml_language/crates/bex_events/src/prof/drain.rs
  • baml_language/crates/bex_events/src/prof/file.rs
  • baml_language/crates/bex_events/src/prof/mod.rs
  • baml_language/crates/bex_events/src/prof/read.rs
  • baml_language/crates/bex_events/src/prof/record.rs
  • baml_language/crates/bex_events/src/prof/transcode.rs
  • baml_language/crates/bex_events/src/run.rs
  • baml_language/crates/bex_events/src/span_id.rs
  • baml_language/crates/bex_events/src/value/artifact.rs
  • baml_language/crates/bex_events/src/value/encode.rs
  • baml_language/crates/bex_events/src/value/live_cache.rs
  • baml_language/crates/bex_events/src/value/mod.rs
  • baml_language/crates/bex_events/src/value/read.rs
  • baml_language/crates/bex_events/src/value/record.rs
  • baml_language/crates/bex_events/src/value/writer.rs
  • baml_language/crates/bex_external_types/src/bex_external_value.rs
  • baml_language/crates/bex_external_types/src/handle.rs
  • baml_language/crates/bex_external_types/src/host_return.rs
  • baml_language/crates/bex_external_types/src/lib.rs
  • baml_language/crates/bex_heap/src/accessor.rs
  • baml_language/crates/bex_heap/src/card_table.rs
  • baml_language/crates/bex_heap/src/gc.rs
  • baml_language/crates/bex_heap/src/heap.rs
  • baml_language/crates/bex_heap/src/heap_debugger/real.rs
  • baml_language/crates/bex_heap/src/heap_debugger/stub.rs
  • baml_language/crates/bex_heap/src/lib.rs
  • baml_language/crates/bex_heap/src/tlab.rs
  • baml_language/crates/bex_project/src/bex_lsp/mod.rs
  • baml_language/crates/bex_project/src/bex_lsp/multi_project/mod.rs
  • baml_language/crates/bex_project/src/bex_lsp/multi_project/request.rs
  • baml_language/crates/bex_project/src/bex_lsp/multi_project/wasm_helpers.rs
  • baml_language/crates/bex_project/src/fs.rs
  • baml_language/crates/bex_project/src/project.rs
  • baml_language/crates/bex_resource_types/src/host_value.rs
  • baml_language/crates/bex_resource_types/src/lib.rs
  • baml_language/crates/bex_sap/src/baml_value.rs
  • baml_language/crates/bex_sap/src/deserializer/coercer/coerce_enum.rs
  • baml_language/crates/bex_sap/src/deserializer/coercer/coerce_ty.rs
  • baml_language/crates/bex_sap/src/deserializer/coercer/mod.rs
  • baml_language/crates/bex_sap/src/deserializer/deserialize_flags.rs
  • baml_language/crates/bex_sap/src/deserializer/types.rs
  • baml_language/crates/bex_sap/src/jsonish/parser/dedent.rs
  • baml_language/crates/bex_sap/src/jsonish/parser/mod.rs
  • baml_language/crates/bex_sap/src/jsonish/value.rs
  • baml_language/crates/bex_sap/src/lib.rs
  • baml_language/crates/bex_sap/src/sap_model/convert.rs
  • baml_language/crates/bex_sap/src/sap_model/from_literal.rs
  • baml_language/crates/bex_sap/src/sap_model/mod.rs
  • baml_language/crates/bex_str/src/bex_str.rs
  • baml_language/crates/bex_vm/src/debug.rs
  • baml_language/crates/bex_vm/src/kperf.rs
  • baml_language/crates/bex_vm/src/lib.rs
  • baml_language/crates/bex_vm/src/package_baml/json.rs
  • baml_language/crates/bex_vm/src/package_baml/mod.rs
  • baml_language/crates/bex_vm/src/package_boundary/id.rs
  • baml_language/crates/bex_vm/src/package_boundary/mod.rs
  • baml_language/crates/bex_vm/src/package_load.rs
  • baml_language/crates/bex_vm/src/vm.rs
  • baml_language/crates/bex_vm_types/src/bytecode.rs
  • baml_language/crates/bex_vm_types/src/errors.rs
  • baml_language/crates/bex_vm_types/src/heap_ptr.rs
  • baml_language/crates/bex_vm_types/src/indexable.rs
  • baml_language/crates/bex_vm_types/src/lazy_biased_mutex.rs
  • baml_language/crates/bex_vm_types/src/lib.rs
  • baml_language/crates/bex_vm_types/src/types.rs
  • baml_language/crates/bex_vm_types/src/types/class.rs
  • baml_language/crates/bex_vm_types/src/types/containers.rs
  • baml_language/crates/bex_vm_types/src/types/function.rs
  • baml_language/crates/bex_vm_types/src/types/future.rs
  • baml_language/crates/bex_vm_types/src/types/interface.rs
  • baml_language/crates/bex_vm_types/src/types/value.rs
  • baml_language/crates/sys_glob/src/lib.rs
  • baml_language/crates/sys_jinja_types/src/evaluate_type/mod.rs
  • baml_language/crates/sys_jinja_types/src/evaluate_type/stmt.rs
  • baml_language/crates/sys_jinja_types/src/evaluate_type/types.rs
  • baml_language/crates/sys_jinja_types/src/lib.rs
  • baml_language/crates/sys_llm/src/baml_std.rs
  • baml_language/crates/sys_llm/src/build_request/google.rs
  • baml_language/crates/sys_llm/src/build_request/mod.rs
  • baml_language/crates/sys_llm/src/parse_response/mod.rs
  • baml_language/crates/sys_llm/src/types/output_format.rs
  • baml_language/crates/sys_llm/src/types/sap.rs
  • baml_language/crates/sys_native/src/host_dispatch.rs
  • baml_language/crates/sys_native/src/lib.rs
  • baml_language/crates/sys_native/src/registry.rs
  • baml_language/crates/sys_native/src/shell.rs
  • baml_language/crates/sys_ops/src/lib.rs
  • baml_language/crates/sys_types/src/lib.rs
  • baml_language/crates/tools_sap_visualizer/src/compile.rs
  • baml_language/crates/tools_sap_visualizer/src/state.rs
  • baml_language/crates/tools_sap_visualizer/src/ui.rs
  • baml_language/forks/aws-bedrock/src/lib.rs
  • baml_language/hawk.toml
  • baml_language/scripts/hawk
  • baml_language/sdk_tests/harness_setup/src/lib.rs
  • baml_language/sdks/cpp/sdkgen_cpp/src/naming.rs
  • baml_language/sdks/java/sdkgen_java/src/emit.rs
  • baml_language/sdks/java/sdkgen_java/src/lib.rs
  • baml_language/sdks/java/sdkgen_java/src/routing.rs
  • baml_language/sdks/java/sdkgen_java/src/translate_ty.rs
  • baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/emit/method.rs
  • baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/leaf.rs
  • baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/lib.rs
  • baml_language/sdks/python/rust/sdkgen_python_pydantic2/src/routing.rs
  • baml_language/sdks/rust/sdkgen_rust/src/analyze.rs
  • baml_language/sdks/rust/sdkgen_rust/src/routing.rs
  • baml_language/sdks/rust/sdkgen_rust/src/translate_ty.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/emit/method.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/leaf.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/lib.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/routing.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript.rs
  • baml_language/sdks/typescript/sdkgen_typescript_shared/src/sdkgen_typescript_web.rs
  • mise.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

Comment thread baml_language/crates/baml_compiler2_ppir/src/item_data/functions.rs Outdated
Comment thread baml_language/sdk_tests/harness_setup/src/lib.rs Outdated
@aaronvg
aaronvg force-pushed the codex/hawk-baml-language branch from babbd42 to 2628caa Compare July 23, 2026 00:21
@vercel
vercel Bot temporarily deployed to Preview – beps July 23, 2026 00:22 Inactive

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread baml_language/crates/baml_base/src/debug_log.rs
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 23, 2026 00:29 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Assign unique codes to the new diagnostics.

BuiltinInterfaceNotImplementable is assigned E0153, but GenericSysOpMethodInInterfaceImpl already uses E0153 at 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

📥 Commits

Reviewing files that changed from the base of the PR and between babbd42 and 2628caa.

📒 Files selected for processing (49)
  • .github/workflows/ci.yaml
  • .pre-commit-config.yaml
  • baml_language/crates/baml_base/src/core_types.rs
  • baml_language/crates/baml_base/src/debug_log.rs
  • baml_language/crates/baml_base/src/lib.rs
  • baml_language/crates/baml_base/src/qualified_name.rs
  • baml_language/crates/baml_builtins2/src/lib.rs
  • baml_language/crates/baml_builtins2/src/media.rs
  • baml_language/crates/baml_codegen_types/src/symbols.rs
  • baml_language/crates/baml_codegen_types/src/ty.rs
  • baml_language/crates/baml_compiler2_ast/src/ast.rs
  • baml_language/crates/baml_compiler2_hir/src/lib.rs
  • baml_language/crates/baml_compiler2_hir/src/scope.rs
  • baml_language/crates/baml_compiler2_hir/src/semantic_index.rs
  • baml_language/crates/baml_compiler2_hir/src/type_ref.rs
  • baml_language/crates/baml_compiler2_mir/src/ir.rs
  • baml_language/crates/baml_compiler2_ppir/src/lib.rs
  • baml_language/crates/baml_compiler2_ppir/src/ty.rs
  • baml_language/crates/baml_compiler2_tir/src/analysis.rs
  • baml_language/crates/baml_compiler2_tir/src/cycle_detector.rs
  • baml_language/crates/baml_compiler2_tir/src/exhaustiveness.rs
  • baml_language/crates/baml_compiler2_tir/src/generics.rs
  • baml_language/crates/baml_compiler2_tir/src/infer_context.rs
  • baml_language/crates/baml_compiler2_tir/src/inference.rs
  • baml_language/crates/baml_compiler2_tir/src/interfaces.rs
  • baml_language/crates/baml_compiler2_tir/src/lib.rs
  • baml_language/crates/baml_compiler2_tir/src/package_interface.rs
  • baml_language/crates/baml_compiler2_tir/src/self_type.rs
  • baml_language/crates/baml_compiler2_tir/src/throw_inference.rs
  • baml_language/crates/baml_compiler2_visualization/src/control_flow/mod.rs
  • baml_language/crates/baml_compiler_diagnostics/src/diagnostic.rs
  • baml_language/crates/baml_compiler_diagnostics/src/lib.rs
  • baml_language/crates/baml_compiler_diagnostics/src/render.rs
  • baml_language/crates/baml_compiler_parser/src/lib.rs
  • baml_language/crates/baml_compiler_parser/src/parser.rs
  • baml_language/crates/baml_compiler_syntax/src/ast.rs
  • baml_language/crates/baml_compiler_syntax/src/syntax_kind.rs
  • baml_language/crates/baml_compiler_syntax/src/traversal.rs
  • baml_language/crates/baml_fmt/src/ast/expressions.rs
  • baml_language/crates/baml_fmt/src/ast/mod.rs
  • baml_language/crates/baml_fmt/src/ast/tokens.rs
  • baml_language/crates/baml_fmt/src/printer.rs
  • baml_language/crates/baml_lsp2_actions/src/env_vars.rs
  • baml_language/crates/baml_lsp_server/src/lsp_ingress.rs
  • baml_language/crates/baml_project/src/check.rs
  • baml_language/crates/baml_project/src/db.rs
  • baml_language/crates/baml_project/src/lib.rs
  • baml_language/crates/baml_project/src/position.rs
  • baml_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

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 23, 2026 00:42 Inactive
@vercel
vercel Bot temporarily deployed to Preview – beps July 23, 2026 00:53 Inactive
@aaronvg
aaronvg enabled auto-merge July 23, 2026 00:58

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2628caa and 4070533.

📒 Files selected for processing (10)
  • baml_language/crates/baml_base/src/debug_log.rs
  • baml_language/crates/baml_base/src/lib.rs
  • baml_language/crates/baml_compiler2_tir/src/interfaces.rs
  • baml_language/crates/baml_compiler2_tir/src/lower_type_expr.rs
  • baml_language/crates/baml_compiler2_tir/src/self_type.rs
  • baml_language/crates/baml_compiler_syntax/src/ast.rs
  • baml_language/crates/baml_tests/tests/interfaces.rs
  • baml_language/crates/bex_vm/src/vm.rs
  • baml_language/crates/bex_vm_types/src/bytecode.rs
  • baml_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

Comment thread baml_language/crates/baml_compiler2_tir/src/lower_type_expr.rs Outdated
Comment thread baml_language/crates/baml_tests/tests/interfaces.rs Outdated
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 23, 2026 01:02 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 23, 2026 01:14 Inactive
@vercel
vercel Bot temporarily deployed to Preview – beps July 23, 2026 01:29 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 23, 2026 01:36 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 23, 2026 01:39 Inactive
@vercel
vercel Bot temporarily deployed to Preview – beps July 23, 2026 01:40 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 23, 2026 01:47 Inactive
@aaronvg
aaronvg added this pull request to the merge queue Jul 23, 2026
Merged via the queue into canary with commit b081650 Jul 23, 2026
68 checks passed
@aaronvg
aaronvg deleted the codex/hawk-baml-language branch July 23, 2026 02:02
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.

1 participant