Repository navigation
fix(plugin): deduplicate tracked ignored files in scoped inventories - #1077
Merged
mldangelo-oai merged 2 commits intoSep 30, 2026
Merged
Conversation
mldangelo-oai
approved these changes
Sep 30, 2026
mldangelo-oai
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for catching this and adding the regression tests. I confirmed the duplicate rows against main and checked the fix with relative and absolute scopes. The refreshed branch preserves the Git metadata exclusions, and all focused tests and portable source checks pass. This is a small, useful fix to the inventory helper. Looks good to me.
Merged
3 tasks done
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 non-diff inventory helper can collect the same tracked, ignored file from both ripgrep and Git when an ignored directory or file is explicitly scoped. Two selected files can therefore produce four inventory rows and an inflated count.
Deduplicate the combined results before writing the inventory. This fixes direct use of the retained helper; the public diff preparation tool already uses a separate, deduplicated path.
Changes
./prefixes, and absolute directory and file paths.Testing
python -m pytest -q plugins/codex-security/tests/test_generate_in_scope_files.py: 70 passed.node --test plugins/codex-security/mcp-app/tests/test_artifact_inventory.mjs: passed.python -m ruff check --config plugins/codex-security/pyproject.toml plugins/codex-security: passed.python -m ruff format --check --config plugins/codex-security/pyproject.toml plugins/codex-security: passed, 136 files.pnpm --dir sdk/typescript run build:ci: passed.node .github/scripts/check_plugin_source_compatibility.mjs: passed.node --test .github/scripts/test_check_plugin_source_compatibility.mjs: 9 passed.git diff --check: passed.Risk and rollout
Low risk: only duplicate byte-identical inventory rows are removed. Path validation, ordering, and atomic output replacement remain intact. No CLI options or defaults change.
The MCP regression calls the internal helper directly. It verifies totals and pagination without claiming that the current public diff tool or Standard scan workflow reaches the affected non-diff branch.
Public disclosure review