b503f7d86b
- Added `review_pr` task that checks out PR head in a detached worktree, classifies rank/type/area, and posts a batched GitHub review as `event=COMMENT`. - Added four new host tools: `fetch_pr`, `classify_pr`, `pr_review_comment`, and `submit_pr_review`; review tools self-gate on `review_mode`, push/open-PR tools refuse when `review_mode` is set. - Added sqlite staging table `pr_review_comments` with `stage_review_comment`, `list_staged_review_comments`, and `clear_staged_review_comments` DAOs. - Routed `pull_request.opened/reopened/ready_for_review` to `review_pr` and extended `pull_request.closed` cleanup to any tracked PR regardless of author.
101 lines
6.4 KiB
TOML
101 lines
6.4 KiB
TOML
[fetch_pr]
|
|
description = "Fetch the inbound PR premise and changed-file list for review. Review-mode only."
|
|
|
|
[classify_pr]
|
|
description = "Classify and rank an incoming PR, apply triaged/review labels, and persist the rank. Review-mode only."
|
|
|
|
[classify_pr.parameters]
|
|
rank = "Required review verdict label: one of `review:p0..p3`."
|
|
type = "Exactly one PR type: feat, fix, docs, refactor, perf, test, chore, ci, or build."
|
|
area = "Zero or more functional labels. Unknown values are dropped silently; omit when none apply."
|
|
provider = "Only when provider-scoped; format `provider:<name>`. Omit otherwise."
|
|
rationale = "One sentence explaining what the PR changes and why it earns this rank."
|
|
|
|
[pr_review_comment]
|
|
description = "Stage one inline PR review comment in sqlite. Does not call GitHub until submit_pr_review. Review-mode only."
|
|
|
|
[pr_review_comment.parameters]
|
|
path = "Changed file path to comment on."
|
|
line = "Line number in the PR diff."
|
|
body = "Markdown body for one concrete finding."
|
|
side = "`RIGHT` for added/changed lines, `LEFT` for removed lines. Defaults to `RIGHT`."
|
|
start_line = "Optional first line for a multi-line comment range."
|
|
start_side = "Optional side for start_line; `RIGHT` or `LEFT`."
|
|
|
|
[submit_pr_review]
|
|
description = "Submit one GitHub PR review with all staged inline comments. Always posts event=`COMMENT`; never approves or requests changes. Review-mode only."
|
|
|
|
[submit_pr_review.parameters]
|
|
body = "Markdown review summary. Required even when there are no inline comments."
|
|
event = "Ignored except for schema compatibility; the orchestrator always sends `COMMENT`."
|
|
|
|
[gh_post_comment]
|
|
description = "Post a comment on the inbound thread (PR for PR conversations/reviews, originating issue otherwise). Pass `number` ONLY to post elsewhere."
|
|
|
|
[gh_post_comment.parameters]
|
|
body = "Markdown comment body."
|
|
number = "Optional issue/PR override. Defaults to the inbound thread."
|
|
|
|
[gh_push_branch]
|
|
description = "Push the workspace branch to origin. Pre-publish gate (when the repo defines them): `bun run fix` → auto-commit any formatter diff as `style: bun run fix` → `bun check`. On `bun check` failure, fix the cause and retry. Pre-existing breakage on `main` against the same paths NOT caused by your diff → retry with `skip_checks=true` and document the bypass in the follow-up comment. Dirty-tree gate runs unconditionally."
|
|
|
|
[gh_push_branch.parameters]
|
|
branch = "Optional branch override; defaults to the workspace branch."
|
|
skip_checks = "Bypass `bun run fix` + `bun check`. Use ONLY after verifying (e.g. `git diff origin/<default>..HEAD` against the failing paths) the failure exists on `main` and is NOT caused by your diff. Dirty-tree gate still runs — commit everything first."
|
|
|
|
[gh_open_pr]
|
|
description = "Open a PR from the workspace branch using the four-section body template. Same pre-publish gate as `gh_push_branch`: `bun run fix` → auto-commit formatter diff as `style: bun run fix` → `bun check`. On failure, fix and retry. Pre-existing `main` breakage NOT caused by your diff → `skip_checks=true` and document the bypass in the PR's `## Verification` section."
|
|
|
|
[gh_open_pr.parameters]
|
|
body = "Markdown body. MUST contain the four template sections in order: `## Repro`, `## Cause`, `## Fix`, `## Verification`."
|
|
base = "Optional base branch override (default: repo default)."
|
|
skip_checks = "Bypass `bun run fix` + `bun check`. Use ONLY after verifying the failure exists on `main` and is NOT caused by your diff. When set, document in `## Verification` (e.g. ``Skipped pre-publish gate: `bun check` fails on `main` due to <link>``). Dirty-tree gate still runs."
|
|
|
|
[gh_request_review]
|
|
description = "Request reviewers and/or add assignees on the open PR."
|
|
|
|
[repro_record]
|
|
description = "Persist a reproduction transcript (command, output, exit code) for the issue."
|
|
|
|
[repro_record.parameters]
|
|
reproduced = "True when the recorded run demonstrates the bug."
|
|
|
|
[mark_unable_to_reproduce]
|
|
description = "Close the loop without a PR: comment with diagnosis + info request, mark issue abandoned."
|
|
|
|
[abort_task]
|
|
description = "Irrecoverably abandon this task WITHOUT posting any visible message. Use ONLY for orchestrator/environment defects you cannot work around (broken filesystem permissions, missing system tools, corrupted git metadata, harness bugs). NEVER for normal workflow problems — failed builds, missing repro info, unclear requests use `gh_post_comment` or `mark_unable_to_reproduce` instead. `reason` is audit-only and NEVER shown to the reporter."
|
|
|
|
[abort_task.parameters]
|
|
reason = "Internal diagnosis for the operator. Concrete, specific, blameless. NEVER shown to the reporter."
|
|
|
|
[fetch_issue_thread]
|
|
description = "Refetch the originating issue and its comments. Use sparingly."
|
|
|
|
[set_issue_labels]
|
|
description = "Append labels to the originating issue/PR. NEVER removes existing labels."
|
|
|
|
[set_issue_labels.parameters]
|
|
number = "Optional override; defaults to the originating issue."
|
|
|
|
[classify_issue]
|
|
description = "First triage step. Classify the issue, apply labels on GitHub, pick the workflow branch (bug → repro+fix+PR, question → reply only, etc.). MUST be called before any other `gh_*` action on a new issue."
|
|
|
|
[classify_issue.parameters]
|
|
primary = "Exactly one primary classification."
|
|
priority = "REQUIRED when `primary=='bug'`; one of `prio:p0..p3`. Omit the field for any other primary — orchestrator silently drops stray values."
|
|
functional = "Zero or more functional labels. Unknown values dropped silently; omit the field when none apply."
|
|
provider = "Only when provider-scoped; format `provider:<name>`. Omit otherwise."
|
|
platform = "Only when platform materially affects reproduction; one of `platform:linux|macos|windows|wsl`. Omit otherwise."
|
|
rationale = "One sentence explaining the classification."
|
|
branch_slug = "Kebab-case slug, 1-50 chars `[a-z0-9-]`, no leading/trailing/double hyphen. Replaces the auto-generated slug in the working branch name. Provide for `bug`/`documentation`. Omit for non-PR workflows (`question`, `enhancement`, `proposal`, `invalid`, `duplicate`)."
|
|
|
|
[classify_issue.next_steps]
|
|
bug = "reproduce → diagnose → fix → PR"
|
|
documentation = "fix the docs and open a PR using the four-section template"
|
|
question = "answer in a single gh_post_comment; no PR, no repro"
|
|
enhancement = "post one thoughtful gh_post_comment on feasibility/scope; no PR"
|
|
proposal = "post one thoughtful gh_post_comment on feasibility/scope; no PR"
|
|
invalid = "post one explanatory gh_post_comment; no further action"
|
|
duplicate = "post one explanatory gh_post_comment; no further action"
|