Appearance
Specification: Bodybuilding - Zoro Sync (Z2 Orchestrated)
Owner: Zoro (fitness) + Jimmy Neutron (infrastructure) Status: DESIGNED — pending Z2 container deployment Source file: /Users/nnamdi/Library/CloudStorage/OneDrive-Personal/hinata-onedrive/Bodybuilding - Zoro Sync.xlsx
Architecture: Z2-Orchestrated Excel Reconciliation
OneDrive syncs the Excel tracker between phone and Mac. Z2 orchestrates the reconciliation pipeline — no Mac dependency at runtime.
Pipeline
┌─────────────────────────────────┐
│ Phone (OneDrive app) │
│ Michael logs session in Excel │
└──────────────┬──────────────────┘
│ (OneDrive sync)
▼
┌─────────────────────────────────┐
│ Mac (CloudStorage mount) │
│ ~/Library/CloudStorage/ │
│ OneDrive-Personal/ │
│ hinata-onedrive/ │
│ Bodybuilding - Zoro Sync.xlsx │
└──────────────┬──────────────────┘
│ (NFS or rsync to Z2)
▼
┌─────────────────────────────────┐
│ Z2 — zoro-sync container │
│ 1. Detect file change │
│ 2. reconcile_gym_data.py │
│ 3. Emit fitness.session_logged │
│ 4. Append reconciled data │
└────────────────────────────��────┘Data flow
- Michael logs a gym session in Excel on phone (OneDrive)
- OneDrive syncs
Bodybuilding - Zoro Sync.xlsxto Mac CloudStorage mount - Z2 (zoro-sync container) detects the file change via periodic poll or NFS watch
- reconcile_gym_data.py runs:
- Loads Excel (Input tab,
GymDatatable) - Loads Apple Health data (CSV from
parse-apple-health.pyif available) - Applies reconciliation rules (see below)
- Appends reconciled rows back to Excel
- Loads Excel (Input tab,
- Event emitted:
fitness.session_logged→ ct100 PostgreSQL events table - Optional:
fitness.pr_setif a personal record detected
Reconciliation rules (deterministic)
| Field | Priority source | Reason |
|---|---|---|
| Weight | Apple Health (auto) | Scale auto-reports |
| RPE / Intensity | Excel (manual) | Subjective — only Michael knows |
| Sets / Reps | Excel (manual) | Apple Watch doesn't track rep counts |
| Date | Excel (manual) | Session date as logged |
| Exercise name | Excel (manual) | Canonical exercise taxonomy |
Prerequisites
- [ ]
Bodybuilding - Zoro Sync.xlsxformatted as Excel Table namedGymData - [ ] Column mapping defined (Excel ↔ Apple Health)
- [ ] Z2
zoro-synccontainer deployed (Debian 12 LXC, Python 3.11, openpyxl, pandas) - [ ] NFS mount or rsync from Mac OneDrive → Z2 working
- [ ]
update-bodybuilding.pyported to Z2 container (currently referenced in event-kinds)
Z2 container spec (zoro-sync)
yaml
container: zoro-sync
type: LXC (Debian 12)
dependencies: python3.11, openpyxl, pandas
mount: /mnt/onedrive (NFS from Mac CloudStorage or rsync target)
scripts:
- reconcile_gym_data.py # Core reconciliation logic
- update-bodybuilding.py # Event emission to ct100 postgres
cron: "*/15 * * * *" # Check for file changes every 15 min
events_emitted:
- fitness.session_logged
- fitness.pr_set
repo: hinata-z2 (zoro-sync/ folder)Tool signature
python
def reconcile_and_append(manual_df, auto_df, rules):
"""
1. Merge manual_df and auto_df on 'Date'.
2. Apply conflict rules (weight_final = auto_weight if exists).
3. Append resulting rows to Excel 'GymData' table via openpyxl.
"""See also: supreme-court/runtime/event-kinds · reference_approved-ip-addresses · federation/colonel_saitama-foundation_zoro-fitness_context