Skip to content

[RED TEAM] .codelensignore negation pattern (!) silently ignored — files NOT re-included #120

Description

@Wolfvin

Temuan

PR #106 (.codelensignore support) mengklaim mendukung 3-tier ignore patterns termasuk negation (!pattern) untuk re-include files yang sebelumnya di-ignore. Namun negation pattern TIDAK berfungsi — files yang di-negate tetap di-ignore.

Cara reproduce

cd benchmarks/fixtures/clean_app
rm -rf .codelens

# Baseline: no ignore
python ../../../scripts/codelens.py scan . 2>&1 | grep -E '"python"|"js_backend"'
# Output: python: 7, js_backend: 1

# Ignore src/
echo 'src/' > .codelensignore
python ../../../scripts/codelens.py scan . 2>&1 | grep -E '"python"|"js_backend"'
# Output: python: 2, js_backend: 0  (src/ excluded)
rm .codelensignore

# Ignore src/ but negate src/utils.py
echo -e 'src/\n!src/utils.py' > .codelensignore
python ../../../scripts/codelens.py scan . 2>&1 | grep -E '"python"|"js_backend"'
# Output: python: 2, js_backend: 0  (negation NOT applied!)
rm .codelensignore

Output aktual

# Dengan negation !src/utils.py:
python: 2  (should be 3: config/settings.py + main.py + src/utils.py)
js_backend: 0  (should still be 0 — src/api_client.js is still ignored)

Graph nodes after scan dengan negation:

utils.py nodes: []  (should have format_text, validate_input, dll)
all nodes: [get_aws_credentials, get_database_url, get_stripe_config, get_jwt_config, is_debug_mode, main]

Output yang diharapkan

Dengan !src/utils.py negation, src/utils.py harus re-include dan functions-nya (format_text, validate_input, dll) harus muncul di graph. python: 3 (bukan 2).

Severity

HIGH — fitur negation adalah standard gitignore feature yang didokumentasikan tapi tidak berfungsi. User yang rely on negation untuk keep specific files saat ignore broad directory akan silently kehilangan files dari graph. Tidak ada error message — files just disappear dari scan results.

PR terkait

#106 (.codelensignore support). Bug di implementation — negation pattern ! di-parse tapi tidak apply ke file filtering logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions