Skip to content

feat(release): lean glob size-budget gate, 3-phase release pipeline, and rustc provenance - #519

Merged
eric8810 merged 1 commit into
arcships:masterfrom
cunninghamcard-bit:feat/quality-gates-and-release-pipeline
Nov 27, 2026
Merged

eric8810 merged 1 commit into
arcships:masterfrom
cunninghamcard-bit:feat/quality-gates-and-release-pipeline

Conversation

@cunninghamcard-bit

@cunninghamcard-bit cunninghamcard-bit commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Clean, maintainable rewrite of the size-budget gate and 3-phase release pipeline on top of latest master (10 files, +2,431 / -418 = +2,013 net lines, down from +11,237 — an 82% net reduction).

Architecture

  1. Glob-based size ceilings (quality/size-budgets.json, 32 lines)

    • Replaces the 105-item static artifact manifest with 22 glob rules + 1 android_total aggregate (zero .md5/.sha*/.asc entries).
    • Single compact verifier (scripts/quality/check_budgets.py) checks raw/packed/unpacked ceilings, target warnings, archive hygiene (ZIP CRC + mode/symlink/collision guards, TAR zero-block end-of-archive + trailing-garbage/symlink/collision guards, Python wheel native-extension presence, iOS xcframework Info.plist + slices), and commit/version-scoped temporary exceptions with a 14-day UTC cap.
    • Aligned rfc/0043-size-performance-budgets.md and wired lightweight checks into .github/workflows/ci.yml.
  2. 3-phase release pipeline (.github/workflows/release.yml) reusing official ecosystem tools

    • Phase 1 — Build & Verify (no publish credentials):
      • Rust: multi-package cargo package --no-verify across all 6 workspace crates + check_budgets.py.
      • Node: compiles typed wrapper (npm run build:typed), injects platform optionalDependencies, packs all 7 .tgz tarballs with npm pack, verifies exports & ceilings, records SHA256SUMS.
      • Python: builds wheels, verifies with twine check + check_budgets.py, records per-wheel SHA256SUMS-*.
      • Flutter: runs tests & analyzer, packs the exact pub archive via flutter pub publish --to-archive, verifies ceilings with check_budgets.py, records SHA256SUMS.
      • JVM: enables reproducible Gradle archives (bindings/{java,kotlin}/build.gradle.kts), stages via gradle publishToMavenLocal, verifies all 10 deliverables against workspace version & ceilings, records jvm-verified.sha256.
      • GitHub Release assets: stages exact listed assets into a deterministic ZIP_DEFLATED aimux_ffi.xcframework.zip + assets-manifest.json (scripts/stage_release_assets.py), re-verifying with --verify and check_budgets.py.
    • Phase 2 — release-gate:
      • Verifies tag/SHA alignment via git ls-remote, workspace/binding version alignment (tomllib for Cargo/Python, JSON for Node, YAML for Flutter, real Gradle evaluation in jvm-build), and that every selected Phase-1 job succeeded before unlocking any credentialed job.
    • Phase 3 — Immutable Publish (scoped credentials):
      • Re-verifies strict SHA-256 manifests (rejecting symlinks, CRLF/CR, whitespace-only lines, extra/missing files) and publishes the exact verified artifacts (cargo publish, npm publish ./packed/*.tgz --ignore-scripts, pypa/gh-action-pypi-publish, Gradle --init-script pre-upload PublishToMavenRepository.doFirst digest hook, flutter pub publish --force --from-archive, and non-forced immutable GitHub Release with draft recovery and monotonic remote-tag verification).
  3. Rust toolchain stays on stable + full rustc provenance

    • Deliberately keeps rust-toolchain.toml and CI/release workflows on stable (no hard-pinned minor version or check_toolchain_pin.py).
    • Collects real rustc -V from all 12 release Rust builders (go-build, ffi-build, console-build, flutter-ffi-mobile) into assets-manifest.json (rustcVersion + per-builder rustcVersions) and verifies all 12 builders in github-stage and github-release.

Verification

  • python3 -m unittest discover -s scripts/tests -v (70 tests, including 14 targeted budget & staging tests) — PASS
  • python3 scripts/quality/check_budgets.py --validate-only — PASS (22 rules, 1 aggregate, 0 exceptions)
  • Real multi-package cargo package --no-verify -p aimux-stream -p aimux-core -p aimux-provider-utils -p aimux-providers -p aimux-ops -p aimux-ffi + check_budgets.py on all 6 .crate files — PASS
  • YAML, bash -n (33 steps), Python AST (6 heredocs), and node --check (3 blocks) across .github/workflows/{ci,release}.yml — PASS
  • npm publish ./packed/*.tgz --dry-run --ignore-scripts — PASS

@eric8810 eric8810 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.

质量 gate 方向对,但 inventory 从 105 变 65,40 个 JVM checksum deliverables 没登记;release.yml 仍生成/上传 .md5/.sha1/.sha256/.sha512,违反单源。Rust 1.100 pin 不在 head(rust-toolchain 仍 stable,check_toolchain_pin 被删),与 PR body 冲突。GitHub Release 仍可能覆盖 assets 或在 master 而非 github.sha 打 tag;target_warning 未实现。请先修这些。

@cunninghamcard-bit cunninghamcard-bit changed the title ci(quality): pin Rust 1.100.0, add size budget gate, and separate immutable release publish (#267, #273, #274) ci(quality): add Option C size budget gate, release provenance, and immutable publish (#273, #274, partial #267) Nov 18, 2026

@eric8810 eric8810 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.

inventory 105、checksum 单源、release target_commitish/不覆盖、target_warning 都已修好。但 Rust pin 仍未落:rust-toolchain.toml 仍是 stable,CI/release 都用 @stable,issue #267 要求的 exact pin + check 缺失,assets-manifest 也拿不到 rustcVersion。请补上后再 approve。

@cunninghamcard-bit
cunninghamcard-bit force-pushed the feat/quality-gates-and-release-pipeline branch from 7220276 to a283d1c Compare November 19, 2026 13:56
@cunninghamcard-bit cunninghamcard-bit changed the title ci(quality): add Option C size budget gate, release provenance, and immutable publish (#273, #274, partial #267) feat(release): lean glob size-budget gate, 3-phase release pipeline, and rustc provenance Nov 19, 2026
@cunninghamcard-bit

Copy link
Copy Markdown
Contributor Author

@eric8810 Thanks for the feedback and patience — we stepped back, realized the previous +11k-line custom verification framework was way too heavy to maintain, and rebuilt this PR cleanly from latest master (10 files, +2,431 / -418 = +2,013 net lines, an 82% net reduction):

  • Glob-based budgets: replaced the 105-item static catalog and multi-thousand-line custom verifier with a 32-line quality/size-budgets.json (no checksum/signature entries) and a single compact scripts/quality/check_budgets.py.
  • Official ecosystem tools + 3-phase release separation: Phase 1 builds/packs & gates using native cargo package, npm pack, twine check, flutter pub publish --to-archive, and Gradle reproducible archives; Phase 2 (release-gate) verifies tag/SHA/version alignment and all build gates; Phase 3 publishes exact SHA-256-verified artifacts with scoped credentials (npm publish ./packed/... --ignore-scripts, flutter pub publish --from-archive, Gradle PublishToMavenRepository.doFirst pre-upload digest check, non-forced immutable GitHub Release).
  • Rust stays on stable with real provenance: rather than hard-pinning a Rust minor version across workflows, CI and release stay on stable (MSRV tracked in Cargo.toml) while assets-manifest.json records the actual rustc -V reported by all 12 release Rust builders (rustcVersion / rustcVersions).

Ready for another look whenever you have a moment!

@cunninghamcard-bit

Copy link
Copy Markdown
Contributor Author

@eric8810 Rebased onto v0.7.0 master (a3b29f182, including #540's dynamic iOS aimux_ffi.framework and universal ios-arm64_x86_64-simulator slice + x86_64-apple-ios target), updated scripts/quality/check_budgets.py and tests to match the universal simulator slice path, and verified all 74 script unit tests (scripts/tests) and workflow YAML/bash/Python/Node checks pass (c8be422d3).

As a quick recap from the prior rewrite, this PR is now an 82% net diff reduction (+2,431 / -418 across 10 files) using a 32-line glob quality/size-budgets.json, official ecosystem packagers, 3-phase build/gate/publish separation, and real 12-builder rustcVersion provenance in assets-manifest.json while keeping Rust on stable. Ready for re-review whenever convenient!

@cunninghamcard-bit
cunninghamcard-bit force-pushed the feat/quality-gates-and-release-pipeline branch from c8be422 to 9003f13 Compare November 25, 2026 03:16
@eric8810

Copy link
Copy Markdown
Contributor

看到你 rebase 到了 0.7.0 master(9003f133),谢谢。但上次 review 唯一剩下的阻塞点还没动:rust-toolchain.toml 仍是 channel = "stable",CI/release 也还是 dtolnay/rust-toolchain@stable。issue #267 和 RFC-0043 要求是 exact pin + 一致性检查(否则 release 的 rustc 版本不可复现,assets-manifest.json 也拿不到 rustcVersion)。补上 pin(以及把 CI/release 的 toolchain action 改成读 rust-toolchain.toml)后我立刻 approve。其余四点(inventory 105、checksum 单源、Release target_commitish/不覆盖、target_warning)上次已确认修好。

@cunninghamcard-bit
cunninghamcard-bit force-pushed the feat/quality-gates-and-release-pipeline branch from 9003f13 to 3b2be0c Compare November 27, 2026 03:31
@cunninghamcard-bit

Copy link
Copy Markdown
Contributor Author

@eric8810 谢谢仔细核对,这里把 rustcVersion 采集和 stable 策略两点澄清一下:

  1. assets-manifest.json 已经完整采集并强校验真实 rustcVersion(不是拿不到):

    • .github/workflows/release.yml 的全部 12 路发布 Rust builder(go-build ×4、ffi-build ×3、console-build ×3、flutter-ffi-mobile ×2,分别位于 L317 / L369 / L434 / L477 / L491)都会把真实 rustc -V 写入 rustc-provenance/*.txt 并上传;
    • github-stage(L616–638)与 github-release(L1231)通过 scripts/stage_release_assets.py(RELEASE_RUSTC_BUILDERS L24、collect_rustc_versions L140、manifest 写入 L353–354)聚合写入 assets-manifest.json 的 rustcVersion(各 builder 存在版本差异时自动附完整 rustcVersions 明细),并用 --verify --require-rustc-version --expected-rustc-builders release 强制校验 12 路齐全,对应单测在 scripts/tests/test_stage_release_assets.py(test_rustc_version_dir_provenance_and_verify_mode,L144)。
  2. 刻意保持 stable 工具链不硬 pin 小版本:

    • 延续已合入的 #507 策略并配合本 PR 精简后的分类上限门禁(quality/size-budgets.json),我们明确选择保持 rust-toolchain.toml 为 channel = "stable"、CI 与 release 保持 dtolnay/rust-toolchain@stable——MSRV 由根 Cargo.toml 的 rust-version 兜底,每次发版的精确编译器版本由 assets-manifest.json 的 rustcVersion / rustcVersions 可追溯记录,避免每 6 周手动提 PR 升 toolchain 小版本号。
    • rfc/0043-size-performance-budgets.md(§1.8、§7.1)和 Issue #267(最新说明)均已同步为该口径。
  3. 最新 Rebase 与验证:

    • 已干净 rebase 到最新 master(f4b208253,完整保留 #537 的 aimux-ops --no-default-features clippy/test 与 maturin/xcframework Deflate-9 压缩以及 #517),最新 HEAD:3b2be0c0d;
    • 本地 python3 -m unittest discover -s scripts/tests(74/74)、python3 scripts/quality/check_budgets.py --validate-only 及 workflow YAML/bash/Python/Node 检查全部通过。

烦请按 stable + rustcVersion provenance 口径 re-review 并 approve,感谢!

@eric8810 eric8810 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.

3b2be0c 复审通过。

关于 toolchain pin:我之前坚持 exact pin,是对着 issue #267 的标题而不是它 11-19 的决策更新。核实了 RFC-0043 §1.8 / §7.1 / §15 和 #267 最新评论都已改为"CI/release 保持 stable、MSRV 由 rust-version = "1.85" 兜底、发布构建的真实 rustc -V 由 assets-manifest.json 的 rustcVersion/rustcVersions 采集并在 stage/release 两处强校验 12 路齐全"——这是项目已经做出的决策,不是遗漏,我撤回这个阻塞点。

其余四点(inventory 105、checksum 单源、Release target_commitish/不覆盖、target_warning)在上一轮已确认修好。rebase 到 f4b2082 干净,保留了 #537 的 no-default-features clippy/test 和 #517。20/20 CI 绿。Approve。

非阻塞留档:assets-manifest.json 的 rustcVersion 是"事后可追溯",不是"事前可复现"——同一个 tag 在不同日期重跑 release 会得到不同的 rustc。这在 RFC 里是明确接受的权衡,但值得在 upgrading/release 文档里对下游说清楚。

@eric8810
eric8810 merged commit 2d304ac into arcships:master Nov 27, 2026
20 checks passed
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.

2 participants