Repository navigation
test(plugin): cover Perl source and mixed encodings in diff inventories - #2109
Merged
mldangelo-oai merged 1 commit intoOct 28, 2026
Merged
Conversation
The extension allowlist that silently dropped `.cgi`, `.pl`, `.pm`, and `.t` files was removed in openai#1347, and openai#1432 moved inventory generation to Node. The move left no coverage for the reported Perl/mixed-encoding scenario: the Python `source_cases` matrix that carried unfamiliar and extensionless sources is no longer referenced, so a future suffix filter would regress silently. Add a diff-inventory regression that includes `.cgi`, `.pl`, `.pm`, `.t`, an extensionless Perl shebang script, and a file stored as EUC-JP rather than UTF-8. A `.pm` containing NUL bytes stays excluded, pinning selection to file content rather than suffix. Refs openai#2078.
Collaborator
|
Thanks! |
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
Issue #2078 reported that Codex Security 0.1.32 silently excluded
.cgi,.pl,.pm, and.tfiles from diff inventories because of a fixedTEXT_CODE_EXTENSIONSallowlist. That allowlist was removed in #1347 ("include text files in scans regardless of extension"), and #1432 later moved inventory generation from Python to the Node helper. The behavior is fixed: I verified the published 0.8.0 bundle on a synthetic repo containing.cgi,.pl,.pm,.t, and an EUC-JP CGI file, and every changed file appears inin_scope_files.txt.What the migration left behind is coverage. #1347 added extensionless and unfamiliar-source cases to the Python
source_casesmatrix, but #1432 replaced those tests andplugins/codex-security/tests/source_cases.pyis now unreferenced. Nothing currently pins Perl or non-UTF-8 text, so a future suffix filter could reintroduce the reported coverage gap silently. This PR adds the regression coverage the issue asks for.Changes
testPrepareIncludesPerlSourceWithMixedEncodingstoplugins/codex-security/mcp-app/tests/test_artifact_inventory.ts..cgi,.pl,.pm, and.tfiles, an extensionless Perl shebang script, and a CGI file encoded as EUC-JP; all are asserted present in the automatic diff inventory..pmcontaining NUL bytes is asserted absent, pinning selection to file content rather than suffix.Buffercontent so the EUC-JP case is byte-exact.Testing
node --experimental-strip-types --test tests/test_artifact_inventory.tswith a helper built from the branch source: 1/1 file passed..cgi|.pl|.pm|.tsuffix filter ingenerate-inventory.tsmade the new test fail (reviewItemsTotal: 0vs6); restored afterward.node --experimental-strip-types --test tests/test_candidate_inventory.ts: 2/2 passed.pnpm --dir plugins/codex-security/mcp-app exec prettier --check "tests/test_artifact_inventory.ts": clean.uvx ruff==0.17.1 check/format --checkwithplugins/codex-security/pyproject.toml: clean.pnpm --dir sdk/typescript run build:ci,check_plugin_source_compatibility.mjs, and its test: pass.Risk and rollout
Test-only change; no production code, CLI surface, or artifacts change. The new case runs in the existing MCP test job and is platform-neutral (NUL-based binary classification, ASCII paths).
Public disclosure review