Skip to content

fix(analysis): preserve candidate blob bytes on Windows - #3548

Merged
EffortlessSteven merged 4 commits into
mainfrom
codex/windows-candidate-bytes
Aug 29, 2026
Merged

EffortlessSteven merged 4 commits into
mainfrom
codex/windows-candidate-bytes

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Force git archive materialization to disable core.autocrlf so candidate-tree bytes remain exact on Windows. Tests now compare extracted bytes with git show candidate blobs.

Proof

  • cargo test --locked -p ripr --lib analysis::git_candidate_execution::tests (10 passed)
  • cargo fmt --check
  • cargo clippy --locked -p ripr --lib -- -D warnings
  • git diff --check

Claim boundary

This proves byte-preserving candidate materialization for the covered archive paths. It does not establish release or publication readiness. No workflow, dependency, or release surface changed.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 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
📝 Code Review ✅ Completed 2026-08-29T02:04:07.296014Z 946bfe7 Manual request
ℹ️ 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.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

@codex review

@coderabbitai

coderabbitai Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 33 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: fc786a00-3956-4231-a878-da818fca5833

📥 Commits

Reviewing files that changed from the base of the PR and between dcb18a8 and 314229f.

📒 Files selected for processing (2)
  • crates/ripr/src/analysis/git_candidate_execution.rs
  • crates/ripr/tests/immutable_candidate_falsifier.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Exact-head substantive review for 946bfe7bc9613863e75cbe3d810905375b2519f2: the production change is limited to the object-backed git archive invocation, forcing core.autocrlf=false; tests now compare extracted bytes with git show candidate blobs. The focused candidate-execution suite passes 10/10 on Windows, including the three prior CRLF failures. cargo fmt --check, locked ripr-library Clippy with -D warnings, and git diff --check pass. No defect found in this bounded seam. This establishes candidate blob fidelity for covered archive paths only; it does not establish full workspace, release, or publication readiness. Hosted proof and required review remain pending.

@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 Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 946bfe7bc9

ℹ️ 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".

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Current-head hosted disposition — 946bfe7

The displayed source-of-truth and droid-review failures are cancelled jobs, not source findings. The source-of-truth job stopped during document-artifact validation with no diagnostic output; droid-review had no executed steps. Rust gates, UB review, dependency, security, routing, and plan checks pass. This leaves those two lanes NOT_PROVEN; no unchanged retry or merge claim is made. The bounded Windows candidate-blob fidelity claim remains locally proven only.

…onversion (#3548 review)

git archive honors .gitattributes (e.g. '*.rs text eol=crlf') even with
core.autocrlf=false, so archive-extracted candidate roots could silently
differ from the exact blob bytes bound by the immutable candidate
identity. Materialize instead by enumerating the tree (ls-tree -r -z,
fail-closed on non-UTF-8 paths per the #3545 lossy-collapse family) and
writing each blob through cat-file, which never applies attribute
conversion. Traversal-safe path joins and the bounded-output limits are
preserved; the in-crate tar machinery is removed.

Regression: a candidate committed under an eol=crlf attribute must
materialize byte-identical to git show <tree>:<path> (LF stays LF).
…n message (#3548 review)

The blob-wise materialization rejects a symlink at tree enumeration
(unsupported tree entry mode 120000, naming src/linked.rs) before any
byte is written, so the fail-closed property is structural; the falsifier
tests now assert the new typed message while keeping the entry-naming and
cleanup assertions.
@EffortlessSteven
EffortlessSteven merged commit d42e158 into main Aug 29, 2026
21 checks passed
@EffortlessSteven
EffortlessSteven deleted the codex/windows-candidate-bytes branch August 29, 2026 12:37
EffortlessSteven added a commit that referenced this pull request Oct 3, 2026
…file --batch session (#5105)

* perf(analysis): batch candidate-tree materialization through one cat-file --batch session (#5015)

Materializing a candidate tree spawned one sequential git cat-file
subprocess per file, each carrying the full per-invocation git deadline:
N spawns for an N-file tree and a worst case of N x git_timeout for a
slow or hanging git, with a 512 MiB buffer per blob.

Replace the per-blob loop with one streaming git cat-file --batch
session (two git spawns total with the ls-tree listing, O(1) in tree
size). The session is a lockstep request/response protocol through the
shared git spawn authority: blob bytes stream to disk in bounded 64 KiB
chunks, so memory stays bounded regardless of tree size and a large
blob can never deadlock against an unread pipe. The same value the
per-blob calls each used before now bounds the whole materialization
phase once, enforced incrementally on every blocking read through the
shared named git_invocation_timeout classification; cooperative
cancellation is checked per request and per chunk. The materialized
byte total is capped at MAX_ARCHIVE_BYTES for the whole tree.

Fail-closed behavior is preserved: unsupported modes, non-UTF-8 paths,
and traversal attempts fail with the existing named errors before any
byte is written; malformed framing, truncated streams, missing objects,
and deadline expiry fail the whole subject, and the temp-root guard
removes the partial tree. Blob bytes remain byte-identical to per-blob
cat-file output, preserving the #3548 no-textconv identity argument
against git archive.

Evidence: stream-parser unit tests (chunk-boundary reassembly,
truncation, spent-budget timeout), a real-repository session round trip
against the raw git show oracle including a missing object, a
zero-budget named-timeout control through finish, and a 300-file plus
multi-chunk binary plus empty-file scale fixture asserting byte parity
with the bound blobs. Spawn count for the materialization phase goes
from N+1 to 2 structurally; wall-clock magnitude stays a
measurement-pending claim per the issue's own design_question
classification (RIPR-SPEC-0206).

* style: apply rustfmt from CI gate log

* fix: restore the request_blob try-operator and compute budget before stdin drop

* docs: register RIPR-SPEC-0206 in the doc-artifacts ledger

* docs: bring RIPR-SPEC-0206 to the required spec format headings

* fix: satisfy clippy cast-sign-loss and duration-unit lints in new tests

* fix: harden the batch session from review findings

- Backpressure: the stdout chunk reader now feeds a bounded
  sync_channel (8 x 64 KiB); a slow destination stalls git through the
  pipe instead of queuing unbounded chunks in memory.
- Absolute deadline: stream waits recompute their allowance from one
  deadline Instant per wait, so fragments dribbling just under each
  individual wait cannot outlive the overall budget; new
  dribbling-fragment test pins it.
- Abort routing: every stream failure (truncated stream, oversized
  header, malformed header/kind, bad framing) now terminates the owned
  process tree through the shared terminate-then-classify contract
  instead of relying on the drop path.
- One budget for both git processes: the materialization clock starts
  at entry, ls-tree runs inside the remaining budget, and the batch
  session receives only what is left after listing and validation.
- The truncation test now parses a real header before asserting the
  mid-blob EOF; RIPR-SPEC-0206 documents the residual stalled-write
  limitation honestly.

* style: apply rustfmt from CI gate log

* fix: reject buffered bytes past the overall deadline
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.

1 participant