Skip to content

Stop wrapping review prose in code fences - #17

Merged
MichaelFisher1997 merged 1 commit into
mainfrom
t3code/fix-code-review-code-block-rendering
Sep 14, 2026
Merged

MichaelFisher1997 merged 1 commit into
mainfrom
t3code/fix-code-review-code-block-rendering

Conversation

@MichaelFisher1997

Copy link
Copy Markdown
Contributor

Problem

The opencode PR reviewer renders each issue as a text code block, so all of the prose (description, impact, confidence) appears in a fence instead of only actual code. See the Medium Priority section of a recent review for an example.

Cause

.github/prompts/pr-review.md presented the per-issue output template inside a fenced code block. The model followed "use this exact format" literally and reproduced the fence around every issue.

Fix

  • Present the issue structure as plain Markdown with an explicit "do not wrap it in a code fence" instruction.
  • Add a global formatting rule: never fence review prose; fence only real code snippets, tagged gdscript when it is GDScript.

High/Medium/Low sections reference "Same format as Critical", so they inherit the corrected behavior.

Notes

$PREVIOUS_REVIEWS still injects older fenced reviews into the prompt, which reinforced the bad pattern. The new explicit instruction overrides that, and the reinforcement goes away once the first clean review is posted.

@github-actions

Copy link
Copy Markdown

📋 Summary

No linked issues found in the PR body (it references "a recent review" as an example, but no "Closes #N"/"Fixes #N").

📌 Review Metadata

This PR fixes prompt-induced formatting in the advisory reviewer by removing the fenced code block around the per-issue output template in .github/prompts/pr-review.md and adding a global FORMATTING rule that forbids fencing review prose. The change is exactly scoped as described (+5/-3, one file), touches no game code, and directly addresses the root cause identified in the PR body. Verification is by inspection (no headless verifier covers prompt files), which is appropriate here; the strongest end-to-end check is the next workflow run, and this very review being generated from the updated prompt confirms the template loads correctly through envsubst.

🔴 Critical Issues (Must Fix - Blocks Merge)

None identified. No previous automated reviews were found, so there is nothing to re-verify or acknowledge. The change is Markdown-only: no GDScript, shaders, scenes, worker-thread state, or asset/licensing surface is affected. The only remaining fence in the file is the JSON verdict block (.github/prompts/pr-review.md:136), which is legitimate data, consistent with the new rule.

⚠️ High Priority Issues (Should Fix)

None identified. Claims verified against the file: the FORMATTING rule is wired into the CRITICAL INSTRUCTIONS (line 46), the Critical template is now unfenced (lines 69-77), and the High/Medium/Low sections inherit it via "Same format as Critical" (lines 82, 87, 92). No new $ sequences were introduced, so the envsubst '$PR_NUMBER $HEAD_SHA $PREVIOUS_REVIEWS' substitution in .github/workflows/opencode-pr.yml:121 is unaffected.

💡 Medium Priority Issues (Nice to Fix)

None identified.

ℹ️ Low Priority Suggestions (Optional)

[LOW] .github/prompts/pr-review.md:71-75 - Template fields render as one flowing paragraph in GitHub's file view
Confidence: High
Description: The five template lines have no blank lines or hard breaks between them. When the prompt file itself is viewed on github.com (CommonMark soft-break collapsing), they render as a single run-on paragraph. This is purely cosmetic for humans reading the prompt; the raw text fed to the model preserves newlines, and PR review comments render hard breaks, so model behavior and posted reviews are unaffected.
Impact: None functional; slightly harder to eyeball the template when editing the file in the GitHub UI.
Suggested Fix: Either accept as-is, or make the visual separation explicit without changing the emitted structure, e.g. trailing backslashes or double-spaces:

# Markdown-only fix (not GDScript), for each template line ending:
**[CRITICAL]** `File:Line` - Issue Title\
**Confidence:** High|Medium|Low (how sure you are this is a real problem)\

📊 SOLID Principles Score

Principle Score Notes
Single Responsibility 8 The prompt still does one thing (define the review rubric/output contract); the formatting rule is placed in the instructions list where it belongs
Open/Closed 8 The rule is stated generically (all prose, all sections) rather than patching each section, so future sections inherit it
Liskov Substitution 8 N/A for a prompt file; nothing replaces anything, placeholders ($PREVIOUS_REVIEWS) behave as before
Interface Segregation 8 The per-issue contract stays minimal and unchanged in content; only its presentation changed
Dependency Inversion 8 The prompt remains decoupled from the workflow via envsubst placeholders; no new coupling introduced
Average 8.0

🎯 Final Assessment

Overall Confidence Score: 90%

Confidence Breakdown:

  • Code Quality: 90% (minimal, precise diff that matches the stated intent exactly)
  • Completeness: 95% (fixes both the reinforcing template fence and adds an explicit override for legacy fenced reviews injected via $PREVIOUS_REVIEWS)
  • Risk Level: 95% (Markdown prompt only; no game code, workflows, or assets touched)
  • Verification: 80% (no headless verifier applies to prompt files; inspection confirms wiring, and the next workflow run plus this review itself serve as the behavioral check — residual risk is that a model could still occasionally fence prose despite the instruction)

Merge Readiness:

  • All critical issues resolved
  • SOLID average score >= 6.0
  • Overall confidence >= 60%
  • No security concerns
  • No unresolved worker-thread, determinism, or data-loss risk

Verdict:

MERGE

A correctly scoped, low-risk prompt fix that removes the root cause of fenced review prose and explicitly overrides the legacy pattern from injected previous reviews; the single Low note is cosmetic only.

Machine Readable Verdict

{
  "reviewed_sha": "5b8ff008838ecb8a39dc704d112863b398d5ab9a",
  "critical_issues": 0,
  "high_priority_issues": 0,
  "medium_priority_issues": 0,
  "overall_confidence_score": 90,
  "recommendation": "MERGE"
}

New%20session%20-%202026-09-14T21%3A57%3A17.606Z
opencode session  |  github run

@MichaelFisher1997
MichaelFisher1997 merged commit 253e84d into main Sep 14, 2026
7 checks passed
@MichaelFisher1997
MichaelFisher1997 deleted the t3code/fix-code-review-code-block-rendering branch September 14, 2026 22:02
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.

1 participant