commit 10dcbedcc2e1c3ad46280035a34627d2caadfc83 Author: Mc_Smog Date: Tue Jul 14 00:26:08 2026 +0500 chore: back up Pi environment diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..73a6b21 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,3 @@ +pi-backup-*.tar.zst filter=lfs diff=lfs merge=lfs -text +pi-backup-*.tar.gz filter=lfs diff=lfs merge=lfs -text +pi-backup-*.tar.zst.part-* filter=lfs diff=lfs merge=lfs -text diff --git a/.omx/hud-config.json b/.omx/hud-config.json new file mode 100644 index 0000000..e20bc4a --- /dev/null +++ b/.omx/hud-config.json @@ -0,0 +1,3 @@ +{ + "preset": "focused" +} \ No newline at end of file diff --git a/.omx/logs/notify-fallback-2026-05-01.jsonl b/.omx/logs/notify-fallback-2026-05-01.jsonl new file mode 100644 index 0000000..ca6556a --- /dev/null +++ b/.omx/logs/notify-fallback-2026-05-01.jsonl @@ -0,0 +1,2 @@ +{"timestamp":"2026-05-01T19:13:22.486Z","type":"watcher_start","cwd":"/home/smog/main","notify_script":"/usr/lib/node_modules/oh-my-codex/dist/scripts/notify-hook.js","authority_only":false,"poll_ms":250,"effective_poll_ms":250,"idle_max_poll_ms":1000,"once":false,"parent_pid":1337975,"pid_file":"/home/smog/main/.omx/state/notify-fallback.pid","max_lifetime_ms":21600000} +{"timestamp":"2026-05-01T19:13:37.674Z","type":"watcher_stop","signal":"SIGTERM","reason":"signal","parent_pid":1337975,"pid_file":"/home/smog/main/.omx/state/notify-fallback.pid"} diff --git a/.omx/logs/notify-fallback-2026-07-12.jsonl b/.omx/logs/notify-fallback-2026-07-12.jsonl new file mode 100644 index 0000000..7504b62 --- /dev/null +++ b/.omx/logs/notify-fallback-2026-07-12.jsonl @@ -0,0 +1,2 @@ +{"timestamp":"2026-07-12T19:57:02.897Z","type":"watcher_start","cwd":"/home/smog/main","notify_script":"/home/smog/.local/lib/node_modules/oh-my-codex/dist/scripts/notify-hook.js","authority_only":false,"poll_ms":250,"effective_poll_ms":1000,"idle_max_poll_ms":1000,"once":false,"parent_pid":68688,"pid_file":"/home/smog/main/.omx/state/notify-fallback.pid","max_lifetime_ms":21600000} +{"timestamp":"2026-07-12T21:15:25.051Z","type":"watcher_stop","signal":null,"reason":"parent_gone","parent_pid":68688,"pid_file":"/home/smog/main/.omx/state/notify-fallback.pid"} diff --git a/.omx/logs/omx-2026-05-01.jsonl b/.omx/logs/omx-2026-05-01.jsonl new file mode 100644 index 0000000..47931f2 --- /dev/null +++ b/.omx/logs/omx-2026-05-01.jsonl @@ -0,0 +1,3 @@ +{"event":"session_start","session_id":"omx-1777662801842-unhxxn","pid":1337975,"timestamp":"2026-05-01T19:13:22.411Z","_ts":"2026-05-01T19:13:22.411Z"} +{"event":"session_start","session_id":"omx-1777662801842-unhxxn","pid":1337975,"timestamp":"2026-05-01T19:13:37.564Z","_ts":"2026-05-01T19:13:37.673Z"} +{"event":"session_end","session_id":"omx-1777662801842-unhxxn","timestamp":"2026-05-01T19:13:37.675Z","_ts":"2026-05-01T19:13:37.675Z"} diff --git a/.omx/logs/omx-2026-07-12.jsonl b/.omx/logs/omx-2026-07-12.jsonl new file mode 100644 index 0000000..1bc4a9a --- /dev/null +++ b/.omx/logs/omx-2026-07-12.jsonl @@ -0,0 +1 @@ +{"event":"session_start","session_id":"omx-1783886220848-ugrwhe","pid":68688,"timestamp":"2026-07-12T19:57:02.811Z","_ts":"2026-07-12T19:57:02.811Z"} diff --git a/.omx/logs/omx-2026-07-13.jsonl b/.omx/logs/omx-2026-07-13.jsonl new file mode 100644 index 0000000..39b9fdb --- /dev/null +++ b/.omx/logs/omx-2026-07-13.jsonl @@ -0,0 +1,2 @@ +{"event":"session_start","session_id":"019f57e4-d006-76e2-b9bf-99950205bb6d","native_session_id":"019f57e4-d006-76e2-b9bf-99950205bb6d","pid":12549,"timestamp":"2026-07-13T16:20:18.642Z","_ts":"2026-07-13T16:20:18.643Z"} +{"event":"session_start","session_id":"019f5c48-1130-7663-b700-14621eff9671","native_session_id":"019f5c48-1130-7663-b700-14621eff9671","pid":12549,"timestamp":"2026-07-13T16:21:02.350Z","_ts":"2026-07-13T16:21:02.350Z"} diff --git a/.omx/logs/session-history.jsonl b/.omx/logs/session-history.jsonl new file mode 100644 index 0000000..f0f7cef --- /dev/null +++ b/.omx/logs/session-history.jsonl @@ -0,0 +1 @@ +{"session_id":"omx-1777662801842-unhxxn","started_at":"2026-05-01T19:13:37.564Z","ended_at":"2026-05-01T19:13:37.675Z","cwd":"/home/smog/main","pid":1337975} diff --git a/.omx/logs/tmux-hook-2026-07-12.jsonl b/.omx/logs/tmux-hook-2026-07-12.jsonl new file mode 100644 index 0000000..7eb42d0 --- /dev/null +++ b/.omx/logs/tmux-hook-2026-07-12.jsonl @@ -0,0 +1 @@ +{"timestamp":"2026-07-12T20:05:19.980Z","type":"auto_nudge_skipped","reason":"unmanaged_session"} diff --git a/.omx/logs/tmux-hook-2026-07-13.jsonl b/.omx/logs/tmux-hook-2026-07-13.jsonl new file mode 100644 index 0000000..1556041 --- /dev/null +++ b/.omx/logs/tmux-hook-2026-07-13.jsonl @@ -0,0 +1,2 @@ +{"timestamp":"2026-07-13T16:20:24.480Z","type":"auto_nudge_skipped","reason":"unmanaged_session"} +{"timestamp":"2026-07-13T16:21:43.956Z","type":"auto_nudge_skipped","reason":"unmanaged_session"} diff --git a/.omx/logs/turns-2026-07-12.jsonl b/.omx/logs/turns-2026-07-12.jsonl new file mode 100644 index 0000000..7d7b5d3 --- /dev/null +++ b/.omx/logs/turns-2026-07-12.jsonl @@ -0,0 +1 @@ +{"timestamp":"2026-07-12T20:05:19.929Z","type":"agent-turn-complete","thread_id":"019f57e4-d006-76e2-b9bf-99950205bb6d","turn_id":"019f57ee-f2d7-7392-b4c5-421e31f54265","input_preview":"Как перенести полностью не только pi coding agent как мы уже сделали в этой папке создали перенос pi, надо теперь тоже самое сделать с codex + ohmycodex установленный на этом pc надо перенести списки ","input_message_count":1,"output_preview":"Готов продолжить, но в этой сессии мне недоступен терминальный инструмент для просмотра и изменения файлов. Чтобы сделать перенос корректно, нужен доступ к содержимому `/home/smog/main` и каталогам `~"} diff --git a/.omx/logs/turns-2026-07-13.jsonl b/.omx/logs/turns-2026-07-13.jsonl new file mode 100644 index 0000000..22865dc --- /dev/null +++ b/.omx/logs/turns-2026-07-13.jsonl @@ -0,0 +1,2 @@ +{"timestamp":"2026-07-13T16:20:24.426Z","type":"agent-turn-complete","thread_id":"019f57e4-d006-76e2-b9bf-99950205bb6d","turn_id":"019f5c47-837d-7491-84c8-6e32542b3ec2","input_preview":"Как мне дать доступ?","input_message_count":2,"output_preview":"В этом чате доступ к инструментам не был выдан вообще — поэтому я не могу открыть даже файлы рабочей папки. Дать его можно, начав новый агентский сеанс в Codex с включённым доступом к терминалу/файлов"} +{"timestamp":"2026-07-13T16:21:43.904Z","type":"agent-turn-complete","thread_id":"019f5c48-1130-7663-b700-14621eff9671","turn_id":"019f5c48-2c0f-7102-9710-8f60fbe7db48","input_preview":"Как перенести полностью не только pi coding agent как мы уже сделали в этой папке создали перенос pi, надо теперь тоже самое сделать с\n codex + ohmycodex установленный на этом pc надо перенести списк","input_message_count":1,"output_preview":"Сделай отдельный переносимый архив рядом с переносом Pi. Копировать нужно конфигурацию, skills/plugins/MCP, но **не** `auth.json`, токены и ключи.\n\n```bash\ncd /home/smog/main\nmkdir -p codex-ohmycodex-"} diff --git a/.omx/logs/update-2026-07-12T19-57-02-767Z.log b/.omx/logs/update-2026-07-12T19-57-02-767Z.log new file mode 100644 index 0000000..f5a1484 --- /dev/null +++ b/.omx/logs/update-2026-07-12T19-57-02-767Z.log @@ -0,0 +1,69 @@ + +added 1 package, and changed 94 packages in 5s + +31 packages are looking for funding + run `npm fund` for details +npm warn install-scripts 1 package had install scripts blocked because they are not covered by allowScripts: +npm warn install-scripts oh-my-codex@0.20.1 (postinstall: node -e "const fs=require('fs');const p='./dist/scripts/postinstall.js';if(fs.existsSync(p))import(p).then(m=>m.main?.()).catch(e=>console.warn('[omx] Postinstall skipped after a non-fatal error: '+(e?.message??e)))") +npm warn install-scripts +npm warn install-scripts Run `npm install -g --allow-scripts=oh-my-codex` to allow these scripts once, or `npm config set allow-scripts=oh-my-codex --location=user` to allow them for all global installs. +oh-my-codex setup +================= + +Using setup scope: user + +Using setup install mode: legacy + +Using setup MCP mode: none + +Using setup Team mode: enabled + +[1/8] Creating directories... + Done. + +[2/8] Installing agent prompts... + Prompt refresh complete (catalog baseline: 22). + +[3/8] Installing skills... + Skill refresh complete (catalog baseline: 29). + +[4/8] Installing native agent configs... + Native agent refresh complete (/home/smog/.codex/agents). + +[5/8] Updating config.toml... + Config refresh complete (/home/smog/.codex/config.toml). + + Native Codex hooks refresh complete (/home/smog/.codex/hooks.json). + +[5.5/8] Verifying Team CLI API interop... + omx team api command detected (CLI-first interop ready) + +[6/8] Generating AGENTS.md... + Refreshed AGENTS.md model capability table in /home/smog/.codex. + User scope leaves project AGENTS.md unchanged. + +[7/8] Configuring notification hook... + Done. + +[8/8] Configuring HUD... + HUD config created (preset: focused). + StatusLine configured in config.toml via [tui] section. + +Setup refresh summary: + prompts: updated=1, unchanged=36, backed_up=1, skipped=0, removed=0 + skills: updated=12, unchanged=18, backed_up=12, skipped=17, removed=0 + native_agents: updated=0, unchanged=0, backed_up=0, skipped=22, removed=0 + agents_md: updated=1, unchanged=0, backed_up=1, skipped=0, removed=0 + config: updated=2, unchanged=0, backed_up=2, skipped=0, removed=0 + +Migration hint: Legacy ~/.agents/skills still exists (2 skills) alongside canonical /home/smog/.codex/skills. Codex may still discover both roots; archive or remove ~/.agents/skills if Enable/Disable Skills shows duplicates. + +Setup complete! Run "omx doctor" to verify installation. + +Next steps: + 1. Start Codex CLI in your project directory + 2. Use role/workflow keywords like $architect, $executor, and $plan in Codex + 3. Browse skills with /skills; AGENTS keyword routing can also activate them implicitly + 4. The AGENTS.md orchestration brain is loaded automatically + 5. Native agent role TOML files written to .codex/agents/; use explicit agent_type when spawning OMX roles + 6. "omx explore" and "omx sparkshell" can hydrate native release binaries on first use; source installs still allow repo-local fallbacks and OMX_EXPLORE_BIN / OMX_SPARKSHELL_BIN overrides diff --git a/.omx/metrics.json b/.omx/metrics.json new file mode 100644 index 0000000..451506d --- /dev/null +++ b/.omx/metrics.json @@ -0,0 +1,10 @@ +{ + "total_turns": 3, + "session_turns": 3, + "last_activity": "2026-07-13T16:21:43.907Z", + "session_input_tokens": 0, + "session_output_tokens": 0, + "session_total_tokens": 0, + "five_hour_limit_pct": 0, + "weekly_limit_pct": 0 +} \ No newline at end of file diff --git a/.omx/runtime/bin/omx b/.omx/runtime/bin/omx new file mode 100755 index 0000000..cfae591 --- /dev/null +++ b/.omx/runtime/bin/omx @@ -0,0 +1,2 @@ +#!/bin/sh +exec '/usr/bin/node' '/home/smog/.local/lib/node_modules/oh-my-codex/dist/cli/omx.js' "$@" diff --git a/.omx/setup-scope.json b/.omx/setup-scope.json new file mode 100644 index 0000000..55c8eed --- /dev/null +++ b/.omx/setup-scope.json @@ -0,0 +1,5 @@ +{ + "scope": "user", + "mcpMode": "none", + "installMode": "legacy" +} diff --git a/.omx/state/native-stop-state.json b/.omx/state/native-stop-state.json new file mode 100644 index 0000000..d1fff81 --- /dev/null +++ b/.omx/state/native-stop-state.json @@ -0,0 +1,24 @@ +{ + "sessions": { + "019f57e4-d006-76e2-b9bf-99950205bb6d": { + "ordinary_no_progress_guard": { + "fingerprint": "ordinary|в этом чате доступ к инструментам не был выдан вообще — поэтому я не могу открыть даже файлы рабочей папки. дать его можно, начав новый агентский сеанс в codex с включённым доступом к терминалу/файловой системе и выбрав `/home/smog/main` как workspace. после этого напишите, например: «сделай перенос codex и oh-my-codex по образцу pi». я сам: - найду существующий перенос pi; - создам экспорт/импорт для `~/.codex` и omx; - перенесу skills, plugins и mcp-конфигурации; - исключу секреты из обычного архива; - добавлю проверку восстановленной установки.", + "first_seen_at": "2026-07-13T16:20:24.324Z", + "last_seen_at": "2026-07-13T16:20:24.324Z", + "repeat_count": 1, + "last_turn_id": "019f5c47-837d-7491-84c8-6e32542b3ec2", + "last_thread_id": null + } + }, + "019f5c48-1130-7663-b700-14621eff9671": { + "ordinary_no_progress_guard": { + "fingerprint": "ordinary|сделай отдельный переносимый архив рядом с переносом pi. копировать нужно конфигурацию, skills/plugins/mcp, но **не** `auth.json`, токены и ключи. ```bash cd /home/smog/main mkdir -p codex-ohmycodex-transfer/{codex,agents,omx,shell,meta} # codex: настройки, skills, plugins, роли и prompts rsync -a ~/.codex/config.toml codex-ohmycodex-transfer/codex/ 2>/dev/null || true rsync -a ~/.codex/{skills,plugins,agents,prompts} codex-ohmycodex-transfer/codex/ 2>/dev/null || true # дополнительные локальные skills (у тебя они используются) rsync -a ~/.agents/skills codex-ohmycodex-transfer/agents/ 2>/dev/null || true # конфигурация oh-my-codex, если существует rsync -a ~/.config/oh-my-codex codex-ohmycodex-transfer/omx/ 2>/dev/null || true rsync -a ~/.oh-my-codex codex-ohmycodex-transfer/omx/ 2>/dev/null || true # shell-настройки: aliases/functions для codex/omx/yolo grep -nei 'codex|omx|yolo' ~/.zshrc ~/.zprofile ~/.bashrc ~/.profile \\ > codex-ohmycodex-transfer/shell/codex-omx-yolo-lines.txt 2>/dev/null || true # инвентарь: поможет поставить ровно те же cli-пакеты на новом пк { echo '== versions ==' codex --version 2>&1 || true omx --version 2>&1 || true node --version 2>&1 || true npm --version 2>&1 || true echo echo '== global npm ==' npm -g ls --depth=0 2>&1 || true echo echo '== mcp in config ==' grep -nei 'mcp|approval_policy|sandbox_mode|yolo' ~/.codex/config.toml 2>/dev/null || true } > codex-ohmycodex-transfer/meta/inventory.txt # контрольная сумма и архив tar -czf codex-ohmycodex-transfer.tar.gz codex-ohmycodex-transfer sha256sum codex-ohmycodex-transfer.tar.gz \\ > codex-ohmycodex-transfer.tar.gz.sha256 ``` на новом пк: ```bash tar -xzf codex-ohmycodex-transfer.tar.gz cd codex-ohmycodex-transfer mkdir -p ~/.codex ~/.agents ~/.config rsync -a codex/ ~/.codex/ rsync -a agents/ ~/.agents/ rsync -a omx/ ~/.config/ # только если в архиве есть конфиг omx # установить codex/omx той же версией из meta/inventory.txt, # затем восстановить/проверить интеграцию omx setup omx doctor # авторизация намеренно выполняется на новом пк codex login ``` для постоянного yolo-профиля проверь `~/.codex/config.toml`; при необходимости добавь: ```toml [profiles.yolo] approval_policy = \"never\" sandbox_mode = \"danger-full-access\" ``` запуск: ```bash codex --profile yolo ``` важно: - mcp-серверы обычно перенесутся через `~/.codex/config.toml`. - значения переменных окружения, api-ключи, oauth-сессии и `~/.codex/auth.json` переносить не следует; на новой машине их нужно задать заново. - если mcp использует локальные пути к бинарникам, после переноса проверь их установку и пути в `config.toml`. - после восстановления полезно проверить: `codex mcp list` (если поддерживается версией cli), `omx doctor`, затем открыть codex и убедиться, что skills/plugins видны.", + "first_seen_at": "2026-07-13T16:21:43.806Z", + "last_seen_at": "2026-07-13T16:21:43.806Z", + "repeat_count": 1, + "last_turn_id": "019f5c48-2c0f-7102-9710-8f60fbe7db48", + "last_thread_id": null + } + } + } +} \ No newline at end of file diff --git a/.omx/state/notify-fallback-authority-owner.json b/.omx/state/notify-fallback-authority-owner.json new file mode 100644 index 0000000..c452d4c --- /dev/null +++ b/.omx/state/notify-fallback-authority-owner.json @@ -0,0 +1,14 @@ +{ + "owner": "hud", + "pid": 68742, + "cwd": "/home/smog/main", + "heartbeat_at": "2026-07-13T13:19:21.920Z", + "cooldown_ms": 5000, + "jitter_ms": 26, + "skip_count": 52024, + "last_status": "skipped", + "last_reason": "rate_limited", + "last_spawn_at": "2026-07-13T13:19:16.916Z", + "last_skip_at": "2026-07-13T13:19:21.920Z", + "next_allowed_at": "2026-07-13T13:19:21.942Z" +} \ No newline at end of file diff --git a/.omx/state/notify-fallback-authority-state.json b/.omx/state/notify-fallback-authority-state.json new file mode 100644 index 0000000..c452d4c --- /dev/null +++ b/.omx/state/notify-fallback-authority-state.json @@ -0,0 +1,14 @@ +{ + "owner": "hud", + "pid": 68742, + "cwd": "/home/smog/main", + "heartbeat_at": "2026-07-13T13:19:21.920Z", + "cooldown_ms": 5000, + "jitter_ms": 26, + "skip_count": 52024, + "last_status": "skipped", + "last_reason": "rate_limited", + "last_spawn_at": "2026-07-13T13:19:16.916Z", + "last_skip_at": "2026-07-13T13:19:21.920Z", + "next_allowed_at": "2026-07-13T13:19:21.942Z" +} \ No newline at end of file diff --git a/.omx/state/notify-fallback-state.json b/.omx/state/notify-fallback-state.json new file mode 100644 index 0000000..7ffb258 --- /dev/null +++ b/.omx/state/notify-fallback-state.json @@ -0,0 +1,88 @@ +{ + "pid": 890434, + "parent_pid": 68742, + "started_at": "2026-07-13T13:19:17.004Z", + "cwd": "/home/smog/main", + "notify_script": "/home/smog/.local/lib/node_modules/oh-my-codex/dist/scripts/notify-hook.js", + "authority_only": true, + "poll_ms": 75, + "effective_poll_ms": 1000, + "idle_max_poll_ms": 1000, + "pid_file": null, + "max_lifetime_ms": 0, + "tracked_files": 0, + "seen_turns": 0, + "dispatch_drain": { + "enabled": true, + "max_per_tick": 5, + "run_count": 1, + "leader_only": true, + "last_tick_at": "2026-07-13T13:19:17.007Z", + "last_result": { + "processed": 0, + "skipped": 0, + "failed": 0 + }, + "last_error": null + }, + "leader_nudge": { + "enabled": true, + "leader_only": true, + "stale_threshold_ms": 180000, + "precomputed_leader_stale": false, + "last_tick_at": "2026-07-13T13:19:17.008Z", + "last_error": null, + "run_count": 1 + }, + "ralph_continue_steer": { + "enabled": true, + "cadence_ms": 60000, + "message": "Ralph loop active continue", + "active": false, + "last_state_check_at": "2026-07-12T21:15:24.049Z", + "last_sent_at": "", + "cooldown_anchor_at": "", + "last_reason": "blocked_by_current_session", + "last_error": null, + "state_path": "", + "pane_id": "", + "pane_current_command": "", + "current_phase": "", + "subagent_session_id": "", + "active_subagent_thread_ids": [], + "shared_timestamp_path": "/home/smog/main/.omx/state/ralph-last-steer-at", + "shared_last_sent_at": "", + "singleton_lock_path": "/home/smog/main/.omx/state/ralph-continue-steer.lock" + }, + "fallback_auto_nudge": { + "enabled": true, + "stall_ms": 5000, + "last_tick_at": "2026-07-13T13:19:17.016Z", + "last_turn_at": "2026-07-12T20:05:19.938Z", + "last_turn_count": 1, + "last_message": "Готов продолжить, но в этой сессии мне недоступен терминальный инструмент для просмотра и изменения ", + "last_reason": "eligible_but_not_sent", + "last_error": null, + "last_nudged_signature": "", + "last_nudged_at": "" + }, + "authority_backoff": { + "active": false, + "reason": "pid_missing", + "primary_pid": null, + "primary_last_tick_at": "", + "freshness_ms": null, + "threshold_ms": null + }, + "adaptive_poll": { + "enabled": true, + "base_ms": 75, + "max_ms": 1000, + "current_ms": 1000, + "idle_streak": 14307, + "last_tick_at": "2026-07-13T13:19:17.019Z", + "last_activity_at": null, + "last_activity_reason": "eligible_but_not_sent" + }, + "last_cycle_activity": "eligible_but_not_sent" +} \ No newline at end of file diff --git a/.omx/state/session.json b/.omx/state/session.json new file mode 100644 index 0000000..9af0f54 --- /dev/null +++ b/.omx/state/session.json @@ -0,0 +1,10 @@ +{ + "session_id": "019f5c48-1130-7663-b700-14621eff9671", + "native_session_id": "019f5c48-1130-7663-b700-14621eff9671", + "started_at": "2026-07-13T16:21:02.350Z", + "cwd": "/home/smog/main", + "pid": 12549, + "platform": "linux", + "pid_start_ticks": 15454, + "pid_cmdline": "/home/smog/.local/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex" +} \ No newline at end of file diff --git a/.omx/state/sessions/019f57e4-d006-76e2-b9bf-99950205bb6d/hud-state.json b/.omx/state/sessions/019f57e4-d006-76e2-b9bf-99950205bb6d/hud-state.json new file mode 100644 index 0000000..b2bbec7 --- /dev/null +++ b/.omx/state/sessions/019f57e4-d006-76e2-b9bf-99950205bb6d/hud-state.json @@ -0,0 +1,6 @@ +{ + "last_turn_at": "2026-07-13T16:20:24.435Z", + "turn_count": 1, + "last_progress_at": "2026-07-13T16:20:24.435Z", + "last_agent_output": "В этом чате доступ к инструментам не был выдан вообще — поэтому я не могу открыть даже файлы рабочей" +} \ No newline at end of file diff --git a/.omx/state/sessions/019f57e4-d006-76e2-b9bf-99950205bb6d/notify-hook-state.json b/.omx/state/sessions/019f57e4-d006-76e2-b9bf-99950205bb6d/notify-hook-state.json new file mode 100644 index 0000000..32b163f --- /dev/null +++ b/.omx/state/sessions/019f57e4-d006-76e2-b9bf-99950205bb6d/notify-hook-state.json @@ -0,0 +1,6 @@ +{ + "recent_turns": { + "019f57e4-d006-76e2-b9bf-99950205bb6d|019f5c47-837d-7491-84c8-6e32542b3ec2|agent-turn-complete": 1783959624423 + }, + "last_event_at": "2026-07-13T16:20:24.424Z" +} \ No newline at end of file diff --git a/.omx/state/sessions/019f57e4-d006-76e2-b9bf-99950205bb6d/prompt-routing-state.json b/.omx/state/sessions/019f57e4-d006-76e2-b9bf-99950205bb6d/prompt-routing-state.json new file mode 100644 index 0000000..bcac39a --- /dev/null +++ b/.omx/state/sessions/019f57e4-d006-76e2-b9bf-99950205bb6d/prompt-routing-state.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "last_triage": { + "lane": "LIGHT", + "destination": "explore", + "reason": "question_or_explanation", + "prompt_signature": "sha256:c5f5f045c12bc21710208cc1b1aca1777feb832118391c1c6d53e99b0d23abdc", + "turn_id": "019f5c47-837d-7491-84c8-6e32542b3ec2", + "created_at": "2026-07-13T16:20:18.788Z" + }, + "suppress_followup": true +} \ No newline at end of file diff --git a/.omx/state/sessions/019f5c48-1130-7663-b700-14621eff9671/hud-state.json b/.omx/state/sessions/019f5c48-1130-7663-b700-14621eff9671/hud-state.json new file mode 100644 index 0000000..f994fa0 --- /dev/null +++ b/.omx/state/sessions/019f5c48-1130-7663-b700-14621eff9671/hud-state.json @@ -0,0 +1,6 @@ +{ + "last_turn_at": "2026-07-13T16:21:43.913Z", + "turn_count": 1, + "last_progress_at": "2026-07-13T16:21:43.913Z", + "last_agent_output": "Сделай отдельный переносимый архив рядом с переносом Pi. Копировать нужно конфигурацию, skills/plugi" +} \ No newline at end of file diff --git a/.omx/state/sessions/019f5c48-1130-7663-b700-14621eff9671/notify-hook-state.json b/.omx/state/sessions/019f5c48-1130-7663-b700-14621eff9671/notify-hook-state.json new file mode 100644 index 0000000..4807b12 --- /dev/null +++ b/.omx/state/sessions/019f5c48-1130-7663-b700-14621eff9671/notify-hook-state.json @@ -0,0 +1,6 @@ +{ + "recent_turns": { + "019f5c48-1130-7663-b700-14621eff9671|019f5c48-2c0f-7102-9710-8f60fbe7db48|agent-turn-complete": 1783959703902 + }, + "last_event_at": "2026-07-13T16:21:43.902Z" +} \ No newline at end of file diff --git a/.omx/state/sessions/omx-1783886220848-ugrwhe/AGENTS.md b/.omx/state/sessions/omx-1783886220848-ugrwhe/AGENTS.md new file mode 100644 index 0000000..9e2634f --- /dev/null +++ b/.omx/state/sessions/omx-1783886220848-ugrwhe/AGENTS.md @@ -0,0 +1,463 @@ + +YOU ARE AN AUTONOMOUS CODING AGENT. EXECUTE TASKS TO COMPLETION WITHOUT ASKING FOR PERMISSION. +DO NOT STOP TO ASK "SHOULD I PROCEED?" — PROCEED. DO NOT WAIT FOR CONFIRMATION ON OBVIOUS NEXT STEPS. +IF BLOCKED, TRY AN ALTERNATIVE APPROACH. ONLY ASK WHEN TRULY AMBIGUOUS OR DESTRUCTIVE. +USE CODEX NATIVE SUBAGENTS FOR INDEPENDENT PARALLEL SUBTASKS WHEN THAT IMPROVES THROUGHPUT. THIS IS COMPLEMENTARY TO OMX TEAM MODE. + + + +# oh-my-codex - Intelligent Multi-Agent Orchestration + +You are running with oh-my-codex (OMX), a coordination layer for Codex CLI. +This AGENTS.md is the top-level operating contract for the workspace. +Role prompts under `prompts/*.md` are narrower execution surfaces. They must follow this file, not override it. +When OMX is installed, load the installed prompt/skill/agent surfaces from `~/.codex/prompts`, `~/.codex/skills`, and `~/.codex/agents` (or the project-local `./.codex/...` equivalents when project scope is active). + + +Canonical guidance schema for this template is defined in `docs/guidance-schema.md`. + +Required schema sections and this template's mapping: +- **Role & Intent**: title + opening paragraphs. +- **Operating Principles**: ``. +- **Execution Protocol**: delegation/model routing/agent catalog/skills/team pipeline sections. +- **Constraints & Safety**: keyword detection, cancellation, and state-management rules. +- **Verification & Completion**: `` + continuation checks in ``. +- **Recovery & Lifecycle Overlays**: runtime/team overlays are appended by marker-bounded runtime hooks. + +Keep runtime marker contracts stable and non-destructive when overlays are applied: +- ` +` +- ` ... ` + + + +- Solve the task directly when you can do so safely and well. +- Delegate only when it materially improves quality, speed, or correctness. +- Keep progress short, concrete, and useful. +- Prefer evidence over assumption; verify before claiming completion. +- Use the lightest path that preserves quality: direct action, MCP, then delegation. +- Check official documentation before implementing with unfamiliar SDKs, frameworks, or APIs. +- Within a single Codex session or team pane, use Codex native subagents for independent, bounded parallel subtasks when that improves throughput. + +- Default to quality-first, intent-deepening responses; think one more step before replying or asking for clarification, and use as much detail as needed for a strong result without empty verbosity. +- Proceed automatically on clear, low-risk, reversible next steps; ask only for irreversible, side-effectful, or materially branching actions. +- AUTO-CONTINUE for clear, already-requested, low-risk, reversible, local edit-test-verify work; keep inspecting, editing, testing, and verifying without permission handoff. +- ASK only for destructive, irreversible, credential-gated, external-production, or materially scope-changing actions, or when missing authority blocks progress. +- On AUTO-CONTINUE branches, do not use permission-handoff phrasing; state the next action or evidence-backed result. +- Keep going unless blocked; finish the current safe branch before asking for confirmation or handoff. +- Ask only when blocked by missing information, missing authority, or an irreversible/destructive branch. +- Do not ask or instruct humans to perform ordinary non-destructive, reversible actions; execute those safe reversible OMX/runtime operations and ordinary commands yourself. +- Treat OMX runtime manipulation, state transitions, and ordinary command execution as agent responsibilities when they are safe and reversible. +- Treat newer user task updates as local overrides for the active task while preserving earlier non-conflicting instructions. +- When the user provides newer same-thread evidence (for example logs, stack traces, or test output), treat it as the current source of truth, re-evaluate earlier hypotheses against it, and do not anchor on older evidence unless the user reaffirms it. +- Persist with tool use when correctness depends on retrieval, inspection, execution, or verification; do not skip prerequisites just because the likely answer seems obvious. +- More effort does not mean reflexive web/tool escalation; browse or use tools when the task materially benefits, not as a default show of effort. + + + +## Working agreements +- Write a cleanup plan before modifying code for cleanup/refactor/deslop work. +- Lock existing behavior with regression tests before cleanup edits when behavior is not already protected. +- Prefer deletion over addition. +- Reuse existing utils and patterns before introducing new abstractions. +- No new dependencies without explicit request. +- Keep diffs small, reviewable, and reversible. +- Run lint, typecheck, tests, and static analysis after changes. +- Final reports must include changed files, simplifications made, and remaining risks. + + +## Lore Commit Protocol + +Every commit message must follow the Lore protocol — structured decision records using native git trailers. +Commits are not just labels on diffs; they are the atomic unit of institutional knowledge. + +### Format + +``` + + + + +Constraint: +Rejected: | +Confidence: +Scope-risk: +Directive: +Tested: +Not-tested: +``` + +### Rules + +1. **Intent line first.** The first line describes *why*, not *what*. The diff already shows what changed. +2. **Trailers are optional but encouraged.** Use the ones that add value; skip the ones that don't. +3. **`Rejected:` prevents re-exploration.** If you considered and rejected an alternative, record it so future agents don't waste cycles re-discovering the same dead end. +4. **`Directive:` is a message to the future.** Use it for "do not change X without checking Y" warnings. +5. **`Constraint:` captures external forces.** API limitations, policy requirements, upstream bugs — things not visible in the code. +6. **`Not-tested:` is honest.** Declaring known verification gaps is more valuable than pretending everything is covered. +7. **All trailers use git-native trailer format** (key-value after a blank line). No custom parsing required. + +### Example + +``` +Prevent silent session drops during long-running operations + +The auth service returns inconsistent status codes on token +expiry, so the interceptor catches all 4xx responses and +triggers an inline refresh. + +Constraint: Auth service does not support token introspection +Constraint: Must not add latency to non-expired-token paths +Rejected: Extend token TTL to 24h | security policy violation +Rejected: Background refresh on timer | race condition with concurrent requests +Confidence: high +Scope-risk: narrow +Directive: Error handling is intentionally broad (all 4xx) — do not narrow without verifying upstream behavior +Tested: Single expired token refresh (unit) +Not-tested: Auth service cold-start > 500ms behavior +``` + +### Trailer Vocabulary + +| Trailer | Purpose | +|---------|---------| +| `Constraint:` | External constraint that shaped the decision | +| `Rejected:` | Alternative considered and why it was rejected | +| `Confidence:` | Author's confidence level (low/medium/high) | +| `Scope-risk:` | How broadly the change affects the system (narrow/moderate/broad) | +| `Reversibility:` | How easily the change can be undone (clean/messy/irreversible) | +| `Directive:` | Forward-looking instruction for future modifiers | +| `Tested:` | What verification was performed | +| `Not-tested:` | Known gaps in verification | +| `Related:` | Links to related commits, issues, or decisions | + +Teams may introduce domain-specific trailers without breaking compatibility. + + +--- + + +Default posture: work directly. + +Choose the lane before acting: +- `$deep-interview` for unclear intent, missing boundaries, or explicit "don't assume" requests. This mode clarifies and hands off; it does not implement. +- `$ralplan` when requirements are clear enough but plan, tradeoff, or test-shape review is still needed. +- `$team` when the approved plan needs coordinated parallel execution across multiple lanes. +- `$ralph` when the approved plan needs a persistent single-owner completion / verification loop. +- **Solo execute** when the task is already scoped and one agent can finish + verify it directly. + +Delegate only when it materially improves quality, speed, or safety. Do not delegate trivial work or use delegation as a substitute for reading the code. +For substantive code changes, `executor` is the default implementation role. +Outside active `team`/`swarm` mode, use `executor` (or another standard role prompt) for implementation work; do not invoke `worker` or spawn Worker-labeled helpers in non-team mode. +Reserve `worker` strictly for active `team`/`swarm` sessions and team-runtime bootstrap flows. +Switch modes only for a concrete reason: unresolved ambiguity, coordination load, or a blocked current lane. + + + +Leader responsibilities: +1. Pick the mode and keep the user-facing brief current. +2. Delegate only bounded, verifiable subtasks with clear ownership. +3. Integrate results, decide follow-up, and own final verification. + +Worker responsibilities: +1. Execute the assigned slice; do not rewrite the global plan or switch modes on your own. +2. Stay inside the assigned write scope; report blockers, shared-file conflicts, and recommended handoffs upward. +3. Ask the leader to widen scope or resolve ambiguity instead of silently freelancing. + +Rules: +- Max 6 concurrent child agents. +- Child prompts stay under AGENTS.md authority. +- `worker` is a team-runtime surface, not a general-purpose child role. +- Child agents should report recommended handoffs upward. +- Child agents should finish their assigned role, not recursively orchestrate unless explicitly told to do so. +- Prefer inheriting the leader model by omitting `spawn_agent.model` unless a task truly requires a different model. +- Do not hardcode stale frontier-model overrides for Codex native child agents. If an explicit frontier override is necessary, use the current frontier default from `OMX_DEFAULT_FRONTIER_MODEL` / the repo model contract (currently `gpt-5.4`), not older values such as `gpt-5.2`. +- Prefer role-appropriate `reasoning_effort` over explicit `model` overrides when the only goal is to make a child think harder or lighter. + + + +- `$name` — invoke a workflow skill +- `/skills` — browse available skills +- Prefer skill invocation and keyword routing as the primary user-facing workflow surface + + + +Match role to task shape: +- Low complexity: `explore`, `style-reviewer`, `writer` +- Research/discovery: `explore` for repo lookup, `researcher` for official docs/reference gathering, `dependency-expert` for SDK/API/package evaluation +- Standard: `executor`, `debugger`, `test-engineer` +- High complexity: `architect`, `executor`, `critic` + +For Codex native child agents, model routing defaults to inheritance/current repo defaults unless the caller has a concrete reason to override it. + + + +Leader/workflow routing contract: + +- Route to `explore` for repo-local file / symbol / pattern / relationship lookup, current implementation discovery, or mapping how this repo currently uses a dependency. `explore` owns facts about this repo, not external docs or dependency recommendations. +- Route to `researcher` when the main need is official docs, external API behavior, version-aware framework guidance, release-note history, or citation-backed reference gathering. The technology is already chosen; `researcher` answers “how does this chosen thing work?” and is not the default dependency-comparison role. +- Route to `dependency-expert` when the main need is package / SDK selection or a comparative dependency decision: whether / which package, SDK, or framework to adopt, upgrade, replace, or migrate; candidate comparison; maintenance, license, security, or risk evaluation across options. +- Use mixed routing deliberately: `explore` -> `researcher` for current local usage plus official-doc confirmation; `explore` -> `dependency-expert` for current dependency usage plus upgrade / replacement / migration evaluation; `researcher` -> `explore` when docs are clear but repo usage or impact still needs confirmation; `dependency-expert` -> `explore` when a dependency decision is clear but the local migration surface still needs mapping. +- Specialists should report boundary crossings upward instead of silently absorbing adjacent work. +- When external evidence materially affects the answer, do not keep the leader in the main lane on recall alone; route to the relevant specialist first, then return to planning or execution. + + + +--- + + +Key roles: +- `explore` — fast codebase search and mapping +- `planner` — work plans and sequencing +- `architect` — read-only analysis, diagnosis, tradeoffs +- `debugger` — root-cause analysis +- `executor` — implementation and refactoring +- `verifier` — completion evidence and validation + +Research/discovery specialists: +- `explore` — first-stop repository lookup and symbol/file mapping +- `researcher` — official docs, references, and external fact gathering +- `dependency-expert` — SDK/API/package evaluation before adopting or changing dependencies + +Specialists remain available through the role catalog and native child-agent surfaces when the task clearly benefits from them. + + +--- + + +Keyword routing is implemented primarily by native `UserPromptSubmit` hooks and the generated keyword registry. Treat hook-injected routing context as authoritative for the current turn, then load the named `SKILL.md` or prompt file as instructed. + +Fallback behavior when hook context is unavailable: +- Explicit `$name` invocations run left-to-right and override implicit keywords. +- Bare skill names do not activate skills by themselves; skill-name activation requires explicit `$skill` invocation. Natural-language routing phrases may still map to a workflow when they are not just the bare skill name. Examples: `analyze` / `investigate` → `$analyze` for read-only deep analysis with ranked synthesis, explicit confidence, and concrete file references; `deep interview`, `interview`, `don't assume`, or `ouroboros` → `$deep-interview`; `ralplan` / `consensus plan` → `$ralplan`; `cancel`, `stop`, or `abort` → `$cancel`. +- Keep the detailed keyword list in `src/hooks/keyword-registry.ts`; do not duplicate that table here. + +Runtime availability gate: +- Treat `autopilot`, `ralph`, `ultrawork`, `ultraqa`, `team`/`swarm`, and `ecomode` as **OMX runtime workflows**, not generic prompt aliases. +- Auto-activate runtime workflows only when the current session is actually running under OMX CLI/runtime (for example, launched via `omx`, with OMX session overlay/runtime state available, or when the user explicitly asks to run `omx ...` in the shell). +- In Codex App or plain Codex sessions without OMX runtime, do **not** treat those keywords alone as activation. Explain that they require OMX CLI runtime support, and continue with the nearest App-safe surface (`deep-interview`, `ralplan`, `plan`, or native subagents) unless the user explicitly wants you to launch OMX from the shell. +- When deep-interview is active in OMX CLI/runtime, ask interview rounds via `omx question`; do not substitute `request_user_input` or ad hoc plain-text questioning, and respect Stop-hook blocking while a deep-interview question obligation is pending. + + +## Triage: advisory prompt-routing context + +The keyword detector is the first and deterministic routing surface. Triage runs only when no keyword matches. + +When active, triage emits **advisory prompt-routing context** — a developer-context string that the model may follow. It does not activate a skill or workflow by itself. It is a best-effort hint, not a guarantee. + +Note: `explore`, `executor`, and `designer` are agent role-prompt files under `prompts/`, not workflow skills. + +Explicit keywords remain the deterministic control surface when you want explicit, guaranteed routing — use them whenever exact behavior matters. + +To opt out per prompt with phrases such as `no workflow`, `just chat`, or `plain answer` — the triage layer will suppress context injection for that prompt. + + +Ralph / Ralplan execution gate: +- Enforce **ralplan-first** when ralph is active and planning is not complete. +- Planning is complete only after both `.omx/plans/prd-*.md` and `.omx/plans/test-spec-*.md` exist. +- Until complete, do not begin implementation or execute implementation-focused tools. + + +--- + + +Skills are workflow commands. +Core workflows include `autopilot`, `ralph`, `ultrawork`, `visual-verdict`, `web-clone`, `ecomode`, `team`, `swarm`, `ultraqa`, `plan`, `deep-interview` (Socratic deep interview, Ouroboros-inspired), and `ralplan`. +Utilities include `cancel`, `note`, `doctor`, `help`, and `trace`. + + +--- + + +Common team compositions remain available when explicit team orchestration is warranted, for example feature development, bug investigation, code review, and UX audit. + + +--- + + +Team mode is the structured multi-agent surface. +Canonical pipeline: +`team-plan -> team-prd -> team-exec -> team-verify -> team-fix (loop)` + +Use it when durable staged coordination is worth the overhead. Otherwise, stay direct. +Terminal states: `complete`, `failed`, `cancelled`. + + +--- + + +Team/Swarm workers currently share one `agentType` and one launch-arg set. +Model precedence: +1. Explicit model in `OMX_TEAM_WORKER_LAUNCH_ARGS` +2. Inherited leader `--model` +3. Low-complexity default model from `OMX_DEFAULT_SPARK_MODEL` (legacy alias: `OMX_SPARK_MODEL`) + +Normalize model flags to one canonical `--model ` entry. +Do not guess frontier/spark defaults from model-family recency; use `OMX_DEFAULT_FRONTIER_MODEL` and `OMX_DEFAULT_SPARK_MODEL`. + + + +## Model Capability Table + +Auto-generated by `omx setup` from the current `config.toml` plus OMX model overrides. + +| Role | Model | Reasoning Effort | Use Case | +| --- | --- | --- | --- | +| Frontier (leader) | `gpt-5.5` | high | Primary leader/orchestrator for planning, coordination, and frontier-class reasoning. | +| Spark (explorer/fast) | `gpt-5.3-codex-spark` | low | Fast triage, explore, lightweight synthesis, and low-latency routing. | +| Standard (subagent default) | `gpt-5.5` | high | Default standard-capability model for installable specialists and secondary worker lanes unless a role is explicitly frontier or spark. | +| `explore` | `gpt-5.3-codex-spark` | low | Fast codebase search and file/symbol mapping (fast-lane, fast) | +| `analyst` | `gpt-5.5` | medium | Requirements clarity, acceptance criteria, hidden constraints (frontier-orchestrator, frontier) | +| `planner` | `gpt-5.4-mini` | high | Task sequencing, execution plans, risk flags (frontier-orchestrator, frontier) | +| `architect` | `gpt-5.4-mini` | high | System design, boundaries, interfaces, long-horizon tradeoffs (frontier-orchestrator, frontier) | +| `debugger` | `gpt-5.5` | high | Root-cause analysis, regression isolation, failure diagnosis (deep-worker, standard) | +| `executor` | `gpt-5.5` | medium | Code implementation, refactoring, feature work (deep-worker, standard) | +| `team-executor` | `gpt-5.5` | medium | Supervised team execution for conservative delivery lanes (deep-worker, frontier) | +| `verifier` | `gpt-5.5` | high | Completion evidence, claim validation, test adequacy (frontier-orchestrator, standard) | +| `code-reviewer` | `gpt-5.5` | high | Comprehensive review across all concerns (frontier-orchestrator, frontier) | +| `dependency-expert` | `gpt-5.5` | high | External SDK/API/package evaluation (frontier-orchestrator, standard) | +| `test-engineer` | `gpt-5.5` | medium | Test strategy, coverage, flaky-test hardening (deep-worker, frontier) | +| `designer` | `gpt-5.5` | high | UX/UI architecture, interaction design (deep-worker, standard) | +| `writer` | `gpt-5.5` | high | Documentation, migration notes, user guidance (fast-lane, standard) | +| `git-master` | `gpt-5.5` | high | Commit strategy, history hygiene, rebasing (deep-worker, standard) | +| `code-simplifier` | `gpt-5.5` | high | Simplifies recently modified code for clarity and consistency without changing behavior (deep-worker, frontier) | +| `researcher` | `gpt-5.4-mini` | high | External documentation and reference research (fast-lane, standard) | +| `prometheus-strict-metis` | `gpt-5.5` | high | Prometheus Strict requirements interviewer and ambiguity mapper (frontier-orchestrator, frontier) | +| `prometheus-strict-momus` | `gpt-5.5` | high | Prometheus Strict adversarial plan critic and risk challenger (frontier-orchestrator, frontier) | +| `prometheus-strict-oracle` | `gpt-5.5` | high | Prometheus Strict implementation readiness verifier and handoff judge (frontier-orchestrator, standard) | +| `critic` | `gpt-5.5` | high | Plan/design critical challenge and review (frontier-orchestrator, frontier) | +| `scholastic` | `gpt-5.5` | high | Ontology-first reasoning reviewer: category mistakes, hidden assumptions, modality separation, scholastic critique, and minimal-repair proposals (frontier-orchestrator, frontier) | +| `vision` | `gpt-5.5` | low | Image/screenshot/diagram analysis (fast-lane, frontier) | + + +--- + + +Verify before claiming completion. + +Sizing guidance: +- Small changes: lightweight verification +- Standard changes: standard verification +- Large or security/architectural changes: thorough verification + + +Verification loop: identify what proves the claim, run the verification, read the output, then report with evidence. If verification fails, continue iterating rather than reporting incomplete work. Default to quality-first evidence summaries: think one more step before declaring completion, and include enough detail to make the proof actionable without padding. + +- Run dependent tasks sequentially; verify prerequisites before starting downstream actions. +- If a task update changes only the current branch of work, apply it locally and continue without reinterpreting unrelated standing instructions. +- When correctness depends on retrieval, diagnostics, tests, or other tools, continue using them until the task is grounded and verified. + + + + +Mode selection: +- Use `$deep-interview` first when the request is broad, intent/boundaries are unclear, or the user says not to assume. +- Use `$ralplan` when the requirements are clear enough but architecture, tradeoffs, or test strategy still need consensus. +- Use `$team` when the approved plan has multiple independent lanes, shared blockers, or durable coordination needs. +- Use `$ralph` when the approved plan should stay in a persistent completion / verification loop with one owner. +- Otherwise execute directly in solo mode. +- Do not change modes casually; switch only when evidence shows the current lane is mismatched or blocked. + +Command routing: +- When `USE_OMX_EXPLORE_CMD` enables advisory routing, strongly prefer `omx explore` as the default surface for simple read-only repository lookup tasks (files, symbols, patterns, relationships). +- For simple file/symbol lookups, use `omx explore` FIRST before attempting full code analysis. + +When to use what: +- Use `omx explore --prompt ...` for simple read-only lookups. +- Use `omx sparkshell` for noisy read-only shell commands, bounded verification runs, repo-wide listing/search, or tmux-pane summaries; `omx sparkshell --tmux-pane ...` is explicit opt-in. +- Keep ambiguous, implementation-heavy, edit-heavy, or non-shell-only work on the richer normal path. +- `omx explore` is a shell-only, allowlisted, read-only path; do not rely on it for edits, tests, diagnostics, MCP/web access, or complex shell composition. +- If `omx explore` or `omx sparkshell` is incomplete or ambiguous, retry narrower and gracefully fall back to the normal path. + +Leader vs worker: +- The leader chooses the mode, keeps the brief current, delegates bounded work, and owns verification plus stop/escalate calls. +- Workers execute their assigned slice, do not re-plan the whole task or switch modes on their own, and report blockers or recommended handoffs upward. +- Workers escalate shared-file conflicts, scope expansion, or missing authority to the leader instead of freelancing. + +Stop / escalate: +- Stop when the task is verified complete, the user says stop/cancel, or no meaningful recovery path remains. +- Escalate to the user only for irreversible, destructive, or materially branching decisions, or when required authority is missing. +- Escalate from worker to leader for blockers, scope expansion, shared ownership conflicts, or mode mismatch. +- `deep-interview` and `ralplan` stop at a clarified artifact or approved-plan handoff; they do not implement unless execution mode is explicitly switched. + +Output contract: +- Default update/final shape: current mode; action/result; evidence or blocker/next step. +- Keep rationale once; do not restate the full plan every turn. +- Expand only for risk, handoff, or explicit user request. + +Parallelization: +- Run independent tasks in parallel. +- Run dependent tasks sequentially. +- Use background execution for builds and tests when helpful. +- Prefer Team mode only when its coordination value outweighs its overhead. +- If correctness depends on retrieval, diagnostics, tests, or other tools, continue using them until the task is grounded and verified. + +Anti-slop workflow: +- Cleanup/refactor/deslop work still follows the same `$deep-interview` -> `$ralplan` -> `$team`/`$ralph` path; use `$ai-slop-cleaner` as a bounded helper inside the chosen execution lane, not as a competing top-level workflow. +- Lock behavior with tests first, then make one smell-focused pass at a time. +- Prefer deletion, reuse, and boundary repair over new layers. +- Keep writer/reviewer pass separation for cleanup plans and approvals. + +Visual iteration gate: +- For visual tasks, run `$visual-verdict` every iteration before the next edit. +- Persist verdict JSON in `.omx/state/{scope}/ralph-progress.json`. + +Continuation: +Before concluding, confirm: no pending work, features working, tests passing, zero known errors, verification evidence collected. If not, continue. + +Ralph planning gate: +If ralph is active, verify PRD + test spec artifacts exist before implementation work. + + + +Use the `cancel` skill to end execution modes. +Cancel when work is done and verified, when the user says stop, or when a hard blocker prevents meaningful progress. +Do not cancel while recoverable work remains. + + +--- + + +Hooks own normal skill-active and workflow-state persistence under `.omx/state/`. + +OMX persists runtime state under `.omx/`: +- `.omx/state/` — mode state +- `.omx/notepad.md` — session notes +- `.omx/project-memory.json` — cross-session memory +- `.omx/plans/` — plans +- `.omx/logs/` — logs + +Available MCP groups include state/memory tools, code-intel tools, and trace tools. + +Agents may use OMX state/MCP tools for explicit lifecycle transitions, recovery, checkpointing, cancellation cleanup, or compaction resilience. +Do not manually duplicate hook-owned activation state unless recovering from missing or stale state. + + +--- + +## Setup + +Execute `omx setup` to install all components. Execute `omx doctor` to verify installation. + +@/home/smog/.codex/RTK.md + + + +**Session:** omx-1783886220848-ugrwhe | 2026-07-12T19:57:02.802Z + +**Native Subagent Routing:** +When spawning Codex native subagents, always set `agent_type` to an installed OMX role. +Use the most specific role (`architect`, `code-reviewer`, `critic`, `planner`, `debugger`, etc.); use `executor` only for generic implementation work. +Never omit `agent_type` for OMX work: untyped Task subagents appear as default subagents and lose role-specific prompts/routing. + +**Repository Lookup Routing:** use normal Codex repository inspection tools/subagents as the default surface for simple read-only repository lookup and implementation context. +- Use `omx sparkshell -- ` only for explicit shell-native read-only evidence or `--tmux-pane` summaries; it does not replace raw evidence capture. + +**Compaction Protocol:** +Before context compaction, preserve critical state: +1. Write progress checkpoint via `omx state write --input '' --json` +2. Save key decisions via `omx notepad write-working --input '' --json` +3. Before large Team work near compaction, reload `.omx/state/team//preflight-context.json` +4. If context is >80% full, proactively checkpoint state + + diff --git a/.omx/state/sessions/omx-1783886220848-ugrwhe/hud-state.json b/.omx/state/sessions/omx-1783886220848-ugrwhe/hud-state.json new file mode 100644 index 0000000..13f7737 --- /dev/null +++ b/.omx/state/sessions/omx-1783886220848-ugrwhe/hud-state.json @@ -0,0 +1,6 @@ +{ + "last_turn_at": "2026-07-12T20:05:19.938Z", + "last_progress_at": "2026-07-12T20:05:19.938Z", + "turn_count": 1, + "last_agent_output": "Готов продолжить, но в этой сессии мне недоступен терминальный инструмент для просмотра и изменения " +} \ No newline at end of file diff --git a/.omx/state/sessions/omx-1783886220848-ugrwhe/notify-hook-state.json b/.omx/state/sessions/omx-1783886220848-ugrwhe/notify-hook-state.json new file mode 100644 index 0000000..9a88f8f --- /dev/null +++ b/.omx/state/sessions/omx-1783886220848-ugrwhe/notify-hook-state.json @@ -0,0 +1,6 @@ +{ + "recent_turns": { + "019f57e4-d006-76e2-b9bf-99950205bb6d|019f57ee-f2d7-7392-b4c5-421e31f54265|agent-turn-complete": 1783886719927 + }, + "last_event_at": "2026-07-12T20:05:19.928Z" +} \ No newline at end of file diff --git a/.omx/state/subagent-tracking.json b/.omx/state/subagent-tracking.json new file mode 100644 index 0000000..9127346 --- /dev/null +++ b/.omx/state/subagent-tracking.json @@ -0,0 +1,50 @@ +{ + "schemaVersion": 1, + "sessions": { + "omx-1783886220848-ugrwhe": { + "session_id": "omx-1783886220848-ugrwhe", + "leader_thread_id": "019f57e4-d006-76e2-b9bf-99950205bb6d", + "updated_at": "2026-07-12T20:05:19.929Z", + "threads": { + "019f57e4-d006-76e2-b9bf-99950205bb6d": { + "thread_id": "019f57e4-d006-76e2-b9bf-99950205bb6d", + "kind": "leader", + "first_seen_at": "2026-07-12T20:05:19.929Z", + "last_seen_at": "2026-07-12T20:05:19.929Z", + "last_turn_id": "019f57ee-f2d7-7392-b4c5-421e31f54265", + "turn_count": 1 + } + } + }, + "019f57e4-d006-76e2-b9bf-99950205bb6d": { + "session_id": "019f57e4-d006-76e2-b9bf-99950205bb6d", + "leader_thread_id": "019f57e4-d006-76e2-b9bf-99950205bb6d", + "updated_at": "2026-07-13T16:20:24.425Z", + "threads": { + "019f57e4-d006-76e2-b9bf-99950205bb6d": { + "thread_id": "019f57e4-d006-76e2-b9bf-99950205bb6d", + "kind": "leader", + "first_seen_at": "2026-07-13T16:20:24.425Z", + "last_seen_at": "2026-07-13T16:20:24.425Z", + "last_turn_id": "019f5c47-837d-7491-84c8-6e32542b3ec2", + "turn_count": 1 + } + } + }, + "019f5c48-1130-7663-b700-14621eff9671": { + "session_id": "019f5c48-1130-7663-b700-14621eff9671", + "leader_thread_id": "019f5c48-1130-7663-b700-14621eff9671", + "updated_at": "2026-07-13T16:21:43.903Z", + "threads": { + "019f5c48-1130-7663-b700-14621eff9671": { + "thread_id": "019f5c48-1130-7663-b700-14621eff9671", + "kind": "leader", + "first_seen_at": "2026-07-13T16:21:43.903Z", + "last_seen_at": "2026-07-13T16:21:43.903Z", + "last_turn_id": "019f5c48-2c0f-7102-9710-8f60fbe7db48", + "turn_count": 1 + } + } + } + } +} diff --git a/.omx/state/team-leader-nudge.json b/.omx/state/team-leader-nudge.json new file mode 100644 index 0000000..96f0509 --- /dev/null +++ b/.omx/state/team-leader-nudge.json @@ -0,0 +1,5 @@ +{ + "last_nudged_by_team": {}, + "last_idle_nudged_by_team": {}, + "progress_by_team": {} +} \ No newline at end of file diff --git a/.omx/state/tmux-extended-keys/tmp-tmux-1000-default.json b/.omx/state/tmux-extended-keys/tmp-tmux-1000-default.json new file mode 100644 index 0000000..68b61b9 --- /dev/null +++ b/.omx/state/tmux-extended-keys/tmp-tmux-1000-default.json @@ -0,0 +1,11 @@ +{ + "originalMode": "off", + "holders": [ + { + "id": "68736-1783886223054-29cab331337a6", + "pid": 68736, + "platform": "linux", + "linuxStartTicks": 1155192 + } + ] +} \ No newline at end of file diff --git a/.omx/state/tmux-hook-state.json b/.omx/state/tmux-hook-state.json new file mode 100644 index 0000000..a3d53d0 --- /dev/null +++ b/.omx/state/tmux-hook-state.json @@ -0,0 +1,9 @@ +{ + "total_injections": 0, + "pane_counts": {}, + "session_counts": {}, + "recent_keys": {}, + "last_injection_ts": 0, + "last_reason": "disabled", + "last_event_at": "2026-07-13T16:21:43.917Z" +} \ No newline at end of file diff --git a/.omx/state/update-check.json b/.omx/state/update-check.json new file mode 100644 index 0000000..9bc7480 --- /dev/null +++ b/.omx/state/update-check.json @@ -0,0 +1,4 @@ +{ + "last_checked_at": "2026-07-12T19:57:00.848Z", + "last_seen_latest": "0.20.1" +} \ No newline at end of file diff --git a/PI-BACKUP-README.md b/PI-BACKUP-README.md new file mode 100644 index 0000000..92b5f71 --- /dev/null +++ b/PI-BACKUP-README.md @@ -0,0 +1,204 @@ +# Бэкап среды Pi Coding Agent + +Файлы рядом: + +- `pi-env-backup.sh` — скрипт создания, проверки и восстановления бэкапа; +- `PI-BACKUP-README.md` — эта инструкция. + +Скрипт переносит именно среду Pi, а не проекты. + +## Что сохраняется + +- `~/.pi/agent/settings.json` — глобальные настройки Pi; +- `~/.pi/agent/auth.json` — авторизация и API-ключи; +- `~/.pi/agent/mcp.json` и `~/.pi/agent/mcp-oauth/` — MCP; +- `~/.pi/agent/models.json`, `models.yml` — настройки моделей; +- `~/.pi/agent/extensions/`, `skills/`, `npm/`, `git/` — плагины и Pi packages; +- `~/.pi/agent/AGENTS.md`, `keybindings.json`, `trust.json`; +- `~/.pi/agent/sessions/` — история сессий (**по умолчанию не сохраняется**); +- `~/.pi/agent/pi-hermes-memory/` и `projects-memory/` — память; +- `~/.pi/context-mode/` — индексы и локальные данные context-mode (**по умолчанию не сохраняются**); +- `~/.pi/agent/ayu/checkpoints/` — checkpoints (**по умолчанию не сохраняются**); +- `~/.agents/` — дополнительные пользовательские skills; +- `~/.pi/local-docs/`, если каталог существует. + +Архив также содержит манифест версий установленных программ и копию самого скрипта для восстановления. + +> **Внимание:** архив содержит секреты из `auth.json`, MCP OAuth и других конфигов. Не выкладывай его в публичное хранилище. + +--- + +## 1. Создать полный бэкап + +Закрой все запущенные Pi: + +```bash +pkill -f pi-coding-agent || true +``` + +Создай каталог для архивов и запусти: + +```bash +mkdir -p ~/pi-backups +cd /home/smog/main +./pi-env-backup.sh backup ~/pi-backups +``` + +Или сразу на внешний диск: + +```bash +./pi-env-backup.sh backup /media/smog/SSD +``` + +На выходе будут два файла: + +```text +pi-backup-YYYYMMDD-HHMMSS.tar.zst +pi-backup-YYYYMMDD-HHMMSS.tar.zst.sha256 +``` + +По умолчанию архив НЕ включает `ayu/checkpoints`, историю Pi-сессий и `context-mode`: это кэш/история, не нужные для работы плагинов. Поэтому архив обычно будет порядка **0.8–1 ГБ до сжатия** и ориентировочно **0.4–0.8 ГБ после zstd**. Точный размер скрипт покажет в конце. + +--- + +## 2. Проверить архив + +Посмотреть содержимое: + +```bash +./pi-env-backup.sh list ~/pi-backups/pi-backup-*.tar.zst +``` + +Проверить контрольную сумму: + +```bash +sha256sum -c ~/pi-backups/pi-backup-*.tar.zst.sha256 +``` + +--- + +## 3. Дополнительные варианты бэкапа + +По умолчанию уже создаётся облегчённый бэкап: плагины, настройки, auth, MCP, memory и skills сохраняются, а checkpoints/сессии/context-mode — нет. + +Включить историю старых Pi-сессий: + +```bash +PI_BACKUP_INCLUDE_SESSIONS=1 \ + ./pi-env-backup.sh backup ~/pi-backups +``` + +Включить context-mode индексы: + +```bash +PI_BACKUP_INCLUDE_CONTEXT=1 \ + ./pi-env-backup.sh backup ~/pi-backups +``` + +Включить старые ayu checkpoints (обычно не нужно): + +```bash +PI_BACKUP_INCLUDE_AYU=1 \ + ./pi-env-backup.sh backup ~/pi-backups +``` + +Включить всё сразу: + +```bash +PI_BACKUP_INCLUDE_SESSIONS=1 \ +PI_BACKUP_INCLUDE_CONTEXT=1 \ +PI_BACKUP_INCLUDE_AYU=1 \ + ./pi-env-backup.sh backup ~/pi-backups +``` + +Настройки, auth, MCP, memory, плагины и skills сохраняются во всех вариантах. + +--- + +## 4. Восстановить на ноутбуке в WSL + +На ноутбуке установи базовые инструменты: + +```bash +sudo apt update +sudo apt install -y zstd nodejs npm +``` + +Передай на ноутбук архив и `.sha256` рядом с ним. Проверь архив: + +```bash +sha256sum -c pi-backup-YYYYMMDD-HHMMSS.tar.zst.sha256 +``` + +Если бэкап был скачан из этого Git-репозитория, сначала забери LFS-файлы и собери архив из частей: + +```bash +git lfs pull +chmod +x assemble-pi-backup.sh +./assemble-pi-backup.sh pi-backup-YYYYMMDD-HHMMSS.tar.zst +``` + +Скрипт соберёт `*.part-*` в исходный `.tar.zst` и сразу проверит контрольную сумму. + +Извлеки встроенную копию restore-скрипта: + +```bash +zstd -dc pi-backup-YYYYMMDD-HHMMSS.tar.zst \ + | tar -xOf - meta/pi-env-backup.sh > pi-env-restore.sh + +chmod +x pi-env-restore.sh +``` + +Запусти восстановление: + +```bash +./pi-env-restore.sh restore pi-backup-YYYYMMDD-HHMMSS.tar.zst +``` + +Скрипт распакует Pi-среду в домашний каталог текущего пользователя WSL. Если `~/.pi/agent` уже существует, он сначала переименует его в каталог вида: + +```text +~/.pi/agent.before-restore-YYYYMMDD-HHMMSS +``` + +Если Pi ещё не установлен, скрипт установит его так: + +```bash +npm install -g --ignore-scripts @earendil-works/pi-coding-agent +``` + +--- + +## 5. Проверить восстановление + +```bash +pi --version +pi list +``` + +Запусти Pi в одном из своих проектов: + +```bash +cd ~/main/имя-проекта +pi +``` + +Проверь: + +```text +/mcp +/login # только если OAuth/API-ключ не восстановился +``` + +Если какие-то внешние программы нужны плагинам, установи их отдельно: `bun`, `pnpm`, `uv`, `gh`, `jj`, `docker` и т.п. Их бинарники не копируются архивом — архив переносит состояние Pi и список обнаруженных инструментов в `meta/MANIFEST.txt`. + +--- + +## 6. Важные замечания + +1. Перед созданием архива закрывай Pi, чтобы не копировать активные session/SQLite-файлы. +2. Не используй `PI_BACKUP_ALLOW_RUNNING=1`, если нет особой причины. +3. Архив — это переносимая копия пользовательской Pi-среды, но не копия всей ОС. +4. Проекты не входят в этот архив: они уже есть в WSL отдельно. +5. Project-local файлы вроде `project/.pi/`, `project/.agents/`, `AGENTS.md` и `CLAUDE.md` не входят в глобальный архив, если находятся внутри проектов. Их нужно хранить вместе с проектами или отдельно скопировать. +6. Некоторые OAuth-провайдеры могут потребовать повторный `/login` на новом ноутбуке. diff --git a/assemble-pi-backup.sh b/assemble-pi-backup.sh new file mode 100755 index 0000000..ef41551 --- /dev/null +++ b/assemble-pi-backup.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +# Reassemble a Git-LFS split Pi backup after `git lfs pull`. +# Usage: ./assemble-pi-backup.sh [backup-base-name] + +base=${1:-pi-backup-20260714-002452.tar.zst} +shopt -s nullglob +parts=("${base}".part-*) + +(( ${#parts[@]} > 0 )) || { + printf 'No archive parts found for %s\n' "$base" >&2 + exit 1 +} + +for command in cat sha256sum; do + command -v "$command" >/dev/null || { + printf 'Required command is unavailable: %s\n' "$command" >&2 + exit 1 + } +done + +cat "${parts[@]}" > "$base" +printf 'Created: %s\n' "$base" + +if [[ -f "${base}.sha256" ]]; then + sha256sum -c "${base}.sha256" +else + printf 'Checksum file not found: %s.sha256\n' "$base" >&2 +fi diff --git a/pi-backup-20260714-002452.tar.zst.part-000 b/pi-backup-20260714-002452.tar.zst.part-000 new file mode 100644 index 0000000..8310761 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-000 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:688047809fed30b0dc024bfd6ead28320c7ffe9470eefe1ef2d0aaa7893c4776 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-001 b/pi-backup-20260714-002452.tar.zst.part-001 new file mode 100644 index 0000000..e0ac0fd --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-001 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b175b4a01d1fb041b69179eae6530af02cb0b9a43b1e177cdebe9587610e9802 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-002 b/pi-backup-20260714-002452.tar.zst.part-002 new file mode 100644 index 0000000..ed4fc2a --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-002 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:586c648c8c02e957c24579270d34f6f5f458722ecc3b7b61722c7383ab545c22 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-003 b/pi-backup-20260714-002452.tar.zst.part-003 new file mode 100644 index 0000000..8377385 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-003 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9745f35ec9adb9ae82fe0128d8615c7449c234b7467ad22e7ee519e666133528 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-004 b/pi-backup-20260714-002452.tar.zst.part-004 new file mode 100644 index 0000000..b13e71b --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-004 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:372193178d87c42767d7538b59f90339c9736aa2849cfaab1211020efb8aec61 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-005 b/pi-backup-20260714-002452.tar.zst.part-005 new file mode 100644 index 0000000..53f379c --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-005 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a7faf5216e2aceb1965a49e8ad470026037e677e5d24a2291b4da8a3779db11 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-006 b/pi-backup-20260714-002452.tar.zst.part-006 new file mode 100644 index 0000000..32138fd --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-006 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d107a5978f34ede0240b432508e1e23715159c3b6679e880f3d999897a2a560 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-007 b/pi-backup-20260714-002452.tar.zst.part-007 new file mode 100644 index 0000000..9172e97 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-007 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f6442577991349d79063e4e389c6a05f4421dd4a61e9f1c5f2a45330373dbdd +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-008 b/pi-backup-20260714-002452.tar.zst.part-008 new file mode 100644 index 0000000..87ab79c --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-008 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6a49443c35501815ed5e651c079297d3fedb5e6dc89207680b5a9a81e39a1a98 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-009 b/pi-backup-20260714-002452.tar.zst.part-009 new file mode 100644 index 0000000..4fe6cbc --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-009 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:390009ee60b52c0fc0c5593a2d9565dc13faa3fb238f62aaff76a02598d9a557 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-010 b/pi-backup-20260714-002452.tar.zst.part-010 new file mode 100644 index 0000000..4d54f3c --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-010 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0ac135ea4309429fc5ecf91e2884308dbee310e1e07e2c4de7c441b109270de +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-011 b/pi-backup-20260714-002452.tar.zst.part-011 new file mode 100644 index 0000000..1d46a80 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-011 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b74c34459d02aa5cf260f7c4afb5d5c45c96946eb30364ba855e530adf30f877 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-012 b/pi-backup-20260714-002452.tar.zst.part-012 new file mode 100644 index 0000000..bcf5155 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-012 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e20e86928e74961b558b7e1c34876d4ccbd8021c691ca124937bbe404a22d643 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-013 b/pi-backup-20260714-002452.tar.zst.part-013 new file mode 100644 index 0000000..522f74d --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-013 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eec0926ef4b1813322927bde4f390a92f52ca4459f5ded20aa11c48afcbec0f4 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-014 b/pi-backup-20260714-002452.tar.zst.part-014 new file mode 100644 index 0000000..c06c94d --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-014 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8fd6246e32c2caae6955ed2314702eb9855ef3675eac0cb899487b182480b3d +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-015 b/pi-backup-20260714-002452.tar.zst.part-015 new file mode 100644 index 0000000..8298779 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-015 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ae98995a81ded36cfbe61c1f75e28be9dae385a3d1f40438ef761529b7d1706 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-016 b/pi-backup-20260714-002452.tar.zst.part-016 new file mode 100644 index 0000000..a2e46d3 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-016 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da074d70f764cac600ff55d74f9fa5192e3360747aed03940255357cef475ea4 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-017 b/pi-backup-20260714-002452.tar.zst.part-017 new file mode 100644 index 0000000..068eef8 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-017 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3375838fb4efc8fc22adb9944937a1064e2aef4732e91d26d83592f390da512 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-018 b/pi-backup-20260714-002452.tar.zst.part-018 new file mode 100644 index 0000000..07fd886 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-018 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8cf4e7210fe27d0ae35ddb178b3eb4e0e0ffcb523a03228e89e869c3e396416f +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-019 b/pi-backup-20260714-002452.tar.zst.part-019 new file mode 100644 index 0000000..cb257f5 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-019 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e39992796362cf530a7085b09db2194bfae29738ed22c3ed429ef87951cc3408 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-020 b/pi-backup-20260714-002452.tar.zst.part-020 new file mode 100644 index 0000000..38a8016 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-020 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5927ddc57cef7a20279854358a2f76cf695fd7f05f3c0e97c435597e2707a48 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-021 b/pi-backup-20260714-002452.tar.zst.part-021 new file mode 100644 index 0000000..66205a0 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-021 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26ecfcf83c8cf9cf57313cd28c6fb599cc3b861e41cc476a2a6617f43d931214 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-022 b/pi-backup-20260714-002452.tar.zst.part-022 new file mode 100644 index 0000000..5e54837 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-022 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f7435c2b0e721eccf182161edac45b97fcf4ccf688f2d23eedb1c5c8210fb12 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-023 b/pi-backup-20260714-002452.tar.zst.part-023 new file mode 100644 index 0000000..04a5c36 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-023 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4067fd56d0201e00fff8e33a370c38766f2616eec5ca5b9cdc88739cef5fc808 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-024 b/pi-backup-20260714-002452.tar.zst.part-024 new file mode 100644 index 0000000..e36ffbc --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-024 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ce8221e2042f1745840505fce29f578726feefd05aad485c16b48b735926fb6 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-025 b/pi-backup-20260714-002452.tar.zst.part-025 new file mode 100644 index 0000000..a5d3fa6 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-025 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f16da30790f23e87886b763b55a3d9aced4852610895760e90eb3d71790601c +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-026 b/pi-backup-20260714-002452.tar.zst.part-026 new file mode 100644 index 0000000..d3f3cd2 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-026 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b6e8e01229624b715e668e83030709fe7c5a0e006fd6a3a2bc41444c7501919 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-027 b/pi-backup-20260714-002452.tar.zst.part-027 new file mode 100644 index 0000000..9abecf5 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-027 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98328c5b20817259568998212d767f6fad19dda876968768664ca29c2b7aba76 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-028 b/pi-backup-20260714-002452.tar.zst.part-028 new file mode 100644 index 0000000..f9d1423 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-028 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:34d1f66e42e7026d2f50e46be1276871f83fa8475f57ac3ed487563b80d81bfb +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-029 b/pi-backup-20260714-002452.tar.zst.part-029 new file mode 100644 index 0000000..5805255 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-029 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca7efe56b52d5cd1f4004928abb838e9852de4900faad8eb1efb9aafce1240a9 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-030 b/pi-backup-20260714-002452.tar.zst.part-030 new file mode 100644 index 0000000..32ecb30 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-030 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f23327babeae221360e433ed4ed24e5594624cefd3568c862048ac7376a18c49 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-031 b/pi-backup-20260714-002452.tar.zst.part-031 new file mode 100644 index 0000000..7f3cefd --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-031 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b70fdd539e48c44c32f9de28b6f7e8680eb58f88472f1bdcbd8e65f833924ed9 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-032 b/pi-backup-20260714-002452.tar.zst.part-032 new file mode 100644 index 0000000..853e594 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-032 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:984a7c3072352d1b8bdeb6b44d62ec5476eb61a80ae6ed5ea8a31b196e7cc906 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-033 b/pi-backup-20260714-002452.tar.zst.part-033 new file mode 100644 index 0000000..0850b8c --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-033 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0a4dc3127551c386d8140b387f8cd9e06a2b97a23425c47e7c8ccb123ae51964 +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-034 b/pi-backup-20260714-002452.tar.zst.part-034 new file mode 100644 index 0000000..99a85a1 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-034 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:69b299d56115dc7fc10701c20d9146d5321fff51b50d5d7259b471447836e0dc +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-035 b/pi-backup-20260714-002452.tar.zst.part-035 new file mode 100644 index 0000000..4e23540 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-035 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2a1bdea30ec6098888121450b16cf8bbdec2883d5d74d42a7a349c4281eef9a +size 5242880 diff --git a/pi-backup-20260714-002452.tar.zst.part-036 b/pi-backup-20260714-002452.tar.zst.part-036 new file mode 100644 index 0000000..083b9a6 --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.part-036 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3138dd01f9d4bc5dc7aac0d74285b28b96319555f6c7cc26128be7bdc5fe0e0 +size 167333 diff --git a/pi-backup-20260714-002452.tar.zst.sha256 b/pi-backup-20260714-002452.tar.zst.sha256 new file mode 100644 index 0000000..d9e039e --- /dev/null +++ b/pi-backup-20260714-002452.tar.zst.sha256 @@ -0,0 +1 @@ +3ec111d74ed5283e6fefb6e395259576429b113baf04ab050ffea4673c409ed3 ./pi-backup-20260714-002452.tar.zst diff --git a/pi-env-backup.sh b/pi-env-backup.sh new file mode 100755 index 0000000..4070cae --- /dev/null +++ b/pi-env-backup.sh @@ -0,0 +1,215 @@ +#!/usr/bin/env bash +set -Eeuo pipefail + +# Portable backup/restore for Pi Coding Agent. +# Usage: +# ./pi-env-backup.sh backup [destination-dir] +# ./pi-env-backup.sh list +# ./pi-env-backup.sh restore + +PROGRAM=${0##*/} +SELF_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) + +log() { printf '[pi-backup] %s\n' "$*"; } +fail() { printf '[pi-backup] ERROR: %s\n' "$*" >&2; exit 1; } +need() { command -v "$1" >/dev/null 2>&1 || fail "Не найдено: $1"; } + +usage() { + cat <<'EOF' +Portable Pi Coding Agent backup + +Создать бэкап: + ./pi-env-backup.sh backup [папка-для-архива] + +Посмотреть содержимое: + ./pi-env-backup.sh list + +Восстановить на ноутбуке/WSL: + ./pi-env-backup.sh restore <архив> + +Переменные: + PI_BACKUP_INCLUDE_SESSIONS=1 включить историю Pi-сессий (по умолчанию 0) + PI_BACKUP_INCLUDE_CONTEXT=1 включить context-mode index/cache (по умолчанию 0) + PI_BACKUP_INCLUDE_AYU=1 включить ayu/checkpoints (по умолчанию 0; обычно не нужно) + PI_BACKUP_ALLOW_RUNNING=1 не предупреждать о запущенном Pi +EOF +} + +running_processes() { + pgrep -af '(^|/)(pi|pi-coding-agent)( |$)' 2>/dev/null || true +} + +make_manifest() { + local file=$1 + { + echo "created_at=$(date -Is)" + echo "source_user=$USER" + echo "source_home=$HOME" + echo "hostname=$(hostname)" + echo "uname=$(uname -srmo)" + echo "pi_version=$(pi --version 2>/dev/null || echo unavailable)" + echo "node_version=$(node --version 2>/dev/null || echo unavailable)" + echo "npm_version=$(npm --version 2>/dev/null || echo unavailable)" + echo "shell=${SHELL:-unknown}" + echo + echo '[installed-pi-packages]' + pi list 2>/dev/null || true + echo + echo '[external-tools]' + for tool in pi node npm npx bun pnpm python3 pipx git gh jj rg fd docker zstd; do + if command -v "$tool" >/dev/null 2>&1; then + printf '%s: ' "$tool" + case "$tool" in + pi) pi --version 2>&1 || true ;; + node|bun|pnpm|python3|git|gh|jj|rg|fd|docker|zstd) "$tool" --version 2>&1 || true ;; + npm|npx|pipx) "$tool" --version 2>&1 || true ;; + esac + fi + done + echo + echo '[paths]' + find "$HOME/.pi/agent" "$HOME/.agents" -maxdepth 2 -type d 2>/dev/null | sort || true + } > "$file" +} + +backup() { + local dest=${1:-$PWD} + mkdir -p "$dest" + need tar + need pi + + if [[ "${PI_BACKUP_ALLOW_RUNNING:-0}" != 1 ]] && [[ -n "$(running_processes)" ]]; then + fail "Pi запущен. Закрой Pi и повтори. Для принудительного режима: PI_BACKUP_ALLOW_RUNNING=1" + fi + + local stamp archive ext compressor tmp root + stamp=$(date +%Y%m%d-%H%M%S) + tmp=$(mktemp -d) + trap 'rm -rf "$tmp"' RETURN + root="$tmp/pi-backup" + mkdir -p "$root/meta" + + make_manifest "$root/meta/MANIFEST.txt" + cp "$SELF_DIR/pi-env-backup.sh" "$root/meta/pi-env-backup.sh" + chmod 755 "$root/meta/pi-env-backup.sh" + cat > "$root/meta/RESTORE.md" <<'EOF' +# Pi Coding Agent backup + +Этот архив содержит пользовательское состояние Pi Coding Agent: + +- `~/.pi/agent/settings.json` — настройки, модели и список packages; +- `~/.pi/agent/auth.json` — авторизация/API keys; +- `~/.pi/agent/mcp.json` и `mcp-oauth/` — MCP; +- `~/.pi/agent/extensions/`, `skills/`, `npm/`, `git/` — плагины и пакеты; +- `~/.pi/agent/AGENTS.md`, `keybindings.json`, `trust.json`; +- `~/.pi/agent/sessions/` — история Pi; +- `~/.pi/agent/pi-hermes-memory/`, `projects-memory/` — память; +- `~/.pi/context-mode/` — локальный индекс context-mode; +- `~/.agents/` — внешние пользовательские skills. + +## Восстановление + +Внутри WSL установите Node.js/npm, затем выполните из распакованного архива: + +```bash +bash meta/pi-env-backup.sh restore pi-backup.tar.zst +``` + +Или передайте архив и этот скрипт на ноутбук: + +```bash +bash pi-env-backup.sh restore pi-backup.tar.zst +``` + +Скрипт НЕ переносит бинарник Pi и внешние системные программы. После восстановления +он переустанавливает Pi через npm и проверяет состояние. Авторизация из `auth.json` +переносится, но некоторые OAuth-провайдеры могут попросить повторный `/login`. +EOF + + # Store paths relative to $HOME. Never archive unrelated parts of the home directory. + local -a paths=(.pi/agent .agents) + [[ -d "$HOME/.pi/local-docs" ]] && paths+=(.pi/local-docs) + [[ "${PI_BACKUP_INCLUDE_CONTEXT:-0}" == 1 && -d "$HOME/.pi/context-mode" ]] && paths+=(.pi/context-mode) + if [[ "${PI_BACKUP_INCLUDE_SESSIONS:-0}" != 1 ]]; then + # handled after copying by tar exclusions + log 'История сессий будет исключена (PI_BACKUP_INCLUDE_SESSIONS=0)' + fi + + if command -v zstd >/dev/null 2>&1; then + archive="$dest/pi-backup-$stamp.tar.zst" + compressor=(zstd -T0 -19 -q) + else + archive="$dest/pi-backup-$stamp.tar.gz" + compressor=(gzip -9) + log 'zstd не найден; используется gzip. Для меньшего архива установи zstd.' + fi + + log "Архивирую: ${paths[*]}" + # Build one tar with relative paths only, then compress it. No absolute paths leak. + # По умолчанию не переносим историю, context-mode cache и ayu checkpoints. + # Они не нужны для работы плагинов, но могут занимать десятки гигабайт. + tar_args=(--exclude=.pi/agent/.locks --exclude=.pi/agent/*.lock) + [[ "${PI_BACKUP_INCLUDE_SESSIONS:-0}" != 1 ]] && tar_args+=(--exclude=.pi/agent/sessions) + [[ "${PI_BACKUP_INCLUDE_CONTEXT:-0}" != 1 ]] && tar_args+=(--exclude=.pi/context-mode) + [[ "${PI_BACKUP_INCLUDE_AYU:-0}" != 1 ]] && tar_args+=(--exclude=.pi/agent/ayu) + tar -C "$root" -cf "$tmp/all.tar" meta + tar "${tar_args[@]}" -C "$HOME" -rf "$tmp/all.tar" "${paths[@]}" 2>/dev/null || true + if [[ "$archive" == *.zst ]]; then + zstd -T0 -19 -q "$tmp/all.tar" -o "$archive" + else + gzip -9 -c "$tmp/all.tar" > "$archive" + fi + + chmod 600 "$archive" + sha256sum "$archive" | tee "$archive.sha256" + log "Готово: $archive" + log "Размер: $(du -h "$archive" | awk '{print $1}')" + log 'Архив содержит секреты. Передавай его только по защищённому каналу.' +} + +list_archive() { + local archive=$1 + [[ -f "$archive" ]] || fail "Архив не найден: $archive" + if [[ "$archive" == *.zst ]]; then + need zstd; zstd -dc "$archive" | tar -tvf - + else + tar -tzvf "$archive" + fi +} + +restore() { + local archive=$1 + [[ -f "$archive" ]] || fail "Архив не найден: $archive" + need tar + if [[ "$archive" == *.zst ]]; then need zstd; fi + if [[ -e "$HOME/.pi/agent/settings.json" ]]; then + log 'Обнаружен существующий ~/.pi/agent. Будет создан backup перед заменой.' + mv "$HOME/.pi/agent" "$HOME/.pi/agent.before-restore-$(date +%Y%m%d-%H%M%S)" + fi + mkdir -p "$HOME" + log 'Распаковываю состояние Pi в домашний каталог...' + if [[ "$archive" == *.zst ]]; then + zstd -dc "$archive" | tar -xpf - -C "$HOME" + else + tar -xpf "$archive" -C "$HOME" + fi + chmod 700 "$HOME/.pi" "$HOME/.pi/agent" "$HOME/.agents" 2>/dev/null || true + chmod 600 "$HOME/.pi/agent/auth.json" "$HOME/.pi/agent/mcp.json" 2>/dev/null || true + + if ! command -v pi >/dev/null 2>&1; then + need npm + log 'Pi не найден; устанавливаю текущую версию через npm...' + npm install -g --ignore-scripts @earendil-works/pi-coding-agent + fi + log "Pi: $(pi --version 2>/dev/null || echo 'не удалось определить версию')" + log 'Проверка настроек и установленных packages:' + pi list 2>&1 || true + log 'Восстановление завершено. Если OAuth не подхватился, запусти Pi и выполни /login.' +} + +case "${1:-}" in + backup) backup "${2:-$PWD}" ;; + list) [[ $# -ge 2 ]] || { usage; exit 2; }; list_archive "$2" ;; + restore) [[ $# -ge 2 ]] || { usage; exit 2; }; restore "$2" ;; + *) usage; exit 2 ;; +esac