graphite-code 1.7.0__tar.gz → 1.7.1__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 (321) hide show
  1. {graphite_code-1.7.0 → graphite_code-1.7.1}/CHANGELOG.md +94 -0
  2. {graphite_code-1.7.0 → graphite_code-1.7.1}/PKG-INFO +2 -2
  3. {graphite_code-1.7.0 → graphite_code-1.7.1}/README.md +1 -1
  4. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/__init__.py +1 -1
  5. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/dependency_install.py +37 -10
  6. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/probe_process.py +64 -7
  7. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_agent_hooks_session_tagging.py +26 -0
  8. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_dependency_install.py +62 -0
  9. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_doctor.py +289 -33
  10. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_probe_process.py +47 -0
  11. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_published_schemas.py +21 -0
  12. {graphite_code-1.7.0 → graphite_code-1.7.1}/.gitignore +0 -0
  13. {graphite_code-1.7.0 → graphite_code-1.7.1}/ARCHITECTURE.md +0 -0
  14. {graphite_code-1.7.0 → graphite_code-1.7.1}/CONTRIBUTING.md +0 -0
  15. {graphite_code-1.7.0 → graphite_code-1.7.1}/LICENSE +0 -0
  16. {graphite_code-1.7.0 → graphite_code-1.7.1}/RELEASING.md +0 -0
  17. {graphite_code-1.7.0 → graphite_code-1.7.1}/pyproject.toml +0 -0
  18. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/__main__.py +0 -0
  19. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/_cleanup_worker.py +0 -0
  20. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/_win32_ctypes.py +0 -0
  21. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/activation.py +0 -0
  22. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/agent_hooks.py +0 -0
  23. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/agent_settings.py +0 -0
  24. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/analyze.py +0 -0
  25. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/answer_contract.py +0 -0
  26. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/bootstrap.py +0 -0
  27. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/buildlock.py +0 -0
  28. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/cache.py +0 -0
  29. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/channel.py +0 -0
  30. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/cli.py +0 -0
  31. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/cluster.py +0 -0
  32. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/config.py +0 -0
  33. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/context.py +0 -0
  34. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/daemon.py +0 -0
  35. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/daemon_health.py +0 -0
  36. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/daemon_launch.py +0 -0
  37. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/debt.py +0 -0
  38. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/detach.py +0 -0
  39. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/doctor.py +0 -0
  40. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/doctor_probes.py +0 -0
  41. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/engine_identity.py +0 -0
  42. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/export/__init__.py +0 -0
  43. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/export/html.py +0 -0
  44. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/export/json.py +0 -0
  45. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/export/md.py +0 -0
  46. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/extract/__init__.py +0 -0
  47. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/extract/ast.py +0 -0
  48. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/extract/pyscope.py +0 -0
  49. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/freshness.py +0 -0
  50. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/git.py +0 -0
  51. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/graph.py +0 -0
  52. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/graph_io.py +0 -0
  53. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/health.py +0 -0
  54. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/hook_entry.py +0 -0
  55. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/hookinstall.py +0 -0
  56. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/hookshim.py +0 -0
  57. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/incident_ledger.py +0 -0
  58. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/ingest.py +0 -0
  59. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/init.py +0 -0
  60. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/io.py +0 -0
  61. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/launchd_agent.py +0 -0
  62. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/listing.py +0 -0
  63. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/llm.py +0 -0
  64. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/llm_probe.py +0 -0
  65. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/mcp.py +0 -0
  66. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/mcp_server.py +0 -0
  67. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/natural_query.py +0 -0
  68. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/overlays.py +0 -0
  69. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/ownership.py +0 -0
  70. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/probe_workspace.py +0 -0
  71. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/process_contracts.py +0 -0
  72. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/programs.py +0 -0
  73. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/provider_observer.py +0 -0
  74. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/py.typed +0 -0
  75. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/query.py +0 -0
  76. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/query_plan.py +0 -0
  77. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/replacement_audit.py +0 -0
  78. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/resolve.py +0 -0
  79. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/review.py +0 -0
  80. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/__init__.py +0 -0
  81. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/approval.py +0 -0
  82. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/classifier.py +0 -0
  83. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/claude_executor.py +0 -0
  84. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/claude_probe.py +0 -0
  85. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/cli_identity.py +0 -0
  86. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/codex_executor.py +0 -0
  87. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/codex_probe.py +0 -0
  88. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/context_builder.py +0 -0
  89. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/contracts.py +0 -0
  90. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/diff_policy.py +0 -0
  91. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/edit_apply.py +0 -0
  92. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/effort.py +0 -0
  93. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/lifecycle.py +0 -0
  94. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/lifecycle_operator.py +0 -0
  95. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/lifecycle_service.py +0 -0
  96. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/lifecycle_storage.py +0 -0
  97. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/ollama_executor.py +0 -0
  98. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/ollama_probe.py +0 -0
  99. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/openrouter_executor.py +0 -0
  100. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/openrouter_probe.py +0 -0
  101. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/policy.py +0 -0
  102. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/probe_runner.py +0 -0
  103. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/process_runner.py +0 -0
  104. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/profiles.py +0 -0
  105. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/prompt.py +0 -0
  106. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/registry.py +0 -0
  107. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/route_pool.py +0 -0
  108. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/route_pool_execution.py +0 -0
  109. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/schema_validation.py +0 -0
  110. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/service.py +0 -0
  111. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/settings.py +0 -0
  112. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/shadow.py +0 -0
  113. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/storage.py +0 -0
  114. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/telemetry.py +0 -0
  115. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/worktree.py +0 -0
  116. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/zai_edit.py +0 -0
  117. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/zai_executor.py +0 -0
  118. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/routing/zai_probe.py +0 -0
  119. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/savings.py +0 -0
  120. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/systemd_unit.py +0 -0
  121. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/ts_bridge.py +0 -0
  122. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/ts_resolver.mjs +0 -0
  123. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/typescript_activation.py +0 -0
  124. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/usage_ledger.py +0 -0
  125. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/validation.py +0 -0
  126. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/watch.py +0 -0
  127. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/windows_job.py +0 -0
  128. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/windows_startup.py +0 -0
  129. {graphite_code-1.7.0 → graphite_code-1.7.1}/src/graphite/windows_task.py +0 -0
  130. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/conftest.py +0 -0
  131. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/data/sqloracle/blindspots.py.txt +0 -0
  132. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/data/sqloracle/round69.py.txt +0 -0
  133. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/fake_clis/fake_cli.py +0 -0
  134. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/fixtures/provider_lifecycle_schema_v1.sql +0 -0
  135. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/fixtures/routing_schema_v2_ca77600.sql +0 -0
  136. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/fixtures/routing_schema_v3_94eb333.sql +0 -0
  137. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/fixtures/routing_schema_v4_lifecycle_migration.sql +0 -0
  138. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test__win32_ctypes.py +0 -0
  139. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_activation.py +0 -0
  140. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_activation_backstop.py +0 -0
  141. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_agent_hook_activation.py +0 -0
  142. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_agent_hooks.py +0 -0
  143. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_agent_hooks_session_books.py +0 -0
  144. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_agent_settings.py +0 -0
  145. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_answer_contract.py +0 -0
  146. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_arrow_and_constructor_binding.py +0 -0
  147. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_ast_make_id_length.py +0 -0
  148. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_ast_name_a_module_only_imports.py +0 -0
  149. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_ast_source_lines.py +0 -0
  150. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_ast_super_over_a_builtin_base.py +0 -0
  151. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_atomic_write.py +0 -0
  152. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_bootstrap.py +0 -0
  153. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_build_detach.py +0 -0
  154. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_buildlock.py +0 -0
  155. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cache_engine_identity.py +0 -0
  156. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cache_entry_pruning.py +0 -0
  157. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cache_file_identity.py +0 -0
  158. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cache_file_set.py +0 -0
  159. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cache_pruning.py +0 -0
  160. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_call_graph.py +0 -0
  161. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_case_ambiguous_answer.py +0 -0
  162. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_channel_attribution.py +0 -0
  163. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_channel_cli.py +0 -0
  164. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_channel_core.py +0 -0
  165. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_channel_kind.py +0 -0
  166. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_channel_lock.py +0 -0
  167. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_channel_log_integrity.py +0 -0
  168. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_channel_mcp.py +0 -0
  169. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_channel_register.py +0 -0
  170. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_channel_report.py +0 -0
  171. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_channel_status.py +0 -0
  172. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_class_field_arrow_binding.py +0 -0
  173. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cli_below_repository_root.py +0 -0
  174. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cli_build_missing_path.py +0 -0
  175. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cli_channel.py +0 -0
  176. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cli_channel_attribution.py +0 -0
  177. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cli_doctor_below_root.py +0 -0
  178. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cli_reference.py +0 -0
  179. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cli_usage.py +0 -0
  180. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cli_version.py +0 -0
  181. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cluster.py +0 -0
  182. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_compare_dist.py +0 -0
  183. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_configuration_reference.py +0 -0
  184. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_context.py +0 -0
  185. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_context_builder.py +0 -0
  186. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cwd_relative_config.py +0 -0
  187. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_cycle_search.py +0 -0
  188. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_daemon.py +0 -0
  189. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_daemon_activation.py +0 -0
  190. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_daemon_build_lock.py +0 -0
  191. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_daemon_child_lock.py +0 -0
  192. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_daemon_engine_staleness.py +0 -0
  193. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_daemon_health.py +0 -0
  194. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_daemon_health_activation.py +0 -0
  195. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_daemon_launch.py +0 -0
  196. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_daemon_service_cli.py +0 -0
  197. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_daemon_snapshot_failure.py +0 -0
  198. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_debt.py +0 -0
  199. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_destructured_binding.py +0 -0
  200. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_determinism.py +0 -0
  201. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_dispatch_evidence.py +0 -0
  202. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_doctor_agent_hooks.py +0 -0
  203. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_doctor_hooks.py +0 -0
  204. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_doctor_managed_docs.py +0 -0
  205. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_doctor_probes.py +0 -0
  206. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_documentation.py +0 -0
  207. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_edit_apply.py +0 -0
  208. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_engine_identity.py +0 -0
  209. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_exit_codes_reference.py +0 -0
  210. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_external_calls.py +0 -0
  211. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_file_node_id_collision.py +0 -0
  212. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_git_security.py +0 -0
  213. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_go_rust.py +0 -0
  214. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_graph_io.py +0 -0
  215. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_graph_provider_isolation.py +0 -0
  216. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_hardening.py +0 -0
  217. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_health.py +0 -0
  218. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_hook_entry.py +0 -0
  219. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_hook_template.py +0 -0
  220. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_hookinstall.py +0 -0
  221. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_hookshim.py +0 -0
  222. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_html_security.py +0 -0
  223. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_incident_ledger.py +0 -0
  224. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_init.py +0 -0
  225. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_init_activation_doctrine.py +0 -0
  226. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_init_hooks.py +0 -0
  227. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_init_validation_exit.py +0 -0
  228. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_launchd_agent.py +0 -0
  229. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_lifecycle_operator.py +0 -0
  230. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_listing.py +0 -0
  231. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_listing_surfaces.py +0 -0
  232. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_llm.py +0 -0
  233. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_llm_probe.py +0 -0
  234. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_mcp.py +0 -0
  235. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_mcp_server.py +0 -0
  236. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_mcp_server_channel_attribution.py +0 -0
  237. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_member_call_receiver.py +0 -0
  238. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_method_dispatch_scope.py +0 -0
  239. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_monorepo.py +0 -0
  240. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_mutation_tests.py +0 -0
  241. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_natural_query.py +0 -0
  242. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_no_path_is_graded.py +0 -0
  243. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_node_identity.py +0 -0
  244. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_ollama_executor.py +0 -0
  245. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_overlays.py +0 -0
  246. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_path_leak_fixture.py +0 -0
  247. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_probe_diagnostics.py +0 -0
  248. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_probe_workspace.py +0 -0
  249. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_process_contracts.py +0 -0
  250. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_programs.py +0 -0
  251. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_provider_claude_probe.py +0 -0
  252. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_provider_codex_probe.py +0 -0
  253. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_provider_lifecycle.py +0 -0
  254. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_provider_lifecycle_service.py +0 -0
  255. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_provider_lifecycle_storage.py +0 -0
  256. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_provider_observer.py +0 -0
  257. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_provider_ollama_probe.py +0 -0
  258. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_provider_openrouter_probe.py +0 -0
  259. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_provider_probe_runner.py +0 -0
  260. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_public_surface.py +0 -0
  261. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_pyscope.py +0 -0
  262. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_pyscopeoracle.py +0 -0
  263. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_python_builtin_named_symbols.py +0 -0
  264. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_python_import_bindings.py +0 -0
  265. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_python_inherits_edge.py +0 -0
  266. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_python_local_alias_call.py +0 -0
  267. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_python_reexport_follow.py +0 -0
  268. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_python_resolver.py +0 -0
  269. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_python_scope_identity.py +0 -0
  270. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_query_plan.py +0 -0
  271. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_reliability.py +0 -0
  272. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_replacement_audit.py +0 -0
  273. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_repository_root_ownership.py +0 -0
  274. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_resolve.py +0 -0
  275. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_resolve_python_reexports_of.py +0 -0
  276. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_review.py +0 -0
  277. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_route_pool.py +0 -0
  278. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_route_pool_execution.py +0 -0
  279. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_approval.py +0 -0
  280. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_benchmark.py +0 -0
  281. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_classifier.py +0 -0
  282. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_claude_executor.py +0 -0
  283. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_cli.py +0 -0
  284. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_cli_contracts.py +0 -0
  285. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_cli_recovery.py +0 -0
  286. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_codex_executor.py +0 -0
  287. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_context.py +0 -0
  288. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_contracts.py +0 -0
  289. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_diff_policy.py +0 -0
  290. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_executor.py +0 -0
  291. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_openrouter_executor.py +0 -0
  292. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_policy.py +0 -0
  293. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_process_runner.py +0 -0
  294. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_profiles.py +0 -0
  295. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_registry.py +0 -0
  296. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_schema_validation.py +0 -0
  297. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_security.py +0 -0
  298. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_service.py +0 -0
  299. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_shadow.py +0 -0
  300. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_storage.py +0 -0
  301. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_telemetry.py +0 -0
  302. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_worktree.py +0 -0
  303. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_zai_executor.py +0 -0
  304. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_routing_zai_probe.py +0 -0
  305. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_savings.py +0 -0
  306. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_search.py +0 -0
  307. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_self_super_dispatch.py +0 -0
  308. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_smoke.py +0 -0
  309. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_sqloracle.py +0 -0
  310. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_synthetic_repo.py +0 -0
  311. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_systemd_unit.py +0 -0
  312. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_ts_bridge.py +0 -0
  313. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_typescript_activation.py +0 -0
  314. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_typescript_resolver.py +0 -0
  315. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_usage_ledger.py +0 -0
  316. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_verify_artifact.py +0 -0
  317. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_verify_published_release.py +0 -0
  318. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_watch.py +0 -0
  319. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_windows_startup.py +0 -0
  320. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_windows_task.py +0 -0
  321. {graphite_code-1.7.0 → graphite_code-1.7.1}/tests/test_zai_edit.py +0 -0
@@ -15,6 +15,100 @@ machine-checkable identity; the version is for humans.
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [1.7.1] — 2026-10-28
19
+
20
+ A patch release: three fixes, and no change to any stable surface. No command,
21
+ option, exit code, entry point or JSON field is added, removed or renamed, so
22
+ this is a patch by the rule in `docs/compatibility.md` -- "fixes are patches".
23
+
24
+ **A launch failure keeps its cause.** `probe_process.py` raised
25
+ `ProbeProcessError("launch_failed") from None`, so the exception under it was
26
+ discarded and the CI log said only `probe process failed: launch_failed` --
27
+ nothing said why the interpreter failed to start. The cause is now kept, as
28
+ the `__cause__` and not in the message, so the text a report or a log line may
29
+ carry still holds no path and no process data.
30
+
31
+ **A child that exits first no longer fails the launch.** The cause the first
32
+ fix made visible turned out to be a race, and it is now fixed rather than
33
+ merely explained. On macOS the exit observer is a kqueue registration, and the
34
+ kernel refuses it for a process that is no longer there. The registration is
35
+ made right after the fork, so a child that exits before it reaches the kernel
36
+ lost the race -- and the launch was then reported as a transport failure, for a
37
+ child that had run and succeeded.
38
+
39
+ The child is a zombie at that point, so its status is still readable, and it is
40
+ read where it was always read: at the reap, after the containment. That order
41
+ is what keeps the process group held -- the zombie keeps the group non-empty,
42
+ so the group's id cannot be recycled under the signals that follow -- and the
43
+ status stays unread until then rather than carrying a placeholder that would
44
+ be a false status.
45
+
46
+ A test beside it was repaired too. The sibling that claims "fails closed
47
+ before spawn" was failing in the environment validation and never reached its
48
+ own spawn check, and its "must not spawn" was an assertion that the launch's
49
+ own `except Exception` would have swallowed into the same verdict. It now
50
+ reaches the check and asserts it.
51
+
52
+ **A directory's moving times are not the trusted route's identity.** The POSIX
53
+ trusted-command route captured every directory on the path from the filesystem
54
+ root down to the executable, and refused a component whose stat moved between
55
+ the capture's two `lstat` calls -- comparing a directory's size, mtime and
56
+ ctime. None of those is a directory's identity: the size is its entry count,
57
+ and the times move whenever a child is created or removed.
58
+
59
+ pytest's xdist workers all create their `popen-gwN` directory inside the
60
+ SHARED `pytest-N` parent, so one worker's `mkdir` landed inside another
61
+ worker's route capture, and the route was refused -- a route that never went
62
+ near the executable. The refusal was silent where it matters: the manager
63
+ resolution returned `None` (`manager_unavailable`) and the revalidation failed
64
+ (`command_changed`). Two CI cells, two shapes, one defect, and both were a
65
+ security control failing CLOSED on a harmless event.
66
+
67
+ What the route's trust rests on is the hop's inode (is it still the same
68
+ object), its mode (who may write it) and its owner (who owns it), and all
69
+ three are still compared: a swap changes the inode, a `chmod` the mode, a
70
+ `chown` the owner. The code already said this about a directory's link count,
71
+ which is its number of subdirectories; the fix extends the same reasoning to
72
+ the size and the times. A file keeps every field -- its content is hashed and
73
+ compared separately, and its times are its identity.
74
+
75
+ Two further changes in this release are TEST-ONLY and change no product
76
+ behaviour: the published `check` schema is now checked against every shape it
77
+ answers -- which is what kills the recorded mutation survivor in `cli.py`,
78
+ measured by mutating that one line and watching the suite fail at the new
79
+ assertion; and a fourth wall-clock race in the doctor tests -- a teardown
80
+ waited for by a one-second poll rather than by the teardown's own signal -- is
81
+ fixed the way its three siblings already were.
82
+
83
+ The graph changes by what these fixes add. Measured on this repository: the
84
+ v1.7.0 tree built by the installed 1.7.0 engine, and this tree built by this
85
+ engine, each into fresh output, cache and state directories:
86
+
87
+ - 9,322 nodes become 9,352 and 25,655 edges become 25,714.
88
+ - every node id survives: 9,322 of 9,322 are in both, 30 are new and 0 is removed.
89
+ - 6,768 definition ids become 6,793: 6,479 keep their id and their definition, 289 keep their id but move, 0 is removed and 25 are new.
90
+ - `calls` goes from 16,457 to 16,490, `contains` goes from 6,766 to 6,791, `imports` goes from 2,480 to 2,484, `inherits` stays at 122.
91
+ - 25,825 relation triples become 25,887, with 3 only in the old graph and 65 only in the new.
92
+ - the cycle count goes from 18 to 18, and the communities from 178 to 180.
93
+ - every one of those moves is in the 6 files this release touches (`src/graphite/dependency_install.py` 43, `src/graphite/probe_process.py` 17, `tests/test_dependency_install.py` 16, `tests/test_doctor.py` 201, `tests/test_probe_process.py` 6, `tests/test_published_schemas.py` 6).
94
+ - the control holds: the same tree built by both engines gives the same 9,352 nodes, the same 25,714 edges and the same 25,887 relation triples, with no id moved and none removed, and identical cycles, communities and `resolution_health` -- so the difference above is attributable to this change and not to the engine behind it.
95
+
96
+ `metadata.engine.fingerprint` moves, as it does whenever the engine's own
97
+ files change -- and they do: the identity hashes every `.py` and `.mjs` file
98
+ in the package, so a change to the probe transport or to the trusted-command
99
+ route moves it whether or not the extraction changed.
100
+
101
+ The two builds above used different `tree-sitter` versions (0.25.2 for the
102
+ installed 1.7.0 and 0.26.0 for the dev environment), so the difference was
103
+ controlled for rather than assumed away. The grammar that actually parses
104
+ Python is the same in both -- `tree-sitter-python` 0.25.0 -- and the control
105
+ build settles the rest: the SAME tree built by both engines gives the same
106
+ ids, the same edges and the same triples, node for node, with no id moved and
107
+ none removed, and identical cycles, entry points, god nodes, orphans,
108
+ surprising connections, top files by links, clusters and `resolution_health`.
109
+ The figures above are therefore attributable to this change and not to the
110
+ parsers.
111
+
18
112
  ## [1.7.0] — 2026-10-28
19
113
 
20
114
  A minor release: the daemon's log now says WHICH way enumerating a repository
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: graphite-code
3
- Version: 1.7.0
3
+ Version: 1.7.1
4
4
  Summary: Local-first, zero-LLM knowledge graph extraction for codebases.
5
5
  Project-URL: Homepage, https://github.com/jared0565/graphite
6
6
  Project-URL: Repository, https://github.com/jared0565/graphite
@@ -49,7 +49,7 @@ Description-Content-Type: text/markdown
49
49
 
50
50
  Local-first, deterministic knowledge graph extraction for codebases — zero-LLM, daemon-maintained, agent-agnostic.
51
51
 
52
- **Status: 1.7.0, production/stable.** Published on PyPI as
52
+ **Status: 1.7.1, production/stable.** Published on PyPI as
53
53
  [`graphite-code`](https://pypi.org/project/graphite-code/) with PEP 740
54
54
  attestations; supported on Windows, Linux and macOS with Python 3.11–3.14
55
55
  (every cell gates CI). What 1.x promises — CLI, JSON outputs, `graph.json`,
@@ -2,7 +2,7 @@
2
2
 
3
3
  Local-first, deterministic knowledge graph extraction for codebases — zero-LLM, daemon-maintained, agent-agnostic.
4
4
 
5
- **Status: 1.7.0, production/stable.** Published on PyPI as
5
+ **Status: 1.7.1, production/stable.** Published on PyPI as
6
6
  [`graphite-code`](https://pypi.org/project/graphite-code/) with PEP 740
7
7
  attestations; supported on Windows, Linux and macOS with Python 3.11–3.14
8
8
  (every cell gates CI). What 1.x promises — CLI, JSON outputs, `graph.json`,
@@ -38,4 +38,4 @@ __all__ = ["__version__"]
38
38
  #: Coarse and hand-maintained by construction. It is a release label, not
39
39
  #: evidence that a given fix is present -- to answer that, survey for the marker
40
40
  #: the fix introduced, or compare `graphite --version` fingerprints.
41
- __version__ = "1.7.0"
41
+ __version__ = "1.7.1"
@@ -312,17 +312,44 @@ def _capture_posix_component(path: Path) -> TrustedPathComponent | None:
312
312
  after = lexical.lstat()
313
313
  except (OSError, RuntimeError, ValueError):
314
314
  return None
315
- stable_fields = (
316
- "st_dev",
317
- "st_ino",
318
- "st_mode",
319
- "st_size",
320
- "st_mtime_ns",
321
- "st_ctime_ns",
322
- "st_nlink",
323
- "st_uid",
315
+ # The fields that IDENTIFY a component: the device and the inode say
316
+ # whether this is still the same object, the mode and the owner say who
317
+ # may replace it. A swap changes the inode, a chmod changes the mode, a
318
+ # chown changes the owner -- all three are compared, and they are what
319
+ # the route's trust actually rests on.
320
+ #
321
+ # A DIRECTORY has no identity in its size, its times or its link count:
322
+ # the size is its entry count, the times move whenever a child is created
323
+ # or removed, and the link count is the number of subdirectories it has.
324
+ # pytest's xdist workers all create their `popen-gwN` directory inside the
325
+ # SHARED `pytest-N` parent, so one worker's mkdir lands inside another
326
+ # worker's route capture -- and a capture that refuses on any of those
327
+ # three refuses a route that never went near the executable.
328
+ #
329
+ # The refusal is silent where it matters: the manager resolution returns
330
+ # None ("manager_unavailable") or the revalidation fails
331
+ # ("command_changed"), and a security control that fails closed turns a
332
+ # harmless concurrent mkdir into a refusal to install.
333
+ #
334
+ # A FILE keeps every field: its content is hashed and compared
335
+ # separately, and its link count is a trust signal (a hard link is a
336
+ # second name for the same bytes).
337
+ is_directory = stat.S_ISDIR(before.st_mode)
338
+ fields = (
339
+ ("st_dev", "st_ino", "st_mode", "st_uid")
340
+ if is_directory
341
+ else (
342
+ "st_dev",
343
+ "st_ino",
344
+ "st_mode",
345
+ "st_size",
346
+ "st_mtime_ns",
347
+ "st_ctime_ns",
348
+ "st_nlink",
349
+ "st_uid",
350
+ )
324
351
  )
325
- if any(getattr(before, field, None) != getattr(after, field, None) for field in stable_fields):
352
+ if any(getattr(before, field, None) != getattr(after, field, None) for field in fields):
326
353
  return None
327
354
  return TrustedPathComponent(
328
355
  lexical,
@@ -246,7 +246,7 @@ class _Process(Protocol):
246
246
  stdout: Any
247
247
  stderr: Any
248
248
  returncode: int | None
249
- def wait(self, timeout: float) -> int: ...
249
+ def wait(self, timeout: float) -> int | None: ...
250
250
  def kill(self) -> bool | None: ...
251
251
 
252
252
 
@@ -263,6 +263,9 @@ class _PosixProcess:
263
263
  self._reaped = False
264
264
  self._kqueue: Any | None = None
265
265
  self._kqueue_exit_flags = 0
266
+ # True once the child is known to have exited while its status is
267
+ # still unread. See `_observe` and the registration below.
268
+ self._exit_pending = False
266
269
  if not callable(getattr(os, "waitid", None)):
267
270
  if sys.platform != "darwin" or not hasattr(select, "kqueue"):
268
271
  raise RuntimeError("non-reaping process observation unavailable")
@@ -275,11 +278,42 @@ class _PosixProcess:
275
278
  flags=select.KQ_EV_ADD | select.KQ_EV_ENABLE | select.KQ_EV_ONESHOT,
276
279
  fflags=self._kqueue_exit_flags,
277
280
  )
278
- self._kqueue.control([event], 0, 0)
281
+ try:
282
+ self._kqueue.control([event], 0, 0)
283
+ except ProcessLookupError:
284
+ # The child exited before the registration reached the
285
+ # kernel, and macOS refuses an EVFILT_PROC registration for
286
+ # a process that is no longer there.
287
+ #
288
+ # MEASURED on macos-latest 3.11 (CI run 40696690448, job
289
+ # 122845242659): the registration answered
290
+ # `ProcessLookupError: [Errno 3] No such process` for a
291
+ # child that had already run and exited 0 -- the child's
292
+ # own wait succeeded afterwards, so it was an unreaped
293
+ # ZOMBIE, not a process that had never existed. The launch
294
+ # was then reported as `launch_failed`: a transport
295
+ # failure for a child that succeeded.
296
+ #
297
+ # The child is a zombie, so its status is still readable --
298
+ # by waitpid, which reaps it -- and the reap is where it is
299
+ # read, AFTER containment. That order is what keeps the
300
+ # process group held: the zombie keeps the group
301
+ # non-empty, so the group's id cannot be recycled under the
302
+ # signals that follow.
303
+ self._kqueue.close()
304
+ self._kqueue = None
305
+ self._exit_pending = True
279
306
 
280
307
  def _observe(self) -> int | None:
281
308
  if self.returncode is not None:
282
309
  return self.returncode
310
+ if self._exit_pending:
311
+ # The child exited before the observer could be registered, so
312
+ # its status is unread -- and `os.waitid`, which would read it
313
+ # without reaping, does not exist on darwin. The reap reads it,
314
+ # after containment. Returning None here says "no status",
315
+ # which is true; `_exit_pending` is what says "exited".
316
+ return None
283
317
  if self._kqueue is not None:
284
318
  events = self._kqueue.control(None, 1, 0)
285
319
  if not events:
@@ -300,12 +334,18 @@ class _PosixProcess:
300
334
  def poll(self) -> int | None:
301
335
  return self._observe()
302
336
 
303
- def wait(self, timeout: float) -> int:
337
+ def wait(self, timeout: float) -> int | None:
304
338
  deadline = time.monotonic() + timeout
305
339
  while True:
306
340
  result = self._observe()
307
341
  if result is not None:
308
342
  return result
343
+ if self._exit_pending:
344
+ # The child exited before the observer could be registered.
345
+ # The caller wants the EXIT, and it happened; the status is
346
+ # unread and the reap reads it, after containment. This is
347
+ # not a timeout, which is a different verdict.
348
+ return None
309
349
  remaining = deadline - time.monotonic()
310
350
  if remaining <= 0:
311
351
  raise subprocess.TimeoutExpired([], timeout)
@@ -448,12 +488,23 @@ def run_bounded_process(
448
488
  validated_environment = _validated_environment(environment)
449
489
  except ProbeProcessError:
450
490
  raise
451
- except Exception:
452
- raise ProbeProcessError("launch_failed") from None
491
+ except Exception as exc:
492
+ # The cause is KEPT, and it is kept as the cause rather than in the
493
+ # message. `launch_failed` says what happened; the exception under it
494
+ # says why, and the difference is the whole diagnosis: the macOS cell
495
+ # failed to start its probes twice with nothing but the code, so the
496
+ # next occurrence could not be told apart from a missing program.
497
+ #
498
+ # The message stays `probe process failed: launch_failed`, so the text
499
+ # a report, a log line or a caller may carry still holds no path and no
500
+ # process data -- the house rule this module follows. The cause rides
501
+ # in the traceback, which is a developer surface: `graphite`'s CLI
502
+ # prints one only under `GRAPHITE_DEBUG`.
503
+ raise ProbeProcessError("launch_failed") from exc
453
504
  try:
454
505
  process = _launch_process(argv, cwd=cwd, input_data=input_data, environment=validated_environment)
455
- except Exception:
456
- raise ProbeProcessError("launch_failed") from None
506
+ except Exception as exc:
507
+ raise ProbeProcessError("launch_failed") from exc
457
508
 
458
509
  outputs = {"stdout": bytearray(), "stderr": bytearray()}
459
510
  overflow: threading.Event | None = None
@@ -870,6 +921,12 @@ def _darwin_group_holds_only_the_zombie_leader(process: _Process, error: OSError
870
921
  """
871
922
  if sys.platform != "darwin" or not isinstance(error, PermissionError):
872
923
  return False
924
+ if getattr(process, "_exit_pending", False):
925
+ # The child exited before the observer could be registered, so the
926
+ # leader is a zombie -- which is the case this function reads. The
927
+ # status is unread at this point, so `returncode` cannot say it;
928
+ # the flag does.
929
+ return True
873
930
  if process.returncode is None:
874
931
  # `returncode` is only set where the run HAPPENED to observe the exit.
875
932
  # The success and timeout paths reach `process.wait` and so carry a
@@ -262,3 +262,29 @@ def test_a_cursor_state_without_an_offset_reads_the_ledger_from_its_start(
262
262
  unit = _one_entry_tokens(repo)
263
263
  assert summary is not None
264
264
  assert _session_tokens(repo, "A") == unit
265
+
266
+
267
+ def test_a_cursor_state_without_a_token_count_starts_from_zero(
268
+ repo: Path, monkeypatch: pytest.MonkeyPatch
269
+ ) -> None:
270
+ """A state that lost its token count is a damaged cursor, and a damaged
271
+ cursor counts no tokens of its own.
272
+
273
+ The session's total is the stored total plus this turn's, and it is
274
+ carried forward for the rest of the session's life. A default of 1
275
+ would invent a token that was never saved: the count would read one too
276
+ high from then on, and every later report would carry it. The default is
277
+ 0 -- no stored tokens, no stored tokens.
278
+ """
279
+ _start(repo, "A")
280
+ _use(repo, monkeypatch, "A")
281
+
282
+ # Damage the cursor: the session's state keeps no token count.
283
+ cursor = read_cursor(repo)
284
+ cursor["sessions"]["A"].pop("tokens", None)
285
+ usage_ledger.write_cursor(repo, cursor)
286
+
287
+ _stop(repo, "A")
288
+
289
+ unit = _one_entry_tokens(repo)
290
+ assert _session_tokens(repo, "A") == unit
@@ -11,6 +11,8 @@ checks -- with plain bytes.
11
11
  from __future__ import annotations
12
12
 
13
13
  import json
14
+ import os
15
+ from pathlib import Path
14
16
 
15
17
  import pytest
16
18
 
@@ -240,3 +242,63 @@ def test_minimal_node_environment_keeps_locale_only_and_pins_path() -> None:
240
242
  assert "NPM_TOKEN" not in env
241
243
  assert env["PATH"] != "/evil"
242
244
  assert env["PATH"].endswith("System32") if "SYSTEMROOT" in env else env["PATH"] == "/usr/bin:/bin"
245
+
246
+
247
+ # --- the POSIX route's component identity ------------------------------------------------------
248
+
249
+
250
+ def test_route_component_survives_a_directory_whose_times_move(
251
+ tmp_path: Path, monkeypatch: pytest.MonkeyPatch
252
+ ) -> None:
253
+ """A DIRECTORY's times are not its identity, and the route knows that.
254
+
255
+ pytest's xdist workers all create their `popen-gwN` directory inside the
256
+ SHARED `pytest-N` parent, so a directory on the route changes while the
257
+ route is being captured. The capture stats the component twice and
258
+ refuses when the two disagree -- and for a directory its size and its
259
+ times move for that reason alone, with nothing about the executable
260
+ changing.
261
+
262
+ The refusal is silent where it matters: the manager resolution returns
263
+ None ("manager_unavailable") and the revalidation fails
264
+ ("command_changed"), so a harmless concurrent mkdir becomes a refusal
265
+ to install. Those are the two shapes the macOS and the Ubuntu CI cells
266
+ reported, from the same defect.
267
+
268
+ What the route's trust rests on is the hop's IDENTITY (the inode), its
269
+ MODE (who may write it) and its OWNER (who owns it): a swap changes the
270
+ inode, a chmod changes the mode, a chown changes the owner, and all
271
+ three are still compared. A FILE keeps every field -- its content is
272
+ hashed and compared separately, and its times ARE its identity.
273
+ """
274
+ from graphite import dependency_install as install
275
+
276
+ directory = tmp_path / "hop"
277
+ directory.mkdir()
278
+ executable = tmp_path / "npm"
279
+ executable.write_text("#!/usr/bin/env node\n", encoding="utf-8")
280
+
281
+ real_lstat = Path.lstat
282
+ seen: dict[str, int] = {}
283
+
284
+ def moving_lstat(self: Path) -> os.stat_result:
285
+ result = real_lstat(self)
286
+ key = str(self)
287
+ seen[key] = seen.get(key, 0) + 1
288
+ if seen[key] == 2:
289
+ # The capture's SECOND stat of this component reports a moved
290
+ # time -- what a sibling's mkdir does to a directory.
291
+ fields = list(result)
292
+ fields[8] = fields[8] + 1
293
+ return os.stat_result(tuple(fields))
294
+ return result
295
+
296
+ monkeypatch.setattr(Path, "lstat", moving_lstat)
297
+
298
+ assert install._capture_posix_component(directory) is not None, (
299
+ "a directory's moving times must not refuse the route"
300
+ )
301
+ seen.clear()
302
+ assert install._capture_posix_component(executable) is None, (
303
+ "a file's moving times ARE its identity, and the route must refuse it"
304
+ )