You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
workspace: join commits to work by patch-id when a trailer is gone #3036
A commit joins to its work through trailers (commitJoins in packages/core/src/workspace/intent-joins.ts). A rebase or cherry-pick keeps the trailers when the tool keeps the message, but people also rewrite messages, drop trailers by hand, or carry a change across branches with tooling that rewrites it. The commit then has a new SHA and no trailer, and the intent walk reports it as unexplained, even though the change is the same one a unit or an agent run made.
git already has an identity that survives this: git patch-id --stable gives the same id to the same diff whatever its parent.
graph --intent and graph --intent --record fall back to patch-id matching when a commit in the window carries no trailer. A commit whose patch-id matches a recorded one joins to that unit or run, marked as "joined by content", so a reader can tell it from a trailer join.
A patch-id join never overrides a trailer join, and conflicting joins become a finding.
Acceptance
Recorded commits carry patchId (the git patch-id --stable value) beside their sha.
After a rebase or cherry-pick that drops the trailer, graph --intent still joins the commit to its unit or run, marked joinedBy: "patch-id".
The fallback lives in the run join that graph --intent, graph --intent --record and runs all share. A commit with no Chant-Run trailer that no run's end lists joins every run whose end recorded a commit with the same git patch-id --stable. The join order is trailer, then record, then patch-id, and the patch-id join is tried only when the first two give nothing.
Readers see it as joinedBy: ["patch-id"] on the made-by edge, on the intent-record runs entry and on the runs --json commit, each with recordedAs, the recorded commit it rewrites. The why block's spans and runs gain a joinedBy field, so hud can mark content joins without a new narrowedBy value; hud's reader rejects unknown narrowedBy values. A run's recorded hunks don't narrow a content join, because the rewritten commit's line numbers may have moved, and runs --json gives such a commit hunks: null.
A commit claimed by one run's trailer or record whose content matches a commit another run recorded keeps its join, and graph --intent reports the new finding intent-commit-join-conflict. runs --json reads patch-ids only for commits made since the earliest run with a recorded patch-id started, less a day for clock skew, in one git log -p | git patch-id pass. The unit's result side of the proposal isn't built, per the status comment above: run records already store the patch-ids.
Activity
lex00 commentedon Oct 3, 2026
Status: run records (#3033) already store each commit's patch-id, so the remaining work here is the fallback join on it in graph --intent and runs.
lex00 commentedon Oct 4, 2026
Design as built in #3425.
The fallback lives in the run join that graph --intent, graph --intent --record and runs all share. A commit with no Chant-Run trailer that no run's end lists joins every run whose end recorded a commit with the same
git patch-id --stable. The join order is trailer, then record, then patch-id, and the patch-id join is tried only when the first two give nothing.Readers see it as
joinedBy: ["patch-id"]on the made-by edge, on the intent-record runs entry and on the runs --json commit, each withrecordedAs, the recorded commit it rewrites. The why block's spans and runs gain ajoinedByfield, so hud can mark content joins without a newnarrowedByvalue; hud's reader rejects unknownnarrowedByvalues. A run's recorded hunks don't narrow a content join, because the rewritten commit's line numbers may have moved, and runs --json gives such a commithunks: null.A commit claimed by one run's trailer or record whose content matches a commit another run recorded keeps its join, and graph --intent reports the new finding
intent-commit-join-conflict. runs --json reads patch-ids only for commits made since the earliest run with a recorded patch-id started, less a day for clock skew, in onegit log -p | git patch-idpass. The unit'sresultside of the proposal isn't built, per the status comment above: run records already store the patch-ids.