aiworkhub_agent_accept_review
Accept a review-ready request by revalidating gates and hashes, then promote the verified changes into the canonical repo. Failures leave the repo untouched and the task in review.
Instructions
COORDINATOR/WRITE-GATED: accept one review_ready request, phase 2.
Re-runs scope, required-output, and validation gates against the
retained isolated worktree, compares every changed path's hash against
the ones recorded when the request first reached review, and only then
promotes into the canonical repo and finalizes the task as done. Any
precondition or revalidation failure leaves the canonical repo untouched
and the task in review. Idempotent: accepting the same already-finished
request again returns already_accepted instead of re-promoting.
Medium-and-higher risk profiles also validate a fresh canonical+candidate
combined tree and require strict reviewer findings; high/critical review
requires an explicit confirm_high_risk decision.
manager_correction -- unset by default, and every other behaviour is
then exactly as before -- accepts the sealed candidate PLUS a manager patch
instead of rejecting it:
{"patch": <unified diff>, "finding_ids": ["reviewer:<lens>:<id>", ...], "reason": str}. It lifts the refinement_required blocker of each
named finding that a selected reviewer reported and
aiworkhub_manager_review_finding_dispose already recorded as
confirmed, provided its severity is not blocking. The patch is
validated before any promotion or state change and refuses with
manager_correction_invalid:<reason> when the manager is unverified, the
patch does not apply to the sealed candidate bytes, a touched path is
outside the card's allowed_writes or not part of the candidate, no
finding is named, or a named finding is unconfirmed or blocking. The
declared validations and the mechanical gate then run on the CORRECTED
bytes, those are the bytes promoted, and the accepted-outcome receipt binds
the patch digest with the candidate and corrected hashes.
An optional "allowed_writes_amendment": [<repo-relative path>, ...]
(NF-2026-02241) lets the patch also touch those exact paths -- e.g. a
neighbour test the accept revalidation showed red. Every amended path must
be touched by the patch and obey the allowed_writes path rules
(allowed_writes_amendment_* refusals otherwise); a path outside the
candidate is patched against its canonical bytes and promoted with it.
After the accept lands the paths are added to the card's allowed_writes,
add-only, and the reply names them under allowed_writes_amendment.
Without the key a path outside allowed_writes is refused as before.
A successful reply is the receipt (aiworkhub.accept_review_receipt.v1):
promoted_paths, reviewer_finalization, acceptance_evidence_record,
accepted_outcome_receipt, needfix_closure, learning_commit_owed, plus the
finalized card's status and card_sha256/card_bytes. include_card =
none (default) | summary | full adds the card view. Errors are unchanged.
lesson_candidate / no_new_lesson_reason -- both unset by default, and
the reply is then exactly as before -- close this decision's learning out in
the same call, AFTER the accept landed. lesson_candidate (with optional
promote_ai_memory and extra_evidence_ids) runs
aiworkhub_manager_learning_commit for this request and returns its reply
under learning_commit; no_new_lesson_reason (one of
learning_commit_store.NO_NEW_LESSON_REASONS) records that disposition and
returns it under learning_disposition. Both together
(learning_inline_conflict), an unknown reason, or promote_ai_memory
without a lesson are refused before anything changes. A failed close-out
never undoes the accept: ok stays true, the failure is reported under
its own key, and learning_commit_owed stays in the reply.
commit (accept_commit) is {state: committed|skipped|failed, sha?, reason?, paths, message_subject}; a skip or failure never undoes the accept.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"request_id": "<request_id>",
"task_id": "<task_id>"
},
"name": "aiworkhub_agent_accept_review"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | Id of the task card that request belongs to. | |
| request_id | Yes | Id of the worker request to accept; it must be in review_ready state. | |
| auto_commit | No | Default true: after a successful accept, git-commit exactly the receipt's promoted_paths (hooks run; never amend, push or --no-verify) and report it under commit; false leaves the commit to you. | |
| include_card | No | none (default), summary or full; adds that view of the finalized card to the reply. | none |
| risk_signals | No | Extra risk signals to add to those derived from the candidate diff; they can only tighten review. | |
| commit_message | No | Commit message to use instead of the generated "<fix|feat>(<topic>): <title>"; the Resolves/AIWorkHub-Task/AIWorkHub-Request and aiworkhub.commitTrailer trailers are still appended. | |
| lesson_candidate | No | Lesson text to commit for this decision in the same call, after the accept lands; omit to commit the lesson separately. | |
| reviewer_reports | No | Optional reviewer report objects; normally omitted because acceptance verifies reviewer receipts by request id (see reviewer_request_ids). | |
| confirm_high_risk | No | Set true to give the explicit human approval that high or critical risk tiers require; default false. | |
| promote_ai_memory | No | Set true together with lesson_candidate to also promote the lesson to AI memory; refused without a lesson. Default false. | |
| extra_evidence_ids | No | Additional evidence ids to cite with the lesson; only used together with lesson_candidate. | |
| manager_correction | No | Accept the sealed candidate plus a manager patch: {"patch": <unified diff>, "finding_ids": ["reviewer:<lens>:<id>", ...], "reason": str, "allowed_writes_amendment": [<exact repo-relative path>, ...] (optional; each must be touched by the patch and is added to the card's allowed_writes once the accept lands)}; omit for a plain accept. | |
| requested_risk_tier | No | Risk tier to review at; omit to use the tier the finalizer measured for this candidate. An explicit value can only raise the tier, never lower it. | |
| no_new_lesson_reason | No | Instead of a lesson, record why none is owed: duplicate_of_recorded_lesson, no_generalizable_cause, mechanical_change_only, evidence_insufficient or decision_not_about_code; refused together with lesson_candidate. | |
| reviewer_request_ids | No | Reviewer request ids to verify; omit to use every verified reviewer bound to this request and task, and pass [] to exclude all reviewers. | |
| confirm_destructive_change | No | Set true to accept a candidate whose diff failed a destructive-change check; otherwise accept is refused with destructive_diff_requires_manager_confirmation. Default false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||