Repository navigation
fix: a lease commit spammed the pull request's timeline - #20
Conversation
`holder` is `<owner>/<repo>#<pr>#<run>-<attempt>`, and `<owner>/<repo>#<pr>`
is exactly GitHub's cross-repository issue reference syntax. It went into the
lease commit message verbatim, so every borrow and every return posted a
"referenced this in code-review-credentials" event onto the reviewed pull
request's own timeline.
Two events per review, on every review, for the life of the branch. Measured
2026-09-22 on MarketData-App/api#463: twelve lease commits, twelve timeline
events, timestamps matching to the second. That pull request's timeline holds
more lease references than commits, comments and labels combined.
`lease_message` now spells the same three facts without the `#`:
lease taken by MarketData-App/api pull 463 run 35743856939-1
The HOLDER is untouched. `release` compares it to decide whether this run
still owns the lease, and that identity is the whole reason it carries the
run id and attempt; rewriting it would reopen the race it was added to close.
Only the human-facing message changes.
`lease_spans` reads both forms and keys a hold on (repo, pr, run) rather than
on the message's spelling, so the months of `#`-joined history already in the
store keep parsing and `lease-report` is unaffected.
This cannot retire the timeline events already posted. GitHub builds a
cross-reference from the commit and offers no way to delete one.
✅ Ready — Code reviewThis change removes GitHub cross-repository references from lease commit messages while preserving the stored holder identity. The history parser supports both old and new message formats and normalizes them to the same lease span identity. Rating patch 5/6 (solid) · proof 6/6 (comprehensive) · overall 5/6 FindingsNit
Since last review
Reviewed |
a1f9e042 from the bot's review of this pull request.
A new-format span took the bare repository token as its `holder`
("MarketData-App/api"), and an open span with no pull request was given a
fabricated "verification#None#". So the field's meaning depended both on
which message wrote the hold and on whether it had been freed.
The holder is now rebuilt once, beside the pairing key, and carried through
the open-span map. Old and new formats yield the identical string, an open
hold reads the same as a closed one, and a holder with no pull request stays
"verification" rather than being padded. One test round-trips every shape
through `lease_message` and back.
2f9d3e2b (nit) Not taken, for the third time and the same reason: dated
measurements in docstrings are this repository's house style, present in
credentials.py, github.py, claude.py and cli.py.
|
The holder is now rebuilt once, beside the pairing key, and carried through the open-span map, so both branches append the same string. Old and new formats yield an identical holder, an open hold reads the same as a closed one, and a holder with no pull request stays
This is the third review running to raise it. If the rule is wanted, it belongs in |
Reported from a phone screenshot of
MarketData-App/api#463: the timeline is full ofmarketdata-code-review[bot] referenced this in MarketData-App/code-review-credentials, each showing alease taken by MarketData…/lease freed by MarketData…commit.Cause
holderis<owner>/<repo>#<pr>#<run>-<attempt>, and<owner>/<repo>#<pr>is exactly GitHub's cross-repository issue reference syntax. It went into the lease commit message verbatim, so every write tocodex/lease.jsonposted a cross-reference onto the reviewed pull request.Two events per review, on every review, for the life of the branch.
Measured on
api#463— twelve lease commits, twelve timeline events, matching to the second:2026-09-22T14:25:26Z14:25:25lease taken by MarketData-App/api#463#35740179424-12026-09-22T14:26:06Z14:26:05lease freed by MarketData-App/api#463#35740179424-1Its timeline holds 12
referencedevents against 2committed, 2commentedand 3labeled.Fix
lease_messagespells the same three facts without the#:The holder is untouched.
releasecompares it to decide whether this run still owns the lease, and that identity is why it carries the run id and attempt — rewriting it would reopen the race#<run_id>-<run_attempt>was added to close. Only the human-facing message changes.lease_spansnow reads both forms and keys a hold on(repo, pr, run)rather than on the message's spelling, so the months of#-joined history already in the store keep parsing. Verified against the live store: 237 holds over 7 days, unchanged.What this does not do
It cannot retire the events already posted. GitHub builds a cross-reference from the commit and offers no way to delete one. The existing noise on open pull requests stays; no new noise is added.
Tests
11 new, TDD, each watched failing first.
653 passed, ruff clean. One test round-tripslease_messagethroughlease_spans, so a change to either side without the other fails here rather than in next week's report.