Expand description
Pure-function module for parsing structural PR review comments and evaluating whether a PR meets the auto-merge criteria.
This module intentionally has zero dependency on orchestrator runtime state
and performs no I/O. It parses the output of the structural-pr-review
Claude Code skill and applies a deterministic policy.
See cto-executive-system/plans/adf-rate-of-change-design.md §Step 1
(Gitea issue terraphim/adf-fleet#29).
§Expected review comment layout
The skill emits HTML <h3> section headings (not markdown ###) so that
Gitea/GitHub render them consistently. The relevant anchors for this
parser are:
<h3>Summary</h3>— summary paragraphs and optionally acceptance criteria checklist items (- [x]/- [ ]).<h3>Confidence Score: N/5</h3>— integerNin1..=5.<h3>Inline Findings</h3>— finding blocks starting with**P0,**P1, or**P2.- Footer
<sub>Last reviewed commit: <short hash> | Reviews (N)</sub>— the| Reviews (N)suffix is optional for first-round reviews.
Structs§
- Auto
Merge Criteria - Thresholds that must be satisfied for a PR to be auto-merged.
- PrMetadata
- Minimum PR metadata required by
evaluate. - Review
Verdict - Parsed review verdict extracted from a single review comment body.
Enums§
- Auto
Merge Decision - Auto-merge decision produced by
evaluate. - Verdict
Parse Error - Errors raised when a review comment body does not conform to the
structural-pr-reviewtemplate.
Functions§
- author_
is_ agent - Return
truewhenloginbelongs to an automation account authorised to open auto-merge-eligible PRs. - evaluate
- Evaluate whether a PR clears every auto-merge gate.
- parse_
verdict - Parse a review comment body emitted by the
structural-pr-reviewskill.