Project
Check a byte-order mark, an existing license comment and a second run so the edit neither duplicates the header nor changes the body.
Keep the first line intact. LibrePatch is a Windows AI coding workspace for discussing license-header edits against your project files, with model suggestions and the resulting code available for review.
text = source.removeprefix("\ufeff")
head, separator, body = text.partition("\n")
if head.startswith("#!"):
result = head + (separator or "\n") + update_spdx(body)
else:
result = update_spdx(source)Check a byte-order mark, an existing license comment and a second run so the edit neither duplicates the header nor changes the body.
Compare actual behavior with the expected result. If a check fails, investigate it before applying more changes.
Base URL, credentials and a reachable server.
text = source.removeprefix("\ufeff")
head, separator, body = text.partition("\n")
if head.startswith("#!"):
result = head + (separator or "\n") + update_spdx(body)
else:
result = update_spdx(source)LibrePatch provides a Windows AI coding workspace for maintenance that repeats across files but still needs careful boundaries. Start by describing which files belong in the change and which must be excluded. Ask the connected model to inspect representative examples before proposing a script or patch that touches a larger portion of the repository.
License-header maintenance illustrates the approach. An executable script may need its interpreter line preserved while an existing notice is updated. Bring the repository convention and sample files into the discussion; the model can help reason about a proposed implementation. LibrePatch does not supply legal advice or a built-in license migration system.
Review the edit on a small set containing ordinary files, already updated files and scripts with first-line requirements. Check that a second pass leaves the intended result stable, and inspect the diff for body changes. Run your project checks and relevant scripts before expanding the operation to the rest of the selected files.
For this work you may choose an uncensored AI model available through a supported OpenAI-compatible or Anthropic endpoint. Provide credentials when necessary and check its actual restrictions. The model and server set context and tool limits; choosing a model does not remove your responsibility to review a broad edit.
Use the wording approved for your repository and provide it explicitly. The coding task is to implement that instruction without disturbing source behavior. Do not treat a generated notice or model explanation as a determination of licensing obligations.
Ask for an explicit rule for recognizing an existing header, then review a second pass on the same fixtures. Compare the resulting files. A script that works once may still duplicate or progressively modify content when repeated.
Include scripts with interpreter lines, files without a final newline and files already carrying the desired notice. Also name generated or vendor directories that should be excluded. These examples reveal assumptions hidden by testing only ordinary source files.
No. The model server must run separately, and connected tools have their own destinations. Review how scans and commands execute, including any external services, before allowing sensitive source material into the maintenance conversation.
LibrePatch · Updated 2026-10-25