Skip to content

docs(auto-sync): stage patch targets in scratch cwd for offline check - #427

Merged
thxCode merged 1 commit into
mainfrom
fix-autosync-patch-check-cwd
Nov 20, 2026
Merged

thxCode merged 1 commit into
mainfrom
fix-autosync-patch-check-cwd

Conversation

@thxCode

@thxCode thxCode commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Relates #426

PR #426 merged (e7166b1) while its inline review round was in flight, so this follow-up PR lands the post-review adjustment as a standalone commit on top of main:

  • Offline patch staging cwd: stage files fetched via mcp__github__get_file_contents at their patch-relative paths in the current working directory (fresh per-call scratch cwd) rather than $TMPDIR, ensuring git apply --check "$CANDIDATE_DIR/<patch-path>" resolves target paths directly.
  • Digest lockfile parity: refresh .auto-sync/digests.lock.json via loopwright digest sync --taskpack .auto-sync/taskpack.yaml --repo ..

Verification

  • loopwright digest sync --taskpack .auto-sync/taskpack.yaml --repo . --check --json
  • uv run bash .auto-sync/checks/validate_candidate.sh
  • uv run pytest
  • uv run mkdocs build --strict
  • uv run pre-commit run --all-files

- Stage MCP-fetched upstream files in the current scratch directory before git apply --check.
- Refresh .auto-sync/digests.lock.json for the updated .auto-sync/instructions.md SHA-256 digest.

Signed-off-by: thxCode <thxcode0824@gmail.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the auto-sync instructions to stage files in the current working directory instead of $TMPDIR when verifying patches, and updates the corresponding digest lock file. The reviewer noted that running git apply --check in a fresh, isolated directory will fail without a git repository, and suggested explicitly adding a git init step to the instructions.

Comment thread .auto-sync/instructions.md Resolved
@thxCode

thxCode commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

Review Feedback Summary

Comment Location Verdict Outcome
4641813245 (PRRT_kwDOPb01xM659arM) .auto-sync/instructions.md:110 False positive Not fixed (kept as-is, thread left open) — per git-apply(1), without --index or --cached, git apply --check operates directly on files and does not require a .git repository (verified in an isolated non-git directory for both matching and mismatched patches), so an extra git init step is unnecessary.

@thxCode
thxCode merged commit 2d5915d into main Nov 20, 2026
7 checks passed
@thxCode
thxCode deleted the fix-autosync-patch-check-cwd branch November 20, 2026 11:25
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