Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions crates/baml-bridge/TODO.md

This file was deleted.

2 changes: 1 addition & 1 deletion crates/bamltype-derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ fn parse_baml_container_meta(attr: &Attribute, out: &mut ContainerCompatAttrs) -
for meta in parse_meta_list(attr)? {
match meta {
Meta::NameValue(meta) if meta.path.is_ident("name") => {
out.rename = Some(parse_string_expr(&meta.value, meta.span())?);
out.rename = Some(parse_string_expr(&meta.value, meta.path.span())?);
}
Meta::NameValue(meta) if meta.path.is_ident("rename_all") => {
out.rename_all = Some(parse_rename_rule(&meta.value, meta.span())?);
Expand Down
29 changes: 29 additions & 0 deletions crates/bamltype/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# AGENTS (bamltype)

## Baseline Commands

1. `cargo test -p bamltype --tests`
2. `cargo test -p dspy-rs --test typed_integration --test test_typed_alias --test test_typed_prompt_format`

## Test Layers

1. `integration.rs`: runtime behavior and conversion semantics.
2. `contract_frozen_oracle.rs`: frozen contract fixtures for schema/parse/error behavior.
3. `render_options_parity.rs`: frozen fixtures for render option combinations.
4. `golden_parity.rs`: frozen schema text snapshots for canonical examples.
5. `property_parity.rs`: deterministic property tests plus frozen fixtures for key parse/error outputs.
6. `contract_bridge_ui_messages.rs` + `ui.rs`: compile-fail diagnostics and fixture integrity.

## When Editing Behavior

1. Run target tests first:
`cargo test -p bamltype --test contract_frozen_oracle --test render_options_parity --test golden_parity --test property_parity --test contract_bridge_ui_messages --test parity_bridge_api --test ui`
2. If a behavior change is intentional, bless fixtures with `UPDATE_EXPECT=1` for the affected tests only.
3. Rerun all `bamltype` tests without `UPDATE_EXPECT`.
4. Record the behavior change and rationale in the commit message.

## Snapshot Stability Rules

1. Keep fixture serialization canonical (sorted map keys, explicit fields, deterministic seed for proptest).
2. Prefer snapshotting semantic payloads (value/checks/flags/explanations/error fields) over raw debug dumps when possible.
3. Avoid snapshotting non-deterministic data (pointer addresses, hash iteration order).
4 changes: 3 additions & 1 deletion crates/bamltype/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ default = ["derive"]
derive = []

[dev-dependencies]
baml-bridge = { path = "../baml-bridge" }
trybuild = "1.0.96"
serde_json = { version = "1", features = ["float_roundtrip", "preserve_order"] }
expect-test = "1.5.0"
proptest = "1.5.0"
serde = { version = "1", features = ["alloc", "derive", "rc"] }
Loading
Loading