Skip to content

REF:(Big Change): Centralized Contracts, ADD: ruff & import-linter#30

Merged
RBhupi merged 16 commits into
mainfrom
devel
May 13, 2026
Merged

REF:(Big Change): Centralized Contracts, ADD: ruff & import-linter#30
RBhupi merged 16 commits into
mainfrom
devel

Conversation

@RBhupi
Copy link
Copy Markdown
Collaborator

@RBhupi RBhupi commented May 13, 2026

PR tags (required)

Select all that apply.

  • docs-only
  • tests-only
  • tiny-change (<5 lines, single class/file)
  • code-change
  • scientific/algorithmic
  • design/architecture
  • GUI

What changed

  • Added Ruff linting workflow and resolved repository-wide Ruff violations, including automated and manual cleanup passes.
  • Added import-linter contracts and refactored module/config ownership to reduce cross-layer coupling and enforce cleaner package boundaries.
  • Moved contracts into adapt.contracts, refactored config injection patterns, and cleaned runtime/module dependency structure.
  • Improved packaging/release tooling, including version reporting, README/CI release updates, and PyPI publishing integration.

Why

As the codebase grows, architectural drift and hidden import coupling become harder to manage. This PR establishes enforceable boundaries, standardized linting, and cleaner packaging/release workflows to improve maintainability, contributor onboarding, and long-term scalability.

Issues closed

Addresses #8
Closes #18
Closes #19
Addresses #9

Target version (required)

Aiming for: next release

Validation

  • I ran ruff

    • Evidence (command + pass/fail): ruff check . — All pass
    • N/A reason (if not run):
  • I ran import-linter

    • Evidence (command + pass/fail): lint-imports — All pass
Analyzed 59 files, 100 dependencies.

Adapt modules remain independent KEPT  
Modules do not depend on runtime KEPT  
Modules do not import infrastructure layers KEPT  
Persistence does not depend on modules or runtime KEPT  
Internal packages do not depend on CLI KEPT  
Core packages do not depend on extensions KEPT  
Contracts package imports no adapt internals KEPT

Contracts: 7 kept, 0 broken.

  • N/A reason (if not run):

  • I ran tests

    • Evidence manual validation failed. I will push new commits.

AI usage & manual verification

  • AI used: yes
  • Model/tooling: Argo API, ChatGPT, Codex, Claude Code,
  • Tasks delegated to AI:
    • lint cleanup assistance
    • refactor code
    • PR drafting
  • Manual verification performed:
    • reviewed all diffs manually with git diff
    • verified import-linter contract outputs
    • manually checked CLI/version behavior. It works A2Z
    • verified Ruff cleanup and module boundary refactors
    • reviewed packaging and CI workflow changes

Reviewer guide

  • Entry point:

    • Ruff/import-linter integration commits
    • contract/config refactor commits
  • Key files/areas (1-3):

    • adapt.contracts
    • config injection and module initialization flow
    • CI/release/linting configuration
  • Expected review time:

    • 30–60 minutes

Impact note (optional):

This PR has started to enforce architectural boundaries with import-linter.

@RBhupi RBhupi changed the title REF:(Big Change) track store,events, & CI:Architecture Validation REF:(Big Change): Centralized Contracts, ADD: ruff & import-linter May 13, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 13, 2026

Codecov Report

❌ Patch coverage is 44.44444% with 365 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.88%. Comparing base (d390856) to head (ba3342f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/adapt/runtime/processor.py 0.00% 54 Missing ⚠️
src/adapt/modules/analysis/module.py 0.00% 38 Missing ⚠️
src/adapt/modules/ingest/module.py 0.00% 27 Missing ⚠️
src/adapt/visualization/plotter.py 0.00% 27 Missing ⚠️
src/adapt/api/client.py 0.00% 25 Missing ⚠️
src/adapt/modules/detection/module.py 0.00% 24 Missing ⚠️
src/adapt/gui/dashboard.py 0.00% 21 Missing ⚠️
src/adapt/modules/projection/module.py 0.00% 20 Missing ⚠️
src/adapt/runtime/file_tracker.py 0.00% 16 Missing ⚠️
src/adapt/contracts/analysis.py 30.00% 14 Missing ⚠️
... and 25 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #30      +/-   ##
==========================================
+ Coverage   18.34%   19.88%   +1.54%     
==========================================
  Files          46       49       +3     
  Lines        6100     6079      -21     
  Branches      886      863      -23     
==========================================
+ Hits         1119     1209      +90     
+ Misses       4869     4761     -108     
+ Partials      112      109       -3     
Flag Coverage Δ
unittests 19.88% <44.44%> (+1.54%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@RBhupi RBhupi merged commit 2ef40a6 into main May 13, 2026
7 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.

Add Ruff and import-linter checks Fix: Centralized Contract Ownership

2 participants