Repository navigation
fix(review-pr): show inline confidence as a table + harden band/threshold drift - #25
Conversation
The confidence label (`confidence: <band> (<score>/100)`) is written by the review agent, mirroring src/score-confidence, and there is no deterministic step that adds it. When the agent omits the label, nothing puts it back, so inline comments can be posted without a confidence score. Make the requirement explicit in the agent prompt (pr-review.yaml) and the posting-format reference: the label is mandatory, has a fixed format, sits on its own line as the last line of the body immediately before the review marker, and the agent must verify each comment carries it (adding it when missing) before posting.
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟡 NEEDS ATTENTION
The PR correctly identifies the gap (confidence label being agent-emitted free text with no deterministic enforcement) and adds the label as a hard requirement in both the agent prompt and the posting reference. The approach is sound, but the new text introduces three issues worth addressing before merge.
Replace the free-text "confidence: <band> (<score>/100)" label with a two-column markdown table (band dot + score) as the last content block of each inline comment, before the review marker. Harden the prompt against the band/threshold drift seen in review: the band is read off the Step 5 score boundaries (never estimated), and a non-forced finding scoring below 55 is never posted inline. Address the review feedback on this PR: bake the indicator in at authoring time and verify-don't-mutate (no /tmp/review_comments.json splicing); place it as the last content block with a blank line before the marker (no tension with the marker rule); and anchor the pre-post check in numbered step 9.
4689385 to
8dbf4a5
Compare
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
The prompt hardening and confidence-table changes look correct and internally consistent.
What was reviewed: review-pr/agents/pr-review.yaml, review-pr/agents/refs/posting-format.md, review-pr/README.md
Confidence bands added in Step 5 (strong ≥ 80, moderate 55–79, weak 30–54, negligible < 30) exactly mirror the source-of-truth values in src/score-confidence/score-confidence.ts. The MODERATE_THRESHOLD = 55 hard gate is correctly applied in both the posting policy prose and the new verification step.
Table format — the two-column confidence table is consistently specified in both pr-review.yaml and posting-format.md. The <!-- docker-agent-review --> marker placement rule (blank line after the table, then the marker on its own line) is preserved.
Console mode — correctly exempted; keeps its own text label (confidence: BAND SCORE/100).
Drift hardening — the "read it off, never estimate" language directly addresses the root cause (a 43 scoring as moderate). The pre-post verification in numbered step 9 is anchored in the correct structural position.
No bugs introduced by the changes in this PR.
derekmisler
left a comment
There was a problem hiding this comment.
clean PR. the table format is much nicer than the old free-text label, and the drift hardening in step 9 is a good catch. a couple super non-blocking nits: the reference table in posting-format.md uses html-encoded placeholders (<emoji>) that render as literal entities when the agent reads the file raw (the canonical instruction in pr-review.yaml uses bare angle brackets and is fine); and the verify requirement is stated in both step 9 and the REQUIRED block, which could drift if the threshold ever changes. neither is a blocker. ci is green, approving!
Resolve conflicts between the confidence-table format (this branch) and the suggestion blocks + configurable confidence-threshold from main: - keep suggestion blocks and update their examples to the confidence table - keep the configurable inline threshold T; replace the branch's hard-coded 55 threshold references with T
Summary
Inline review comments now show their confidence as a small markdown table (band + score)
instead of a free-text label, and the prompt is hardened against the band/threshold drift
surfaced in review: a finding scored 43 was labelled
moderateand posted inline, even though30–54 is the
weakband and weak non-forced findings belong in the lower-confidence summary(
MODERATE_THRESHOLD = 55is the inline cutoff).The confidence indicator renders as the last content block of each inline comment:
(🟢 strong · 🟡 moderate · 🟠 weak · ⚪ negligible — band derived from the same thresholds as
src/score-confidence.)What changed
confidence: <band> (<score>/100)line witha two-column mini markdown table as the last content block of the body (blank line, then the
<!-- docker-agent-review -->marker). Console mode keeps its own text label.estimated ("a 43 is
weak, notmoderate"); a non-forced finding scoring below 55 is neverposted inline; and a pre-post verification is anchored in numbered step 9.
verify-only (re-author or move to summary), with no post-hoc splicing of
/tmp/review_comments.json.Files
review-pr/agents/pr-review.yamlreview-pr/agents/refs/posting-format.mdreview-pr/README.mdResolves the review feedback on this PR
last content block with a blank line before the marker; no tension.
Validation
biome ci .tsc --noEmitactionlintpr-review.yaml)Note / possible follow-up
Prompt-level hardening only. The band and posting disposition are still computed by the
orchestrator LLM mirroring
src/score-confidence(which is not executed in the reviewpipeline), so the drift is made less likely, not impossible. A deterministic gate — running
score-confidence.tsto reject mis-banded or sub-55 non-forced inline comments before posting —remains a possible follow-up.