Skip to content

fix(core): authorize relative external paths#37839

Open
H-TTTTT wants to merge 1 commit into
anomalyco:devfrom
H-TTTTT:fix/patch-relative-permission
Open

fix(core): authorize relative external paths#37839
H-TTTTT wants to merge 1 commit into
anomalyco:devfrom
H-TTTTT:fix/patch-relative-permission

Conversation

@H-TTTTT

@H-TTTTT H-TTTTT commented Jul 20, 2026

Copy link
Copy Markdown

Issue for this PR

Fixes #37687

Type of change

  • Bug fix

What does this PR do?

A relative mutation path that lexically escapes the active Location (e.g. ../sibling/file) was rejected before permission evaluation, so a valid apply_patch/edit against an approved external sibling target failed with an empty durable error instead of routing through external_directory authorization.

Relative paths now resolve from the active Location, and any external target flows through the existing external_directory -> leaf approval path. The unused relative_escape reason is removed.

Ports the V2 fix (#37689) to dev.

How did you verify your code works?

  • bun test test/location-mutation.test.ts — 10 passed (the relative-escape case now asserts external_directory authorization).
  • bun run typecheck in packages/core.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Relative paths that lexically escape the active Location (e.g.
`../sibling/file`) were rejected before permission evaluation, so a
valid patch against an approved external sibling target failed with an
empty error and never reached `external_directory` authorization.

Resolve relative mutation paths from the active Location and route any
external target through the existing `external_directory` -> leaf
approval flow, matching V1 behavior. Drop the now-unused
`relative_escape` reason.

Fixes anomalyco#37687
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.

patch: relative external target skips permission and returns blank error

1 participant