Skip to content

Clarify symlink behavior for repository file writes - #3071

Draft
theinfosecguy wants to merge 1 commit into
github:mainfrom
theinfosecguy:fix-symlink-file-write-safety
Draft

Clarify symlink behavior for repository file writes#3071
theinfosecguy wants to merge 1 commit into
github:mainfrom
theinfosecguy:fix-symlink-file-write-safety

Conversation

@theinfosecguy

Copy link
Copy Markdown

Summary

Clarifies that get_file_contents may follow a symbolic link while repository file writes operate on exact Git paths. Adds guidance for distinguishing updates to linked content from changes to the link itself.

Why

Fixes #2997.

A read can return the linked file's contents, but writing to the same path can rewrite or replace the symbolic link. The existing tool guidance did not explain this difference.

What changed

  • Added repository-level guidance describing the read/write mismatch.
  • Added exact-path behavior to create_or_update_file.path and push_files.files[].path.
  • Added regression coverage for instruction routing and both write behaviors.
  • Updated tool snapshots and generated documentation.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added

Only descriptions and server instructions changed. Input shapes, handlers, and API call sequences remain unchanged.

Prompts tested (tool changes only)

  • Not applicable. This changes safety guidance rather than runtime behavior. MCP initialization, tools/list output, and the existing handler workflows were verified locally.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

No authentication, permission, data exposure, or resource-limit behavior changed.

Tool renaming

  • I am renaming tools as part of this PR
  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Additional validation included tool snapshot tests, repeated race-enabled edge-case tests, and git diff --check.

Docs

  • Not needed
  • Updated (README / docs / examples)

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.

Symlink corruption: get_file_contents follows symlinks but create_or_update_file does not

1 participant