{"definition_raw":"---\nid: git-sync\ntitle: Sync PKA repo with GitHub\nschedule: \"0 * * * *\"\ntimeout: 300\nretry: false\nenabled: true\nnotify_on: failure\nrun_as: shell\ncommand: \"cd /home/lucienne/workspace/PKA && G='ssh -i /home/lucienne/.ssh/id_ed25519_pka -o IdentitiesOnly=yes -o ConnectTimeout=20 -o ServerAliveInterval=10 -o ServerAliveCountMax=3'; GIT_SSH_COMMAND=\\\"$G\\\" git pull --rebase --autostash --quiet origin master || { n=0; while [ -d .git/rebase-merge ] || [ -d .git/rebase-apply ]; do n=$((n+1)); if [ $n -gt 50 ]; then git rebase --abort 2>/dev/null; echo 'git-sync: too many rebase steps, aborted'; exit 1; fi; msg=$(git log --format=%s -1 REBASE_HEAD 2>/dev/null); if echo \\\"$msg\\\" | grep -q '\\\\[skip ci\\\\]'; then echo \\\"git-sync: auto-skipping conflicting [skip ci] commit: $msg\\\"; git -c rerere.enabled=false rebase --skip || true; else git rebase --abort 2>/dev/null; echo \\\"git-sync: pull/rebase failed (non-skip-ci): $msg\\\"; exit 1; fi; done; }; git add -- SecondBrain/ wiki/ Vault/memory/ ':(exclude)SecondBrain/.obsidian/' 2>/dev/null; if ! git diff --cached --quiet; then git commit -m \\\"Luci: auto-sync $(date +%Y-%m-%dT%H:%M)\\\" --quiet; GIT_SSH_COMMAND=\\\"$G\\\" git push --quiet origin master; fi; cp -u /home/lucienne/workspace/PKA/Vault/notes/luci-deploy/*.py /home/lucienne/workspace/scripts/ 2>/dev/null; true\"\ntags: [infrastructure, git]\nruntime_profile: direct_shell\n---\n**OVERRIDES runtime profile:** uses `direct_shell` (plain shell, no model) because the command chain never invokes the `claude` CLI or any LLM API \u2014 pure-infra task; scheduler provider env injection is a no-op (MC-4942 U12 sweep).\n\nBidirectional PKA sync, **hourly** (was every 15 min \u2014 caused commit churn + collisions with Mac's autopush).\n\n**Receive:** `git pull --rebase --autostash origin master` pulls Mac's pushes. Fetch refspec is restricted to master-only (post 2026-05-21 history purge) so it can't re-bloat from old refs.\n\n**Send (scoped \u2014 NO `git add -A`):** stages only Luci's authored surface \u2014 `SecondBrain/`, `wiki/`, `Vault/memory/` (reports/ + dashboards/ are cloud-migrated outputs, gitignored \u2014 never synced from Luci) (excluding `SecondBrain/.obsidian/` churn). Commits + pushes only if those paths changed. Anything Luci edits outside that surface (scripts, infra, `.claude`) is pushed manually \u2014 Mac owns those.\n\n**Not synced here:** `vault.db` / `entity_graph.db` (gitignored, per-machine rebuildable), `mc.db` (separate repo). The old vault.db stash/checkout dance was removed \u2014 it's dead code now that vault.db is gitignored.\n\nRe-enabled 2026-05-21 after the 15-min `git add -A` churn was reworked to scoped hourly sync.\n","id":"git-sync","last_run":{"duration_s":1.732666,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/413831.log","output":"","started_at":"2026-06-13T06:00:23.503302+02:00","status":"completed"},"next_run":"2026-06-13 07:00","next_run_iso":"2026-06-13T07:00:00+02:00","runs":[{"duration_s":1.732666,"finished_at":"2026-06-13T06:00:25.239021+02:00","id":413831,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/413831.log","output":"","started_at":"2026-06-13T06:00:23.503302+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":1.656757,"finished_at":"2026-06-13T05:00:11.322531+02:00","id":413660,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/413660.log","output":"","started_at":"2026-06-13T05:00:09.663509+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":4.221822,"finished_at":"2026-06-13T04:04:12.787800+02:00","id":413485,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/413485.log","output":"","started_at":"2026-06-13T04:04:08.563404+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":4.369796,"finished_at":"2026-06-13T03:00:14.153933+02:00","id":413304,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/413304.log","output":"","started_at":"2026-06-13T03:00:09.781125+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":1.703545,"finished_at":"2026-06-13T02:00:22.778435+02:00","id":413129,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/413129.log","output":"","started_at":"2026-06-13T02:00:21.071076+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":4.333627,"finished_at":"2026-06-13T01:00:12.091543+02:00","id":412954,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/412954.log","output":"","started_at":"2026-06-13T01:00:07.754966+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":1.774859,"finished_at":"2026-06-13T00:00:26.730636+02:00","id":412777,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/412777.log","output":"","started_at":"2026-06-13T00:00:24.953369+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":4.537561,"finished_at":"2026-06-12T23:00:12.755114+02:00","id":412603,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/412603.log","output":"","started_at":"2026-06-12T23:00:08.213667+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":2.048061,"finished_at":"2026-06-12T22:00:07.609864+02:00","id":412429,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/412429.log","output":"","started_at":"2026-06-12T22:00:05.559877+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":4.648455,"finished_at":"2026-06-12T21:00:09.928359+02:00","id":412256,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/412256.log","output":"Created autostash: 139d4579\n","started_at":"2026-06-12T21:00:05.277287+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":1.880142,"finished_at":"2026-06-12T20:00:05.811520+02:00","id":412080,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/412080.log","output":"","started_at":"2026-06-12T20:00:03.929448+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":1.631898,"finished_at":"2026-06-12T19:03:42.376905+02:00","id":411913,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/411913.log","output":"","started_at":"2026-06-12T19:03:40.742451+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":4.215059,"finished_at":"2026-06-12T18:00:57.195254+02:00","id":411738,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/411738.log","output":"","started_at":"2026-06-12T18:00:52.978050+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":4.255162,"finished_at":"2026-06-12T17:00:25.089183+02:00","id":411564,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/411564.log","output":"","started_at":"2026-06-12T17:00:20.831433+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":1.863974,"finished_at":"2026-06-12T16:00:05.558490+02:00","id":411390,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/411390.log","output":"","started_at":"2026-06-12T16:00:03.691871+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":5.461583,"finished_at":"2026-06-12T15:00:09.163169+02:00","id":411217,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/411217.log","output":"","started_at":"2026-06-12T15:00:03.698740+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":2.253813,"finished_at":"2026-06-12T14:00:23.400058+02:00","id":411044,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/411044.log","output":"Created autostash: 0f6957aa\n","started_at":"2026-06-12T14:00:21.143646+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":4.063351,"finished_at":"2026-06-12T13:00:25.471961+02:00","id":410870,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/410870.log","output":"","started_at":"2026-06-12T13:00:21.405519+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":1.847551,"finished_at":"2026-06-12T12:03:55.242251+02:00","id":410710,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/410710.log","output":"","started_at":"2026-06-12T12:03:53.392125+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"},{"duration_s":4.366778,"finished_at":"2026-06-12T11:00:07.703416+02:00","id":410534,"log_path":"/home/lucienne/workspace/logs/task-runs/git-sync/410534.log","output":"","started_at":"2026-06-12T11:00:03.334044+02:00","status":"completed","task_id":"git-sync","task_name":"Sync PKA repo with GitHub"}],"runs_limit":20,"schedule":"0 * * * *","schedule_label":{"description":"Every hour at :00","is_custom":false,"label":"Hourly","sort":2,"sort_time":""},"stats":{"avg_duration":3.2162379657142854,"completed":175,"failed":0,"timeout":0,"total":175},"task":{"_description":"**OVERRIDES runtime profile:** uses `direct_shell` (plain shell, no model) because the command chain never invokes the `claude` CLI or any LLM API \u2014 pure-infra task; scheduler provider env injection is a no-op (MC-4942 U12 sweep).\n\nBidirectional PKA sync, **hourly** (was every 15 min \u2014 caused commit churn + collisions with Mac's autopush).\n\n**Receive:** `git pull --rebase --autostash origin master` pulls Mac's pushes. Fetch refspec is restricted to master-only (post 2026-05-21 history purge) so it can't re-bloat from old refs.\n\n**Send (scoped \u2014 NO `git add -A`):** stages only Luci's authored surface \u2014 `SecondBrain/`, `wiki/`, `Vault/memory/` (reports/ + dashboards/ are cloud-migrated outputs, gitignored \u2014 never synced from Luci) (excluding `SecondBrain/.obsidian/` churn). Commits + pushes only if those paths changed. Anything Luci edits outside that surface (scripts, infra, `.claude`) is pushed manually \u2014 Mac owns those.\n\n**Not synced here:** `vault.db` / `entity_graph.db` (gitignored, per-machine rebuildable), `mc.db` (separate repo). The old vault.db stash/checkout dance was removed \u2014 it's dead code now that vault.db is gitignored.\n\nRe-enabled 2026-05-21 after the 15-min `git add -A` churn was reworked to scoped hourly sync.","_file":"git-sync.md","_path":"/home/lucienne/workspace/tasks/git-sync.md","command":"cd /home/lucienne/workspace/PKA && G='ssh -i /home/lucienne/.ssh/id_ed25519_pka -o IdentitiesOnly=yes -o ConnectTimeout=20 -o ServerAliveInterval=10 -o ServerAliveCountMax=3'; GIT_SSH_COMMAND=\"$G\" git pull --rebase --autostash --quiet origin master || { n=0; while [ -d .git/rebase-merge ] || [ -d .git/rebase-apply ]; do n=$((n+1)); if [ $n -gt 50 ]; then git rebase --abort 2>/dev/null; echo 'git-sync: too many rebase steps, aborted'; exit 1; fi; msg=$(git log --format=%s -1 REBASE_HEAD 2>/dev/null); if echo \"$msg\" | grep -q '\\[skip ci\\]'; then echo \"git-sync: auto-skipping conflicting [skip ci] commit: $msg\"; git -c rerere.enabled=false rebase --skip || true; else git rebase --abort 2>/dev/null; echo \"git-sync: pull/rebase failed (non-skip-ci): $msg\"; exit 1; fi; done; }; git add -- SecondBrain/ wiki/ Vault/memory/ ':(exclude)SecondBrain/.obsidian/' 2>/dev/null; if ! git diff --cached --quiet; then git commit -m \"Luci: auto-sync $(date +%Y-%m-%dT%H:%M)\" --quiet; GIT_SSH_COMMAND=\"$G\" git push --quiet origin master; fi; cp -u /home/lucienne/workspace/PKA/Vault/notes/luci-deploy/*.py /home/lucienne/workspace/scripts/ 2>/dev/null; true","enabled":true,"id":"git-sync","notify_on":"failure","retry":false,"run_as":"shell","runtime_profile":"direct_shell","schedule":"0 * * * *","tags":["infrastructure","git"],"timeout":300,"title":"Sync PKA repo with GitHub"}}
