Skip to content

Commit 1c5eeca

Browse files
mikejmorgan-aiMike Morganclaude
authored andcommitted
Code review: Security fixes, documentation overhaul, CI/CD repair (cortexlinux#208)
Comprehensive code review and improvement of the Cortex Linux repository. - Added command validation in coordinator.py to prevent shell injection - Expanded dangerous command patterns in sandbox_executor.py (20+ new patterns) - Created cortex/utils/commands.py with secure command execution utilities - Created ASSESSMENT.md with full code audit report - Created ROADMAP.md with prioritized improvement plan - Rewrote README.md with comprehensive documentation - Updated CONTRIBUTING.md with detailed guidelines - Created CHANGELOG.md following Keep a Changelog format - Fixed automation.yml (wrong test directory tests/ → test/) - Added Python version matrix (3.10, 3.11, 3.12) - Added lint job (black, pylint) - Added security job (bandit, safety) - Added coverage reporting with Codecov - Created root requirements.txt with core dependencies - Created requirements-dev.txt with dev dependencies - Updated setup.py to use root requirements.txt - Standardized Python version to >=3.10 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Mike Morgan <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent dfe3077 commit 1c5eeca

File tree

13 files changed

+2422
-119
lines changed

13 files changed

+2422
-119
lines changed

.github/workflows/automation.yml

Lines changed: 72 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,82 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12-
12+
strategy:
13+
matrix:
14+
python-version: ['3.10', '3.11', '3.12']
15+
1316
steps:
14-
- uses: actions/checkout@v3
15-
16-
- name: Set up Python
17-
uses: actions/setup-python@v4
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
1821
with:
19-
python-version: '3.11'
20-
22+
python-version: ${{ matrix.python-version }}
23+
2124
- name: Install dependencies
2225
run: |
2326
python -m pip install --upgrade pip
24-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
25-
27+
pip install -r requirements.txt
28+
pip install pytest pytest-cov pytest-mock
29+
2630
- name: Run tests
2731
run: |
28-
if [ -d tests ]; then
29-
python -m pytest tests/ || echo "Tests not yet implemented"
30-
else
31-
echo "No tests directory found"
32-
fi
32+
python -m pytest test/ -v --cov=cortex --cov-report=xml --cov-report=term-missing
33+
34+
- name: Upload coverage to Codecov
35+
uses: codecov/codecov-action@v4
36+
if: matrix.python-version == '3.11'
37+
with:
38+
file: ./coverage.xml
39+
fail_ci_if_error: false
40+
41+
lint:
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Set up Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: '3.11'
51+
52+
- name: Install linting tools
53+
run: |
54+
python -m pip install --upgrade pip
55+
pip install black pylint mypy
56+
57+
- name: Check formatting with black
58+
run: |
59+
black --check cortex/ || echo "::warning::Code formatting issues found. Run 'black cortex/' to fix."
60+
61+
- name: Lint with pylint
62+
run: |
63+
pylint cortex/ --exit-zero --output-format=text | tee pylint-report.txt
64+
score=$(tail -n 2 pylint-report.txt | head -n 1 | grep -oP '\d+\.\d+')
65+
echo "Pylint score: $score"
66+
67+
security:
68+
runs-on: ubuntu-latest
69+
70+
steps:
71+
- uses: actions/checkout@v4
72+
73+
- name: Set up Python
74+
uses: actions/setup-python@v5
75+
with:
76+
python-version: '3.11'
77+
78+
- name: Install security tools
79+
run: |
80+
python -m pip install --upgrade pip
81+
pip install bandit safety
82+
83+
- name: Run Bandit security linter
84+
run: |
85+
bandit -r cortex/ -ll -ii || echo "::warning::Security issues found. Please review."
86+
87+
- name: Check dependencies with safety
88+
run: |
89+
pip install -r requirements.txt
90+
safety check --full-report || echo "::warning::Vulnerable dependencies found."

0 commit comments

Comments
 (0)