Skip to content

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
mainfrom
split/576-664b-signals-stubs
Open

chore: add drift-engine signal compatibility stubs in src/drift/signals (ADR-100 phase 3b)#709
mick-gsk wants to merge 1 commit into
mainfrom
split/576-664b-signals-stubs

Conversation

@mick-gsk
Copy link
Copy Markdown
Owner

@mick-gsk mick-gsk commented May 3, 2026

Split from #576 (ADR-100 monorepo migration). Part of the PR decomposition into atomic, reviewable units.

Copilot AI review requested due to automatic review settings May 3, 2026 17:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 targeting drift_engine.signals.
  • Updated package-level signal exports in src/drift/signals/__init__.py to import signal classes from drift_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,
)
Copy link
Copy Markdown

@github-advanced-security github-advanced-security AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@github-actions github-actions Bot added the signals Changes to signal detection logic label May 3, 2026
@mick-gsk mick-gsk closed this May 4, 2026
@mick-gsk mick-gsk deleted the split/576-664b-signals-stubs branch May 4, 2026 05:09
@mick-gsk mick-gsk restored the split/576-664b-signals-stubs branch May 4, 2026 05:14
@mick-gsk mick-gsk reopened this May 4, 2026
@mick-gsk mick-gsk added release:maintenance Include this PR under Maintenance in release notes size/XL Diff ≥ 500 lines — consider splitting labels May 4, 2026
@github-actions github-actions Bot added agent-review-requested Agent review was requested automatically lane/standard Fixes and features — standard review path lane/high-risk Signals/scoring/architecture — full gates + audit required labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-review-requested Agent review was requested automatically lane/high-risk Signals/scoring/architecture — full gates + audit required lane/standard Fixes and features — standard review path release:maintenance Include this PR under Maintenance in release notes signals Changes to signal detection logic size/XL Diff ≥ 500 lines — consider splitting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants