doubled-graph 3.0.1__tar.gz → 3.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/PKG-INFO +41 -23
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/README.md +40 -22
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/pyproject.toml +1 -1
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/cli.py +28 -1
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/daemon/server.py +7 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/health.py +19 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/integrations/graphd.py +56 -2
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/integrations/service.py +113 -13
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/setup.py +54 -16
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/tools/analyze.py +34 -1
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_cli_daemon.py +149 -6
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_cli_entrypoint.py +3 -3
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_daemon.py +40 -3
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_graphd_client.py +82 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_health.py +69 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_service.py +170 -5
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_smoke.py +53 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/.gitignore +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/ARTICLE.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/INDEX.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/LICENSE +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/for-ai-existing-project/README.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/for-ai-maintenance/README.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/for-ai-new-project/README.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/for-humans/FAQ.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/for-humans/deep-dive.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/for-humans/getting-started.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/README.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/approval-checkpoints.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/artifacts.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/auto-scaling.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/ci-templates/github-actions.yml +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/ci-templates/gitlab-ci.yml +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/drift-and-priority.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/language-adapters/_template.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/language-adapters/csharp.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/language-adapters/go.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/language-adapters/java.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/language-adapters/python.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/language-adapters/rust.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/language-adapters/swift.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/language-adapters/typescript.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/principles.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/roles.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/runtime-adapters/_template.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/runtime-adapters/claude-code.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/runtime-adapters/codex.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/runtime-adapters/continue.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/runtime-adapters/cursor.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/runtime-adapters/local-llm.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/runtime-adapters/windsurf.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/tools.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/methodology/workflow.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/maintenance/on-after-edit.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/maintenance/on-before-edit.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/maintenance/on-drift-detected.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/maintenance/on-user-manual-edit.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/migrate-existing-project/00-entry-prompt.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/migrate-existing-project/01-discover.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/migrate-existing-project/02-reconstruct-intent.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/migrate-existing-project/03-draft-plan.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/migrate-existing-project/04-markup-codebase.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/migrate-existing-project/05-verification-and-logs.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/migrate-existing-project/06-validation-gates.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/new-project/00-entry-prompt.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/new-project/01-intent-interview.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/new-project/02-requirements.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/new-project/03-technology.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/new-project/04-development-plan.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/new-project/05-verification-plan.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/new-project/06-generate.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/new-project/07-post-init-sync.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/upgrade-methodology/00-entry-prompt.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/prompts/upgrade-methodology/01-content-gaps.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/__init__.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/__main__.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/config.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/daemon/__init__.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/daemon/main.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-after-edit/SKILL.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-before-edit/SKILL.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-drift/SKILL.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-guide/SKILL.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-manual-edit/SKILL.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-refactor/SKILL.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-verify/SKILL.md +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/graphs/__init__.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/graphs/anchors.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/graphs/crossref.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/graphs/declared.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/graphs/grace4.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/hooks_installer.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/integrations/__init__.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/integrations/cgc.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/integrations/grace_cli.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/migrations/__init__.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/migrations/grace3_to_grace4.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/policy/__init__.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/policy/agents_md.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/policy/phase.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/server.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/storage/__init__.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/storage/paths.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/tools/__init__.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/tools/_meta.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/tools/context.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/tools/detect_changes.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/tools/impact.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/tools/post_tool.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/tools/provenance.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/src/doubled_graph/uninstall.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/__init__.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/conftest.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_anchors.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_bom_support.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_cgc_backend.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_cgc_contract.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_cgc_lifecycle.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_cli_surface.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_crossref_drift.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_daemon_main.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_declared_coverage.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_e2e_acceptance.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_grace4_artifacts.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_grace_cli_coverage.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_grace_cli_engine.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_hook_public_coverage.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mcp_transport.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mcp_validation.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_migration_coverage.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_migration_grace3_to_grace4.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mutation_gate_script.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mutation_kill_analyze.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mutation_kill_cgc_edges.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mutation_kill_cgc_fallback.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mutation_kill_cgc_misc.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mutation_kill_context.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mutation_kill_crossref.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mutation_kill_hooks.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mutation_kill_impact.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_mutation_probes.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_packaging.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_platform_branches.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_provenance.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_release_script.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_repo_hygiene.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_setup_artifacts.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_setup_coverage.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_setup_failure_semantics.py +0 -0
- {doubled_graph-3.0.1 → doubled_graph-3.0.2}/tests/test_uninstall.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: doubled-graph
|
|
3
|
-
Version: 3.0.
|
|
3
|
+
Version: 3.0.2
|
|
4
4
|
Summary: MCP facade over CodeGraphContext + GRACE 4 (.grace artifacts): impact, context, drift-detect, migration for LLM-driven codebases.
|
|
5
5
|
Project-URL: Homepage, https://github.com/rour/doubled-graph-mcp
|
|
6
6
|
Project-URL: Repository, https://github.com/rour/doubled-graph-mcp
|
|
@@ -88,30 +88,30 @@ pipx ensurepath
|
|
|
88
88
|
|
|
89
89
|
### 2. Установить doubled-graph
|
|
90
90
|
|
|
91
|
-
На PyPI сейчас опубликована **
|
|
91
|
+
На PyPI сейчас опубликована **3.0.1**. Версия **3.0.2 в PyPI ещё не
|
|
92
92
|
опубликована**, поэтому `pipx install doubled-graph` (без версии) на
|
|
93
|
-
поддерживаемом Python поставит
|
|
94
|
-
3.0.
|
|
95
|
-
3.0.
|
|
93
|
+
поддерживаемом Python поставит 3.0.1, а `doubled-graph --version` покажет не
|
|
94
|
+
3.0.2. Чтобы поставить именно
|
|
95
|
+
3.0.2 из этого репозитория, соберите wheel поддерживаемым интерпретатором
|
|
96
96
|
(3.11–3.14) и установите его **с явным `--python`**: если сам pipx запущен
|
|
97
97
|
на 3.15, его venv тоже будет 3.15, и pip откажется ставить пакет.
|
|
98
98
|
|
|
99
99
|
```bash
|
|
100
100
|
python3.14 -m pip install build
|
|
101
101
|
python3.14 -m build --wheel
|
|
102
|
-
pipx install --python python3.14 --force dist/doubled_graph-3.0.
|
|
102
|
+
pipx install --python python3.14 --force dist/doubled_graph-3.0.2-py3-none-any.whl
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
Подойдёт любой минор из 3.11–3.14; `--python python3.14` — пример. После
|
|
106
106
|
публикации релиза команда станет обычной и точной:
|
|
107
107
|
|
|
108
108
|
```bash
|
|
109
|
-
pipx install --python python3.14 doubled-graph==3.0.
|
|
109
|
+
pipx install --python python3.14 doubled-graph==3.0.2 # до релиза — wheel выше
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
> Уже работаете в своём venv или conda-окружении? `python3.14 -m pip install
|
|
113
|
-
> doubled-graph` из PyPI тоже поставит
|
|
114
|
-
> `python3.14 -m pip install dist/doubled_graph-3.0.
|
|
113
|
+
> doubled-graph` из PyPI тоже поставит 3.0.1; для 3.0.2 используйте wheel:
|
|
114
|
+
> `python3.14 -m pip install dist/doubled_graph-3.0.2-py3-none-any.whl`.
|
|
115
115
|
|
|
116
116
|
---
|
|
117
117
|
|
|
@@ -133,7 +133,12 @@ doubled-graph setup
|
|
|
133
133
|
- установит `git post-commit` хук для автообновления графа. Хук вызывает `doubled-graph` из `PATH` (в отличие от `.mcp.json`, куда `setup` пишет абсолютный путь к интерпретатору); если бинаря в `PATH` нет, коммит не блокируется, а в `.doubled-graph/logs/post-commit.log` появляется строка `'doubled-graph' is not on PATH; skipped incremental analyze…`
|
|
134
134
|
- поставит **демон графа** (`graphd`) как сервис ОС (launchd / `systemd --user` /
|
|
135
135
|
Task Scheduler) и зарегистрирует проект в `~/.doubled-graph/state.json`;
|
|
136
|
-
повторный `setup` не создаёт второй
|
|
136
|
+
повторный `setup` не создаёт второй сервис, а **всегда** останавливает
|
|
137
|
+
текущий процесс, обновляет unit и запускает новый. Это не «перезапуск при
|
|
138
|
+
поломке»: `pipx upgrade` меняет файлы на диске, но не память уже запущенного
|
|
139
|
+
демона, поэтому каждый `setup` заканчивается свежим процессом из текущей
|
|
140
|
+
установки. После ожидания (до 60 с) шаг сверяет `daemon.version` с
|
|
141
|
+
`doubled-graph --version`; расхождение — `failed_steps: ["daemon"]` и rc=1.
|
|
137
142
|
- запустит первый полный `analyze`
|
|
138
143
|
|
|
139
144
|
Если хотя бы один из этих шагов завершился ошибкой (например, битый
|
|
@@ -160,8 +165,8 @@ doubled-graph setup
|
|
|
160
165
|
> отсутствующих колёс для текущего Python, шаг 2 «CGC dep self-heal» вызывает
|
|
161
166
|
> `pipx install --python python3.12|3.13|3.14 --force doubled-graph==<установленная
|
|
162
167
|
> версия>` (`setup.py::_auto_reinstall_on_working_python`). Версия
|
|
163
|
-
> **запинена**: команда без версии поставила бы опубликованную
|
|
164
|
-
> откатила 3.0. Это единственная сетевая переустановка пакета; при `--dry-run`
|
|
168
|
+
> **запинена**: команда без версии поставила бы опубликованную 3.0.1 и молча
|
|
169
|
+
> откатила 3.0.2. Это единственная сетевая переустановка пакета; при `--dry-run`
|
|
165
170
|
> она только репортится (`status: "dry_run_reinstall"`), а при `pip install` в
|
|
166
171
|
> venv/CI не выполняется вовсе (`_looks_like_pipx_install()`). Если сети нет
|
|
167
172
|
> или такой версии ещё нет на PyPI, шаг честно возвращает `reinstall_failed`
|
|
@@ -218,7 +223,7 @@ head -1 "$(which doubled-graph)" # вывести shebang — это и ест
|
|
|
218
223
|
### 4. Проверить, что всё встало
|
|
219
224
|
|
|
220
225
|
```bash
|
|
221
|
-
doubled-graph --version # 3.0.
|
|
226
|
+
doubled-graph --version # 3.0.2 (после wheel-установки выше; 3.0.1 при pipx install из PyPI)
|
|
222
227
|
doubled-graph status --repo . # artifacts.project_kind = grace4, grace_engine.upgrade_required = false
|
|
223
228
|
doubled-graph daemon status # installed = true, running = true
|
|
224
229
|
doubled-graph health --repo . # cgc.ok = true (демон ответил)
|
|
@@ -229,7 +234,7 @@ doubled-graph migrate check --repo . # map_pending / placeholders — что
|
|
|
229
234
|
Если `project_kind` = `grace3` — артефакты ещё не перенесены: `doubled-graph setup --repo .`.
|
|
230
235
|
Если `upgrade_required` = `true` — движок старее 4.x: `npm install -g @osovv/grace-cli@4.2.1`, затем `setup` повторно.
|
|
231
236
|
Если `daemon.running` = `false`, а `health.cgc.ok` = `false` — демон не запущен: выполните `doubled-graph setup` в обычном шелле (из песочницы `launchctl`/`systemctl` могут быть запрещены), затем `daemon status`. Без демона графовые команды возвращают `CGC_BACKEND_FAIL` и rc=1 — это не «пустой граф».
|
|
232
|
-
Если `health.cgc.diagnostic` = `FalkorDB Lite previously failed to start…` — в 3.0.0 это была памятка о прошлой неудаче, а не причина. В 3.0.1 кэш сбрасывается перед каждой попыткой, а мёртвый `falkordb.sock` и осиротевший `graph.settings` удаляются автоматически: первый `analyze`/`setup` чинит репозиторий сам, `health.cgc.repaired` перечисляет
|
|
237
|
+
Если `health.cgc.diagnostic` = `FalkorDB Lite previously failed to start…` — в 3.0.0 это была памятка о прошлой неудаче, а не причина. В 3.0.1 кэш сбрасывается перед каждой попыткой, а мёртвый `falkordb.sock` и осиротевший `graph.settings` удаляются автоматически: первый `analyze`/`setup` чинит репозиторий сам, `health.cgc.repaired` перечисляет удалённое (в 3.0.2 этот список приходит из демона, а не всегда пуст). В 3.0.2 также `setup` всегда перезапускает демон, поэтому обновление не оставляет старый процесс со старым кэшем. Если ошибка осталась — это настоящий сбой движка: `daemon logs` и `cgc.backend`.
|
|
233
238
|
Если `lint` вернул `markup.module-map-missing` — это содержательная работа, промпт `prompts/upgrade-methodology/01-content-gaps.md`.
|
|
234
239
|
|
|
235
240
|
Полная проверка (ruff + unit + real-CGC E2E + diff/version): `bash scripts/verify.sh`; критерии готовности — [docs/VERIFICATION.md](docs/VERIFICATION.md).
|
|
@@ -290,9 +295,13 @@ NFS-home): CGC при инициализации пишет `graph.settings` и
|
|
|
290
295
|
doubled-graph daemon install
|
|
291
296
|
doubled-graph daemon start
|
|
292
297
|
|
|
293
|
-
# Состояние: сервис + живой демон + реестр
|
|
298
|
+
# Состояние: сервис + живой демон + реестр проектов; показывает
|
|
299
|
+
# daemon.version и client_version и при расхождении — version_mismatch + hint
|
|
294
300
|
doubled-graph daemon status
|
|
295
301
|
|
|
302
|
+
# Заменить демон свежим процессом без полного setup (stop → unit → start)
|
|
303
|
+
doubled-graph daemon restart
|
|
304
|
+
|
|
296
305
|
# Логи и foreground-режим для отладки
|
|
297
306
|
doubled-graph daemon logs --lines 100
|
|
298
307
|
doubled-graph daemon run
|
|
@@ -304,6 +313,13 @@ doubled-graph daemon uninstall
|
|
|
304
313
|
`daemon status` завершается с rc=0, только если живой демон ответил на `ping`;
|
|
305
314
|
если сервис установлен, но не запущен (или не установлен вовсе), rc=1 и
|
|
306
315
|
`daemon.running: false` — это диагностический код, а не сбой установки.
|
|
316
|
+
Отчёт содержит обе версии — `daemon.version` (что отвечает процесс) и
|
|
317
|
+
`daemon.client_version` (что установлено). При расхождении выставляется
|
|
318
|
+
`daemon.version_mismatch: true` и `daemon.hint` с `doubled-graph setup` /
|
|
319
|
+
`doubled-graph daemon restart`: один и тот же wire-протокол не позволяет
|
|
320
|
+
заметить старый процесс иначе. `doubled-graph daemon restart` выполняет ту же
|
|
321
|
+
безусловную операцию stop → install/update unit → start и возвращает rc=2,
|
|
322
|
+
если хотя бы один шаг не удался (`failed_steps`, `detail`).
|
|
307
323
|
|
|
308
324
|
`daemon uninstall` честен и при отказе супервизора: если `launchctl bootout` /
|
|
309
325
|
`systemctl disable --now` вернул ошибку, команда выводит `status: "failed"` и
|
|
@@ -434,13 +450,15 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
|
|
|
434
450
|
|
|
435
451
|
Пошагово с 2.x (или 1.9.x, если проект ещё на `docs/*.xml`):
|
|
436
452
|
|
|
437
|
-
1. **Поставьте именно 3.0.** `pipx upgrade doubled-graph` сейчас даёт
|
|
438
|
-
**
|
|
453
|
+
1. **Поставьте именно 3.0.2.** `pipx upgrade doubled-graph` сейчас даёт
|
|
454
|
+
**3.0.1**, а не 3.0.2 (3.0.2 ещё не в PyPI). Точный путь — wheel с явным
|
|
439
455
|
`--python`: см. [§Установка](#2-установить-doubled-graph). Убедитесь:
|
|
440
|
-
`doubled-graph --version` → `3.0.
|
|
456
|
+
`doubled-graph --version` → `3.0.2`.
|
|
441
457
|
2. **`cd your-project && doubled-graph setup`** — в **обычном** шелле, не из
|
|
442
|
-
песочницы. `setup`
|
|
443
|
-
|
|
458
|
+
песочницы. `setup` **всегда** останавливает и заново запускает сервис
|
|
459
|
+
`graphd` (stop → install/update unit → start), регистрирует проект,
|
|
460
|
+
обновляет движок и `.grace`, а затем сверяет версию ответившего демона с
|
|
461
|
+
версией клиента; несовпадение — `failed_steps: ["daemon"]` и rc=1.
|
|
444
462
|
3. **Проверьте:** `doubled-graph daemon status` → `installed: true`,
|
|
445
463
|
`running: true`; `doubled-graph health` → `cgc.ok: true`. Если демон не
|
|
446
464
|
ответил за 60 с холодного старта, `setup` печатает честное сообщение с
|
|
@@ -464,9 +482,9 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
|
|
|
464
482
|
обновлением на 3.0:
|
|
465
483
|
|
|
466
484
|
```bash
|
|
467
|
-
# 1. поставить 3.0 (pipx upgrade даст только
|
|
485
|
+
# 1. поставить 3.0.2 (pipx upgrade даст только 3.0.1 — см. §Установка)
|
|
468
486
|
python3.14 -m build --wheel
|
|
469
|
-
pipx install --python python3.14 --force dist/doubled_graph-3.0.
|
|
487
|
+
pipx install --python python3.14 --force dist/doubled_graph-3.0.2-py3-none-any.whl
|
|
470
488
|
cd your-project
|
|
471
489
|
doubled-graph setup # 2. движок, .grace и демон graphd — одной командой
|
|
472
490
|
```
|
|
@@ -488,7 +506,7 @@ doubled-graph setup # 2. движок, .grace и демон graphd —
|
|
|
488
506
|
| Сценарий | Последствия |
|
|
489
507
|
|---|---|
|
|
490
508
|
| Остались на 1.9.x | Всё работает по-старому, но без обновлений и поддержки `.grace` |
|
|
491
|
-
| Обновили пакет, `setup` не запускали | `doubled-graph lint` → `project.grace3-detected` (exit 1), MCP `file_show`/`module_show` → `invalid-project`; графовые команды без демона → `CGC_BACKEND_FAIL`, rc=1 |
|
|
509
|
+
| Обновили пакет, `setup` не запускали | `doubled-graph lint` → `project.grace3-detected` (exit 1), MCP `file_show`/`module_show` → `invalid-project`; старый демон продолжает отвечать старым кодом, `daemon status` показывает `version_mismatch`, `analyze`/`health` — warning `DAEMON_VERSION_MISMATCH`; графовые команды без демона → `CGC_BACKEND_FAIL`, rc=1 |
|
|
492
510
|
| Мигрировали, но `LINKS` не поправили | lint зелёный, но модули «пустые»: `module show` не показывает файлы, `detect_changes` даёт `code_without_module` на весь код |
|
|
493
511
|
|
|
494
512
|
Обновление версии методики — отдельный (третий) сценарий, он не требует проходить миграцию
|
|
@@ -47,30 +47,30 @@ pipx ensurepath
|
|
|
47
47
|
|
|
48
48
|
### 2. Установить doubled-graph
|
|
49
49
|
|
|
50
|
-
На PyPI сейчас опубликована **
|
|
50
|
+
На PyPI сейчас опубликована **3.0.1**. Версия **3.0.2 в PyPI ещё не
|
|
51
51
|
опубликована**, поэтому `pipx install doubled-graph` (без версии) на
|
|
52
|
-
поддерживаемом Python поставит
|
|
53
|
-
3.0.
|
|
54
|
-
3.0.
|
|
52
|
+
поддерживаемом Python поставит 3.0.1, а `doubled-graph --version` покажет не
|
|
53
|
+
3.0.2. Чтобы поставить именно
|
|
54
|
+
3.0.2 из этого репозитория, соберите wheel поддерживаемым интерпретатором
|
|
55
55
|
(3.11–3.14) и установите его **с явным `--python`**: если сам pipx запущен
|
|
56
56
|
на 3.15, его venv тоже будет 3.15, и pip откажется ставить пакет.
|
|
57
57
|
|
|
58
58
|
```bash
|
|
59
59
|
python3.14 -m pip install build
|
|
60
60
|
python3.14 -m build --wheel
|
|
61
|
-
pipx install --python python3.14 --force dist/doubled_graph-3.0.
|
|
61
|
+
pipx install --python python3.14 --force dist/doubled_graph-3.0.2-py3-none-any.whl
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
Подойдёт любой минор из 3.11–3.14; `--python python3.14` — пример. После
|
|
65
65
|
публикации релиза команда станет обычной и точной:
|
|
66
66
|
|
|
67
67
|
```bash
|
|
68
|
-
pipx install --python python3.14 doubled-graph==3.0.
|
|
68
|
+
pipx install --python python3.14 doubled-graph==3.0.2 # до релиза — wheel выше
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
> Уже работаете в своём venv или conda-окружении? `python3.14 -m pip install
|
|
72
|
-
> doubled-graph` из PyPI тоже поставит
|
|
73
|
-
> `python3.14 -m pip install dist/doubled_graph-3.0.
|
|
72
|
+
> doubled-graph` из PyPI тоже поставит 3.0.1; для 3.0.2 используйте wheel:
|
|
73
|
+
> `python3.14 -m pip install dist/doubled_graph-3.0.2-py3-none-any.whl`.
|
|
74
74
|
|
|
75
75
|
---
|
|
76
76
|
|
|
@@ -92,7 +92,12 @@ doubled-graph setup
|
|
|
92
92
|
- установит `git post-commit` хук для автообновления графа. Хук вызывает `doubled-graph` из `PATH` (в отличие от `.mcp.json`, куда `setup` пишет абсолютный путь к интерпретатору); если бинаря в `PATH` нет, коммит не блокируется, а в `.doubled-graph/logs/post-commit.log` появляется строка `'doubled-graph' is not on PATH; skipped incremental analyze…`
|
|
93
93
|
- поставит **демон графа** (`graphd`) как сервис ОС (launchd / `systemd --user` /
|
|
94
94
|
Task Scheduler) и зарегистрирует проект в `~/.doubled-graph/state.json`;
|
|
95
|
-
повторный `setup` не создаёт второй
|
|
95
|
+
повторный `setup` не создаёт второй сервис, а **всегда** останавливает
|
|
96
|
+
текущий процесс, обновляет unit и запускает новый. Это не «перезапуск при
|
|
97
|
+
поломке»: `pipx upgrade` меняет файлы на диске, но не память уже запущенного
|
|
98
|
+
демона, поэтому каждый `setup` заканчивается свежим процессом из текущей
|
|
99
|
+
установки. После ожидания (до 60 с) шаг сверяет `daemon.version` с
|
|
100
|
+
`doubled-graph --version`; расхождение — `failed_steps: ["daemon"]` и rc=1.
|
|
96
101
|
- запустит первый полный `analyze`
|
|
97
102
|
|
|
98
103
|
Если хотя бы один из этих шагов завершился ошибкой (например, битый
|
|
@@ -119,8 +124,8 @@ doubled-graph setup
|
|
|
119
124
|
> отсутствующих колёс для текущего Python, шаг 2 «CGC dep self-heal» вызывает
|
|
120
125
|
> `pipx install --python python3.12|3.13|3.14 --force doubled-graph==<установленная
|
|
121
126
|
> версия>` (`setup.py::_auto_reinstall_on_working_python`). Версия
|
|
122
|
-
> **запинена**: команда без версии поставила бы опубликованную
|
|
123
|
-
> откатила 3.0. Это единственная сетевая переустановка пакета; при `--dry-run`
|
|
127
|
+
> **запинена**: команда без версии поставила бы опубликованную 3.0.1 и молча
|
|
128
|
+
> откатила 3.0.2. Это единственная сетевая переустановка пакета; при `--dry-run`
|
|
124
129
|
> она только репортится (`status: "dry_run_reinstall"`), а при `pip install` в
|
|
125
130
|
> venv/CI не выполняется вовсе (`_looks_like_pipx_install()`). Если сети нет
|
|
126
131
|
> или такой версии ещё нет на PyPI, шаг честно возвращает `reinstall_failed`
|
|
@@ -177,7 +182,7 @@ head -1 "$(which doubled-graph)" # вывести shebang — это и ест
|
|
|
177
182
|
### 4. Проверить, что всё встало
|
|
178
183
|
|
|
179
184
|
```bash
|
|
180
|
-
doubled-graph --version # 3.0.
|
|
185
|
+
doubled-graph --version # 3.0.2 (после wheel-установки выше; 3.0.1 при pipx install из PyPI)
|
|
181
186
|
doubled-graph status --repo . # artifacts.project_kind = grace4, grace_engine.upgrade_required = false
|
|
182
187
|
doubled-graph daemon status # installed = true, running = true
|
|
183
188
|
doubled-graph health --repo . # cgc.ok = true (демон ответил)
|
|
@@ -188,7 +193,7 @@ doubled-graph migrate check --repo . # map_pending / placeholders — что
|
|
|
188
193
|
Если `project_kind` = `grace3` — артефакты ещё не перенесены: `doubled-graph setup --repo .`.
|
|
189
194
|
Если `upgrade_required` = `true` — движок старее 4.x: `npm install -g @osovv/grace-cli@4.2.1`, затем `setup` повторно.
|
|
190
195
|
Если `daemon.running` = `false`, а `health.cgc.ok` = `false` — демон не запущен: выполните `doubled-graph setup` в обычном шелле (из песочницы `launchctl`/`systemctl` могут быть запрещены), затем `daemon status`. Без демона графовые команды возвращают `CGC_BACKEND_FAIL` и rc=1 — это не «пустой граф».
|
|
191
|
-
Если `health.cgc.diagnostic` = `FalkorDB Lite previously failed to start…` — в 3.0.0 это была памятка о прошлой неудаче, а не причина. В 3.0.1 кэш сбрасывается перед каждой попыткой, а мёртвый `falkordb.sock` и осиротевший `graph.settings` удаляются автоматически: первый `analyze`/`setup` чинит репозиторий сам, `health.cgc.repaired` перечисляет
|
|
196
|
+
Если `health.cgc.diagnostic` = `FalkorDB Lite previously failed to start…` — в 3.0.0 это была памятка о прошлой неудаче, а не причина. В 3.0.1 кэш сбрасывается перед каждой попыткой, а мёртвый `falkordb.sock` и осиротевший `graph.settings` удаляются автоматически: первый `analyze`/`setup` чинит репозиторий сам, `health.cgc.repaired` перечисляет удалённое (в 3.0.2 этот список приходит из демона, а не всегда пуст). В 3.0.2 также `setup` всегда перезапускает демон, поэтому обновление не оставляет старый процесс со старым кэшем. Если ошибка осталась — это настоящий сбой движка: `daemon logs` и `cgc.backend`.
|
|
192
197
|
Если `lint` вернул `markup.module-map-missing` — это содержательная работа, промпт `prompts/upgrade-methodology/01-content-gaps.md`.
|
|
193
198
|
|
|
194
199
|
Полная проверка (ruff + unit + real-CGC E2E + diff/version): `bash scripts/verify.sh`; критерии готовности — [docs/VERIFICATION.md](docs/VERIFICATION.md).
|
|
@@ -249,9 +254,13 @@ NFS-home): CGC при инициализации пишет `graph.settings` и
|
|
|
249
254
|
doubled-graph daemon install
|
|
250
255
|
doubled-graph daemon start
|
|
251
256
|
|
|
252
|
-
# Состояние: сервис + живой демон + реестр
|
|
257
|
+
# Состояние: сервис + живой демон + реестр проектов; показывает
|
|
258
|
+
# daemon.version и client_version и при расхождении — version_mismatch + hint
|
|
253
259
|
doubled-graph daemon status
|
|
254
260
|
|
|
261
|
+
# Заменить демон свежим процессом без полного setup (stop → unit → start)
|
|
262
|
+
doubled-graph daemon restart
|
|
263
|
+
|
|
255
264
|
# Логи и foreground-режим для отладки
|
|
256
265
|
doubled-graph daemon logs --lines 100
|
|
257
266
|
doubled-graph daemon run
|
|
@@ -263,6 +272,13 @@ doubled-graph daemon uninstall
|
|
|
263
272
|
`daemon status` завершается с rc=0, только если живой демон ответил на `ping`;
|
|
264
273
|
если сервис установлен, но не запущен (или не установлен вовсе), rc=1 и
|
|
265
274
|
`daemon.running: false` — это диагностический код, а не сбой установки.
|
|
275
|
+
Отчёт содержит обе версии — `daemon.version` (что отвечает процесс) и
|
|
276
|
+
`daemon.client_version` (что установлено). При расхождении выставляется
|
|
277
|
+
`daemon.version_mismatch: true` и `daemon.hint` с `doubled-graph setup` /
|
|
278
|
+
`doubled-graph daemon restart`: один и тот же wire-протокол не позволяет
|
|
279
|
+
заметить старый процесс иначе. `doubled-graph daemon restart` выполняет ту же
|
|
280
|
+
безусловную операцию stop → install/update unit → start и возвращает rc=2,
|
|
281
|
+
если хотя бы один шаг не удался (`failed_steps`, `detail`).
|
|
266
282
|
|
|
267
283
|
`daemon uninstall` честен и при отказе супервизора: если `launchctl bootout` /
|
|
268
284
|
`systemctl disable --now` вернул ошибку, команда выводит `status: "failed"` и
|
|
@@ -393,13 +409,15 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
|
|
|
393
409
|
|
|
394
410
|
Пошагово с 2.x (или 1.9.x, если проект ещё на `docs/*.xml`):
|
|
395
411
|
|
|
396
|
-
1. **Поставьте именно 3.0.** `pipx upgrade doubled-graph` сейчас даёт
|
|
397
|
-
**
|
|
412
|
+
1. **Поставьте именно 3.0.2.** `pipx upgrade doubled-graph` сейчас даёт
|
|
413
|
+
**3.0.1**, а не 3.0.2 (3.0.2 ещё не в PyPI). Точный путь — wheel с явным
|
|
398
414
|
`--python`: см. [§Установка](#2-установить-doubled-graph). Убедитесь:
|
|
399
|
-
`doubled-graph --version` → `3.0.
|
|
415
|
+
`doubled-graph --version` → `3.0.2`.
|
|
400
416
|
2. **`cd your-project && doubled-graph setup`** — в **обычном** шелле, не из
|
|
401
|
-
песочницы. `setup`
|
|
402
|
-
|
|
417
|
+
песочницы. `setup` **всегда** останавливает и заново запускает сервис
|
|
418
|
+
`graphd` (stop → install/update unit → start), регистрирует проект,
|
|
419
|
+
обновляет движок и `.grace`, а затем сверяет версию ответившего демона с
|
|
420
|
+
версией клиента; несовпадение — `failed_steps: ["daemon"]` и rc=1.
|
|
403
421
|
3. **Проверьте:** `doubled-graph daemon status` → `installed: true`,
|
|
404
422
|
`running: true`; `doubled-graph health` → `cgc.ok: true`. Если демон не
|
|
405
423
|
ответил за 60 с холодного старта, `setup` печатает честное сообщение с
|
|
@@ -423,9 +441,9 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
|
|
|
423
441
|
обновлением на 3.0:
|
|
424
442
|
|
|
425
443
|
```bash
|
|
426
|
-
# 1. поставить 3.0 (pipx upgrade даст только
|
|
444
|
+
# 1. поставить 3.0.2 (pipx upgrade даст только 3.0.1 — см. §Установка)
|
|
427
445
|
python3.14 -m build --wheel
|
|
428
|
-
pipx install --python python3.14 --force dist/doubled_graph-3.0.
|
|
446
|
+
pipx install --python python3.14 --force dist/doubled_graph-3.0.2-py3-none-any.whl
|
|
429
447
|
cd your-project
|
|
430
448
|
doubled-graph setup # 2. движок, .grace и демон graphd — одной командой
|
|
431
449
|
```
|
|
@@ -447,7 +465,7 @@ doubled-graph setup # 2. движок, .grace и демон graphd —
|
|
|
447
465
|
| Сценарий | Последствия |
|
|
448
466
|
|---|---|
|
|
449
467
|
| Остались на 1.9.x | Всё работает по-старому, но без обновлений и поддержки `.grace` |
|
|
450
|
-
| Обновили пакет, `setup` не запускали | `doubled-graph lint` → `project.grace3-detected` (exit 1), MCP `file_show`/`module_show` → `invalid-project`; графовые команды без демона → `CGC_BACKEND_FAIL`, rc=1 |
|
|
468
|
+
| Обновили пакет, `setup` не запускали | `doubled-graph lint` → `project.grace3-detected` (exit 1), MCP `file_show`/`module_show` → `invalid-project`; старый демон продолжает отвечать старым кодом, `daemon status` показывает `version_mismatch`, `analyze`/`health` — warning `DAEMON_VERSION_MISMATCH`; графовые команды без демона → `CGC_BACKEND_FAIL`, rc=1 |
|
|
451
469
|
| Мигрировали, но `LINKS` не поправили | lint зелёный, но модули «пустые»: `module show` не показывает файлы, `detect_changes` даёт `code_without_module` на весь код |
|
|
452
470
|
|
|
453
471
|
Обновление версии методики — отдельный (третий) сценарий, он не требует проходить миграцию
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "doubled-graph"
|
|
7
|
-
version = "3.0.
|
|
7
|
+
version = "3.0.2"
|
|
8
8
|
description = "MCP facade over CodeGraphContext + GRACE 4 (.grace artifacts): impact, context, drift-detect, migration for LLM-driven codebases."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "MIT" }
|
|
@@ -513,11 +513,32 @@ def _cmd_daemon(args: argparse.Namespace) -> int:
|
|
|
513
513
|
payload = manager.stop()
|
|
514
514
|
print(json.dumps(payload, indent=2, ensure_ascii=False))
|
|
515
515
|
return 0 if payload.get("status") in {"stopped"} else 2
|
|
516
|
+
if action == "restart":
|
|
517
|
+
# Explicit, unconditional stop → install/update unit → start. `setup`
|
|
518
|
+
# uses the same operation; the command exists so a stale daemon can be
|
|
519
|
+
# replaced without re-running the whole onboarding.
|
|
520
|
+
payload = manager.restart()
|
|
521
|
+
print(json.dumps(payload, indent=2, ensure_ascii=False))
|
|
522
|
+
return 0 if payload.get("status") == "restarted" else 2
|
|
516
523
|
|
|
517
524
|
# status — service state + live daemon + registry, in one report.
|
|
525
|
+
from doubled_graph import __version__ as client_version
|
|
526
|
+
|
|
527
|
+
daemon = graphd.probe_daemon()
|
|
528
|
+
daemon["client_version"] = client_version
|
|
529
|
+
if daemon.get("version") and daemon["version"] != client_version:
|
|
530
|
+
# Both halves speak the same wire protocol, so a stale daemon is
|
|
531
|
+
# invisible without this comparison; `probe_daemon` already sets the
|
|
532
|
+
# flag, and recomputing here keeps a fabricated/partial snapshot honest.
|
|
533
|
+
daemon["version_mismatch"] = True
|
|
534
|
+
daemon["hint"] = (
|
|
535
|
+
f"graph daemon runs doubled-graph {daemon['version']}, client is "
|
|
536
|
+
f"{client_version}. Run `doubled-graph setup` (it always restarts "
|
|
537
|
+
"the service) or `doubled-graph daemon restart`."
|
|
538
|
+
)
|
|
518
539
|
payload: dict[str, Any] = {
|
|
519
540
|
"service": manager.status(),
|
|
520
|
-
"daemon":
|
|
541
|
+
"daemon": daemon,
|
|
521
542
|
}
|
|
522
543
|
if payload["daemon"].get("running"):
|
|
523
544
|
# `status` is repo-independent (it reports the daemon registry). Use
|
|
@@ -1036,6 +1057,12 @@ def main(argv_default: list[str] | None = None, argv: list[str] | None = None) -
|
|
|
1036
1057
|
"stop", parents=[daemon_home], help="Ask the supervisor to stop the daemon"
|
|
1037
1058
|
)
|
|
1038
1059
|
p_d_stop.set_defaults(func=_cmd_daemon, daemon_action="stop")
|
|
1060
|
+
p_d_restart = daemon_sub.add_parser(
|
|
1061
|
+
"restart",
|
|
1062
|
+
parents=[daemon_home],
|
|
1063
|
+
help="Stop, update the unit and start a fresh daemon (unconditional)",
|
|
1064
|
+
)
|
|
1065
|
+
p_d_restart.set_defaults(func=_cmd_daemon, daemon_action="restart")
|
|
1039
1066
|
p_d_status = daemon_sub.add_parser(
|
|
1040
1067
|
"status", parents=[daemon_home], help="Service state + live daemon + registry"
|
|
1041
1068
|
)
|
|
@@ -1212,6 +1212,10 @@ class GraphDaemon:
|
|
|
1212
1212
|
if params.get("probe_parser"):
|
|
1213
1213
|
result = self._with_engine(repo, lambda engine: engine.check_parser())
|
|
1214
1214
|
payload["diagnostic"] = result["value"]
|
|
1215
|
+
# `_with_engine` reports the engine's diagnostics separately
|
|
1216
|
+
# from the value; surface the repair list in the health answer
|
|
1217
|
+
# itself so a client sees it even without diag handling.
|
|
1218
|
+
payload["repaired"] = list(result["diag"].get("last_repair") or [])
|
|
1215
1219
|
return payload
|
|
1216
1220
|
|
|
1217
1221
|
def _method_status(self, _params: dict[str, Any]) -> dict[str, Any]:
|
|
@@ -1381,6 +1385,9 @@ class GraphDaemon:
|
|
|
1381
1385
|
"last_incremental_failures": [],
|
|
1382
1386
|
"last_incremental_rollbacks": [],
|
|
1383
1387
|
"last_incremental_cleanups": [],
|
|
1388
|
+
# Engine files removed to heal a half-written start. Returned to
|
|
1389
|
+
# the client so `health.cgc.repaired` is populated in daemon mode.
|
|
1390
|
+
"last_repair": [],
|
|
1384
1391
|
}
|
|
1385
1392
|
return {name: getattr(engine, name, default) for name, default in defaults.items()}
|
|
1386
1393
|
|
|
@@ -200,6 +200,24 @@ def build_health_report(repo: Path) -> dict[str, Any]:
|
|
|
200
200
|
# discovery file, and the report must say why (audit P3).
|
|
201
201
|
daemon["service_check_error"] = f"{type(exc).__name__}: {exc}"
|
|
202
202
|
|
|
203
|
+
# A live daemon from a previous release keeps the old code (and its cached
|
|
204
|
+
# engine state) in memory; the wire protocol does not change between patch
|
|
205
|
+
# releases, so only the package version exposes it. `setup` is the fix —
|
|
206
|
+
# it restarts unconditionally — but health must say so until it runs.
|
|
207
|
+
warnings: list[dict[str, str]] = []
|
|
208
|
+
if daemon.get("version_mismatch"):
|
|
209
|
+
warnings.append(
|
|
210
|
+
{
|
|
211
|
+
"code": "DAEMON_VERSION_MISMATCH",
|
|
212
|
+
"detail": (
|
|
213
|
+
f"graph daemon runs doubled-graph {daemon.get('version')}, "
|
|
214
|
+
f"client is {daemon.get('client_version')}; the daemon still "
|
|
215
|
+
"serves the previous release. Run `doubled-graph setup` (it "
|
|
216
|
+
"always restarts the service) or `doubled-graph daemon restart`."
|
|
217
|
+
),
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
|
|
203
221
|
return {
|
|
204
222
|
"phase": read_phase(repo),
|
|
205
223
|
"artifacts": {
|
|
@@ -231,6 +249,7 @@ def build_health_report(repo: Path) -> dict[str, Any]:
|
|
|
231
249
|
"verification": {"total_v_m_records": len(declared.verification)},
|
|
232
250
|
"drift": {"total": drift_count, "by_type": drift_by_type},
|
|
233
251
|
"drift_md": {"open_entries": open_drift_entries},
|
|
252
|
+
"warnings": warnings,
|
|
234
253
|
"ok": (
|
|
235
254
|
not declared_errors
|
|
236
255
|
and cgc_diag is None
|
|
@@ -36,6 +36,7 @@ from multiprocessing.connection import AuthenticationError, Client
|
|
|
36
36
|
from pathlib import Path
|
|
37
37
|
from typing import Any, Self
|
|
38
38
|
|
|
39
|
+
from doubled_graph import __version__
|
|
39
40
|
from doubled_graph.integrations.cgc import (
|
|
40
41
|
AnalyzeStats,
|
|
41
42
|
Callsite,
|
|
@@ -340,17 +341,46 @@ def _install_hint() -> str:
|
|
|
340
341
|
)
|
|
341
342
|
|
|
342
343
|
|
|
344
|
+
def _finish_probe_version(result: dict[str, Any]) -> None:
|
|
345
|
+
"""Record whether the *answering* daemon matches this client's package.
|
|
346
|
+
|
|
347
|
+
Since 3.0.2 the package version is part of the diagnostics, not only the
|
|
348
|
+
wire protocol: ``pipx upgrade`` replaces files on disk but a live
|
|
349
|
+
``graphd`` keeps the old code in memory, and both halves still speak
|
|
350
|
+
protocol v1. Comparing package versions is what exposes that stale
|
|
351
|
+
process to ``daemon status`` and ``health`` instead of silently answering
|
|
352
|
+
from the previous release.
|
|
353
|
+
|
|
354
|
+
A version recorded in ``daemon.json`` is only compared when the daemon
|
|
355
|
+
actually answered (or answered with a protocol error). A stale discovery
|
|
356
|
+
file left by a dead process must not turn into a version warning.
|
|
357
|
+
"""
|
|
358
|
+
version = result.get("version")
|
|
359
|
+
result["client_version"] = __version__
|
|
360
|
+
result["version_mismatch"] = bool(
|
|
361
|
+
(result.get("running") or result.get("protocol_mismatch"))
|
|
362
|
+
and isinstance(version, str)
|
|
363
|
+
and version
|
|
364
|
+
and version != __version__
|
|
365
|
+
)
|
|
366
|
+
|
|
367
|
+
|
|
343
368
|
#: How long ``ping`` may take when probing from ``health``/``daemon status``.
|
|
344
369
|
def probe_daemon(timeout: float = PING_TIMEOUT_S) -> dict[str, Any]:
|
|
345
370
|
"""Best-effort daemon snapshot for diagnostics. Never raises.
|
|
346
371
|
|
|
347
372
|
Returns ``{"installed", "running", "version", "protocol", "pid",
|
|
348
373
|
"transport", "address", "port", "max_live", "protocol_mismatch",
|
|
349
|
-
"error"}``. ``installed``
|
|
374
|
+
"client_version", "version_mismatch", "error"}``. ``installed``
|
|
350
375
|
only means "a discovery file exists"; callers may OR it with the
|
|
351
376
|
service-manager state. For the TCP fallback ``address`` is the loopback
|
|
352
377
|
host and ``port`` the integer port (matching ``daemon.json``), never a
|
|
353
378
|
stringified ``(host, port)`` tuple.
|
|
379
|
+
|
|
380
|
+
``version_mismatch`` is true when the live daemon runs a different
|
|
381
|
+
``doubled-graph`` release than this client. Nothing restarts it here:
|
|
382
|
+
``setup`` owns the unconditional restart, this snapshot only reports the
|
|
383
|
+
fact so ``analyze``/``health``/``daemon status`` can warn.
|
|
354
384
|
"""
|
|
355
385
|
info = load_daemon_info()
|
|
356
386
|
result: dict[str, Any] = {
|
|
@@ -364,16 +394,24 @@ def probe_daemon(timeout: float = PING_TIMEOUT_S) -> dict[str, Any]:
|
|
|
364
394
|
"port": None,
|
|
365
395
|
"max_live": None,
|
|
366
396
|
"protocol_mismatch": False,
|
|
397
|
+
"client_version": __version__,
|
|
398
|
+
"version_mismatch": False,
|
|
367
399
|
"error": None,
|
|
368
400
|
}
|
|
369
401
|
if info is None:
|
|
370
402
|
result["error"] = "daemon.json is missing or unreadable"
|
|
403
|
+
_finish_probe_version(result)
|
|
371
404
|
return result
|
|
372
405
|
result["transport"] = info.get("transport")
|
|
406
|
+
# The daemon writes its package version into the discovery file at start.
|
|
407
|
+
# Keep it as the fallback for a protocol mismatch, where the pong never
|
|
408
|
+
# arrives but the live old daemon's release is still known.
|
|
409
|
+
result["version"] = info.get("version")
|
|
373
410
|
try:
|
|
374
411
|
resolved = resolve_address(info)
|
|
375
412
|
except (KeyError, TypeError, ValueError) as exc:
|
|
376
413
|
result["error"] = f"daemon.json is corrupt: {exc}"
|
|
414
|
+
_finish_probe_version(result)
|
|
377
415
|
return result
|
|
378
416
|
if info.get("transport") == TRANSPORT_TCP:
|
|
379
417
|
result["address"], result["port"] = resolved
|
|
@@ -392,15 +430,20 @@ def probe_daemon(timeout: float = PING_TIMEOUT_S) -> dict[str, Any]:
|
|
|
392
430
|
# healthy install (P1-1).
|
|
393
431
|
result["error"] = str(exc)
|
|
394
432
|
result["protocol_mismatch"] = True
|
|
433
|
+
_finish_probe_version(result)
|
|
395
434
|
return result
|
|
396
435
|
except DaemonError as exc:
|
|
397
436
|
result["error"] = str(exc)
|
|
437
|
+
_finish_probe_version(result)
|
|
398
438
|
return result
|
|
399
439
|
result["running"] = True
|
|
400
|
-
|
|
440
|
+
# Older/foreign daemons may omit `version` from the pong; keep the value
|
|
441
|
+
# from the discovery file rather than erasing what the daemon recorded.
|
|
442
|
+
result["version"] = pong.get("version") or result["version"]
|
|
401
443
|
result["protocol"] = pong.get("protocol")
|
|
402
444
|
result["pid"] = pong.get("pid", result["pid"])
|
|
403
445
|
result["max_live"] = pong.get("max_live")
|
|
446
|
+
_finish_probe_version(result)
|
|
404
447
|
return result
|
|
405
448
|
|
|
406
449
|
|
|
@@ -508,6 +551,10 @@ class GraphClient:
|
|
|
508
551
|
self.last_relationship_partial = False
|
|
509
552
|
self.last_relationship_refused = False
|
|
510
553
|
self.last_close_error: str | None = None
|
|
554
|
+
#: Engine files the daemon removed to heal a half-written start. Filled
|
|
555
|
+
#: by ``health`` so ``health.cgc.repaired`` is populated in daemon
|
|
556
|
+
#: mode too (the client never touches CGC itself).
|
|
557
|
+
self.last_repair: list[str] = []
|
|
511
558
|
self.daemon_info: dict[str, Any] | None = None
|
|
512
559
|
|
|
513
560
|
# -- transport ------------------------------------------------------
|
|
@@ -731,6 +778,13 @@ class GraphClient:
|
|
|
731
778
|
payload = self._call("health", params, timeout=timeout)
|
|
732
779
|
if not isinstance(payload, dict):
|
|
733
780
|
raise DaemonUnavailable("graph daemon health returned a non-object")
|
|
781
|
+
# The daemon owns CGC, so only it can report which engine files were
|
|
782
|
+
# removed to heal a failed start. Keep the list on the client: health
|
|
783
|
+
# and analyze read `last_repair` exactly as they do for an in-process
|
|
784
|
+
# CGC, which makes the repair visible in daemon mode as well.
|
|
785
|
+
repaired = payload.get("repaired")
|
|
786
|
+
if isinstance(repaired, list):
|
|
787
|
+
self.last_repair = [str(item) for item in repaired]
|
|
734
788
|
return payload
|
|
735
789
|
|
|
736
790
|
def status(self, *, timeout: float | None = None) -> dict[str, Any]:
|