Uh oh!
There was an error while loading. Please reload this page.
docs(agents): note that checkout-from-ref stages the index (#8280) - #8472
Merged
Conversation
`git checkout <ref> -- <path>` writes the index as well as the working tree, so restoring the file with `cp` after a reverse-verification lap leaves the index holding main's content. `git diff HEAD` reads clean and the tests pass off the working tree, while a bare `git commit` builds from the index and lands a commit that deletes the fix the PR claims to make. Verified in a worktree before writing: MM in `git status --porcelain`, clean `git diff HEAD`, 2 deletions in `git diff --cached`, and a bare commit that captured the reversion. Both prescribed restores (`git checkout HEAD -- <path>` and `git restore --source=HEAD --staged --worktree <path>`) clear index and tree together. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WuTtyckQa1VcXwgd52JpN
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
One clause appended to the checkout-from-ref note: `git restore --source=<ref> -- <path>` without `--staged` writes the working tree only, so the foreign copy never reaches the index and the trap cannot arise. Prevention at source beside the existing cure. Measured with the exact prescribed form on this branch (HEAD holds the note, origin/main does not): porcelain ' M AGENTS.md', `git diff --cached` empty (index untouched), and the restore verified by byte-identity of hash-object against the HEAD blob. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018WuTtyckQa1VcXwgd52JpN
hotlong
marked this pull request as ready for review
August 13, 2026 15:33
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#8280
A short note in AGENTS.md's reverse-verification paragraph (Multi-agent working discipline), directly beside the existing
git stashprohibition — the same family: a git operation whose blast radius is wider than it reads.Where it landed
AGENTS.md has no separate "reverse verification" heading. The reverse-verification guidance is the paragraph that closes the stash block ("Doing reverse verification … Commit the fix FIRST"), and its own prescription is
git checkout your-branch -- some/path— precisely the form that stages. The note follows it immediately, so the correction sits on the sentence that needs it.Measured, not quoted
The trap was reproduced in a throwaway probe commit on
lychee.tomlin this worktree before the note was written (probe reset away afterwards; the branch carries the AGENTS.md change only):Both prescribed restores were then verified to clear index and tree, each leaving
git status --porcelainempty:git checkout HEAD -- lychee.tomlandgit restore --source=HEAD --staged --worktree lychee.toml.One correction the measurement forced. The card explains the clean
git diff HEADas "it compares HEAD against the index". It does not —git diff HEADcompares the working tree with HEAD and never consults the index, which is exactly why thecprestore silences it while the index still holds main's content. The note states the mechanism as measured rather than as quoted.Amendment (second commit, per recorded seat ruling)
Per the seat ruling on this report's open question, a second commit appends one clause naming the measured non-staging way in —
git restore --source=REF -- PATHwithout--stagedwrites the working tree only, so the foreign copy never reaches the index and the trap cannot arise; prevention at source, beside the cure that was already there. Re-measured with the exact prescribed form on this branch before writing it (HEAD holds the note,origin/maindoes not):Scope
AGENTS.md only, +17 lines across two commits. The stronger index-vs-worktree commit guard named in the card stays out of scope (gate-farm owner's, not this card's). Governance text → conservative ADR-class treatment: draft PR, human merge — deliberately not marked ready, no auto-merge armed.
Gates
Re-run in the foreground on the amended tree (head
f1c0aeecea):pnpm check:nul-bytes— green (self-test 75 assertions; 7637 text files scanned, no raw control bytes)pnpm check:doc-authoring— green (self-test + 376 files clean)grep -naPover the control ranges) — no hitsnode scripts/pm/dispatch-gates.mjs AGENTS.md— re-derived against the actual diff: "No check family names the given paths in its own source." Adds nothing to the dispatched set.skip-changesetapplied: governance/docs text, releases no package.Generated by Claude Code