Skip to content

Release v0.13.4

Bug Fix - Atomic Commit Staging Safety + Split Prompt Hardening

Fixes a class of bugs in --split mode where files outside the staging area could be silently committed. Adds three layers of protection: LLM response validation, git pathspec literal enforcement, and subprocess working-directory correctness.

Fixed

Split Commit Staging Safety

  • parse_split_response now validates both directions: LLM-returned file paths must be a subset of the staging area. Previously only the inverse was checked, allowing hallucinated or extra files to be staged and committed via git add
  • stage_files now sets GIT_LITERAL_PATHSPECS=1, preventing git from interpreting bracket characters (e.g. [locale]) as pathspec glob patterns that could match unintended files
  • unstage_all and stage_files now call current_dir(workdir) on subprocess commands, ensuring they operate on the correct repository regardless of the process working directory
  • get_staged_files now force-reloads the git index from disk (index.read(true)), so state is accurate after external git process modifications (e.g. git reset HEAD)

Split Commit Prompt

  • Strengthened no-duplicate constraint: now marked as CRITICAL CONSTRAINTS with explicit STRICTLY FORBIDDEN wording to reduce LLM violations
  • Added a complete file list section at the top of the user message, giving the LLM a global view of the partition before seeing individual diffs

Tests

  • 3 new unit tests for parse_split_response extra-file validation
  • 3 new unit tests for stage_files glob-path behavior and unstage_all + stage_files round-trip

Upgrade

bash
# Homebrew
brew upgrade gcop-rs

# Cargo
cargo install gcop-rs

# pip
pip install --upgrade gcop-rs