-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Consolidated Argus Remediation & Refactoring #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
65f8ee9
c818a59
b7150cd
e64c5ae
4555a8a
e442ddb
8d904c4
6f84b77
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -62,13 +55,13 @@ jobs: | |
|
|
||
| - name: Run Quality Gates | ||
| run: | | ||
| python -m argus.core.quality.cli run \ | ||
| uv run python -m argus.core.quality.cli run \ | ||
| --output=quality-report.json \ | ||
| --format=json \ | ||
| --fail-on-warning | ||
|
|
||
| - name: Upload Quality Report | ||
| uses: actions/upload-artifact@v3 | ||
| uses: actions/upload-artifact@v4 | ||
| if: always() | ||
| with: | ||
| name: quality-report | ||
|
|
@@ -124,20 +117,23 @@ 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 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
doneRepository: 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.ymlRepository: 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.ymlRepository: DsThakurRawat/Argus Length of output: 1651 Remove In uv sync --frozen
uv pip install psutil
🤖 Prompt for AI Agents |
||
|
|
||
| - name: Run Performance Gates | ||
| run: | | ||
| python -m argus.core.quality.cli run \ | ||
| uv run python -m argus.core.quality.cli run \ | ||
| --gates=performance \ | ||
| --output=performance-report.json \ | ||
| --format=json | ||
|
|
||
| - name: Upload Performance Report | ||
| uses: actions/upload-artifact@v3 | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: performance-report | ||
| path: performance-report.json | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,14 +23,7 @@ | |
| # ============================================================================ | ||
|
|
||
|
|
||
| class StatusCode(str, Enum): | ||
| """Standard status codes for agent responses.""" | ||
|
|
||
| SUCCESS = "success" | ||
| ERROR = "error" | ||
| WARNING = "warning" | ||
| PENDING = "pending" | ||
| PARTIAL = "partial" | ||
|
|
||
|
|
||
| class SeverityLevel(str, Enum): | ||
|
|
@@ -89,6 +82,7 @@ class ActionType(str, Enum): | |
| # Base models; Response models; Supporting models; Factory functions; Registry and utilities | ||
| from .response_models import ( | ||
| AGENT_RESPONSE_MODELS, | ||
| StatusCode, | ||
| AnalysisFinding, | ||
| AnalysisResult, | ||
| BaseAgentResponse, | ||
|
|
@@ -120,7 +114,7 @@ class ActionType(str, Enum): | |
| PersistentAgentData, | ||
| StateManager, | ||
| StateSnapshot, | ||
| StateTransition, # State enums; State models; State utilities | ||
| StateTransitionEnum, # State enums | ||
| WorkflowContext, | ||
| WorkflowState, | ||
| WorkflowStep, | ||
|
|
@@ -235,9 +229,8 @@ def validate_agent_data( | |
| # State models | ||
| "AgentState", | ||
| "WorkflowState", | ||
| "StateTransitionEnum", | ||
| "StateSnapshot", | ||
| "StateTransition", | ||
| "StateTransitionEnum", | ||
|
Comment on lines
232
to
+233
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| "AgentExecutionContext", | ||
| "AgentExecutionMetrics", | ||
| "AgentExecutionState", | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Repository: DsThakurRawat/Argus
Length of output: 464
Pin
actions/upload-artifactto a full commit SHA.Lines 64 and 136 use
actions/upload-artifact@v4, which is mutable. Pin to a full commit SHA to prevent supply-chain drift.🧰 Tools
🪛 zizmor (1.25.2)
[error] 64-64: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents
Source: Linters/SAST tools