Skip to content

baml_language: add PPIR stream diagnostics and centralize virtual file handling#3226

Draft
miguelcsx wants to merge 2 commits intoBoundaryML:canaryfrom
miguelcsx:feat/ppir-stream
Draft

baml_language: add PPIR stream diagnostics and centralize virtual file handling#3226
miguelcsx wants to merge 2 commits intoBoundaryML:canaryfrom
miguelcsx:feat/ppir-stream

Conversation

@miguelcsx
Copy link
Contributor

@miguelcsx miguelcsx commented Mar 9, 2026

This improves the stream-types pipeline by validating @stream.* usage earlier in PPIR and by centralizing virtual file classification in SourceFile.

Mainly inspired by: 06910c5

Before this change:

  • virtual file detection was spread across crates with hardcoded prefixes
  • invalid/conflicting stream attributes were often only handled indirectly or later
  • diagnostics for malformed stream attributes could be noisier or less precise
  • PPIR name collection could behave inconsistently in duplicate-name scenarios

Now we:

  • validate stream attributes directly in PPIR
  • report clearer diagnostics for unknown, invalid, and conflicting stream attributes
  • use a single canonical API for builtin/generated file classification
  • make temp-test projects safer and more isolated

Impact

  • earlier, clearer feedback for invalid @stream.* usage
  • fewer hardcoded virtual-path checks across the compiler
  • more robust diagnostic spans and less noisy reporting on parse-broken files
  • more stable PPIR behavior when duplicate names exist
  • safer, deterministic integration tests

What changed

  • added ppir_stream_diagnostics and integrated it into project diagnostics
  • added ConflictingStreamAttributes diagnostic plumbing and error code
  • centralized builtin/generated file prefix logic in baml_base::SourceFile
  • updated call sites to use canonical builtin path helpers
  • improved PPIR validation span selection and parse-error gating
  • preserved first-seen PPIR name metadata instead of overwriting on duplicates
  • added PPIR diagnostics integration tests and switched them to real temp dirs

…al file handling

- Adds a dedicated PPIR stream diagnostics pass

- Centralizes builtin/generated file handling

- Tightnes diagnostic behavior around stream annotations
@vercel
Copy link

vercel bot commented Mar 9, 2026

@miguelcsx is attempting to deploy a commit to the Boundary Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2026

Important

Review skipped

Draft detected.

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

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 95ec2301-4fdd-4411-b80d-2da75b58008c

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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 and usage tips.

- remove hardcoded strings and use attrs
@miguelcsx
Copy link
Contributor Author

Hi @sxlijin, I was reviewing your commit on PPIR and had a question: should @stream.type(...) support complex types, or only simple names/types? I’d prefer not to complicate things unnecessarily.

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