Skip to content

fix(review-pr): show inline confidence as a table + harden band/threshold drift - #25

Merged
Sayt-0 merged 3 commits into
mainfrom
feat/enforce-confidence-label
Jul 2, 2026
Merged

Sayt-0 merged 3 commits into
mainfrom
feat/enforce-confidence-label

Conversation

@Sayt-0

@Sayt-0 Sayt-0 commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

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 moderate and posted inline, even though
30–54 is the weak band and weak non-forced findings belong in the lower-confidence summary
(MODERATE_THRESHOLD = 55 is the inline cutoff).

The confidence indicator renders as the last content block of each inline comment:

| Confidence | Score |
| :--: | :--: |
| 🟡 moderate | 72/100 |

(🟢 strong · 🟡 moderate · 🟠 weak · ⚪ negligible — band derived from the same thresholds as src/score-confidence.)

What changed

  • Confidence indicator — replaced the free-text confidence: <band> (<score>/100) line with
    a 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.
  • Drift hardening — Step 5 now states the band is read off the score boundaries, never
    estimated ("a 43 is weak, not moderate"); a non-forced finding scoring below 55 is never
    posted inline; and a pre-post verification is anchored in numbered step 9.
  • Enforcement mechanism — the indicator is baked in at authoring time; the self-check is
    verify-only (re-author or move to summary), with no post-hoc splicing of
    /tmp/review_comments.json.

Files

File Change
review-pr/agents/pr-review.yaml step 9 + Confidence Scoring: table indicator, drift hardening, numbered-step verify
review-pr/agents/refs/posting-format.md heredoc template + REQUIRED-table rule + wiring examples
review-pr/README.md example output

Resolves the review feedback on this PR

  • Fragile post-hoc JSON splice → authoring-time + verify-only (never mutate the JSON).
  • "Immediately before the marker" vs the blank-line-before-marker rule → the indicator is the
    last content block with a blank line before the marker; no tension.
  • Self-check outside the numbered steps → anchored in numbered step 9.

Validation

Check Result
biome ci . pass
tsc --noEmit pass
actionlint pass
Unit tests 614 passed
YAML parse (pr-review.yaml) ok

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 review
pipeline), so the drift is made less likely, not impossible. A deterministic gate — running
score-confidence.ts to reject mis-banded or sub-55 non-forced inline comments before posting —
remains a possible follow-up.

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.
@Sayt-0
Sayt-0 requested a review from derekmisler June 29, 2026 10:13

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread review-pr/agents/pr-review.yaml Resolved
Comment thread review-pr/agents/refs/posting-format.md Resolved
Comment thread review-pr/agents/pr-review.yaml Resolved
@Sayt-0 Sayt-0 changed the title fix(review-pr): require a confidence label on every inline comment fix(review-pr): show inline confidence as a table + harden band/threshold drift Jun 29, 2026
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.
@Sayt-0
Sayt-0 force-pushed the feat/enforce-confidence-label branch from 4689385 to 8dbf4a5 Compare June 29, 2026 11:52
@Sayt-0
Sayt-0 requested a review from docker-agent June 29, 2026 11:53
@Sayt-0
Sayt-0 enabled auto-merge (squash) June 29, 2026 11:54

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 derekmisler left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (&lt;emoji&gt;) 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
@Sayt-0
Sayt-0 merged commit f9fa09f into main Jul 2, 2026
7 checks passed
@Sayt-0
Sayt-0 deleted the feat/enforce-confidence-label branch July 2, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants