- Git C-style quoting octal-escapes raw UTF-8 bytes; decoding each escape
with String.fromCharCode produced mojibake, so attribution lookups missed
quoted non-ASCII paths and their sections were never filtered (macroscope,
bugbot). stripGitPathQuoting now decodes into a byte buffer and UTF-8
decodes the result.
- gitFileCount counted every git-attributed path in the attribution map,
overstating hidden files when a path had no section in the patch (e.g.
whitespace-only changes elided by ignoreWhitespace) and double-counting
renames from the --no-renames map (macroscope, bugbot). It now counts
git-attributed sections actually present in the patch, so the banner
matches what the toggle can reveal.
Co-Authored-By: Claude Fable 5 <[email protected]>
- patch-id --stable strips whitespace, so a whitespace-only amend collided
with its pre-amend reflog original and was demoted as a replay — hiding
agent work (macroscope, bugbot, codex). Switched to --verbatim and added
an integration test amending a whitespace-only change.
- Binary and mode-only sections have no ---/+++ lines, so they always
survived filtering even when git-attributed (codex). resolveDiffSectionPath
now falls back to rename/copy metadata and then the `diff --git` header
(with C-style quoted-path decoding); genuinely ambiguous headers are still
kept. Tests for binary, mode-only, quoted, spaced, rename-only, and
ambiguous sections.
- The diff panel banner was driven by the turn summary's origin tags while
the patch was filtered by an independent attribution pass, so the two
could disagree after partial failures (codex). getTurnDiff and
getFullThreadDiff now return gitFileCount from the same pass that filtered
the patch, and the banner uses that.
Codex also flagged attribution cost (re-running per diff-query variant);
deferred — all calls are plumbing on OIDs, the fast path covers turns
without HEAD movement, and caching by checkpoint pair can come later if
real-world latency shows up.
Co-Authored-By: Claude Fable 5 <[email protected]>
- resolveDiffSectionPath scanned line-by-line and returned the `--- a/`
source path before ever seeing `+++ b/`, so rename sections resolved to
the pre-image path and could be mis-filtered (macroscope, bugbot). Now
resolves the post-image path in a full pass with the source as fallback,
plus a rename filtering test.
- `commit --amend` of a pre-turn commit preserved the old author date, so
amended agent content was misattributed to history and hidden — the one
invariant violation both bots flagged. Commits authored before the turn
but committed during it are now disambiguated by patch-id: an identical
patch elsewhere in the repo (branches/remotes/reflog — reflog catches
pre-rebase originals) means replayed pre-existing content (demote);
otherwise it's an amend (show). Integration test included.
- Per-commit diff-tree now passes --root so agent-authored root commits on
orphan branches contribute their paths (macroscope).
- includeGitChanges is scoped to the diff panel selection key so revealing
git changes on one turn no longer leaks into other turns/threads
(macroscope).
- Git-only turns render a compact card with just the "Updated via git" row
instead of a "0 changed files" header with dead controls (macroscope).
Co-Authored-By: Claude Fable 5 <[email protected]>
The changed-files card and per-turn inline diff are derived from full-tree
checkpoint snapshots, so any tree-rewriting git command the agent runs
(pull, checkout, cherry-pick, rebase) shows up as hundreds of "changed
files" the agent never authored.
This adds a read-side attribution layer on top of the existing checkpoint
mechanism (capture, storage, and revert are untouched):
- Checkpoint commits now record the HEAD oid and branch in their commit
message. Legacy checkpoints without metadata degrade to today's behavior.
- attributeCheckpointDiff classifies each path in a checkpoint tree delta:
a path is "git" only when its exact blob transition also appears in the
HEAD-movement delta for the turn and no commit authored during the turn
touched it. Every ambiguity resolves to "agent" (shown), so
misclassification can add noise but never hide agent work. Merge commits
use the combined diff so only conflict resolutions count as agent work.
- The checkpoint reactor tags each file with an origin; attribution
failures degrade to unattributed files and never block the pipeline.
- getTurnDiff/getFullThreadDiff drop git-attributed file sections from the
patch unless the new includeGitChanges input is set.
- The changed-files card lists agent files only, with a muted
"Updated via git — N files" row for demoted changes. The diff panel
shows a banner with a show/hide toggle so the full tree delta stays one
click away.
Co-Authored-By: Claude Fable 5 <[email protected]>