chore: add drift-engine signal compatibility stubs in src/drift/signals (ADR-100 phase 3b)#709
Open
mick-gsk wants to merge 1 commit into
Open
chore: add drift-engine signal compatibility stubs in src/drift/signals (ADR-100 phase 3b)#709mick-gsk wants to merge 1 commit into
mick-gsk wants to merge 1 commit into
Conversation
…ls (ADR-100 phase 3b)
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR replaces many in-tree drift.signals implementations with compatibility stubs that forward to drift_engine.signals as part of the ADR-100 monorepo migration split.
Changes:
- Replaced legacy signal implementation modules under
src/drift/signals/with thin re-export stubs targetingdrift_engine.signals. - Updated package-level signal exports in
src/drift/signals/__init__.pyto import signal classes fromdrift_engine. - Preserved access to many helper functions/constants by explicitly re-exporting them from the new package.
Reviewed changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/drift/signals/type_safety_bypass.py |
Replaces local TSB implementation with a re-export stub to drift_engine. |
src/drift/signals/ts_architecture.py |
Replaces TS architecture signal implementation with a re-export stub. |
src/drift/signals/test_polarity_deficit.py |
Replaces TPD implementation with compatibility re-exports. |
src/drift/signals/temporal_volatility.py |
Replaces TVS implementation with a re-export stub. |
src/drift/signals/system_misalignment.py |
Replaces SMS implementation with forwarded imports from drift_engine. |
src/drift/signals/pattern_fragmentation.py |
Replaces PFS implementation with a re-export stub. |
src/drift/signals/missing_authorization.py |
Replaces MAZ implementation with compatibility re-exports. |
src/drift/signals/insecure_default.py |
Replaces ISD implementation with a re-export stub. |
src/drift/signals/guard_clause_deficit.py |
Replaces GCD implementation with forwarded imports. |
src/drift/signals/fan_out_explosion.py |
Replaces FOE implementation with a re-export stub. |
src/drift/signals/explainability_deficit.py |
Replaces EDS implementation with a re-export stub. |
src/drift/signals/exception_contract_drift.py |
Replaces ECM implementation with forwarded imports from drift_engine. |
src/drift/signals/dependency_dag.py |
Replaces DAG utility implementation with a re-export stub. |
src/drift/signals/dead_code_accumulation.py |
Replaces DCA implementation with compatibility re-exports. |
src/drift/signals/cohesion_deficit.py |
Replaces COD implementation with a re-export stub. |
src/drift/signals/cognitive_complexity.py |
Replaces CXS implementation with forwarded imports. |
src/drift/signals/co_change_coupling.py |
Replaces CCC implementation with a re-export stub. |
src/drift/signals/circular_import.py |
Replaces CID implementation with compatibility re-exports. |
src/drift/signals/bypass_accumulation.py |
Replaces BAT implementation with a re-export stub. |
src/drift/signals/broad_exception_monoculture.py |
Replaces BEM implementation with forwarded imports. |
src/drift/signals/base.py |
Replaces core signal base/registry implementation with re-exports to drift_engine. |
src/drift/signals/_utils.py |
Replaces shared signal utilities with a re-export stub. |
src/drift/signals/_ts_support.py |
Replaces TS helper implementation with a re-export stub. |
src/drift/signals/__init__.py |
Rewires package-level signal exports to import from drift_engine. |
Comment on lines
+3
to
+24
| from drift_engine.signals.architecture_violation import ArchitectureViolationSignal | ||
| from drift_engine.signals.base import BaseSignal | ||
| from drift_engine.signals.broad_exception_monoculture import BroadExceptionMonocultureSignal | ||
| from drift_engine.signals.bypass_accumulation import BypassAccumulationSignal | ||
| from drift_engine.signals.circular_import import CircularImportSignal | ||
| from drift_engine.signals.co_change_coupling import CoChangeCouplingSignal | ||
| from drift_engine.signals.cognitive_complexity import CognitiveComplexitySignal | ||
| from drift_engine.signals.cohesion_deficit import CohesionDeficitSignal | ||
| from drift_engine.signals.dead_code_accumulation import DeadCodeAccumulationSignal | ||
| from drift_engine.signals.doc_impl_drift import DocImplDriftSignal | ||
| from drift_engine.signals.exception_contract_drift import ExceptionContractDriftSignal | ||
| from drift_engine.signals.explainability_deficit import ExplainabilityDeficitSignal | ||
| from drift_engine.signals.fan_out_explosion import FanOutExplosionSignal | ||
| from drift_engine.signals.guard_clause_deficit import GuardClauseDeficitSignal | ||
| from drift_engine.signals.mutant_duplicates import MutantDuplicateSignal | ||
| from drift_engine.signals.naming_contract_violation import NamingContractViolationSignal | ||
| from drift_engine.signals.pattern_fragmentation import PatternFragmentationSignal | ||
| from drift_engine.signals.phantom_reference import PhantomReferenceSignal | ||
| from drift_engine.signals.system_misalignment import SystemMisalignmentSignal | ||
| from drift_engine.signals.temporal_volatility import TemporalVolatilitySignal | ||
| from drift_engine.signals.test_polarity_deficit import TestPolarityDeficitSignal | ||
| from drift_engine.signals.ts_architecture import TypeScriptArchitectureSignal |
Comment on lines
+3
to
35
| from drift_engine.signals.type_safety_bypass import ( | ||
| _DEFAULT_THRESHOLD as _DEFAULT_THRESHOLD, | ||
| ) | ||
| from drift.signals._ts_support import ts_node_text, ts_parse_source, ts_walk | ||
| from drift.signals._utils import _TS_LANGUAGES | ||
| from drift.signals.base import BaseSignal, register_signal | ||
|
|
||
| _TS_DIRECTIVE_RE = re.compile(r"@ts-(ignore|expect-error)") | ||
| _SDK_IMPORT_RE = re.compile( | ||
| r"from\s+[\"'](?:@?playwright(?:/test)?|playwright-core|discord\.js|@discordjs/[^\"']+)[\"']" | ||
| from drift_engine.signals.type_safety_bypass import ( | ||
| _DOUBLE_CAST_ASSIGN_RE as _DOUBLE_CAST_ASSIGN_RE, | ||
| ) | ||
| _EVENT_EMITTER_NON_NULL_RE = re.compile( | ||
| r"\.(?:on|off|once|addlistener|removelistener)!\s*$", | ||
| re.IGNORECASE, | ||
| from drift_engine.signals.type_safety_bypass import ( | ||
| _EVENT_EMITTER_NON_NULL_RE as _EVENT_EMITTER_NON_NULL_RE, | ||
| ) | ||
| _PLAYWRIGHT_LOCATOR_NON_NULL_RE = re.compile( | ||
| r"\.locator\s*\(.*!\s*\)", | ||
| re.IGNORECASE, | ||
| from drift_engine.signals.type_safety_bypass import ( | ||
| _PLAYWRIGHT_LOCATOR_NON_NULL_RE as _PLAYWRIGHT_LOCATOR_NON_NULL_RE, | ||
| ) | ||
| _DOUBLE_CAST_ASSIGN_RE = re.compile( | ||
| r"\b(?:const|let|var)\s+(?P<var>[A-Za-z_$][\w$]*)\s*=\s*.+\bas\s+unknown\s+as\b", | ||
| re.IGNORECASE, | ||
| from drift_engine.signals.type_safety_bypass import ( | ||
| _SDK_IMPORT_RE as _SDK_IMPORT_RE, | ||
| ) | ||
| from drift_engine.signals.type_safety_bypass import ( | ||
| _TS_DIRECTIVE_RE as _TS_DIRECTIVE_RE, | ||
| ) | ||
| from drift_engine.signals.type_safety_bypass import ( | ||
| TypeSafetyBypassSignal as TypeSafetyBypassSignal, | ||
| ) | ||
| from drift_engine.signals.type_safety_bypass import ( | ||
| _count_bypasses as _count_bypasses, | ||
| ) | ||
| from drift_engine.signals.type_safety_bypass import ( | ||
| _effective_bypass_count as _effective_bypass_count, | ||
| ) | ||
| from drift_engine.signals.type_safety_bypass import ( | ||
| _is_runtime_guarded_playwright_double_cast as _is_runtime_guarded_playwright_double_cast, | ||
| ) | ||
| from drift_engine.signals.type_safety_bypass import ( | ||
| _read_source as _read_source, | ||
| ) |
There was a problem hiding this comment.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split from #576 (ADR-100 monorepo migration). Part of the PR decomposition into atomic, reviewable units.