Skip to content

refactor: reduce review-pr prompt surface - #116

Merged
dceoy merged 3 commits into
mainfrom
refactor/review-pr-compact-harness
Sep 5, 2026
Merged

dceoy merged 3 commits into
mainfrom
refactor/review-pr-compact-harness

Conversation

@dceoy

@dceoy dceoy commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • compact the OpenCode-specific pr-review skill while preserving the existing permission boundary and trusted helper workflow
  • keep immutable snapshot review semantics and snapshot-bound submission
  • keep one generic read-only review-worker, but reduce each worker packet to the minimum decision-relevant fields
  • simplify validation output to disposition/rationale plus only corrected location or human check when needed
  • retain the existing aspect routing vocabulary and runtime-enforced read-only constraints

Rationale

The current review flow contains useful safety and snapshot guarantees, but some of those guarantees are already enforced by OpenCode permissions and trusted helper scripts. Repeating the implementation detail in the model harness increases context size without strengthening the boundary.

This change keeps OpenCode-specific enforcement in OpenCode while making the model-facing procedure smaller and closer to the generic adaptive review policy.

Verification

  • branch is based directly on current main
  • no helper scripts, permissions, authentication, or submission endpoints are changed
  • wording asserted by the existing validate-opencode.bats routing/runtime contract is preserved
  • compare against main: 2 model-facing files changed, net instruction reduction

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 509b61e962

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .opencode/skills/pr-review/SKILL.md
Comment thread .opencode/skills/pr-review/SKILL.md Outdated
@opencode-agent

opencode-agent Bot commented Sep 5, 2026

Copy link
Copy Markdown

No noteworthy issues found.

New%20session%20-%202026-09-05T10%3A09%3A03.471Z
opencode session  |  github run

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed the two prompt/instruction files this PR compacts (.opencode/agents/review-worker.md, .opencode/skills/pr-review/SKILL.md) against the current file content, the enforcing scripts (review-pr-submit.sh, review-pr-gh.sh), review-pr-orchestrator.md's permission allow-lists, and tests/validate-opencode.bats. All textual contracts asserted by the bats suite still hold, but the compaction dropped several behavioral instructions that aren't backstopped by anything else (permissions gate which tool calls are possible, not whether the model chooses to make them), so these are real regressions rather than pure style trims. Filed as 4 inline comments; details below.

Summary of findings (all in .opencode/skills/pr-review/SKILL.md, all confirmed against the current file and review-pr-submit.sh's payload validator):

  1. Section 4's validation dispatch never states the literal TASK KIND: validation token (only TASK KIND: discovery appears anywhere in the file), even though review-worker.md branches its entire behavior on that literal — a validation packet built from the file as written has no discriminator telling the worker to falsify rather than discover.
  2. Section 6's inline-comment body instruction dropped both the required severity enum (critical|important|suggestion) and the mandatory blank line before the finding text — both are hard-enforced by review-pr-submit.sh's regex, so any other severity word or a missing blank line now fails validate-initial with no textual guidance to prevent it.
  3. The fallback path for "confirmed findings exist but none are safely anchorable" (all summary_only) was deleted with no replacement. review-pr-submit.sh requires comments to be a non-empty array, so following section 6 literally in that state either dead-ends the run or, in the mixed case (some inline + some summary-only), silently drops the summary-only findings from an otherwise-successful submission.
  4. The explicit prohibition on describing confirmed, anchorable findings only in chat text instead of running the submission scripts was removed. This isn't covered by the orchestrator's bash allow-list, since permissions only restrict which calls are possible, not whether the model bothers to make one — so a review can now silently complete without ever posting to GitHub.

No issues found in the discovery-packet contract, the aspect-routing table, or the read-only permission boundaries themselves — those parts of the compaction are faithful.

Comment thread .opencode/skills/pr-review/SKILL.md Outdated
Comment thread .opencode/skills/pr-review/SKILL.md Outdated
Comment thread .opencode/skills/pr-review/SKILL.md
Comment thread .opencode/skills/pr-review/SKILL.md

@dceoy dceoy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Reviewed head 509b61e962bc0d47a04728036f4b444c0487781b. No new actionable findings beyond the current review feedback. The existing comments correctly identify the material regressions introduced by the compaction: the missing validation-task discriminator/candidate record, the submit helper's severity/body grammar no longer being documented, loss of the summary-only publication path, and loss of the explicit requirement to submit anchorable findings rather than merely return them in chat.

@dceoy dceoy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Reviewed current head 59e11c11e8f6572fe93100406699976392cbf0d3. No new actionable findings. The previously reported validation-dispatch, inline-body grammar, summary-only fallback, and mandatory-submission regressions are addressed in the current diff; the OpenCode permission boundary and trusted snapshot/submission helpers remain unchanged, and CI is passing on this head.

@dceoy
dceoy merged commit 0ff6448 into main Sep 5, 2026
40 checks passed
@dceoy
dceoy deleted the refactor/review-pr-compact-harness branch September 5, 2026 13:24
@dceoy dceoy self-assigned this Sep 5, 2026
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