Skip to content

docs: encode the newLineIfNotEmpty conversion rule in the xtend-to-java skill#1461

Merged
joaodinissf merged 1 commit into
dsldevkit:masterfrom
joaodinissf:docs/xtend-skill-newlineifnotempty-rule
Jul 13, 2026
Merged

docs: encode the newLineIfNotEmpty conversion rule in the xtend-to-java skill#1461
joaodinissf merged 1 commit into
dsldevkit:masterfrom
joaodinissf:docs/xtend-skill-newlineifnotempty-rule

Conversation

@joaodinissf

Copy link
Copy Markdown
Collaborator

Documents the source-verified StringConcatenation semantics that govern coalescing migrated append-chains into text blocks, and the conversion rule they imply.

New section rules/04-templates.md §4.8:

  • append(String) replaces embedded newlines with the builder's own delimiter — one multi-line text block is byte-equivalent to the per-line append + newLine() sequence it replaces.
  • newLineIfNotEmpty() is line-scoped and whitespace-retracting: non-whitespace on the current line → newline; empty/whitespace-only line → the trailing whitespace is deleted and no newline is added.
  • Two-arg append(value, indent) re-indents every continuation line of the value — unreproducible by text blocks for multi-line values.

The rule: newLineIfNotEmpty() → newLine() only when the line-tail is a static literal; keep it after dynamic values and after indent + conditional values; never fold two-arg appends of potentially multi-line values; leave appendImmediate loops untouched. Checklist row 35 enforces it.

Distilled from the #1429 round-3 rework, where each of these distinctions was byte-verified (executable old-vs-new harness + adversarial per-hunk review).

🤖 Generated with Claude Code

…va skill

Adds rules/04-templates.md section 4.8 documenting the source-verified
StringConcatenation semantics that govern coalescing append-chains into
text blocks: append(String) newline normalization (the formal basis for
coalescing), the line-scoped whitespace-retracting behaviour of
newLineIfNotEmpty(), and the two-arg append(value, indent) continuation
re-indent. The conversion rule: newLineIfNotEmpty() may become newLine()
only when the last append on the current line is a static non-whitespace
literal; it must stay after dynamic line-tails and after indent +
conditional values; two-arg appends of potentially multi-line values are
never folded; appendImmediate loops stay untouched. Validation checklist
gains row 35 enforcing the rule.

Distilled from the dsldevkit#1429 round-3 review rework, where these distinctions
were byte-verified against an executable harness and an adversarial
per-hunk review.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ANGM7L3BaEGfGUmPVKRt4
@joaodinissf
joaodinissf merged commit 6bf0726 into dsldevkit:master Jul 13, 2026
4 checks passed
@joaodinissf
joaodinissf deleted the docs/xtend-skill-newlineifnotempty-rule branch July 13, 2026 08:13
joaodinissf added a commit to joaodinissf/dsl-devkit that referenced this pull request Jul 15, 2026
Applies the adversarially-verified findings of the skill review (13-agent
Opus panel over the stacked dsldevkit#1453+dsldevkit#1461 state; 25 confirmed findings):

Cuts: duplicate string-decision list in 00-decisions; duplicated
commit-message fence in multi-file-batch; four known-pitfalls rows that
were verbatim checklist echoes; copyright restatements reduced to
pointers (formatting-and-commit stays canonical).

Staleness/contradictions: one-file-conversion step 8 and the checklist
final invariant now teach the two-step rename+translate scheme; stale
hard-coded rule counts dropped; overview slice branch now based on
upstream/master; import order stated once (java.* -> org.* -> com.*,
junit inside org, static block separate) and aligned in rule 11 and the
pitfalls row; == equality rule gains the primitive-operand carve-out
(enums stay object-form); rollback recipe corrected for two-step slices
(reset --hard HEAD~N / revert both shas, never -m 1) and stated once;
SKILL.md lambda cheat-sheet aligned with 07 (expression form); Pairs
guidance defers to the no-xbase.lib pitfall; dead "ledger's Method 1"
pointer removed.

Small additions: trailing-\s trap noted at point of use in 4.3;
stable-rule-ID legend in the checklist header; overview Step 0 leads
with the bash listing; examples no longer claim their whitespace WAS
verified (they illustrate; real migrations must verify) and use the
PMD-safe explicit StringBuilder capacity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ANGM7L3BaEGfGUmPVKRt4
joaodinissf added a commit that referenced this pull request Jul 16, 2026
Applies the adversarially-verified findings of the skill review (13-agent
Opus panel over the stacked #1453+#1461 state; 25 confirmed findings):

Cuts: duplicate string-decision list in 00-decisions; duplicated
commit-message fence in multi-file-batch; four known-pitfalls rows that
were verbatim checklist echoes; copyright restatements reduced to
pointers (formatting-and-commit stays canonical).

Staleness/contradictions: one-file-conversion step 8 and the checklist
final invariant now teach the two-step rename+translate scheme; stale
hard-coded rule counts dropped; overview slice branch now based on
upstream/master; import order stated once (java.* -> org.* -> com.*,
junit inside org, static block separate) and aligned in rule 11 and the
pitfalls row; == equality rule gains the primitive-operand carve-out
(enums stay object-form); rollback recipe corrected for two-step slices
(reset --hard HEAD~N / revert both shas, never -m 1) and stated once;
SKILL.md lambda cheat-sheet aligned with 07 (expression form); Pairs
guidance defers to the no-xbase.lib pitfall; dead "ledger's Method 1"
pointer removed.

Small additions: trailing-\s trap noted at point of use in 4.3;
stable-rule-ID legend in the checklist header; overview Step 0 leads
with the bash listing; examples no longer claim their whitespace WAS
verified (they illustrate; real migrations must verify) and use the
PMD-safe explicit StringBuilder capacity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018ANGM7L3BaEGfGUmPVKRt4
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