fix: self-heal stale python_site staging copy in release builds#77
Merged
Conversation
verify_python_repo_sync() (build_appstore_release.sh, build_swift_only.sh) compares src/python/marcut against the gitignored, local-only staging copy at src/swift/MarcutApp/Sources/MarcutApp/python_site/marcut, and hard-fails the build with "python_site source stale mismatch" if they've drifted. But nothing kept them in sync day to day -- the only sync mechanism was the `cp -R` inside build-scripts/setup_beeware_framework.sh, which only runs as part of the full one-time BeeWare framework setup, not on every source edit. Any edit to src/python/marcut/*.py without re-running the full framework setup (or manually re-copying) left the staged copy stale, and the first sign was a failed release build with no indication of the fix. Caught during the 2026-07-15 release-readiness pass. Since python_site/marcut is disposable, gitignored build output with no independent history -- src/python/marcut is always the sole source of truth -- there's no round-trip risk in re-syncing it automatically. Added sync_python_repo_into_site() and call it immediately before verify_python_repo_sync() in both scripts, turning a hard stop into a self-healing step. verify_python_repo_sync() itself is left in place as a defense-in-depth sanity check. A CI check that diffs the two trees (the originally suggested fix) doesn't work here: python_site/marcut is gitignored, so a fresh GitHub Actions checkout never has a stale copy to detect in the first place -- the drift is inherently a local-developer-machine condition. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
python_site/marcutbuild-time staging copy used byscripts/sh/build_appstore_release.shandscripts/sh/build_swift_only.shcould silently drift fromsrc/python/marcut, causing confusing failures late in the release build (at the existing verify step) instead of a clear, early signal.Test plan
python_site/marcutcopy and confirmed the new auto-sync step self-heals it before the verify step runsbash -nsyntax-checked bothscripts/sh/build_appstore_release.shandscripts/sh/build_swift_only.sh🤖 Generated with Claude Code