Repository navigation
Conversation
qq init --project --force followed a symlinked .qq or .qq/config.ron and truncated the link's target; both are now refused with InitError::Symlink. Ignore files (.gitignore, .ignore, .qqignore) were read whole whatever their size, and a FIFO in their place blocked the walk at open. Only a regular file of at most 256 KiB is read now; anything else counts as absent. search_walk bench before/after (10k files, 20 iterations): content_rare 5306/5055 us, definition_full 21847/21697 us, tree_depth2 5350/5235 us; no regression from the added stat. Refs: ENG-974
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7fcb67ddc
ℹ️ 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".
…eck atomic with the open Review (Codex, #217): both checks ran before the open, so a writer in the directory could swap in a symlink (init --force would then truncate the target) or a FIFO (the walk would block at open) in between. - qq init opens the target relative to an O_NOFOLLOW|O_DIRECTORY handle on its directory, with O_NOFOLLOW (and O_EXCL unless --force); ELOOP/ENOTDIR map to InitError::Symlink. Root enables rustix's fs feature on unix (no new crate or version: Cargo.lock gains only the qq -> rustix edge). - Ignore files open O_NOFOLLOW|O_NONBLOCK and the type and size are checked on the opened descriptor. Regressions (each fails on the old check-then-open code): the_open_itself_refuses_links_swapped_in_after_the_check, an_ignore_file_swapped_for_a_fifo_or_link_after_listing_is_not_read. search_walk bench unchanged within noise (tree_depth2 5069 us, content_rare 5396 us). Also merges #216 into this branch. Refs: ENG-974
…w option Pre-push review: the O_NOFOLLOW|O_NONBLOCK flags were passed as raw custom flags. cap-primitives' manual path resolution (macOS, or Linux without openat2) reads ELOOP as a symlink to follow unless its own follow option is No, so a symlinked .gitignore could still be read there. Set follow(No) and nonblock through cap-primitives' options instead. Refs: ENG-974
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b363ecd63d
ℹ️ 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".
| .write(true) | ||
| .create_new(!force) | ||
| .create(force) | ||
| .truncate(force) | ||
| .open(path) |
There was a problem hiding this comment.
Refuse Windows reparse points in the forced open
On Windows, when --force targets a project directory writable by another user or process, that writer can replace config.ron with a symlink or junction after symlink_metadata succeeds; this ordinary OpenOptions::open follows the reparse point and truncates its target. The fresh evidence after the prior Unix fix is this new cfg(not(unix)) branch, which still separates the check from the destructive open even though Windows is a shipped release target; open without following reparse points and validate the opened handle atomically.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Won't fix now: before this PR Windows had no symlink check at all, and the Unix path is atomic. Opening without following reparse points needs FILE_FLAG_OPEN_REPARSE_POINT via Windows APIs we don't depend on yet. Follow-up for the Windows target.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
1 similar comment
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
) * test(store): upgrade a v0.1.4 (schema 35) session store to current v0.1.5 carries migrations 36 to 39. A store populated through the runtime is rewound to the v0.1.4 shape (no sessions.approval_delegate, schema_version 35), then reopened: it migrates to STORE_SCHEMA_VERSION, keeps the session and its prompt, invents no delegate override, accepts SetApprovalDelegate, and reopens as a no-op. Removing the 36 step makes the test fail. Refs: ENG-975 * Merge #217 into test/eng-975; address Codex review Review (Codex, #218): - The reopen only rechecked schema_version. It now reopens the runtime and asserts the delegate written before closing (off) and the transcript are unchanged. - The prompt was matched anywhere in the serialized snapshot, which the session title also contains. The test now asserts the focused message rows: the user prompt text and a complete, non-empty assistant reply. Refs: ENG-975
Stack ENG-968 (v0.1.5 readiness), 6 of 9. Merge in order; diff shown is this layer only.
Bugs
qq init --project --forcefollowed a symlinked.qqor.qq/config.ronand truncated the link's target..gitignore/.ignore/.qqignorewere read whole regardless of size; a FIFO in their place blocked the walk forever.Fix
InitError::Symlinkfor either path. Ignore files: regular file only, ≤ 256 KiB (bounded read), else treated as absent.Tests
force_refuses_to_write_through_a_symlinked_project_config,a_fifo_or_oversized_ignore_file_is_skipped_not_read.Measured (
search_walk, 10k files, 20 it, before/after)content_rare 5306/5055 µs · definition_full 21847/21697 µs · tree_depth2 5350/5235 µs: no regression from the added stat.
Docs:
design/tools.md§ read-side walk. Linear: ENG-974.Verification (top of stack)
cargo test --workspace1970 passed / 0 failed / 7 ignored;cargo clippy --workspace --all-targets --all-features -- -D warningsclean;cargo fmt --all -- --checkclean;cargo test -p qq-provider --no-default-features --features test-supportpassed.