graphite-code 1.9.0__tar.gz → 1.9.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {graphite_code-1.9.0 → graphite_code-1.9.2}/CHANGELOG.md +91 -1
- {graphite_code-1.9.0 → graphite_code-1.9.2}/PKG-INFO +2 -2
- {graphite_code-1.9.0 → graphite_code-1.9.2}/README.md +1 -1
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/__init__.py +1 -1
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/agent_hooks.py +243 -11
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/cli.py +30 -3
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/conftest.py +88 -1
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_agent_hooks.py +330 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cli_channel.py +10 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_doctor.py +139 -21
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_probe_diagnostics.py +31 -7
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_search.py +75 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/.gitignore +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/.mcp.json +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/ARCHITECTURE.md +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/CONTRIBUTING.md +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/LICENSE +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/RELEASING.md +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/SECURITY.md +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/benchmarks/__init__.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/benchmarks/build_benchmark.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/benchmarks/realty_router/README.md +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/benchmarks/realty_router/__init__.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/benchmarks/realty_router/evaluate.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/benchmarks/realty_router/tasks.json +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/benchmarks/synthetic_repo.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/pyproject.toml +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/scripts/__init__.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/scripts/compare_dist.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/scripts/gen_cli_reference.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/scripts/mutation_tests.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/scripts/pyscopeoracle.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/scripts/sqloracle.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/scripts/verify_artifact.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/scripts/verify_published_release.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/__main__.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/_cleanup_worker.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/_win32_ctypes.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/activation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/agent_settings.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/analyze.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/answer_contract.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/bootstrap.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/buildlock.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/cache.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/channel.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/cluster.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/config.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/context.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/daemon.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/daemon_health.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/daemon_launch.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/debt.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/dependency_install.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/detach.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/doctor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/doctor_probes.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/engine_identity.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/export/__init__.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/export/html.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/export/json.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/export/md.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/extract/__init__.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/extract/ast.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/extract/pyscope.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/freshness.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/git.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/graph.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/graph_io.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/health.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/hook_entry.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/hookinstall.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/hookshim.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/incident_ledger.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/ingest.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/init.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/io.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/launchd_agent.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/listing.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/llm.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/llm_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/mcp.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/mcp_server.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/natural_query.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/overlays.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/ownership.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/probe_process.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/probe_workspace.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/process_contracts.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/programs.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/provider_observer.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/py.typed +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/query.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/query_plan.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/replacement_audit.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/resolve.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/review.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/__init__.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/approval.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/classifier.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/claude_executor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/claude_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/cli_identity.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/codex_executor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/codex_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/context_builder.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/contracts.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/diff_policy.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/edit_apply.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/effort.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/lifecycle.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/lifecycle_operator.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/lifecycle_service.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/lifecycle_storage.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/ollama_executor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/ollama_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/openrouter_executor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/openrouter_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/policy.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/probe_runner.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/process_runner.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/profiles.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/prompt.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/registry.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/route_pool.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/route_pool_execution.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/schema_validation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/service.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/settings.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/shadow.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/storage.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/telemetry.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/worktree.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/zai_edit.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/zai_executor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/routing/zai_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/savings.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/systemd_unit.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/ts_bridge.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/ts_resolver.mjs +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/typescript_activation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/usage_ledger.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/validation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/watch.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/windows_job.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/windows_startup.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/src/graphite/windows_task.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/data/sqloracle/blindspots.py.txt +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/data/sqloracle/round69.py.txt +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/fake_clis/fake_cli.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/fixtures/provider_lifecycle_schema_v1.sql +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/fixtures/routing_schema_v2_ca77600.sql +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/fixtures/routing_schema_v3_94eb333.sql +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/fixtures/routing_schema_v4_lifecycle_migration.sql +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test__win32_ctypes.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_activation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_activation_backstop.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_agent_hook_activation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_agent_hooks_session_books.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_agent_hooks_session_tagging.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_agent_settings.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_answer_contract.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_arrow_and_constructor_binding.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_ast_make_id_length.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_ast_name_a_module_only_imports.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_ast_source_lines.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_ast_super_over_a_builtin_base.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_atomic_write.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_bootstrap.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_build_detach.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_buildlock.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cache_engine_identity.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cache_entry_pruning.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cache_file_identity.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cache_file_set.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cache_pruning.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_call_graph.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_case_ambiguous_answer.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_channel_attribution.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_channel_cli.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_channel_core.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_channel_kind.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_channel_lock.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_channel_log_integrity.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_channel_mcp.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_channel_register.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_channel_report.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_channel_status.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_class_field_arrow_binding.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cli_below_repository_root.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cli_build_missing_path.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cli_channel_attribution.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cli_doctor_below_root.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cli_reference.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cli_usage.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cli_version.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cluster.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_compare_dist.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_configuration_reference.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_context.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_context_builder.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cwd_relative_config.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_cycle_search.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_daemon.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_daemon_activation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_daemon_build_lock.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_daemon_child_lock.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_daemon_engine_staleness.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_daemon_health.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_daemon_health_activation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_daemon_launch.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_daemon_service_cli.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_daemon_snapshot_failure.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_debt.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_dependency_install.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_destructured_binding.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_determinism.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_dispatch_evidence.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_doctor_agent_hooks.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_doctor_hooks.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_doctor_managed_docs.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_doctor_probes.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_documentation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_edit_apply.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_engine_identity.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_exit_codes_reference.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_external_calls.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_file_node_id_collision.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_git_security.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_go_rust.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_graph_io.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_graph_provider_isolation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_hardening.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_health.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_hook_entry.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_hook_template.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_hookinstall.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_hookshim.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_html_security.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_incident_ledger.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_init.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_init_activation_doctrine.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_init_hooks.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_init_validation_exit.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_launchd_agent.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_lifecycle_operator.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_listing.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_listing_surfaces.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_llm.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_llm_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_mcp.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_mcp_server.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_mcp_server_channel_attribution.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_member_call_receiver.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_method_dispatch_scope.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_monorepo.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_mutation_tests.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_natural_query.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_no_path_is_graded.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_node_identity.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_ollama_executor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_overlays.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_path_leak_fixture.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_probe_process.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_probe_workspace.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_process_contracts.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_programs.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_provider_claude_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_provider_codex_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_provider_lifecycle.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_provider_lifecycle_service.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_provider_lifecycle_storage.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_provider_observer.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_provider_ollama_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_provider_openrouter_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_provider_probe_runner.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_public_surface.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_published_schemas.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_pyscope.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_pyscopeoracle.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_python_builtin_named_symbols.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_python_import_bindings.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_python_inherits_edge.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_python_local_alias_call.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_python_reexport_follow.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_python_resolver.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_python_scope_identity.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_query_plan.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_reliability.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_replacement_audit.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_repository_root_ownership.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_resolve.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_resolve_python_reexports_of.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_review.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_route_pool.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_route_pool_execution.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_approval.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_benchmark.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_classifier.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_claude_executor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_cli.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_cli_contracts.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_cli_recovery.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_codex_executor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_context.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_contracts.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_diff_policy.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_executor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_openrouter_executor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_policy.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_process_runner.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_profiles.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_registry.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_schema_validation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_security.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_service.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_shadow.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_storage.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_telemetry.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_worktree.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_zai_executor.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_routing_zai_probe.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_savings.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_self_super_dispatch.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_smoke.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_sqloracle.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_synthetic_repo.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_systemd_unit.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_ts_bridge.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_typescript_activation.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_typescript_resolver.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_usage_ledger.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_verify_artifact.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_verify_published_release.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_watch.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_windows_startup.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_windows_task.py +0 -0
- {graphite_code-1.9.0 → graphite_code-1.9.2}/tests/test_zai_edit.py +0 -0
|
@@ -13,7 +13,97 @@ machine-checkable identity; the version is for humans.
|
|
|
13
13
|
|
|
14
14
|
[Keep a Changelog]: https://keepachangelog.com/en/1.1.0/
|
|
15
15
|
|
|
16
|
-
## [
|
|
16
|
+
## [1.9.2] — 2026-11-05
|
|
17
|
+
|
|
18
|
+
A patch release: one fix, and no change to any command, option, exit code
|
|
19
|
+
or entry point. The agent hook's stable contract is that it always exits 0,
|
|
20
|
+
and which searches the strict hook refuses is not a stable surface
|
|
21
|
+
(`docs/compatibility.md`) — so a fix to that decision is a patch.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
**A search for a definition is judged again, not let through as a phrase.**
|
|
26
|
+
1.9.1 stopped the strict agent hook from refusing a prose search for a word
|
|
27
|
+
the repository happens to name: a required space inside a pattern makes the
|
|
28
|
+
word beside it part of a phrase. That rule also let `def dependents`
|
|
29
|
+
through, because it has such a space — and a search written that way asks
|
|
30
|
+
where `dependents` is defined, which is exactly the question the graph
|
|
31
|
+
answers. The nudge was gone for the commonest way a definition is searched
|
|
32
|
+
for.
|
|
33
|
+
|
|
34
|
+
A term that follows a definition keyword across that space is now judged
|
|
35
|
+
like the bare term: `def`, `class`, `function`, `fn`, `func`, `struct`,
|
|
36
|
+
`enum`, `trait`, `impl`, `interface`, `type`, `const`, `let` and `var`. The
|
|
37
|
+
keyword must be the whole word before the space, so `undef name` is still
|
|
38
|
+
prose, and it is matched as written unless the search folds case, since
|
|
39
|
+
`Def name` cannot match `def name` in code. It holds on all three routes.
|
|
40
|
+
|
|
41
|
+
The price is stated rather than hidden: prose that puts one of those words
|
|
42
|
+
in front of a name the repository defines — `type check`, where `check` is a
|
|
43
|
+
function — is refused. The refusal points at the graph, which can answer it,
|
|
44
|
+
and refusing is the direction this hook already takes when it cannot tell.
|
|
45
|
+
|
|
46
|
+
## [1.9.1] — 2026-11-03
|
|
47
|
+
|
|
48
|
+
A patch release: three fixes, and no change to any command, option, exit code
|
|
49
|
+
or entry point. The wording of human-readable output is not a stable surface
|
|
50
|
+
(`docs/compatibility.md`), and the agent hook's stable contract is that it
|
|
51
|
+
always exits 0 — neither moves. The graph the release changes was measured
|
|
52
|
+
against the 1.9.0 tree: every node id survives, none is removed, and no edge
|
|
53
|
+
triple is lost.
|
|
54
|
+
|
|
55
|
+
### Fixed
|
|
56
|
+
|
|
57
|
+
**`graphite search` says how many matches there are, and how to see them.**
|
|
58
|
+
The text form printed `20 match(es) for: X (truncated)`, which reads as the
|
|
59
|
+
total: an agent that reads it that way believes the graph fell short and
|
|
60
|
+
falls back to searching files one at a time — the outcome the graph-first
|
|
61
|
+
rule exists to prevent. The full answer was one flag away and nothing in the
|
|
62
|
+
output or the help said so. The line now reads `20 of 3499 match(es) for: X
|
|
63
|
+
(truncated; pass --limit 3499 to see all)`, and where `--limit` is capped it
|
|
64
|
+
says the cap instead of naming a number above it. `--limit`'s help states
|
|
65
|
+
its default. The JSON form already carried both figures and is unchanged.
|
|
66
|
+
|
|
67
|
+
**A search for a phrase is no longer refused for a word the repo happens to
|
|
68
|
+
name.** The strict agent hook refused `email you` because `email` is a
|
|
69
|
+
method in that repository's graph, and refused `the parser tree` and
|
|
70
|
+
`version path` for the same reason — while `Send Test Email` passed. Whether
|
|
71
|
+
a prose search was allowed depended on where the word fell in the sentence,
|
|
72
|
+
because the comparison is case-exact.
|
|
73
|
+
|
|
74
|
+
A literal space inside a pattern is part of the text the search must match,
|
|
75
|
+
so the word beside it cannot be the bare symbol the search is looking for.
|
|
76
|
+
That is the rule the gate already applied to a piece of a path, a file's
|
|
77
|
+
name and a hyphenated option, and a required space is that kind of joining
|
|
78
|
+
character. A phrase is now searched as text, on all three routes — the Grep
|
|
79
|
+
tool, a shell search and PowerShell — and the graph-first reminder still
|
|
80
|
+
reaches the agent.
|
|
81
|
+
|
|
82
|
+
Two conditions keep this from becoming a way past the gate: the space must
|
|
83
|
+
be **required** (a quantifier or an escape after it may make the space
|
|
84
|
+
absent — `?`, `*`, `{0}`, and BRE's escaped `\?` — and an absent space can
|
|
85
|
+
still find the bare name; where the engine's dialect cannot be read, the
|
|
86
|
+
term is judged rather than excused) and it must be **interior** (text on both
|
|
87
|
+
sides, within the same branch and group, so a space at the edge of either —
|
|
88
|
+
leading, trailing, or against an alternation, a group or an anchor — cannot
|
|
89
|
+
be added to any pattern to smuggle a bare symbol through). A regex escape is
|
|
90
|
+
not a space: `^\s*def\s+name\b` still names the symbol and is still refused,
|
|
91
|
+
and a bare identifier is still refused.
|
|
92
|
+
|
|
93
|
+
**A qualified member the graph cannot answer for is no longer refused.** The
|
|
94
|
+
strict agent hook refused `RUNTIME\.put\(` because `put` is a
|
|
95
|
+
property of a test mock's object literal — a node nothing calls, so the
|
|
96
|
+
route the refusal offers (`callers put`) answers with an empty list. The
|
|
97
|
+
member was a call on something the graph does not model, and the graph had
|
|
98
|
+
nothing to say about it.
|
|
99
|
+
|
|
100
|
+
A member is now exempt from being a refusal when **both** hold: the receiver
|
|
101
|
+
is not something this repo defines, and nothing in this repo calls anything
|
|
102
|
+
of that name. Both are needed — the receiver alone would excuse
|
|
103
|
+
`self.check(`, where the graph does know who calls the method, and the
|
|
104
|
+
callers alone would excuse `graph.jsonify`, where the receiver is a symbol
|
|
105
|
+
this repo defines. A bare word is still refused, including one nothing
|
|
106
|
+
calls.
|
|
17
107
|
|
|
18
108
|
## [1.9.0] — 2026-10-31
|
|
19
109
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: graphite-code
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.2
|
|
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.9.
|
|
52
|
+
**Status: 1.9.2, 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.9.
|
|
5
|
+
**Status: 1.9.2, 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.9.
|
|
41
|
+
__version__ = "1.9.2"
|
|
@@ -19,10 +19,12 @@ from . import usage_ledger
|
|
|
19
19
|
from .activation import mark_active
|
|
20
20
|
from .config import Config
|
|
21
21
|
from .freshness import check_graph_freshness
|
|
22
|
+
from .graph import edge_relations
|
|
22
23
|
from .graph_io import load_validated_graph_bundle
|
|
23
24
|
from .health import _edge_language, is_placeholder, persisted_resolution
|
|
24
25
|
from .incident_ledger import record_incident, repo_ledger_dir
|
|
25
26
|
from .ingest import enclosing_git_root, repository_root
|
|
27
|
+
from .query import _CALL_RELATIONS
|
|
26
28
|
|
|
27
29
|
SESSION_CONTRACT = (
|
|
28
30
|
"graphite-first: this repo uses a shared code graph. For cross-file questions "
|
|
@@ -236,27 +238,179 @@ def _without_fused_escapes(pattern: str) -> str:
|
|
|
236
238
|
return _FUSED_ESCAPE_RE.sub(lambda found: found.group() if found.group() == "\\\\" else " ", pattern)
|
|
237
239
|
|
|
238
240
|
|
|
239
|
-
|
|
241
|
+
# A run of literal whitespace in a pattern. Tab counts: a pattern may be
|
|
242
|
+
# written with one.
|
|
243
|
+
_WHITESPACE_RUN_RE = re.compile(r"[ \t]+")
|
|
244
|
+
# The characters that end a branch, a group, a character class, a repetition
|
|
245
|
+
# or an anchor's span. A run next to one of them sits at the edge of what the
|
|
246
|
+
# pattern matches rather than inside a phrase, so it is not a joining
|
|
247
|
+
# character: `dependents |zzqx` is the first branch `dependents ` and
|
|
248
|
+
# `zzqx| dependents` is the second branch ` dependents`, and both are the
|
|
249
|
+
# bare name with a space at the edge of it.
|
|
250
|
+
_BOUNDARY_CHARS = frozenset("|()[]{}^$")
|
|
251
|
+
# A quantifier or an escape after a space. The space may be absent -- `?`,
|
|
252
|
+
# `*` and `{0` in ERE, `\\?` and `\\{0,1\\}` in BRE -- or the construct is one
|
|
253
|
+
# this hook cannot parse, and a parse it does not understand fails closed.
|
|
254
|
+
# Either way the space is not something the matched text must carry, so the
|
|
255
|
+
# bare name is still what the search may be looking for.
|
|
256
|
+
_QUANTIFIER_OR_ESCAPE_AFTER = frozenset("?*+{\\")
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
def _required_interior_whitespace(pattern: str) -> list[tuple[int, int]]:
|
|
260
|
+
"""Spans of whitespace a matched text must carry, with text on both sides.
|
|
261
|
+
|
|
262
|
+
A literal space inside a pattern is part of the text the search must
|
|
263
|
+
match: `email you` finds the phrase, not the bare word. The rule that
|
|
264
|
+
already skips a piece of a path, a file's name or a hyphenated option is
|
|
265
|
+
the same one -- a fragment of a longer literal is not judged alone -- and
|
|
266
|
+
a required space beside a word is that kind of joining character. So a
|
|
267
|
+
prose search is not refused for a word the repo happens to call `email`
|
|
268
|
+
(round 331), and the refusal no longer depends on where the word falls
|
|
269
|
+
in the sentence.
|
|
270
|
+
|
|
271
|
+
Two conditions keep this from becoming a way past the gate:
|
|
272
|
+
|
|
273
|
+
- the space must be REQUIRED. A quantifier or an escape after it may make
|
|
274
|
+
the space absent, and an absent space can still find the bare name.
|
|
275
|
+
- it must be INTERIOR: text on both sides, within the same branch and
|
|
276
|
+
group. A space at the edge of either -- leading, trailing, or against
|
|
277
|
+
an alternation, a group or an anchor -- would let any pattern smuggle a
|
|
278
|
+
bare symbol past the gate by adding one space, so it is not treated as
|
|
279
|
+
a joining character.
|
|
280
|
+
|
|
281
|
+
The engine's dialect is not read, and where it would matter the space is
|
|
282
|
+
judged rather than excused: a bare `?` is a quantifier in ERE and a
|
|
283
|
+
literal character in BRE, and the hook cannot tell which it is looking
|
|
284
|
+
at, so `email ?you` is judged in both. That refuses a search the pattern
|
|
285
|
+
may have allowed, and refusing is the safe direction.
|
|
286
|
+
|
|
287
|
+
A regex escape is not a space. `\\s` is an operator, so
|
|
288
|
+
`^\\s*def\\s+dependents\\b` still names the symbol and is still judged,
|
|
289
|
+
and the name beside an escape is judged exactly as it was.
|
|
290
|
+
"""
|
|
291
|
+
spans: list[tuple[int, int]] = []
|
|
292
|
+
for found in _WHITESPACE_RUN_RE.finditer(pattern):
|
|
293
|
+
start, end = found.start(), found.end()
|
|
294
|
+
before = pattern[start - 1] if start else ""
|
|
295
|
+
after = pattern[end] if end < len(pattern) else ""
|
|
296
|
+
if not before or not after:
|
|
297
|
+
continue # at the edge of the pattern
|
|
298
|
+
if before in _BOUNDARY_CHARS or after in _BOUNDARY_CHARS:
|
|
299
|
+
continue # at the edge of a branch, a group or an anchor
|
|
300
|
+
if after in _QUANTIFIER_OR_ESCAPE_AFTER:
|
|
301
|
+
continue # the space may be absent, or the parse is unknown
|
|
302
|
+
spans.append((start, end))
|
|
303
|
+
return spans
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
def _beside_a_required_space(start: int, end: int, spaces: list[tuple[int, int]]) -> bool:
|
|
307
|
+
"""Whether the token at `start:end` sits against a required interior space."""
|
|
308
|
+
return any(run_end == start or run_start == end for run_start, run_end in spaces)
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
# The words a definition is written with, in the languages graphite reads.
|
|
312
|
+
# The word after one is the name being defined, so `def dependents` asks where
|
|
313
|
+
# `dependents` is defined -- the question the graph answers -- and is not a
|
|
314
|
+
# phrase. Round 331 first excused it as prose, which gave up the nudge for
|
|
315
|
+
# the commonest way a definition is searched for.
|
|
316
|
+
_DEFINITION_KEYWORDS = frozenset(
|
|
317
|
+
{
|
|
318
|
+
"def", "class", "function", "fn", "func", "struct", "enum", "trait",
|
|
319
|
+
"impl", "interface", "type", "const", "let", "var",
|
|
320
|
+
}
|
|
321
|
+
)
|
|
322
|
+
# The word that ends exactly where a space begins: the whole identifier, so
|
|
323
|
+
# `undef` and `defx` are not `def`.
|
|
324
|
+
_WORD_BEFORE_RE = re.compile(r"[A-Za-z0-9_]+$")
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
def _follows_a_definition_keyword(
|
|
328
|
+
pattern: str, start: int, spaces: list[tuple[int, int]], fold_case: bool
|
|
329
|
+
) -> bool:
|
|
330
|
+
"""Whether the token at `start` follows a definition keyword across a
|
|
331
|
+
required space.
|
|
332
|
+
|
|
333
|
+
Such a token is the name a definition defines, so the space beside it does
|
|
334
|
+
not make it a fragment of a phrase. `pattern` is read with its fused
|
|
335
|
+
escapes blanked, so `\\bdef name` reads its keyword as `def`. The keyword
|
|
336
|
+
is matched as written unless the search folds case: `Def name` cannot
|
|
337
|
+
match `def name` in code.
|
|
338
|
+
"""
|
|
339
|
+
for run_start, run_end in spaces:
|
|
340
|
+
if run_end != start:
|
|
341
|
+
continue
|
|
342
|
+
found = _WORD_BEFORE_RE.search(pattern, 0, run_start)
|
|
343
|
+
if found is None:
|
|
344
|
+
continue
|
|
345
|
+
word = found.group()
|
|
346
|
+
if (word.lower() if fold_case else word) in _DEFINITION_KEYWORDS:
|
|
347
|
+
return True
|
|
348
|
+
return False
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
def _receiver_of(pattern: str, start: int) -> str | None:
|
|
352
|
+
"""The identifier the word at `start` is qualified by, or None.
|
|
353
|
+
|
|
354
|
+
`env.put(` and `env\\.put(` both qualify `put` by `env`. A word that is
|
|
355
|
+
not behind a dot is qualified by nothing.
|
|
356
|
+
"""
|
|
357
|
+
index = start - 1
|
|
358
|
+
if index < 0:
|
|
359
|
+
return None
|
|
360
|
+
if pattern[index] == "\\":
|
|
361
|
+
index -= 1
|
|
362
|
+
if index < 0 or pattern[index] != ".":
|
|
363
|
+
return None
|
|
364
|
+
index -= 1 # past the dot
|
|
365
|
+
if index >= 0 and pattern[index] == "\\":
|
|
366
|
+
index -= 1 # and past the backslash of an escaped dot
|
|
367
|
+
end = index + 1
|
|
368
|
+
while index >= 0 and (pattern[index].isalnum() or pattern[index] == "_"):
|
|
369
|
+
index -= 1
|
|
370
|
+
if index + 1 == end:
|
|
371
|
+
return None # nothing before the dot
|
|
372
|
+
return pattern[index + 1:end]
|
|
373
|
+
|
|
374
|
+
|
|
375
|
+
def _pattern_tokens(pattern: str, fold_case: bool) -> list[tuple[str, str | None]]:
|
|
240
376
|
"""Identifier-like tokens from a grep pattern, deduplicated, capped.
|
|
241
377
|
|
|
242
378
|
Two spellings of one word are one token only when the search folds case.
|
|
243
379
|
Otherwise `Done|done` would keep `Done` alone and never check `done`.
|
|
380
|
+
|
|
381
|
+
Each token carries the identifier it is qualified by, or None when the
|
|
382
|
+
word appears without one. A word that appears bare anywhere in the
|
|
383
|
+
pattern is never a qualified member: `install|env.install(` is a search
|
|
384
|
+
for the bare name as well.
|
|
244
385
|
"""
|
|
245
|
-
seen:
|
|
246
|
-
|
|
386
|
+
seen: dict[str, str] = {}
|
|
387
|
+
receivers: dict[str, str | None] = {}
|
|
388
|
+
# The spaces are read from the pattern as written: `_without_fused_escapes`
|
|
389
|
+
# blanks an escape into spaces of its own, and a blanked escape is an
|
|
390
|
+
# operator, not a space the matched text must carry.
|
|
391
|
+
spaces = _required_interior_whitespace(pattern)
|
|
247
392
|
pattern = _without_fused_escapes(pattern)
|
|
248
393
|
for found in _IDENTIFIER_RE.finditer(pattern):
|
|
249
394
|
if _is_literal_fragment(pattern, found.start(), found.end()):
|
|
250
395
|
continue
|
|
396
|
+
if _beside_a_required_space(
|
|
397
|
+
found.start(), found.end(), spaces
|
|
398
|
+
) and not _follows_a_definition_keyword(pattern, found.start(), spaces, fold_case):
|
|
399
|
+
continue
|
|
251
400
|
token = found.group()
|
|
252
401
|
key = token.lower() if fold_case else token
|
|
402
|
+
receiver = _receiver_of(pattern, found.start())
|
|
253
403
|
if key in seen:
|
|
404
|
+
# Qualified somewhere and bare somewhere else is a search for the
|
|
405
|
+
# bare name too, so the word is not a qualified member.
|
|
406
|
+
if receivers[key] != receiver:
|
|
407
|
+
receivers[key] = None
|
|
254
408
|
continue
|
|
255
|
-
seen
|
|
256
|
-
|
|
257
|
-
if len(
|
|
409
|
+
seen[key] = token
|
|
410
|
+
receivers[key] = receiver
|
|
411
|
+
if len(seen) >= _MAX_TOKENS_CHECKED:
|
|
258
412
|
break
|
|
259
|
-
return
|
|
413
|
+
return [(seen[key], receivers[key]) for key in seen]
|
|
260
414
|
|
|
261
415
|
|
|
262
416
|
def _hook_graph(root: Path) -> Any | None:
|
|
@@ -268,7 +422,74 @@ def _hook_graph(root: Path) -> Any | None:
|
|
|
268
422
|
return graph
|
|
269
423
|
|
|
270
424
|
|
|
271
|
-
def
|
|
425
|
+
def _defines(graph: Any, word: str, fold_case: bool) -> bool:
|
|
426
|
+
"""Whether this repo defines something by this word.
|
|
427
|
+
|
|
428
|
+
A placeholder does not count: `json` is in the graph because a file
|
|
429
|
+
imports it, not because the repo defines it.
|
|
430
|
+
"""
|
|
431
|
+
key = word.lower() if fold_case else word
|
|
432
|
+
for node_id, data in graph.nodes(data=True):
|
|
433
|
+
if is_placeholder(data):
|
|
434
|
+
continue
|
|
435
|
+
for candidate in (node_id, str(data.get("name", ""))):
|
|
436
|
+
candidate_key = candidate.lower() if fold_case else candidate
|
|
437
|
+
if candidate_key and candidate_key == key:
|
|
438
|
+
return True
|
|
439
|
+
return False
|
|
440
|
+
|
|
441
|
+
|
|
442
|
+
def _has_callers(graph: Any, node_id: str) -> bool:
|
|
443
|
+
"""Whether the graph's own `callers` listing for this node is non-empty.
|
|
444
|
+
|
|
445
|
+
The same relations `query "callers"` counts: an inbound edge whose
|
|
446
|
+
relations include a call or a reference. Nesting (`contains`) is not a
|
|
447
|
+
call -- a nested function is contained by its parent, not called by it.
|
|
448
|
+
"""
|
|
449
|
+
return any(
|
|
450
|
+
any(relation in _CALL_RELATIONS for relation in edge_relations(graph[source][node_id]))
|
|
451
|
+
for source in graph.predecessors(node_id)
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
def _exempt_member(graph: Any, word: str, receiver: str | None, fold_case: bool) -> bool:
|
|
456
|
+
"""Whether a qualified member is something the graph cannot answer for.
|
|
457
|
+
|
|
458
|
+
The receiver is not something this repo defines, so the member is a call
|
|
459
|
+
on something the graph does not model -- a runtime binding, or a test
|
|
460
|
+
double's namesake. And nothing in this repo calls anything of that name,
|
|
461
|
+
so the route the refusal offers (`callers <word>`) would resolve the word
|
|
462
|
+
to a node with no callers and answer with an empty list (round 332).
|
|
463
|
+
|
|
464
|
+
Both conditions are needed, and each of them alone would undo a decision
|
|
465
|
+
this gate already made:
|
|
466
|
+
|
|
467
|
+
- the receiver alone would excuse `self.check(`, where the graph does
|
|
468
|
+
know who calls the method;
|
|
469
|
+
- the callers alone would excuse `graph.jsonify`, where the receiver is
|
|
470
|
+
a symbol this repo defines.
|
|
471
|
+
"""
|
|
472
|
+
if receiver is None:
|
|
473
|
+
return False
|
|
474
|
+
if _defines(graph, receiver, fold_case):
|
|
475
|
+
return False
|
|
476
|
+
key = word.lower() if fold_case else word
|
|
477
|
+
for node_id, data in graph.nodes(data=True):
|
|
478
|
+
if is_placeholder(data):
|
|
479
|
+
continue
|
|
480
|
+
name = str(data.get("name", ""))
|
|
481
|
+
name_key = name.lower() if fold_case else name
|
|
482
|
+
id_key = node_id.lower() if fold_case else node_id
|
|
483
|
+
if name_key != key and id_key != key:
|
|
484
|
+
continue
|
|
485
|
+
if _has_callers(graph, node_id):
|
|
486
|
+
return False
|
|
487
|
+
return True
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
def _graph_symbol(
|
|
491
|
+
graph: Any, tokens: list[tuple[str, str | None]], fold_case: bool
|
|
492
|
+
) -> tuple[str, str] | None:
|
|
272
493
|
"""First token that IS something this repo defines (exact id or name), else None.
|
|
273
494
|
|
|
274
495
|
A placeholder does not count. `json` is in the graph because a file imports
|
|
@@ -278,15 +499,26 @@ def _graph_symbol(graph: Any, tokens: list[str], fold_case: bool) -> tuple[str,
|
|
|
278
499
|
|
|
279
500
|
Case is compared the way the search compares it. A case-exact search for
|
|
280
501
|
`DONE` cannot find a function `done`, so it is not a search for one.
|
|
502
|
+
|
|
503
|
+
A qualified member the graph cannot answer for is not a symbol this
|
|
504
|
+
search is about, and does not refuse it (round 332).
|
|
281
505
|
"""
|
|
282
|
-
wanted = {(token.lower() if fold_case else token): token for token in tokens}
|
|
506
|
+
wanted = {(token.lower() if fold_case else token): token for token, _ in tokens}
|
|
507
|
+
receivers = {(token.lower() if fold_case else token): receiver for token, receiver in tokens}
|
|
508
|
+
exempt: set[str] = set()
|
|
283
509
|
for node_id, data in graph.nodes(data=True):
|
|
284
510
|
if is_placeholder(data):
|
|
285
511
|
continue
|
|
286
512
|
for candidate in (node_id, str(data.get("name", ""))):
|
|
287
513
|
key = candidate.lower() if fold_case else candidate
|
|
288
|
-
if key and key in wanted:
|
|
289
|
-
|
|
514
|
+
if not (key and key in wanted):
|
|
515
|
+
continue
|
|
516
|
+
if key in exempt:
|
|
517
|
+
continue
|
|
518
|
+
if _exempt_member(graph, key, receivers.get(key), fold_case):
|
|
519
|
+
exempt.add(key)
|
|
520
|
+
continue
|
|
521
|
+
return node_id, wanted[key]
|
|
290
522
|
return None
|
|
291
523
|
|
|
292
524
|
|
|
@@ -1415,6 +1415,29 @@ def cmd_query(args: argparse.Namespace) -> int:
|
|
|
1415
1415
|
return 0
|
|
1416
1416
|
|
|
1417
1417
|
|
|
1418
|
+
def _search_summary(result: dict[str, Any]) -> str:
|
|
1419
|
+
"""The one line that says what was shown, how much exists, and how to see it.
|
|
1420
|
+
|
|
1421
|
+
`20 match(es)` reads as the total, and an agent that reads it that way
|
|
1422
|
+
believes the graph fell short and falls back to searching files one at a
|
|
1423
|
+
time -- the outcome the graph-first rule exists to prevent. The full
|
|
1424
|
+
answer was one flag away, so the line now says so (round 330). The JSON
|
|
1425
|
+
form already carried both figures and is unchanged.
|
|
1426
|
+
"""
|
|
1427
|
+
count = result["count"]
|
|
1428
|
+
query = result["query"]
|
|
1429
|
+
if not result.get("truncated"):
|
|
1430
|
+
return f"[graphite] {count} match(es) for: {query}"
|
|
1431
|
+
total = result["total_matches"]
|
|
1432
|
+
if total <= MAX_SEARCH_LIMIT:
|
|
1433
|
+
way_out = f"pass --limit {total} to see all"
|
|
1434
|
+
else:
|
|
1435
|
+
# `--limit` is capped, so naming a number above the cap would be a
|
|
1436
|
+
# false instruction. Say the cap instead.
|
|
1437
|
+
way_out = f"--limit caps at {MAX_SEARCH_LIMIT}"
|
|
1438
|
+
return f"[graphite] {count} of {total} match(es) for: {query} (truncated; {way_out})"
|
|
1439
|
+
|
|
1440
|
+
|
|
1418
1441
|
def cmd_search(args: argparse.Namespace) -> int:
|
|
1419
1442
|
started = time.perf_counter()
|
|
1420
1443
|
g = _load_cli_graph(args)
|
|
@@ -1426,8 +1449,7 @@ def cmd_search(args: argparse.Namespace) -> int:
|
|
|
1426
1449
|
elif not result["results"]:
|
|
1427
1450
|
print(f"[graphite] no matches for: {result['query']}")
|
|
1428
1451
|
else:
|
|
1429
|
-
|
|
1430
|
-
print(f"[graphite] {result['count']} match(es) for: {result['query']}{suffix}")
|
|
1452
|
+
print(_search_summary(result))
|
|
1431
1453
|
for item in result["results"]:
|
|
1432
1454
|
location = f" ({item['source_file']})" if item["source_file"] else ""
|
|
1433
1455
|
print(f" - {item['id']} [{item['kind']}, {item['match_type']}]{location}")
|
|
@@ -3362,7 +3384,12 @@ def build_parser() -> argparse.ArgumentParser:
|
|
|
3362
3384
|
default=_DEFAULT_GRAPH_JSON,
|
|
3363
3385
|
help="Path to graph.json",
|
|
3364
3386
|
)
|
|
3365
|
-
p_search.add_argument(
|
|
3387
|
+
p_search.add_argument(
|
|
3388
|
+
"--limit",
|
|
3389
|
+
type=int,
|
|
3390
|
+
default=DEFAULT_SEARCH_LIMIT,
|
|
3391
|
+
help=f"Maximum results (default: {DEFAULT_SEARCH_LIMIT})",
|
|
3392
|
+
)
|
|
3366
3393
|
p_search.add_argument("--json", action="store_true", help="Emit machine-readable JSON")
|
|
3367
3394
|
p_search.set_defaults(func=cmd_search)
|
|
3368
3395
|
|
|
@@ -11,9 +11,10 @@ from __future__ import annotations
|
|
|
11
11
|
|
|
12
12
|
import json
|
|
13
13
|
import sqlite3
|
|
14
|
+
import time
|
|
14
15
|
import traceback
|
|
15
16
|
from pathlib import Path
|
|
16
|
-
from typing import Callable
|
|
17
|
+
from typing import Callable, Iterator
|
|
17
18
|
|
|
18
19
|
import pytest
|
|
19
20
|
|
|
@@ -119,7 +120,93 @@ _REPOSITORY_TREE_MODULES = frozenset(
|
|
|
119
120
|
)
|
|
120
121
|
|
|
121
122
|
|
|
123
|
+
# --- tests that run a REAL manifest build (#146) -------------------------------
|
|
124
|
+
#
|
|
125
|
+
# `probe_mcp` launches a manifest builder child before the server. A test that
|
|
126
|
+
# leaves that child real pays for a real build, and a COLD one -- no cached
|
|
127
|
+
# manifest for that cache key -- walks every package's metadata. The walk is
|
|
128
|
+
# syscall-bound on Windows (`_getfinalpathname`, `_path_exists`), so under
|
|
129
|
+
# contention each call yields its slice and queues behind the busy processes:
|
|
130
|
+
# it slows far more than its CPU share would predict. The probe's default 20s
|
|
131
|
+
# budget (19s of execution) is an idle-machine figure, and the suite spends it
|
|
132
|
+
# on a loaded one.
|
|
133
|
+
#
|
|
134
|
+
# MEASURED 2026-11-05 on a 12-core Windows dev box, cold build, dev venv:
|
|
135
|
+
#
|
|
136
|
+
# idle n=5 3.60-3.96s
|
|
137
|
+
# 2x oversubscribed n=20 p50 21.1s p90 30.0s max 52.3s
|
|
138
|
+
# (24 CPU burners on 12 cores)
|
|
139
|
+
#
|
|
140
|
+
# CI that day, Windows cells: five runs failed with every build killed at
|
|
141
|
+
# 19.1-19.3s, and the pre-change tag failed the same way on the same day -- the
|
|
142
|
+
# runners, not a change. That gives only a LOWER bound on CI's true duration,
|
|
143
|
+
# which is why the budget is derived from the harsher local shape instead.
|
|
144
|
+
#
|
|
145
|
+
# Derived the way `_COLD_START_BUDGET_SECONDS` in test_doctor.py derives its
|
|
146
|
+
# own: the transport's EXECUTION deadline -- `budget - min(1.0, 0.4 * budget)`
|
|
147
|
+
# -- about 4x the loaded p90. 4 x 30.0s = 120s; a 120s budget leaves 119s of
|
|
148
|
+
# execution, 2.3x the slowest build measured. It costs nothing when the code is
|
|
149
|
+
# correct, because the run returns the moment the build does. Re-derive it if
|
|
150
|
+
# the build or the load model changes -- do not tune it by re-running until
|
|
151
|
+
# green.
|
|
152
|
+
#
|
|
153
|
+
# THE CEILING. CI runs pytest with `--timeout=120 --timeout-method=thread`, and
|
|
154
|
+
# that method calls `os._exit` -- it kills the whole xdist worker, not the
|
|
155
|
+
# test. A test legitimately waiting out this budget would die mid-wait and take
|
|
156
|
+
# the rest of its file with it. So every test that requests the fixture also
|
|
157
|
+
# gets a per-test timeout above its own worst case: two builds (one test calls
|
|
158
|
+
# the probe twice), one real server phase (20s), and a minute for the rest.
|
|
159
|
+
# The local gate passes no `--timeout`, so only CI would ever show that
|
|
160
|
+
# ceiling -- which is why it is stated here.
|
|
161
|
+
#
|
|
162
|
+
# THE HANG COST, and the guard that bounds it. "Costs nothing" holds only while
|
|
163
|
+
# the build FINISHES. If the builder genuinely hangs, the cache never fills and
|
|
164
|
+
# every test requesting the fixture would wait out the whole budget:
|
|
165
|
+
# test_doctor.py runs on one worker under `--dist loadfile` and holds about 24
|
|
166
|
+
# such items -- roughly 48 minutes in series, past the CI test job's 30-minute
|
|
167
|
+
# `timeout-minutes`, which kills the job with no pytest summary (the #45 shape).
|
|
168
|
+
#
|
|
169
|
+
# So the first full wait is treated as the answer. Once a test in this worker
|
|
170
|
+
# has spent `_SPENT_THRESHOLD_SECONDS` -- within 20s of the budget, nearly twice
|
|
171
|
+
# the slowest build that ever FINISHED (52.3s) -- every later request gets the
|
|
172
|
+
# probe's own default instead. A genuine hang then costs one full budget plus
|
|
173
|
+
# about 19s per remaining test, roughly 10 minutes, and ends in a summary of
|
|
174
|
+
# clean `timeout` failures. The guard is per worker process, which is the scope
|
|
175
|
+
# of the manifest cache whose emptiness it stands in for.
|
|
176
|
+
#
|
|
177
|
+
# The clock is captured at import on purpose: some tests patch `time.monotonic`
|
|
178
|
+
# process-wide (the stdlib module IS what they patch), and this fixture is torn
|
|
179
|
+
# down before their monkeypatch is undone.
|
|
180
|
+
#
|
|
181
|
+
# NOT for a test whose subject IS the manifest budget (the hard-bound test in
|
|
182
|
+
# test_doctor.py): it keeps its own number.
|
|
183
|
+
COLD_MANIFEST_BUILD_BUDGET_SECONDS = 120.0
|
|
184
|
+
_COLD_MANIFEST_BUILD_TEST_TIMEOUT_SECONDS = 2 * COLD_MANIFEST_BUILD_BUDGET_SECONDS + 20 + 60
|
|
185
|
+
_COLD_MANIFEST_BUILD_FIXTURE = "cold_manifest_build_budget"
|
|
186
|
+
_SPENT_THRESHOLD_SECONDS = COLD_MANIFEST_BUILD_BUDGET_SECONDS - 20.0
|
|
187
|
+
_AFTER_A_SPENT_BUDGET_SECONDS = 20.0 # `probe_mcp`'s own default
|
|
188
|
+
_monotonic = time.monotonic
|
|
189
|
+
_build_budget_spent_in_this_worker = False
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
@pytest.fixture
|
|
193
|
+
def cold_manifest_build_budget() -> Iterator[float]:
|
|
194
|
+
"""The manifest budget for a test that runs a REAL build (see above)."""
|
|
195
|
+
global _build_budget_spent_in_this_worker
|
|
196
|
+
if _build_budget_spent_in_this_worker:
|
|
197
|
+
yield _AFTER_A_SPENT_BUDGET_SECONDS
|
|
198
|
+
return
|
|
199
|
+
started = _monotonic()
|
|
200
|
+
yield COLD_MANIFEST_BUILD_BUDGET_SECONDS
|
|
201
|
+
if _monotonic() - started >= _SPENT_THRESHOLD_SECONDS:
|
|
202
|
+
_build_budget_spent_in_this_worker = True
|
|
203
|
+
|
|
204
|
+
|
|
122
205
|
def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item]) -> None:
|
|
206
|
+
ceiling = pytest.mark.timeout(_COLD_MANIFEST_BUILD_TEST_TIMEOUT_SECONDS)
|
|
207
|
+
for item in items:
|
|
208
|
+
if _COLD_MANIFEST_BUILD_FIXTURE in getattr(item, "fixturenames", ()):
|
|
209
|
+
item.add_marker(ceiling)
|
|
123
210
|
if (_REPO_ROOT / "docs").is_dir():
|
|
124
211
|
return
|
|
125
212
|
skip = pytest.mark.skip(
|