graphite-code 1.9.1__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.1 → graphite_code-1.9.2}/CHANGELOG.md +30 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/PKG-INFO +2 -2
- {graphite_code-1.9.1 → graphite_code-1.9.2}/README.md +1 -1
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/__init__.py +1 -1
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/agent_hooks.py +43 -1
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/conftest.py +88 -1
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_agent_hooks.py +111 -6
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cli_channel.py +10 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_doctor.py +139 -21
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_probe_diagnostics.py +31 -7
- {graphite_code-1.9.1 → graphite_code-1.9.2}/.gitignore +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/.mcp.json +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/ARCHITECTURE.md +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/CONTRIBUTING.md +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/LICENSE +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/RELEASING.md +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/SECURITY.md +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/benchmarks/__init__.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/benchmarks/build_benchmark.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/benchmarks/realty_router/README.md +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/benchmarks/realty_router/__init__.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/benchmarks/realty_router/evaluate.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/benchmarks/realty_router/tasks.json +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/benchmarks/synthetic_repo.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/pyproject.toml +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/scripts/__init__.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/scripts/compare_dist.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/scripts/gen_cli_reference.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/scripts/mutation_tests.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/scripts/pyscopeoracle.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/scripts/sqloracle.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/scripts/verify_artifact.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/scripts/verify_published_release.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/__main__.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/_cleanup_worker.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/_win32_ctypes.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/activation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/agent_settings.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/analyze.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/answer_contract.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/bootstrap.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/buildlock.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/cache.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/channel.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/cli.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/cluster.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/config.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/context.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/daemon.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/daemon_health.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/daemon_launch.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/debt.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/dependency_install.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/detach.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/doctor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/doctor_probes.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/engine_identity.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/export/__init__.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/export/html.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/export/json.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/export/md.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/extract/__init__.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/extract/ast.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/extract/pyscope.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/freshness.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/git.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/graph.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/graph_io.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/health.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/hook_entry.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/hookinstall.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/hookshim.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/incident_ledger.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/ingest.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/init.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/io.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/launchd_agent.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/listing.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/llm.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/llm_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/mcp.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/mcp_server.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/natural_query.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/overlays.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/ownership.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/probe_process.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/probe_workspace.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/process_contracts.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/programs.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/provider_observer.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/py.typed +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/query.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/query_plan.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/replacement_audit.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/resolve.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/review.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/__init__.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/approval.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/classifier.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/claude_executor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/claude_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/cli_identity.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/codex_executor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/codex_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/context_builder.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/contracts.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/diff_policy.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/edit_apply.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/effort.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/lifecycle.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/lifecycle_operator.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/lifecycle_service.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/lifecycle_storage.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/ollama_executor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/ollama_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/openrouter_executor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/openrouter_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/policy.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/probe_runner.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/process_runner.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/profiles.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/prompt.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/registry.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/route_pool.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/route_pool_execution.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/schema_validation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/service.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/settings.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/shadow.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/storage.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/telemetry.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/worktree.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/zai_edit.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/zai_executor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/routing/zai_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/savings.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/systemd_unit.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/ts_bridge.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/ts_resolver.mjs +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/typescript_activation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/usage_ledger.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/validation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/watch.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/windows_job.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/windows_startup.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/src/graphite/windows_task.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/data/sqloracle/blindspots.py.txt +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/data/sqloracle/round69.py.txt +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/fake_clis/fake_cli.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/fixtures/provider_lifecycle_schema_v1.sql +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/fixtures/routing_schema_v2_ca77600.sql +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/fixtures/routing_schema_v3_94eb333.sql +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/fixtures/routing_schema_v4_lifecycle_migration.sql +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test__win32_ctypes.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_activation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_activation_backstop.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_agent_hook_activation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_agent_hooks_session_books.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_agent_hooks_session_tagging.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_agent_settings.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_answer_contract.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_arrow_and_constructor_binding.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_ast_make_id_length.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_ast_name_a_module_only_imports.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_ast_source_lines.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_ast_super_over_a_builtin_base.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_atomic_write.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_bootstrap.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_build_detach.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_buildlock.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cache_engine_identity.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cache_entry_pruning.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cache_file_identity.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cache_file_set.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cache_pruning.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_call_graph.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_case_ambiguous_answer.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_channel_attribution.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_channel_cli.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_channel_core.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_channel_kind.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_channel_lock.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_channel_log_integrity.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_channel_mcp.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_channel_register.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_channel_report.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_channel_status.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_class_field_arrow_binding.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cli_below_repository_root.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cli_build_missing_path.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cli_channel_attribution.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cli_doctor_below_root.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cli_reference.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cli_usage.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cli_version.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cluster.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_compare_dist.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_configuration_reference.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_context.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_context_builder.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cwd_relative_config.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_cycle_search.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_daemon.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_daemon_activation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_daemon_build_lock.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_daemon_child_lock.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_daemon_engine_staleness.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_daemon_health.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_daemon_health_activation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_daemon_launch.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_daemon_service_cli.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_daemon_snapshot_failure.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_debt.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_dependency_install.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_destructured_binding.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_determinism.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_dispatch_evidence.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_doctor_agent_hooks.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_doctor_hooks.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_doctor_managed_docs.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_doctor_probes.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_documentation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_edit_apply.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_engine_identity.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_exit_codes_reference.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_external_calls.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_file_node_id_collision.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_git_security.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_go_rust.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_graph_io.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_graph_provider_isolation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_hardening.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_health.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_hook_entry.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_hook_template.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_hookinstall.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_hookshim.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_html_security.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_incident_ledger.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_init.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_init_activation_doctrine.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_init_hooks.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_init_validation_exit.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_launchd_agent.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_lifecycle_operator.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_listing.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_listing_surfaces.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_llm.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_llm_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_mcp.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_mcp_server.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_mcp_server_channel_attribution.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_member_call_receiver.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_method_dispatch_scope.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_monorepo.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_mutation_tests.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_natural_query.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_no_path_is_graded.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_node_identity.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_ollama_executor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_overlays.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_path_leak_fixture.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_probe_process.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_probe_workspace.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_process_contracts.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_programs.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_provider_claude_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_provider_codex_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_provider_lifecycle.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_provider_lifecycle_service.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_provider_lifecycle_storage.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_provider_observer.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_provider_ollama_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_provider_openrouter_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_provider_probe_runner.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_public_surface.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_published_schemas.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_pyscope.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_pyscopeoracle.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_python_builtin_named_symbols.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_python_import_bindings.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_python_inherits_edge.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_python_local_alias_call.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_python_reexport_follow.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_python_resolver.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_python_scope_identity.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_query_plan.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_reliability.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_replacement_audit.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_repository_root_ownership.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_resolve.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_resolve_python_reexports_of.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_review.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_route_pool.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_route_pool_execution.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_approval.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_benchmark.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_classifier.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_claude_executor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_cli.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_cli_contracts.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_cli_recovery.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_codex_executor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_context.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_contracts.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_diff_policy.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_executor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_openrouter_executor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_policy.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_process_runner.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_profiles.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_registry.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_schema_validation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_security.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_service.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_shadow.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_storage.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_telemetry.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_worktree.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_zai_executor.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_routing_zai_probe.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_savings.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_search.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_self_super_dispatch.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_smoke.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_sqloracle.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_synthetic_repo.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_systemd_unit.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_ts_bridge.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_typescript_activation.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_typescript_resolver.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_usage_ledger.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_verify_artifact.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_verify_published_release.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_watch.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_windows_startup.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_windows_task.py +0 -0
- {graphite_code-1.9.1 → graphite_code-1.9.2}/tests/test_zai_edit.py +0 -0
|
@@ -13,6 +13,36 @@ 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
|
+
## [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
|
+
|
|
16
46
|
## [1.9.1] — 2026-11-03
|
|
17
47
|
|
|
18
48
|
A patch release: three fixes, and no change to any command, option, exit code
|
|
@@ -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"
|
|
@@ -308,6 +308,46 @@ def _beside_a_required_space(start: int, end: int, spaces: list[tuple[int, int]]
|
|
|
308
308
|
return any(run_end == start or run_start == end for run_start, run_end in spaces)
|
|
309
309
|
|
|
310
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
|
+
|
|
311
351
|
def _receiver_of(pattern: str, start: int) -> str | None:
|
|
312
352
|
"""The identifier the word at `start` is qualified by, or None.
|
|
313
353
|
|
|
@@ -353,7 +393,9 @@ def _pattern_tokens(pattern: str, fold_case: bool) -> list[tuple[str, str | None
|
|
|
353
393
|
for found in _IDENTIFIER_RE.finditer(pattern):
|
|
354
394
|
if _is_literal_fragment(pattern, found.start(), found.end()):
|
|
355
395
|
continue
|
|
356
|
-
if _beside_a_required_space(
|
|
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):
|
|
357
399
|
continue
|
|
358
400
|
token = found.group()
|
|
359
401
|
key = token.lower() if fold_case else token
|
|
@@ -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(
|
|
@@ -1146,12 +1146,11 @@ def test_a_fragment_of_a_literal_is_not_judged_alone(
|
|
|
1146
1146
|
("check the round", "allow"),
|
|
1147
1147
|
("round one message", "allow"),
|
|
1148
1148
|
("out of the graph", "allow"),
|
|
1149
|
-
# a
|
|
1150
|
-
#
|
|
1151
|
-
#
|
|
1152
|
-
#
|
|
1153
|
-
|
|
1154
|
-
("def dependents", "allow"),
|
|
1149
|
+
# a definition is NOT a phrase: the word after `def` is the name being
|
|
1150
|
+
# defined, so `def dependents` asks where `dependents` is defined --
|
|
1151
|
+
# the question the graph answers. Round 331 first let it through as
|
|
1152
|
+
# prose; the keywords are below, each with its own allow control.
|
|
1153
|
+
("def dependents", "deny"),
|
|
1155
1154
|
# a space that is not interior does not join: it cannot be added to
|
|
1156
1155
|
# any pattern to smuggle a bare name past the gate
|
|
1157
1156
|
("dependents ", "deny"),
|
|
@@ -1241,6 +1240,112 @@ def test_a_phrase_is_not_judged_in_a_powershell_search_either(
|
|
|
1241
1240
|
assert _decision(out) == expected, command
|
|
1242
1241
|
|
|
1243
1242
|
|
|
1243
|
+
# ------------------------- a definition is not a phrase (round 331 follow-up) --
|
|
1244
|
+
# The phrase rule excuses a word beside a required space, and `def dependents`
|
|
1245
|
+
# has one, so it was let through as prose. But the word after a definition
|
|
1246
|
+
# keyword is the NAME BEING DEFINED: the search asks where `dependents` is
|
|
1247
|
+
# defined, which is the question the graph answers. So a name that follows a
|
|
1248
|
+
# keyword across a required space is judged as if the space were not there.
|
|
1249
|
+
#
|
|
1250
|
+
# Every keyword has its own allow control, `<keyword>x dependents`: the same
|
|
1251
|
+
# letters, but not the whole word. An implementation that matched a keyword
|
|
1252
|
+
# as a substring, or that dropped the phrase rule altogether, turns that
|
|
1253
|
+
# control red rather than passing every deny arm by accident.
|
|
1254
|
+
|
|
1255
|
+
_DEFINITION_KEYWORDS = (
|
|
1256
|
+
"def", "class", "function", "fn", "func", "struct", "enum", "trait",
|
|
1257
|
+
"impl", "interface", "type", "const", "let", "var",
|
|
1258
|
+
)
|
|
1259
|
+
|
|
1260
|
+
|
|
1261
|
+
@pytest.mark.parametrize("keyword", _DEFINITION_KEYWORDS)
|
|
1262
|
+
def test_the_name_after_a_definition_keyword_is_judged(
|
|
1263
|
+
literal_repo: Path, keyword: str
|
|
1264
|
+
) -> None:
|
|
1265
|
+
out = handle_pre_tool_use(
|
|
1266
|
+
_grep_payload(literal_repo, f"{keyword} dependents", path="src/"), "strict"
|
|
1267
|
+
)
|
|
1268
|
+
|
|
1269
|
+
assert _decision(out) == "deny", keyword
|
|
1270
|
+
|
|
1271
|
+
|
|
1272
|
+
@pytest.mark.parametrize("keyword", _DEFINITION_KEYWORDS)
|
|
1273
|
+
def test_a_word_that_only_contains_a_keyword_is_still_prose(
|
|
1274
|
+
literal_repo: Path, keyword: str
|
|
1275
|
+
) -> None:
|
|
1276
|
+
out = handle_pre_tool_use(
|
|
1277
|
+
_grep_payload(literal_repo, f"{keyword}x dependents", path="src/"), "strict"
|
|
1278
|
+
)
|
|
1279
|
+
|
|
1280
|
+
assert _decision(out) == "allow", keyword
|
|
1281
|
+
|
|
1282
|
+
|
|
1283
|
+
@pytest.mark.parametrize(
|
|
1284
|
+
("pattern", "expected", "fold"),
|
|
1285
|
+
[
|
|
1286
|
+
# the keyword need not start the pattern
|
|
1287
|
+
("async def dependents", "deny", False),
|
|
1288
|
+
("pub fn dependents", "deny", False),
|
|
1289
|
+
("export function dependents", "deny", False),
|
|
1290
|
+
("the def dependents", "deny", False),
|
|
1291
|
+
# a run of spaces, or a tab, is the same required space
|
|
1292
|
+
("def dependents", "deny", False),
|
|
1293
|
+
("def\tdependents", "deny", False),
|
|
1294
|
+
# an escape before the keyword is an operator, not part of the word
|
|
1295
|
+
("\\bdef dependents", "deny", False),
|
|
1296
|
+
# an alternation before the keyword does not hide it
|
|
1297
|
+
("zzqx|def dependents", "deny", False),
|
|
1298
|
+
# the keyword is matched as written unless the search folds case:
|
|
1299
|
+
# `Def dependents` cannot match `def dependents` in code
|
|
1300
|
+
("Def dependents", "allow", False),
|
|
1301
|
+
("DEF dependents", "deny", True),
|
|
1302
|
+
# a keyword AFTER the name defines nothing
|
|
1303
|
+
("dependents def", "allow", False),
|
|
1304
|
+
# a word that ends in a keyword is not the keyword
|
|
1305
|
+
("undef dependents", "allow", False),
|
|
1306
|
+
# the price, stated: prose that happens to put a keyword before a
|
|
1307
|
+
# name this repo defines is refused. The refusal points at the graph,
|
|
1308
|
+
# which can answer it, and refusing is the direction this hook takes.
|
|
1309
|
+
("type check", "deny", False),
|
|
1310
|
+
# a keyword before a word the repo does not define changes nothing
|
|
1311
|
+
("def zzqx", "allow", False),
|
|
1312
|
+
],
|
|
1313
|
+
)
|
|
1314
|
+
def test_a_definition_keyword_is_read_where_it_stands(
|
|
1315
|
+
literal_repo: Path, pattern: str, expected: str, fold: bool
|
|
1316
|
+
) -> None:
|
|
1317
|
+
extra = {"-i": True} if fold else {}
|
|
1318
|
+
out = handle_pre_tool_use(_grep_payload(literal_repo, pattern, path="src/", **extra), "strict")
|
|
1319
|
+
|
|
1320
|
+
assert _decision(out) == expected, pattern
|
|
1321
|
+
|
|
1322
|
+
|
|
1323
|
+
@pytest.mark.parametrize(
|
|
1324
|
+
("command", "expected"),
|
|
1325
|
+
[
|
|
1326
|
+
("grep -rn 'def dependents' src/", "deny"),
|
|
1327
|
+
("grep -rnE 'class dependents' src/", "deny"),
|
|
1328
|
+
("rg 'fn dependents' src/", "deny"),
|
|
1329
|
+
("grep -rn 'defx dependents' src/", "allow"),
|
|
1330
|
+
("Select-String -Pattern 'def dependents' -Path src/", "deny"),
|
|
1331
|
+
("Select-String -Pattern 'defx dependents' -Path src/", "allow"),
|
|
1332
|
+
],
|
|
1333
|
+
)
|
|
1334
|
+
def test_a_definition_keyword_is_read_on_every_route(
|
|
1335
|
+
literal_repo: Path, command: str, expected: str
|
|
1336
|
+
) -> None:
|
|
1337
|
+
"""The shell and PowerShell routes read the same pattern and must reach
|
|
1338
|
+
the same verdict as the Grep tool."""
|
|
1339
|
+
payload = (
|
|
1340
|
+
_ps_payload(literal_repo, command)
|
|
1341
|
+
if command.startswith("Select-String")
|
|
1342
|
+
else _bash_payload(literal_repo, command)
|
|
1343
|
+
)
|
|
1344
|
+
out = handle_pre_tool_use(payload, "strict")
|
|
1345
|
+
|
|
1346
|
+
assert _decision(out) == expected, command
|
|
1347
|
+
|
|
1348
|
+
|
|
1244
1349
|
@pytest.mark.parametrize(
|
|
1245
1350
|
"command",
|
|
1246
1351
|
[
|
|
@@ -71,6 +71,12 @@ def test_json_reports_existence_and_git_status(projects_root: Path, capsys) -> N
|
|
|
71
71
|
|
|
72
72
|
payload = json.loads(capsys.readouterr().out)
|
|
73
73
|
assert code == 0
|
|
74
|
+
# The envelope is pinned, not just the facts in it. A `schema_version`
|
|
75
|
+
# nothing asserted SURVIVED aramid's mutation gate as `1 -> 2`
|
|
76
|
+
# (8aab21c3, 2026-11-05): a caller branching on the version would have
|
|
77
|
+
# read a different contract and no test would have said so.
|
|
78
|
+
assert payload["schema_version"] == 1
|
|
79
|
+
assert payload["ok"] is True
|
|
74
80
|
assert payload["exists"] is True
|
|
75
81
|
assert payload["is_git_repo"] is True
|
|
76
82
|
assert payload["has_protocol"] is True
|
|
@@ -85,6 +91,10 @@ def test_json_distinguishes_a_bare_directory_from_a_channel(projects_root: Path,
|
|
|
85
91
|
code = main(["channel", "--json"])
|
|
86
92
|
|
|
87
93
|
payload = json.loads(capsys.readouterr().out)
|
|
94
|
+
assert payload["schema_version"] == 1
|
|
95
|
+
# `ok` is the one field a caller can gate on, and here it must say no:
|
|
96
|
+
# the directory exists, but without git it is not a channel.
|
|
97
|
+
assert payload["ok"] is False
|
|
88
98
|
assert payload["exists"] is True
|
|
89
99
|
assert payload["is_git_repo"] is False
|
|
90
100
|
assert payload["has_protocol"] is False
|