feat(hitl): render PR reviews via a dedicated hax template#39
Merged
Conversation
…late
Replace the generic form-builder request with the purpose-built
`pr-af-review-v1` hax template. The gate now sends a structured payload
(PR metadata + a findings list) instead of a flat FormBuilder, and
`clean_intent` strips HTML and truncates the PR body so a Dependabot-style
changelog no longer dumps raw markup into the form.
The template emits the same `{template, values}` response envelope as
form-builder, so the decision parser is unchanged. `create_hax_*` is
generalized to take an arbitrary payload + request_type.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… no findings Thread PR metadata (repo, number, url, author, diff stats) into the review template via `_pr_meta`. When the review produces zero findings and HITL is enabled, skip the human gate entirely and post nothing — no point bugging a reviewer, and an empty auto-approve would be noise on a public repo. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #38. The HITL review approval was rendered with hax's generic
form-builder, which dumped the raw PR body (e.g. a Dependabot HTML changelog) into a plain-text description field — unreadable. This switches the gate to a purpose-builtpr-af-review-v1hax template (added in the hax-sdk repo) and cleans up what we send.What changed (pr-af)
type="pr-af-review-v1"with a structured payload — PR metadata (repo, number, url, author, diff stats) + a findings list (severity, file:line, body, suggestion, dimension) — instead of a flat FormBuilder.clean_intent()strips HTML tags and truncates the PR body, so bot-authored changelogs no longer leak raw markup into the form.{template, values}response envelope, so the decision parser is unchanged.Companion change
Requires the
pr-af-review-v1template in hax-sdk (separate PR). The hax service validates the request payload against the registered template and rejects unknown types, so hax-sdk must deploy before this does.Test plan
ruff check src/ scripts/ tests/— cleanpytest— 21 passed (payload shape, decision parsing unchanged, zero-finding skip, watchdog fast-fail)docker build— passes🤖 Generated with Claude Code