Skip to content

feat(github): Credit all run actors as Co-Authored-By on commits - #789

Merged
dcramer merged 2 commits into
mainfrom
feat/commit-coauthor-run-actors
Jul 8, 2026
Merged

dcramer merged 2 commits into
mainfrom
feat/commit-coauthor-run-actors

Conversation

@dcramer

@dcramer dcramer commented Jul 8, 2026

Copy link
Copy Markdown
Member

Commits made through the GitHub plugin now carry a Co-Authored-By trailer for every actor who contributed instructions to the run, not just the run actor. When Alice asks for a change and Bob steers mid-run, the resulting commit credits both, followed by Junior's agent trailer.

The run loop maintains a live projection of committed instruction provenance — seeded from the resumed session record's provenance (or the fresh turn's instruction provenance, mirroring what the turn session record commits) and extended as steering messages drain — and exposes it to plugins as a new optional actors field on BeforeToolExecuteHookContext, derived via the existing instructionActors projection from specs/multi-actor-runs.md. The GitHub plugin composes trailers from it and injects them as JUNIOR_GIT_ACTOR_COAUTHOR_TRAILERS; the sandbox prepare-commit-msg hook appends all missing trailers as one contiguous block so git and GitHub parse every co-author (blank-line-separated trailers are only recognized in the final paragraph).

Resolutions for the issue's open questions, now recorded in specs/security-policy.md:

  • An actor without a resolvable name and email is omitted from the trailers rather than blocking the commit — no placeholder or derived emails. Only the run-actor author check stays fail-closed as before.
  • The run actor is excluded (already the git author, compared by identity ids so display-profile variants don't slip through), and trailers dedupe by resolved email case-insensitively, including against the author and bot emails.
  • run.actors is attribution only: it selects trailer text and never influences which credentials commit or push.

Review order: packages/junior-github/src/index.ts (trailer composition and the reworked hook script), then the runtime threading (agent/index.ts → agent/tools.ts → plugins/agent-hooks.ts → junior-plugin-api), then the specs. The new integration test proves the actors getter grows as steering drains through a real executeAgentRun; the hook script's block placement and idempotency are exercised by executing the generated bash against real message files.

Fixes #777

🤖 Generated with Claude Code

When a run has multiple instruction actors (one user asks, another steers
mid-run), commits made through the GitHub plugin previously credited only
the run actor (git author) and Junior's agent trailer. Thread run.actors
into the beforeToolExecute plugin hook as a live projection of committed
instruction provenance, and have the GitHub plugin compose a Co-Authored-By
trailer for each additional actor.

Attribution is fail-closed and attribution-only: actors without a
resolvable name and email are omitted rather than blocking the commit,
trailers dedupe by identity ids and resolved email (excluding the git
author and bot identities), and run.actors never influences which
credentials commit or push. The prepare-commit-msg hook now appends all
missing trailers as one contiguous block so git and GitHub parse every
co-author, with Junior's agent trailer last.

Fixes GH-777
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Co-Authored-By: Claude Fable 5 <[email protected]>
@vercel

vercel Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jul 8, 2026 8:15pm

Request Review

Comment thread packages/junior-github/src/index.ts Resolved
Comment thread packages/junior-github/src/index.ts Resolved
Comment thread packages/junior-github/src/index.ts Resolved

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a7864a7. Configure here.

Comment thread packages/junior/src/chat/agent/index.ts Resolved
Overwrite actor coauthor trailer env on every commit command so model-supplied values cannot survive when no run actors resolve to trailers.

When an existing commit message already ends with Junior's bot trailer, insert missing actor trailers before that bot trailer so the agent coauthor remains last.

Co-Authored-By: GPT-5 Codex <[email protected]>
@dcramer
dcramer force-pushed the feat/commit-coauthor-run-actors branch from e4b0985 to 4850f7e Compare July 8, 2026 20:14
@dcramer
dcramer merged commit 9d55451 into main Jul 8, 2026
19 checks passed
@dcramer
dcramer deleted the feat/commit-coauthor-run-actors branch July 8, 2026 20:27
dcramer added a commit that referenced this pull request Jul 9, 2026
Resolve the agent/index.ts import conflict: the run-actor credit change
(#789) imports instructionActors/instructionProvenanceFor, which stay in
state/session-log on this branch, while the runtime recorders moved to
conversations/projection in the SQL cutover.

Co-Authored-By: Claude Fable 5 <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 4850f7e2 Deployed Jul 8, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

github: credit all run actors as Co-Authored-By on commits

1 participant