Skip to content

fix(repo): close the small P28 review follow-ons - #203

Merged
tonibergholm-codento merged 3 commits into
mainfrom
p28-followons
Oct 19, 2026
Merged

tonibergholm-codento merged 3 commits into
mainfrom
p28-followons

Conversation

@tonibergholm

@tonibergholm tonibergholm commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Four small non-blocking items from the P28 security-sweep final review, still on the Deferred list:

  • refs::write_head and refs::delete_branch now run validate_branch_name like every other ref write (delete_branch joins its argument onto the refs directory, so a crafted name must never reach outside it).
  • SC_PACK_CHUNK is clamped to MAX_OBJECT_SIZE: a larger value made every transfer fail with a confusing receiver-side error (a frame above the length cap). The decision is a pure chunk_from so it is testable without touching the environment.
  • Repo::worktree_paths (used by the sc protect nudge) no longer reads every file's bytes: worktree::list_worktree_paths is the same walk with the same .scignore and tracked-path rules, minus the read.
  • The /-boundary prefix rule was written twice (protect::matching_prefix and run_protect's nudge); it is now one protect::path_under_prefix.

Verification

New tests: write_head_and_delete_branch_validate_the_branch_name, chunk_from_defaults_and_clamps_to_the_object_cap, list_worktree_paths_matches_read_worktree (same list as read_worktree, ignore rules and the tracked-under-ignored exemption), path_under_prefix_matches_at_a_boundary_only. cargo fmt, cargo clippy --workspace --all-targets -D warnings, cargo test --workspace pass. ROADMAP entry marked shipped.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Protection rules now match complete path boundaries, avoiding unintended matches with similarly named sibling paths.
    • Invalid branch names are rejected before branch or HEAD updates.
  • Improvements
    • Worktree path listings now follow the same ignore and tracking rules as worktree reads.
    • Pack chunk settings use a safe default when invalid and are capped at the maximum supported object size.

refs::write_head and delete_branch now validate the branch name; SC_PACK_CHUNK
is clamped to MAX_OBJECT_SIZE instead of producing frames every receiver
refuses; Repo::worktree_paths is a paths-only walk (list_worktree_paths) rather
than reading every file; and the /-boundary prefix rule is one shared
protect::path_under_prefix used by rule lookup and the sc protect nudge.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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-10-19T13:36:37.476315Z 6eb752c New commits
🔒 Security Review ✅ Completed 2026-10-19T13:36:23.790278Z 6eb752c 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.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5c68b8e2-ff1b-4530-a2b3-3e9aec0b4334
📥 Commits

Reviewing files that changed from the base of the PR and between 981e6d0 and 18108d9.

📒 Files selected for processing: 7
  • ROADMAP.md
  • crates/cli/src/main.rs
  • crates/repo/src/protect.rs
  • crates/repo/src/refs.rs
  • crates/repo/src/repo.rs
  • crates/repo/src/wire.rs
  • crates/repo/src/worktree.rs
+--------------------------------------------------+
| Deploying the charm offensive against your bugs. |
+--------------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@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: 18108d9244

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

Comment thread crates/repo/src/wire.rs Resolved
tonibergholm and others added 2 commits October 19, 2026 16:32
Codex: a chunk frame is the ST_PACK_CHUNK tag byte plus the data, so data at
MAX_OBJECT_SIZE made a frame one byte over what the receiver accepts.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

@tonibergholm-codento tonibergholm-codento left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Required checks green on 6eb752c; Codex finding fixed and resolved.

@tonibergholm-codento
tonibergholm-codento merged commit 3df290c into main Oct 19, 2026
7 checks passed
@tonibergholm
tonibergholm deleted the p28-followons branch October 19, 2026 13:42
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