Skip to content

fix(retro): prohibit filing "evidence for" issues - #3638

Closed
rh-hemartin wants to merge 2 commits into
mainfrom
fix/3617-no-evidence-issues
Closed

fix(retro): prohibit filing "evidence for" issues#3638
rh-hemartin wants to merge 2 commits into
mainfrom
fix/3617-no-evidence-issues

Conversation

@rh-hemartin

Copy link
Copy Markdown
Member

Summary

  • Add explicit prohibition against filing "Evidence for #XXXX" issues to skills/retro-analysis/SKILL.md
  • Evidence for existing issues goes in the summary field (posted as PR comment), not as a new proposal
  • Same change needs to be applied to fullsend-ai/agents separately

The retro agent's dedup check says "skip proposals covered by existing issues" but the LLM invented a workaround: titling proposals "Evidence for #XXXX" and stuffing the evidence narrative into the standard what_happened/proposed_change fields. Schema validation passes because it only checks field names and types, not semantic intent.

Transcript analysis (runs 28948580111, 28941534472) shows the agent fighting the schema to get evidence filed — in one case burning 4 validation-loop iterations trying {"type": "evidence", "target_issue": 2959} before discovering it can just use "Evidence for #2959" as the title with standard fields.

336 of 485 retro-filed issues since July 5 (69%) are evidence filings. On peak day (July 7), 156 of 230.

Fixes #3617

Test plan

  • Next 20 retro runs produce zero "Evidence for" titled issues
  • Retro summaries posted on originating PRs still reference existing issues with specific evidence

🤖 Generated with Claude Code

rh-hemartin and others added 2 commits July 8, 2026 09:17
Teach the code agent to discover and use PR templates when writing
pr_body for the structured output file. The post-script uses pr_body
verbatim as the PR description, falling back to the commit body when
absent.

Address review feedback:
- Annotate ADR 0053 with pr_body schema amendment
- Use printf instead of echo for pr_body piping (flag-safe)
- Tighten sed to only strip GitHub close-reference lines, not prose
- Add maxLength: 65536 to pr_body schema (GitHub API limit)
- Fix wrong cross-reference ("step 6" → "structured output block")
- Replace heredoc examples with jq -n pattern (safe from shell expansion)
- Wrap examples in if/else to prevent running both branches
- Align pr_body description style with target_branch (direct assertion)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Hector Martinez <hemartin@redhat.com>
The retro agent's dedup check tells it to skip proposals covered by
existing issues, but the LLM invented a workaround: filing "Evidence
for #XXXX" issues that pass schema validation by stuffing evidence
into the standard proposal fields. This produced 336 noise issues
in 3 days (69% of all retro output since July 5).

Add explicit prohibition to the retro-analysis skill. Evidence for
existing issues goes in the summary field (posted as a PR comment),
not as a new proposal.

The same change must be applied to fullsend-ai/agents independently.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Hector Martinez <hemartin@redhat.com>
@rh-hemartin
rh-hemartin requested a review from a team as a code owner July 8, 2026 14:20
@fullsend-ai-review

fullsend-ai-review Bot commented Jul 8, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 2:20 PM UTC · Completed 2:31 PM UTC
Commit: 86d15e3 · View workflow run →

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

Site preview

Preview: https://99a76a7c-site.fullsend-ai.workers.dev

Commit: 86d15e3f8b839b04161cb8696eb40ed44a0dc21d

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Support template-aware PR bodies and ban retro "Evidence for" issue spam

🐞 Bug fix ✨ Enhancement 📝 Documentation 🧪 Tests 🕐 40+ Minutes

Grey Divider

AI Description

• Add optional pr_body to code-agent results for template-aware PR descriptions.
• Update PR creation scripts to prefer pr_body, falling back to commit body.
• Explicitly forbid retro agent from filing "Evidence for #XXXX" issues; require summary comments
 instead.
Diagram

graph TD
A["Code agent"] --> B["code-result.json (pr_body)"] --> C["post-code.sh"] --> D["gh pr create"] --> E["GitHub PR"]
F["PR template"] --> A
H["retro-analysis SKILL"] --> G["Retro agent"]
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Post-script enforcement for retro evidence titles
  • ➕ Defense-in-depth: blocks "Evidence for #" issues even if the model ignores the skill
  • ➕ Provides a clear error/signal in automation rather than relying on prompt compliance
  • ➖ Requires identifying evidence-like issues heuristically (risk of false positives)
  • ➖ Adds coupling between retro policy and post-processing scripts
2. Schema-level semantics (explicit evidence type)
  • ➕ Makes intent machine-checkable (e.g., type: evidence must target an existing issue)
  • ➕ Enables validation to prevent misuse of proposal fields for evidence narratives
  • ➖ Requires schema evolution + toolchain updates across repos and agents
  • ➖ Still needs policy on whether evidence entries should create issues at all
3. Ingestion-side deduplication / evidence aggregation
  • ➕ Centralizes noise control regardless of prompting strategy
  • ➕ Can automatically append evidence to existing issues rather than creating new ones
  • ➖ More moving parts and harder to iterate quickly
  • ➖ Requires access to and changes in the issue-filing pipeline

Recommendation: The PR’s approach is a pragmatic, low-risk first step: keep backward compatibility while enabling template-aware PR bodies, and stop the retro workaround by explicitly routing evidence into PR summary comments. Consider a follow-up post-script guard for retro outputs as defense-in-depth if evidence-issue spam persists despite the skill update.

Files changed (6) +179 / -26

Enhancement (1) +22 / -9
post-code.shPrefer agent-provided 'pr_body' over commit body when creating PRs +22/-9

Prefer agent-provided 'pr_body' over commit body when creating PRs

• Reads '.pr_body' from the agent result file and uses it as the PR description when present. Strips 'Signed-off-by:' and 'Closes ...' lines from the provided body to avoid duplication, otherwise retains the legacy commit-body unwrapping path.

internal/scaffold/fullsend-repo/scripts/post-code.sh

Bug fix (1) +3 / -1
SKILL.mdBan retro proposals framed as "Evidence for #XXXX"; require summary evidence +3/-1

Ban retro proposals framed as "Evidence for #XXXX"; require summary evidence

• Adds an explicit prohibition against filing evidence-only issues that duplicate existing open issues. Instructs the agent to record corroborating evidence in the 'summary' field (posted as a PR comment) when skipping duplicates.

internal/scaffold/fullsend-repo/skills/retro-analysis/SKILL.md

Tests (1) +86 / -1
post-code-test.shAdd test coverage for 'pr_body' handling and Closes-line stripping +86/-1

Add test coverage for 'pr_body' handling and Closes-line stripping

• Extends the test harness to pass an agent-provided PR body into 'build_pr_body' and assert it is used verbatim. Adds checks that embedded 'Closes #N' in 'pr_body' is stripped so the script appends exactly one close reference.

internal/scaffold/fullsend-repo/scripts/post-code-test.sh

Documentation (2) +62 / -14
0053-agent-driven-branch-targeting.mdDocument optional 'pr_body' in the code-agent result contract +12/-0

Document optional 'pr_body' in the code-agent result contract

• Updates ADR 0053 to record an amendment adding an optional 'pr_body' field. Clarifies that post-code uses 'pr_body' verbatim when present and falls back to commit body otherwise.

docs/ADRs/0053-agent-driven-branch-targeting.md

SKILL.mdTeach code-implementation skill to discover PR templates and emit 'pr_body' +50/-14

Teach code-implementation skill to discover PR templates and emit 'pr_body'

• Adds guidance to detect and parse repository PR templates and structure 'pr_body' accordingly. Updates the structured-output instructions to use 'jq -n' for safe JSON construction and clarifies that 'pr_body' is not subject to gitlint body line-length constraints.

internal/scaffold/fullsend-repo/skills/code-implementation/SKILL.md

Other (1) +6 / -1
code-result.schema.jsonExtend code-result schema with optional 'pr_body' (GitHub-size limited) +6/-1

Extend code-result schema with optional 'pr_body' (GitHub-size limited)

• Expands 'code-result.schema.json' to allow an optional 'pr_body' string with 'maxLength: 65536' (GitHub API limit). Updates the schema description to reflect PR-body support in addition to target branch selection.

internal/scaffold/fullsend-repo/schemas/code-result.schema.json

@rh-hemartin rh-hemartin closed this Jul 8, 2026
@rh-hemartin
rh-hemartin deleted the fix/3617-no-evidence-issues branch July 8, 2026 14:24
@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (3) 📎 Requirement gaps (0) 📜 Skill insights (1)

Context used
✅ Compliance rules (platform): 61 rules

Grey Divider


Action required

1. pr_body lacks requirement link 📘 Rule violation § Compliance
Description
The PR introduces new behavior (pr_body support) in the code-agent contract and post-script, but
this PR is scoped/described as a retro-agent fix (#3617) and does not reference a tracked
requirement for the new PR-body feature. Untracked functionality increases scope creep and weakens
change control.
Code

internal/scaffold/fullsend-repo/scripts/post-code.sh[R445-455]

+# Read pr_body from agent output. Fall back to commit body if absent.
+PR_BODY_FROM_RESULT=""
+if [ -n "${RESULT_FILE}" ]; then
+  PR_BODY_FROM_RESULT="$(jq -r '.pr_body // empty' "${RESULT_FILE}" 2>/dev/null || true)"
+fi
+
+if [ -n "${PR_BODY_FROM_RESULT}" ]; then
+  # Agent provided pr_body (template-aware or best-effort).
+  # Strip Signed-off-by and Closes lines so the script appends them once.
+  COMMIT_BODY="$(printf '%s\n' "${PR_BODY_FROM_RESULT}" | sed '/^Signed-off-by:/d' | sed '/^Closes #/d; /^Closes [a-zA-Z0-9_.-]*\/[a-zA-Z0-9_.-]*#/d' | sed -e :a -e '/^\n*$/{ $d; N; ba; }')"
+else
Relevance

⭐⭐⭐ High

Team has accepted scope/requirement-linking expectations for non-trivial PRs without linked issues
(PR #1903).

PR-#1903

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The PR adds pr_body to the schema contract and updates post-code.sh to preferentially use
.pr_body from RESULT_FILE, which is a new externally-visible behavior. The PR also updates the
code-implementation skill to instruct agents to populate pr_body, demonstrating this is intended
functionality that should be tied to a tracked requirement.

Rule 1062064: New code must map to explicit tracked requirements; no speculative features
internal/scaffold/fullsend-repo/scripts/post-code.sh[445-465]
internal/scaffold/fullsend-repo/schemas/code-result.schema.json[4-19]
internal/scaffold/fullsend-repo/skills/code-implementation/SKILL.md[167-234]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New behavior (`pr_body` support) was added but is not tied to an explicit tracked requirement in this PR’s scope.

## Issue Context
Compliance requires new public behaviors to map to an explicit tracked requirement (issue/RFC/etc.) and not be introduced as unrelated scope.

## Fix Focus Areas
- internal/scaffold/fullsend-repo/scripts/post-code.sh[445-465]
- internal/scaffold/fullsend-repo/schemas/code-result.schema.json[4-19]
- internal/scaffold/fullsend-repo/skills/code-implementation/SKILL.md[167-234]
- docs/ADRs/0053-agent-driven-branch-targeting.md[115-124]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. ADR inlines JSON schema 📜 Skill insight ⚙ Maintainability
Description
The ADR embeds the code-result JSON Schema inline (and expands it in this PR) instead of linking
to a versioned normative spec. Inline contracts are harder to audit/version and should live under
docs/normative/<topic>/v<major>/... with the ADR linking to them.
Code

docs/ADRs/0053-agent-driven-branch-targeting.md[R105-109]

+    },
+    "pr_body": {
+      "type": "string",
+      "maxLength": 65536,
+      "description": "PR description used as PR body instead of commit body."
Relevance

⭐⭐ Medium

No strong precedent found requiring schemas be moved from ADRs into docs/normative versioned specs.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The ADR’s Decision section contains an inline JSON schema block for the code-result contract, and
this PR modifies that block by adding pr_body, which continues the pattern of inlining schema
instead of referencing a normative spec file.

docs/ADRs/0053-agent-driven-branch-targeting.md[89-124]
Skill: writing-adrs

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The ADR includes inline JSON Schema content instead of linking to a versioned normative spec location.

## Issue Context
Compliance requires detailed contracts/JSON schemas to be stored in `docs/normative/<topic>/v<major>/...` and referenced from the ADR.

## Fix Focus Areas
- docs/ADRs/0053-agent-driven-branch-targeting.md[89-124]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. Extra Closes directives retained 🐞 Bug ≡ Correctness
Description
In post-code.sh, the legacy commit-body path only strips lines starting with Closes # but can
retain other Closes ... lines (e.g. Closes owner/repo#123). Because the script always appends
its own Closes #${ISSUE_NUMBER} footer, the resulting PR body can contain multiple close
directives, contradicting the “append once” intent and risking unintended side effects.
Code

internal/scaffold/fullsend-repo/scripts/post-code.sh[R456-463]

+  # Fall back to unwrapped commit body (legacy path)
+  COMMIT_BODY_RAW="$(git log -1 --format='%b' HEAD | sed '/^Signed-off-by:/d' | sed '/^Closes #/d' | sed -e :a -e '/^\n*$/{ $d; N; ba; }')"
+  COMMIT_BODY="$(echo "${COMMIT_BODY_RAW}" | awk '
+    /^$/           { if (buf) print buf; print; buf=""; next }
+    /^[-*#>]|^  /  { if (buf) print buf; buf=""; print; next }
+    /^Closes /     { if (buf) print buf; buf=""; print; next }
+                   { buf = (buf ? buf " " $0 : $0) }
+    END            { if (buf) print buf }
Relevance

⭐⭐⭐ High

Team previously removed duplicate “Closes #” lines in PR bodies, indicating preference for a single
close directive (PR #521).

PR-#521

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new pr_body path removes cross-repo Closes owner/repo#... lines, but the legacy commit-body
path only removes Closes #.... Since the script later appends Closes #${ISSUE_NUMBER}
unconditionally, any remaining Closes ... lines from the commit body will co-exist with the
appended footer in the PR body.

internal/scaffold/fullsend-repo/scripts/post-code.sh[445-465]
internal/scaffold/fullsend-repo/scripts/post-code.sh[492-497]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`post-code.sh` strips `Closes` lines more completely for the new `pr_body` path than for the legacy commit-body path. The legacy path can therefore leave additional `Closes ...` directives in the final PR body even though the script appends its own `Closes #<issue>` footer.

### Issue Context
- The new `pr_body` path deletes both `^Closes #` and `^Closes owner/repo#...`.
- The legacy path deletes only `^Closes #`, leaving other `Closes ...` lines intact.

### Fix Focus Areas
- internal/scaffold/fullsend-repo/scripts/post-code.sh[451-465]
- internal/scaffold/fullsend-repo/scripts/post-code-test.sh[127-337]

### Suggested fix
- Make the legacy commit-body sanitization match the `pr_body` path by deleting all `Closes ...` lines (at minimum the cross-repo form) before assembling `COMMIT_BODY`.
- Add a regression test in `post-code-test.sh` where the commit body includes `Closes owner/repo#123` and assert it does not appear in the final body (and that the appended `Closes #<issue>` appears exactly once).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


4. PR description misses ADR 📘 Rule violation § Compliance
Description
An Accepted ADR was modified in this PR, but the PR description does not explicitly call out the
ADR filename/identifier and summarize what changed. This reduces auditability of architectural
decision changes.
Code

docs/ADRs/0053-agent-driven-branch-targeting.md[R105-109]

+    },
+    "pr_body": {
+      "type": "string",
+      "maxLength": 65536,
+      "description": "PR description used as PR body instead of commit body."
Relevance

⭐⭐ Medium

No clear historical evidence of enforcing “mention ADR change in PR description” requirement.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The ADR file modified in this PR is explicitly Accepted, so it triggers the requirement to call
out the ADR change in the PR description; the diff shows substantive additions to the ADR’s
decision/contract area.

Rule 1062059: Call out edits to accepted ADRs in PR descriptions
docs/ADRs/0053-agent-driven-branch-targeting.md[1-20]
docs/ADRs/0053-agent-driven-branch-targeting.md[85-124]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR modifies an accepted ADR but the PR description does not explicitly mention the ADR and summarize the change.

## Issue Context
Compliance requires PR descriptions to call out edits to accepted ADRs.

## Fix Focus Areas
- docs/ADRs/0053-agent-driven-branch-targeting.md[1-20]
- docs/ADRs/0053-agent-driven-branch-targeting.md[85-124]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Informational

5. Accepted ADR 0053 modified 📘 Rule violation ⌂ Architecture
Description
The PR changes the recorded decision/contract inside an already Accepted ADR by adding the
pr_body field and an amendment describing new behavior. Per policy, substantive decision changes
must be captured in a new ADR that supersedes the old one rather than modifying accepted history.
Code

docs/ADRs/0053-agent-driven-branch-targeting.md[R118-123]

+**Amendment (PR #2979):** Added optional `pr_body` field so the agent can
+provide a PR description independently of the commit body. When the repo has
+a PR template, the agent structures `pr_body` to match. The post-script uses
+`pr_body` verbatim as the PR description when present, falling back to the
+commit body otherwise. `pr_body` is optional — omitting it preserves the
+original commit-body-as-description behavior.
Relevance

⭐ Low

Similar “don’t edit Accepted ADR; write new one” feedback was rejected in PR #2277.

PR-#2277

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
docs/ADRs/0053-agent-driven-branch-targeting.md is marked status: Accepted, yet the PR adds a
new schema field (pr_body) and an amendment describing new PR-body behavior, which materially
alters the accepted decision/contract rather than superseding it with a new ADR.

Rule 1062058: Supersede accepted ADRs with new ADRs instead of modifying history
docs/ADRs/0053-agent-driven-branch-targeting.md[1-20]
docs/ADRs/0053-agent-driven-branch-targeting.md[85-124]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
An `Accepted` ADR (`docs/ADRs/0053-agent-driven-branch-targeting.md`) was substantively modified to add new behavior (`pr_body`) instead of being superseded by a new ADR.

## Issue Context
Compliance requires that changes to an accepted decision be captured as a new ADR (with cross-links), preserving the original ADR as historical record.

## Fix Focus Areas
- docs/ADRs/0053-agent-driven-branch-targeting.md[85-136]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment on lines +105 to +109
},
"pr_body": {
"type": "string",
"maxLength": 65536,
"description": "PR description used as PR body instead of commit body."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

2. Pr description misses adr 📘 Rule violation § Compliance

An Accepted ADR was modified in this PR, but the PR description does not explicitly call out the
ADR filename/identifier and summarize what changed. This reduces auditability of architectural
decision changes.
Agent Prompt
## Issue description
The PR modifies an accepted ADR but the PR description does not explicitly mention the ADR and summarize the change.

## Issue Context
Compliance requires PR descriptions to call out edits to accepted ADRs.

## Fix Focus Areas
- docs/ADRs/0053-agent-driven-branch-targeting.md[1-20]
- docs/ADRs/0053-agent-driven-branch-targeting.md[85-124]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +445 to +455
# Read pr_body from agent output. Fall back to commit body if absent.
PR_BODY_FROM_RESULT=""
if [ -n "${RESULT_FILE}" ]; then
PR_BODY_FROM_RESULT="$(jq -r '.pr_body // empty' "${RESULT_FILE}" 2>/dev/null || true)"
fi

if [ -n "${PR_BODY_FROM_RESULT}" ]; then
# Agent provided pr_body (template-aware or best-effort).
# Strip Signed-off-by and Closes lines so the script appends them once.
COMMIT_BODY="$(printf '%s\n' "${PR_BODY_FROM_RESULT}" | sed '/^Signed-off-by:/d' | sed '/^Closes #/d; /^Closes [a-zA-Z0-9_.-]*\/[a-zA-Z0-9_.-]*#/d' | sed -e :a -e '/^\n*$/{ $d; N; ba; }')"
else

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

3. pr_body lacks requirement link 📘 Rule violation § Compliance

The PR introduces new behavior (pr_body support) in the code-agent contract and post-script, but
this PR is scoped/described as a retro-agent fix (#3617) and does not reference a tracked
requirement for the new PR-body feature. Untracked functionality increases scope creep and weakens
change control.
Agent Prompt
## Issue description
New behavior (`pr_body` support) was added but is not tied to an explicit tracked requirement in this PR’s scope.

## Issue Context
Compliance requires new public behaviors to map to an explicit tracked requirement (issue/RFC/etc.) and not be introduced as unrelated scope.

## Fix Focus Areas
- internal/scaffold/fullsend-repo/scripts/post-code.sh[445-465]
- internal/scaffold/fullsend-repo/schemas/code-result.schema.json[4-19]
- internal/scaffold/fullsend-repo/skills/code-implementation/SKILL.md[167-234]
- docs/ADRs/0053-agent-driven-branch-targeting.md[115-124]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +105 to +109
},
"pr_body": {
"type": "string",
"maxLength": 65536,
"description": "PR description used as PR body instead of commit body."

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

4. Adr inlines json schema 📜 Skill insight ⚙ Maintainability

The ADR embeds the code-result JSON Schema inline (and expands it in this PR) instead of linking
to a versioned normative spec. Inline contracts are harder to audit/version and should live under
docs/normative/<topic>/v<major>/... with the ADR linking to them.
Agent Prompt
## Issue description
The ADR includes inline JSON Schema content instead of linking to a versioned normative spec location.

## Issue Context
Compliance requires detailed contracts/JSON schemas to be stored in `docs/normative/<topic>/v<major>/...` and referenced from the ADR.

## Fix Focus Areas
- docs/ADRs/0053-agent-driven-branch-targeting.md[89-124]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines +456 to +463
# Fall back to unwrapped commit body (legacy path)
COMMIT_BODY_RAW="$(git log -1 --format='%b' HEAD | sed '/^Signed-off-by:/d' | sed '/^Closes #/d' | sed -e :a -e '/^\n*$/{ $d; N; ba; }')"
COMMIT_BODY="$(echo "${COMMIT_BODY_RAW}" | awk '
/^$/ { if (buf) print buf; print; buf=""; next }
/^[-*#>]|^ / { if (buf) print buf; buf=""; print; next }
/^Closes / { if (buf) print buf; buf=""; print; next }
{ buf = (buf ? buf " " $0 : $0) }
END { if (buf) print buf }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

5. Extra closes directives retained 🐞 Bug ≡ Correctness

In post-code.sh, the legacy commit-body path only strips lines starting with Closes # but can
retain other Closes ... lines (e.g. Closes owner/repo#123). Because the script always appends
its own Closes #${ISSUE_NUMBER} footer, the resulting PR body can contain multiple close
directives, contradicting the “append once” intent and risking unintended side effects.
Agent Prompt
### Issue description
`post-code.sh` strips `Closes` lines more completely for the new `pr_body` path than for the legacy commit-body path. The legacy path can therefore leave additional `Closes ...` directives in the final PR body even though the script appends its own `Closes #<issue>` footer.

### Issue Context
- The new `pr_body` path deletes both `^Closes #` and `^Closes owner/repo#...`.
- The legacy path deletes only `^Closes #`, leaving other `Closes ...` lines intact.

### Fix Focus Areas
- internal/scaffold/fullsend-repo/scripts/post-code.sh[451-465]
- internal/scaffold/fullsend-repo/scripts/post-code-test.sh[127-337]

### Suggested fix
- Make the legacy commit-body sanitization match the `pr_body` path by deleting all `Closes ...` lines (at minimum the cross-repo form) before assembling `COMMIT_BODY`.
- Add a regression test in `post-code-test.sh` where the commit body includes `Closes owner/repo#123` and assert it does not appear in the final body (and that the appended `Closes #<issue>` appears exactly once).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@fullsend-ai-retro

fullsend-ai-retro Bot commented Jul 8, 2026

Copy link
Copy Markdown

🤖 Finished Retro · ✅ Success · Started 2:26 PM UTC · Completed 2:32 PM UTC
Commit: 86d15e3 · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review skipped — this PR is already closed.

The /fs-review command only reviews open pull requests.

Posted by fullsend post-review check

@fullsend-ai-retro

Copy link
Copy Markdown

Retro: PR #3638 — closed without merge

PR #3638 was a human-authored PR by rh-hemartin that bundled two unrelated changes: a 3-line retro skill fix for #3617 (prohibiting "Evidence for" issue filings) and a 176-line new feature (pr_body support for the code agent). The PR was opened at 14:20 UTC and closed without merge at 14:24 UTC (~4 minutes later), before the fullsend-ai-review agent could complete its run.

Issue #3617 remains open and undelivered. The retro agent continues to file "Evidence for" issues — 354 are currently open.

Observations

  • Scope bundling caused the fix to fail delivery. The retro fix was 3 lines; the bundled pr_body feature was 176 lines across 5 files. Qodo correctly flagged the scope creep. The author likely closed the PR to split it, but no follow-up PR was created on the same day.
  • Review agent never completed. The fullsend-ai-review workflow run (28949875885) is still marked in_progress — it was overtaken by the PR closing. Relates to existing issues #1870 and #1439.
  • Retro dispatched on closed-without-merge PR. This retro run itself was dispatched on a PR that was never merged, producing analysis with limited actionable value. Relates to #2176.
  • Post-retro.sh lacks semantic title validation. The post-retro.sh script validates JSON structure and required fields but has no guard against evidence-style proposal titles. The LLM invented the "Evidence for" workaround precisely because schema validation only checks field names and types, not semantic intent.

Proposals filed

rh-hemartin added a commit to fullsend-ai/agents that referenced this pull request Jul 8, 2026
The retro agent's dedup check tells it to skip proposals covered by
existing issues, but the LLM invented a workaround: filing "Evidence
for #XXXX" issues that pass schema validation. This produced 336
noise issues in 3 days (69% of all retro output since July 5).

Add explicit prohibition to the retro-analysis skill. Evidence for
existing issues goes in the summary field (posted as a PR comment),
not as a new proposal.

Mirrors fullsend-ai/fullsend#3638.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Hector Martinez <hemartin@redhat.com>
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.

Retro agent files "Evidence for" issues instead of skipping duplicates

1 participant