Draft: Use Cursor AI to convert everything to Semantic Line Breaks #1492

Open
churchyard wants to merge 1 commit from sembr into main
Owner

Using the claude-4-sonnet-1m model.

Prompt:

Get familiar with the Semantic Line Braks principle @https://sembr.org/

For every adoc document in the project, perform the following 2 steps:

  1. remove all the nonsemantic line wraps
  2. add new line breaks as defined by @https://sembr.org/

Never change any code examples within the documents, only prose.

You must not ever change anything else than newlines and spaces.
Particularly, do not replace any other characters, such as apostrophes or quotes.

As the AI created a regex based Python script to break lines after certain characters, I followed with:

Go trough all the adoc files once again and manually inspect them for correctness,
adding more semantic newlines where the script did not do that.

Then I used git diff --word-diff to locate some undesired changes in apostrophes and quotes
(the AI insisted on replacing the Unicode ones with ASCII ones, but only in some of the files).

The overall diff is quite horrible to review.
I propose this as is for consideration, but it was not yet completely reviewed by me.
Overall, I think this is not worth it.

Using the claude-4-sonnet-1m model. Prompt: > Get familiar with the Semantic Line Braks principle @https://sembr.org/ > > For every adoc document in the project, perform the following 2 steps: > > 1. remove all the nonsemantic line wraps > 2. add new line breaks as defined by @https://sembr.org/ > > Never change any code examples within the documents, only prose. > > You must not ever change anything else than newlines and spaces. > Particularly, do not replace any other characters, such as apostrophes or quotes. As the AI created a regex based Python script to break lines after certain characters, I followed with: > Go trough all the adoc files once again and manually inspect them for correctness, > adding more semantic newlines where the script did not do that. Then I used `git diff --word-diff` to locate some undesired changes in apostrophes and quotes (the AI insisted on replacing the Unicode ones with ASCII ones, but only in some of the files). The overall diff is quite horrible to review. I propose this as is for consideration, but it was not yet completely reviewed by me. Overall, I think this is not worth it.
Author
Owner

rebased onto a612abd622

rebased onto a612abd62278c5a86aa112fa6ffa09fa94d27d7b
Author
Owner

rebased onto a612abd622

rebased onto a612abd62278c5a86aa112fa6ffa09fa94d27d7b
Owner

Hm ... it looks like in some cases like here, it even converted stuff that was already SemBR back into really long lines? (and also introduced other formatting changes that don't look like valid AsciiDoc any longer)?

Hm ... it looks like in some cases like here, it even converted stuff that was *already* SemBR back into really long lines? (and also introduced other formatting changes that don't look like valid AsciiDoc any longer)?
Owner

Yeah this doesn't seem great.

At least limit it to the files which haven't already been converted. But even then, I don't have a lot of confidence that this approach is reasonable. We'd be far better off with just breaking lines after sentences because that's at least half the job.

Yeah this doesn't seem great. At least limit it to the files which haven't already been converted. But even then, I don't have a lot of confidence that this approach is reasonable. We'd be far better off with just breaking lines after sentences because that's at least half the job.
Owner

Can you please hold off on converting the Golang pages? I'm working on updating them, and this will create conflicts.

Can you please hold off on converting the Golang pages? I'm working on updating them, and this will create conflicts.
Author
Owner

Can you please hold off on converting the Golang pages? I'm working on updating them, and this will create conflicts.

Don't worry, we are probably not going to merge this anyway.

> Can you please hold off on converting the Golang pages? I'm working on updating them, and this will create conflicts. Don't worry, we are probably not going to merge this anyway.
Author
Owner

rebased onto a612abd622

rebased onto a612abd62278c5a86aa112fa6ffa09fa94d27d7b
Author
Owner

I have changed the model and continued adding more and more instructions until it kinda made sense. The changes look mostly good to me.

(If we want this, I can exclude the Golang pages from the commit.)

Todo fixes identified by the AI that I manually removed to limit the scope:

  • Lua: sufficient**.** e.g.
  • JavaScript: Bundling Guidelines**.** MUST still be followed.
  • Node.js: Additional Provides: bundled() line is added for e (missing end of the sentence)
I have changed the model and continued adding more and more instructions until it kinda made sense. The changes look mostly good to me. (If we want this, I can exclude the Golang pages from the commit.) Todo fixes identified by the AI that I manually removed to limit the scope: - Lua: sufficient**.** e.g. - JavaScript: Bundling Guidelines**.** MUST still be followed. - Node.js: Additional Provides: bundled() line is added for e (missing end of the sentence)
Owner

It doesn't look terrible now ... but it's a lot and some of the changes seem random.

Would probably be much happier if it was limited just splitting lines that were over 100 characters or something.

It doesn't look terrible now ... but it's a lot and some of the changes seem random. Would probably be much happier if it was limited just splitting lines that were over 100 characters or something.
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin sembr:sembr
git switch sembr

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff sembr
git switch sembr
git rebase main
git switch main
git merge --ff-only sembr
git switch sembr
git rebase main
git switch main
git merge --no-ff sembr
git switch main
git merge --squash sembr
git switch main
git merge --ff-only sembr
git switch main
git merge sembr
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
packaging/guidelines!1492
No description provided.