Skip to content

refactor(plugin): migrate rank shard helpers to TypeScript - #841

Open
kmbroai wants to merge 7 commits into
dev/kyleb/python-free-unix-directory-entriesfrom
dev/kyleb/python-free-rank-shards
Open

kmbroai wants to merge 7 commits into
dev/kyleb/python-free-unix-directory-entriesfrom
dev/kyleb/python-free-rank-shards

Conversation

@kmbroai

@kmbroai kmbroai commented Sep 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Move ranking shard creation, validation, and merging to the bundled TypeScript helper while preserving command options, shard layout, and output rows.

Changes

  • Reuse the shared worklist parser and raw-byte directory enumeration.
  • Generate canonical shard names and check their membership directly; preserve contiguous assignments, row partitions, paths, and area validation.
  • Keep real Unicode/raw-filename tests and update the Windows native proof for the canonical-name diagnostic.
  • 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 the Unix directory primitive. make-rank-shards, validate-rank-shard, and merge-rank-outputs move to launch_codex_security_mcp[.cmd] --helper, preserving options and defaults. Malformed shard names use the canonical-name diagnostic; missing inputs report their read 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:06:36.444056Z bc172b4 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 added this pull request to stack #855 September 9, 2026 22:16
Comment thread plugins/codex-security/mcp-app/src/helpers/rank-shards.ts Outdated
Comment thread sdk/typescript/tests-ts/rank-shards.test.ts Outdated
@mldangelo-oai

Copy link
Copy Markdown
Collaborator

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

The migration preserves the covered partition, worker-validation and filesystem contracts. I found no demonstrated correctness or security regression and identified two nonblocking simplifications totaling 42 lines:

  • Generate canonical shard names and check membership instead of parsing and sorting numeric suffixes: 13 lines.
  • Remove the inactive opendirSync preload from the Unicode/raw-name regression test: 29 lines, retaining its real filesystem assertions.

Verification beyond the complete-stack comparison with main:

  • 89 focused shard/deep-review tests passed, with 2 Windows-only skips; 15 surviving Python pool-consumer tests passed.
  • The discovery replacement passed 327 filesystem cases on each of Node 22.13, 24 and 26, including 10,001 canonical shards.
  • 35 Python-base/head/variant scenarios and five pool compositions covered 326 helper invocations. Artifact bytes, modes, links, assignments and 15 independently recomputed worker receipts matched.
  • An unconditional opendirSync trap recorded zero calls in both test scenarios; the shorter fixture passed.
  • SDK/MCP types, builds, Ruff and portable source checks passed.

Malformed-name diagnostics intentionally use the canonical-name error. One downstream test asserting the previous wording needed that assertion updated; its focused rerun passed. Keep the exact partition/path/area checks and wide/raw-path handling. The native-export and input-existence suggestions remain on #840 and #839 to avoid duplicate findings.

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

kmbroai commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

Applied canonical shard-name generation and membership checks, carried the earlier removal of the unused preload, and updated the downstream diagnostic assertions and Windows native proof. The raw-filename, partition, path, area, and output-preservation checks remain.

Updated head: bc172b4428d9388b9f90fbd61fcac4ec8b8c436e. 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. GitHub still labels Windows shard 2 as in progress, although all its test and cleanup steps completed successfully; the workflow and required gates report success. The combined stack at 5bd1d1909ad99d2749fe8d3ec49a9a144ae2bac0 includes this head and has also passed platform CI.

# Conflicts:
#	plugins/codex-security/mcp-app/src/helpers/deep-review-input.ts

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