Skip to content

feat(review): delivery escalation for generated E2E tests — commit / follow-up-PR modes #4197

Description

@JSONbored

Part of #4189. Depends on #4195. See also #4201 (contributor-scoring exclusion — required before this ships, not optional).

Revised 2026-07-08: this is now the primary v1 delivery mode, not a v2 escalation over comment-only suggestion. Maintainers specifically want "generate full E2E test code at the click of a button, added as a new commit to the PR, before it merges" — that's this issue's commit mode, invoked only via #4195's maintainer-only command. The comment-only rendering path (#4193/#4194) still matters as a confirmation/summary layer (what was generated, a link to the commit), not as the primary content-delivery mechanism. pr mode (a separate follow-up PR) remains a genuine v2+ option but is no longer the focus of this issue.

Context

gittensory already has a working example of exactly the write path this needs: openRepoDocPullRequest (src/github/repo-doc-pr.ts:140) builds a tree/commit/branch using the raw Git Data API (POST git/trees at repo-doc-pr.ts:98,102, POST git/commits at repo-doc-pr.ts:220, POST git/refs at repo-doc-pr.ts:223). This issue needs the "commit onto the existing PR's own head branch" variant — a ref-update against the PR's head.ref, not a new branch/ref-create.

This is a deliberate, narrow exception to #1972's no-cloud-write boundary (see the epic's Context) — safe specifically because: (1) only a genuine maintainer/owner can trigger it (#4195's ["maintainer"]-only authorization, never collaborator/pr_author/confirmed_miner), (2) the commit is clearly attributed (a commit trailer + PR comment marker identifying it as maintainer-invoked/machine-generated), and (3) the contributor's Gittensor score must not be inflated by it (#4201).

Requirements

Deliverables

  • commit mode implemented and tested against a fixture PR branch, including the provenance trailer.
  • Confirmation-comment posting after a successful commit.
  • pr mode implemented as the secondary path, with a documented decision on the contributor-PR-cap interaction.
  • delivery config resolved, defaulting to no silent behavior change for repos that haven't opted in.

Expected outcome

A maintainer can comment @gittensory generate-tests on any PR and get a real commit, pushed directly onto that PR's branch, containing AI-generated Playwright tests — clearly attributed, gated to maintainer-only, and excluded from the contributor's own scored contribution.

Resources / examples

  • src/github/repo-doc-pr.ts (full file — openRepoDocPullRequest, the git/trees → git/commits → git/refs pattern)
  • src/settings/global-contributor-cap.ts (the contributor open-PR-cap mechanism to reconcile with, for pr mode)
  • CodeRabbit's own two delivery modes, for reference: same-PR commit vs. separate follow-up PR

Effort

L — real write access to a PR branch is a bigger surface than anything else in the epic short of #4198; budget for careful authorization, provenance, and scoring-interaction review.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.orbGittensory Orb related - maintainer self-hosting analytics.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions