Visitar URL original
fix: name the caller path when file ops refuse by SebTardif · Pull Request #2725 · patchloom/patchloom · GitHub
Skip to content

fix: name the caller path when file ops refuse - #2725

Merged
SebTardif merged 8 commits into
mainfrom
fix/improve-mpi-20261105-s0739
Nov 5, 2026
Merged

SebTardif merged 8 commits into
mainfrom
fix/improve-mpi-20261105-s0739

Conversation

@SebTardif

@SebTardif SebTardif commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Library refusals name the path the caller passed, and undo no longer deletes a directory the containment check never saw.

Without a guard, file create, delete, rename, and other single-path library writes stored an absolute plan path and printed it on refusal. Creating keep.txt/child.txt when keep.txt is a file printed the absolute parent. Those files are not changed.

undo --apply checked each restored file, then removed created_dirs with no traversal or contain check. A manifest could name an outside empty directory, including through .. or a symlink, and undo deleted it. Those paths now use the same restore policy before any change. A directory the apply created inside the project is still removed.

The README and the Smithery publish script no longer link smithery.ai/servers/patchloom/patchloom, which is a 404. They point at https://smithery.ai/. Compatible patch bumps: globset 0.4.21, ignore 0.4.34, toml_edit 0.25.18, yaml-edit 0.3.6.

cargo test --lib --features cli,files names_caller_path passed (8). cargo test --lib --features cli,files created_dir passed (5). cargo test --lib --features cli,files ops::doc:: passed (527) after the lockfile bump.

file_create, file_delete, and file_rename stored an absolute plan
path when no guard was set. Refusals echoed that path. The error now
uses the path the caller passed. An existing file is not overwritten
and a directory is not deleted.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
file_create of keep.txt/child.txt, when keep.txt is a file, reported
the absolute parent directory. The refusal now names keep.txt. The
existing file is not replaced and child.txt is not created.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
github-actions[bot]
github-actions Bot previously approved these changes Nov 5, 2026
replace_text and the other single-path library writes stored an
absolute plan path and printed it on refusal. The shared engine
adapter now puts the caller spelling back when the operation names
one path. A relative binary replace leaves the file unchanged.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
github-actions[bot]
github-actions Bot previously approved these changes Nov 5, 2026
globset 0.4.21, ignore 0.4.34, toml_edit 0.25.18, and yaml-edit 0.3.6.
toml_edit pulls toml_writer 1.2.0. The doc operation tests passed.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
The README and the publish script pointed at
smithery.ai/servers/patchloom/patchloom. That page is a 404, and the
Monday link check failed on it. The directory at smithery.ai still
responds.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
github-actions[bot]
github-actions Bot previously approved these changes Nov 5, 2026
undo checked each restored file, then removed created_dirs with no
traversal or contain check. A manifest could name an outside empty
directory, including through .. or a symlink, and undo deleted it.
Those paths now use the same restore policy before any change.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
github-actions[bot]
github-actions Bot previously approved these changes Nov 5, 2026
AGENTS.md said that helper lives in tests/integration/main.rs.
That file only has path helpers. Integration tests call
patchloom::cmd::tx::execute_plan_direct, which returns (u8, String).
The library function with the same name returns the typed report.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
github-actions[bot]
github-actions Bot previously approved these changes Nov 5, 2026
@SebTardif
SebTardif marked this pull request as ready for review November 5, 2026 16:51
The caller-path rewrite replaced any substring. A patch dest of
b/foo.rs is a suffix of notb/foo.rs, so the error doubled the
absolute path and the path-component test failed. Only a whole
absolute plan path is rewritten.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@patchloom-release
patchloom-release Bot enabled auto-merge (squash) November 5, 2026 16:57
@SebTardif
SebTardif merged commit 4f82395 into main Nov 5, 2026
62 checks passed
@SebTardif
SebTardif deleted the fix/improve-mpi-20261105-s0739 branch November 5, 2026 17:21
SebTardif pushed a commit that referenced this pull request Nov 5, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.37.7](patchloom-v0.37.6...patchloom-v0.37.7)
(2026-11-05)


### Bug Fixes

* name the caller path when append refuses a binary file
([#2723](#2723))
([71e9bb0](71e9bb0)),
closes [#2720](#2720)
* name the caller path when file ops refuse
([#2725](#2725))
([4f82395](4f82395))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: patchloom-release[bot] <291219740+patchloom-release[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

1 participant