docs/.pmngr/specs/GIT-SP-0001-the-rev-write-protocol.md
### GIT-SP-0001.R2 — Refuse a write based on a stale rev
WHEN a conditional write quotes a `rev` that differs from
the `rev` of the file on disk, the store SHALL refuse the
write with `stale_revision`, carrying the current `rev`,
and leave the file unchanged.
#### Scenario: two agents claim one story
- GIVEN two agents read `GIT-US-0042` at the same `rev`
- WHEN the first agent's `update_item` lands
- THEN the second write is refused with `stale_revision`
internal/vault/store.go
// Implements: GIT-SP-0001.R2
func (s *Store) WriteIf(rev Rev, b []byte) error { … }
// Verifies: GIT-SP-0001.R2
func TestStaleRevIsRefused(t *testing.T) { … }
CI · spec-impact
$ gintrack spec impact --since origin/main --fail-on failing,suspect
impact origin/main..worktree: 1 files, 2 symbols, 2 hits
tiers: 1 ok 1; 2 ok 1; 3 unavailable (no Pando semantic search is configured)
GIT-SP-0001.R2 t1 passing "Refuse a write based on a stale rev"
GIT-SP-0001.R3 t2 suspect "Name the fields still in conflict"
gintrack: 1 requirement is in a --fail-on state
$ echo $?
7
contextspec_context returns just the requirements your story touches, inside a token budget.
markPut Implements: on the code and Verifies: on the test.
impactspec_impact ranks every hit: failing first, then suspect, with why.
resolveFix the code, propose a ## Spec Delta, or ask a human.
verifyIngest test results; verify_requirement stamps only what passed.
mergeThe spec changes when the story reaches done — never to make code pass.