Repository navigation
fix(scans): count changed files when registering diff scans - #1916
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
Security findingsBlocking findings (1)
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for fixing the diff scope counts and sharing the inventory selector across all three registration paths. This owner-level merge-safety review found one remaining Windows test mismatch: the new directory-link exclusion changes an existing SDK regression’s expected rows, and the current Windows CI job fails on that assertion. Please update the test as noted inline. No other substantive findings.
Validation: portable source checks, SDK/plugin builds, types, and 14 independent inventory/count parity scenarios passed. Locally, 142 Python inventory/ranking cases, two registration cases, and nine SDK cases passed. Three CLI registration cases and two MCP completion cases were blocked by existing output-ancestor checks; one no-tools fallback fixture was affected by its enclosing Git checkout. Representative failures reproduce on the unchanged base, so these are testing limitations, not regressions. Full local integration coverage was not achieved.
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for fixing diff scope counts and sharing the inventory selector across all three registration paths. This owner-level merge-safety pass found no additional issues in the count correction. The directory-link behavior and Windows regression covered by the existing thread remain in this head; please fold stacked #1927 into this branch before merging.
Validation: 170 Python cases, all three packaged SDK diff-rank tests, and 14 independent benign count/inventory/registration checks passed. Ruff, the TypeScript CI build, SDK types, plugin packaging, source compatibility, and all nine compatibility-checker tests passed. Three CLI registration tests were blocked by the environment's existing output-parent ownership guard, and one no-tools fixture encountered an enclosing Git checkout; representative failures reproduce on the unchanged base. Full CLI completion and native Windows execution were not verified locally.
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for sharing the diff inventory across all three registration paths. Owner-level merge-safety review of 391fdaf: no additional count issues. The directory-link omission in the existing thread remains: the current Windows packaged test fails because the committed file below the junction is missing. Please fold the fix from #1927 into this branch before merging.
Validation: 12 focused Python cases and 14 benign count/inventory/registration scenarios passed locally, along with Ruff, CI compilation, SDK types, and all nine source-compatibility tests. Verified 330 relevant Python cases passed in exact-source CI, including all six changed cases. Three local CLI registration cases remain blocked by the environment's output-parent permissions guard; full CLI completion and Windows execution were not run locally.
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for sharing the diff inventory across all three registration paths. This owner-level merge-safety pass found no additional count issues at c4279a6. The directory-link omission in the existing thread remains: a modified committed file below a directory link is dropped. The local comparison confirms #1927 retains that base file and its empty preview. Please fold #1927 into this branch before merging.
Validation: 129 Python cases, nine count/inventory scenarios, all three packaged diff-rank tests, builds, types, Ruff, and all nine source-compatibility tests passed. Exact-source Linux CI passed all six changed cases on Python 3.12 and 3.14. Four local Python failures reproduce on the unchanged base because of the test environment. Windows execution and full CLI completion were not verified locally; the current Windows packaged job is still running.
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for sharing the diff inventory across all three registration paths. This owner-level merge-safety pass found no additional count issues at 9848a3f. The directory-link omission covered by the existing thread remains: a modified committed file below a directory link is dropped from the local diff inventory. Please fold #1927 into this branch before merging so the base file remains in scope with an empty preview.
Validation: 170 focused Python cases, 12 independent count/inventory scenarios, all three packaged SDK diff-rank tests on CI-pinned Bun 1.3.14, builds, types, Ruff, and all nine source-compatibility tests passed. Three CLI registration cases and one no-tools fixture failed because of environment conditions that also reproduce on the pinned base. Full CLI completion and Windows execution were not verified locally; the current broader CI run is still in progress.
There was a problem hiding this comment.
🛡️ Codex Security Review · Automatically triggered
Here are some automated security review suggestions for this pull request.
Reviewed commit: fd4eed64f8
ℹ️ 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.
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for sharing the diff inventory across all three registration paths. This review found no additional count issues at fd4eed6. The directory-link omission in the existing review thread remains; please fold #1927 into this branch before merging. The existing automated security thread also remains unresolved and needs maintainer triage.
Validation: 170 focused Python cases, 12 benign count/inventory/rank scenarios, two packaged diff-selection tests, builds, types, Ruff, and all nine source-compatibility tests passed. One unrelated no-tools fixture was excluded; known CLI registration environment limits were not bypassed. Full CLI completion, native Windows execution, and the automated security claim were not reproduced locally.
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for consolidating the registration counts and making the new Git reads use local objects only. The directory-link gap discussed in the existing thread still affects this head: a modified committed text file contributes zero after its parent is replaced by a directory link. A local comparison gives one file with #1927 applied. Please fold that selection fix into this branch so the count retains the base file. No additional substantive findings.
Validation: 23 focused tests, ordinary count and missing-object fixtures, builds, types, Ruff and formatting passed. All 65 exact-tree CI jobs passed; Linux reports confirm the six changed registration cases. Those cases were not selected by Windows CI. Full runtime and SQLite registration suites were not run locally.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e11742ddd3
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for sharing the selected diff count across the registration paths. Two existing issues still need attention:
- The modified base-file omission in the existing directory-link thread remains. Please fold the selection fix from #1927 into this branch so the original text file stays counted.
- The local binary-read concern is also supported: a 1 MiB in-memory input with a NUL at byte zero still consumes all 1,048,576 bytes. Stop early once a separately opened local file is known to be binary, while preserving the draining required for Git batch framing.
Validation: 23 focused tests and three ordinary count controls passed, along with builds, types, Ruff, formatting, and source checks. Exact-source CI passed all 65 jobs; Linux reports confirm six relevant registration cases. Full runtime and SQLite registration suites were not run locally, and those six cases were absent from the Windows selection.
alandelong-oai
left a comment
There was a problem hiding this comment.
This owner-level merge-safety review assessed 6e90d3e0dcad63b2d177a9522d091fa1253849a6 against 607038e13988b791886e1d68cc58174245eb9599. Counting the selected diff is necessary, and the shared registration helper and bounded Git batch reader are a reasonable approach. Two previously reported issues still need resolution before I can approve:
- The directory-link omission remains at this head: a modified tracked file beneath a replaced directory disappears from the count instead of retaining the relevant base file. The focused control gives 0 here and 1 with the fix in #1927. That child remains open and has not been folded into this branch; #2101 is also an open alternative, so neither resolves this exact head.
- The local binary-read issue also remains: a separately opened local binary is read to EOF after detection. Preserve full draining for Git batch framing, but stop early for local files so scan registration does not read entire large binaries unnecessarily.
Verification: Ruff checks, SDK CI/plugin builds and types, source compatibility plus its 9 tests, and packaged diff-rank tests passed (3 passed, 2 Windows skips). Focused Python validation recorded 172 passed, 73 platform skips and 5 Git-discovery fixture failures attributable to the local enclosing repository marker; the affected discovery functions are unchanged from base, and I did not rerun those fixtures on base. All new cases passed. Source CI passed all 65 jobs on a full Git tree identical to this head. New count tests run in Linux CI, not the native Windows/macOS subsets. No additional inline comments; the two existing threads cover the remaining findings.
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for correcting registration to count the selected diff. This owner-level merge-safety review confirms three existing issues:
- Missing local blobs abort registration: a real partial clone with a materialized HEAD but a missing deleted base blob cannot register because the optional count raises. Preserve the no-fetch boundary and leave the total unknown when classification is unavailable.
- Local binaries are drained after classification: a 1 MiB input with a NUL at byte zero still consumes all 1,048,576 bytes. Stop early for separately opened local files while retaining the draining needed for Git batch framing.
- The previously reported directory-link omission still occurs for a supported working-tree scan against an older base: a modified
skip-worktreefile counts as zero after its parent becomes a directory link. Retain the relevant base file as in the still-open #1927 fix. The ordinary deletion case correctly counts one.
I did not confirm the scoped-diff concern: public setup and CLI recipes reject those inputs. The post-count snapshot ordering also predates this patch. No duplicate inline comments.
Validation: the ordered portable checks, 31 focused Python tests and independent count controls passed; three other selected fixtures were blocked by existing ownership checks. Matching-tree CI passes all 20 changed regression cases on Linux Python 3.10/3.12/3.14; those cases were not selected on macOS/Windows. Local persistence remains constrained by existing ownership protections, and CI has an unrelated unchanged SDK signal-test failure. No full local integration or native Windows execution is claimed.
alandelong-oai
left a comment
There was a problem hiding this comment.
Thanks for addressing the count and inventory edge cases. Reviewed 1151dcf2e2aaeabd58cd29f08a88cc9051542800; no remaining findings.
Missing local Git objects now preserve an unknown total without fetching, local binary reads stop early while Git batch reads preserve framing, and directory-link replacements retain the selected base file. I also checked the post-count working-tree identity checks and nullable count persistence across registration paths.
Validation: 18 focused Python tests, 11 packaged inventory tests (46 assertions; one Windows-only skip), nine source-checker tests, and 11 temporary-Git control groups passed, together with the required lint/source checks, SDK/plugin builds, types and formatting. Inspected current CI reports for the exact base/head merge whose tree matches this head: the eight new regression cases pass on macOS and Windows, and 25 relevant cases pass on Linux 3.10 and 3.14.
Full persistent registration was not rerun locally because of the existing filesystem-owner restriction; its relevant regression coverage comes from those hosted reports. The Linux 3.12 report download was unavailable, so I am not claiming its individual results. No live scan was run.
Summary
A diff scan used to count every file in the checkout. Newly registered CLI, workspace, and prompt-driven scans now count the changed text files selected for review.
Refs #25.
Changes
Testing
On
11145b59c, 446 Python tests passed across registration, target selection, snapshot binding, and remediation, with 69 platform skips. The packaged inventory, ranking, source-preview, and build suites passed 171 cases on macOS, with 27 skips. Both Ruff checks, the SDK CI build, plugin source compatibility, and all nine checker tests passed.A real
--filter=blob:noneclone registered a range with a missing deleted base blob, persisted a null total, and left the object missing. Independent entry-point checks confirmed that saved-workspace, prompt, and CLI diff configurations all require a repository-wide diff. The regression suite also covers edits during counting, directory symlinks and Windows junctions, early binary detection, and active Git replacement objects.Earlier validation at
e11742ddd3f32 Python tests passed. A real partial clone confirmed missing objects stay unfetched during registration. Both Ruff checks, the SDK CI build and type check, plugin source compatibility, and all nine checker tests passed. The packaged inventory and ranking suites passed 142 cases on Linux and skipped 25 platform-specific cases. The prior feature patch reapplied to
6625739ef81reproduced the complete refreshed tree.Earlier validation at
4e57d18a98dRisk and rollout
The count applies to new scans. Registration reads the selected files before model work. Missing local objects leave the estimated total unknown. A working-tree edit during counting requires another registration attempt so the scan binds to the selected snapshot.
Public disclosure review