Skip to content

revert: remove unknown companion surface (#4464) - #4469

Merged
antoniosarosi merged 1 commit into
canaryfrom
agent/revert-unknown-companion
Aug 17, 2026
Merged

antoniosarosi merged 1 commit into
canaryfrom
agent/revert-unknown-companion

Conversation

@antoniosarosi

@antoniosarosi antoniosarosi commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Byte-perfect revert of #4464's `baml.Unknown` companion: `unknown` returns to having no member surface, and runtime field reads return to the free-function spelling `reflect.class.get_field(obj, name)`.

Split out of #4466 at Antonio's direction: this revert half merges now; the replacement value-side API (`reflect.class.instance_from`) stays on #4466 for explicit human sign-off.

Verification

Notes

Summary by CodeRabbit

  • Breaking Changes

    • Removed the Unknown built-in type and its instance-based field access method.
    • Unknown values no longer provide instance-method completions for dynamic field access.
  • Changes

    • Runtime class field access now uses the reflective access API.
    • Updated diagnostics and documentation to reflect the supported field-access behavior.
    • Removed obsolete completion and regression coverage for the retired API.

@vercel

vercel Bot commented Aug 17, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
beps Ready Ready Preview Aug 17, 2026 4:50pm
promptfiddle2 Ready Ready Preview Aug 17, 2026 4:50pm

Request Review

@github-actions

Copy link
Copy Markdown

⏭️ Performance benchmarks were skipped

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

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

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

@coderabbitai

coderabbitai Bot commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 234403d0-4214-439e-af5a-d3b3e5e5eb88

📥 Commits

Reviewing files that changed from the base of the PR and between 1a997de and 2c68aa3.

⛔ Files ignored due to path filters (7)
  • baml_language/crates/baml_cli/src/snapshots/baml_cli__describe_command_tests__render_builtin_package_listing.snap is excluded by !**/*.snap
  • baml_language/crates/baml_tests/snapshots/compiles/__baml_std__/baml_tests__compiles____baml_std____03_ppir.snap is excluded by !**/*.snap
  • baml_language/crates/baml_tests/snapshots/compiles/__baml_std__/baml_tests__compiles____baml_std____04_5_mir.snap is excluded by !**/*.snap
  • baml_language/crates/baml_tests/snapshots/compiles/__baml_std__/baml_tests__compiles____baml_std____06_codegen.snap is excluded by !**/*.snap
  • baml_language/crates/baml_tests/src/compiler2_tir/snapshots/baml_tests__compiler2_tir__phase5__snapshot_baml_package_items.snap is excluded by !**/*.snap
  • baml_language/crates/baml_tests/tests/bytecode_format/snapshots/bytecode_format__bytecode_display_expanded.snap is excluded by !**/*.snap
  • baml_language/crates/baml_tests/tests/bytecode_format/snapshots/bytecode_format__bytecode_display_expanded_unoptimized.snap is excluded by !**/*.snap
📒 Files selected for processing (9)
  • CHANGELOG.md
  • baml_language/crates/baml_builtins2/baml_std/baml/core.baml
  • baml_language/crates/baml_builtins2/baml_std/baml/ns_reflect/ns_class/class.baml
  • baml_language/crates/baml_builtins2/keyword_docs/baml_keywords.yaml
  • baml_language/crates/baml_cli/src/describe_command_tests.rs
  • baml_language/crates/baml_compiler2_hir_ty/src/method_resolution.rs
  • baml_language/crates/baml_lsp2_actions/src/completions.rs
  • baml_language/crates/baml_lsp2_actions_tests/test_files/completion/unknown_members.baml
  • baml_language/crates/baml_tests/tests/runtime_classes_and_composites.rs
💤 Files with no reviewable changes (8)
  • baml_language/crates/baml_builtins2/baml_std/baml/ns_reflect/ns_class/class.baml
  • baml_language/crates/baml_builtins2/keyword_docs/baml_keywords.yaml
  • baml_language/crates/baml_cli/src/describe_command_tests.rs
  • baml_language/crates/baml_lsp2_actions_tests/test_files/completion/unknown_members.baml
  • baml_language/crates/baml_lsp2_actions/src/completions.rs
  • baml_language/crates/baml_compiler2_hir_ty/src/method_resolution.rs
  • baml_language/crates/baml_builtins2/baml_std/baml/core.baml
  • CHANGELOG.md

Included review availability: Your plan includes up to 8 reviews per rolling hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change removes the builtin Unknown class and instance get_field access. Compiler and completion mappings are removed. Runtime tests use reflect.class.get_field, and related documentation and regression tests are deleted.

Changes

Unknown instance access removal

Layer / File(s) Summary
Remove Unknown compiler and completion integration
baml_language/crates/baml_builtins2/baml_std/baml/core.baml, baml_language/crates/baml_compiler2_hir_ty/src/method_resolution.rs, baml_language/crates/baml_lsp2_actions/src/completions.rs
The builtin Unknown class and its get_field method are removed. Compiler type mappings and language-server completions for Unknown are also removed.
Retain reflective field access
baml_language/crates/baml_builtins2/baml_std/baml/ns_reflect/ns_class/class.baml, baml_language/crates/baml_tests/tests/runtime_classes_and_composites.rs
Runtime tests use reflect.class.get_field for field reads and validate missing-field and wrong-type diagnostics.
Update documentation and describe tests
CHANGELOG.md, baml_language/crates/baml_builtins2/keyword_docs/baml_keywords.yaml, baml_language/crates/baml_cli/src/describe_command_tests.rs
References to checked field reads through Unknown instance methods are removed from documentation and tests.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 2c68a

The PR restores the prior unknown API and field-read syntax; no actionable merge-blocking risk remains after normal checks, including cargo test --lib.

Suggested reviewers: aaronvg

Poem

A rabbit nibbles old methods away,
While reflective fields remain in play.
Unknown hops out of the class-built lane,
Tests check errors with simpler gain.
Docs grow quiet, clean, and bright—
One less burrow to review tonight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the revert of the unknown companion surface, which is the main change in the pull request.
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.
✨ 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 agent/revert-unknown-companion

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 August 17, 2026 16:43 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 August 17, 2026 16:50 Inactive
@github-actions

Copy link
Copy Markdown

Binary size checks passed

✅ 7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 31.7 MB 12.6 MB file 31.7 MB +5.3 KB (+0.0%) OK
✅ packed-program Linux 🔒 24.9 MB 9.1 MB file 24.9 MB +23.8 KB (+0.1%) OK
✅ baml-cli macOS 🔒 25.4 MB 11.1 MB file 25.4 MB +54.4 KB (+0.2%) OK
✅ packed-program macOS 🔒 20.6 MB 8.2 MB file 20.6 MB +41.7 KB (+0.2%) OK
✅ baml-cli Windows 🔒 27.2 MB 11.3 MB file 27.2 MB +16.3 KB (+0.1%) OK
✅ packed-program Windows 🔒 21.7 MB 8.2 MB file 21.7 MB +9.8 KB (+0.0%) OK
✅ bridge_wasm WASM 21.3 MB 🔒 5.4 MB gzip 5.3 MB +33.4 KB (+0.6%) 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

@antoniosarosi
antoniosarosi added this pull request to the merge queue Aug 17, 2026
Merged via the queue into canary with commit bc509e3 Aug 17, 2026
73 checks passed
@antoniosarosi
antoniosarosi deleted the agent/revert-unknown-companion branch August 17, 2026 17:05
sxlijin added a commit to ryanmazzolini/baml that referenced this pull request Aug 17, 2026
## Summary

- bump all legacy BAML v0 release surfaces from 0.225.0 to 0.226.0 using
the repository version-bump configuration
- add exactly the two verified external-contributor engine changes:
connection pooling from BoundaryML#3975 and OpenAI transcriptions from BoundaryML#4202
- synchronize the new 0.226.0 sections in the top-level and Fern
changelogs
- regenerate all nine integration clients without test-report churn and
update the engine, Rust SDK, and generated Rust integration lockfile
versions

## Release boundary

- 0.225.0 boundary: release PR BoundaryML#4310 / merge commit
da2a673
- BoundaryML#3975 shipped as 521919c
- BoundaryML#4202 merged from reviewed head
ff96fd4 as squash commit
79b8705; the reviewed-head and squash
diffs have the same stable patch ID
- BoundaryML#4464 and its byte-perfect revert BoundaryML#4469 have zero net diff and are
excluded
- rebased onto current canary after BoundaryML#4202 merged

## Validation

- TypeScript runtime build and nine-client generation
- Python runtime build/install and nine-client generation
- deterministic regeneration: unchanged binary diff hash on repeated
generation
- locked Cargo metadata for the engine and Rust SDK workspaces
- generated Rust integration library build: `cargo test --lib --locked`
- OpenAI transcription wiremock closure tests: 2 passed
- generated Python multipart request test: 1 passed
- connection pooling transport test: 1 passed
- HTTP config validation fixtures: 8 passed
- release metadata and workflow contracts: 50 passed
- stale 0.225.0 audit clean across release-owned surfaces; historical
junit.xml intentionally unchanged
- final release diff matches the 0.225.0 workflow-owned file set,
excludes junit.xml test-report churn, and additionally refreshes the two
tracked Rust SDK/integration lockfiles proven stale by locked builds

## Status

- dependency satisfied; rebased onto current canary with the reviewed
BoundaryML#4202 patch present
- all required GitHub Actions checks are green; local and GitHub
CodeRabbit reviews are green with approval and no review threads or
requested changes
- merge-ready; awaiting normal human review

This branch was previously deployed

2 inactive deployments
Preview – promptfiddle2 — 2c68aa33 Deployed Aug 17, 2026 by vercel[bot]
Preview – beps — 2c68aa33 Deployed Aug 17, 2026 by vercel[bot]
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