doubled-graph 3.0.0__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.0 → doubled_graph-3.0.2}/PKG-INFO +41 -22
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/README.md +40 -21
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/pyproject.toml +1 -1
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/cli.py +28 -1
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/daemon/server.py +7 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/health.py +27 -1
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/integrations/cgc.py +96 -16
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/integrations/graphd.py +56 -2
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/integrations/service.py +113 -13
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/setup.py +54 -16
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/tools/analyze.py +46 -1
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_cgc_backend.py +142 -1
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_cli_daemon.py +149 -6
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_cli_entrypoint.py +3 -3
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_daemon.py +40 -3
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_graphd_client.py +82 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_health.py +69 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_service.py +170 -5
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_smoke.py +81 -1
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/.gitignore +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/ARTICLE.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/INDEX.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/LICENSE +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/for-ai-existing-project/README.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/for-ai-maintenance/README.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/for-ai-new-project/README.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/for-humans/FAQ.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/for-humans/deep-dive.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/for-humans/getting-started.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/README.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/approval-checkpoints.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/artifacts.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/auto-scaling.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/ci-templates/github-actions.yml +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/ci-templates/gitlab-ci.yml +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/drift-and-priority.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/language-adapters/_template.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/language-adapters/csharp.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/language-adapters/go.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/language-adapters/java.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/language-adapters/python.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/language-adapters/rust.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/language-adapters/swift.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/language-adapters/typescript.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/principles.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/roles.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/runtime-adapters/_template.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/runtime-adapters/claude-code.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/runtime-adapters/codex.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/runtime-adapters/continue.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/runtime-adapters/cursor.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/runtime-adapters/local-llm.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/runtime-adapters/windsurf.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/tools.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/methodology/workflow.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/maintenance/on-after-edit.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/maintenance/on-before-edit.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/maintenance/on-drift-detected.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/maintenance/on-user-manual-edit.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/migrate-existing-project/00-entry-prompt.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/migrate-existing-project/01-discover.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/migrate-existing-project/02-reconstruct-intent.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/migrate-existing-project/03-draft-plan.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/migrate-existing-project/04-markup-codebase.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/migrate-existing-project/05-verification-and-logs.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/migrate-existing-project/06-validation-gates.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/new-project/00-entry-prompt.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/new-project/01-intent-interview.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/new-project/02-requirements.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/new-project/03-technology.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/new-project/04-development-plan.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/new-project/05-verification-plan.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/new-project/06-generate.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/new-project/07-post-init-sync.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/upgrade-methodology/00-entry-prompt.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/prompts/upgrade-methodology/01-content-gaps.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/__init__.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/__main__.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/config.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/daemon/__init__.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/daemon/main.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-after-edit/SKILL.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-before-edit/SKILL.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-drift/SKILL.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-guide/SKILL.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-manual-edit/SKILL.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-refactor/SKILL.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/data/skills/doubled-graph-verify/SKILL.md +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/graphs/__init__.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/graphs/anchors.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/graphs/crossref.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/graphs/declared.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/graphs/grace4.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/hooks_installer.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/integrations/__init__.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/integrations/grace_cli.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/migrations/__init__.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/migrations/grace3_to_grace4.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/policy/__init__.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/policy/agents_md.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/policy/phase.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/server.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/storage/__init__.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/storage/paths.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/tools/__init__.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/tools/_meta.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/tools/context.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/tools/detect_changes.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/tools/impact.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/tools/post_tool.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/tools/provenance.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/src/doubled_graph/uninstall.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/__init__.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/conftest.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_anchors.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_bom_support.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_cgc_contract.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_cgc_lifecycle.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_cli_surface.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_crossref_drift.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_daemon_main.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_declared_coverage.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_e2e_acceptance.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_grace4_artifacts.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_grace_cli_coverage.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_grace_cli_engine.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_hook_public_coverage.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mcp_transport.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mcp_validation.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_migration_coverage.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_migration_grace3_to_grace4.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mutation_gate_script.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mutation_kill_analyze.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mutation_kill_cgc_edges.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mutation_kill_cgc_fallback.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mutation_kill_cgc_misc.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mutation_kill_context.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mutation_kill_crossref.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mutation_kill_hooks.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mutation_kill_impact.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_mutation_probes.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_packaging.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_platform_branches.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_provenance.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_release_script.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_repo_hygiene.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_setup_artifacts.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_setup_coverage.py +0 -0
- {doubled_graph-3.0.0 → doubled_graph-3.0.2}/tests/test_setup_failure_semantics.py +0 -0
- {doubled_graph-3.0.0 → 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,6 +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 — это не «пустой граф».
|
|
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`.
|
|
232
238
|
Если `lint` вернул `markup.module-map-missing` — это содержательная работа, промпт `prompts/upgrade-methodology/01-content-gaps.md`.
|
|
233
239
|
|
|
234
240
|
Полная проверка (ruff + unit + real-CGC E2E + diff/version): `bash scripts/verify.sh`; критерии готовности — [docs/VERIFICATION.md](docs/VERIFICATION.md).
|
|
@@ -289,9 +295,13 @@ NFS-home): CGC при инициализации пишет `graph.settings` и
|
|
|
289
295
|
doubled-graph daemon install
|
|
290
296
|
doubled-graph daemon start
|
|
291
297
|
|
|
292
|
-
# Состояние: сервис + живой демон + реестр
|
|
298
|
+
# Состояние: сервис + живой демон + реестр проектов; показывает
|
|
299
|
+
# daemon.version и client_version и при расхождении — version_mismatch + hint
|
|
293
300
|
doubled-graph daemon status
|
|
294
301
|
|
|
302
|
+
# Заменить демон свежим процессом без полного setup (stop → unit → start)
|
|
303
|
+
doubled-graph daemon restart
|
|
304
|
+
|
|
295
305
|
# Логи и foreground-режим для отладки
|
|
296
306
|
doubled-graph daemon logs --lines 100
|
|
297
307
|
doubled-graph daemon run
|
|
@@ -303,6 +313,13 @@ doubled-graph daemon uninstall
|
|
|
303
313
|
`daemon status` завершается с rc=0, только если живой демон ответил на `ping`;
|
|
304
314
|
если сервис установлен, но не запущен (или не установлен вовсе), rc=1 и
|
|
305
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`).
|
|
306
323
|
|
|
307
324
|
`daemon uninstall` честен и при отказе супервизора: если `launchctl bootout` /
|
|
308
325
|
`systemctl disable --now` вернул ошибку, команда выводит `status: "failed"` и
|
|
@@ -433,13 +450,15 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
|
|
|
433
450
|
|
|
434
451
|
Пошагово с 2.x (или 1.9.x, если проект ещё на `docs/*.xml`):
|
|
435
452
|
|
|
436
|
-
1. **Поставьте именно 3.0.** `pipx upgrade doubled-graph` сейчас даёт
|
|
437
|
-
**
|
|
453
|
+
1. **Поставьте именно 3.0.2.** `pipx upgrade doubled-graph` сейчас даёт
|
|
454
|
+
**3.0.1**, а не 3.0.2 (3.0.2 ещё не в PyPI). Точный путь — wheel с явным
|
|
438
455
|
`--python`: см. [§Установка](#2-установить-doubled-graph). Убедитесь:
|
|
439
|
-
`doubled-graph --version` → `3.0.
|
|
456
|
+
`doubled-graph --version` → `3.0.2`.
|
|
440
457
|
2. **`cd your-project && doubled-graph setup`** — в **обычном** шелле, не из
|
|
441
|
-
песочницы. `setup`
|
|
442
|
-
|
|
458
|
+
песочницы. `setup` **всегда** останавливает и заново запускает сервис
|
|
459
|
+
`graphd` (stop → install/update unit → start), регистрирует проект,
|
|
460
|
+
обновляет движок и `.grace`, а затем сверяет версию ответившего демона с
|
|
461
|
+
версией клиента; несовпадение — `failed_steps: ["daemon"]` и rc=1.
|
|
443
462
|
3. **Проверьте:** `doubled-graph daemon status` → `installed: true`,
|
|
444
463
|
`running: true`; `doubled-graph health` → `cgc.ok: true`. Если демон не
|
|
445
464
|
ответил за 60 с холодного старта, `setup` печатает честное сообщение с
|
|
@@ -463,9 +482,9 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
|
|
|
463
482
|
обновлением на 3.0:
|
|
464
483
|
|
|
465
484
|
```bash
|
|
466
|
-
# 1. поставить 3.0 (pipx upgrade даст только
|
|
485
|
+
# 1. поставить 3.0.2 (pipx upgrade даст только 3.0.1 — см. §Установка)
|
|
467
486
|
python3.14 -m build --wheel
|
|
468
|
-
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
|
|
469
488
|
cd your-project
|
|
470
489
|
doubled-graph setup # 2. движок, .grace и демон graphd — одной командой
|
|
471
490
|
```
|
|
@@ -487,7 +506,7 @@ doubled-graph setup # 2. движок, .grace и демон graphd —
|
|
|
487
506
|
| Сценарий | Последствия |
|
|
488
507
|
|---|---|
|
|
489
508
|
| Остались на 1.9.x | Всё работает по-старому, но без обновлений и поддержки `.grace` |
|
|
490
|
-
| Обновили пакет, `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 |
|
|
491
510
|
| Мигрировали, но `LINKS` не поправили | lint зелёный, но модули «пустые»: `module show` не показывает файлы, `detect_changes` даёт `code_without_module` на весь код |
|
|
492
511
|
|
|
493
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,6 +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 — это не «пустой граф».
|
|
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`.
|
|
191
197
|
Если `lint` вернул `markup.module-map-missing` — это содержательная работа, промпт `prompts/upgrade-methodology/01-content-gaps.md`.
|
|
192
198
|
|
|
193
199
|
Полная проверка (ruff + unit + real-CGC E2E + diff/version): `bash scripts/verify.sh`; критерии готовности — [docs/VERIFICATION.md](docs/VERIFICATION.md).
|
|
@@ -248,9 +254,13 @@ NFS-home): CGC при инициализации пишет `graph.settings` и
|
|
|
248
254
|
doubled-graph daemon install
|
|
249
255
|
doubled-graph daemon start
|
|
250
256
|
|
|
251
|
-
# Состояние: сервис + живой демон + реестр
|
|
257
|
+
# Состояние: сервис + живой демон + реестр проектов; показывает
|
|
258
|
+
# daemon.version и client_version и при расхождении — version_mismatch + hint
|
|
252
259
|
doubled-graph daemon status
|
|
253
260
|
|
|
261
|
+
# Заменить демон свежим процессом без полного setup (stop → unit → start)
|
|
262
|
+
doubled-graph daemon restart
|
|
263
|
+
|
|
254
264
|
# Логи и foreground-режим для отладки
|
|
255
265
|
doubled-graph daemon logs --lines 100
|
|
256
266
|
doubled-graph daemon run
|
|
@@ -262,6 +272,13 @@ doubled-graph daemon uninstall
|
|
|
262
272
|
`daemon status` завершается с rc=0, только если живой демон ответил на `ping`;
|
|
263
273
|
если сервис установлен, но не запущен (или не установлен вовсе), rc=1 и
|
|
264
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`).
|
|
265
282
|
|
|
266
283
|
`daemon uninstall` честен и при отказе супервизора: если `launchctl bootout` /
|
|
267
284
|
`systemctl disable --now` вернул ошибку, команда выводит `status: "failed"` и
|
|
@@ -392,13 +409,15 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
|
|
|
392
409
|
|
|
393
410
|
Пошагово с 2.x (или 1.9.x, если проект ещё на `docs/*.xml`):
|
|
394
411
|
|
|
395
|
-
1. **Поставьте именно 3.0.** `pipx upgrade doubled-graph` сейчас даёт
|
|
396
|
-
**
|
|
412
|
+
1. **Поставьте именно 3.0.2.** `pipx upgrade doubled-graph` сейчас даёт
|
|
413
|
+
**3.0.1**, а не 3.0.2 (3.0.2 ещё не в PyPI). Точный путь — wheel с явным
|
|
397
414
|
`--python`: см. [§Установка](#2-установить-doubled-graph). Убедитесь:
|
|
398
|
-
`doubled-graph --version` → `3.0.
|
|
415
|
+
`doubled-graph --version` → `3.0.2`.
|
|
399
416
|
2. **`cd your-project && doubled-graph setup`** — в **обычном** шелле, не из
|
|
400
|
-
песочницы. `setup`
|
|
401
|
-
|
|
417
|
+
песочницы. `setup` **всегда** останавливает и заново запускает сервис
|
|
418
|
+
`graphd` (stop → install/update unit → start), регистрирует проект,
|
|
419
|
+
обновляет движок и `.grace`, а затем сверяет версию ответившего демона с
|
|
420
|
+
версией клиента; несовпадение — `failed_steps: ["daemon"]` и rc=1.
|
|
402
421
|
3. **Проверьте:** `doubled-graph daemon status` → `installed: true`,
|
|
403
422
|
`running: true`; `doubled-graph health` → `cgc.ok: true`. Если демон не
|
|
404
423
|
ответил за 60 с холодного старта, `setup` печатает честное сообщение с
|
|
@@ -422,9 +441,9 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
|
|
|
422
441
|
обновлением на 3.0:
|
|
423
442
|
|
|
424
443
|
```bash
|
|
425
|
-
# 1. поставить 3.0 (pipx upgrade даст только
|
|
444
|
+
# 1. поставить 3.0.2 (pipx upgrade даст только 3.0.1 — см. §Установка)
|
|
426
445
|
python3.14 -m build --wheel
|
|
427
|
-
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
|
|
428
447
|
cd your-project
|
|
429
448
|
doubled-graph setup # 2. движок, .grace и демон graphd — одной командой
|
|
430
449
|
```
|
|
@@ -446,7 +465,7 @@ doubled-graph setup # 2. движок, .grace и демон graphd —
|
|
|
446
465
|
| Сценарий | Последствия |
|
|
447
466
|
|---|---|
|
|
448
467
|
| Остались на 1.9.x | Всё работает по-старому, но без обновлений и поддержки `.grace` |
|
|
449
|
-
| Обновили пакет, `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 |
|
|
450
469
|
| Мигрировали, но `LINKS` не поправили | lint зелёный, но модули «пустые»: `module show` не показывает файлы, `detect_changes` даёт `code_without_module` на весь код |
|
|
451
470
|
|
|
452
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": {
|
|
@@ -215,7 +233,14 @@ def build_health_report(repo: Path) -> dict[str, Any]:
|
|
|
215
233
|
for item in declared.issues
|
|
216
234
|
],
|
|
217
235
|
},
|
|
218
|
-
"cgc": {
|
|
236
|
+
"cgc": {
|
|
237
|
+
"ok": cgc_diag is None,
|
|
238
|
+
"diagnostic": cgc_diag,
|
|
239
|
+
"daemon": daemon,
|
|
240
|
+
# Engine files the backend removed because a previous start died
|
|
241
|
+
# halfway: the repair must be visible, not silent.
|
|
242
|
+
"repaired": list(getattr(cgc, "last_repair", []) or []),
|
|
243
|
+
},
|
|
219
244
|
"modules": {
|
|
220
245
|
"total": len(declared.modules),
|
|
221
246
|
"verified": len(verified_module_ids & set(declared.modules.keys())),
|
|
@@ -224,6 +249,7 @@ def build_health_report(repo: Path) -> dict[str, Any]:
|
|
|
224
249
|
"verification": {"total_v_m_records": len(declared.verification)},
|
|
225
250
|
"drift": {"total": drift_count, "by_type": drift_by_type},
|
|
226
251
|
"drift_md": {"open_entries": open_drift_entries},
|
|
252
|
+
"warnings": warnings,
|
|
227
253
|
"ok": (
|
|
228
254
|
not declared_errors
|
|
229
255
|
and cgc_diag is None
|
|
@@ -16,6 +16,7 @@ import hashlib
|
|
|
16
16
|
import importlib.util
|
|
17
17
|
import os
|
|
18
18
|
import re
|
|
19
|
+
import socket
|
|
19
20
|
import subprocess
|
|
20
21
|
import sys
|
|
21
22
|
import tempfile
|
|
@@ -326,11 +327,16 @@ def _manager_backend_type(manager: Any) -> str | None:
|
|
|
326
327
|
|
|
327
328
|
|
|
328
329
|
def _clear_falkordb_failed_config(db_path: str) -> None:
|
|
329
|
-
"""Drop CGC's cached start-failure for *db_path* before
|
|
330
|
-
|
|
331
|
-
``FalkorDBManager.get_driver`` remembers a failed configuration
|
|
332
|
-
|
|
333
|
-
|
|
330
|
+
"""Drop CGC's cached start-failure for *db_path* before every attempt.
|
|
331
|
+
|
|
332
|
+
``FalkorDBManager.get_driver`` remembers a failed configuration and then
|
|
333
|
+
refuses to try again ("previously failed") for the rest of the process.
|
|
334
|
+
That memo is a footnote of one attempt, not a property of the database: a
|
|
335
|
+
long-lived daemon that hit one transient failure (stale socket, another
|
|
336
|
+
process still exiting, a full disk for a second) would otherwise report
|
|
337
|
+
the cached message forever, and the user would see "previously failed"
|
|
338
|
+
instead of the real reason. The cache is therefore cleared before each
|
|
339
|
+
attempt so the next one starts from facts.
|
|
334
340
|
"""
|
|
335
341
|
try:
|
|
336
342
|
from codegraphcontext.core.database_falkordb import FalkorDBManager # type: ignore
|
|
@@ -344,6 +350,49 @@ def _clear_falkordb_failed_config(db_path: str) -> None:
|
|
|
344
350
|
failed.discard(key)
|
|
345
351
|
|
|
346
352
|
|
|
353
|
+
#: Files an interrupted FalkorDB start leaves next to ``db_path``. The graph
|
|
354
|
+
#: data itself lives inside ``db_path`` and is never touched here: deleting a
|
|
355
|
+
#: socket/settings pair costs one restart, deleting the data costs the index.
|
|
356
|
+
_STALE_ENGINE_FILES = ("falkordb.sock", "graph.settings")
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
def _dead_unix_socket(path: Path) -> bool:
|
|
360
|
+
"""True when *path* is a socket file that nobody is listening on."""
|
|
361
|
+
probe = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
|
362
|
+
probe.settimeout(0.2)
|
|
363
|
+
try:
|
|
364
|
+
probe.connect(str(path))
|
|
365
|
+
return False
|
|
366
|
+
except OSError:
|
|
367
|
+
return True
|
|
368
|
+
finally:
|
|
369
|
+
probe.close()
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
def _repair_stale_engine_state(db_path: str) -> list[str]:
|
|
373
|
+
"""Remove leftovers of an interrupted FalkorDB start; keep graph data.
|
|
374
|
+
|
|
375
|
+
A socket nobody listens on, and a settings file written by a start that
|
|
376
|
+
died halfway, are enough to make every later attempt fail. Removing them
|
|
377
|
+
is safe: a live engine is never touched (the socket answers), and the
|
|
378
|
+
database directory itself is left alone.
|
|
379
|
+
"""
|
|
380
|
+
directory = Path(db_path).parent
|
|
381
|
+
removed: list[str] = []
|
|
382
|
+
for name in _STALE_ENGINE_FILES:
|
|
383
|
+
candidate = directory / name
|
|
384
|
+
try:
|
|
385
|
+
if not candidate.exists():
|
|
386
|
+
continue
|
|
387
|
+
if candidate.suffix == ".sock" and not _dead_unix_socket(candidate):
|
|
388
|
+
continue # a live engine owns it
|
|
389
|
+
candidate.unlink()
|
|
390
|
+
removed.append(str(candidate))
|
|
391
|
+
except OSError:
|
|
392
|
+
continue
|
|
393
|
+
return removed
|
|
394
|
+
|
|
395
|
+
|
|
347
396
|
def _create_db_manager(db_path: str, db_type: str) -> Any:
|
|
348
397
|
"""Create exactly the requested backend; never accept a silent fallback.
|
|
349
398
|
|
|
@@ -360,6 +409,10 @@ def _create_db_manager(db_path: str, db_type: str) -> Any:
|
|
|
360
409
|
"""
|
|
361
410
|
attempt = 0
|
|
362
411
|
while True:
|
|
412
|
+
if db_type == "falkordb":
|
|
413
|
+
# A memo of an earlier failure must not outlive that attempt; see
|
|
414
|
+
# `_clear_falkordb_failed_config` for why the daemon depends on it.
|
|
415
|
+
_clear_falkordb_failed_config(db_path)
|
|
363
416
|
try:
|
|
364
417
|
if db_type == "falkordb":
|
|
365
418
|
from codegraphcontext.core import FalkorDBManager # type: ignore
|
|
@@ -388,8 +441,6 @@ def _create_db_manager(db_path: str, db_type: str) -> Any:
|
|
|
388
441
|
if not _is_backend_lock_error(exc) or attempt >= _BACKEND_INIT_ATTEMPTS - 1:
|
|
389
442
|
raise
|
|
390
443
|
attempt += 1
|
|
391
|
-
if db_type == "falkordb":
|
|
392
|
-
_clear_falkordb_failed_config(db_path)
|
|
393
444
|
time.sleep(_BACKEND_RETRY_BASE_DELAY_S * (2 ** (attempt - 1)))
|
|
394
445
|
|
|
395
446
|
|
|
@@ -465,6 +516,10 @@ class CGC:
|
|
|
465
516
|
#: Last ``close`` failure. ``close`` never raises (a failed teardown
|
|
466
517
|
#: must not break process exit); the reason is kept for diagnostics.
|
|
467
518
|
self.last_close_error: str | None = None
|
|
519
|
+
#: Engine files removed because a previous start died halfway. A
|
|
520
|
+
#: non-empty list means the backend healed itself; surfaced by
|
|
521
|
+
#: `analyze`/`health` so the repair is visible, not silent.
|
|
522
|
+
self.last_repair: list[str] = []
|
|
468
523
|
self._atexit_registered = False
|
|
469
524
|
self._register_atexit()
|
|
470
525
|
|
|
@@ -556,15 +611,40 @@ class CGC:
|
|
|
556
611
|
except CGCUnavailable:
|
|
557
612
|
raise
|
|
558
613
|
except Exception as e:
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
614
|
+
# A start that died halfway leaves a dead socket and/or a
|
|
615
|
+
# half-written settings file next to the database; every later
|
|
616
|
+
# attempt then fails for good. Repair once and retry: `setup` and
|
|
617
|
+
# `analyze` must heal this without asking the user to delete
|
|
618
|
+
# `~/.codegraphcontext` by hand.
|
|
619
|
+
repaired = (
|
|
620
|
+
_repair_stale_engine_state(db_path) if db_type == "falkordb" else []
|
|
621
|
+
)
|
|
622
|
+
if repaired:
|
|
623
|
+
self.last_repair = repaired
|
|
624
|
+
try:
|
|
625
|
+
self._db = _create_db_manager(db_path, db_type)
|
|
626
|
+
except Exception as retry_exc:
|
|
627
|
+
raise CGCUnavailable(
|
|
628
|
+
f"CGC backend {db_type!r} failed to initialise at {db_path} "
|
|
629
|
+
f"even after removing stale engine files "
|
|
630
|
+
f"({', '.join(repaired)}): "
|
|
631
|
+
f"{type(retry_exc).__name__}: {retry_exc}\n"
|
|
632
|
+
"No fallback to another backend is attempted: an embedded "
|
|
633
|
+
"fallback would open the same per-repo directory with a "
|
|
634
|
+
"different engine, which can lock or corrupt it. Fix the "
|
|
635
|
+
"backend, or set `cgc.backend` explicitly "
|
|
636
|
+
"(falkordb/kuzu/neo4j) and retry."
|
|
637
|
+
) from retry_exc
|
|
638
|
+
else:
|
|
639
|
+
raise CGCUnavailable(
|
|
640
|
+
f"CGC backend {db_type!r} failed to initialise at {db_path}: "
|
|
641
|
+
f"{type(e).__name__}: {e}\n"
|
|
642
|
+
"No fallback to another backend is attempted: an embedded "
|
|
643
|
+
"fallback would open the same per-repo directory with a "
|
|
644
|
+
"different engine, which can lock or corrupt it. Fix the "
|
|
645
|
+
"backend, or set `cgc.backend` explicitly "
|
|
646
|
+
"(falkordb/kuzu/neo4j) and retry."
|
|
647
|
+
) from e
|
|
568
648
|
finally:
|
|
569
649
|
if previous_db_type is None:
|
|
570
650
|
os.environ.pop("CGC_RUNTIME_DB_TYPE", None)
|