Skip to content

fix(playbook): collapse blank lines around issue context partials#96

Merged
chihsuan merged 1 commit into
mainfrom
fix/workflow-preview-blank-lines
May 27, 2026
Merged

fix(playbook): collapse blank lines around issue context partials#96
chihsuan merged 1 commit into
mainfrom
fix/workflow-preview-blank-lines

Conversation

@chihsuan
Copy link
Copy Markdown
Member

Context

symphony workflow preview rendered a stack of blank lines around the issue-context block whenever optional sections (description, comments, links, retry context) were empty, making the prompt harder to scan.

TL;DR

Use Liquid whitespace control so empty issue-context sections collapse instead of leaving stray blank lines.

Summary

  • Inline the issue description directly after Description: so there is no blank line between the label and the body.
  • Trim the Recent comments and Linked issues {% if %} blocks with {%-/-%} so they emit nothing when empty.
  • Render continuation_context to an empty string when no retry attempt is set, instead of leaking surrounding newlines.

Alternatives

  • Leave the blanks as-is: rejected, the rendered prompt is what the agent and authors read, so readability matters.
  • Strip blank lines in the renderer post-pass: rejected, it would also collapse intentional spacing elsewhere; fixing the templates is targeted and idiomatic.

Test Plan

  • make all
  • mix test test/symphony_elixir/workflow_preview_test.exs test/symphony_elixir/prompt_builder_test.exs test/symphony_elixir/quality_gate/prompt_test.exs (+ core prompt cases) — green
  • symphony workflow preview before/after: blank line after Description: gone; trailing gap cut from 6 blank lines to 1

Summary:
- Inline the issue description right after "Description:" and trim the
  empty "Recent comments"/"Linked issues" if-blocks with {%-/-%} so they
  emit nothing instead of stray blank lines.
- Make continuation_context render to an empty string when no attempt is
  set, instead of leaking surrounding newlines.

Rationale:
- Liquid tags on their own lines preserve their trailing newline, so the
  unguarded if/for blocks left several blank lines in the rendered prompt
  whenever optional sections (comments, links, retry context) were empty.
  Whitespace control keeps the source readable while collapsing the gaps.

Tests:
- mix test test/symphony_elixir/workflow_preview_test.exs
  test/symphony_elixir/prompt_builder_test.exs
  test/symphony_elixir/quality_gate/prompt_test.exs (+ core prompt cases)
@chihsuan chihsuan merged commit a6f8e08 into main May 27, 2026
10 checks passed
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