Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 17 additions & 21 deletions .github/workflows/quality-gates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,30 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip dependencies
uses: actions/cache@v3
- name: Install uv and dependencies
uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install ruff pyright bandit safety pytest-cov
enable-cache: true
- name: Sync dependencies
run: uv sync --frozen

- name: Run Static Analysis (Pyright)
run: |
pyright --strict
uv run pyright

- name: Run Linting (Ruff)
run: |
ruff check --output-format=github
ruff format --check
uv run ruff check --output-format=github
uv run ruff format --check

- name: Run Security Scan (Bandit)
run: |
bandit -r argus -f json -o bandit-report.json || true
bandit -r argus
uv run bandit -r argus -f json -o bandit-report.json || true
uv run bandit -r argus

- name: Run Tests with Coverage
run: |
pytest --cov=argus --cov-report=xml --cov-report=html --cov-fail-under=80
uv run pytest --cov=argus --cov-report=xml --cov-report=html --cov-fail-under=80

- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down Expand Up @@ -124,10 +117,13 @@ jobs:
python-version: '3.12'

- name: Install dependencies
uses: astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081 # v5
with:
enable-cache: true
- name: Sync dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install psutil
uv sync --frozen
uv pip install psutil
Comment on lines 124 to +126

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify whether psutil is already represented in project dependency sources
for f in $(fd -i 'pyproject.toml|uv.lock'); do
  echo "### $f"
  rg -n 'psutil|optional-dependencies|dependency-groups|dependencies' "$f" || true
done

Repository: DsThakurRawat/Argus

Length of output: 4870


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n "uv pip install psutil|uv sync --frozen" .github/workflows/quality-gates.yml
sed -n '90,160p' .github/workflows/quality-gates.yml

Repository: DsThakurRawat/Argus

Length of output: 1651


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n "uv pip install psutil|uv sync --frozen" .github/workflows/quality-gates.yml
sed -n '90,160p' .github/workflows/quality-gates.yml

Repository: DsThakurRawat/Argus

Length of output: 1651


Remove uv pip install psutil from the frozen CI flow

In .github/workflows/quality-gates.yml (lines 124-126), the job runs:

uv sync --frozen
uv pip install psutil

psutil is already declared in pyproject.toml and present in uv.lock, so uv sync --frozen should install it deterministically; the extra uv pip install psutil is redundant and bypasses lockfile reproducibility. Remove the ad-hoc install step.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/quality-gates.yml around lines 124 - 126, Remove the
ad-hoc package install that bypasses the lockfile: in the workflow step where
the commands run "uv sync --frozen" and "uv pip install psutil", delete the "uv
pip install psutil" line so only "uv sync --frozen" remains; this ensures psutil
(already declared in pyproject.toml and uv.lock) is installed deterministically
from the lockfile.


- name: Run Performance Gates
run: |
Expand Down
14 changes: 3 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,26 @@
repos:
# Ruff for linting and formatting
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
rev: v0.12.0
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format

# Pyright for type checking
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.350
rev: v1.1.405
hooks:
- id: pyright
args: [--strict]

# Security scanning
- repo: https://github.com/PyCQA/bandit
rev: 1.7.5
rev: 1.8.0
hooks:
- id: bandit
args: [-r, argus, -f, json]
exclude: ^tests/

# Import sorting
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: [--profile, black, --line-length, 100]

# General hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Expand Down
3 changes: 0 additions & 3 deletions argus/agents/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
EnhancedTriageAgent,
)
from .response_models import AnalysisResult, CodeResponse, TextResponse
from .specialized.analysis_agent import EnhancedAnalysisAgent
from .specialized.code_agent import EnhancedCodeAgent
from .specialized.text_agent import EnhancedTextAgent

__all__ = [
# Base agents
Expand Down
5 changes: 3 additions & 2 deletions argus/agents/agent_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ class ActionType(str, Enum):
PersistentAgentData,
StateManager,
StateSnapshot,
StateTransition, # State enums; State models; State utilities
StateTransition, # State models
StateTransitionEnum, # State enums

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The StateTransition class was renamed to StateTransitionEnum in argus/agents/state_models.py. Importing StateTransition here will raise an ImportError at runtime.

Suggested change
StateTransition, # State models
StateTransitionEnum, # State enums
StateTransitionEnum, # State enums

WorkflowContext,
WorkflowState,
WorkflowStep,
Expand Down Expand Up @@ -235,9 +236,9 @@ def validate_agent_data(
# State models
"AgentState",
"WorkflowState",
"StateTransitionEnum",
"StateSnapshot",
"StateTransition",
"StateTransitionEnum",
Comment on lines 232 to +233

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

The StateTransition class was renamed to StateTransitionEnum in argus/agents/state_models.py. Exporting StateTransition in __all__ will raise an ImportError at runtime.

Suggested change
"StateSnapshot",
"StateTransition",
"StateTransitionEnum",
"StateSnapshot",
"StateTransitionEnum",

"AgentExecutionContext",
"AgentExecutionMetrics",
"AgentExecutionState",
Expand Down
154 changes: 0 additions & 154 deletions argus/agents/enhanced_analysis_agent.py

This file was deleted.

Loading
Loading