feat(pr-review): operator/chat trigger queues a pr-review task

review_pr self-omitted since 7299b923 deleted the synchronous reviewer it
called. It is rebuilt on the task enqueue path everything else uses: the
tool resolves the identity's configured repo, then queues a pr-review task
naming the pull request through the workflow's declared pr_number input,
which is the same generic input mechanism a watched-repos binding uses.

That input has to reach the store with the task, so
EnqueueChatTaskRequest gains inputs_json and the tasks insert writes the
inputs column directly. StampTaskBinding no longer writes it: the insert is
now the column's only writer, and a chat task must not acquire binding
provenance just to carry an input.

ChatPRReviewer, its result shape and the reviewer wiring are deleted with
the path they served.
This commit is contained in:
sam committed 2026-09-28 18:24:36 +10:00
1 parent a6627954bd
commit 5c91575166
39 files changed
+227 -192

No files matched your search

@@ -42,7 +42,10 @@ SELECT status, count(*)::int AS count FROM tasks GROUP BY status;
-- issue numbers; this allocator is the single source of truth for it.
-- fallback_issue_number is only the seed for a repo's first chat task -- the
-- passed value is not the issue number that lands.
INSERT INTO tasks (owner, repo, issue_number, title, body, labels, workflow, source, identity, org_id)
-- inputs is the chat task's own workflow inputs; a binding dispatch passes
-- its inputs here too, so this insert is the single writer of the column and
-- StampTaskBinding adds only the provenance.
INSERT INTO tasks (owner, repo, issue_number, title, body, labels, workflow, source, identity, org_id, inputs)
VALUES (
sqlc.arg(owner), sqlc.arg(repo),
COALESCE((
@@ -57,12 +60,13 @@ VALUES (
(SELECT m.org_id FROM memberships m WHERE m.identity_id = sqlc.arg(identity)
ORDER BY m.created_at, m.org_id, m.workspace_id NULLS LAST LIMIT 1),
'default'
)
),
sqlc.arg(inputs)
)
RETURNING *;
-- name: StampTaskBinding :exec
UPDATE tasks SET binding_id = $2, binding_version = $3, inputs = $4 WHERE id = $1;
UPDATE tasks SET binding_id = $2, binding_version = $3 WHERE id = $1;
-- name: UpdateTask :exec
UPDATE tasks SET workflow = $2, branch = $3, plan = $4, notes = $5,