Skip to content

refactor(plugin): port security policy resolution to TypeScript - #799

Open
kmbroai wants to merge 7 commits into
dev/kyleb/python-free-windows-wide-pathsfrom
dev/kyleb/python-free-policy-resolver
Open

refactor(plugin): port security policy resolution to TypeScript#799
kmbroai wants to merge 7 commits into
dev/kyleb/python-free-windows-wide-pathsfrom
dev/kyleb/python-free-policy-resolver

Conversation

@kmbroai

@kmbroai kmbroai commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replace the Python SECURITY.md resolver and its tests with a typed helper bundled alongside the MCP runtime. Policy discovery and root-to-leaf guidance use the existing Node launcher.

Changes

  • Preserve containment, symlink and junction behavior, byte limits, UTF-8 handling, home expansion, inventory ordering, accepted arguments, and output formats.
  • Preserve POSIX path bytes and Windows UTF-16 process values and paths; compare canonical Windows components without losing characters during case conversion.
  • Invoke launch_codex_security_mcp[.cmd] --helper resolve-security-md --repo PATH [--list | --scope PATH] [--out PATH], defaulting to stdout. Limit the SDK's Python interpreter instruction to .py helper scripts.
  • Document intentional compatibility for abbreviated options, inherited help behavior, named-user expansion, and home-variable precedence. Replace complete Markdown snapshots with semantic source/content/order assertions and dedicated framing checks.
  • Retain the compatible path resolver after native realpath comparisons showed different existing-file parent behavior. Remove the completed characterization probe and describe the active TypeScript policy helper in the native documentation.

Testing

  • After the Windows File integration: both MSVC-target Clippy checks, CI-tool compilation, proof syntax, Rust/TypeScript formatting, workflow lint, Ruff, portable source checks, and all nine checker tests passed.
  • 34 policy/launcher tests passed locally, with four Windows-only skips, plus the focused SDK prompt test.
  • After correcting malformed short-help errors, 32 helper tests passed with three Windows-only skips and 180 assertions. All 19 help-suffix comparisons matched the deleted Python helper.
  • SDK/MCP TypeScript checks, formatting, Ruff, portable source checks and all nine checker tests passed.
  • Completed comparisons on GNU Linux, musl, and macOS established the native file-parent behavior. The deleted Python helper independently confirmed the retained compatibility behavior.
  • Hosted CI exercises macOS, glibc, musl, and Windows fixtures on both architectures. Resolver tests retain file-parent, missing-path, symlink-cycle, and raw-byte behavior.

Risk and rollout

Stacked on #798. The helper entrypoint changes from the Python script to the shared launcher, with callers updated together. Previously accepted arguments and home expansion remain supported intentionally. GNU Linux file/.. compatibility requires retaining the existing resolver; native realpath is not a drop-in replacement. Other Python helpers remain for subsequent migration slices. There are no new top-level CLI flags.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review Completed 2026-09-05T01:46:17.346644Z 9986e31 New commits

Security findings

Blocking findings (1)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@kmbroai
kmbroai force-pushed the dev/kyleb/python-free-policy-resolver branch from 1eb78b2 to 7a77479 Compare September 3, 2026 18:28
@kmbroai
kmbroai force-pushed the dev/kyleb/python-free-policy-resolver branch from 7a77479 to 2228b64 Compare September 3, 2026 19:19
Comment thread plugins/codex-security/mcp-app/src/helpers/posix-path.ts
Comment thread plugins/codex-security/mcp-app/src/helpers/resolve-security-md.ts
Comment thread plugins/codex-security/mcp-app/src/helpers/resolve-security-md.ts
Comment thread sdk/typescript/tests-ts/security-policy-helper.test.ts Outdated
Comment thread plugins/codex-security/references/security-guidance.md
@kmbroai
kmbroai force-pushed the dev/kyleb/python-free-policy-resolver branch from 2228b64 to 0216913 Compare September 4, 2026 22:46
@kmbroai
kmbroai force-pushed the dev/kyleb/python-free-policy-resolver branch from 0216913 to ad511ed Compare September 4, 2026 23:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Security Review

Here are some automated security review suggestions for this pull request.

Reviewed commit: ad511edcbb

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread plugins/codex-security/scripts/launch_codex_security_mcp

@mldangelo-oai mldangelo-oai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed the exact current head and reconciled all prior threads. The compatibility behavior is well covered; the remaining comments are nonblocking simplification and documentation cleanup.

Comment thread plugins/codex-security/native/proof.mts Outdated
Comment thread plugins/codex-security/mcp-app/src/helpers/resolve-security-md.ts
@kmbroai
kmbroai force-pushed the dev/kyleb/python-free-policy-resolver branch from ad511ed to 9986e31 Compare September 5, 2026 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants