Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
3a6d321
fix(security): prevent information exposure through exception
d-ulker Sep 14, 2025
f22683d
feat: Add comprehensive demo website with DeBERTa v3 Large integration
d-ulker Sep 18, 2025
6e049c4
feat: Add local development server for demo testing
d-ulker Sep 18, 2025
d2ea54d
fix: add favicon and Chrome DevTools config to eliminate 404s
d-ulker Sep 18, 2025
353a311
fix: resolve security vulnerabilities
d-ulker Sep 18, 2025
88a7942
feat: comprehensive security and functionality improvements
d-ulker Sep 18, 2025
30425d7
chore: add .gitleaksignore to suppress ML tokenizer false positives
d-ulker Sep 18, 2025
a175e7e
fix: address code review feedback and improve code quality
d-ulker Sep 18, 2025
ea2b982
security: address BAN-B104 binding to all interfaces audit
d-ulker Sep 18, 2025
4d85a3c
fix: comprehensive security and performance improvements
d-ulker Sep 18, 2025
1539173
ui: enhance demo interface with tooltips and improvements
d-ulker Sep 18, 2025
fd9b8a4
refactor: address code review feedback for maintainability
d-ulker Sep 18, 2025
a3b17c0
security: fix gitleaks configuration for ML tokenizer false positives
d-ulker Sep 18, 2025
ed536f2
chore: clean up remaining changes
d-ulker Sep 18, 2025
73128a8
security: implement secure host binding to address BAN-B104 audit
d-ulker Sep 18, 2025
2c5761b
fix: resolve unused variable warnings PYL-W0612
d-ulker Sep 18, 2025
7b172f4
fix: resolve demo website API format and Chart.js import errors
d-ulker Sep 18, 2025
6306a04
fix: improve ENDPOINTS fallback and timeout handling in comprehensive…
d-ulker Sep 18, 2025
7addc7f
improve: add better user feedback for OpenAI proxy fallback
d-ulker Sep 18, 2025
0c2592f
fix: update demo to work with deployed API format
d-ulker Sep 18, 2025
1756c19
fix: correct API call format and improve error handling
d-ulker Sep 18, 2025
117816e
security: fix information exposure through exceptions in api_server.py
d-ulker Sep 18, 2025
d17f0db
security: fix information exposure through exceptions across all depl…
d-ulker Sep 18, 2025
f2058aa
fix: address major linting issues and security warnings
d-ulker Sep 18, 2025
df83ee8
security: implement centralized host binding security module
d-ulker Sep 18, 2025
bcf0009
fix: clean up all trailing whitespace and blank line formatting issues
d-ulker Sep 18, 2025
d995b3c
fix: address code review comments and improve security
d-ulker Sep 18, 2025
f785691
fix: improve memory logging robustness in startup_api.py
d-ulker Sep 18, 2025
056e950
fix: address major linting issues and improve code quality
d-ulker Sep 18, 2025
100a9f4
fix: resolve LayoutManager processing state stuck issue
d-ulker Sep 18, 2025
f1267bf
fix: resolve duplicate showProcessingState() call issue
d-ulker Sep 18, 2025
1fb36e9
fix: resolve duplicate state check in processText function
d-ulker Sep 18, 2025
fa6889a
fix: optimize API timeout handling and processing state management
d-ulker Sep 19, 2025
390c22e
fix: resolve input layout not showing after 'New Analysis' button click
d-ulker Sep 19, 2025
bc9c2a6
feat: Add comprehensive demo website with DeBERTa v3 Large integration
deepsource-autofix[bot] Sep 19, 2025
aadef29
refactor: clean up index.html and consolidate demo files
d-ulker Sep 19, 2025
07a2485
fix: resolve FLK-E501 line length violations (31 occurrences)
d-ulker Sep 19, 2025
331a836
Merge branch 'feat/clean-demo-website' of github.com:uelkerd/SAMO--DL…
d-ulker Sep 19, 2025
8bd3714
feat: significantly improve demo website test coverage (74% → 80%+)
d-ulker Sep 19, 2025
fd2cf67
feat: Add comprehensive demo website with DeBERTa v3 Large integration
deepsource-autofix[bot] Sep 19, 2025
b19d4d5
fix: improve URLSearchParams mock and query string encoding
d-ulker Sep 19, 2025
7b9615d
feat: achieve 88.5% test coverage - exceeding 85% target! 🎉
d-ulker Sep 19, 2025
7e7670a
Fix linting issues and code quality improvements: remove duplicate im…
d-ulker Sep 19, 2025
81acc76
feat: Add comprehensive demo website with DeBERTa v3 Large integration
deepsource-autofix[bot] Sep 19, 2025
ea169e1
Fix DeBERTa model URL and optimize cache-first loading
d-ulker Sep 19, 2025
7bc4e1e
Fix critical security and functionality issues in local API servers
d-ulker Sep 19, 2025
49f8ccc
Resolve merge conflicts in local API servers
d-ulker Sep 19, 2025
fbcd722
Fix remaining PII logging issues across codebase
d-ulker Sep 19, 2025
15cee74
Fix hardcoded emotions in GCP predict.py
d-ulker Sep 19, 2025
27f9060
Fix tokenizer/model mismatch and host binding in robust_predict.py
d-ulker Sep 19, 2025
c533813
Fix f-string syntax error in mega_comprehensive_model_test.py
d-ulker Sep 19, 2025
ba2b370
Fix label mismatch in debug_label_mismatch.py
d-ulker Sep 19, 2025
79bdf96
Fix multiple deployment and API issues
d-ulker Sep 19, 2025
0b36cfd
Fix multiple API and deployment issues
d-ulker Sep 19, 2025
69a52ce
Fix Cloud Build CPU boost flags
d-ulker Sep 19, 2025
d132040
Improve label normalization in quick_label_fix.py
d-ulker Sep 19, 2025
9ddeaf5
feat: Add comprehensive demo website with DeBERTa v3 Large integration
deepsource-autofix[bot] Sep 19, 2025
bd62766
fix: handle both API response shapes in test_api.py
d-ulker Sep 19, 2025
80c5130
fix: remove API key logging in debug script
d-ulker Sep 19, 2025
79b3d92
fix: pin package versions in Dockerfiles
d-ulker Sep 19, 2025
25a4d55
fix: resolve local variable reference before assignment errors
d-ulker Sep 19, 2025
09682d1
fix: resolve critical variable scoping and callable issues
d-ulker Sep 19, 2025
ee3a69d
fix: remove trailing whitespace from all files
d-ulker Sep 19, 2025
2625330
Fix line length issues (FLK-E501) in core files
d-ulker Sep 19, 2025
d9e3de0
Fix more line length issues in data processing files
d-ulker Sep 19, 2025
52444be
Fix most line length issues (FLK-E501) in src/ directory
d-ulker Sep 19, 2025
1419d1e
Fix remaining line length issues (FLK-E501)
d-ulker Sep 19, 2025
0906109
Fix deployment and API issues
d-ulker Sep 19, 2025
b6f9b09
Fix information disclosure vulnerability in health check
d-ulker Sep 19, 2025
feb140f
fix: implement REAL AI models across all services, remove all mocks
d-ulker Sep 19, 2025
a541fbf
feat: Add missing automated code quality tools
d-ulker Sep 19, 2025
50e3f05
fix: resolve syntax errors in voice processing and summarization models
d-ulker Sep 20, 2025
fb6b93c
feat: resolve Cloud Build timeout issues and fix voice processing
d-ulker Sep 20, 2025
240c768
fix: resolve demo website functionality issues
d-ulker Sep 20, 2025
81f4e56
fix: resolve ReferenceError for generateSampleText function
d-ulker Sep 20, 2025
c768c2e
fix: resolve syntax error preventing generateSampleText from being av…
d-ulker Sep 20, 2025
a2e66fd
feat: Add comprehensive demo website with DeBERTa v3 Large integration
deepsource-autofix[bot] Sep 20, 2025
83614fb
Add permissions block to fix security warning
d-ulker Sep 20, 2025
28acd1f
Fix emotion labels derivation from model config
d-ulker Sep 20, 2025
03d590a
fix: correct API request format to send JSON in POST body instead of …
d-ulker Sep 20, 2025
064c642
Fix multiple code review issues: readiness flag, JSON truncation, and…
d-ulker Sep 20, 2025
1889274
fix: resolve 404 errors by switching to local unified API server
d-ulker Sep 20, 2025
7ab43d4
Fix 14 Python syntax errors: f-strings, string literals, and line con…
d-ulker Sep 20, 2025
b2cfee0
feat: apply automated code formatting and fix syntax errors
d-ulker Sep 20, 2025
a96f292
fix: resolve 11 critical syntax errors (FLK-E999) across voice proces…
d-ulker Sep 20, 2025
65fa58d
feat: Add comprehensive demo website with DeBERTa v3 Large integration
deepsource-autofix[bot] Sep 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
15 changes: 15 additions & 0 deletions .bandit
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Bandit security linter configuration for SAMO-DL project
# This file configures bandit to ignore false positives and focus on real security issues

[bandit]
# Keep B104 enabled; use inline `# nosec B104` on intentional 0.0.0.0 bindings.
# This ensures we catch real security issues while allowing intentional production bindings.

# B104: Binding to all interfaces - Use inline # nosec B104 only where 0.0.0.0 is strictly required
# (e.g., Cloud Run entrypoint) with proper justification in code comments.

# Include specific files and directories
include = src/, scripts/, deployment/

# Exclude test files and build artifacts
exclude = tests/, build/, __pycache__/, .git/, .pytest_cache/
35 changes: 18 additions & 17 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
permissions:
pages: write
id-token: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Debug - Check current directory structure
run: |
echo "=== Current Directory Structure ==="
Expand All @@ -31,12 +31,12 @@ jobs:
ls -la website/ || echo "Website directory not found"
echo "=== Root HTML Files ==="
ls -la *.html 2>/dev/null || echo "No HTML files in root"

- name: Create clean website directory
run: |
# Create a completely clean directory with only website files
mkdir -p website-deploy

# Copy website files from the website/ directory (primary source)
if [ -d "website" ]; then
cp -r website/* website-deploy/ 2>/dev/null || true
Expand All @@ -45,67 +45,68 @@ jobs:
echo "ERROR: website/ directory not found!"
exit 1
fi

# Copy essential files from root if they don't exist in website/
if [ ! -f "website-deploy/index.html" ]; then
cp index.html website-deploy/ 2>/dev/null || true
fi
if [ ! -f "website-deploy/README.md" ]; then
cp README.md website-deploy/ 2>/dev/null || true
fi

# Copy .nojekyll file
cp .nojekyll website-deploy/ 2>/dev/null || true

# Remove any problematic directories that might have been copied
rm -rf website-deploy/data/
rm -rf website-deploy/models/
rm -rf website-deploy/deployment/
rm -rf website-deploy/test_checkpoints/
rm -rf website-deploy/__pycache__/
rm -rf website-deploy/*/__pycache__/

# Remove any lock files
find website-deploy -name "*.lock" -delete 2>/dev/null || true
find website-deploy -name "*.incomplete_info.lock" -delete 2>/dev/null || true

# Remove large files
find website-deploy -name "*.pt" -delete 2>/dev/null || true
find website-deploy -name "*.pth" -delete 2>/dev/null || true
find website-deploy -name "*.safetensors" -delete 2>/dev/null || true
find website-deploy -name "*.bin" -delete 2>/dev/null || true
find website-deploy -name "*.onnx" -delete 2>/dev/null || true

echo "=== Clean website directory created ==="
ls -la website-deploy/
echo "=== HTML files in website-deploy ==="
ls -la website-deploy/*.html 2>/dev/null || echo "No HTML files found"

# Validate that we have the required files
if [ ! -f "website-deploy/index.html" ]; then
echo "ERROR: index.html not found in website-deploy!"
exit 1
fi

echo "✅ Deployment files ready"

- name: Check GitHub Pages settings
run: |
echo "=== GitHub Pages Configuration ==="
echo "Branch: ${{ github.ref }}"
echo "Event: ${{ github.event_name }}"
echo "Actor: ${{ github.actor }}"
echo "Repository: ${{ github.repository }}"

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: 'website-deploy'
retention-days: 1

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
uses: actions/deploy-pages@v4
98 changes: 98 additions & 0 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: Code Quality Checks

permissions:
contents: read

on:
push:
branches: [ main, develop, feat/dl-* ]
pull_request:
branches: [ main, develop ]

jobs:
quality-check:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Comment on lines +20 to +24

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

Pin GitHub Actions to commit SHAs (supply‑chain hardening).

actions/checkout, setup-python, codecov, upload-artifact should be pinned to immutable SHAs, not tags. I can open a quick PR with the correct SHAs for your exact versions.

Also applies to: 23-25, 63-63, 74-75

🤖 Prompt for AI Agents
.github/workflows/quality.yml lines 20-24 (and also update 23-25, 63, and
74-75): GitHub Actions steps currently reference action tags (e.g.,
actions/checkout@v4, actions/setup-python@v5, codecov, upload-artifact); replace
each tag ref with the corresponding immutable commit SHA for the exact action
versions you intend to use. For each usage (actions/checkout,
actions/setup-python, codecov, actions/upload-artifact) find the commit SHA for
the desired release in the action’s repository and update the workflow to use
owner/repo@<full-commit-sha>, ensuring all occurrences on the listed lines are
pinned to SHAs rather than tags.

python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: |
pyproject.toml
requirements-dev.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Run Black (Code Formatting)
run: black --check src/ tests/ scripts/

- name: Run isort (Import Sorting)
run: isort --check-only src/ tests/ scripts/

- name: Run Flake8 (Linting)
run: flake8 src/ tests/ scripts/

- name: Run Pylint
run: pylint src/ tests/ scripts/ || true
continue-on-error: true

- name: Run MyPy (Type Checking)
run: mypy src/ tests/ scripts/

- name: Run Bandit (Security)
run: bandit -r src/ scripts/ -f json -o bandit-report.json

- name: Run Safety (Vulnerability Check)
run: safety check --json --output safety-report.json || true
continue-on-error: true

- name: Run Tests
run: pytest tests/ --cov=src --cov-report=xml --cov-report=html --tb=short

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: matrix.python-version == '3.11'
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Archive test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.python-version }}
path: |
bandit-report.json
safety-report.json
coverage.xml
htmlcov/
retention-days: 30

quality-gate:
Comment thread Fixed
runs-on: ubuntu-latest
needs: quality-check
if: always()

steps:
- name: Quality Gate Check
run: |
if [ "${{ needs.quality-check.result }}" = "failure" ]; then
echo "❌ Quality checks failed"
exit 1
else
echo "✅ All quality checks passed"
fi
Comment thread Fixed
61 changes: 61 additions & 0 deletions .gitleaks.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Gitleaks configuration for SAMO-DL project
# This file configures gitleaks to ignore false positives for ML tokenizer imports

[allowlist]
# ML tokenizer imports - these are false positives for "generic-api-key"
# The word "tokenizer" in ML context refers to model components, not API keys
description = "ML tokenizer imports that are false positives for generic-api-key detection"

[[allowlist.rules]]
description = "T5Tokenizer and T5ForConditionalGeneration imports"
regex = '''from transformers import T5Tokenizer, T5ForConditionalGeneration'''

[[allowlist.rules]]
description = "AutoTokenizer and AutoModelForSequenceClassification imports"
regex = '''from transformers import AutoTokenizer, AutoModelForSequenceClassification'''

[[allowlist.rules]]
description = "T5Tokenizer standalone import"
regex = '''from transformers import T5Tokenizer'''

[[allowlist.rules]]
description = "AutoTokenizer standalone import"
regex = '''from transformers import AutoTokenizer'''

[[allowlist.rules]]
description = "T5ForConditionalGeneration standalone import"
regex = '''from transformers import T5ForConditionalGeneration'''

[[allowlist.rules]]
description = "AutoModelForSequenceClassification standalone import"
regex = '''from transformers import AutoModelForSequenceClassification'''

# Additional ML-related patterns that might trigger false positives
[[allowlist.rules]]
description = "Model loading with tokenizer references"
regex = '''tokenizer.*=.*from_pretrained'''

[[allowlist.rules]]
description = "Tokenizer initialization patterns"
regex = '''AutoTokenizer\.from_pretrained'''

[[allowlist.rules]]
description = "T5 tokenizer initialization patterns"
regex = '''T5Tokenizer\.from_pretrained'''

[[allowlist.rules]]
description = "Model loading patterns with tokenizer"
regex = '''\.from_pretrained.*tokenizer'''

[[allowlist.rules]]
description = "Tokenizer variable assignments"
regex = '''tokenizer\s*=\s*.*from_pretrained'''

# File-specific allowlist for known false positive files
[[allowlist.rules]]
description = "scripts/pre_download_models.py - ML model download script"
regex = '''scripts/pre_download_models\.py'''

[[allowlist.rules]]
description = "src/startup_api.py - ML model loading in API"
regex = '''src/startup_api\.py'''
2 changes: 1 addition & 1 deletion .logs/code_quality_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Generated: 2025-07-22 20:21:52 UTC

## Pre-commit Hook Status
✅ Successfully implemented Ruff linting and formatting
✅ Security scanning with Bandit configured
✅ Security scanning with Bandit configured
✅ Secret detection active
✅ File quality checks working
✅ Automatic code formatting enabled
Expand Down
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ repos:
language_version: python3
args: [--line-length=88, --target-version=py38]
types: [python]
files: ^(src|tests|scripts)/

# Import sorting and organization
- repo: https://github.com/pycqa/isort
Expand All @@ -111,6 +112,7 @@ repos:
- id: isort
args: [--profile=black, --line-length=88, --py=38]
types: [python]
files: ^(src|tests|scripts)/

# Python linting with Ruff (super fast)
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand All @@ -119,6 +121,7 @@ repos:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
types: [python]
files: ^(src|tests|scripts)/

# Type checking with MyPy
- repo: https://github.com/pre-commit/mirrors-mypy
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,4 @@ All notable changes to this project will be documented in this file.

---

*This changelog follows the [Keep a Changelog](https://keepachangelog.com/) format and adheres to [Semantic Versioning](https://semver.org/).*
*This changelog follows the [Keep a Changelog](https://keepachangelog.com/) format and adheres to [Semantic Versioning](https://semver.org/).*
Loading
Loading