Skip to content
refs

feat(backend): record who pushed each commit and which agent opened a pull request

Aman Kumarcommitted Nov 20, 202603f416fparent 2c71cf3

Each push now records its pusher for every commit it adds. Commit history and pull request changes carry that pusher, so the UI can mark agent commits. A pull request summary names the agent that opened it.

3 decisions

Store the pusher of each commit in a new commit_pushes table, written when a push is indexed.

Why

  • The push queue already lists the commits that each push adds.
  • A lookup by commit is exact, also after a rebase or force push.

Paths considered

  1. Chosen
  2. Match commits to repo.pushed events when a page loads.
  3. match_eventsIt guesses after a rebase and costs a walk of every push on each page load.

Assumes

  • The first push of a commit names its real author for the UI. Later pushes keep it.

Touches

  • 0031_commit_pushes.sql
  • events.ts
  • decisions.ts
  • pull.ts
  • repo.ts
Evidence · 1
  • apps/backend/test/steer.test.ts

Read the agent that opened a pull request from its pull.opened event, not from a new column.

Why

  • The event already stores the actor and the agent session.
  • Existing pull requests get the right value with no backfill.

Touches

  • pulls.ts
  • views.ts
Evidence · 1
  • apps/backend/test/steer.test.ts

Pushes that refs finds by itself record no pusher.

Why

  • refs does not know who made those commits, so it must not name itself as the author.

Touches

  • events.ts
8 files changed · +73 −7
apps/backend/contract/views.ts+2 −0
apps/backend/decisions.ts+3 −1
apps/backend/events.ts+26 −1
apps/backend/handles/pull.ts+3 −2
apps/backend/handles/repo.ts+2 −2
apps/backend/pulls.ts+4 −1
apps/backend/test/steer.test.ts+24 −0
migrations/0031_commit_pushes.sql+9 −0