Skip to content

fix: self-heal stale python_site staging copy in release builds#77

Merged
LegalMarc merged 1 commit into
mainfrom
fix/auto-sync-python-site
Jul 15, 2026
Merged

fix: self-heal stale python_site staging copy in release builds#77
LegalMarc merged 1 commit into
mainfrom
fix/auto-sync-python-site

Conversation

@LegalMarc

Copy link
Copy Markdown
Owner

Summary

  • The gitignored python_site/marcut build-time staging copy used by scripts/sh/build_appstore_release.sh and scripts/sh/build_swift_only.sh could silently drift from src/python/marcut, causing confusing failures late in the release build (at the existing verify step) instead of a clear, early signal.
  • Adds an auto-sync step before the existing verify step in both scripts so the staging copy is refreshed from source before it's checked, self-healing the drift instead of failing on it.

Test plan

  • Deliberately staled the python_site/marcut copy and confirmed the new auto-sync step self-heals it before the verify step runs
  • Confirmed the existing verify step still passes after auto-sync
  • bash -n syntax-checked both scripts/sh/build_appstore_release.sh and scripts/sh/build_swift_only.sh

🤖 Generated with Claude Code

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>
@LegalMarc
LegalMarc merged commit 920c2af into main Jul 15, 2026
3 checks passed
@LegalMarc
LegalMarc deleted the fix/auto-sync-python-site branch July 15, 2026 18:41
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