Skip to content

feat: require ! prefix for revision comments, ignore unprefixed#75

Open
eshulman2 wants to merge 2 commits into
mainfrom
feat/revision-prefix
Open

feat: require ! prefix for revision comments, ignore unprefixed#75
eshulman2 wants to merge 2 commits into
mainfrom
feat/revision-prefix

Conversation

@eshulman2
Copy link
Copy Markdown
Collaborator

@eshulman2 eshulman2 commented Jun 7, 2026

Summary

Revision prefix for comments

Previously, any Jira comment that wasn't a question (? prefix) would trigger artifact regeneration — meaning users couldn't post informational comments ("looks good", "FYI for the team") without accidentally kicking off a revision cycle.

Now comments require an explicit ! prefix to trigger revisions. Unprefixed comments are treated as informational and ignored by the workflow.

Prefix Effect
! Revision request — triggers regeneration with feedback
? or @forge ask Question — triggers Q&A answer
>option N RCA option selection (RCA Option Gate only)
(no prefix) Informational — workflow ignores it

Fix: PRD section loss during revision

_strip_preamble used text.find("\n#") which matched any \n# anywhere — including #1 in numbered lists or heading-like patterns in agent narration. This could strip actual document content (e.g., the Executive Summary section was being silently dropped after revisions).

Fixed by:

  • Making _strip_preamble only match proper headings (# , ## , ### with a space) within the first 5 lines
  • Updating the regenerate prompt to explicitly require preserving ALL sections from the original document

Test plan

  • Post !Fix the auth section on a paused approval gate — verify regeneration triggers
  • Post ?Why REST? on a paused gate — verify Q&A answer is posted
  • Post Looks good, thanks on a paused gate — verify workflow stays paused (no regeneration)
  • Post >option 2 at RCA option gate — verify option selection still works
  • Trigger a PRD revision — verify all sections (including Executive Summary) are preserved
  • 932 unit tests pass

🤖 Generated with Claude Code

Users can now post informational comments (e.g. "looks good", "FYI")
without triggering artifact regeneration. Only comments prefixed with
! are treated as revision requests.

Comment syntax:
- !  → revision (triggers regeneration)
- ?  → question (triggers Q&A)
- >option N → RCA option selection
- (no prefix) → informational (ignored)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ekuris-redhat
Copy link
Copy Markdown
Collaborator

ekuris-redhat commented Jun 8, 2026

I've tested the PR and can confirm that I am reproducing the exact issue with the executive summary disappearing.
https://redhat.atlassian.net/browse/AISOS-886

The previous implementation used text.find("\n#") which matched any
\n# anywhere — including #1 in numbered lists or heading-like patterns
in agent narration. This could strip actual document content like the
Executive Summary.

Now only looks within the first 10 lines and requires proper heading
format (# or ## followed by a space).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@eshulman2 eshulman2 force-pushed the feat/revision-prefix branch from 7e8c304 to fce0cb1 Compare June 8, 2026 12:00
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.

2 participants