Skip to content

fix(#2253): pass human review comments to intent-coherence sub-agent#2257

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/2253-human-review-scope-auth
Open

fix(#2253): pass human review comments to intent-coherence sub-agent#2257
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/2253-human-review-scope-auth

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

The intent-coherence sub-agent evaluated scope authorization solely against the linked issue, with no visibility into human review comments from earlier PR review cycles. When a human reviewer explicitly requested a change that deviated from the issue spec (e.g., renaming a category), the sub-agent flagged it as unauthorized scope creep — a false positive.

Changes:

  • Add step 2b to the review orchestrator (SKILL.md) to fetch
    human-authored review comments from the GitHub PR reviews API,
    filtering out bot reviews
  • Include human_review_comments in the context package sent to
    sub-agents (step 3d) and in the dispatch template (step 4)
  • Add a "Human-authorized scope amendments" section to the
    intent-coherence sub-agent with guidance on identifying
    human-authorized deviations and reporting them as info-level
    findings instead of medium+ findings
  • Handle ambiguous cases: vague comments default to normal
    severity, conflicting reviewer feedback flags for human
    resolution

Note: pre-commit could not run due to sandbox network restrictions (shellcheck install failed). The post-script runs pre-commit authoritatively on the runner.


Closes #2253

Post-script verification

  • Branch is not main/master (agent/2253-human-review-scope-auth)
  • Secret scan passed (gitleaks — 0f53834f72372426c24dc0ede0030486a3e510ea..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

The intent-coherence sub-agent evaluated scope authorization solely
against the linked issue, with no visibility into human review
comments from earlier PR review cycles. When a human reviewer
explicitly requested a change that deviated from the issue spec
(e.g., renaming a category), the sub-agent flagged it as
unauthorized scope creep — a false positive.

Changes:
- Add step 2b to the review orchestrator (SKILL.md) to fetch
  human-authored review comments from the GitHub PR reviews API,
  filtering out bot reviews
- Include human_review_comments in the context package sent to
  sub-agents (step 3d) and in the dispatch template (step 4)
- Add a "Human-authorized scope amendments" section to the
  intent-coherence sub-agent with guidance on identifying
  human-authorized deviations and reporting them as info-level
  findings instead of medium+ findings
- Handle ambiguous cases: vague comments default to normal
  severity, conflicting reviewer feedback flags for human
  resolution

Note: pre-commit could not run due to sandbox network
restrictions (shellcheck install failed). The post-script runs
pre-commit authoritatively on the runner.

Closes #2253
@github-actions

Copy link
Copy Markdown

E2E tests did not run

E2E tests run automatically for org/repo members and collaborators on pull requests.

For other contributors, a maintainer must add the ok-to-test label after the latest push.

See E2E testing guide for details.

@github-actions

Copy link
Copy Markdown

Site preview

Preview: https://076bd3a1-site.fullsend-ai.workers.dev

Commit: 99075bbc1e864d3db02e97b9954b4b4c21cdf6bd

@codecov

codecov Bot commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review

fullsend-ai-review Bot commented Jun 12, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 6:57 PM UTC · Completed 7:08 PM UTC
Commit: 99075bb · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [prompt-injection] internal/scaffold/fullsend-repo/skills/pr-review/SKILL.md:193 — Human review comments are passed as context to sub-agents without being identified as untrusted input. The meta-prompt (meta-prompt.md) warns sub-agents that "diff and PR metadata" are untrusted, but human_review_comments is a new input channel not covered by this warning. Any GitHub user with permission to leave PR reviews can craft review comments containing prompt injection payloads designed to manipulate the intent-coherence sub-agent into suppressing legitimate scope-creep findings.
    Remediation: Update meta-prompt.md to explicitly list human_review_comments as untrusted input alongside diff and PR metadata. Additionally, in SKILL.md step 4's context package template, add a warning label to the "Human review comments" section.

  • [logic-error] internal/scaffold/fullsend-repo/skills/pr-review/SKILL.md:565 — Step 6e "Scope authorization" check verifies change scope against the linked issue's authorization but has not been updated to account for human review comments. The intent-coherence sub-agent now downgrades human-authorized deviations to info-level, but the orchestrator's own scope authorization check could independently flag the same deviation at a higher severity. Since PR-specific findings are merged after the challenger pass (step 6f), the challenger cannot remove the orchestrator's duplicate.
    Remediation: Update the step 6e "Scope authorization" section to also consult human review comments before flagging scope exceedance, or clarify that the orchestrator's scope check defers to the intent-coherence sub-agent's findings.

Low

  • [logic-error] internal/scaffold/fullsend-repo/skills/pr-review/SKILL.md:305 — The human_review_comments field description in step 3d says "for intent-coherence", but the dispatch template in step 4 adds ### Human review comments unconditionally for all sub-agents. This is internally inconsistent, though the practical impact is low since other sub-agents will ignore the extraneous section.

  • [edge-case] internal/scaffold/fullsend-repo/skills/pr-review/sub-agents/intent-coherence.md:56 — The "Human-authorized scope amendments" section specifies that deviations authorized by CHANGES_REQUESTED or COMMENTED review states should be treated as info-level, but APPROVED is excluded. A human reviewer who approves the PR with a comment authorizing a deviation has arguably given stronger authorization than a COMMENTED review. The data is already available (step 2b includes APPROVED state), but the sub-agent does not act on it.

  • [prompt-injection] internal/scaffold/fullsend-repo/skills/pr-review/sub-agents/intent-coherence.md:45 — The section instructs the sub-agent to treat review comments as authoritative scope amendments that suppress medium+ findings to info-level. This creates a trust elevation: PR review comments (which any collaborator can post) are granted the same authority as linked issues without verifying the commenter's authority level (e.g., CODEOWNERS membership).

Info

  • [edge-case] internal/scaffold/fullsend-repo/skills/pr-review/SKILL.md:193 — The gh api call filters reviews where .user.type != "Bot". Organization and Mannequin account types would pass this filter, though in practice neither type can submit PR reviews on GitHub.

  • [design-direction] internal/scaffold/fullsend-repo/skills/pr-review/SKILL.md:12 — Pre-existing: SKILL.md acknowledges departure from ADR-0018 and notes a superseding ADR is needed. This PR extends the orchestrator further without that ADR.

  • [design-smell] internal/scaffold/fullsend-repo/skills/pr-review/sub-agents/intent-coherence.md:44 — Scope authorization is becoming a multi-source reconciliation problem (issue spec + human review comments + PR description) relying on LLM interpretation of natural language. Consider whether structured representation would be more robust than natural-language reconciliation.

@fullsend-ai-review fullsend-ai-review 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.

See the review comment for full details.

avoid flagging human-directed changes as unauthorized scope creep.

```bash
# Fetch all review comments (not inline diff comments)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[medium] prompt-injection

Human review comments are passed as context to sub-agents without being identified as untrusted input. The meta-prompt warns that diff and PR metadata are untrusted, but human_review_comments is a new input channel not covered by this warning. Any GitHub user with permission to leave PR reviews can craft review comments containing prompt injection payloads to manipulate the intent-coherence sub-agent into suppressing legitimate scope-creep findings.

Suggested fix: Update meta-prompt.md to explicitly list human_review_comments as untrusted input alongside diff and PR metadata. Additionally, in SKILL.md step 4 context package template, add a warning label to the Human review comments section.

**Identifying human-authorized deviations:**

A deviation is human-authorized when a human reviewer (not a bot) has
explicitly requested it in a review comment with state

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] edge-case

The Human-authorized scope amendments section specifies that deviations authorized by CHANGES_REQUESTED or COMMENTED review states should be treated as info-level, but APPROVED is excluded. A reviewer who approves with a comment authorizing a deviation has given stronger authorization than a COMMENTED review. The data is already available but the sub-agent does not act on it.

scope. If there is no linked issue, flag a `missing-authorization`
finding — non-trivial changes require explicit authorization.

## Human-authorized scope amendments

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[low] prompt-injection

The section instructs the sub-agent to treat review comments as authoritative scope amendments that suppress medium+ findings to info-level. This creates a trust elevation: PR review comments (which any collaborator can post) are granted the same authority as linked issues without verifying the commenter authority level.

avoid flagging human-directed changes as unauthorized scope creep.

```bash
# Fetch all review comments (not inline diff comments)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[info] edge-case

The gh api call filters reviews where .user.type != Bot. Organization and Mannequin account types would pass this filter, though in practice neither type can submit PR reviews on GitHub.

@@ -42,6 +42,48 @@ Calibrate investigation to the diff size and nature.
scope. If there is no linked issue, flag a `missing-authorization`
finding — non-trivial changes require explicit authorization.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

[info] design-smell

Scope authorization is becoming a multi-source reconciliation problem (issue spec + human review comments + PR description) relying on LLM interpretation of natural language. Consider whether structured representation would be more robust.

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.

Review intent-coherence sub-agent should treat human review feedback as scope authorization

0 participants