Minimal diff format and robust edit applier for LLM-driven code editing
Project description
lcea
lcea is the short name for the project formerly called llm-code-edit-applier.
The shorter name is used for the package and CLI command so it is easier to type and remember.
This project provides:
- a minimal diff-like edit format for LLM output
- a prompt template that constrains model output to that format
- a robust applier that parses, validates, and applies edits to a workspace
Minimal edit format
Each edit targets one file and uses a single fenced block:
path/to/file.py
```edit
<<<<<<< SEARCH
old text
=======
new text
>>>>>>> REPLACE
Rules:
- The line before the fenced block is the relative file path.
- Fence info string must be `edit`.
- `SEARCH` is matched literally.
- `REPLACE` is the replacement text.
- Empty `SEARCH` means create at file start when the file already exists, or create a new file.
- Empty `REPLACE` means delete the matched text.
- A `SEARCH` block must match exactly once in the target file unless `SEARCH` is empty.
## Prompt template
See `src/llm_edit_applier/prompts.md`.
## Run tests
```bash
python -m pytest
CLI
After installation:
lcea spec
lcea prompt
lcea apply edits.txt --root .
cat edits.txt | lcea apply --root .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lcea-0.1.0.tar.gz.
File metadata
- Download URL: lcea-0.1.0.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2af388e33c0a90d05c17dd54366e1eb2bf0fd2378f90fb1803bcdb825e597fad
|
|
| MD5 |
33117971fc8450e6d3efbfea95033aaf
|
|
| BLAKE2b-256 |
5ac889bd087aa0a0b5ffeef28523df7ebe49d14f2577261d38bfe8a6ceb3fdd0
|
Provenance
The following attestation bundles were made for lcea-0.1.0.tar.gz:
Publisher:
publish.yml on TingjiaInFuture/lcea
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lcea-0.1.0.tar.gz -
Subject digest:
2af388e33c0a90d05c17dd54366e1eb2bf0fd2378f90fb1803bcdb825e597fad - Sigstore transparency entry: 1066601946
- Sigstore integration time:
-
Permalink:
TingjiaInFuture/lcea@a30a3ae64feab0d0022367024f509040f7442a39 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/TingjiaInFuture
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a30a3ae64feab0d0022367024f509040f7442a39 -
Trigger Event:
release
-
Statement type:
File details
Details for the file lcea-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lcea-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a913a374611d18c346380adba334f3c713cd805bcdc4364b2a37d4ff85e5d89
|
|
| MD5 |
5ed33142dcc75350f459bdf9b6e9160c
|
|
| BLAKE2b-256 |
aa5715489632b37ffd9b62180c09f22a2280ac5dee4cfa9c07bdb00639de61c2
|
Provenance
The following attestation bundles were made for lcea-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on TingjiaInFuture/lcea
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lcea-0.1.0-py3-none-any.whl -
Subject digest:
9a913a374611d18c346380adba334f3c713cd805bcdc4364b2a37d4ff85e5d89 - Sigstore transparency entry: 1066601948
- Sigstore integration time:
-
Permalink:
TingjiaInFuture/lcea@a30a3ae64feab0d0022367024f509040f7442a39 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/TingjiaInFuture
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a30a3ae64feab0d0022367024f509040f7442a39 -
Trigger Event:
release
-
Statement type: