Skip to content

trace: support advanced Git index semantics for same-call attribution #3698

Open

Description

@waveywaves

Context

Follow-up to #3625 and PR #3631. This scope was intentionally deferred while narrowing the PR to the normal-index foreground Claude Bash case, following maintainer review.

Scope

Support same-call attribution when Git does not use the repository's normal stage-0 index:

Expected behavior

The pre-call and commit-time snapshots use the index Git is actually committing. Only content newly staged by that Bash call is attributed, and special index states cannot add or omit session attribution incorrectly.

Acceptance criteria

  • A same-call git commit --only <path> receives the correct session trailer.
  • Pre-existing normal-index content is not claimed by a temporary-index commit.
  • Intent-to-add paths do not receive attribution unless committed.
  • Resolving an unmerged path changes the index signature even when stage 0 reuses an existing blob.
  • Indexed blob reads remain exact in repositories with refs/replace/*.
  • Race-enabled lifecycle tests cover the temporary-index commit path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions