Skip to content

Fix release pipeline contract and integrate Swift fan-in - #4158

Merged
rossirpaulo merged 3 commits into
canaryfrom
paulo/release-pipeline-fix
Jul 23, 2026
Merged

rossirpaulo merged 3 commits into
canaryfrom
paulo/release-pipeline-fix

Conversation

@rossirpaulo

@rossirpaulo rossirpaulo commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • make the eight-RID C# product an explicit release contract backed by the shared CFFI artifacts, with platform-neutral preparation running in parallel and per-RID verification fanning out afterward
  • freeze registry identities, timestamps, and native provenance in the release plan; stamp NuGet/Maven/Gradle consistently; make NuGet retries content-aware; and bind manifests to the exact verified package
  • gate channel advancement on all enabled publishers, rehearse the production manifest in dry runs, and replace the registry ceiling with a measured C# package-size policy
  • preserve Dhilan's Swift build-once/passive-mirror/immutable-publish design while adding SwiftPM to the frozen plan, release completion, production and dry-run manifests, and the post-publish nightly gate
  • make both Swift consumer gates invoke BamlRuntime.nativeVersion() so the native binary cannot be dead-stripped, and make the mirror assembler refuse every pre-existing output path instead of treating a forgeable SOURCE_SHA marker as recursive-delete authority

Swift review

Dhilan's merged PR #4149 chose the right overall direction: one XCFramework build, verification before publication, an immutable GitHub release asset, and a passive baml-swift mirror consumed from a clean project. I kept that architecture.

It did not yet fully adhere to the shared release plan: the Swift publisher was outside the final publisher fan-in, Swift was absent from the frozen registry plan and manifests, nightly dispatch did not wait for the Swift smoke, and both Swift checks only imported/printed without calling native code. Its normal CI passed, but the release-dispatch job was skipped, so those edges were not exercised end to end. This PR closes those correctness gaps. Explicit Swift package-size history and broader generated/simulator coverage should remain measured follow-ups rather than an invented policy in this change.

Validation

  • 13 focused Python release-contract tests pass
  • 45 baml_release Rust tests pass
  • C# managed tests and the CFFI/C# ABI/lifetime probe pass
  • a nightly C# package was produced locally with the planned NuGet version
  • a representative remapped Linux release cdylib compiled and passed the shipping-path scan
  • NuGet normalizer self-tests pass
  • changed release workflows pass actionlint and YAML parsing
  • commit hooks pass except cargo-hawk, which was skipped after its environment failed because gofmt is unavailable; cargo fmt, clippy, and YAML hooks pass independently

Release readiness

No production release was triggered. NuGet package ownership/trusted-publisher configuration still needs an administrative confirmation before declaring the production publisher ready.

Summary by CodeRabbit

  • New Features
    • Added contract-driven C# SDK preparation and platform-aware native staging, with per-target native asset sizing and package digest validation.
    • Enriched release planning with registry-specific versions and released_at, plus verified package digests in generated manifests.
  • Bug Fixes
    • Improved NuGet publishing safety by compare-then-allow republishing based on normalized payload equality.
    • Strengthened fail-closed platform and SDK contract validation (including C#↔native dependency rules).
  • Tests
    • Expanded CI with additional unit tests and stricter version/gating assertions; added new release-contract and manifest/version test suites.
  • Documentation
    • Updated C# SDK release pipeline docs and NuGet normalizer usage (including new comparison mode).

@vercel

vercel Bot commented Jul 23, 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 10:52pm
promptfiddle Ready Ready Preview, Comment Jul 23, 2026 10:52pm
promptfiddle2 Ready Ready Preview, Comment Jul 23, 2026 10:52pm

Request Review

@coderabbitai

coderabbitai Bot commented Jul 23, 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: 15bb2e90-f1a7-4b76-8d70-ae57a62f9390

📥 Commits

Reviewing files that changed from the base of the PR and between 540aefb and 780bb8d.

📒 Files selected for processing (4)
  • .github/workflows/build2-bridge-cffi.reusable.yaml
  • .github/workflows/release-baml-language.yml
  • baml_language/sdks/csharp/bridge_csharp/tools/Baml.NuGetNormalizer/Program.cs
  • scripts/tests/test_release_pipeline_contract.py
🚧 Files skipped from review as they are similar to previous changes (4)
  • .github/workflows/build2-bridge-cffi.reusable.yaml
  • baml_language/sdks/csharp/bridge_csharp/tools/Baml.NuGetNormalizer/Program.cs
  • scripts/tests/test_release_pipeline_contract.py
  • .github/workflows/release-baml-language.yml

📝 Walkthrough

Walkthrough

This change adds contract-driven C# SDK packaging and verification, registry-specific release metadata, package digest recording, expanded release workflow orchestration, stricter Swift checks, reproducible native build flags, and CI coverage for release-plan and NuGet invariants.

Changes

Release contracts and version identities

Layer / File(s) Summary
Platform and release identity contracts
baml_language/crates/baml_release/..., scripts/baml-language-version, scripts/baml-release-manifests, release/platforms.json, release/csharp-package-size-policy.json
C# platform metadata, registry-specific versions, deterministic release timestamps, verified SDK digests, manifest generation, and release-plan validation are expanded.
C# artifact staging and package validation
scripts/baml-csharp-release-contract, baml_language/sdks/csharp/bridge_csharp/...
Native artifacts are staged and verified through provenance JSON, NuGet packages are checked against runtime digests and versions, and package-size policies replace fixed asset and size assumptions.

Workflow execution and publishing

Layer / File(s) Summary
C# preparation and verification workflow
.github/workflows/prepare-csharp-sdk.reusable.yaml, .github/workflows/verify-csharp-product-slice.reusable.yaml, .github/workflows/cargo-tests.reusable.yaml
Reusable workflows prepare deterministic C# inputs, validate generated artifacts, consume the external platform matrix, stage native assets, and run NuGet verification steps.
Release matrix, gates, and manifest publication
.github/workflows/release-baml-language.yml, .github/workflows/publish2-csharp-sdk.yaml, .github/workflows/build2-java-sdk.reusable.yaml, .github/workflows/ci.yaml, .github/workflows/build2-bridge-cffi.reusable.yaml, baml_language/Cross.toml, scripts/assemble-swift-sdk-mirror
Release jobs propagate registry versions and digests, gate publishers, compare existing NuGet payloads, use registry-specific package versions, validate Swift runtime identities, and apply reproducible native build flags.
Release contract and workflow tests
scripts/tests/*, baml_language/crates/baml_release/src/manifest.rs, baml_language/crates/baml_release/src/platforms.rs
Tests validate release-plan behavior, manifest determinism, C# staging failures, workflow dependency wiring, NuGet normalization, and Swift mirror destination handling.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReleasePlan
  participant PrepareCSharp
  participant VerifyCSharp
  participant NuGet
  ReleasePlan->>PrepareCSharp: provide frozen plan and source SHA
  PrepareCSharp->>VerifyCSharp: upload neutral preparation artifact
  VerifyCSharp->>NuGet: stage and verify native package
  NuGet-->>VerifyCSharp: return existing-package comparison
Loading

Possibly related PRs

Poem

I’m a rabbit with packages bright,
Digests tucked safely out of sight.
C# hops through every RID,
Swift checks versions as planned.
Rust paths fade from view—
CI stamps the release anew!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.36% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the core changes: release pipeline contract fixes and Swift fan-in integration.
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 paulo/release-pipeline-fix

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 23, 2026 19:32 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 23, 2026 19:39 Inactive
@github-actions

github-actions Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

Binary size checks passed

✅ 7 passed

Artifact Platform File Gzip Gated on Baseline Delta Status
✅ baml-cli Linux 🔒 26.9 MB 11.5 MB file 26.2 MB +749.1 KB (+2.9%) OK
✅ packed-program Linux 🔒 17.4 MB 7.2 MB file 17.0 MB +392.9 KB (+2.3%) OK
✅ baml-cli macOS 🔒 20.9 MB 10.0 MB file 20.3 MB +596.1 KB (+2.9%) OK
✅ packed-program macOS 🔒 13.6 MB 6.3 MB file 13.2 MB +347.3 KB (+2.6%) OK
✅ baml-cli Windows 🔒 22.6 MB 10.2 MB file 21.9 MB +643.6 KB (+2.9%) OK
✅ packed-program Windows 🔒 14.5 MB 6.4 MB file 14.2 MB +342.2 KB (+2.4%) OK
✅ bridge_wasm WASM 16.4 MB 🔒 4.5 MB gzip 4.4 MB +71.8 KB (+1.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

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 23, 2026 19:54 Inactive
@rossirpaulo
rossirpaulo marked this pull request as ready for review July 23, 2026 20:23
@vercel
vercel Bot temporarily deployed to Preview – beps July 23, 2026 20:25 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 23, 2026 20:32 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.

🧹 Nitpick comments (1)
baml_language/sdks/csharp/bridge_csharp/tools/Baml.NuGetNormalizer/Program.cs (1)

602-633: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Use length-aware reads to avoid a false "not equal" on partial reads.

Stream.Read may return fewer bytes than requested, so two byte-identical (equal-length) files can produce differing leftRead/rightRead at different chunk boundaries and return false. On the compare path that surfaces as a spurious "different product-owned content" failure, blocking an otherwise-valid republish. Prefer ReadExactly/ReadAtLeast (available on net10.0) or fully fill each buffer before comparing.

🤖 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/sdks/csharp/bridge_csharp/tools/Baml.NuGetNormalizer/Program.cs`
around lines 602 - 633, Update FilesEqual to use length-aware reads, such as
ReadExactly or ReadAtLeast, so each comparison processes complete chunks until
the remaining file length is exhausted. Preserve the existing length check,
byte-by-byte comparison, and equal-file result while preventing differing
partial-read boundaries from causing false mismatches.
🤖 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.

Nitpick comments:
In
`@baml_language/sdks/csharp/bridge_csharp/tools/Baml.NuGetNormalizer/Program.cs`:
- Around line 602-633: Update FilesEqual to use length-aware reads, such as
ReadExactly or ReadAtLeast, so each comparison processes complete chunks until
the remaining file length is exhausted. Preserve the existing length check,
byte-by-byte comparison, and equal-file result while preventing differing
partial-read boundaries from causing false mismatches.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 617330db-4127-4964-b43d-040d33c1a5f9

📥 Commits

Reviewing files that changed from the base of the PR and between 4bf53a5 and 5f36b27.

📒 Files selected for processing (27)
  • .github/workflows/build2-bridge-cffi.reusable.yaml
  • .github/workflows/build2-java-sdk.reusable.yaml
  • .github/workflows/cargo-tests.reusable.yaml
  • .github/workflows/ci.yaml
  • .github/workflows/prepare-csharp-sdk.reusable.yaml
  • .github/workflows/publish2-csharp-sdk.yaml
  • .github/workflows/release-baml-language.yml
  • .github/workflows/verify-csharp-product-slice.reusable.yaml
  • baml_language/Cross.toml
  • baml_language/crates/baml_release/src/manifest.rs
  • baml_language/crates/baml_release/src/platforms.rs
  • baml_language/crates/baml_version/src/lib.rs
  • baml_language/sdks/csharp/DEVELOPMENT.md
  • baml_language/sdks/csharp/bridge_csharp/src/Baml.Bridge.csproj
  • baml_language/sdks/csharp/bridge_csharp/tools/Baml.NuGetNormalizer/Program.cs
  • baml_language/sdks/csharp/bridge_csharp/tools/Baml.NuGetNormalizer/README.md
  • baml_language/sdks/csharp/bridge_csharp/tools/pack-product.sh
  • release/csharp-package-size-policy.json
  • release/platforms.json
  • scripts/assemble-swift-sdk-mirror
  • scripts/baml-csharp-release-contract
  • scripts/baml-language-version
  • scripts/baml-release-manifests
  • scripts/tests/test_baml_language_version.py
  • scripts/tests/test_baml_release_manifests.py
  • scripts/tests/test_release_pipeline_contract.py
  • scripts/tests/test_swift_release_contract.py

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 23, 2026 20:52 Inactive
@rossirpaulo
rossirpaulo force-pushed the paulo/release-pipeline-fix branch from 5f36b27 to 3892d56 Compare July 23, 2026 21:52
@vercel
vercel Bot temporarily deployed to Preview – beps July 23, 2026 21:53 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 23, 2026 22:01 Inactive
@vercel
vercel Bot temporarily deployed to Preview – beps July 23, 2026 22:06 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.

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 (2)
.github/workflows/release-baml-language.yml (2)

1597-1650: 🔒 Security & Privacy | 🟠 Major

Bind release-plan values to env vars before interpolating into the manifest-generation script.

Static analysis (zizmor) flags Lines 1633, 1634, 1636, 1647, 1648, 1649 as template-injection risk: ${{ needs.plan.outputs.* }} expressions are expanded directly into the run: shell body instead of being passed through an env: block first, unlike the pattern used elsewhere in this same file (e.g. EXPECTED_VERSION: ${{ needs.plan.outputs.version }} in verify-swift-sdk). Direct expansion means any value containing shell metacharacters gets spliced verbatim into the script before bash ever runs, which is the classic GitHub Actions script-injection vector — even though these particular values currently originate from the internally computed release plan, this pattern degrades the workflow's injection-safety guarantees. Same issue recurs in dry-run-artifacts (Lines 1976-2018). See consolidated comment for both sites.

🤖 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 @.github/workflows/release-baml-language.yml around lines 1597 - 1650, Update
the release-manifest generation step to pass every needs.plan.outputs value used
by the shell script—crates_io_version, nuget_version, swiftpm_version, channel,
version, released_at, pypi_version, and wrapper_version—through the step’s env
block, then reference those environment variables inside the run script instead
of directly interpolating expressions. Apply the same env-binding pattern to the
dry-run-artifacts manifest-generation step.

1939-2018: 🔒 Security & Privacy | 🟠 Major

Same template-injection pattern as the real manifest job.

Lines 1980, 2001, 2002, 2004, 2015 mirror the direct ${{ needs.plan.outputs.* }} expansion flagged in publish-pkg-boundaryml-com (Lines 1597-1650). See consolidated comment.

🤖 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 @.github/workflows/release-baml-language.yml around lines 1939 - 2018, Update
the dry-run-artifacts job’s “Generate dry-run files” step to avoid direct `${{
needs.plan.outputs.* }}` interpolation in the shell script, matching the safe
handling used by publish-pkg-boundaryml-com. Pass the referenced plan outputs
through environment variables or another non-template-injection mechanism, then
use those values for the arguments to scripts/baml-release-manifests, including
the version, channel, release timestamp, package versions, and wrapper-change
flag.
🧹 Nitpick comments (3)
scripts/tests/test_release_pipeline_contract.py (1)

134-134: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use typing.Callable instead of the callable builtin in the annotation.

callable is a builtin function, not a type; type checkers reject it in an annotation. It's harmless at runtime here (local annotation isn't evaluated), so this is purely for type-check cleanliness.

♻️ Proposed change
-        cases: list[tuple[str, callable]] = [
+        cases: list[tuple[str, Callable[[dict], object]]] = [

Add the import near the top:

+from typing import Callable
🤖 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 `@scripts/tests/test_release_pipeline_contract.py` at line 134, Update the type
annotation for cases to use typing.Callable rather than the callable builtin,
and add the corresponding Callable import at the top of the module.
.github/workflows/release-baml-language.yml (2)

563-606: 📐 Maintainability & Code Quality | 🔵 Trivial

Duplicated Swift native-version verification logic.

This main.swift + build/codesign/run block is byte-for-byte duplicated in smoke-swift-release (Lines 1759-1773). Both must independently stay correct for the release-version guarantee to hold; consider extracting the verifier program and shell steps into a shared script/composite action consumed by both jobs. See consolidated comment.

🤖 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 @.github/workflows/release-baml-language.yml around lines 563 - 606, Extract
the duplicated Swift native-version verifier and its build, codesign, and
execution steps into one shared script or composite action, then invoke it from
both this release verification block and the smoke-swift-release job. Preserve
each job’s existing inputs, including EXPECTED_VERSION/BAML_EXPECTED_VERSION,
and keep both jobs independently validating the planned version.

1731-1774: 📐 Maintainability & Code Quality | 🔵 Trivial

Same native-version verification duplicated from verify-swift-sdk.

Env wiring at Lines 1742-1743 is correct, but the main.swift template and build/run steps at Lines 1759-1773 duplicate verify-swift-sdk (Lines 563-606). See consolidated comment.

🤖 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 @.github/workflows/release-baml-language.yml around lines 1731 - 1774, Remove
the duplicated native-version verification and build/run logic from
smoke-swift-release, reusing the existing verify-swift-sdk mechanism instead.
Update the smoke job’s dependencies and invocation so it consumes the published
package while preserving the planned-versus-native version check currently
implemented by verify-swift-sdk.
🤖 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 @.github/workflows/build2-bridge-cffi.reusable.yaml:
- Around line 175-211: Update the RUSTFLAGS setup in the workflow to preserve
the wasm32 target configuration that is clobbered by the exported flags. Add the
target-scoped --cfg getrandom_backend="wasm_js" replacement when TARGET is
wasm32-unknown-unknown, alongside the existing Windows and musl-specific
handling, without changing other target behavior.

---

Outside diff comments:
In @.github/workflows/release-baml-language.yml:
- Around line 1597-1650: Update the release-manifest generation step to pass
every needs.plan.outputs value used by the shell script—crates_io_version,
nuget_version, swiftpm_version, channel, version, released_at, pypi_version, and
wrapper_version—through the step’s env block, then reference those environment
variables inside the run script instead of directly interpolating expressions.
Apply the same env-binding pattern to the dry-run-artifacts manifest-generation
step.
- Around line 1939-2018: Update the dry-run-artifacts job’s “Generate dry-run
files” step to avoid direct `${{ needs.plan.outputs.* }}` interpolation in the
shell script, matching the safe handling used by publish-pkg-boundaryml-com.
Pass the referenced plan outputs through environment variables or another
non-template-injection mechanism, then use those values for the arguments to
scripts/baml-release-manifests, including the version, channel, release
timestamp, package versions, and wrapper-change flag.

---

Nitpick comments:
In @.github/workflows/release-baml-language.yml:
- Around line 563-606: Extract the duplicated Swift native-version verifier and
its build, codesign, and execution steps into one shared script or composite
action, then invoke it from both this release verification block and the
smoke-swift-release job. Preserve each job’s existing inputs, including
EXPECTED_VERSION/BAML_EXPECTED_VERSION, and keep both jobs independently
validating the planned version.
- Around line 1731-1774: Remove the duplicated native-version verification and
build/run logic from smoke-swift-release, reusing the existing verify-swift-sdk
mechanism instead. Update the smoke job’s dependencies and invocation so it
consumes the published package while preserving the planned-versus-native
version check currently implemented by verify-swift-sdk.

In `@scripts/tests/test_release_pipeline_contract.py`:
- Line 134: Update the type annotation for cases to use typing.Callable rather
than the callable builtin, and add the corresponding Callable import at the top
of the module.
🪄 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: d9b0302c-1049-4dde-b726-410177c70298

📥 Commits

Reviewing files that changed from the base of the PR and between 5f36b27 and 3892d56.

📒 Files selected for processing (27)
  • .github/workflows/build2-bridge-cffi.reusable.yaml
  • .github/workflows/build2-java-sdk.reusable.yaml
  • .github/workflows/cargo-tests.reusable.yaml
  • .github/workflows/ci.yaml
  • .github/workflows/prepare-csharp-sdk.reusable.yaml
  • .github/workflows/publish2-csharp-sdk.yaml
  • .github/workflows/release-baml-language.yml
  • .github/workflows/verify-csharp-product-slice.reusable.yaml
  • baml_language/Cross.toml
  • baml_language/crates/baml_release/src/manifest.rs
  • baml_language/crates/baml_release/src/platforms.rs
  • baml_language/crates/baml_version/src/lib.rs
  • baml_language/sdks/csharp/DEVELOPMENT.md
  • baml_language/sdks/csharp/bridge_csharp/src/Baml.Bridge.csproj
  • baml_language/sdks/csharp/bridge_csharp/tools/Baml.NuGetNormalizer/Program.cs
  • baml_language/sdks/csharp/bridge_csharp/tools/Baml.NuGetNormalizer/README.md
  • baml_language/sdks/csharp/bridge_csharp/tools/pack-product.sh
  • release/csharp-package-size-policy.json
  • release/platforms.json
  • scripts/assemble-swift-sdk-mirror
  • scripts/baml-csharp-release-contract
  • scripts/baml-language-version
  • scripts/baml-release-manifests
  • scripts/tests/test_baml_language_version.py
  • scripts/tests/test_baml_release_manifests.py
  • scripts/tests/test_release_pipeline_contract.py
  • scripts/tests/test_swift_release_contract.py
🚧 Files skipped from review as they are similar to previous changes (17)
  • baml_language/sdks/csharp/bridge_csharp/tools/Baml.NuGetNormalizer/README.md
  • release/csharp-package-size-policy.json
  • .github/workflows/build2-java-sdk.reusable.yaml
  • baml_language/sdks/csharp/bridge_csharp/src/Baml.Bridge.csproj
  • .github/workflows/publish2-csharp-sdk.yaml
  • .github/workflows/ci.yaml
  • scripts/baml-release-manifests
  • scripts/assemble-swift-sdk-mirror
  • .github/workflows/cargo-tests.reusable.yaml
  • .github/workflows/prepare-csharp-sdk.reusable.yaml
  • scripts/baml-csharp-release-contract
  • baml_language/crates/baml_release/src/platforms.rs
  • release/platforms.json
  • .github/workflows/verify-csharp-product-slice.reusable.yaml
  • baml_language/sdks/csharp/bridge_csharp/tools/Baml.NuGetNormalizer/Program.cs
  • baml_language/sdks/csharp/bridge_csharp/tools/pack-product.sh
  • scripts/baml-language-version

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 23, 2026 22:13 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 23, 2026 22:26 Inactive
@vercel
vercel Bot temporarily deployed to Preview – beps July 23, 2026 22:31 Inactive
@vercel
vercel Bot temporarily deployed to Preview – promptfiddle2 July 23, 2026 22:39 Inactive
@blacksmith-sh

This comment has been minimized.

@vercel
vercel Bot temporarily deployed to Preview – promptfiddle July 23, 2026 22:52 Inactive
@rossirpaulo
rossirpaulo added this pull request to the merge queue Jul 23, 2026
Merged via the queue into canary with commit c534bbc Jul 23, 2026
123 of 125 checks passed
@rossirpaulo
rossirpaulo deleted the paulo/release-pipeline-fix branch July 23, 2026 23:04
meefs pushed a commit to meefs/baml that referenced this pull request Jul 24, 2026
…aryML#4169)

## Summary

- replace the stale 11-file C# generator assertion with a
preparation-time SHA-256 manifest that binds the complete generated
source tree through verification and publication
- retain essential generated entry-point checks and exact copy
verification in the clean package consumer
- attach the reusable NuGet publisher to the existing
`boundary-tools-prod` environment so Infisical-hydrated `NUGET_USER` is
resolved where `NuGet/login` runs
- align the documented trusted-publishing identity with
`publish2-csharp-sdk.yaml` and remove the invalid
caller-to-reusable-workflow secret forwarding

## Why

The release integration itself was green after BoundaryML#4158, but the production
release failed during C# preparation because Dhilan's Swift/release work
also expanded the generated C# stdlib surface from 11 to 35 legitimate
`.g.cs` files. The hard-coded filename snapshot was not a sound product
invariant. This keeps Dhilan's generator output and changes the release
contract to pin what preparation actually produced, including paths and
hashes, so later additions, removals, or content changes still fail
closed.

The NuGet trusted-publisher policy is configured for the reusable
workflow and existing `boundary-tools-prod` environment. GitHub
environment secrets are resolved in the called job; they are not passed
from the caller.

## Validation

- regenerated `sdk_tests/crates/csharp/primitive_slice` with the current
CLI
- wrote and verified a manifest for all 35 generated `.g.cs` files
- `python3 -m unittest scripts.tests.test_release_pipeline_contract` (9
tests)
- Python compile checks
- workflow YAML parse checks
- `bash -n` on the package consumer
- `git diff --check`
- repository pre-commit hooks, including YAML validation

## Safety

No compiler/runtime semantics, stdlib implementation, platform support,
or shared CFFI artifact format is changed. This PR does not trigger a
production release.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Improvements**
* Added SHA-256–based integrity validation for generated C# client
sources via a generated `generated-sources.sha256` manifest.
* Workflow verification now produces and checks the manifest for the
generated sources directory, including carrying it into product outputs.
* NuGet publishing workflow updates to rely on the reusable workflow’s
own trusted-publishing secret configuration.
* **Bug Fixes**
* Replaced brittle hardcoded `*.g.cs` filename list comparisons with
manifest-driven validation (missing/unexpected/modified detection).
* **Tests**
* Expanded contract and pipeline tests to cover manifest “growth,” exact
pinned content, missing/extra inputs, and invalid manifest data.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

This branch was previously deployed

3 inactive deployments
Preview – promptfiddle — 780bb8d4 Deployed Jul 23, 2026 by vercel[bot]
Preview – promptfiddle2 — 780bb8d4 Deployed Jul 23, 2026 by vercel[bot]
Preview – beps — 780bb8d4 Deployed Jul 23, 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