Skip to content

Post-merge git friction fixes: drone sync FF-only realign + sync_main_ref (no checkout), merge.md/branch-prompt corrected (merge commit not squash), deterministic spawn template registry IDs#640

Open
AIOSAI wants to merge 24 commits into
mainfrom
dev

Conversation

@AIOSAI

@AIOSAI AIOSAI commented Jun 11, 2026

Copy link
Copy Markdown
Owner

No description provided.

…), merge-not-squash docs, deterministic spawn registry
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.81818% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/aipass/drone/apps/handlers/git/sync_handler.py 77.27% 5 Missing ⚠️
src/aipass/drone/apps/modules/git_module.py 80.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

AIOSAI and others added 23 commits June 12, 2026 00:25
…ls.* (48 imports), path-depth parents[3]→[4], happy-path logger.info() central logging (DPLAN-0203 night shift). 252 tests, seedgo 100%
…72 imports/67 files) + path-depth + 4 bug fixes, add E501/CLI/Windows_Compat cleanup + happy-path logger.info() central logging (DPLAN-0203 night shift). 449 tests, seedgo 100%
… 6 stale @vera refs, add happy-path logger.info() central logging, fix Ruff/Introspection/Windows_Compat/Handler_Import/Imports (DPLAN-0203 night shift). 387 tests, seedgo 100%. Scheduler .daemon/ redesign deferred to DPLAN-0204
… parents[4]->[3], fill branch prompt, archive stray upgrade/ to .archive, Handler_Import + happy-path central logging (DPLAN-0203 night shift). CLI runs clean. seedgo 92%: structural gaps (Diagnostics=standalone sys.path/pyright, Test_Quality=no test suite) flagged for Patrick, not forced overnight
…en — convert 47 internal imports across 11 files (apps.* -> aipass.backup.apps.*), fix importlib discovery string, drop sys.path/PROJECT_ROOT hack, add root __init__.py package marker. Diagnostics 0%->100%, Imports 99%->100%, overall 92%->95% (S220). Verified-by-artifact: all 10 drone cmds live, register+status e2e clean, ruff clean, zero standalone imports. Test_Quality (no suite) stays separate build (td-018)
…backup --help now shows a curated Rich command reference (boxed header + USAGE + COMMANDS), bare drone @backup shows the discovered-modules self-map. Previously both fell through to one conflated module-list block. Also revives the dead print_introspection() (was unused). Matches the commons/skills citizen pattern. ruff clean, both paths verified live (S220)
… backup_timestamps state handler + display.py 5-stage pipeline (last_backups panel -> boxed header -> live Rich progress bar -> result summary -> backups_now panel), extend BackupResult with files_checked/files_skipped/backup_path, emit on_progress callbacks from copy/snapshot+versioned, rewire snapshot/versioned/all to the rich pipeline. Faithful port from gold archive source. Verified live under pty: full color + animated transient progress bar. seedgo 95%, ruff clean.
…up' to INTERACTIVE_BRANCHES so snapshot/versioned/all inherit the TTY instead of capture_output=True. Drone was flattening backup's Rich output (non-TTY -> color stripped, transient progress bar rendered to nothing) and the 30s capture timeout would kill large backups. Mirrors the existing 'cli' entry. Verified live: full rich output now flows through drone. + CHANGELOG.
…storation Phase 1)

Safety net under backup before the feature rebuild (master FPLAN-0264 Phase 1).
No new features — harness + standards only.

Tests (new src/aipass/backup/tests/): 94 tests across json_handler, CLI routing,
filesystem handlers, error resilience, mocked drive — ported from the canonical
citizen conftest pattern (autouse mock_infrastructure, env log-redirect, tmp_path).
Hermetic + stdlib-only (passes 3.10-3.13), ruff clean. Module coverage 27%.

Standards to 100% (all 35): shared --help/-h/help guard in all 10 modules'
handle_command (Cli 92->100, Introspection 86->100); 6 Phase-3 drive/diff/ui
stubs wired-or-bypassed (Dead_Code 82->100, Unused_Function 81->100);
requirements.project.txt (Architecture); README module list (Readme 87->100);
display.handle_command no-op (Modules); create_progress_bar->build_progress_bar
(Trigger). Overall 95->100.

Verified by artifact (devpulse): seedgo audit 100% + pytest 94 passed + ruff clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…on Phase 2)

Restore the snapshot-side machinery the 2026-04-23 rewrite degraded, ported from
the GOLD archive onto the current per-project handlers.

- handlers/cleanup/mirror.py cleanup_deleted_files: exception-aware mirror-delete
  (vanished source files are removed from the snapshot, respecting ignore
  exceptions) — replaces the blind rmtree+recopy.
- copy/snapshot.py: mtime-skip quick-check (unchanged files no longer re-copied),
  long-path guard (>260), read-only handling.
- report/result.py BackupResult: critical vs non-critical errors + warnings +
  files_deleted + success.
- ignore/patterns.py: IGNORE_EXCEPTIONS + is_exception().
- modules/snapshot.py: quick-check fast path.
- +16 tests (test_snapshot_fidelity.py) -> 110 total.

Verified by artifact (devpulse): seedgo audit 100%, pytest 110 passed, ruff clean,
AND a live throwaway-project test — deleted two source files, re-snapshotted, both
mirror-deleted, kept files preserved, 3 skipped/0 re-copied (quick-check working).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…(restoration Phase 3, the heart)

Faithful port of the GOLD versioned engine (no reinvention). Replaces the mtime
full-copy-into-per-run-dirs remnant with ONE persistent store
(.backup_system/versioned/) using GOLD's file-folder packaging:

  <parent>/<name>/<name>                       current (copy2, mtime preserved)
  <parent>/<name>/<stem>-baseline-<date>.<ext> first-run full copy, never touched
  <parent>/<name>/<name>_diffs/<name>_v<old-mtime>.diff  unified-diff per change

Patrick's laws, all enforced + tested:
- versioned backs up the EXACT same files as snapshot (same scan/ignore;
  all.py shares one scan between modes)
- first versioned run = baseline snapshot of that state
- append-only: versioned NEVER deletes (cleanup stays snapshot-only)
- change detection is LEDGER-FREE (source mtime vs store-current mtime) —
  removes versioned's use of shared timestamps.json, killing the
  snapshot-starves-versioned regression

New diff/restore.py (list_versions + restore_file); diff/generator.py wired
(binary detection, DIFF include/ignore patterns); path/builder.py file-folder
versioned branch (root/ wrap, >50-char hash shortening). +15 tests -> 125.

Verified by artifact (audit 100% all 36, pytest 125, ruff clean) + LIVE
end-to-end: snapshot-first-then-versioned baselines all 5 files (starvation
dead) -> edit -> diff with old-mtime timestamp + current overwritten + baseline
intact -> source delete -> versioned store untouched while snapshot
mirror-deletes -> restore round-trip byte-identical.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…nd (restoration Phase 4, final)

Faithful port of GOLD's GoogleDriveSync against the live @api gateway. Completes
the backup restoration (master FPLAN-0264).

Drive pipeline (handlers/drive/):
- DriveClient: folder hierarchy 'AIPass Backups/<project>/', thread-safe cache,
  retry-with-rebuild. Auth via aipass.api get_drive_service + api_call_with_retry
  (never console-OAuth).
- upload.py: resumable MediaFileUpload, 3 threaded workers, single + batch.
- tracker.py: mtime+size dedup (.backup_system/drive_tracker.json) — no re-upload
  of unchanged files.
- test.py: connectivity check.
All 4 drive_* modules un-stubbed. all = snapshot->versioned->drive-sync, drive
step FAILS HONESTLY if creds absent (no silent skip, snapshot+versioned still run).

restore command (modules/restore.py -> handlers/diff/restore.py):
- 'restore <project> list <file>'  (baseline + current + diffs)
- 'restore <project> file <file> <out>'  (reconstruct + write)

pyright/cleanup (Patrick's call): removed backup's standalone pyrightconfig.json
(pre-namespace leftover, archived) so it inherits the repo-root config like every
citizen; dead PyQt5 ui/settings_window.py archived.

Drive tests fully mocked — ZERO real Google calls in CI. Live Drive upload awaits
Google OAuth creds (~/.secrets/aipass/google_client_secret.json + drone @api
reauth google) — Patrick's setup step.

Verified by artifact (devpulse): seedgo 100% all 36 standards / 37 files, 187
tests, ruff clean; restore list/file round-trip confirmed live.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… restore pre-trim backup on empty-embeddings path + honor skipped-extraction flag to close the concurrent-rollover race (orchestrator.py + extractor.py, +4 tests). Verified by artifact (seedgo 100%, 876 tests) + live (drone @memory search returns a rolled-off item at 91%)
…OLD's lock scope (whole-method _folder_cache_lock on project/nested folders, lock-free backup-folder short-circuit, guarded tracker reset). Fix drive_* underscore command routing + declare 3 google libs. Verified by artifact (seedgo 100%, 197 tests incl. 5-thread concurrency) + live (real Drive backup, no duplicate folders)
…'the other branches' / 'drone systems' for the live list) + sync AGENTS.md startup protocol to match CLAUDE.md (dashboard-refresh flow)
…urce of truth + Drive stops dropping dotfiles (FPLAN-0269)

Replace hand-rolled fnmatch+part-loop matcher with pathspec gitwildmatch (leading-slash anchoring, !negation, dir-only foo/, *-not-crossing-/, last-match-wins). Demote BUILTIN_IGNORES to a seed-only default (written when absent, never merged at runtime); delete IGNORE_EXCEPTIONS/is_exception (exceptions are native ! lines). snapshot+versioned+all+mirror-cleanup all obey one .backupignore. Remove the drive_sync dotfile-skip so .trinity/.chroma/.aipass/.ai_mail.local (4558 files incl memories) now reach Drive. Add a Drive-sync output panel matching snapshot/versioned. Declare pathspec (pure-python, cross-OS). Verified by artifact (seedgo 100%, 220 tests incl 26 new gitignore-parity) + live (dotfile flows into store, !negation re-includes end-to-end).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e of truth now (FPLAN-0269 follow-up)

.backupignore is now AIPass's managed backup filter (true gitignore semantics via pathspec), so it belongs in version control like .gitignore — a fresh clone gets the curated rules, not just the auto-seed default. Includes the .ruff_cache/ + .coverage additions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… versions/ (FPLAN-0269 follow-up)

Backup root is now .backup/ via BACKUP_DIR (builder.py:19); tracker.py uses backup_root() not a hardcoded path; patterns.py BUILTIN_IGNORES + docstrings/README updated. Removed the orphaned per-timestamp versions/ scaffold (setup.py) and unused build_versioned_path() — both superseded by the Phase-3 versioned/ baseline+diff store. .backup/ coexists with flow's .backup/processed_plans/. Repo-root .backupignore now ignores both .backup/ and (until manual deletion) .backup_system/ (also carries Patrick's *logs rule). Verified by artifact (seedgo 100%, 220 tests) + live (throwaway writes to .backup/, no versions/, Drive reads .backup/versioned/).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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