fix(analyzer): align file-size guard with character semantics (#284)#287
Open
rodboev wants to merge 1 commit into
Open
fix(analyzer): align file-size guard with character semantics (#284)#287rodboev wants to merge 1 commit into
rodboev wants to merge 1 commit into
Conversation
…#284) Signed-off-by: Rod Boev <rod.boev@gmail.com>
koriyoshi2041
approved these changes
Jul 19, 2026
koriyoshi2041
left a comment
Contributor
There was a problem hiding this comment.
The character-based policy is applied consistently across the four analyzer paths, and the renamed constant/log wording now matches the actual len(str) guard. The boundary and multibyte cases also preserve the existing behavior explicitly.
I ran the four focused analyzer test modules on this head: 206 passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The analyzer file-size guard already measures decoded Python characters, but the shared constant name and skip logs still describe that threshold as bytes. Multibyte UTF-8 content therefore follows the current compatibility policy while being reported with the wrong unit.
Closes #284
Root cause
src/skillspector/nodes/analyzers/static_runner.pyowns the shared analyzer size guard, and every affected analyzer compareslen(content)on decodedstrcontent against that constant. The value and behavior were already character-based; only the constant name, skip logs, and one adjacent_agent_cli.pycomment still claimed byte semantics.Diff Notes
MAX_FILE_BYTEStoMAX_FILE_CHARSinsrc/skillspector/nodes/analyzers/static_runner.pyand updated static patterns, YARA, behavioral AST, and behavioral taint consumers to import the renamed authority._agent_cli.pycap comment so the analyzer character limit and the CLI's encoded-byte limit are described as separate guards.tests/nodes/analyzers/test_static_runner_filtering.py,tests/nodes/analyzers/test_static_yara.py,tests/nodes/analyzers/test_behavioral_ast.py, andtests/nodes/analyzers/test_behavioral_taint_tracking.py.Scope
This keeps the existing one-million-character analyzer policy and per-file skip behavior. It does not switch analyzers to encoded-byte limits, change
build_contextsize_bytesmetadata, touch input acquisition or report schemas, or alter_agent_cli.pyruntime behavior.Verification
uv sync --all-extraspassed;Resolved 156 packages in 0.88msandChecked 151 packages in 3ms.cmd.exe /d /s /c "set PYTHONPATH=src&& .\.venv\Scripts\python.exe -m pytest tests\nodes\analyzers\test_static_runner_filtering.py tests\nodes\analyzers\test_static_yara.py tests\nodes\analyzers\test_behavioral_ast.py tests\nodes\analyzers\test_behavioral_taint_tracking.py"passed;206 passed in 44.64s.uv run ruff check src/ tests/passed.uv run ruff format --check src/ tests/passed.git diff --checkpassed.