-
-
Notifications
You must be signed in to change notification settings - Fork 0
fix(ci): emit bare Security Gate Validation context #78
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| import tempfile | ||
| from dataclasses import dataclass | ||
| from pathlib import Path | ||
| from typing import cast | ||
|
|
||
| import librosa | ||
| import numpy as np | ||
|
|
@@ -282,8 +283,12 @@ def process_audio( | |
| ) | ||
|
|
||
| try: | ||
| # Load audio | ||
| # Load audio. dtype="float64" guarantees a float64 array at | ||
| # runtime; soundfile's stub returns a dtype union for the | ||
| # non-literal dtype argument, so cast to the concrete alias | ||
| # used by speech_chunks below. | ||
| audio, sample_rate = sf.read(str(input_path), dtype="float64") | ||
|
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. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- target method and imports ---'
sed -n '1,35p;250,325p' src/audio_processor/services/vad_processor.py
printf '%s\n' '--- direct process_audio callers ---'
rg -n -C 3 'process_audio\(' src tests 2>/dev/null || true
printf '%s\n' '--- path resolution and upload-directory validation symbols ---'
rg -n -C 3 'resolve\(\)|upload.?dir|validate.*path|path.*valid|relative_to|is_relative_to' src/audio_processorRepository: ByronWilliamsCPA/audio-processor Length of output: 9182 🤖 get_repo_knowledge executed:
Length of output: 16066 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- VADProcessor definition and related file I/O ---'
ast-grep outline src/audio_processor/services/vad_processor.py
sed -n '35,270p' src/audio_processor/services/vad_processor.py
printf '%s\n' '--- API upload flow and VAD invocation ---'
sed -n '201,345p' src/audio_processor/api/routes.py
printf '%s\n' '--- configuration fields relevant to storage roots ---'
rg -n -C 3 'UPLOAD|upload|TEMP|temp|storage|directory|dir' src/audio_processor/core/config.py src/audio_processor/api/routes.py src/audio_processor/servicesRepository: ByronWilliamsCPA/audio-processor Length of output: 42263 🏁 Script executed: #!/bin/bash
set -e
printf '%s\n' '--- all VAD construction and method calls ---'
rg -n -C 4 'VADProcessor|detect_speech|process_audio' src/audio_processor --glob '*.py'
printf '%s\n' '--- worker/job processing path references ---'
rg -n -C 4 'file_path|audio_temp_dir|AudioJobInput|condition\(|convert|transcrib' src/audio_processor/worker.py src/audio_processor 2>/dev/null | head -240Repository: ByronWilliamsCPA/audio-processor Length of output: 33341 Add path confinement and the required external-resource marker before audio reads.
🤖 Prompt for AI AgentsSource: Coding guidelines |
||
| audio = cast("AudioSamples", audio) | ||
|
Comment on lines
+286
to
+291
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. 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win Add the required external-resource RAD tag.
As per coding guidelines: “All methods that call external APIs or read files must carry 🤖 Prompt for AI AgentsSource: Coding guidelines |
||
|
|
||
| # Ensure mono | ||
| if audio.ndim > 1: | ||
|
|
||
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Wrap this changelog entry to 120 characters or less.
Line 22 is a single Markdown line that exceeds the repository limit. Split the list item across indented continuation lines.
As per coding guidelines, Markdown files must use 120 character line length.
🤖 Prompt for AI Agents
Source: Coding guidelines