Skip to content

fix(backup): exclude swiftui-docs (Apple IP) from backup zip - #115

Merged
Kyzcreig merged 3 commits into
mainfrom
fix/backup-exclude-swiftui-docs
Jun 29, 2026
Merged

Kyzcreig merged 3 commits into
mainfrom
fix/backup-exclude-swiftui-docs

Conversation

@Kyzcreig

Copy link
Copy Markdown
Collaborator

What

Adds swiftui-docs to _EXCLUDED_DIRS in hermes_cli/backup.py so Apple's Xcode AdditionalDocumentation can never enter the backup zip.

Why

hermes backup zips the whole HERMES_HOME and does not honor .gitignore (hardcoded exclude set). The new skills-shared/mobile-design/swiftui-skills skill reads Apple's docs in-place from a live Xcode.app and never copies them (Apple IP) — but this is belt-and-suspenders so a stray copy under a swiftui-docs/ dir can't leak Apple IP into the offsite backup.

Test

tests/hermes_cli/test_backup.py::...::test_excludes_swiftui_docs — asserts the exclude fires on swiftui-docs/* and that a normal SKILL.md in the same skill is NOT excluded. Full backup-exclude suite: 18 passed.

The fleet backup (hermes backup) zips the whole HERMES_HOME and does NOT honor .gitignore — it
uses a hardcoded _EXCLUDED_DIRS set. The mobile-design/swiftui-skills skill reads Apple's
AdditionalDocumentation IN-PLACE from a live Xcode.app and never copies it (Apple IP), but this
adds a belt-and-suspenders exclude so a stray copy under a swiftui-docs/ dir can never enter the
backup. Test asserts the exclude fires and that a normal SKILL.md in the same skill is NOT excluded.
@github-actions

github-actions Bot commented Jun 27, 2026 •

Copy link
Copy Markdown

🔎 Lint report: fix/backup-exclude-swiftui-docs vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 11083 on HEAD, 11083 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5780 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@greptile-apps

greptile-apps Bot commented Jun 27, 2026 •

Copy link
Copy Markdown

Greptile Summary

This PR scopes the SwiftUI docs backup exclusion. The main changes are:

  • Adds a parent/child exclusion for swiftui-skills/swiftui-docs.
  • Applies that exclusion inside _should_exclude.
  • Adds tests for the intended docs path and unrelated bare swiftui-docs folders.

Confidence Score: 4/5

This is close, but the backup exclusion can still omit unrelated user files.

  • The new check matches swiftui-skills/swiftui-docs at any depth under HERMES_HOME.
  • A normal workspace with those adjacent folder names can be skipped from the backup.
  • The tests do not cover that same adjacent-name case outside the intended skill path.

hermes_cli/backup.py

Important Files Changed

Filename Overview
hermes_cli/backup.py Adds the scoped backup exclusion, but the matcher can still drop unrelated user paths with the same adjacent folder names.
tests/hermes_cli/test_backup.py Adds tests for the intended docs exclusion and unrelated bare swiftui-docs folders.

Reviews (3): Last reviewed commit: "fix(backup): scope swiftui-docs exclude ..." | Re-trigger Greptile

Comment thread hermes_cli/backup.py Outdated
Kyzcreig and others added 2 commits June 29, 2026 10:32
The first cut added swiftui-docs to _EXCLUDED_DIRS, which prunes a dir of that name
at ANY depth — so a user's coincidental swiftui-docs/ dir would be silently dropped
from the backup. Replace with a path-anchored _EXCLUDED_PARENT_CHILD check that only
prunes swiftui-docs when it's a direct child of swiftui-skills/. Test now asserts both
the scoped match AND that a stray swiftui-docs elsewhere is preserved.
@Kyzcreig

Copy link
Copy Markdown
Collaborator Author

Good catch — fixed in 3841c27. Replaced the bare-name swiftui-docs entry in _EXCLUDED_DIRS (which pruned that leaf name at any depth) with a path-anchored _EXCLUDED_PARENT_CHILD rule that only matches swiftui-docs when it's a direct child of swiftui-skills/. A coincidental user dir named swiftui-docs anywhere else is now preserved. Added assertions covering both the scoped match and the stray-dir-preserved case (workspace/my-notes/swiftui-docs/... is NOT excluded).

@Kyzcreig
Kyzcreig merged commit d6bd86d into main Jun 29, 2026
37 checks passed
@Kyzcreig
Kyzcreig deleted the fix/backup-exclude-swiftui-docs branch June 29, 2026 17:46
Comment thread hermes_cli/backup.py
Comment on lines +128 to +129
for i in range(len(parts) - 1):
if parts[i] == parent and parts[i + 1] == child:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Still Matches User Paths
The exclusion is still based on adjacent directory names anywhere under HERMES_HOME. A user workspace such as workspace/research/swiftui-skills/swiftui-docs/notes.md matches this loop even though it is not the Apple documentation directory, so those files are silently left out of the backup. Anchor the check to the full intended relative path under skills-shared/mobile-design/swiftui-skills/swiftui-docs so unrelated workspaces with the same folder names are preserved.

@Kyzcreig
Kyzcreig restored the fix/backup-exclude-swiftui-docs branch September 21, 2026 10:32
Kyzcreig added a commit that referenced this pull request Sep 25, 2026
… 3 premises re-checked (t_2a1bd9cd)

#115 DROP->KEEP (swiftui-skills skill is live), #215/#441 DROP->UNRESOLVED
(tui_gateway/ws.py still consumes the gate; dashboard live), nopr:8a8b81638c
UPSTREAM->UNRESOLVED (leak needs the fork-only auto-attach detector).
Branches: 5 revert branches built + targeted pytest green; upstream-617 and
upstream-466 hand-ported onto upstream/main with tests green.
Kyzcreig pushed a commit that referenced this pull request Sep 28, 2026
ang-fleet-workers Bot added a commit that referenced this pull request Sep 28, 2026
ang-fleet-workers Bot added a commit that referenced this pull request Sep 28, 2026
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