Class: CoPlan::Plans::ReviewPromptFormatter

Inherits:
Object
  • Object
show all
Defined in:
app/services/coplan/plans/review_prompt_formatter.rb

Constant Summary collapse

RESPONSE_FORMAT_INSTRUCTIONS =
"You MUST respond with a JSON array of feedback items. Each item is an object with two keys:\n- \"anchor_text\": An exact substring copied verbatim from the plan document that this feedback applies to. Keep it short (a phrase or single sentence). Must match the plan text exactly. Use null for general feedback not tied to specific text.\n- \"comment\": Your feedback in Markdown. Be concise and actionable.\n\nExample response:\n```json\n[\n  {\"anchor_text\": \"API tokens scoped to a user\", \"comment\": \"Consider adding token expiration by default. Long-lived tokens without expiry are a common security risk.\"},\n  {\"anchor_text\": null, \"comment\": \"Overall the plan looks solid. One general concern: there's no mention of audit logging for administrative actions.\"}\n]\n```\n\nReturn ONLY the JSON array. No other text before or after it.\n".freeze

Class Method Summary collapse

Class Method Details

.call(reviewer_prompt:) ⇒ Object



20
21
22
# File 'app/services/coplan/plans/review_prompt_formatter.rb', line 20

def self.call(reviewer_prompt:)
  "#{reviewer_prompt}\n\n#{RESPONSE_FORMAT_INSTRUCTIONS}"
end