Skip to content

refactor(plugin): migrate rank pool helpers to TypeScript - #842

Open
kmbroai wants to merge 5 commits into
dev/kyleb/python-free-rank-shardsfrom
dev/kyleb/python-free-rank-pool
Open

kmbroai wants to merge 5 commits into
dev/kyleb/python-free-rank-shardsfrom
dev/kyleb/python-free-rank-pool

Conversation

@kmbroai

@kmbroai kmbroai commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Move ranking pool planning, validation, and result merging to the bundled TypeScript helper.

Changes

  • Preserve plan schemas, directory checks, deterministic assignments, shard validation, and receipt hashes over the original input bytes.
  • Remove redundant aggregate assignment and slot checks; validate the canonical round-robin assignment once per worker.
  • Read plans directly and use strict UTF-8 decoding while retaining BOM and UTF-16/32 support.
  • Register the migrated commands and remove their Python commands and tests.

Testing

  • Combined stack tip ba12023: both full SDK runs passed 2,656 tests with 50 skips and zero failures (seeds 12345 and 4201856736).
  • The six affected helper suites passed 213 tests with four Windows-only skips; all 23 MCP test processes passed.
  • CI compilation, plugin build, types, formatting, Ruff, portable source checks, and nine source-checker tests passed.
  • Rust formatting and cross-target Clippy for the Windows x64 native proof passed. Local execution was Linux; hosted CI supplies platform runtime coverage.

Risk and rollout

Stacked on ranking shards. make-rank-pool-plan, validate-rank-worker, and validate-rank-pool move to launch_codex_security_mcp[.cmd] --helper, preserving arguments, defaults, and the existing worker bound. Malformed UTF-8 is rejected even in overwritten duplicate values; ASCII-escaped surrogates and valid UTF-8/16/32 plans retain their handling. Duplicate assignments report the existing round-robin error.

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 9, 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-11T00:04:56.336337Z c46466b New commits
ℹ️ 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-rank-pool branch from 1ee4605 to c60440c Compare September 9, 2026 02:16
@kmbroai
kmbroai added this pull request to stack #855 September 9, 2026 22:16
Comment thread plugins/codex-security/mcp-app/src/helpers/rank-pool.ts Outdated
Comment thread plugins/codex-security/mcp-app/src/helpers/python-json.ts Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator

Reviewed c60440ca2554c5bb3cfdea69f19763d291499c09 against its #841 base using GPT-6 Astra at ultra effort, including the PR deslop and critical review passes.

This preserves the existing callable pool API. Its immediate product value is limited: the current in-tree scan guidance excludes separate ranking-phase pools, and I found no production orchestrator or receipt parser beyond helper dispatch. That makes additional generic compatibility machinery difficult to justify.

I found no introduced correctness or security regression and identified two nonblocking reductions totaling 58 lines:

  • Remove aggregate assignment checks and an unreachable slot check already implied by exact per-slot validation: 39 lines.
  • Reuse strict UTF-8 decoding for pool-plan JSON while retaining BOM and UTF-16/32 support: 19 lines. This deliberately rejects malformed UTF-8 that an overwritten duplicate value can currently hide; the inline comment describes that compatibility change.

Verification beyond the complete-stack comparison with main:

  • 163 focused tests passed, with 4 Windows-only skips; 29 remaining Python generator tests passed.
  • 2,540 direct mutation/encoding cases passed their explicit oracles on each of Node 20.0, 22.13, 24 and 26, comparing the original with independent variants.
  • 29 real CLI scenarios covered 304 invocations on each of Node 20 and 22. Original-byte receipt hashes, artifact bytes and modes were verified; invalid plans caused zero shard reads.
  • The three disposable pool-test variants passed 162 tests. SDK/MCP builds and types, Ruff and portable source checks passed.

Keep original plan/output buffers for receipt hashing and the exact per-slot and shard-content validators. Coordinate the previously posted existence, native-directory and discovery simplifications through this caller.

Local OS execution was Linux. Exact-head CI supplies separate Windows, PowerShell, macOS and native-runtime evidence. The proposed changes need that platform CI when applied, and the synthetic combined stack needs it after restacking.

kmbroai commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

Applied the remaining reductions: aggregate assignment checks are removed, plan reads no longer precheck existence, and UTF-8 uses the shared strict decoder. Per-slot assignment validation, shard checks, BOM/UTF-16/32 support, and original-byte receipt hashing remain. The malformed-UTF-8 compatibility change is documented and tested.

Updated head: c46466b46e494958d47ea0dc499045cbff9e4d36. Hosted CI passes on this head, including Linux/macOS/Windows tests, native proofs, installed-package checks, plugin source contracts, types, and formatting. Codex Security Review also passes. The combined stack at 5bd1d1909ad99d2749fe8d3ec49a9a144ae2bac0 includes this head and has also passed platform CI.

This branch has not been deployed

No deployments
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