Skip to content

fix(agent_writer): normalize missing trailing newline before child splice (#72)#74

Merged
MarcoPorcellato merged 1 commit into
mainfrom
fix/72-append-child-newline
Jun 29, 2026
Merged

fix(agent_writer): normalize missing trailing newline before child splice (#72)#74
MarcoPorcellato merged 1 commit into
mainfrom
fix/72-append-child-newline

Conversation

@MarcoPorcellato

Copy link
Copy Markdown
Owner

Summary

  • Normalize source Markdown in append_child_to_node when the file lacks a final newline, so agent-write inserts a new child on its own line instead of concatenating onto the last row.
  • Add regression test test_append_child_to_node_without_trailing_source_newline.
  • Document splice behavior in docs/ARCHITECTURE.md §3.4.

Closes #72

Test plan

  • make all (Ruff, Mypy, pytest)
  • New test covers file without trailing \n on last line

Made with Cursor

…lice

Prevents agent-write from appending a new bullet onto the last source line
when the on-disk Markdown file lacks a final newline.

Closes #72

Co-authored-by: Cursor <cursoragent@cursor.com>
@MarcoPorcellato MarcoPorcellato merged commit fe4101c into main Jun 29, 2026
6 checks passed
@MarcoPorcellato MarcoPorcellato deleted the fix/72-append-child-newline branch June 29, 2026 17:21
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.

fix(agent_writer): append_child corrupts markdown when source file lacks trailing newline

1 participant