|
| 1 | +# Agent Authorship Attribution |
| 2 | + |
| 3 | +EvalOps uses agent-written code in the same systems that sell audit, approvals, |
| 4 | +and governance. Our own repositories should therefore answer a basic operating |
| 5 | +question: which production changes were written by an agent, under which human's |
| 6 | +direction, and through which approval chain? |
| 7 | + |
| 8 | +This convention makes agent authorship git-native, visible in GitHub, and ready |
| 9 | +for audit-service indexing. |
| 10 | + |
| 11 | +## Commit Trailers |
| 12 | + |
| 13 | +Every Maestro-authored commit must include these trailers: |
| 14 | + |
| 15 | +```text |
| 16 | +Co-Authored-By: Maestro <maestro@evalops.dev> |
| 17 | +Maestro-Version: <maestro-version> / <model-identifier> |
| 18 | +Maestro-Prompt-Id: <prompt-registry-id> |
| 19 | +Maestro-Approvals-Id: <approvals-service-request-id> |
| 20 | +``` |
| 21 | + |
| 22 | +Use one trailer block per commit. If a human materially edits agent output before |
| 23 | +commit, keep the human as the git author and keep the Maestro trailers so the |
| 24 | +chain remains visible. |
| 25 | + |
| 26 | +### Field Rules |
| 27 | + |
| 28 | +| Trailer | Required | Purpose | |
| 29 | +|---|---:|---| |
| 30 | +| `Co-Authored-By` | Yes | Lets GitHub render Maestro as a co-author and gives git-native provenance. | |
| 31 | +| `Maestro-Version` | Yes | Records the Maestro build and model identifier used for the change. | |
| 32 | +| `Maestro-Prompt-Id` | Yes | Links the commit to the prompt registry entry that shaped the work. | |
| 33 | +| `Maestro-Approvals-Id` | Yes | Links the commit to the approvals request that authorized the change. | |
| 34 | + |
| 35 | +If an identifier is not available, do not invent one. Use the best durable |
| 36 | +identifier the producing system has and file a follow-up against that system. |
| 37 | + |
| 38 | +## Pull Request Labels |
| 39 | + |
| 40 | +The reusable workflow in this repository applies exactly one authorship label to |
| 41 | +each PR: |
| 42 | + |
| 43 | +| Label | Meaning | |
| 44 | +|---|---| |
| 45 | +| `agent-authored` | Every commit in the PR carries Maestro authorship metadata. | |
| 46 | +| `human-authored` | No commit in the PR carries Maestro authorship metadata. | |
| 47 | +| `mixed-authorship` | Some commits carry Maestro metadata and some do not. | |
| 48 | + |
| 49 | +The labels are a GitHub UI affordance. The commit trailers remain the source of |
| 50 | +truth because they travel with the git history. |
| 51 | + |
| 52 | +## Reusable Workflow |
| 53 | + |
| 54 | +Adopt the org workflow from the GitHub Actions template picker, or add this file |
| 55 | +to a repository as `.github/workflows/agent-authorship-labels.yml`: |
| 56 | + |
| 57 | +```yaml |
| 58 | +name: Agent authorship labels |
| 59 | + |
| 60 | +on: |
| 61 | + pull_request_target: |
| 62 | + types: [opened, synchronize, reopened, ready_for_review, edited] |
| 63 | + |
| 64 | +permissions: |
| 65 | + contents: read |
| 66 | + pull-requests: read |
| 67 | + issues: write |
| 68 | + |
| 69 | +jobs: |
| 70 | + label: |
| 71 | + uses: evalops/.github/.github/workflows/agent-authorship-label.yml@main |
| 72 | +``` |
| 73 | +
|
| 74 | +The workflow creates the three labels if they are missing, removes stale |
| 75 | +authorship labels, and applies the label that matches the current PR commit set. |
| 76 | +
|
| 77 | +## Audit Indexing |
| 78 | +
|
| 79 | +Audit ingestion should parse trailers from every commit merged to protected |
| 80 | +branches and index at least: |
| 81 | +
|
| 82 | +- commit SHA |
| 83 | +- git author and committer |
| 84 | +- `Maestro-Version` |
| 85 | +- `Maestro-Prompt-Id` |
| 86 | +- `Maestro-Approvals-Id` |
| 87 | +- merged PR number and repository |
| 88 | + |
| 89 | +The target product query is: |
| 90 | + |
| 91 | +```text |
| 92 | +For this production line, show the commit, Maestro version, prompt, approvals |
| 93 | +request, human author, and merge PR that produced it. |
| 94 | +``` |
| 95 | + |
| 96 | +## Backfill |
| 97 | + |
| 98 | +Do not rewrite old commit history to add trailers. For pre-convention PRs, use |
| 99 | +best-effort labels only when evidence is clear. If evidence is heuristic, prefer |
| 100 | +a separate `agent-authored-pre-convention` follow-up instead of weakening the |
| 101 | +meaning of the three current labels. |
0 commit comments