doubled-graph 3.0.4__tar.gz → 3.0.5__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.
Files changed (150) hide show
  1. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/PKG-INFO +17 -15
  2. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/README.md +16 -14
  3. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/pyproject.toml +1 -1
  4. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/cli.py +49 -3
  5. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/health.py +23 -1
  6. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/integrations/cgc.py +74 -31
  7. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/migrations/grace3_to_grace4.py +0 -53
  8. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/setup.py +182 -170
  9. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/tools/analyze.py +23 -0
  10. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/tools/detect_changes.py +5 -0
  11. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_bom_support.py +15 -3
  12. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_cgc_contract.py +52 -1
  13. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_cli_entrypoint.py +3 -3
  14. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_cli_surface.py +67 -0
  15. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_crossref_drift.py +3 -0
  16. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_e2e_acceptance.py +44 -0
  17. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_health.py +35 -0
  18. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_migration_coverage.py +13 -9
  19. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_migration_grace3_to_grace4.py +35 -6
  20. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_setup_coverage.py +152 -115
  21. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_smoke.py +123 -8
  22. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/.gitignore +0 -0
  23. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/ARTICLE.md +0 -0
  24. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/INDEX.md +0 -0
  25. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/LICENSE +0 -0
  26. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/for-ai-existing-project/README.md +0 -0
  27. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/for-ai-maintenance/README.md +0 -0
  28. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/for-ai-new-project/README.md +0 -0
  29. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/for-humans/FAQ.md +0 -0
  30. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/for-humans/deep-dive.md +0 -0
  31. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/for-humans/getting-started.md +0 -0
  32. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/README.md +0 -0
  33. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/approval-checkpoints.md +0 -0
  34. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/artifacts.md +0 -0
  35. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/auto-scaling.md +0 -0
  36. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/ci-templates/github-actions.yml +0 -0
  37. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/ci-templates/gitlab-ci.yml +0 -0
  38. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/drift-and-priority.md +0 -0
  39. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/language-adapters/_template.md +0 -0
  40. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/language-adapters/csharp.md +0 -0
  41. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/language-adapters/go.md +0 -0
  42. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/language-adapters/java.md +0 -0
  43. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/language-adapters/python.md +0 -0
  44. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/language-adapters/rust.md +0 -0
  45. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/language-adapters/swift.md +0 -0
  46. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/language-adapters/typescript.md +0 -0
  47. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/principles.md +0 -0
  48. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/roles.md +0 -0
  49. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/runtime-adapters/_template.md +0 -0
  50. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/runtime-adapters/claude-code.md +0 -0
  51. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/runtime-adapters/codex.md +0 -0
  52. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/runtime-adapters/continue.md +0 -0
  53. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/runtime-adapters/cursor.md +0 -0
  54. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/runtime-adapters/local-llm.md +0 -0
  55. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/runtime-adapters/windsurf.md +0 -0
  56. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/tools.md +0 -0
  57. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/methodology/workflow.md +0 -0
  58. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/maintenance/on-after-edit.md +0 -0
  59. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/maintenance/on-before-edit.md +0 -0
  60. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/maintenance/on-drift-detected.md +0 -0
  61. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/maintenance/on-user-manual-edit.md +0 -0
  62. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/migrate-existing-project/00-entry-prompt.md +0 -0
  63. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/migrate-existing-project/01-discover.md +0 -0
  64. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/migrate-existing-project/02-reconstruct-intent.md +0 -0
  65. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/migrate-existing-project/03-draft-plan.md +0 -0
  66. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/migrate-existing-project/04-markup-codebase.md +0 -0
  67. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/migrate-existing-project/05-verification-and-logs.md +0 -0
  68. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/migrate-existing-project/06-validation-gates.md +0 -0
  69. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/new-project/00-entry-prompt.md +0 -0
  70. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/new-project/01-intent-interview.md +0 -0
  71. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/new-project/02-requirements.md +0 -0
  72. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/new-project/03-technology.md +0 -0
  73. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/new-project/04-development-plan.md +0 -0
  74. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/new-project/05-verification-plan.md +0 -0
  75. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/new-project/06-generate.md +0 -0
  76. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/new-project/07-post-init-sync.md +0 -0
  77. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/upgrade-methodology/00-entry-prompt.md +0 -0
  78. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/prompts/upgrade-methodology/01-content-gaps.md +0 -0
  79. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/__init__.py +0 -0
  80. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/__main__.py +0 -0
  81. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/config.py +0 -0
  82. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/daemon/__init__.py +0 -0
  83. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/daemon/main.py +0 -0
  84. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/daemon/server.py +0 -0
  85. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/data/skills/doubled-graph-after-edit/SKILL.md +0 -0
  86. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/data/skills/doubled-graph-before-edit/SKILL.md +0 -0
  87. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/data/skills/doubled-graph-drift/SKILL.md +0 -0
  88. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/data/skills/doubled-graph-guide/SKILL.md +0 -0
  89. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/data/skills/doubled-graph-manual-edit/SKILL.md +0 -0
  90. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/data/skills/doubled-graph-refactor/SKILL.md +0 -0
  91. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/data/skills/doubled-graph-verify/SKILL.md +0 -0
  92. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/graphs/__init__.py +0 -0
  93. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/graphs/anchors.py +0 -0
  94. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/graphs/crossref.py +0 -0
  95. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/graphs/declared.py +0 -0
  96. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/graphs/grace4.py +0 -0
  97. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/hooks_installer.py +0 -0
  98. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/integrations/__init__.py +0 -0
  99. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/integrations/grace_cli.py +0 -0
  100. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/integrations/graphd.py +0 -0
  101. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/integrations/service.py +0 -0
  102. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/migrations/__init__.py +0 -0
  103. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/policy/__init__.py +0 -0
  104. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/policy/agents_md.py +0 -0
  105. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/policy/phase.py +0 -0
  106. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/server.py +0 -0
  107. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/storage/__init__.py +0 -0
  108. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/storage/paths.py +0 -0
  109. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/tools/__init__.py +0 -0
  110. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/tools/_meta.py +0 -0
  111. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/tools/context.py +0 -0
  112. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/tools/impact.py +0 -0
  113. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/tools/post_tool.py +0 -0
  114. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/tools/provenance.py +0 -0
  115. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/src/doubled_graph/uninstall.py +0 -0
  116. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/__init__.py +0 -0
  117. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/conftest.py +0 -0
  118. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_anchors.py +0 -0
  119. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_cgc_backend.py +0 -0
  120. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_cgc_lifecycle.py +0 -0
  121. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_cli_daemon.py +0 -0
  122. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_daemon.py +0 -0
  123. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_daemon_main.py +0 -0
  124. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_declared_coverage.py +0 -0
  125. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_grace4_artifacts.py +0 -0
  126. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_grace_cli_coverage.py +0 -0
  127. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_grace_cli_engine.py +0 -0
  128. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_graphd_client.py +0 -0
  129. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_hook_public_coverage.py +0 -0
  130. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mcp_transport.py +0 -0
  131. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mcp_validation.py +0 -0
  132. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mutation_gate_script.py +0 -0
  133. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mutation_kill_analyze.py +0 -0
  134. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mutation_kill_cgc_edges.py +0 -0
  135. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mutation_kill_cgc_fallback.py +0 -0
  136. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mutation_kill_cgc_misc.py +0 -0
  137. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mutation_kill_context.py +0 -0
  138. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mutation_kill_crossref.py +0 -0
  139. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mutation_kill_hooks.py +0 -0
  140. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mutation_kill_impact.py +0 -0
  141. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_mutation_probes.py +0 -0
  142. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_packaging.py +0 -0
  143. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_platform_branches.py +0 -0
  144. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_provenance.py +0 -0
  145. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_release_script.py +0 -0
  146. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_repo_hygiene.py +0 -0
  147. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_service.py +0 -0
  148. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_setup_artifacts.py +0 -0
  149. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/tests/test_setup_failure_semantics.py +0 -0
  150. {doubled_graph-3.0.4 → doubled_graph-3.0.5}/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.4
3
+ Version: 3.0.5
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 сейчас опубликована **3.0.1**. Версии **3.0.2, 3.0.3 и 3.0.4 в PyPI
91
+ На PyPI сейчас опубликована **3.0.1**. Версии **3.0.2, 3.0.3, 3.0.4 и 3.0.5 в PyPI
92
92
  ещё не опубликованы**, поэтому `pipx install doubled-graph` (без версии) на
93
93
  поддерживаемом Python поставит 3.0.1, а `doubled-graph --version` покажет не
94
- 3.0.4. Чтобы поставить именно
95
- 3.0.4 из этого репозитория, соберите wheel поддерживаемым интерпретатором
94
+ 3.0.5. Чтобы поставить именно
95
+ 3.0.5 из этого репозитория, соберите 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.4-py3-none-any.whl
102
+ pipx install --python python3.14 --force dist/doubled_graph-3.0.5-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.4 # до релиза — wheel выше
109
+ pipx install --python python3.14 doubled-graph==3.0.5 # до релиза — wheel выше
110
110
  ```
111
111
 
112
112
  > Уже работаете в своём venv или conda-окружении? `python3.14 -m pip install
113
- > doubled-graph` из PyPI тоже поставит 3.0.1; для 3.0.4 используйте wheel:
114
- > `python3.14 -m pip install dist/doubled_graph-3.0.4-py3-none-any.whl`.
113
+ > doubled-graph` из PyPI тоже поставит 3.0.1; для 3.0.5 используйте wheel:
114
+ > `python3.14 -m pip install dist/doubled_graph-3.0.5-py3-none-any.whl`.
115
115
 
116
116
  ---
117
117
 
@@ -166,7 +166,7 @@ doubled-graph setup
166
166
  > `pipx install --python python3.12|3.13|3.14 --force doubled-graph==<установленная
167
167
  > версия>` (`setup.py::_auto_reinstall_on_working_python`). Версия
168
168
  > **запинена**: команда без версии поставила бы опубликованную 3.0.1 и молча
169
- > откатила текущую версию (3.0.4). Это единственная сетевая переустановка пакета; при `--dry-run`
169
+ > откатила текущую версию (3.0.5). Это единственная сетевая переустановка пакета; при `--dry-run`
170
170
  > она только репортится (`status: "dry_run_reinstall"`), а при `pip install` в
171
171
  > venv/CI не выполняется вовсе (`_looks_like_pipx_install()`). Если сети нет
172
172
  > или такой версии ещё нет на PyPI, шаг честно возвращает `reinstall_failed`
@@ -223,7 +223,7 @@ head -1 "$(which doubled-graph)" # вывести shebang — это и ест
223
223
  ### 4. Проверить, что всё встало
224
224
 
225
225
  ```bash
226
- doubled-graph --version # 3.0.4 (после wheel-установки выше; 3.0.1 при pipx install из PyPI)
226
+ doubled-graph --version # 3.0.5 (после wheel-установки выше; 3.0.1 при pipx install из PyPI)
227
227
  doubled-graph status --repo . # artifacts.project_kind = grace4, grace_engine.upgrade_required = false
228
228
  doubled-graph daemon status # installed = true, running = true
229
229
  doubled-graph health --repo . # cgc.ok = true (демон ответил)
@@ -236,6 +236,8 @@ doubled-graph migrate check --repo . # map_pending / placeholders — что
236
236
  Если `daemon.running` = `false`, а `health.cgc.ok` = `false` — демон не запущен: выполните `doubled-graph setup` в обычном шелле (из песочницы `launchctl`/`systemctl` могут быть запрещены), затем `daemon status`. Без демона графовые команды возвращают `CGC_BACKEND_FAIL` и rc=1 — это не «пустой граф».
237
237
  Если `daemon status` показывает `installed: false`, `plist_present: true`, `loaded: false` — plist/unit записан, но job не загружен (launchd отключил сервис, `bootstrap` отклонён, остался stale-lock/сокет). С 3.0.3 это лечится само: `setup` и `daemon restart` останавливают старый процесс, удаляют discovery и stale-lock только при мёртвом PID-владельце, при необходимости выполняют `launchctl enable`/`systemctl unmask`, переписывают unit и делают `bootstrap`, а при отказе показывают реальный stderr супервизора и подсказку `log show --last 1m`. Ручная чистка `~/.doubled-graph` не требуется.
238
238
  Если `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.3 этот список приходит из демона, а не всегда пуст). В 3.0.3 также `setup` всегда перезапускает демон, поэтому обновление не оставляет старый процесс со старым кэшем.
239
+ С 3.0.5 `scan.exclude` — общий фильтр: full/incremental/`--paths` в `analyze` видят те же исключения, что `detect-changes`, и scratch-каталоги (`.dg-tmp/**`, `node_modules/**`) не попадают в граф. `setup` печатает по шагу только `ok`/`failed (причина)`/`skipped`, а счётчики и списки `per_ide` оставляет в JSON (в `--dry-run` — прогноз `would write/overwrite/append`). `detect-changes` получил `files_examined_count` (список — с `--verbose`), `health` — `modules.without_verification_breakdown: {missing, placeholder}`, а `migrate` в консоли печатает только `created`/`markup_pending` (полный отчёт — `migrate ... --json`).
240
+
239
241
  Если после этого движок всё равно падает с `Connection refused`, а `redis-server` в логах пишет `Can't handle RDB format version 13`, виновата сама база: файл `<db_path>` записан новее, чем умеет читать текущий `redis-server`. С 3.0.4 `_ensure` после двух неудач **переименовывает** его в `<db_path>.incompatible-<UTC timestamp>` (никогда не удаляет), один раз повторяет запуск на свежей базе, а `analyze` эмитит `CGC_ENGINE_DB_QUARANTINED`. `health.cgc.quarantined` перечисляет такие файлы, `health.cgc.repaired` — и их, и удалённые stale-файлы, а `setup` показывает `quarantined` в отчёте шага analyze (и `quarantine_candidate` в `--dry-run`). Если и третий запуск не удался, `CGCUnavailable` перечисляет все попытки и путь карантина; дальше — `daemon logs` и `cgc.backend`.
240
242
  Если `lint` вернул `markup.module-map-missing` — это содержательная работа, промпт `prompts/upgrade-methodology/01-content-gaps.md`.
241
243
 
@@ -452,10 +454,10 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
452
454
 
453
455
  Пошагово с 2.x (или 1.9.x, если проект ещё на `docs/*.xml`):
454
456
 
455
- 1. **Поставьте именно 3.0.4.** `pipx upgrade doubled-graph` сейчас даёт
456
- **3.0.1**, а не 3.0.4 (3.0.2, 3.0.3 и 3.0.4 ещё не в PyPI). Точный путь — wheel с явным
457
+ 1. **Поставьте именно 3.0.5.** `pipx upgrade doubled-graph` сейчас даёт
458
+ **3.0.1**, а не 3.0.5 (3.0.2, 3.0.3, 3.0.4 и 3.0.5 ещё не в PyPI). Точный путь — wheel с явным
457
459
  `--python`: см. [§Установка](#2-установить-doubled-graph). Убедитесь:
458
- `doubled-graph --version` → `3.0.4`.
460
+ `doubled-graph --version` → `3.0.5`.
459
461
  2. **`cd your-project && doubled-graph setup`** — в **обычном** шелле, не из
460
462
  песочницы. `setup` **всегда** останавливает и заново запускает сервис
461
463
  `graphd` (stop → install/update unit → start), регистрирует проект,
@@ -484,9 +486,9 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
484
486
  обновлением на 3.0:
485
487
 
486
488
  ```bash
487
- # 1. поставить 3.0.4 (pipx upgrade даст только 3.0.1 — см. §Установка)
489
+ # 1. поставить 3.0.5 (pipx upgrade даст только 3.0.1 — см. §Установка)
488
490
  python3.14 -m build --wheel
489
- pipx install --python python3.14 --force dist/doubled_graph-3.0.4-py3-none-any.whl
491
+ pipx install --python python3.14 --force dist/doubled_graph-3.0.5-py3-none-any.whl
490
492
  cd your-project
491
493
  doubled-graph setup # 2. движок, .grace и демон graphd — одной командой
492
494
  ```
@@ -47,30 +47,30 @@ pipx ensurepath
47
47
 
48
48
  ### 2. Установить doubled-graph
49
49
 
50
- На PyPI сейчас опубликована **3.0.1**. Версии **3.0.2, 3.0.3 и 3.0.4 в PyPI
50
+ На PyPI сейчас опубликована **3.0.1**. Версии **3.0.2, 3.0.3, 3.0.4 и 3.0.5 в PyPI
51
51
  ещё не опубликованы**, поэтому `pipx install doubled-graph` (без версии) на
52
52
  поддерживаемом Python поставит 3.0.1, а `doubled-graph --version` покажет не
53
- 3.0.4. Чтобы поставить именно
54
- 3.0.4 из этого репозитория, соберите wheel поддерживаемым интерпретатором
53
+ 3.0.5. Чтобы поставить именно
54
+ 3.0.5 из этого репозитория, соберите 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.4-py3-none-any.whl
61
+ pipx install --python python3.14 --force dist/doubled_graph-3.0.5-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.4 # до релиза — wheel выше
68
+ pipx install --python python3.14 doubled-graph==3.0.5 # до релиза — wheel выше
69
69
  ```
70
70
 
71
71
  > Уже работаете в своём venv или conda-окружении? `python3.14 -m pip install
72
- > doubled-graph` из PyPI тоже поставит 3.0.1; для 3.0.4 используйте wheel:
73
- > `python3.14 -m pip install dist/doubled_graph-3.0.4-py3-none-any.whl`.
72
+ > doubled-graph` из PyPI тоже поставит 3.0.1; для 3.0.5 используйте wheel:
73
+ > `python3.14 -m pip install dist/doubled_graph-3.0.5-py3-none-any.whl`.
74
74
 
75
75
  ---
76
76
 
@@ -125,7 +125,7 @@ doubled-graph setup
125
125
  > `pipx install --python python3.12|3.13|3.14 --force doubled-graph==<установленная
126
126
  > версия>` (`setup.py::_auto_reinstall_on_working_python`). Версия
127
127
  > **запинена**: команда без версии поставила бы опубликованную 3.0.1 и молча
128
- > откатила текущую версию (3.0.4). Это единственная сетевая переустановка пакета; при `--dry-run`
128
+ > откатила текущую версию (3.0.5). Это единственная сетевая переустановка пакета; при `--dry-run`
129
129
  > она только репортится (`status: "dry_run_reinstall"`), а при `pip install` в
130
130
  > venv/CI не выполняется вовсе (`_looks_like_pipx_install()`). Если сети нет
131
131
  > или такой версии ещё нет на PyPI, шаг честно возвращает `reinstall_failed`
@@ -182,7 +182,7 @@ head -1 "$(which doubled-graph)" # вывести shebang — это и ест
182
182
  ### 4. Проверить, что всё встало
183
183
 
184
184
  ```bash
185
- doubled-graph --version # 3.0.4 (после wheel-установки выше; 3.0.1 при pipx install из PyPI)
185
+ doubled-graph --version # 3.0.5 (после wheel-установки выше; 3.0.1 при pipx install из PyPI)
186
186
  doubled-graph status --repo . # artifacts.project_kind = grace4, grace_engine.upgrade_required = false
187
187
  doubled-graph daemon status # installed = true, running = true
188
188
  doubled-graph health --repo . # cgc.ok = true (демон ответил)
@@ -195,6 +195,8 @@ doubled-graph migrate check --repo . # map_pending / placeholders — что
195
195
  Если `daemon.running` = `false`, а `health.cgc.ok` = `false` — демон не запущен: выполните `doubled-graph setup` в обычном шелле (из песочницы `launchctl`/`systemctl` могут быть запрещены), затем `daemon status`. Без демона графовые команды возвращают `CGC_BACKEND_FAIL` и rc=1 — это не «пустой граф».
196
196
  Если `daemon status` показывает `installed: false`, `plist_present: true`, `loaded: false` — plist/unit записан, но job не загружен (launchd отключил сервис, `bootstrap` отклонён, остался stale-lock/сокет). С 3.0.3 это лечится само: `setup` и `daemon restart` останавливают старый процесс, удаляют discovery и stale-lock только при мёртвом PID-владельце, при необходимости выполняют `launchctl enable`/`systemctl unmask`, переписывают unit и делают `bootstrap`, а при отказе показывают реальный stderr супервизора и подсказку `log show --last 1m`. Ручная чистка `~/.doubled-graph` не требуется.
197
197
  Если `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.3 этот список приходит из демона, а не всегда пуст). В 3.0.3 также `setup` всегда перезапускает демон, поэтому обновление не оставляет старый процесс со старым кэшем.
198
+ С 3.0.5 `scan.exclude` — общий фильтр: full/incremental/`--paths` в `analyze` видят те же исключения, что `detect-changes`, и scratch-каталоги (`.dg-tmp/**`, `node_modules/**`) не попадают в граф. `setup` печатает по шагу только `ok`/`failed (причина)`/`skipped`, а счётчики и списки `per_ide` оставляет в JSON (в `--dry-run` — прогноз `would write/overwrite/append`). `detect-changes` получил `files_examined_count` (список — с `--verbose`), `health` — `modules.without_verification_breakdown: {missing, placeholder}`, а `migrate` в консоли печатает только `created`/`markup_pending` (полный отчёт — `migrate ... --json`).
199
+
198
200
  Если после этого движок всё равно падает с `Connection refused`, а `redis-server` в логах пишет `Can't handle RDB format version 13`, виновата сама база: файл `<db_path>` записан новее, чем умеет читать текущий `redis-server`. С 3.0.4 `_ensure` после двух неудач **переименовывает** его в `<db_path>.incompatible-<UTC timestamp>` (никогда не удаляет), один раз повторяет запуск на свежей базе, а `analyze` эмитит `CGC_ENGINE_DB_QUARANTINED`. `health.cgc.quarantined` перечисляет такие файлы, `health.cgc.repaired` — и их, и удалённые stale-файлы, а `setup` показывает `quarantined` в отчёте шага analyze (и `quarantine_candidate` в `--dry-run`). Если и третий запуск не удался, `CGCUnavailable` перечисляет все попытки и путь карантина; дальше — `daemon logs` и `cgc.backend`.
199
201
  Если `lint` вернул `markup.module-map-missing` — это содержательная работа, промпт `prompts/upgrade-methodology/01-content-gaps.md`.
200
202
 
@@ -411,10 +413,10 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
411
413
 
412
414
  Пошагово с 2.x (или 1.9.x, если проект ещё на `docs/*.xml`):
413
415
 
414
- 1. **Поставьте именно 3.0.4.** `pipx upgrade doubled-graph` сейчас даёт
415
- **3.0.1**, а не 3.0.4 (3.0.2, 3.0.3 и 3.0.4 ещё не в PyPI). Точный путь — wheel с явным
416
+ 1. **Поставьте именно 3.0.5.** `pipx upgrade doubled-graph` сейчас даёт
417
+ **3.0.1**, а не 3.0.5 (3.0.2, 3.0.3, 3.0.4 и 3.0.5 ещё не в PyPI). Точный путь — wheel с явным
416
418
  `--python`: см. [§Установка](#2-установить-doubled-graph). Убедитесь:
417
- `doubled-graph --version` → `3.0.4`.
419
+ `doubled-graph --version` → `3.0.5`.
418
420
  2. **`cd your-project && doubled-graph setup`** — в **обычном** шелле, не из
419
421
  песочницы. `setup` **всегда** останавливает и заново запускает сервис
420
422
  `graphd` (stop → install/update unit → start), регистрирует проект,
@@ -443,9 +445,9 @@ Bun/Node-пакет 4.x: `bun remove -g @osovv/grace-cli` или
443
445
  обновлением на 3.0:
444
446
 
445
447
  ```bash
446
- # 1. поставить 3.0.4 (pipx upgrade даст только 3.0.1 — см. §Установка)
448
+ # 1. поставить 3.0.5 (pipx upgrade даст только 3.0.1 — см. §Установка)
447
449
  python3.14 -m build --wheel
448
- pipx install --python python3.14 --force dist/doubled_graph-3.0.4-py3-none-any.whl
450
+ pipx install --python python3.14 --force dist/doubled_graph-3.0.5-py3-none-any.whl
449
451
  cd your-project
450
452
  doubled-graph setup # 2. движок, .grace и демон graphd — одной командой
451
453
  ```
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "doubled-graph"
7
- version = "3.0.4"
7
+ version = "3.0.5"
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" }
@@ -130,7 +130,16 @@ def _cmd_analyze(args: argparse.Namespace) -> int:
130
130
  session_id=getattr(args, "session_id", None),
131
131
  )
132
132
  if not args.silent:
133
- print(json.dumps(result.model_dump(), indent=2, default=str))
133
+ payload = result.model_dump()
134
+ if not getattr(args, "verbose", False):
135
+ # The per-file lists are inventories: they do not change the next
136
+ # action and can be thousands of lines. Counts stay in `stats`
137
+ # (`files_processed`/`files_deleted`); `--verbose` returns names.
138
+ stats = payload.get("stats")
139
+ if isinstance(stats, dict):
140
+ stats.pop("processed_files", None)
141
+ stats.pop("deleted_files", None)
142
+ print(json.dumps(payload, indent=2, default=str))
134
143
  # Unavailable backend is always a failure for the public command. The JSON
135
144
  # report (with its `CGC_BACKEND_FAIL` warning and install hint) is still
136
145
  # printed, so a CI log keeps the diagnosis; only the exit code is honest.
@@ -582,7 +591,19 @@ def _cmd_migrate(args: argparse.Namespace) -> int:
582
591
  report = check_migration(repo)
583
592
  else:
584
593
  report = apply_migration(repo, dry_run=args.dry_run, fix_markup=not args.no_markup_fix)
585
- print(json.dumps(report.as_dict(), indent=2, ensure_ascii=False))
594
+ if args.json:
595
+ print(json.dumps(report.as_dict(), indent=2, ensure_ascii=False))
596
+ else:
597
+ # The console is the next action: what was (or would be) created and
598
+ # what still needs the LINKS repair. `kept_existing` and the other
599
+ # inventories are in the JSON report (`--json` / the migration report).
600
+ print(f"created: {', '.join(report.created) if report.created else 'none'}")
601
+ print(
602
+ "markup_pending: "
603
+ f"{', '.join(report.markup_pending) if report.markup_pending else 'none'}"
604
+ )
605
+ for issue in report.errors:
606
+ print(f"{issue.code} ({issue.file}): {issue.message}", file=sys.stderr)
586
607
  return 0 if report.ok else 1
587
608
 
588
609
 
@@ -696,7 +717,12 @@ def _cmd_detect_changes(args: argparse.Namespace) -> int:
696
717
  since_ref=args.since_ref,
697
718
  include_unchanged=args.include_unchanged,
698
719
  )
699
- print(json.dumps(result.model_dump(mode="json"), indent=2, ensure_ascii=False))
720
+ payload = result.model_dump(mode="json")
721
+ if not getattr(args, "verbose", False):
722
+ # `files_examined` can be every source file in the repository; the
723
+ # count answers "how much was checked", the names are diagnostics.
724
+ payload.pop("files_examined", None)
725
+ print(json.dumps(payload, indent=2, ensure_ascii=False))
700
726
  # A dead backend/Daemon produces an *empty* snapshot, so `drift` is empty
701
727
  # even though nothing was actually compared. That must fail without any
702
728
  # flag: `detect-changes --scope all` returning rc=0 here let a CI script
@@ -847,6 +873,11 @@ def main(argv_default: list[str] | None = None, argv: list[str] | None = None) -
847
873
  p_an.add_argument("--paths", nargs="*", default=None)
848
874
  p_an.add_argument("--force", action="store_true")
849
875
  p_an.add_argument("--silent", action="store_true")
876
+ p_an.add_argument(
877
+ "--verbose",
878
+ action="store_true",
879
+ help="include stats.processed_files/deleted_files (per-file lists) in the JSON",
880
+ )
850
881
  p_an.add_argument(
851
882
  "--strict",
852
883
  action="store_true",
@@ -975,6 +1006,11 @@ def main(argv_default: list[str] | None = None, argv: list[str] | None = None) -
975
1006
  "check", help="Read-only inventory: legacy artifacts, coverage gaps, markup to repair"
976
1007
  )
977
1008
  p_migrate_check.add_argument("--repo")
1009
+ p_migrate_check.add_argument(
1010
+ "--json",
1011
+ action="store_true",
1012
+ help="print the full MigrationReport JSON (kept_existing, placeholders, issues, …)",
1013
+ )
978
1014
  p_migrate_check.set_defaults(func=_cmd_migrate)
979
1015
  p_migrate_apply = migrate_sub.add_parser(
980
1016
  "apply", help="Write .grace from legacy docs (copy-and-validate; legacy untouched)"
@@ -986,6 +1022,11 @@ def main(argv_default: list[str] | None = None, argv: list[str] | None = None) -
986
1022
  action="store_true",
987
1023
  help="do not add M-* to MODULE_CONTRACT LINKS",
988
1024
  )
1025
+ p_migrate_apply.add_argument(
1026
+ "--json",
1027
+ action="store_true",
1028
+ help="print the full MigrationReport JSON (kept_existing, placeholders, issues, …)",
1029
+ )
989
1030
  p_migrate_apply.set_defaults(func=_cmd_migrate)
990
1031
 
991
1032
  # Phase policy — single writer/reader of AGENTS.md phase-block.
@@ -1043,6 +1084,11 @@ def main(argv_default: list[str] | None = None, argv: list[str] | None = None) -
1043
1084
  "a backend failure already exits 1 without this flag"
1044
1085
  ),
1045
1086
  )
1087
+ p_dc.add_argument(
1088
+ "--verbose",
1089
+ action="store_true",
1090
+ help="include files_examined (the per-file list) in the JSON; the count is always present",
1091
+ )
1046
1092
  p_dc.set_defaults(func=_cmd_detect_changes)
1047
1093
 
1048
1094
  # Graph daemon: OS-supervised engine owner. The client never starts it.
@@ -136,8 +136,23 @@ def build_health_report(repo: Path) -> dict[str, Any]:
136
136
  for v in declared.verification.values()
137
137
  if v.module_id and v.described and not v.placeholder
138
138
  }
139
+ covered_module_ids = {
140
+ v.module_id for v in declared.verification.values() if v.module_id
141
+ }
142
+ # Two different gaps used to appear as two contradicting numbers in one
143
+ # report: `modules.without_verification` (nothing usable, including an
144
+ # empty placeholder) and `drift.by_type.missing_verification` (no V-* record
145
+ # at all). Name both counts explicitly; the list stays for compatibility.
146
+ modules_missing_verification = sorted(
147
+ mid for mid in declared.modules if mid not in covered_module_ids
148
+ )
149
+ modules_placeholder_verification = sorted(
150
+ mid
151
+ for mid in declared.modules
152
+ if mid in covered_module_ids and mid not in verified_module_ids
153
+ )
139
154
  modules_without_verification = sorted(
140
- mid for mid in declared.modules if mid not in verified_module_ids
155
+ set(modules_missing_verification) | set(modules_placeholder_verification)
141
156
  )
142
157
 
143
158
  # Any error-severity issue means the declared graph could not be read as a
@@ -258,6 +273,13 @@ def build_health_report(repo: Path) -> dict[str, Any]:
258
273
  "total": len(declared.modules),
259
274
  "verified": len(verified_module_ids & set(declared.modules.keys())),
260
275
  "without_verification": modules_without_verification,
276
+ # `missing` == drift.by_type.missing_verification; `placeholder`
277
+ # is a structurally valid but empty V-<M> (lint:
278
+ # verification.placeholder). Both make `ok` false.
279
+ "without_verification_breakdown": {
280
+ "missing": len(modules_missing_verification),
281
+ "placeholder": len(modules_placeholder_verification),
282
+ },
261
283
  },
262
284
  "verification": {"total_v_m_records": len(declared.verification)},
263
285
  "drift": {"total": drift_count, "by_type": drift_by_type},
@@ -924,13 +924,21 @@ class CGC:
924
924
  ``add_repository_to_graph`` (the old call) only registers a
925
925
  Repository node — no files are parsed. That was the root cause of
926
926
  ``analyze`` silently returning 0 symbols on every repo.
927
+
928
+ ``scan.exclude`` is passed to CGC as the *explicit* ignore file next
929
+ to the per-repo database (never written into the project). CGC merges
930
+ it with the project's own ``.cgcignore``, so full indexing and
931
+ ``detect_changes`` see the same universe of source files.
927
932
  """
928
933
  self._ensure()
929
934
  assert self._builder is not None
930
935
  assert self._loop is not None
936
+ ignore_path = self._managed_ignore_path()
931
937
  self._loop.run_until_complete(
932
938
  self._builder.build_graph_from_path_async(
933
- self.repo_path, is_dependency=False
939
+ self.repo_path,
940
+ is_dependency=False,
941
+ cgcignore_path=str(ignore_path),
934
942
  )
935
943
  )
936
944
  summary = getattr(self._builder, "last_index_summary", {}) or {}
@@ -948,13 +956,30 @@ class CGC:
948
956
  symbols = int(summary.get("function_nodes") or 0) + int(summary.get("class_nodes") or 0)
949
957
  return AnalyzeStats(
950
958
  files_processed=files,
951
- processed_files=self._full_index_processed_files(summary, files),
959
+ processed_files=self._full_index_processed_files(
960
+ summary, files, cgcignore_path=str(ignore_path)
961
+ ),
952
962
  symbols_added=symbols,
953
963
  edges_added=int(summary.get("call_edges") or 0),
954
964
  )
955
965
 
966
+ def _managed_ignore_path(self) -> Path:
967
+ """Ensure the daemon-side ``.cgcignore`` carries ``scan.exclude``.
968
+
969
+ The file lives next to the per-repo database, never in the project
970
+ tree, and is the single mechanism behind both CGC's discovery and
971
+ this product's ``DEFAULT_IGNORED_DIRS``. Loading config here (rather
972
+ than accepting an argument) keeps the daemon's ``analyze_full`` call
973
+ identical to the in-process one.
974
+ """
975
+ from doubled_graph.config import load_config
976
+
977
+ target = _repo_db_dir(self.repo_path, create=True) / ".cgcignore"
978
+ _ensure_managed_cgcignore(target, extra_patterns=load_config(self.repo_path).scan.exclude)
979
+ return target
980
+
956
981
  def _full_index_processed_files(
957
- self, summary: dict[str, Any], files: int
982
+ self, summary: dict[str, Any], files: int, cgcignore_path: str | None = None
958
983
  ) -> list[str]:
959
984
  """Per-file list for a full index (``TOOLS.md`` §1.2 promises names).
960
985
 
@@ -963,6 +988,10 @@ class CGC:
963
988
  the files that failed to parse. Best-effort by design: if discovery is
964
989
  unavailable or raises, the honest answer is an empty list, not a
965
990
  fabricated one — ``files_processed`` still reports the count.
991
+
992
+ ``cgcignore_path`` must be the same explicit file passed to the
993
+ builder: replaying discovery without it would list excluded scratch
994
+ files in the public stats even though the graph never received them.
966
995
  """
967
996
  if not files:
968
997
  return []
@@ -973,7 +1002,9 @@ class CGC:
973
1002
 
974
1003
  parser_extensions = set((getattr(self._builder, "parsers", {}) or {}).keys())
975
1004
  discovered, _ignore_root = discover_files_to_index(
976
- self.repo_path, supported_extensions=parser_extensions
1005
+ self.repo_path,
1006
+ cgcignore_path=cgcignore_path,
1007
+ supported_extensions=parser_extensions,
977
1008
  )
978
1009
  except Exception: # noqa: BLE001 — optional enrichment, not the index itself
979
1010
  return []
@@ -1991,7 +2022,7 @@ _CGCIGNORE_HEADER = (
1991
2022
  )
1992
2023
 
1993
2024
 
1994
- def _managed_cgcignore_patterns() -> list[str]:
2025
+ def _managed_cgcignore_patterns(extra_patterns: Iterable[str] = ()) -> list[str]:
1995
2026
  """Patterns the daemon-side ``.cgcignore`` always carries (P2-1, cycle 24).
1996
2027
 
1997
2028
  CGC's own defaults list 22 binary/media/venv patterns and knows nothing
@@ -2004,6 +2035,11 @@ def _managed_cgcignore_patterns() -> list[str]:
2004
2035
  The product already owns ``DEFAULT_IGNORED_DIRS`` for its own walks. Union
2005
2036
  it with CGC's defaults (as ``<dir>/`` patterns) so the two lists cannot
2006
2037
  drift: a directory this product prunes is never left for CGC to index.
2038
+
2039
+ ``extra_patterns`` is ``scan.exclude`` (``.dg-tmp/**``, ``node_modules/**``,
2040
+ …). It is appended last: CGC's matcher is last-match-wins, so an explicit
2041
+ project exclude cannot be re-included by a ``!pattern`` inherited from
2042
+ ``.gitignore``/the project's own ``.cgcignore``.
2007
2043
  """
2008
2044
  from codegraphcontext.tools.indexing.constants import ( # type: ignore
2009
2045
  DEFAULT_IGNORE_PATTERNS,
@@ -2016,38 +2052,41 @@ def _managed_cgcignore_patterns() -> list[str]:
2016
2052
  pattern = f"{name}/"
2017
2053
  if pattern not in patterns:
2018
2054
  patterns.append(pattern)
2055
+ for pattern in extra_patterns:
2056
+ normalized = pattern.strip()
2057
+ if normalized and normalized not in patterns:
2058
+ patterns.append(normalized)
2019
2059
  return patterns
2020
2060
 
2021
2061
 
2022
- def _ensure_managed_cgcignore(target: Path) -> None:
2023
- """Create or extend the daemon-side ignore file without losing user rules.
2062
+ def _ensure_managed_cgcignore(
2063
+ target: Path, extra_patterns: Iterable[str] = ()
2064
+ ) -> None:
2065
+ """Write the daemon-side ignore file with the current product patterns.
2024
2066
 
2025
2067
  The file lives next to the per-repo database (never in the project), so it
2026
- is product-owned; appending only the missing managed patterns keeps an
2027
- older file created by a previous version useful after an upgrade.
2068
+ is product-owned: project-specific rules belong in the repository's own
2069
+ ``.cgcignore``. Rewriting it (rather than append-only) matters for
2070
+ ``scan.exclude``: a pattern removed from the config must stop excluding
2071
+ files on the next analyze instead of persisting forever. An unreadable
2072
+ file is left untouched — discovery then falls back to CGC's defaults.
2028
2073
  """
2029
- patterns = _managed_cgcignore_patterns()
2074
+ patterns = _managed_cgcignore_patterns(extra_patterns)
2030
2075
  try:
2031
- if not target.exists():
2032
- target.write_text(
2033
- _CGCIGNORE_HEADER + "\n".join(patterns) + "\n",
2034
- encoding="utf-8",
2035
- )
2036
- return
2037
- existing = target.read_text(encoding="utf-8")
2038
- present = {
2039
- line.strip()
2040
- for line in existing.splitlines()
2041
- if line.strip() and not line.lstrip().startswith("#")
2042
- }
2043
- missing = [pattern for pattern in patterns if pattern not in present]
2044
- if not missing:
2045
- return
2046
- with target.open("a", encoding="utf-8") as handle:
2047
- if existing and not existing.endswith("\n"):
2048
- handle.write("\n")
2049
- handle.write("\n# doubled-graph product runtime directories\n")
2050
- handle.write("\n".join(missing) + "\n")
2076
+ if target.exists():
2077
+ existing = target.read_text(encoding="utf-8")
2078
+ present = {
2079
+ line.strip()
2080
+ for line in existing.splitlines()
2081
+ if line.strip() and not line.lstrip().startswith("#")
2082
+ }
2083
+ if present == set(patterns):
2084
+ return
2085
+ target.parent.mkdir(parents=True, exist_ok=True)
2086
+ target.write_text(
2087
+ _CGCIGNORE_HEADER + "\n".join(patterns) + "\n",
2088
+ encoding="utf-8",
2089
+ )
2051
2090
  except OSError:
2052
2091
  # The ignore file is an optimisation. A read-only/unwritable DB dir
2053
2092
  # will fail at backend start anyway; discovery must not crash here.
@@ -2087,8 +2126,12 @@ def _isolate_cgcignore() -> None:
2087
2126
  found = original(ignore_root, explicit_path=explicit_path)
2088
2127
  if found is not None:
2089
2128
  return found
2129
+ from doubled_graph.config import load_config
2130
+
2090
2131
  target = _repo_db_dir(Path(ignore_root)) / ".cgcignore"
2091
- _ensure_managed_cgcignore(target)
2132
+ _ensure_managed_cgcignore(
2133
+ target, extra_patterns=load_config(Path(ignore_root)).scan.exclude
2134
+ )
2092
2135
  return target
2093
2136
 
2094
2137
  _cgcignore.find_cgcignore = find_cgcignore
@@ -117,12 +117,6 @@ class MigrationReport:
117
117
  #: Context documents the legacy artifacts left as a skeleton (0-1 field),
118
118
  #: so the content prompt must fill them instead of trusting the migration.
119
119
  context_gaps: list[str] = field(default_factory=list)
120
- #: Code files that start with a UTF-8 BOM. Our commands handle them, but the
121
- #: engine's Python/TypeScript/Dart analyzer rejects U+FEFF (`ast.parse`),
122
- #: so lint fails for these files until the BOM is removed.
123
- bom_files: list[str] = field(default_factory=list)
124
- #: Subset of ``bom_files`` in languages the engine analyzes with an adapter.
125
- bom_adapter_files: list[str] = field(default_factory=list)
126
120
  modules: int = 0
127
121
  verifications: int = 0
128
122
  placeholders: list[str] = field(default_factory=list)
@@ -155,8 +149,6 @@ class MigrationReport:
155
149
  "markup_pending": list(self.markup_pending),
156
150
  "map_pending": list(self.map_pending),
157
151
  "context_gaps": list(self.context_gaps),
158
- "bom_files": list(self.bom_files),
159
- "bom_adapter_files": list(self.bom_adapter_files),
160
152
  "modules": self.modules,
161
153
  "verifications": self.verifications,
162
154
  "placeholders": list(self.placeholders),
@@ -244,9 +236,7 @@ def check_migration(root: Path) -> MigrationReport:
244
236
  report.issues.append(Issue("warning", "migration.markup-pending", ".",
245
237
  f"{len(report.markup_pending)} governed file(s) still need the "
246
238
  "MODULE_CONTRACT LINKS repair (no matching M-* or no derivable owner)."))
247
- report.bom_files, report.bom_adapter_files = _bom_scan(resolved)
248
239
  _add_context_gap_warning(report)
249
- _add_bom_warning(report)
250
240
  report.ok = not report.errors
251
241
  return report
252
242
 
@@ -308,9 +298,7 @@ def apply_migration(
308
298
 
309
299
  report.map_pending = _plan_map_work(resolved)
310
300
  report.context_gaps = _context_gaps(resolved)
311
- report.bom_files, report.bom_adapter_files = _bom_scan(resolved)
312
301
  _add_context_gap_warning(report)
313
- _add_bom_warning(report)
314
302
 
315
303
  # `markup_changed` = files the migrator rewrote (or would rewrite in
316
304
  # `--dry-run`); `markup_pending` = files that still need the fix. With
@@ -877,47 +865,6 @@ def _collect_ambiguities(root: Path) -> list[str]:
877
865
  return ambiguities
878
866
 
879
867
 
880
- #: Source languages the engine analyzes with its own adapters; their analyzers
881
- #: (Python `ast.parse`, TypeScript/Dart tooling) reject a leading U+FEFF.
882
- _ADAPTER_EXTENSIONS = frozenset({".py", ".pyi", ".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs", ".mts", ".cts", ".dart"})
883
-
884
- _BOM_BYTES = b"\xef\xbb\xbf"
885
-
886
-
887
- def _bom_scan(root: Path) -> tuple[list[str], list[str]]:
888
- """Return (all BOM files, BOM files whose language has an engine adapter)."""
889
- all_bom: list[str] = []
890
- adapter_bom: list[str] = []
891
- for file_path in iter_code_files(root, ignored=(".doubled-graph",)):
892
- try:
893
- with file_path.open("rb") as handle:
894
- prefix = handle.read(3)
895
- except OSError:
896
- continue
897
- if prefix != _BOM_BYTES:
898
- continue
899
- relative = file_path.relative_to(root).as_posix()
900
- all_bom.append(relative)
901
- if file_path.suffix.lower() in _ADAPTER_EXTENSIONS:
902
- adapter_bom.append(relative)
903
- return sorted(all_bom), sorted(adapter_bom)
904
-
905
-
906
- def _add_bom_warning(report: MigrationReport) -> None:
907
- if not report.bom_adapter_files:
908
- return
909
- report.issues.append(Issue(
910
- "warning",
911
- "migration.bom-in-code",
912
- report.bom_adapter_files[0],
913
- f"{len(report.bom_adapter_files)} source file(s) start with a UTF-8 BOM; the engine's "
914
- "Python/TypeScript/Dart analyzer rejects U+FEFF, so `grace lint` reports "
915
- "`analysis.adapter-failed` for them until the BOM is removed. "
916
- "doubled-graph commands handle BOM files themselves; languages without an adapter "
917
- "(C#, Go, Rust, Java, Swift, …) are unaffected.",
918
- ))
919
-
920
-
921
868
  def _add_context_gap_warning(report: MigrationReport) -> None:
922
869
  """Warn only when the legacy context documents were a skeleton (0-1 field).
923
870