Skip to content

fix(enforcement): ENFORCE-046 exempts the Pattern-B peer its catalog row declares - #509

Merged
marlon-costa-dc merged 1 commit into
0.12.0-devfrom
fix/enforce-046-pattern-b-peer
Sep 26, 2026
Merged

marlon-costa-dc merged 1 commit into
0.12.0-devfrom
fix/enforce-046-pattern-b-peer

Conversation

@marlon-costa-dc

@marlon-costa-dc marlon-costa-dc commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • ENFORCE-046's catalog row already states the Pattern-B exemption ("unless Pattern-B peer"), but its visitor reported every family facade that extends a peer facade by class name — the form required by the facade-base-by-class-name codemod rule and generator law points 1/5.
  • infra #898 un-suspended runtime-census, which turned every member's lock bump red (e.g. meltano 10/10 findings, auth 10 of 27 are this).
  • The peer is now derived rather than listed: the importer is a family package (c.NAMESPACE_FAMILY_PREFIX), the origin is a canonical facade module (c.ENFORCEMENT_CANONICAL_FILES), and the imported class is a base of a class the module declares. Consumers outside the family keep the alias base (Pattern A, flext-dv1ga).

Evidence

  • The local prepush (gen fixed point, audit, check 282s, test 93s) is GREEN.
  • Probe against the flext-meltano and flext-auth E8 lanes: all ENFORCE-046 findings clear.
  • Behavioral tests: tests/unit/test_beartype_engine_import_blacklist.py covers the peer pass, an unused bare class being reported, and a non-family consumer being reported.

🤖 Generated with Claude Code


Summary by cubic

Fixes ENFORCE-046 to match its catalog row: a family facade that extends a peer family facade by class name is now exempt instead of being reported as a bare concrete import.

  • Derives the peer from the importer being a family package, the origin being a canonical facade module, and the imported class being a base of a class the module declares.
  • Keeps consumers outside the family on the alias base (Pattern A).
  • Adds behavioral tests for the peer pass, an unused bare class, and a non-family consumer.

Written for commit de81772. Summary will update on new commits.

Review in cubic

…row declares

A family facade that extends a peer family facade by class name (the form the facade-base-by-class-name codemod and the generator law require) was reported as a bare concrete import. The visitor now derives the peer: family package importer, canonical-facade origin, used as a base of a class the module declares. Consumers outside the family keep the alias base.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@marlon-costa-dc
marlon-costa-dc merged commit 734d12b into 0.12.0-dev Sep 26, 2026
8 of 10 checks passed
@marlon-costa-dc
marlon-costa-dc deleted the fix/enforce-046-pattern-b-peer branch September 26, 2026 20:50
marlon-costa-dc added a commit that referenced this pull request Sep 26, 2026
…d family-surface owners (#510)

## Summary
- #509 added a second, string-parsed definition of a Pattern-B peer
(`NAMESPACE_FAMILY_PREFIX`, canonical file names, `rpartition`). This PR
replaces it with one helper,
`FlextUtilitiesBeartypeHelpers.is_family_facade`, derived only from
existing owners:
- **published facade:** the class bound to a one-letter alias in the
generated `_LAZY_IMPORTS` (`lazy_alias_suffixes`);
- **family membership:**
`FlextUtilitiesFamilySurface.project_alias_owners()`.
- ENFORCE-046 exempts an import only when it is a base of a published
family facade and is itself a published family facade. The duplicate
helper is deleted.
- The test added in #509 copied the style of existing tests
(private-path imports, manual `sys.path`, bare assert), so it is
removed. The evidence is the consumers' `runtime-census` after they move
to this commit.

## Evidence (lane, canonical verbs)
- `make gen`: no changes.
- `make check` with CI unset: exit 0 on all active gates (378 s,
dominated by mypy; performance defect recorded).
- `make test`: 2710 passed in 30.6 s, 0 skipped.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Changes ENFORCE-046 so a Pattern-B peer is recognized through a single
helper, `FlextUtilitiesBeartypeHelpers.is_family_facade`, fed by the
generated `_LAZY_IMPORTS` alias map and
`FlextUtilitiesFamilySurface.project_alias_owners()`.

**Refactors**
- An import is exempt only when it is a base of a published family
facade and is itself a published family facade.
- Removes the string-parsed `_is_pattern_b_peer` helper and its
copied-style unit test; the consumers' runtime-census is the evidence.

<sup>Written for commit ba8849f.
Summary will update on new commits.</sup>

<a
href="https://cubic.dev/pr/flext-sh/flext-core/pull/510?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->
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