Skip to content

fix(publish-runtime): smoke test asserts stable invariants, not feature flags - #2112

Merged
HongmingWang-Rabbit merged 1 commit into
stagingfrom
fix/publish-runtime-smoke-assertions
Apr 26, 2026
Merged

HongmingWang-Rabbit merged 1 commit into
stagingfrom
fix/publish-runtime-smoke-assertions

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Summary

Caught when dry-run publish run 24965411618 failed at the smoke step:

AttributeError: module 'molecule_runtime.a2a_client' has no attribute '_A2A_QUEUED_PREFIX'

The smoke test asserted _A2A_QUEUED_PREFIX exists, but that symbol comes from PR #2061's series (separate from the PR #2103 chain that shipped this workflow). When dry-run fired against staging, the symbol wasn't there yet → smoke failed → PyPI publish skipped.

Fix

Replace the feature-flag-style assertion with checks for stable invariants of the package contract:

  • a2a_client._A2A_ERROR_PREFIX exists (foundational error-tagging primitive)
  • adapters.get_adapter is callable
  • BaseAdapter has the .name() static method (interface anchor)
  • AdapterConfig has __init__ (dataclass present)

These four catch what smoke tests actually need to catch: broken import rewrites, missing modules, dataclass shape regressions. They don't fire when a specific feature is mid-merge.

Anti-pattern flagged

Avoid feature-flag assertions in publish smoke tests — they fire false-positive every time staging is between the merge of the feature and the merge of the smoke-test PR that asserts it. The contract here is "the package shape is correct," not "feature X is shipped."

🤖 Generated with Claude Code

…re flags

The original smoke step had `assert a2a_client._A2A_QUEUED_PREFIX`
which is a feature-flag-style check — it fires false-positive every time
staging is mid-release of that specific feature. Caught when the dry-run
publish (run 24965411618) failed because _A2A_QUEUED_PREFIX hadn't
landed on staging yet (it lives in PR #2061's series, separate from the
PR #2103 chain that shipped this workflow).

Replaced with checks for stable invariants of the package contract:

  - a2a_client._A2A_ERROR_PREFIX exists (always has, since the
    [A2A_ERROR] sentinel is the foundational error-tagging primitive)
  - adapters.get_adapter is callable
  - BaseAdapter has the .name() static method (interface anchor)
  - AdapterConfig has __init__ (dataclass present)

These four cover the cases the smoke test actually needs to catch:
import-path rewrites broken by build_runtime_package.py, missing
modules, dataclass shape regressions. They don't fire when a specific
feature is mid-merge.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit 1996309 into staging Apr 26, 2026
14 checks passed
@molecule-ai
molecule-ai Bot deleted the fix/publish-runtime-smoke-assertions branch May 20, 2026 06:22
HongmingWang-Rabbit pushed a commit that referenced this pull request Jun 12, 2026
…#774 -> mc#1982 (clean, unblock)' (#2112) from fix/renew-coe-tracker-mc774-clean-20260601 into main
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